Skip to content

Commit f9a936b

Browse files
BenOsodracIonitron
andauthored
fix(tokens): remove style dictionary scripts and reuse os tokens logic (#30786)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## 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 system and its dependencies, simplifying the process and removing custom scripts in favor of using the latest features of the `outsystems-design-tokens` package. The changes modernize how design tokens are generated and maintained, reducing custom code and leveraging upstream improvements. Key changes include: **Build Process Simplification:** - The custom design token generation scripts (`core/scripts/tokens/index.mjs` and `core/scripts/tokens/utils.mjs`) have been removed. Token generation is now handled directly via the `outsystems-design-tokens` package using an `npx` command in the `build.tokens` script. This reduces maintenance overhead and keeps the build process aligned with upstream best practices. [[1]](diffhunk://#diff-0b9870c62ff80af860467e2541bba0b9ba5e7280b12bea6eeb124b1d174efbcfL1-L188) [[2]](diffhunk://#diff-8b5c339d9dd13300954577213f84a443321a0d6477acd7553787fbcc00ce8cabL1-L320) [[3]](diffhunk://#diff-7f67769260741e2563407af949f7e54fbf0431d1c607933f6e8a8094e3219e26L83-R82) **Dependency Updates:** - Updated `outsystems-design-tokens` to version `1.3.3` and `style-dictionary` to version `5.1.1` in both `package.json` and `package-lock.json`. This ensures compatibility with the latest features and bug fixes and removes the need to specify `style-dictionary` directly as a dependency. [[1]](diffhunk://#diff-4ff996db8bece1eded512c3b97a6bde33622f94bb387634ef32496d832d57744L47-L52) [[2]](diffhunk://#diff-4ff996db8bece1eded512c3b97a6bde33622f94bb387634ef32496d832d57744L9592-R9598) [[3]](diffhunk://#diff-4ff996db8bece1eded512c3b97a6bde33622f94bb387634ef32496d832d57744L11137-R11138) [[4]](diffhunk://#diff-7f67769260741e2563407af949f7e54fbf0431d1c607933f6e8a8094e3219e26L69-L74) **SCSS Utility Import:** - The `@forward "../../foundations/ionic.utility";` statement was removed from `core/src/css/ionic/utils.bundle.ionic.scss`, likely because the utility SCSS is now generated and managed by the new token build process. Removed CSS tests for Ionic theme, as they relied heavily on testing the effect of the utility-classes, that are no longer created on the ionic scope. ## 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 <[email protected]>
1 parent 2b0a423 commit f9a936b

File tree

425 files changed

+332
-4644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

425 files changed

+332
-4644
lines changed

core/package-lock.json

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

core/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@
6666
"fs-extra": "^9.0.1",
6767
"jest": "^29.7.0",
6868
"jest-cli": "^29.7.0",
69-
"outsystems-design-tokens": "^1.3.2",
69+
"outsystems-design-tokens": "^1.3.4",
7070
"prettier": "^2.8.8",
7171
"rollup": "^2.26.4",
7272
"sass": "^1.33.0",
7373
"serve": "^14.0.1",
74-
"style-dictionary": "^5.0.0",
7574
"stylelint": "^13.13.1",
7675
"stylelint-order": "^4.1.0"
7776
},
@@ -80,7 +79,7 @@
8079
"build.css": "npm run css.sass && npm run css.minify",
8180
"build.debug": "npm run clean && stencil build --debug",
8281
"build.docs.json": "stencil build --docs-json dist/docs.json",
83-
"build.tokens": "node ./node_modules/outsystems-design-tokens/scripts/index.js --config ./scripts/tokens/index.mjs && npm run prettier.tokens",
82+
"build.tokens": "npx build.tokens --dest src/foundations/ --root=false --scss=true --scss-file=ionic.vars.scss --scss-prefix=ion --utilities=false && npm run prettier.tokens",
8483
"clean": "node scripts/clean.js",
8584
"css.minify": "cleancss -O2 -o ./css/ionic.bundle.css ./css/ionic.bundle.css",
8685
"css.sass": "sass --embed-sources --style compressed src/css:./css",

core/scripts/testing/scripts.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@
4848
document.head.appendChild(linkTag);
4949
}
5050

51+
const utilsBundleLinkTag = document.querySelector('link[href*="css/utils.bundle.css"]');
52+
if (!utilsBundleLinkTag) {
53+
const linkTag = document.createElement('link');
54+
linkTag.setAttribute('rel', 'stylesheet');
55+
linkTag.setAttribute('type', 'text/css');
56+
linkTag.setAttribute('href', '/css/utils.bundle.css');
57+
document.head.appendChild(linkTag);
58+
}
59+
5160
const defaultThemeLinkTag = document.querySelector('link[href*="css/ionic.bundle.css"]');
5261
if (defaultThemeLinkTag) {
5362
defaultThemeLinkTag.remove();

core/scripts/tokens/index.mjs

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

0 commit comments

Comments
 (0)