@terrazzo/parser 0.8.0 → 0.8.1
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 +9 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/build/index.ts +6 -4
- package/rolldown.config.ts +0 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terrazzo/parser",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Parser/validator for the Design Tokens Community Group (DTCG) standard.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"picocolors": "^1.1.1",
|
|
43
43
|
"scule": "^1.3.0",
|
|
44
44
|
"wildcard-match": "^5.1.4",
|
|
45
|
-
"@terrazzo/token-tools": "^0.8.
|
|
45
|
+
"@terrazzo/token-tools": "^0.8.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"yaml-to-momoa": "^0.0.3"
|
package/src/build/index.ts
CHANGED
|
@@ -42,9 +42,7 @@ function validateTransformParams({
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/**
|
|
46
|
-
* Run build stage
|
|
47
|
-
*/
|
|
45
|
+
/** Run build stage */
|
|
48
46
|
export default async function build(
|
|
49
47
|
tokens: Record<string, TokenNormalized>,
|
|
50
48
|
{ sources, logger = new Logger(), config }: BuildRunnerOptions,
|
|
@@ -53,7 +51,11 @@ export default async function build(
|
|
|
53
51
|
const result: BuildRunnerResult = { outputFiles: [] };
|
|
54
52
|
|
|
55
53
|
function getTransforms(params: TransformParams) {
|
|
56
|
-
|
|
54
|
+
if (!params?.format) {
|
|
55
|
+
logger.warn({ group: 'plugin', message: '"format" missing from getTransforms(), no tokens returned.' });
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
return (formats[params.format!] ?? []).filter((token) => {
|
|
57
59
|
if (params.$type) {
|
|
58
60
|
if (typeof params.$type === 'string' && token.token.$type !== params.$type) {
|
|
59
61
|
return false;
|
package/rolldown.config.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'rolldown';
|
|
2
|
-
import { dts } from 'rolldown-plugin-dts';
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
input: {
|
|
6
|
-
index: './src/index.ts',
|
|
7
|
-
},
|
|
8
|
-
plugins: [dts()],
|
|
9
|
-
external: [
|
|
10
|
-
'@humanwhocodes/mamoa',
|
|
11
|
-
'@terrazzo/token-tools',
|
|
12
|
-
'culori',
|
|
13
|
-
'merge-anything',
|
|
14
|
-
'picocolors',
|
|
15
|
-
'wildcard-match',
|
|
16
|
-
'yaml-to-momoa',
|
|
17
|
-
'yaml',
|
|
18
|
-
],
|
|
19
|
-
output: {
|
|
20
|
-
dir: 'dist',
|
|
21
|
-
format: 'es',
|
|
22
|
-
sourcemap: true,
|
|
23
|
-
},
|
|
24
|
-
});
|