Skip to content

Commit 9f546ed

Browse files
BenOsodracIonitron
andauthored
feat(tokens): modernize scripts and change prefix to token (#30666)
Issue number: internal --------- ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> This pull request updates the design token build pipeline to support Style Dictionary v5 and modernizes the scripts by migrating them to ES modules. The changes ensure compatibility with the latest dependencies and improve maintainability by refactoring the build scripts and utilities. **Dependency and Build Pipeline Updates:** * Upgraded `outsystems-design-tokens` to version `^1.3.2` and `style-dictionary` to version `^5.0.0` in `package.json` to support the latest features and fixes. * Updated the `build.tokens` npm script to use the new ES module entry point (`index.mjs`) instead of the old CommonJS file (`index.js`). **Migration to ES Modules:** * Migrated the main design token build script from `index.js` to `index.mjs`, refactoring imports/exports and adjusting to Style Dictionary v5 API changes. [[1]](diffhunk://#diff-80accbbc258884565c215c7eb6280722805ddf618d72bf6506c7dd1fb7faaa54L1-L201) [[2]](diffhunk://#diff-0b9870c62ff80af860467e2541bba0b9ba5e7280b12bea6eeb124b1d174efbcfR1-R194) * Renamed and refactored the utility functions file from `utils.js` to `utils.mjs`, converting all utility functions to ES module exports for compatibility. [[1]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL4-R10) [[2]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL22-R22) [[3]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL47-R53) [[4]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL65-R65) [[5]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL76-R76) [[6]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL85-R85) [[7]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL95-R95) [[8]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL118-R118) [[9]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL144-R144) [[10]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL155-R155) [[11]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL221-R221) **Style Dictionary Configuration and Output Improvements:** * Adjusted the Style Dictionary configuration and format registration to match the new API, including changes to file header handling and output structure for SCSS variables and utility classes. * Changed variable prefix to --token ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> --------- Co-authored-by: ionitron <hi@ionicframework.com>
1 parent b2f4d4a commit 9f546ed

12 files changed

+1998
-1906
lines changed

core/package-lock.json

Lines changed: 536 additions & 415 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@
6666
"fs-extra": "^9.0.1",
6767
"jest": "^29.7.0",
6868
"jest-cli": "^29.7.0",
69-
"outsystems-design-tokens": "^1.3.0",
69+
"outsystems-design-tokens": "^1.3.2",
7070
"prettier": "^2.8.8",
7171
"rollup": "^2.26.4",
7272
"sass": "^1.33.0",
7373
"serve": "^14.0.1",
74-
"style-dictionary": "^4.1.3",
74+
"style-dictionary": "^5.0.0",
7575
"stylelint": "^13.13.1",
7676
"stylelint-order": "^4.1.0"
7777
},
@@ -80,7 +80,7 @@
8080
"build.css": "npm run css.sass && npm run css.minify",
8181
"build.debug": "npm run clean && stencil build --debug",
8282
"build.docs.json": "stencil build --docs-json dist/docs.json",
83-
"build.tokens": "npx build.tokens --config scripts/tokens/index.js && npm run prettier.tokens",
83+
"build.tokens": "npx build.tokens --config scripts/tokens/index.mjs && npm run prettier.tokens",
8484
"clean": "node scripts/clean.js",
8585
"css.minify": "cleancss -O2 -o ./css/ionic.bundle.css ./css/ionic.bundle.css",
8686
"css.sass": "sass --embed-sources --style compressed src/css:./css",

core/scripts/tokens/index.js

Lines changed: 0 additions & 201 deletions
This file was deleted.

0 commit comments

Comments
 (0)