Skip to content
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

Merged
merged 4 commits into from
Aug 26, 2024

Conversation

braddialpad
Copy link
Contributor

fix(tokens): NO-JIRA move themes to tokens package

Obligatory GIF (super important!)

Obligatory GIF

🛠️ Type Of Change

These types will increment the version number on release:

  • Fix

📖 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:

  • I have ensured no private Dialpad links or info are in the code or pull request description (Dialtone is a public repo!).
  • I have reviewed my changes.
  • I have added all relevant documentation.
  • I have considered the performance impact of my change.

🔮 Next Steps

Release and test in ui-kits and dx-console

@braddialpad braddialpad self-assigned this Aug 26, 2024
@braddialpad braddialpad added the visual-test-ready Add this tag when the PR is ready for visual test, to trigger GHA visual tests label Aug 26, 2024
Copy link
Collaborator

@juliodialpad juliodialpad left a 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
Comment on lines 6 to 17
/**
* 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('');
}

Copy link
Collaborator

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

Copy link
Contributor Author

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?

Copy link
Contributor Author

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.

Comment on lines 18 to 29
/**
* 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('');
}

Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link

✔️ Deploy previews ready!
😎 Dialtone preview: https://dialtone.dialpad.com/deploy-previews/pr-476/
😎 Dialtone-vue 2 preview: https://dialtone.dialpad.com/vue/deploy-previews/pr-476/
😎 Dialtone-vue 3 the preview: https://dialtone.dialpad.com/vue3/deploy-previews/pr-476/

@braddialpad braddialpad merged commit ea8d977 into staging Aug 26, 2024
13 checks passed
@braddialpad braddialpad deleted the migrate-themes-to-package branch August 26, 2024 23:15
juliodialpad pushed a commit that referenced this pull request Aug 26, 2024
# [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))
juliodialpad pushed a commit that referenced this pull request Aug 26, 2024
## [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))
juliodialpad pushed a commit that referenced this pull request Aug 26, 2024
# [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))
juliodialpad pushed a commit that referenced this pull request Aug 26, 2024
# [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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
visual-test-ready Add this tag when the PR is ready for visual test, to trigger GHA visual tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants