@yahoo/uds 3.171.0 → 3.171.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.
@@ -29,7 +29,7 @@ declare function usePopoverConfig(sizeProp?: PopoverSize | undefined, variantPro
29
29
  gap: SpacingAlias;
30
30
  dismissButtonSpacing: SpacingAlias;
31
31
  dismissIconSize: number;
32
- ariaKitPlacement: ("top-start" | "top-end" | "bottom-start" | "bottom-end" | ("top" | "bottom" | "left" | "right") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
32
+ ariaKitPlacement: ("bottom-start" | "bottom-end" | "top-start" | "top-end" | ("bottom" | "left" | "right" | "top") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
33
33
  animationDuration: number;
34
34
  };
35
35
  //#endregion
@@ -30,7 +30,7 @@ declare function usePopoverConfig(sizeProp?: PopoverSize | undefined, variantPro
30
30
  gap: SpacingAlias;
31
31
  dismissButtonSpacing: SpacingAlias;
32
32
  dismissIconSize: number;
33
- ariaKitPlacement: ("top-start" | "top-end" | "bottom-start" | "bottom-end" | ("top" | "bottom" | "left" | "right") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
33
+ ariaKitPlacement: ("bottom-start" | "bottom-end" | "top-start" | "top-end" | ("bottom" | "left" | "right" | "top") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
34
34
  animationDuration: number;
35
35
  };
36
36
  //#endregion
@@ -0,0 +1,50 @@
1
+ /*! © 2026 Yahoo, Inc. UDS CSS 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
+ deferWrapperSpreadResolution: msg.deferWrapperSpreadResolution,
29
+ filePath: msg.filePath
30
+ });
31
+ parentPort?.postMessage({
32
+ type: "result",
33
+ id: msg.id,
34
+ result
35
+ });
36
+ } catch (error) {
37
+ parentPort?.postMessage({
38
+ type: "error",
39
+ id: msg.id,
40
+ error: error instanceof Error ? error.message : String(error)
41
+ });
42
+ }
43
+ return;
44
+ }
45
+ if (msg.type === "done") process.exit(0);
46
+ });
47
+ //#endregion
48
+ export {};
49
+
50
+ //# sourceMappingURL=purgeWorker.mjs.map
@@ -270,7 +270,9 @@ const runThemeMode = async (options, context) => {
270
270
  autoVariants: context.autoVariants,
271
271
  componentData: context.componentData
272
272
  }, options.workers);
273
- } catch {}
273
+ } catch {
274
+ genLog.warn("Worker pool unavailable — scanning single-threaded (slower)");
275
+ }
274
276
  try {
275
277
  if (pool) genLog.spinStart(`Scanning app and packages... (${pool.workerCount} worker${pool.workerCount === 1 ? "" : "s"})`);
276
278
  else genLog.spinStart("Scanning app and packages... (sync mode)");
@@ -268,7 +268,9 @@ const runThemeMode = async (options, context) => {
268
268
  autoVariants: context.autoVariants,
269
269
  componentData: context.componentData
270
270
  }, options.workers);
271
- } catch {}
271
+ } catch {
272
+ genLog.warn("Worker pool unavailable — scanning single-threaded (slower)");
273
+ }
272
274
  try {
273
275
  if (pool) genLog.spinStart(`Scanning app and packages... (${pool.workerCount} worker${pool.workerCount === 1 ? "" : "s"})`);
274
276
  else genLog.spinStart("Scanning app and packages... (sync mode)");
@@ -1,12 +1,28 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- require("../../../_virtual/_rolldown/runtime.cjs");
2
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
3
+ let node_fs = require("node:fs");
4
+ node_fs = require_runtime.__toESM(node_fs, 1);
5
+ let node_url = require("node:url");
3
6
  let node_os = require("node:os");
4
7
  let node_worker_threads = require("node:worker_threads");
5
8
  //#region ../css/dist/css/workerPool.mjs
6
9
  /*! © 2026 Yahoo, Inc. UDS CSS v0.0.0-development */
10
+ const resolveWorkerUrl = (baseUrl = require("url").pathToFileURL(__filename).href) => {
11
+ for (const candidate of [
12
+ "./purgeWorker.js",
13
+ "./purgeWorker.mjs",
14
+ "./purgeWorker.cjs",
15
+ "./purgeWorker.ts"
16
+ ]) {
17
+ const url = new URL(candidate, baseUrl);
18
+ if (node_fs.default.existsSync((0, node_url.fileURLToPath)(url))) return url;
19
+ }
20
+ return null;
21
+ };
7
22
  const createWorkerPool = async (config, numWorkers) => {
8
23
  const workerCount = numWorkers ?? Math.max(1, (0, node_os.cpus)().length - 1);
9
- const workerUrl = new URL("./purgeWorker.js", require("url").pathToFileURL(__filename).href);
24
+ const workerUrl = resolveWorkerUrl();
25
+ if (!workerUrl) throw new Error("purgeWorker build output not found next to workerPool");
10
26
  const workers = [];
11
27
  const available = [];
12
28
  const pending = /* @__PURE__ */ new Map();
@@ -1,11 +1,26 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
+ import fs from "node:fs";
3
+ import { fileURLToPath } from "node:url";
2
4
  import { cpus } from "node:os";
3
5
  import { Worker } from "node:worker_threads";
4
6
  //#region ../css/dist/css/workerPool.mjs
5
7
  /*! © 2026 Yahoo, Inc. UDS CSS v0.0.0-development */
8
+ const resolveWorkerUrl = (baseUrl = import.meta.url) => {
9
+ for (const candidate of [
10
+ "./purgeWorker.js",
11
+ "./purgeWorker.mjs",
12
+ "./purgeWorker.cjs",
13
+ "./purgeWorker.ts"
14
+ ]) {
15
+ const url = new URL(candidate, baseUrl);
16
+ if (fs.existsSync(fileURLToPath(url))) return url;
17
+ }
18
+ return null;
19
+ };
6
20
  const createWorkerPool = async (config, numWorkers) => {
7
21
  const workerCount = numWorkers ?? Math.max(1, cpus().length - 1);
8
- const workerUrl = new URL("./purgeWorker.js", import.meta.url);
22
+ const workerUrl = resolveWorkerUrl();
23
+ if (!workerUrl) throw new Error("purgeWorker build output not found next to workerPool");
9
24
  const workers = [];
10
25
  const available = [];
11
26
  const pending = /* @__PURE__ */ new Map();