@terrazzo/parser 0.2.1 → 0.2.2
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +9 -0
- package/dist/logger.js +6 -6
- package/dist/logger.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/package.json +2 -2
- package/src/logger.ts +6 -6
- package/src/types.ts +3 -3
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @terrazzo/parser
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#364](https://github.com/terrazzoapp/terrazzo/pull/364) [`27cc92e`](https://github.com/terrazzoapp/terrazzo/commit/27cc92ef5e9e187b5ec7a8abe3f23bc51f59fc9c) Thanks [@drwpow](https://github.com/drwpow)! - Add init CLI options
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`27cc92e`](https://github.com/terrazzoapp/terrazzo/commit/27cc92ef5e9e187b5ec7a8abe3f23bc51f59fc9c)]:
|
|
10
|
+
- @terrazzo/token-tools@0.2.2
|
|
11
|
+
|
|
3
12
|
## 0.2.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/logger.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import pc from 'picocolors';
|
|
2
2
|
import wcmatch from 'wildcard-match';
|
|
3
3
|
import { codeFrameColumns } from './lib/code-frame.js';
|
|
4
4
|
export const LOG_ORDER = ['error', 'warn', 'info', 'debug'];
|
|
5
|
-
const DEBUG_GROUP_COLOR = { core:
|
|
6
|
-
const MESSAGE_COLOR = { error:
|
|
5
|
+
const DEBUG_GROUP_COLOR = { core: pc.green, plugin: pc.magenta };
|
|
6
|
+
const MESSAGE_COLOR = { error: pc.red, warn: pc.yellow };
|
|
7
7
|
const timeFormatter = new Intl.DateTimeFormat('en-gb', { timeStyle: 'medium' });
|
|
8
8
|
/**
|
|
9
9
|
* @param {Entry} entry
|
|
@@ -13,7 +13,7 @@ const timeFormatter = new Intl.DateTimeFormat('en-gb', { timeStyle: 'medium' });
|
|
|
13
13
|
export function formatMessage(entry, severity) {
|
|
14
14
|
let message = entry.message;
|
|
15
15
|
if (entry.label) {
|
|
16
|
-
message = `${
|
|
16
|
+
message = `${pc.bold(`${entry.label}:`)} ${message}`;
|
|
17
17
|
}
|
|
18
18
|
if (severity in MESSAGE_COLOR) {
|
|
19
19
|
message = MESSAGE_COLOR[severity](message);
|
|
@@ -90,7 +90,7 @@ export default class Logger {
|
|
|
90
90
|
if (this.debugScope !== '*' && !wcmatch(this.debugScope)(debugPrefix)) {
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
message = `${(DEBUG_GROUP_COLOR[entry.group] ||
|
|
93
|
+
message = `${(DEBUG_GROUP_COLOR[entry.group] || pc.white)(debugPrefix)} ${pc.dim(timeFormatter.format(new Date()))} ${message}`;
|
|
94
94
|
if (typeof entry.timing === 'number') {
|
|
95
95
|
let timing = Math.round(entry.timing);
|
|
96
96
|
if (timing < 1_000) {
|
|
@@ -99,7 +99,7 @@ export default class Logger {
|
|
|
99
99
|
else if (timing < 60_000) {
|
|
100
100
|
timing = `${Math.round(timing * 100) / 100_000}s`;
|
|
101
101
|
}
|
|
102
|
-
message = `${message} ${
|
|
102
|
+
message = `${message} ${pc.dim(`[${timing}]`)}`;
|
|
103
103
|
}
|
|
104
104
|
// biome-ignore lint/suspicious/noConsoleLog: this is its job
|
|
105
105
|
console.log(message);
|
package/dist/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AACA,OAAO,EAA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MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -67,11 +67,11 @@ export interface ConfigInit {
|
|
|
67
67
|
plugins: Plugin[];
|
|
68
68
|
lint: {
|
|
69
69
|
build: NonNullable<NonNullable<Config['lint']>['build']>;
|
|
70
|
-
rules: Record<string,
|
|
70
|
+
rules: Record<string, LintRuleLonghand>;
|
|
71
71
|
};
|
|
72
72
|
ignore: {
|
|
73
|
-
tokens:
|
|
74
|
-
deprecated:
|
|
73
|
+
tokens: NonNullable<NonNullable<Config['ignore']>['tokens']>;
|
|
74
|
+
deprecated: NonNullable<NonNullable<Config['ignore']>['deprecated']>;
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
export interface ConfigOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terrazzo/parser",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Parser/validator for the Design Tokens Community Group (DTCG) standard.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"scule": "^1.3.0",
|
|
41
41
|
"wildcard-match": "^5.1.3",
|
|
42
42
|
"yaml": "^2.6.1",
|
|
43
|
-
"@terrazzo/token-tools": "^0.2.
|
|
43
|
+
"@terrazzo/token-tools": "^0.2.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"esbuild": "^0.23.1",
|
package/src/logger.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnyNode } from '@humanwhocodes/momoa';
|
|
2
|
-
import
|
|
2
|
+
import pc from 'picocolors';
|
|
3
3
|
import wcmatch from 'wildcard-match';
|
|
4
4
|
import { codeFrameColumns } from './lib/code-frame.js';
|
|
5
5
|
|
|
@@ -43,9 +43,9 @@ export interface DebugEntry {
|
|
|
43
43
|
timing?: number;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
const DEBUG_GROUP_COLOR: Record<string, typeof
|
|
46
|
+
const DEBUG_GROUP_COLOR: Record<string, typeof pc.red | undefined> = { core: pc.green, plugin: pc.magenta };
|
|
47
47
|
|
|
48
|
-
const MESSAGE_COLOR: Record<string, typeof
|
|
48
|
+
const MESSAGE_COLOR: Record<string, typeof pc.red | undefined> = { error: pc.red, warn: pc.yellow };
|
|
49
49
|
|
|
50
50
|
const timeFormatter = new Intl.DateTimeFormat('en-gb', { timeStyle: 'medium' });
|
|
51
51
|
|
|
@@ -57,7 +57,7 @@ const timeFormatter = new Intl.DateTimeFormat('en-gb', { timeStyle: 'medium' });
|
|
|
57
57
|
export function formatMessage(entry: LogEntry, severity: LogSeverity) {
|
|
58
58
|
let message = entry.message;
|
|
59
59
|
if (entry.label) {
|
|
60
|
-
message = `${
|
|
60
|
+
message = `${pc.bold(`${entry.label}:`)} ${message}`;
|
|
61
61
|
}
|
|
62
62
|
if (severity in MESSAGE_COLOR) {
|
|
63
63
|
message = MESSAGE_COLOR[severity]!(message);
|
|
@@ -142,7 +142,7 @@ export default class Logger {
|
|
|
142
142
|
if (this.debugScope !== '*' && !wcmatch(this.debugScope)(debugPrefix)) {
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
|
-
message = `${(DEBUG_GROUP_COLOR[entry.group] ||
|
|
145
|
+
message = `${(DEBUG_GROUP_COLOR[entry.group] || pc.white)(debugPrefix)} ${pc.dim(
|
|
146
146
|
timeFormatter.format(new Date()),
|
|
147
147
|
)} ${message}`;
|
|
148
148
|
if (typeof entry.timing === 'number') {
|
|
@@ -152,7 +152,7 @@ export default class Logger {
|
|
|
152
152
|
} else if (timing < 60_000) {
|
|
153
153
|
timing = `${Math.round(timing * 100) / 100_000}s`;
|
|
154
154
|
}
|
|
155
|
-
message = `${message} ${
|
|
155
|
+
message = `${message} ${pc.dim(`[${timing}]`)}`;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
// biome-ignore lint/suspicious/noConsoleLog: this is its job
|
package/src/types.ts
CHANGED
|
@@ -75,11 +75,11 @@ export interface ConfigInit {
|
|
|
75
75
|
plugins: Plugin[];
|
|
76
76
|
lint: {
|
|
77
77
|
build: NonNullable<NonNullable<Config['lint']>['build']>;
|
|
78
|
-
rules: Record<string,
|
|
78
|
+
rules: Record<string, LintRuleLonghand>;
|
|
79
79
|
};
|
|
80
80
|
ignore: {
|
|
81
|
-
tokens:
|
|
82
|
-
deprecated:
|
|
81
|
+
tokens: NonNullable<NonNullable<Config['ignore']>['tokens']>;
|
|
82
|
+
deprecated: NonNullable<NonNullable<Config['ignore']>['deprecated']>;
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
|