@terrazzo/parser 0.0.7 → 0.0.9
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/LICENSE +2 -2
- package/config.d.ts +1 -1
- package/package.json +23 -19
- package/parse/index.js +4 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2024 Drew Powers
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/config.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface Config {
|
|
|
13
13
|
lint?: {
|
|
14
14
|
/** Configure build behavior */
|
|
15
15
|
build?: {
|
|
16
|
-
/** Should linters run with `
|
|
16
|
+
/** Should linters run with `tz build`? (default: true) */
|
|
17
17
|
enabled?: boolean;
|
|
18
18
|
};
|
|
19
19
|
/** Configure lint rules */
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terrazzo/parser",
|
|
3
|
+
"version": "0.0.9",
|
|
3
4
|
"description": "Parser/validator for the Design Tokens Community Group (DTCG) standard.",
|
|
4
|
-
"
|
|
5
|
+
"type": "module",
|
|
5
6
|
"author": {
|
|
6
7
|
"name": "Drew Powers",
|
|
7
8
|
"email": "drew@pow.rs"
|
|
8
9
|
},
|
|
9
10
|
"keywords": [
|
|
10
11
|
"design tokens",
|
|
11
|
-
"design tokens community group",
|
|
12
|
-
"design tokens format module",
|
|
13
12
|
"dtcg",
|
|
14
13
|
"cli",
|
|
15
|
-
"w3c
|
|
14
|
+
"w3c",
|
|
16
15
|
"design system",
|
|
17
16
|
"typescript",
|
|
18
17
|
"sass",
|
|
@@ -22,23 +21,28 @@
|
|
|
22
21
|
"linting",
|
|
23
22
|
"lint"
|
|
24
23
|
],
|
|
25
|
-
"license": "MIT",
|
|
26
|
-
"type": "module",
|
|
27
24
|
"main": "./index.js",
|
|
25
|
+
"homepage": "https://terrazzoapp.com/docs/cli/api/js",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/terrazzoapp/terrazzo.git",
|
|
29
|
+
"directory": "./packages/parser/"
|
|
30
|
+
},
|
|
31
|
+
"license": "MIT",
|
|
28
32
|
"dependencies": {
|
|
29
|
-
"@babel/code-frame": "^7.24",
|
|
30
|
-
"@humanwhocodes/momoa": "^3.
|
|
31
|
-
"@types/babel__code-frame": "^7.0",
|
|
32
|
-
"@types/culori": "^2.1",
|
|
33
|
-
"@types/deep-equal": "^1.0",
|
|
34
|
-
"culori": "^4.0",
|
|
35
|
-
"deep-equal": "^2.2",
|
|
36
|
-
"is-what": "^4.1",
|
|
37
|
-
"merge-anything": "^5.1",
|
|
38
|
-
"picocolors": "^1.0",
|
|
39
|
-
"wildcard-match": "^5.1",
|
|
40
|
-
"yaml": "^2.4",
|
|
41
|
-
"@terrazzo/token-tools": "^0.0.
|
|
33
|
+
"@babel/code-frame": "^7.24.7",
|
|
34
|
+
"@humanwhocodes/momoa": "^3.1.1",
|
|
35
|
+
"@types/babel__code-frame": "^7.0.6",
|
|
36
|
+
"@types/culori": "^2.1.1",
|
|
37
|
+
"@types/deep-equal": "^1.0.4",
|
|
38
|
+
"culori": "^4.0.1",
|
|
39
|
+
"deep-equal": "^2.2.3",
|
|
40
|
+
"is-what": "^4.1.16",
|
|
41
|
+
"merge-anything": "^5.1.7",
|
|
42
|
+
"picocolors": "^1.0.1",
|
|
43
|
+
"wildcard-match": "^5.1.3",
|
|
44
|
+
"yaml": "^2.4.5",
|
|
45
|
+
"@terrazzo/token-tools": "^0.0.4"
|
|
42
46
|
},
|
|
43
47
|
"scripts": {
|
|
44
48
|
"lint": "biome check .",
|
package/parse/index.js
CHANGED
|
@@ -193,7 +193,7 @@ export default async function parse(input, { logger = new Logger(), skipLint = f
|
|
|
193
193
|
if (members.$value) {
|
|
194
194
|
node = members.$value;
|
|
195
195
|
}
|
|
196
|
-
logger.error({ message: err.message, source, node });
|
|
196
|
+
logger.error({ message: err.message, source, node, continueOnError: true });
|
|
197
197
|
}
|
|
198
198
|
for (const mode in tokens[id].mode) {
|
|
199
199
|
if (mode === '.') {
|
|
@@ -207,7 +207,7 @@ export default async function parse(input, { logger = new Logger(), skipLint = f
|
|
|
207
207
|
if (members.$value) {
|
|
208
208
|
node = members.$value;
|
|
209
209
|
}
|
|
210
|
-
logger.error({ message: err.message, source, node: tokens[id].mode[mode].sourceNode });
|
|
210
|
+
logger.error({ message: err.message, source, node: tokens[id].mode[mode].sourceNode, continueOnError: true });
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
}
|
|
@@ -302,10 +302,10 @@ export function maybeJSONString(input) {
|
|
|
302
302
|
export function resolveAlias(alias, { tokens, logger, source, node, scanned = [] }) {
|
|
303
303
|
const { id } = parseAlias(alias);
|
|
304
304
|
if (!tokens[id]) {
|
|
305
|
-
logger.error({ message: `Alias "${alias}" not found`, source, node });
|
|
305
|
+
logger.error({ message: `Alias "${alias}" not found`, source, node, continueOnError: true });
|
|
306
306
|
}
|
|
307
307
|
if (scanned.includes(id)) {
|
|
308
|
-
logger.error({ message: `Circular alias detected from "${alias}"`, source, node });
|
|
308
|
+
logger.error({ message: `Circular alias detected from "${alias}"`, source, node, continueOnError: true });
|
|
309
309
|
}
|
|
310
310
|
const token = tokens[id];
|
|
311
311
|
if (!isAlias(token.$value)) {
|