@terrazzo/cli 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @terrazzo/cli
|
|
2
2
|
|
|
3
|
+
## 0.6.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#443](https://github.com/terrazzoapp/terrazzo/pull/443) [`8cc558f`](https://github.com/terrazzoapp/terrazzo/commit/8cc558ff98cef4eb36240918aa594905dfeb11ee) Thanks [@drwpow](https://github.com/drwpow)! - Bugfix: allow resolving from node_modules in @terrazzo/cli (note: @terrazzo/parser/JS API still runs in browser, so it still can’t resolve npm modules).
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`8cc558f`](https://github.com/terrazzoapp/terrazzo/commit/8cc558ff98cef4eb36240918aa594905dfeb11ee)]:
|
|
10
|
+
- @terrazzo/parser@0.6.3
|
|
11
|
+
- @terrazzo/token-tools@0.6.3
|
|
12
|
+
|
|
3
13
|
## 0.6.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,UAAU,EAAoC,MAAM,kBAAkB,CAAC;AAKlG,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGlD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAwBvD"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
1
2
|
import { defineConfig as defineConfigCore } from '@terrazzo/parser';
|
|
2
3
|
import { cwd } from './shared.js';
|
|
4
|
+
const require = createRequire(cwd);
|
|
5
|
+
// wrap defineConfig from @terrazzo/parser and add Node.js resolution
|
|
3
6
|
export function defineConfig(config) {
|
|
4
|
-
|
|
7
|
+
const normalizedConfig = { ...config }; // note: we only need a shallow copy because we’re only mutating top-level `tokens`
|
|
8
|
+
// Resolve tokens from npm modules, if any
|
|
9
|
+
if (typeof normalizedConfig.tokens === 'string' || Array.isArray(normalizedConfig.tokens)) {
|
|
10
|
+
normalizedConfig.tokens = (Array.isArray(normalizedConfig.tokens) ? normalizedConfig.tokens : [normalizedConfig.tokens]).map((tokenPath) => {
|
|
11
|
+
if (tokenPath.startsWith('.') || /^(https?|file):\/\//i.test(tokenPath)) {
|
|
12
|
+
return tokenPath;
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
return new URL(`file://${require.resolve(tokenPath)}`);
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
console.error(err);
|
|
19
|
+
// this will throw an error if Node couldn’t automatically resolve it,
|
|
20
|
+
// which will be true for many token paths. We don’t need to surface
|
|
21
|
+
// that error; it’ll get its own error down the line if it’s a bad path.
|
|
22
|
+
return tokenPath;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return defineConfigCore(normalizedConfig, { cwd });
|
|
5
27
|
}
|
|
6
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,YAAY,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;
|
|
1
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AO,gBAAgB,CAAC,gBAAgB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terrazzo/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "CLI for managing design tokens using the Design Tokens Community Group (DTCG) standard and generating code for any platform via plugins.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"meriyah": "^6.0.5",
|
|
52
52
|
"picocolors": "^1.1.1",
|
|
53
53
|
"yaml-to-momoa": "^0.0.3",
|
|
54
|
-
"@terrazzo/parser": "^0.6.
|
|
55
|
-
"@terrazzo/token-tools": "^0.6.
|
|
54
|
+
"@terrazzo/parser": "^0.6.3",
|
|
55
|
+
"@terrazzo/token-tools": "^0.6.3"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsc -p tsconfig.build.json",
|