Comments (5)
I have experienced the same issue. In my case, it was related to executing on a windows machine, rather than a posix system.
I found that custom parsers were not firing either, and style-dictionary was unable to locate the source token files. Style-dictionary itself seems to be expecting a posix glob pattern (see https://github.com/amzn/style-dictionary/blob/main/lib/utils/combineJSON.js - combineJSON) function. However, on a windows machine, the @nxkit/style-dictionary executor is calling path.resolve(...), which produces a Windows style path, causing style dictionaries glob to not return results.
from nxkit.
I used the following within the executor's normalizeConfig section to convert "source" from a windows path to a posix path, and it seemed to work for my case, however I'm not sure if this is the correct solution.
.split(path.sep).join(path.posix.sep)
from nxkit.
I made a little script to patch the lib while the proper fix is being worked on.
const { readFileSync, writeFileSync } = require('node:fs');
const badCode = 'require("path")';
const badFile =
'node_modules/@nxkit/style-dictionary/src/executors/build/lib/normalize-config.js';
const badContents = readFileSync(badFile, 'utf8');
const goodCode = 'require("path/posix")';
if (badContents.includes(badCode)) {
const goodContents = badContents.replace(badCode, goodCode);
writeFileSync(badFile, goodContents, 'utf8');
console.log('Patched');
} else {
console.log('No changes needed');
}
Using a prepare
target, it runs whenever style dictionary needs to build.
"prepare": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "node tools/patch-nxkit-style-dictionary.js"
}
]
}
},
"build": {
"dependsOn": ["prepare"],
"executor": "@nxkit/style-dictionary:build",
...
},
from nxkit.
@allcontributors add @astrodomas for bug
from nxkit.
I've put up a pull request to add @astrodomas! 🎉
from nxkit.
Related Issues (20)
- Expose plugins API's for programatic use.
- Add playwright plugin preset
- Add style directory plugin preset
- Style Dictionary extension generators override existing files HOT 1
- Playwright component testing support
- Playwright: dirname for generated projects not consistent for nested frontend projects HOT 1
- Rename directory's -d alias as this is reserved by Nx for --dryRun
- Playwright: rename project option as is reserved by Nx
- Playwright: remove playwright.base.config.ts from workspace root
- Style Dictionary: cannot generate project with complete preset in subdir
- Playwright project.json outputPath and actual path of output don't match HOT 2
- Multi brand / theme support on Style Dictionary config HOT 2
- Style-Dictionary: Support generating output in different paths, and optionally, for different configs.
- Error while running `nx generate @nxkit/playwright:project` command HOT 2
- Create project doesn't work HOT 3
- Style-Dictionary: Clean build path directories before generating files.
- Include @nx/devkit as a dependency HOT 3
- How to delete previous output before new build
- Can't create style-dictionary library with nx 17 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nxkit.