-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tokens): NO-JIRA move themes to tokens package #476
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple minor comments, please address them before merging, otherwise, looks good.
common/utils.js
Outdated
/** | ||
* Transform a string from kebab-case to PascalCase | ||
* @param string | ||
* @returns {string} | ||
*/ | ||
export function kebabCaseToPascalCase (string) { | ||
return string?.toLowerCase() | ||
.split('-') | ||
.map(word => word.charAt(0).toUpperCase() + word.slice(1)) | ||
.join(''); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your linter did this, right? this is being used on icon component IIRC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get this...
import { kebabCaseToPascalCase } from '../../common/utils.js';
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'kebabCaseToPascalCase' not found. The requested module '../../common/utils.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '../../common/utils.js';
const { kebabCaseToPascalCase } = pkg;
Do we need to rename this to utils.mjs since package.json is not type: "module" anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this as I mentioned above, seems to have fixed it.
/** | ||
* Transform a string from kebab-case to PascalCase | ||
* @param string | ||
* @returns {string} | ||
*/ | ||
function kebabCaseToPascalCase (string) { | ||
return string?.toLowerCase() | ||
.split('-') | ||
.map(word => word.charAt(0).toUpperCase() + word.slice(1)) | ||
.join(''); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why moving it to this file? I think that utility it's more general than just for build-sd-transforms, don't you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved back with .mjs
change mentioned above.
✔️ Deploy previews ready! |
# [9.70.0](dialtone/v9.69.1...dialtone/v9.70.0) (2024-08-26) ### Bug Fixes * NO-JIRA eslint documentation links ([#472](#472)) ([32f606b](32f606b)) * **Tokens:** NO-JIRA move themes to tokens package ([#476](#476)) ([ea8d977](ea8d977)) ### Features * **Contact Row:** NO-JIRA add `avatarColor` prop to contact row recipe ([#469](#469)) ([f0be39d](f0be39d)) * DP-108555 change prop type in contact centers recipe component ([#471](#471)) ([f45f302](f45f302)) ### Reverts * Revert "chore(release): NO-JIRA eslint-plugin-dialtone/v1.1.0" ([22736cb](22736cb))
## [1.34.2](dialtone-tokens/v1.34.1...dialtone-tokens/v1.34.2) (2024-08-26) ### Bug Fixes * **Tokens:** NO-JIRA move themes to tokens package ([#476](#476)) ([ea8d977](ea8d977))
# [2.157.0](dialtone-vue2/v2.156.1...dialtone-vue2/v2.157.0) (2024-08-26) ### Bug Fixes * **Tokens:** NO-JIRA move themes to tokens package ([#476](#476)) ([ea8d977](ea8d977)) ### Features * **Contact Row:** NO-JIRA add `avatarColor` prop to contact row recipe ([#469](#469)) ([f0be39d](f0be39d)) * DP-108555 change prop type in contact centers recipe component ([#471](#471)) ([f45f302](f45f302))
# [3.150.0](dialtone-vue3/v3.149.1...dialtone-vue3/v3.150.0) (2024-08-26) ### Bug Fixes * **Tokens:** NO-JIRA move themes to tokens package ([#476](#476)) ([ea8d977](ea8d977)) ### Features * **Contact Row:** NO-JIRA add `avatarColor` prop to contact row recipe ([#469](#469)) ([f0be39d](f0be39d)) * DP-108555 change prop type in contact centers recipe component ([#471](#471)) ([f45f302](f45f302))
fix(tokens): NO-JIRA move themes to tokens package
Obligatory GIF (super important!)
🛠️ Type Of Change
These types will increment the version number on release:
📖 Description
Moved the new theme logic and configuration to the tokens package instead of the root. Removed type: module from the root.
💡 Context
This change was causing all kinds of issues with imports on ES6 repos, due to
type: "module"
. Needed to be moved to a sub package.📝 Checklist
For all PRs:
🔮 Next Steps
Release and test in ui-kits and dx-console