@kanso-labs/unplugin-style-dictionary 0.10.36 → 0.10.38
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/dist/colour.js +1 -2
- package/dist/compile.js +1 -2
- package/dist/config.js +1 -2
- package/dist/errors.js +1 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -2
- package/dist/options.js +1 -2
- package/dist/patterns.js +1 -2
- package/dist/rolldown.d.ts +0 -2
- package/dist/rolldown.js +1 -2
- package/dist/rollup.d.ts +0 -2
- package/dist/rollup.js +1 -2
- package/dist/rspack.d.ts +0 -2
- package/dist/rspack.js +1 -2
- package/dist/scheduler.js +1 -2
- package/dist/size-report.js +1 -2
- package/dist/types.d.ts +0 -2
- package/dist/up-to-date.js +1 -2
- package/dist/vite.d.ts +0 -2
- package/dist/vite.js +1 -2
- package/dist/watch-filter.js +1 -2
- package/dist/webpack.d.ts +0 -2
- package/dist/webpack.js +1 -2
- package/package.json +3 -3
package/dist/colour.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/colour.ts
|
|
2
2
|
function colourAllowed(stream) {
|
|
3
3
|
if (process.env.NO_COLOR) return false;
|
|
4
4
|
const forced = process.env.FORCE_COLOR;
|
|
@@ -10,7 +10,6 @@ function colourAllowed(stream) {
|
|
|
10
10
|
function paint(code, value, allowed) {
|
|
11
11
|
return allowed ? `\u001B[${code}m${value}\u001B[0m` : value;
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
export { colourAllowed, paint };
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=colour.js.map
|
package/dist/compile.js
CHANGED
|
@@ -6,7 +6,7 @@ import { configFingerprint, declaredDestinations, isUpToDate, newestSourceOf, re
|
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import StyleDictionary from "style-dictionary";
|
|
9
|
-
|
|
9
|
+
// src/compile.ts
|
|
10
10
|
async function runBuilds(instance, resolvedConfigs, context) {
|
|
11
11
|
const { cache, destinationRecords, failOnError, generatedDestinations, log, logTable, notifyBuildOutcome, onBuildEnd, onBuildError, onBuildStart, persistedRecordFiles, platformsOption, quiet, report, verbosity, volume, watch } = instance;
|
|
12
12
|
const root = instance.root();
|
|
@@ -153,7 +153,6 @@ function platformsFor(platformsOption, context) {
|
|
|
153
153
|
if (Array.isArray(platformsOption)) return platformsOption;
|
|
154
154
|
return context === void 0 ? platformsOption.build : platformsOption.watch;
|
|
155
155
|
}
|
|
156
|
-
//#endregion
|
|
157
156
|
export { runBuilds };
|
|
158
157
|
|
|
159
158
|
//# sourceMappingURL=compile.js.map
|
package/dist/config.js
CHANGED
|
@@ -4,7 +4,7 @@ import path from "node:path";
|
|
|
4
4
|
import StyleDictionary from "style-dictionary";
|
|
5
5
|
import JSON5 from "json5";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
|
-
|
|
7
|
+
// src/config.ts
|
|
8
8
|
const IMPORTED_CONFIG_EXTENSIONS = [
|
|
9
9
|
".js",
|
|
10
10
|
".mjs",
|
|
@@ -159,7 +159,6 @@ function withTokenModuleParser(config) {
|
|
|
159
159
|
parsers: [...applied, TOKEN_MODULE_PARSER]
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
//#endregion
|
|
163
162
|
export { configForBuild, describeConfig, readConfigObject, resolveConfigOption };
|
|
164
163
|
|
|
165
164
|
//# sourceMappingURL=config.js.map
|
package/dist/errors.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
// src/errors.ts
|
|
2
2
|
function asError(error) {
|
|
3
3
|
return error instanceof Error ? error : new Error(errorMessage(error));
|
|
4
4
|
}
|
|
5
5
|
function errorMessage(error) {
|
|
6
6
|
return error instanceof Error ? error.message : String(error);
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
export { asError, errorMessage };
|
|
10
9
|
|
|
11
10
|
//# sourceMappingURL=errors.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { StyleDictionaryConfigContext, UnpluginStyleDictionaryOptions } from "./types.js";
|
|
2
|
-
//#region src/index.d.ts
|
|
3
2
|
export declare const unplugin: import("unplugin").UnpluginInstance<UnpluginStyleDictionaryOptions | undefined, false>;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { type StyleDictionaryConfigContext, type UnpluginStyleDictionaryOptions, unplugin as default };
|
|
6
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { compileWatchPatterns, isWatchedSource, matchesWatchedFile, registeredSp
|
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import { createUnplugin } from "unplugin";
|
|
12
|
-
|
|
12
|
+
// src/index.ts
|
|
13
13
|
function appendChokidarIgnored(watch, negations) {
|
|
14
14
|
if (negations.length === 0) return;
|
|
15
15
|
const chokidar = Reflect.get(watch, "chokidar");
|
|
@@ -757,7 +757,6 @@ const unpluginFactory = (options = {}, meta) => {
|
|
|
757
757
|
};
|
|
758
758
|
};
|
|
759
759
|
const unplugin = /* #__PURE__ */ createUnplugin(unpluginFactory);
|
|
760
|
-
//#endregion
|
|
761
760
|
export { unplugin as default, unplugin };
|
|
762
761
|
|
|
763
762
|
//# sourceMappingURL=index.js.map
|
package/dist/options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inspect } from "node:util";
|
|
2
|
-
|
|
2
|
+
// src/options.ts
|
|
3
3
|
const FAIL_ON_ERROR = /* @__PURE__ */ new Set([
|
|
4
4
|
"build",
|
|
5
5
|
false,
|
|
@@ -34,7 +34,6 @@ function read(options, key) {
|
|
|
34
34
|
function reject(name, accepts, received) {
|
|
35
35
|
throw new TypeError(`[unplugin-style-dictionary] The ${name} option must be ${accepts}, and was ${inspect(received)}.`);
|
|
36
36
|
}
|
|
37
|
-
//#endregion
|
|
38
37
|
export { checkOptions };
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=options.js.map
|
package/dist/patterns.js
CHANGED
|
@@ -3,7 +3,7 @@ import { readConfigObject } from "./config.js";
|
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { escapePath, glob } from "tinyglobby";
|
|
6
|
-
|
|
6
|
+
// src/patterns.ts
|
|
7
7
|
const GLOB_CHARACTERS = /[!*?[\]{}]/;
|
|
8
8
|
async function expandPatterns({ globs, literals }, log) {
|
|
9
9
|
const paths = new Set(literals);
|
|
@@ -90,7 +90,6 @@ function staticParentOf(pattern) {
|
|
|
90
90
|
const firstGlob = segments.findIndex((segment) => GLOB_CHARACTERS.test(segment.replace(/\\./g, "")));
|
|
91
91
|
return (firstGlob === -1 ? path.posix.dirname(pattern) : segments.slice(0, firstGlob).join("/")).replace(/\\(.)/g, "$1");
|
|
92
92
|
}
|
|
93
|
-
//#endregion
|
|
94
93
|
export { expandPatterns, patternsMatchingNothing, realpathOf, sourcePatternsOf, watchOptionPatterns, watchPatternsOf };
|
|
95
94
|
|
|
96
95
|
//# sourceMappingURL=patterns.js.map
|
package/dist/rolldown.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { StyleDictionaryConfigContext, UnpluginStyleDictionaryOptions } from "./types.js";
|
|
2
|
-
//#region src/rolldown.d.ts
|
|
3
2
|
declare const _default: (options?: UnpluginStyleDictionaryOptions | undefined) => import("rolldown").Plugin<any>;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { type StyleDictionaryConfigContext, type UnpluginStyleDictionaryOptions, _default as default };
|
|
6
4
|
//# sourceMappingURL=rolldown.d.ts.map
|
package/dist/rolldown.js
CHANGED
package/dist/rollup.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { StyleDictionaryConfigContext, UnpluginStyleDictionaryOptions } from "./types.js";
|
|
2
|
-
//#region src/rollup.d.ts
|
|
3
2
|
declare const _default: (options?: UnpluginStyleDictionaryOptions | undefined) => import("rollup").Plugin<any>;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { type StyleDictionaryConfigContext, type UnpluginStyleDictionaryOptions, _default as default };
|
|
6
4
|
//# sourceMappingURL=rollup.d.ts.map
|
package/dist/rollup.js
CHANGED
package/dist/rspack.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { StyleDictionaryConfigContext, UnpluginStyleDictionaryOptions } from "./types.js";
|
|
2
|
-
//#region src/rspack.d.ts
|
|
3
2
|
declare const _default: (options?: UnpluginStyleDictionaryOptions | undefined) => import("unplugin").RspackPluginInstance;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { type StyleDictionaryConfigContext, type UnpluginStyleDictionaryOptions, _default as default };
|
|
6
4
|
//# sourceMappingURL=rspack.d.ts.map
|
package/dist/rspack.js
CHANGED
package/dist/scheduler.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { asError } from "./errors.js";
|
|
2
|
-
|
|
2
|
+
// src/scheduler.ts
|
|
3
3
|
function createScheduler({ debounceMs, isClosed, run }) {
|
|
4
4
|
let debounceTimer;
|
|
5
5
|
let pendingReason;
|
|
@@ -38,7 +38,6 @@ function createScheduler({ debounceMs, isClosed, run }) {
|
|
|
38
38
|
return covered;
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
//#endregion
|
|
42
41
|
export { createScheduler };
|
|
43
42
|
|
|
44
43
|
//# sourceMappingURL=scheduler.js.map
|
package/dist/size-report.js
CHANGED
|
@@ -2,7 +2,7 @@ import { paint } from "./colour.js";
|
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import zlib from "node:zlib";
|
|
5
|
-
|
|
5
|
+
// src/size-report.ts
|
|
6
6
|
function sizeTable({ colour, root }, generatedFiles) {
|
|
7
7
|
const fileInfos = [];
|
|
8
8
|
for (const filePath of generatedFiles) if (fs.existsSync(filePath)) {
|
|
@@ -34,7 +34,6 @@ function sizeTable({ colour, root }, generatedFiles) {
|
|
|
34
34
|
}
|
|
35
35
|
return lines;
|
|
36
36
|
}
|
|
37
|
-
//#endregion
|
|
38
37
|
export { sizeTable };
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=size-report.js.map
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Config } from "style-dictionary";
|
|
2
|
-
//#region src/types.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* What the host is doing, handed to the function form of `config` so it can
|
|
5
4
|
* decide what to build.
|
|
@@ -415,5 +414,4 @@ export interface UnpluginStyleDictionaryOptions {
|
|
|
415
414
|
*/
|
|
416
415
|
watch?: string | string[];
|
|
417
416
|
}
|
|
418
|
-
//#endregion
|
|
419
417
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/up-to-date.js
CHANGED
|
@@ -3,7 +3,7 @@ import fs from "node:fs";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import StyleDictionary from "style-dictionary";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
|
-
|
|
6
|
+
// src/up-to-date.ts
|
|
7
7
|
const RECORDS_VERSION = 4;
|
|
8
8
|
function configFingerprint(root, item, configObj) {
|
|
9
9
|
let serialised;
|
|
@@ -189,7 +189,6 @@ function statOrNull(file) {
|
|
|
189
189
|
return null;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
//#endregion
|
|
193
192
|
export { configFingerprint, declaredDestinations, isUpToDate, newestSourceOf, readPersistedRecords, recordOf, recordsFileFor, writePersistedRecords, writtenDestination };
|
|
194
193
|
|
|
195
194
|
//# sourceMappingURL=up-to-date.js.map
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { StyleDictionaryConfigContext, UnpluginStyleDictionaryOptions } from "./types.js";
|
|
2
|
-
//#region src/vite.d.ts
|
|
3
2
|
declare const _default: (options?: UnpluginStyleDictionaryOptions | undefined) => import("vite").Plugin<any>;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { type StyleDictionaryConfigContext, type UnpluginStyleDictionaryOptions, _default as default };
|
|
6
4
|
//# sourceMappingURL=vite.d.ts.map
|
package/dist/vite.js
CHANGED
package/dist/watch-filter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import picomatch from "picomatch";
|
|
3
|
-
|
|
3
|
+
// src/watch-filter.ts
|
|
4
4
|
function compileWatchPatterns({ globs, literals }) {
|
|
5
5
|
const named = /* @__PURE__ */ new Set([...globs, ...literals]);
|
|
6
6
|
const matchesGlob = globs.length > 0 ? picomatch(globs) : () => false;
|
|
@@ -23,7 +23,6 @@ function registeredSpellingOf(file, linkedPaths) {
|
|
|
23
23
|
if (path.posix.dirname(real) === real) return file;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { compileWatchPatterns, isWatchedSource, matchesWatchedFile, registeredSpellingOf };
|
|
28
27
|
|
|
29
28
|
//# sourceMappingURL=watch-filter.js.map
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { StyleDictionaryConfigContext, UnpluginStyleDictionaryOptions } from "./types.js";
|
|
2
|
-
//#region src/webpack.d.ts
|
|
3
2
|
declare const _default: (options?: UnpluginStyleDictionaryOptions | undefined) => import("webpack").WebpackPluginInstance;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { type StyleDictionaryConfigContext, type UnpluginStyleDictionaryOptions, _default as default };
|
|
6
4
|
//# sourceMappingURL=webpack.d.ts.map
|
package/dist/webpack.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanso-labs/unplugin-style-dictionary",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.38",
|
|
4
4
|
"description": "Compile Style Dictionary design tokens ahead of your bundler (Vite, Rolldown, Rollup, Webpack or Rspack) from a single unplugin-based plugin, rebuilding on a token change under Vite's dev server and each bundler's watch mode",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unplugin",
|
|
@@ -100,14 +100,14 @@
|
|
|
100
100
|
"oxlint-tsgolint": "7.0.2004",
|
|
101
101
|
"publint": "0.3.25",
|
|
102
102
|
"rimraf": "6.1.3",
|
|
103
|
-
"rolldown": "1.2.
|
|
103
|
+
"rolldown": "1.2.15",
|
|
104
104
|
"rollup": "4.64.12",
|
|
105
105
|
"semver": "7.8.5",
|
|
106
106
|
"style-dictionary": "5.7.0",
|
|
107
107
|
"tsdown": "0.23.1",
|
|
108
108
|
"typescript": "6.0.3",
|
|
109
109
|
"typescript-eslint": "8.72.0",
|
|
110
|
-
"vite": "8.3.
|
|
110
|
+
"vite": "8.3.5",
|
|
111
111
|
"vitest": "5.0.5",
|
|
112
112
|
"webpack": "5.112.0"
|
|
113
113
|
},
|