@yahoo/uds 3.133.3 → 3.134.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/dist/automated-config/dist/generated/autoVariants.cjs +14 -0
- package/dist/automated-config/dist/generated/autoVariants.d.cts +14 -0
- package/dist/automated-config/dist/generated/autoVariants.d.ts +14 -0
- package/dist/automated-config/dist/generated/autoVariants.js +14 -0
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +2796 -1
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +288 -2
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +288 -2
- package/dist/automated-config/dist/generated/generatedConfigs.js +2796 -2
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +119 -0
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +2 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +2 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +119 -0
- package/dist/automated-config/dist/properties.cjs +15 -1
- package/dist/automated-config/dist/properties.d.cts +4 -0
- package/dist/automated-config/dist/properties.d.ts +4 -0
- package/dist/automated-config/dist/properties.js +15 -1
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
- package/dist/cli/commands/sync.cjs +4 -0
- package/dist/cli/commands/sync.js +4 -0
- package/dist/cli/dist/lib/args.cjs +7 -3
- package/dist/cli/dist/lib/args.js +7 -3
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
- package/dist/components/client/Modal/Modal.cjs +193 -0
- package/dist/components/client/Modal/Modal.d.cts +51 -0
- package/dist/components/client/Modal/Modal.d.ts +52 -0
- package/dist/components/client/Modal/Modal.js +191 -0
- package/dist/components/client/Modal/ModalActions.cjs +54 -0
- package/dist/components/client/Modal/ModalActions.d.cts +27 -0
- package/dist/components/client/Modal/ModalActions.d.ts +28 -0
- package/dist/components/client/Modal/ModalActions.js +52 -0
- package/dist/components/client/Modal/ModalContent.cjs +37 -0
- package/dist/components/client/Modal/ModalContent.d.cts +24 -0
- package/dist/components/client/Modal/ModalContent.d.ts +25 -0
- package/dist/components/client/Modal/ModalContent.js +35 -0
- package/dist/components/client/Modal/ModalContext.cjs +15 -0
- package/dist/components/client/Modal/ModalContext.d.cts +13 -0
- package/dist/components/client/Modal/ModalContext.d.ts +14 -0
- package/dist/components/client/Modal/ModalContext.js +12 -0
- package/dist/components/client/Modal/ModalDescription.cjs +29 -0
- package/dist/components/client/Modal/ModalDescription.d.cts +23 -0
- package/dist/components/client/Modal/ModalDescription.d.ts +24 -0
- package/dist/components/client/Modal/ModalDescription.js +27 -0
- package/dist/components/client/Modal/ModalTitle.cjs +29 -0
- package/dist/components/client/Modal/ModalTitle.d.cts +23 -0
- package/dist/components/client/Modal/ModalTitle.d.ts +24 -0
- package/dist/components/client/Modal/ModalTitle.js +27 -0
- package/dist/components/client/Modal/UDSModalConfigProvider.cjs +42 -0
- package/dist/components/client/Modal/UDSModalConfigProvider.d.cts +35 -0
- package/dist/components/client/Modal/UDSModalConfigProvider.d.ts +36 -0
- package/dist/components/client/Modal/UDSModalConfigProvider.js +39 -0
- package/dist/components/client/Modal/index.cjs +16 -0
- package/dist/components/client/Modal/index.d.cts +8 -0
- package/dist/components/client/Modal/index.d.ts +9 -0
- package/dist/components/client/Modal/index.js +9 -0
- package/dist/components/client/Modal/useScrollFade.cjs +38 -0
- package/dist/components/client/Modal/useScrollFade.d.cts +13 -0
- package/dist/components/client/Modal/useScrollFade.d.ts +14 -0
- package/dist/components/client/Modal/useScrollFade.js +36 -0
- package/dist/components/client/Modal/utils.cjs +32 -0
- package/dist/components/client/Modal/utils.d.cts +13 -0
- package/dist/components/client/Modal/utils.d.ts +14 -0
- package/dist/components/client/Modal/utils.js +30 -0
- package/dist/components/client/Popover/index.d.cts +1 -1
- package/dist/components/client/Popover/index.d.ts +1 -1
- package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +1 -1
- package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +1 -1
- package/dist/components/client/index.cjs +13 -0
- package/dist/components/client/index.d.cts +8 -2
- package/dist/components/client/index.d.ts +8 -2
- package/dist/components/client/index.js +7 -1
- package/dist/components/client/providers/UDSConfigProvider.cjs +6 -2
- package/dist/components/client/providers/UDSConfigProvider.d.cts +2 -1
- package/dist/components/client/providers/UDSConfigProvider.d.ts +2 -1
- package/dist/components/client/providers/UDSConfigProvider.js +6 -2
- package/dist/components/experimental/client/index.cjs +0 -5
- package/dist/components/experimental/client/index.d.cts +1 -2
- package/dist/components/experimental/client/index.d.ts +1 -2
- package/dist/components/experimental/client/index.js +1 -2
- package/dist/components/experimental/index.cjs +1 -10
- package/dist/components/experimental/index.d.cts +1 -2
- package/dist/components/experimental/index.d.ts +1 -2
- package/dist/components/experimental/index.js +2 -7
- package/dist/components/index.cjs +20 -0
- package/dist/components/index.d.cts +8 -2
- package/dist/components/index.d.ts +8 -2
- package/dist/components/index.js +14 -1
- package/dist/config/dist/index.cjs +129 -4
- package/dist/config/dist/index.js +129 -4
- package/dist/index.cjs +16 -0
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +9 -2
- package/dist/runtime/index.cjs +2 -0
- package/dist/runtime/index.d.cts +2 -1
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.js +2 -1
- package/dist/runtime/modalConfig.cjs +22 -0
- package/dist/runtime/modalConfig.d.cts +22 -0
- package/dist/runtime/modalConfig.d.ts +22 -0
- package/dist/runtime/modalConfig.js +21 -0
- package/dist/runtime/udsConfig.cjs +4 -2
- package/dist/runtime/udsConfig.d.cts +2 -0
- package/dist/runtime/udsConfig.d.ts +2 -0
- package/dist/runtime/udsConfig.js +4 -2
- package/dist/styles/styler.d.cts +35 -21
- package/dist/styles/styler.d.ts +35 -21
- package/dist/styles/variants.d.cts +42 -0
- package/dist/styles/variants.d.ts +42 -0
- package/dist/tailwind/dist/automated-config/dist/generated/autoVariants.cjs +14 -0
- package/dist/tailwind/dist/automated-config/dist/generated/autoVariants.js +14 -0
- package/dist/tailwind/dist/automated-config/dist/generated/autoVariants.js.map +1 -1
- package/dist/tailwind/dist/automated-config/dist/generated/generatedConfigs.cjs +2796 -1
- package/dist/tailwind/dist/automated-config/dist/generated/generatedConfigs.js +2796 -2
- package/dist/tailwind/dist/automated-config/dist/generated/generatedConfigs.js.map +1 -1
- package/dist/tailwind/dist/automated-config/dist/properties.cjs +15 -1
- package/dist/tailwind/dist/automated-config/dist/properties.js +15 -1
- package/dist/tailwind/dist/automated-config/dist/properties.js.map +1 -1
- package/dist/tailwind/dist/commands/css.cjs +1 -0
- package/dist/tailwind/dist/commands/css.d.cts.map +1 -1
- package/dist/tailwind/dist/commands/css.d.ts.map +1 -1
- package/dist/tailwind/dist/commands/css.helpers.cjs +8 -1
- package/dist/tailwind/dist/commands/css.helpers.js +8 -1
- package/dist/tailwind/dist/commands/css.helpers.js.map +1 -1
- package/dist/tailwind/dist/commands/css.js +1 -0
- package/dist/tailwind/dist/commands/css.js.map +1 -1
- package/dist/tailwind/dist/config/dist/index.cjs +129 -4
- package/dist/tailwind/dist/config/dist/index.js +129 -4
- package/dist/tailwind/dist/config/dist/index.js.map +1 -1
- package/dist/tailwind/dist/css/generate.cjs +7 -4
- package/dist/tailwind/dist/css/generate.d.cts.map +1 -1
- package/dist/tailwind/dist/css/generate.d.ts.map +1 -1
- package/dist/tailwind/dist/css/generate.js +7 -4
- package/dist/tailwind/dist/css/generate.js.map +1 -1
- package/dist/tailwind/dist/css/nodeUtils.cjs +19 -8
- package/dist/tailwind/dist/css/nodeUtils.js +19 -8
- package/dist/tailwind/dist/css/nodeUtils.js.map +1 -1
- package/dist/tailwind/dist/css/perf.cjs +92 -0
- package/dist/tailwind/dist/css/perf.js +89 -0
- package/dist/tailwind/dist/css/perf.js.map +1 -0
- package/dist/tailwind/dist/css/purgeWorker.cjs +47 -0
- package/dist/tailwind/dist/css/purgeWorker.d.cts +2 -0
- package/dist/tailwind/dist/css/purgeWorker.d.ts +2 -0
- package/dist/tailwind/dist/css/purgeWorker.js +48 -0
- package/dist/tailwind/dist/css/purgeWorker.js.map +1 -0
- package/dist/tailwind/dist/css/runner.cjs +158 -145
- package/dist/tailwind/dist/css/runner.js +158 -145
- package/dist/tailwind/dist/css/runner.js.map +1 -1
- package/dist/tailwind/dist/css/utils.cjs +8 -0
- package/dist/tailwind/dist/css/utils.js +8 -0
- package/dist/tailwind/dist/css/utils.js.map +1 -1
- package/dist/tailwind/dist/css/workerPool.cjs +89 -0
- package/dist/tailwind/dist/css/workerPool.js +90 -0
- package/dist/tailwind/dist/css/workerPool.js.map +1 -0
- package/dist/tailwind/dist/purger/optimized/ast/expressions.cjs +95 -15
- package/dist/tailwind/dist/purger/optimized/ast/expressions.js +95 -15
- package/dist/tailwind/dist/purger/optimized/ast/expressions.js.map +1 -1
- package/dist/tailwind/dist/purger/optimized/purgeFromCode.cjs +38 -14
- package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.cts.map +1 -1
- package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.ts.map +1 -1
- package/dist/tailwind/dist/purger/optimized/purgeFromCode.js +39 -15
- package/dist/tailwind/dist/purger/optimized/purgeFromCode.js.map +1 -1
- package/dist/tailwind/dist/purger/optimized/types.d.cts +10 -0
- package/dist/tailwind/dist/purger/optimized/types.d.cts.map +1 -1
- package/dist/tailwind/dist/purger/optimized/types.d.ts +10 -0
- package/dist/tailwind/dist/purger/optimized/types.d.ts.map +1 -1
- package/dist/tailwind/dist/runtimeConfig/hookMetadata.cjs +34 -0
- package/dist/tailwind/dist/runtimeConfig/hookMetadata.js +34 -0
- package/dist/tailwind/dist/runtimeConfig/hookMetadata.js.map +1 -1
- package/dist/tailwind/dist/tailwind/plugins/blurBgFallback.cjs +3 -0
- package/dist/tailwind/dist/tailwind/plugins/blurBgFallback.js +3 -0
- package/dist/tailwind/dist/tailwind/plugins/blurBgFallback.js.map +1 -1
- package/dist/tailwind/dist/tailwind/plugins/components.cjs +1 -0
- package/dist/tailwind/dist/tailwind/plugins/components.js +2 -1
- package/dist/tailwind/dist/tailwind/plugins/components.js.map +1 -1
- package/dist/tailwind/dist/types/dist/index.d.cts.map +1 -1
- package/dist/tailwind/dist/types/dist/index.d.ts.map +1 -1
- package/dist/tokens/automation/configs/index.cjs +1 -0
- package/dist/tokens/automation/configs/index.d.cts +2 -2
- package/dist/tokens/automation/configs/index.d.ts +2 -2
- package/dist/tokens/automation/configs/index.js +2 -2
- package/dist/tokens/automation/index.cjs +1 -0
- package/dist/tokens/automation/index.d.cts +2 -2
- package/dist/tokens/automation/index.d.ts +2 -2
- package/dist/tokens/automation/index.js +2 -2
- package/dist/tokens/index.cjs +1 -0
- package/dist/tokens/index.d.cts +3 -3
- package/dist/tokens/index.d.ts +3 -3
- package/dist/tokens/index.js +2 -2
- package/dist/tokens/types.d.cts +2 -2
- package/dist/tokens/types.d.ts +2 -2
- package/dist/types/dist/index.d.cts +68 -2
- package/dist/types/dist/index.d.ts +68 -2
- package/dist/uds/generated/componentData.cjs +1024 -833
- package/dist/uds/generated/componentData.js +995 -840
- package/dist/uds/generated/tailwindPurge.cjs +137 -96
- package/dist/uds/generated/tailwindPurge.js +137 -96
- package/dist/utils/exposeAriakitScrollbarWidth.cjs +17 -0
- package/dist/utils/exposeAriakitScrollbarWidth.d.cts +13 -0
- package/dist/utils/exposeAriakitScrollbarWidth.d.ts +13 -0
- package/dist/utils/exposeAriakitScrollbarWidth.js +16 -0
- package/generated/componentData.json +1761 -1550
- package/generated/tailwindPurge.ts +4 -4
- package/package.json +1 -1
- package/dist/components/experimental/client/Modal.cjs +0 -60
- package/dist/components/experimental/client/Modal.d.cts +0 -27
- package/dist/components/experimental/client/Modal.d.ts +0 -28
- package/dist/components/experimental/client/Modal.js +0 -55
- package/dist/tailwind/dist/purger/optimized/ast/jsx.cjs +0 -16
- package/dist/tailwind/dist/purger/optimized/ast/jsx.js +0 -17
- package/dist/tailwind/dist/purger/optimized/ast/jsx.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
|
|
2
|
+
import { purgeFromCodeOptimized } from "../purger/optimized/purgeFromCode.js";
|
|
3
|
+
import { parentPort } from "node:worker_threads";
|
|
4
|
+
//#region src/css/purgeWorker.ts
|
|
5
|
+
let sharedConfig = null;
|
|
6
|
+
parentPort?.on("message", async (msg) => {
|
|
7
|
+
if (msg.type === "init") {
|
|
8
|
+
sharedConfig = msg.config;
|
|
9
|
+
parentPort?.postMessage({ type: "ready" });
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (msg.type === "task") {
|
|
13
|
+
if (!sharedConfig) {
|
|
14
|
+
parentPort?.postMessage({
|
|
15
|
+
type: "error",
|
|
16
|
+
id: msg.id,
|
|
17
|
+
error: "Worker not initialized"
|
|
18
|
+
});
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
const result = await purgeFromCodeOptimized(msg.code, {
|
|
23
|
+
...sharedConfig,
|
|
24
|
+
colorModes: msg.colorModes,
|
|
25
|
+
variantDefaults: msg.variantDefaults,
|
|
26
|
+
runtimeConfigValues: msg.runtimeConfigValues,
|
|
27
|
+
includeAllClassNamePrimitives: msg.includeAllClassNamePrimitives,
|
|
28
|
+
filePath: msg.filePath
|
|
29
|
+
});
|
|
30
|
+
parentPort?.postMessage({
|
|
31
|
+
type: "result",
|
|
32
|
+
id: msg.id,
|
|
33
|
+
result
|
|
34
|
+
});
|
|
35
|
+
} catch (error) {
|
|
36
|
+
parentPort?.postMessage({
|
|
37
|
+
type: "error",
|
|
38
|
+
id: msg.id,
|
|
39
|
+
error: error instanceof Error ? error.message : String(error)
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (msg.type === "done") process.exit(0);
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=purgeWorker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purgeWorker.js","names":[],"sources":["../../src/css/purgeWorker.ts"],"sourcesContent":["import { parentPort } from 'node:worker_threads';\n\nimport type { PurgeFromCodeOptions } from '../purger/optimized/purgeFromCode';\nimport { purgeFromCodeOptimized } from '../purger/optimized/purgeFromCode';\n\ntype SharedConfig = Pick<PurgeFromCodeOptions, 'variants' | 'autoVariants' | 'componentData'>;\n\ntype InitMessage = {\n type: 'init';\n config: SharedConfig;\n};\n\ntype TaskMessage = {\n type: 'task';\n id: number;\n code: string;\n filePath: string;\n colorModes?: ('dark' | 'light')[];\n variantDefaults?: PurgeFromCodeOptions['variantDefaults'];\n runtimeConfigValues?: PurgeFromCodeOptions['runtimeConfigValues'];\n includeAllClassNamePrimitives?: boolean;\n};\n\ntype DoneMessage = {\n type: 'done';\n};\n\ntype WorkerMessage = DoneMessage | InitMessage | TaskMessage;\n\nlet sharedConfig: SharedConfig | null = null;\n\nparentPort?.on('message', async (msg: WorkerMessage) => {\n if (msg.type === 'init') {\n sharedConfig = msg.config;\n parentPort?.postMessage({ type: 'ready' });\n return;\n }\n\n if (msg.type === 'task') {\n if (!sharedConfig) {\n parentPort?.postMessage({ type: 'error', id: msg.id, error: 'Worker not initialized' });\n return;\n }\n\n try {\n const result = await purgeFromCodeOptimized(msg.code, {\n ...sharedConfig,\n colorModes: msg.colorModes,\n variantDefaults: msg.variantDefaults,\n runtimeConfigValues: msg.runtimeConfigValues,\n includeAllClassNamePrimitives: msg.includeAllClassNamePrimitives,\n filePath: msg.filePath,\n });\n parentPort?.postMessage({ type: 'result', id: msg.id, result });\n } catch (error) {\n parentPort?.postMessage({\n type: 'error',\n id: msg.id,\n error: error instanceof Error ? error.message : String(error),\n });\n }\n return;\n }\n\n if (msg.type === 'done') {\n process.exit(0);\n }\n});\n"],"mappings":";;;;AA6BA,IAAI,eAAoC;AAExC,YAAY,GAAG,WAAW,OAAO,QAAuB;AACtD,KAAI,IAAI,SAAS,QAAQ;AACvB,iBAAe,IAAI;AACnB,cAAY,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1C;;AAGF,KAAI,IAAI,SAAS,QAAQ;AACvB,MAAI,CAAC,cAAc;AACjB,eAAY,YAAY;IAAE,MAAM;IAAS,IAAI,IAAI;IAAI,OAAO;IAA0B,CAAC;AACvF;;AAGF,MAAI;GACF,MAAM,SAAS,MAAM,uBAAuB,IAAI,MAAM;IACpD,GAAG;IACH,YAAY,IAAI;IAChB,iBAAiB,IAAI;IACrB,qBAAqB,IAAI;IACzB,+BAA+B,IAAI;IACnC,UAAU,IAAI;IACf,CAAC;AACF,eAAY,YAAY;IAAE,MAAM;IAAU,IAAI,IAAI;IAAI;IAAQ,CAAC;WACxD,OAAO;AACd,eAAY,YAAY;IACtB,MAAM;IACN,IAAI,IAAI;IACR,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;IAC9D,CAAC;;AAEJ;;AAGF,KAAI,IAAI,SAAS,OACf,SAAQ,KAAK,EAAE;EAEjB"}
|
|
@@ -4,6 +4,7 @@ const require_colors = require("../cli/dist/lib/colors.cjs");
|
|
|
4
4
|
const require_print = require("../cli/dist/lib/print.cjs");
|
|
5
5
|
const require_spinner = require("../cli/dist/lib/spinner.cjs");
|
|
6
6
|
const require_logger = require("../cli/dist/lib/logger.cjs");
|
|
7
|
+
const require_perf = require("./perf.cjs");
|
|
7
8
|
const require_entryPoints = require("../utils/entryPoints.cjs");
|
|
8
9
|
const require_nodeUtils = require("./nodeUtils.cjs");
|
|
9
10
|
const require_index = require("../config/dist/index.cjs");
|
|
@@ -12,6 +13,7 @@ const require_runner_helpers = require("./runner.helpers.cjs");
|
|
|
12
13
|
const require_utils = require("./utils.cjs");
|
|
13
14
|
const require_generate_helpers = require("./generate.helpers.cjs");
|
|
14
15
|
const require_generate = require("./generate.cjs");
|
|
16
|
+
const require_workerPool = require("./workerPool.cjs");
|
|
15
17
|
let node_fs = require("node:fs");
|
|
16
18
|
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
17
19
|
//#region src/css/runner.ts
|
|
@@ -249,170 +251,181 @@ const runThemeMode = async (options, context) => {
|
|
|
249
251
|
if (themeConfig.config && appConfig === require_index.defaultTokensConfig) log.warn(`App config not found: ${themeConfig.config}, using defaults`);
|
|
250
252
|
const packageDirs = [];
|
|
251
253
|
const generateThemeModeCSS = async (opts) => {
|
|
254
|
+
require_perf.clearTimings();
|
|
255
|
+
require_perf.captureMemory("start");
|
|
252
256
|
const genStartTime = performance.now();
|
|
253
257
|
const genLog = opts?.isWatch ? require_logger.createLogger({ silent: true }) : log;
|
|
254
258
|
const scopedCssOutputs = [];
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
259
|
+
const pool = await require_workerPool.createWorkerPool({
|
|
260
|
+
variants: context.variants,
|
|
261
|
+
autoVariants: context.autoVariants,
|
|
262
|
+
componentData: context.componentData
|
|
263
|
+
}, options.workers);
|
|
264
|
+
try {
|
|
265
|
+
genLog.spinStart(`Scanning app and packages... (${pool.workerCount} worker${pool.workerCount === 1 ? "" : "s"})`);
|
|
266
|
+
const scopedPackageTargets = [];
|
|
267
|
+
const processInheritedPackage = async (packageName) => {
|
|
268
|
+
const packageDir = require_nodeUtils.findPackageSourceDir(packageName);
|
|
269
|
+
if (!packageDir) return {
|
|
270
|
+
packageName,
|
|
271
|
+
status: "not-found"
|
|
272
|
+
};
|
|
273
|
+
if (!packageDirs.includes(packageDir)) packageDirs.push(packageDir);
|
|
274
|
+
return {
|
|
275
|
+
packageName,
|
|
276
|
+
status: "ok",
|
|
277
|
+
scanResult: await require_nodeUtils.scanDirectoryForSafelist(packageDir, colorModes, context.variants, context.autoVariants, context.componentData, appVariantDefaults, runtimeConfigValues, true, pool)
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
const processScopedPackage = async (packageName, scopedPackageValue) => {
|
|
281
|
+
const scopedPackageConfig = normalizeScopedPackageConfig(scopedPackageValue);
|
|
282
|
+
const packageRoot = require_nodeUtils.findPackageRoot(packageName);
|
|
283
|
+
const packageDir = require_nodeUtils.findPackageSourceDir(packageName);
|
|
284
|
+
if (!packageRoot || !packageDir) return;
|
|
285
|
+
const scopeClass = require_nodeUtils.getPackageUdsScope(packageName);
|
|
286
|
+
if (!scopeClass) return;
|
|
287
|
+
const entryDirs = resolveScopedEntryDirs(packageRoot, packageDir, scopedPackageConfig.entry);
|
|
288
|
+
entryDirs.forEach((entryDir) => {
|
|
289
|
+
if (!packageDirs.includes(entryDir)) packageDirs.push(entryDir);
|
|
290
|
+
});
|
|
291
|
+
scopedPackageTargets.push({
|
|
292
|
+
packageName,
|
|
293
|
+
packageRoot,
|
|
294
|
+
packageDir,
|
|
295
|
+
entryDirs,
|
|
296
|
+
scopeClass,
|
|
297
|
+
config: scopedPackageConfig
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
const [appScanResult, inheritedResults] = await Promise.all([
|
|
301
|
+
require_perf.measureAsync("scan", () => require_nodeUtils.scanDirectoriesForSafelist(entryDirs, colorModes, context.variants, context.autoVariants, context.componentData, appVariantDefaults, runtimeConfigValues, false, pool)),
|
|
302
|
+
Promise.all((themeConfig.inherit ?? []).map((packageName) => require_perf.measureAsync(`scan:inherit:${packageName}`, () => processInheritedPackage(packageName)))),
|
|
303
|
+
Promise.all(Object.entries(themeConfig.scoped ?? {}).map(([packageName, scopedPackageConfig]) => processScopedPackage(packageName, scopedPackageConfig)))
|
|
304
|
+
]);
|
|
280
305
|
genLog.spinStop("✅", require_runner_helpers.getScanSummaryMessage({
|
|
281
|
-
label:
|
|
282
|
-
filesScanned:
|
|
283
|
-
filesWithComponents:
|
|
284
|
-
componentCount:
|
|
285
|
-
mode: "
|
|
306
|
+
label: "app",
|
|
307
|
+
filesScanned: appScanResult.filesScanned,
|
|
308
|
+
filesWithComponents: appScanResult.filesWithComponents,
|
|
309
|
+
componentCount: appScanResult.components.length,
|
|
310
|
+
mode: "app"
|
|
286
311
|
}));
|
|
287
|
-
if (options.verbose) printVerboseScanFiles(genLog, workspaceDir,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
312
|
+
if (options.verbose) printVerboseScanFiles(genLog, workspaceDir, appScanResult.filePaths);
|
|
313
|
+
for (const result of inheritedResults) if (result.status === "not-found") genLog.spinStop("⚠️", `Package not found: ${result.packageName}`);
|
|
314
|
+
else {
|
|
315
|
+
genLog.spinStop("✅", require_runner_helpers.getScanSummaryMessage({
|
|
316
|
+
label: result.packageName,
|
|
317
|
+
filesScanned: result.scanResult.filesScanned,
|
|
318
|
+
filesWithComponents: result.scanResult.filesWithComponents,
|
|
319
|
+
componentCount: result.scanResult.components.length,
|
|
320
|
+
mode: "inherit"
|
|
321
|
+
}));
|
|
322
|
+
if (options.verbose) printVerboseScanFiles(genLog, workspaceDir, result.scanResult.filePaths);
|
|
297
323
|
}
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
324
|
+
const inheritedClasses = [...appScanResult.safelist];
|
|
325
|
+
const inheritedComponents = new Set(appScanResult.components);
|
|
326
|
+
for (const result of inheritedResults) if (result.status === "ok") {
|
|
327
|
+
inheritedClasses.push(...result.scanResult.safelist);
|
|
328
|
+
result.scanResult.components.forEach((comp) => inheritedComponents.add(comp));
|
|
302
329
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
});
|
|
307
|
-
scopedPackageTargets.push({
|
|
308
|
-
packageName,
|
|
309
|
-
packageRoot,
|
|
310
|
-
packageDir,
|
|
311
|
-
entryDirs,
|
|
312
|
-
scopeClass,
|
|
313
|
-
config: scopedPackageConfig
|
|
314
|
-
});
|
|
315
|
-
};
|
|
316
|
-
await (themeConfig.inherit ?? []).reduce(async (promise, packageName) => {
|
|
317
|
-
await promise;
|
|
318
|
-
await processInheritedPackage(packageName);
|
|
319
|
-
}, Promise.resolve());
|
|
320
|
-
await Object.entries(themeConfig.scoped ?? {}).reduce(async (promise, [packageName, scopedPackageConfig]) => {
|
|
321
|
-
await promise;
|
|
322
|
-
await processScopedPackage(packageName, scopedPackageConfig);
|
|
323
|
-
}, Promise.resolve());
|
|
324
|
-
const mainSafelist = require_safelist.deduplicateSafelist([
|
|
325
|
-
...inheritedClasses,
|
|
326
|
-
...require_safelist.getThemeAndScaleClasses(colorModes),
|
|
327
|
-
...require_safelist.getInternalSafelistClasses()
|
|
328
|
-
]);
|
|
329
|
-
const allMotionComponents = [...inheritedComponents];
|
|
330
|
-
const mainCssResult = await require_generate.generateCSS([...themeConfig.css?.safelist ?? [], ...mainSafelist], appConfig, {
|
|
331
|
-
scope: options.scope,
|
|
332
|
-
contentDir: entryDirs,
|
|
333
|
-
cssOptions: themeConfig.css,
|
|
334
|
-
safeVarPrefixes: [
|
|
335
|
-
...require_utils.getMotionVarPrefixes(context.componentData, allMotionComponents),
|
|
336
|
-
...require_utils.getConfigurableCssVariables(),
|
|
337
|
-
...require_generate_helpers.getPruneVarSafelist(themeConfig.css)
|
|
338
|
-
]
|
|
339
|
-
});
|
|
340
|
-
ensureOutputDirectory(outputPath);
|
|
341
|
-
node_fs.default.writeFileSync(outputPath, mainCssResult.css);
|
|
342
|
-
for (const scopedPackageTarget of scopedPackageTargets) {
|
|
343
|
-
const packageConfig = await require_nodeUtils.loadConfigFile(isAbsolutePath(scopedPackageTarget.config.config) ? scopedPackageTarget.config.config : joinPath(scopedPackageTarget.packageRoot, scopedPackageTarget.config.config)) ?? require_index.defaultTokensConfig;
|
|
344
|
-
const packageVariantDefaults = require_utils.extractVariantDefaults(packageConfig);
|
|
345
|
-
const packageRuntimeConfigValues = require_utils.extractRuntimeConfigValues(packageConfig);
|
|
346
|
-
const packageScanResult = await require_nodeUtils.scanDirectoriesForSafelist(scopedPackageTarget.entryDirs, colorModes, context.variants, context.autoVariants, context.componentData, packageVariantDefaults, packageRuntimeConfigValues, true);
|
|
347
|
-
genLog.spinStop("✅", require_runner_helpers.getScanSummaryMessage({
|
|
348
|
-
label: scopedPackageTarget.packageName,
|
|
349
|
-
filesScanned: packageScanResult.filesScanned,
|
|
350
|
-
filesWithComponents: packageScanResult.filesWithComponents,
|
|
351
|
-
componentCount: packageScanResult.components.length,
|
|
352
|
-
mode: "scoped"
|
|
353
|
-
}));
|
|
354
|
-
if (options.verbose) printVerboseScanFiles(genLog, workspaceDir, packageScanResult.filePaths);
|
|
355
|
-
const packageSafelist = require_safelist.deduplicateSafelist([
|
|
356
|
-
...packageScanResult.safelist,
|
|
330
|
+
genLog.spinStart("Generating main CSS...");
|
|
331
|
+
const mainSafelist = require_safelist.deduplicateSafelist([
|
|
332
|
+
...inheritedClasses,
|
|
357
333
|
...require_safelist.getThemeAndScaleClasses(colorModes),
|
|
358
334
|
...require_safelist.getInternalSafelistClasses()
|
|
359
335
|
]);
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
336
|
+
const allMotionComponents = [...inheritedComponents];
|
|
337
|
+
require_perf.captureMemory("before-gen");
|
|
338
|
+
const mainCssResult = await require_perf.measureAsync("gen", () => require_generate.generateCSS([...themeConfig.css?.safelist ?? [], ...mainSafelist], appConfig, {
|
|
339
|
+
scope: options.scope,
|
|
340
|
+
contentDir: entryDirs,
|
|
363
341
|
cssOptions: themeConfig.css,
|
|
364
|
-
referenceCss: themeConfig.css?.optimization?.deduplicateScopedCss === false ? void 0 : mainCssResult.css,
|
|
365
342
|
safeVarPrefixes: [
|
|
366
|
-
...require_utils.getMotionVarPrefixes(context.componentData,
|
|
343
|
+
...require_utils.getMotionVarPrefixes(context.componentData, allMotionComponents),
|
|
367
344
|
...require_utils.getConfigurableCssVariables(),
|
|
368
345
|
...require_generate_helpers.getPruneVarSafelist(themeConfig.css)
|
|
369
346
|
]
|
|
370
|
-
});
|
|
371
|
-
|
|
372
|
-
ensureOutputDirectory(
|
|
373
|
-
node_fs.default.writeFileSync(
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
347
|
+
}));
|
|
348
|
+
require_perf.captureMemory("after-gen");
|
|
349
|
+
ensureOutputDirectory(outputPath);
|
|
350
|
+
node_fs.default.writeFileSync(outputPath, mainCssResult.css);
|
|
351
|
+
for (const scopedPackageTarget of scopedPackageTargets) {
|
|
352
|
+
const packageConfig = await require_nodeUtils.loadConfigFile(isAbsolutePath(scopedPackageTarget.config.config) ? scopedPackageTarget.config.config : joinPath(scopedPackageTarget.packageRoot, scopedPackageTarget.config.config)) ?? require_index.defaultTokensConfig;
|
|
353
|
+
const packageVariantDefaults = require_utils.extractVariantDefaults(packageConfig);
|
|
354
|
+
const packageRuntimeConfigValues = require_utils.extractRuntimeConfigValues(packageConfig);
|
|
355
|
+
const packageScanResult = await require_nodeUtils.scanDirectoriesForSafelist(scopedPackageTarget.entryDirs, colorModes, context.variants, context.autoVariants, context.componentData, packageVariantDefaults, packageRuntimeConfigValues, true, pool);
|
|
356
|
+
genLog.spinStop("✅", require_runner_helpers.getScanSummaryMessage({
|
|
357
|
+
label: scopedPackageTarget.packageName,
|
|
358
|
+
filesScanned: packageScanResult.filesScanned,
|
|
359
|
+
filesWithComponents: packageScanResult.filesWithComponents,
|
|
360
|
+
componentCount: packageScanResult.components.length,
|
|
361
|
+
mode: "scoped"
|
|
362
|
+
}));
|
|
363
|
+
if (options.verbose) printVerboseScanFiles(genLog, workspaceDir, packageScanResult.filePaths);
|
|
364
|
+
const packageSafelist = require_safelist.deduplicateSafelist([
|
|
365
|
+
...packageScanResult.safelist,
|
|
366
|
+
...require_safelist.getThemeAndScaleClasses(colorModes),
|
|
367
|
+
...require_safelist.getInternalSafelistClasses()
|
|
368
|
+
]);
|
|
369
|
+
const scopedCssResult = await require_generate.generateCSS([...themeConfig.css?.safelist ?? [], ...packageSafelist], packageConfig, {
|
|
370
|
+
scope: scopedPackageTarget.scopeClass,
|
|
371
|
+
contentDir: scopedPackageTarget.entryDirs,
|
|
372
|
+
cssOptions: themeConfig.css,
|
|
373
|
+
referenceCss: themeConfig.css?.optimization?.deduplicateScopedCss === false ? void 0 : mainCssResult.css,
|
|
374
|
+
safeVarPrefixes: [
|
|
375
|
+
...require_utils.getMotionVarPrefixes(context.componentData, [...packageScanResult.components]),
|
|
376
|
+
...require_utils.getConfigurableCssVariables(),
|
|
377
|
+
...require_generate_helpers.getPruneVarSafelist(themeConfig.css)
|
|
378
|
+
]
|
|
379
|
+
});
|
|
380
|
+
const scopedOutputPath = resolveOutputPath(workspaceDir, getScopedPackageOutputPath(scopedPackageTarget.packageName, scopedPackageTarget.config.outFile));
|
|
381
|
+
ensureOutputDirectory(scopedOutputPath);
|
|
382
|
+
node_fs.default.writeFileSync(scopedOutputPath, scopedCssResult.css);
|
|
383
|
+
scopedCssOutputs.push({
|
|
384
|
+
label: scopedPackageTarget.packageName,
|
|
385
|
+
outputPath: scopedOutputPath,
|
|
386
|
+
sizeGzipBytes: scopedCssResult.sizeGzipBytes,
|
|
387
|
+
optimizationStats: scopedCssResult.optimizationStats
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
const mainCssSummary = require_runner_helpers.getMainCssSummaryMessage({
|
|
391
|
+
sizeGzipBytes: mainCssResult.sizeGzipBytes,
|
|
392
|
+
optimizationStats: mainCssResult.optimizationStats,
|
|
394
393
|
formatBytes: require_utils.formatBytes
|
|
395
394
|
});
|
|
396
|
-
genLog.spinStop("✅",
|
|
397
|
-
|
|
395
|
+
genLog.spinStop("✅", mainCssSummary.summaryLine);
|
|
396
|
+
mainCssSummary.detailLines.forEach((detailLine) => {
|
|
398
397
|
genLog.print(detailLine);
|
|
399
398
|
});
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
duration
|
|
412
|
-
outputPath,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
399
|
+
scopedCssOutputs.forEach((scopedCssOutput) => {
|
|
400
|
+
const scopedCssSummary = require_runner_helpers.getScopedCssSummaryMessage(scopedCssOutput.label, {
|
|
401
|
+
sizeGzipBytes: scopedCssOutput.sizeGzipBytes,
|
|
402
|
+
optimizationStats: scopedCssOutput.optimizationStats,
|
|
403
|
+
formatBytes: require_utils.formatBytes
|
|
404
|
+
});
|
|
405
|
+
genLog.spinStop("✅", scopedCssSummary.summaryLine);
|
|
406
|
+
scopedCssSummary.detailLines.forEach((detailLine) => {
|
|
407
|
+
genLog.print(detailLine);
|
|
408
|
+
});
|
|
409
|
+
});
|
|
410
|
+
const duration = Math.round(performance.now() - genStartTime);
|
|
411
|
+
const outputFileSection = require_runner_helpers.getOutputFileSection(workspaceDir, [outputPath, ...scopedCssOutputs.map((scopedCssOutput) => scopedCssOutput.outputPath)]);
|
|
412
|
+
genLog.newline();
|
|
413
|
+
genLog.print(outputFileSection.label);
|
|
414
|
+
outputFileSection.paths.forEach((filePath) => {
|
|
415
|
+
genLog.listItem(filePath);
|
|
416
|
+
});
|
|
417
|
+
genLog.newline();
|
|
418
|
+
genLog.print(`${require_colors.magenta("Total time:")} ${require_runner_helpers.formatCssDuration(duration)}`);
|
|
419
|
+
require_perf.printPerfSummary(duration);
|
|
420
|
+
return {
|
|
421
|
+
duration,
|
|
422
|
+
outputPath,
|
|
423
|
+
outputPaths: outputFileSection.paths,
|
|
424
|
+
packageDirs
|
|
425
|
+
};
|
|
426
|
+
} finally {
|
|
427
|
+
await pool.destroy();
|
|
428
|
+
}
|
|
416
429
|
};
|
|
417
430
|
await generateThemeModeCSS();
|
|
418
431
|
if (options.watch) {
|