@yahoo/uds 3.116.0-beta.3 → 3.116.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.
Files changed (194) hide show
  1. package/dist/automated-config/dist/generated/autoVariants.cjs +0 -10
  2. package/dist/automated-config/dist/generated/autoVariants.d.cts +0 -10
  3. package/dist/automated-config/dist/generated/autoVariants.d.ts +0 -10
  4. package/dist/automated-config/dist/generated/autoVariants.js +0 -10
  5. package/dist/automated-config/dist/generated/generatedConfigs.cjs +0 -1842
  6. package/dist/automated-config/dist/generated/generatedConfigs.d.cts +1 -194
  7. package/dist/automated-config/dist/generated/generatedConfigs.d.ts +1 -194
  8. package/dist/automated-config/dist/generated/generatedConfigs.js +1 -1842
  9. package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +0 -78
  10. package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +1 -2
  11. package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +1 -2
  12. package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +0 -78
  13. package/dist/cli/commands/sync.cjs +0 -6
  14. package/dist/cli/commands/sync.js +0 -6
  15. package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
  16. package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
  17. package/dist/components/client/Toast/Toast.cjs +3 -3
  18. package/dist/components/client/Toast/Toast.d.cts +1 -1
  19. package/dist/components/client/Toast/Toast.d.ts +1 -1
  20. package/dist/components/client/Toast/Toast.js +3 -3
  21. package/dist/components/client/Toast/index.d.cts +1 -1
  22. package/dist/components/client/Toast/index.d.ts +1 -1
  23. package/dist/components/client/Tooltip/Tooltip.cjs +6 -6
  24. package/dist/components/client/Tooltip/Tooltip.d.cts +1 -1
  25. package/dist/components/client/Tooltip/Tooltip.d.ts +1 -1
  26. package/dist/components/client/Tooltip/Tooltip.js +6 -6
  27. package/dist/components/client/Tooltip/TooltipContent.cjs +96 -33
  28. package/dist/components/client/Tooltip/TooltipContent.js +97 -34
  29. package/dist/components/client/Tooltip/tooltipContext.cjs +1 -0
  30. package/dist/components/client/Tooltip/tooltipContext.d.cts +2 -1
  31. package/dist/components/client/Tooltip/tooltipContext.d.ts +2 -1
  32. package/dist/components/client/Tooltip/tooltipContext.js +1 -0
  33. package/dist/components/client/Tooltip/useTooltipContent.cjs +186 -0
  34. package/dist/components/client/Tooltip/useTooltipContent.d.cts +66 -0
  35. package/dist/components/client/Tooltip/useTooltipContent.d.ts +66 -0
  36. package/dist/{hooks/useSvgFloatingContent.js → components/client/Tooltip/useTooltipContent.js} +44 -94
  37. package/dist/components/client/Tooltip/util.cjs +248 -0
  38. package/dist/{utils/svgFloatingContentUtils.d.cts → components/client/Tooltip/util.d.cts} +62 -25
  39. package/dist/{utils/svgFloatingContentUtils.d.ts → components/client/Tooltip/util.d.ts} +62 -25
  40. package/dist/components/client/Tooltip/util.js +240 -0
  41. package/dist/components/client/index.cjs +0 -8
  42. package/dist/components/client/index.d.cts +5 -10
  43. package/dist/components/client/index.d.ts +5 -10
  44. package/dist/components/client/index.js +1 -5
  45. package/dist/components/client/providers/UDSConfigProvider.cjs +2 -6
  46. package/dist/components/client/providers/UDSConfigProvider.d.cts +1 -2
  47. package/dist/components/client/providers/UDSConfigProvider.d.ts +1 -2
  48. package/dist/components/client/providers/UDSConfigProvider.js +2 -6
  49. package/dist/components/experimental/client/{ExperimentalPopover.cjs → Popover.cjs} +1 -10
  50. package/dist/components/experimental/client/Popover.d.cts +29 -0
  51. package/dist/components/experimental/client/Popover.d.ts +29 -0
  52. package/dist/components/experimental/client/{ExperimentalPopover.js → Popover.js} +1 -10
  53. package/dist/components/experimental/client/index.cjs +10 -10
  54. package/dist/components/experimental/client/index.d.cts +2 -2
  55. package/dist/components/experimental/client/index.d.ts +2 -2
  56. package/dist/components/experimental/client/index.js +1 -1
  57. package/dist/components/experimental/index.cjs +19 -19
  58. package/dist/components/experimental/index.d.cts +2 -2
  59. package/dist/components/experimental/index.d.ts +2 -2
  60. package/dist/components/experimental/index.js +1 -1
  61. package/dist/components/index.cjs +0 -12
  62. package/dist/components/index.d.cts +5 -9
  63. package/dist/components/index.d.ts +5 -9
  64. package/dist/components/index.js +1 -9
  65. package/dist/config/dist/index.cjs +1 -79
  66. package/dist/config/dist/index.js +1 -79
  67. package/dist/index.cjs +10 -21
  68. package/dist/index.d.cts +10 -15
  69. package/dist/index.d.ts +10 -15
  70. package/dist/index.js +11 -16
  71. package/dist/runtime/index.cjs +0 -2
  72. package/dist/runtime/index.d.cts +2 -3
  73. package/dist/runtime/index.d.ts +2 -3
  74. package/dist/runtime/index.js +1 -2
  75. package/dist/runtime/udsConfig.cjs +1 -3
  76. package/dist/runtime/udsConfig.d.cts +1 -3
  77. package/dist/runtime/udsConfig.d.ts +1 -3
  78. package/dist/runtime/udsConfig.js +1 -3
  79. package/dist/styles/styler.d.cts +44 -54
  80. package/dist/styles/styler.d.ts +44 -54
  81. package/dist/styles/variants.d.cts +0 -30
  82. package/dist/styles/variants.d.ts +0 -30
  83. package/dist/tailwind/dist/commands/css.helpers.cjs +6 -2
  84. package/dist/tailwind/dist/commands/css.helpers.js +6 -2
  85. package/dist/tailwind/dist/commands/generateComponentData.cjs +2 -0
  86. package/dist/tailwind/dist/commands/generateComponentData.js +3 -1
  87. package/dist/tailwind/dist/commands/generatePurgeCSSData.cjs +3 -8
  88. package/dist/tailwind/dist/commands/generatePurgeCSSData.js +3 -8
  89. package/dist/tailwind/dist/commands/purge.cjs +2 -2
  90. package/dist/tailwind/dist/commands/purge.js +2 -2
  91. package/dist/tailwind/dist/css/generate.cjs +6 -4
  92. package/dist/tailwind/dist/css/generate.helpers.cjs +4 -1
  93. package/dist/tailwind/dist/css/generate.helpers.js +4 -1
  94. package/dist/tailwind/dist/css/generate.js +7 -5
  95. package/dist/tailwind/dist/css/nodeUtils.cjs +30 -2
  96. package/dist/tailwind/dist/css/nodeUtils.js +30 -3
  97. package/dist/tailwind/dist/css/postcss.cjs +1 -1
  98. package/dist/tailwind/dist/css/postcss.helpers.cjs +8 -6
  99. package/dist/tailwind/dist/css/postcss.helpers.js +8 -6
  100. package/dist/tailwind/dist/css/postcss.js +1 -1
  101. package/dist/tailwind/dist/css/runner.cjs +52 -19
  102. package/dist/tailwind/dist/css/runner.helpers.cjs +2 -2
  103. package/dist/tailwind/dist/css/runner.helpers.js +2 -2
  104. package/dist/tailwind/dist/css/runner.js +53 -20
  105. package/dist/tailwind/dist/css/theme.d.cts +2 -2
  106. package/dist/tailwind/dist/css/theme.d.ts +2 -2
  107. package/dist/tailwind/dist/purger/legacy/purgeCSS.cjs +19 -8
  108. package/dist/tailwind/dist/purger/legacy/purgeCSS.js +19 -8
  109. package/dist/tailwind/dist/purger/optimized/purge.cjs +2 -1
  110. package/dist/tailwind/dist/purger/optimized/purge.js +2 -1
  111. package/dist/tailwind/dist/purger/optimized/purgeFromCode.cjs +22 -2
  112. package/dist/tailwind/dist/purger/optimized/purgeFromCode.js +22 -2
  113. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.cjs +5 -4
  114. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js +5 -4
  115. package/dist/tailwind/dist/purger/optimized/utils/files.cjs +12 -10
  116. package/dist/tailwind/dist/purger/optimized/utils/files.js +12 -9
  117. package/dist/tailwind/dist/tailwind/plugins/components.cjs +0 -1
  118. package/dist/tailwind/dist/tailwind/plugins/components.js +1 -2
  119. package/dist/tailwind/dist/tailwind/plugins/getTailwindAsUdsColors.cjs +294 -10
  120. package/dist/tailwind/dist/tailwind/plugins/getTailwindAsUdsColors.js +294 -9
  121. package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.cts +1 -1
  122. package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.ts +1 -1
  123. package/dist/tailwind/dist/utils/entryPoints.cjs +63 -0
  124. package/dist/tailwind/dist/utils/entryPoints.js +55 -0
  125. package/dist/tokens/automation/configs/index.cjs +0 -1
  126. package/dist/tokens/automation/configs/index.d.cts +2 -2
  127. package/dist/tokens/automation/configs/index.d.ts +2 -2
  128. package/dist/tokens/automation/configs/index.js +2 -2
  129. package/dist/tokens/automation/index.cjs +0 -1
  130. package/dist/tokens/automation/index.d.cts +2 -2
  131. package/dist/tokens/automation/index.d.ts +2 -2
  132. package/dist/tokens/automation/index.js +2 -2
  133. package/dist/tokens/index.cjs +1 -2
  134. package/dist/tokens/index.d.cts +3 -3
  135. package/dist/tokens/index.d.ts +3 -3
  136. package/dist/tokens/index.js +3 -3
  137. package/dist/tokens/types.d.cts +2 -2
  138. package/dist/tokens/types.d.ts +2 -2
  139. package/dist/types/dist/index.d.cts +1 -51
  140. package/dist/types/dist/index.d.ts +1 -51
  141. package/dist/uds/generated/componentData.cjs +149 -293
  142. package/dist/uds/generated/componentData.js +144 -258
  143. package/dist/uds/generated/tailwindPurge.cjs +222 -249
  144. package/dist/uds/generated/tailwindPurge.js +222 -249
  145. package/dist/uds/package.cjs +2 -2
  146. package/dist/uds/package.js +2 -2
  147. package/generated/componentData.json +161 -309
  148. package/generated/tailwindPurge.ts +5 -4604
  149. package/package.json +3 -3
  150. package/dist/components/SvgFloatingOverlay.cjs +0 -122
  151. package/dist/components/SvgFloatingOverlay.d.cts +0 -42
  152. package/dist/components/SvgFloatingOverlay.d.ts +0 -42
  153. package/dist/components/SvgFloatingOverlay.js +0 -120
  154. package/dist/components/client/Popover/Popover.cjs +0 -96
  155. package/dist/components/client/Popover/Popover.d.cts +0 -55
  156. package/dist/components/client/Popover/Popover.d.ts +0 -55
  157. package/dist/components/client/Popover/Popover.js +0 -94
  158. package/dist/components/client/Popover/PopoverContent.cjs +0 -174
  159. package/dist/components/client/Popover/PopoverContent.d.cts +0 -26
  160. package/dist/components/client/Popover/PopoverContent.d.ts +0 -26
  161. package/dist/components/client/Popover/PopoverContent.js +0 -172
  162. package/dist/components/client/Popover/PopoverContext.cjs +0 -11
  163. package/dist/components/client/Popover/PopoverContext.d.cts +0 -21
  164. package/dist/components/client/Popover/PopoverContext.d.ts +0 -21
  165. package/dist/components/client/Popover/PopoverContext.js +0 -9
  166. package/dist/components/client/Popover/PopoverTrigger.cjs +0 -26
  167. package/dist/components/client/Popover/PopoverTrigger.d.cts +0 -14
  168. package/dist/components/client/Popover/PopoverTrigger.d.ts +0 -14
  169. package/dist/components/client/Popover/PopoverTrigger.js +0 -24
  170. package/dist/components/client/Popover/UDSPopoverConfigProvider.cjs +0 -40
  171. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +0 -28
  172. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +0 -28
  173. package/dist/components/client/Popover/UDSPopoverConfigProvider.js +0 -37
  174. package/dist/components/client/Popover/index.cjs +0 -12
  175. package/dist/components/client/Popover/index.d.cts +0 -7
  176. package/dist/components/client/Popover/index.d.ts +0 -7
  177. package/dist/components/client/Popover/index.js +0 -8
  178. package/dist/components/experimental/client/ExperimentalPopover.d.cts +0 -40
  179. package/dist/components/experimental/client/ExperimentalPopover.d.ts +0 -40
  180. package/dist/hooks/useSvgFloatingContent.cjs +0 -236
  181. package/dist/hooks/useSvgFloatingContent.d.cts +0 -74
  182. package/dist/hooks/useSvgFloatingContent.d.ts +0 -74
  183. package/dist/runtime/popoverConfig.cjs +0 -41
  184. package/dist/runtime/popoverConfig.d.cts +0 -24
  185. package/dist/runtime/popoverConfig.d.ts +0 -24
  186. package/dist/runtime/popoverConfig.js +0 -40
  187. package/dist/tailwind/dist/.prettierrc.cjs +0 -13
  188. package/dist/tailwind/dist/.prettierrc.js +0 -12
  189. package/dist/utils/parseShadow.cjs +0 -120
  190. package/dist/utils/parseShadow.d.cts +0 -33
  191. package/dist/utils/parseShadow.d.ts +0 -33
  192. package/dist/utils/parseShadow.js +0 -118
  193. package/dist/utils/svgFloatingContentUtils.cjs +0 -121
  194. package/dist/utils/svgFloatingContentUtils.js +0 -117
@@ -3,6 +3,7 @@ const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
3
3
  const require_index = require('../../../config/dist/index.cjs');
4
4
  const require_colors = require('../../../cli/dist/lib/colors.cjs');
5
5
  const require_print = require('../../../cli/dist/lib/print.cjs');
6
+ const require_entryPoints = require('../utils/entryPoints.cjs');
6
7
  const require_spinner = require('../../../cli/dist/lib/spinner.cjs');
7
8
  const require_logger = require('../../../cli/dist/lib/logger.cjs');
8
9
  const require_nodeUtils = require('./nodeUtils.cjs');
@@ -17,13 +18,34 @@ node_fs = require_runtime.__toESM(node_fs);
17
18
 
18
19
  //#region ../tailwind/dist/css/runner.js
19
20
  /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
20
- const DEFAULT_ENTRY = "./src";
21
21
  const SOURCE_FILE_PATTERN = /\.(jsx?|tsx?)$/i;
22
22
  const getWatchDirs = (dirs) => [...new Set(dirs.filter((dir) => !dir.split(node_path.default.sep).includes("node_modules")))];
23
- const watchSourceFiles = (dirs, onFileChange) => {
24
- dirs.forEach((dir) => {
25
- node_fs.default.watch(dir, { recursive: true }, (_eventType, filename) => {
26
- if (filename && SOURCE_FILE_PATTERN.test(filename)) onFileChange();
23
+ const isCoveredByRecursiveWatch = (watchPath, targetPath) => targetPath === watchPath || targetPath.startsWith(`${watchPath}${node_path.default.sep}`);
24
+ const getEntryWatchTargets = (entries) => {
25
+ const directoryTargets = getWatchDirs(entries.filter((entry) => entry.kind === "directory").map((entry) => entry.absolutePath)).map((watchPath) => ({
26
+ watchPath,
27
+ recursive: true
28
+ }));
29
+ const fileNamesByDirectory = /* @__PURE__ */ new Map();
30
+ entries.filter((entry) => entry.kind === "file" && typeof entry.fileName === "string").forEach((entry) => {
31
+ if (directoryTargets.some((target) => isCoveredByRecursiveWatch(target.watchPath, entry.absolutePath))) return;
32
+ const fileNames = fileNamesByDirectory.get(entry.watchDirectory) ?? /* @__PURE__ */ new Set();
33
+ fileNames.add(entry.fileName);
34
+ fileNamesByDirectory.set(entry.watchDirectory, fileNames);
35
+ });
36
+ const fileTargets = [...fileNamesByDirectory.entries()].map(([watchPath, fileNames]) => ({
37
+ watchPath,
38
+ recursive: false,
39
+ fileNames: [...fileNames]
40
+ }));
41
+ return [...directoryTargets, ...fileTargets];
42
+ };
43
+ const watchSourceFiles = (targets, onFileChange) => {
44
+ targets.forEach((target) => {
45
+ node_fs.default.watch(target.watchPath, { recursive: target.recursive }, (_eventType, filename) => {
46
+ if (!filename || !SOURCE_FILE_PATTERN.test(filename)) return;
47
+ if (target.fileNames && !target.fileNames.includes(node_path.default.basename(String(filename)))) return;
48
+ onFileChange();
27
49
  });
28
50
  });
29
51
  };
@@ -68,7 +90,7 @@ const runCssCommand = async (options, context) => {
68
90
  await runThemeMode(options, context);
69
91
  };
70
92
  const runSimpleMode = async (options, context) => {
71
- const entry = typeof options.entryOption === "string" ? options.entryOption : DEFAULT_ENTRY;
93
+ const entry = options.entryOption ?? require_entryPoints.DEFAULT_ENTRY;
72
94
  const configPath = typeof options.configOption === "string" ? options.configOption : void 0;
73
95
  if (!options.watch && !options.silent) require_spinner.spinStart("Generating CSS...");
74
96
  try {
@@ -91,12 +113,16 @@ const runSimpleMode = async (options, context) => {
91
113
  }
92
114
  };
93
115
  const runSimpleModeWatch = async (options, context, entry, configPath, packageDirs) => {
94
- const entryDir = node_path.default.join(options.workspaceDir, entry);
95
- const watchDirs = getWatchDirs(packageDirs.length > 0 ? packageDirs : [entryDir]);
116
+ const entryWatchTargets = getEntryWatchTargets(require_entryPoints.resolveEntryPaths(entry, options.workspaceDir));
117
+ const fallbackTargets = getWatchDirs(packageDirs).map((watchPath) => ({
118
+ watchPath,
119
+ recursive: true
120
+ }));
121
+ const watchTargets = packageDirs.length > 0 ? fallbackTargets : entryWatchTargets;
96
122
  if (!options.silent) {
97
123
  require_print.print("");
98
124
  require_print.print(`${require_colors.magenta("Watching for changes...")}`);
99
- watchDirs.forEach((dir) => require_print.print(` ${require_colors.gray("•")} ${dir}`));
125
+ watchTargets.forEach((target) => require_print.print(` ${require_colors.gray("•")} ${target.watchPath}`));
100
126
  require_print.print(`${require_colors.gray("Press Ctrl+C to stop")}`);
101
127
  require_print.print("");
102
128
  }
@@ -128,7 +154,7 @@ const runSimpleModeWatch = async (options, context, entry, configPath, packageDi
128
154
  require_print.print(`Error: ${message}`);
129
155
  }
130
156
  });
131
- watchSourceFiles(watchDirs, createDebouncedAction(() => {
157
+ watchSourceFiles(watchTargets, createDebouncedAction(() => {
132
158
  regenerate();
133
159
  }, 100));
134
160
  await new Promise(() => {});
@@ -149,7 +175,7 @@ const loadThemeModeSetup = async (options) => {
149
175
  return {
150
176
  themeConfig,
151
177
  colorModes: themeConfig.colorModes ?? ["dark"],
152
- entry: themeConfig.entry ?? "/src/",
178
+ entries: require_entryPoints.resolveEntryPaths(themeConfig.entry, options.workspaceDir),
153
179
  appConfig,
154
180
  appVariantDefaults: require_utils.extractVariantDefaults(appConfig),
155
181
  effectiveSilent: options.silent || themeConfig.silent === true
@@ -168,9 +194,10 @@ const runThemeMode = async (options, context) => {
168
194
  process.exitCode = 1;
169
195
  return;
170
196
  }
171
- const { themeConfig, colorModes, entry, appConfig, appVariantDefaults } = setup;
197
+ const { themeConfig, colorModes, entries, appConfig, appVariantDefaults } = setup;
172
198
  effectiveSilent = setup.effectiveSilent;
173
199
  log = require_logger.createLogger({ silent: effectiveSilent });
200
+ const entryDirs = entries.map((entry) => entry.absolutePath);
174
201
  if (!effectiveSilent) log.spinStop("✅", "Theme configuration loaded");
175
202
  if (themeConfig.config && appConfig === require_index.defaultTokensConfig) log.warn(`App config not found: ${themeConfig.config}, using defaults`);
176
203
  const packageDirs = [];
@@ -178,7 +205,7 @@ const runThemeMode = async (options, context) => {
178
205
  const genStartTime = performance.now();
179
206
  const genLog = opts?.isWatch ? require_logger.createLogger({ silent: true }) : log;
180
207
  genLog.spinStart("Scanning app code...");
181
- const appScanResult = await require_nodeUtils.scanDirectoryForSafelist(node_path.default.join(workspaceDir, entry), colorModes, context.variants, context.autoVariants, context.componentData, appVariantDefaults);
208
+ const appScanResult = await require_nodeUtils.scanDirectoriesForSafelist(entryDirs, colorModes, context.variants, context.autoVariants, context.componentData, appVariantDefaults);
182
209
  genLog.spinStop("✅", `Scanned ${appScanResult.filesScanned} files`);
183
210
  genLog.spinStart("Generating main CSS...");
184
211
  const inheritedClasses = [...appScanResult.safelist];
@@ -204,7 +231,7 @@ const runThemeMode = async (options, context) => {
204
231
  const allMotionComponents = [...inheritedComponents];
205
232
  const mainCssResult = await require_generate.generateCSS([...themeConfig.css?.safelist ?? [], ...mainSafelist], appConfig, {
206
233
  scope: options.scope,
207
- contentDir: node_path.default.join(workspaceDir, entry),
234
+ contentDir: entryDirs,
208
235
  cssOptions: themeConfig.css,
209
236
  safeVarPrefixes: [...require_utils.getMotionVarPrefixes(context.componentData, allMotionComponents), ...require_utils.getConfigurableCssVariables()]
210
237
  });
@@ -231,12 +258,14 @@ const runThemeMode = async (options, context) => {
231
258
  };
232
259
  await generateThemeModeCSS();
233
260
  if (options.watch) {
234
- const entryDir = node_path.default.join(workspaceDir, entry);
235
- const { watchDirs, filteredPackageDirs } = require_runner_helpers.getWatchDirectoryGroups(entryDir, [entryDir, ...packageDirs]);
261
+ const entryWatchTargets = getEntryWatchTargets(entries);
262
+ const { filteredPackageDirs } = require_runner_helpers.getWatchDirectoryGroups(getWatchDirs(entryWatchTargets.map((target) => target.watchPath)), [...entryDirs, ...packageDirs]);
236
263
  if (!effectiveSilent) {
237
264
  log.newline();
238
265
  log.print(`${require_colors.magenta("Watching for changes...")}`);
239
- log.listItem(`App: ${entryDir}`);
266
+ entryDirs.forEach((entryDir) => {
267
+ log.listItem(`App: ${entryDir}`);
268
+ });
240
269
  filteredPackageDirs.forEach((dir) => {
241
270
  log.listItem(`Package: ${dir}`);
242
271
  });
@@ -262,9 +291,13 @@ const runThemeMode = async (options, context) => {
262
291
  log.print(message);
263
292
  }
264
293
  });
265
- watchSourceFiles(watchDirs, createDebouncedAction(() => {
294
+ const watchDebounce = themeConfig.css?.watchDebounce ?? 100;
295
+ watchSourceFiles([...entryWatchTargets, ...filteredPackageDirs.filter((packageDir) => !entryWatchTargets.some((target) => isCoveredByRecursiveWatch(target.watchPath, packageDir))).map((watchPath) => ({
296
+ watchPath,
297
+ recursive: true
298
+ }))], createDebouncedAction(() => {
266
299
  regenerate();
267
- }, themeConfig.css?.watchDebounce ?? 100));
300
+ }, watchDebounce));
268
301
  await new Promise(() => {});
269
302
  }
270
303
  } catch (error) {
@@ -13,11 +13,11 @@ const getMainCssSummaryMessage = (options) => {
13
13
  if (savedBytesGzip <= 0) return `Main CSS: ${formatBytes(sizeGzipBytes)} gzip`;
14
14
  return `Main CSS: ${formatBytes(sizeGzipBytes)} gzip)(optimized: saved ${formatBytes(savedBytesGzip)} gzip, ${fontFacesRemoved} unused @font-face, ${emptyRulesRemoved} empty rules removed)`;
15
15
  };
16
- const getWatchDirectoryGroups = (entryDir, dirs) => {
16
+ const getWatchDirectoryGroups = (entryDirs, dirs) => {
17
17
  const watchDirs = [...new Set(dirs.filter((dir) => !dir.split(node_path.default.sep).includes("node_modules")))];
18
18
  return {
19
19
  watchDirs,
20
- filteredPackageDirs: watchDirs.filter((dir) => dir !== entryDir)
20
+ filteredPackageDirs: watchDirs.filter((dir) => !entryDirs.includes(dir))
21
21
  };
22
22
  };
23
23
 
@@ -11,11 +11,11 @@ const getMainCssSummaryMessage = (options) => {
11
11
  if (savedBytesGzip <= 0) return `Main CSS: ${formatBytes(sizeGzipBytes)} gzip`;
12
12
  return `Main CSS: ${formatBytes(sizeGzipBytes)} gzip)(optimized: saved ${formatBytes(savedBytesGzip)} gzip, ${fontFacesRemoved} unused @font-face, ${emptyRulesRemoved} empty rules removed)`;
13
13
  };
14
- const getWatchDirectoryGroups = (entryDir, dirs) => {
14
+ const getWatchDirectoryGroups = (entryDirs, dirs) => {
15
15
  const watchDirs = [...new Set(dirs.filter((dir) => !dir.split(path.sep).includes("node_modules")))];
16
16
  return {
17
17
  watchDirs,
18
- filteredPackageDirs: watchDirs.filter((dir) => dir !== entryDir)
18
+ filteredPackageDirs: watchDirs.filter((dir) => !entryDirs.includes(dir))
19
19
  };
20
20
  };
21
21
 
@@ -2,9 +2,10 @@
2
2
  import { defaultTokensConfig } from "../../../config/dist/index.js";
3
3
  import { gray, green, magenta } from "../../../cli/dist/lib/colors.js";
4
4
  import { print } from "../../../cli/dist/lib/print.js";
5
+ import { DEFAULT_ENTRY, resolveEntryPaths } from "../utils/entryPoints.js";
5
6
  import { spinStart, spinStop } from "../../../cli/dist/lib/spinner.js";
6
7
  import { createLogger } from "../../../cli/dist/lib/logger.js";
7
- import { findPackageSourceDir, loadConfigFile, scanDirectoryForSafelist } from "./nodeUtils.js";
8
+ import { findPackageSourceDir, loadConfigFile, scanDirectoriesForSafelist, scanDirectoryForSafelist } from "./nodeUtils.js";
8
9
  import { deduplicateSafelist, getThemeAndScaleClasses } from "../purger/optimized/utils/safelist.js";
9
10
  import { extractVariantDefaults, formatBytes, getConfigurableCssVariables, getMotionVarPrefixes } from "./utils.js";
10
11
  import { generateCSS, generateSimpleModeCSS } from "./generate.js";
@@ -14,13 +15,34 @@ import fs from "node:fs";
14
15
 
15
16
  //#region ../tailwind/dist/css/runner.js
16
17
  /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
17
- const DEFAULT_ENTRY = "./src";
18
18
  const SOURCE_FILE_PATTERN = /\.(jsx?|tsx?)$/i;
19
19
  const getWatchDirs = (dirs) => [...new Set(dirs.filter((dir) => !dir.split(path.sep).includes("node_modules")))];
20
- const watchSourceFiles = (dirs, onFileChange) => {
21
- dirs.forEach((dir) => {
22
- fs.watch(dir, { recursive: true }, (_eventType, filename) => {
23
- if (filename && SOURCE_FILE_PATTERN.test(filename)) onFileChange();
20
+ const isCoveredByRecursiveWatch = (watchPath, targetPath) => targetPath === watchPath || targetPath.startsWith(`${watchPath}${path.sep}`);
21
+ const getEntryWatchTargets = (entries) => {
22
+ const directoryTargets = getWatchDirs(entries.filter((entry) => entry.kind === "directory").map((entry) => entry.absolutePath)).map((watchPath) => ({
23
+ watchPath,
24
+ recursive: true
25
+ }));
26
+ const fileNamesByDirectory = /* @__PURE__ */ new Map();
27
+ entries.filter((entry) => entry.kind === "file" && typeof entry.fileName === "string").forEach((entry) => {
28
+ if (directoryTargets.some((target) => isCoveredByRecursiveWatch(target.watchPath, entry.absolutePath))) return;
29
+ const fileNames = fileNamesByDirectory.get(entry.watchDirectory) ?? /* @__PURE__ */ new Set();
30
+ fileNames.add(entry.fileName);
31
+ fileNamesByDirectory.set(entry.watchDirectory, fileNames);
32
+ });
33
+ const fileTargets = [...fileNamesByDirectory.entries()].map(([watchPath, fileNames]) => ({
34
+ watchPath,
35
+ recursive: false,
36
+ fileNames: [...fileNames]
37
+ }));
38
+ return [...directoryTargets, ...fileTargets];
39
+ };
40
+ const watchSourceFiles = (targets, onFileChange) => {
41
+ targets.forEach((target) => {
42
+ fs.watch(target.watchPath, { recursive: target.recursive }, (_eventType, filename) => {
43
+ if (!filename || !SOURCE_FILE_PATTERN.test(filename)) return;
44
+ if (target.fileNames && !target.fileNames.includes(path.basename(String(filename)))) return;
45
+ onFileChange();
24
46
  });
25
47
  });
26
48
  };
@@ -65,7 +87,7 @@ const runCssCommand = async (options, context) => {
65
87
  await runThemeMode(options, context);
66
88
  };
67
89
  const runSimpleMode = async (options, context) => {
68
- const entry = typeof options.entryOption === "string" ? options.entryOption : DEFAULT_ENTRY;
90
+ const entry = options.entryOption ?? DEFAULT_ENTRY;
69
91
  const configPath = typeof options.configOption === "string" ? options.configOption : void 0;
70
92
  if (!options.watch && !options.silent) spinStart("Generating CSS...");
71
93
  try {
@@ -88,12 +110,16 @@ const runSimpleMode = async (options, context) => {
88
110
  }
89
111
  };
90
112
  const runSimpleModeWatch = async (options, context, entry, configPath, packageDirs) => {
91
- const entryDir = path.join(options.workspaceDir, entry);
92
- const watchDirs = getWatchDirs(packageDirs.length > 0 ? packageDirs : [entryDir]);
113
+ const entryWatchTargets = getEntryWatchTargets(resolveEntryPaths(entry, options.workspaceDir));
114
+ const fallbackTargets = getWatchDirs(packageDirs).map((watchPath) => ({
115
+ watchPath,
116
+ recursive: true
117
+ }));
118
+ const watchTargets = packageDirs.length > 0 ? fallbackTargets : entryWatchTargets;
93
119
  if (!options.silent) {
94
120
  print("");
95
121
  print(`${magenta("Watching for changes...")}`);
96
- watchDirs.forEach((dir) => print(` ${gray("•")} ${dir}`));
122
+ watchTargets.forEach((target) => print(` ${gray("•")} ${target.watchPath}`));
97
123
  print(`${gray("Press Ctrl+C to stop")}`);
98
124
  print("");
99
125
  }
@@ -125,7 +151,7 @@ const runSimpleModeWatch = async (options, context, entry, configPath, packageDi
125
151
  print(`Error: ${message}`);
126
152
  }
127
153
  });
128
- watchSourceFiles(watchDirs, createDebouncedAction(() => {
154
+ watchSourceFiles(watchTargets, createDebouncedAction(() => {
129
155
  regenerate();
130
156
  }, 100));
131
157
  await new Promise(() => {});
@@ -146,7 +172,7 @@ const loadThemeModeSetup = async (options) => {
146
172
  return {
147
173
  themeConfig,
148
174
  colorModes: themeConfig.colorModes ?? ["dark"],
149
- entry: themeConfig.entry ?? "/src/",
175
+ entries: resolveEntryPaths(themeConfig.entry, options.workspaceDir),
150
176
  appConfig,
151
177
  appVariantDefaults: extractVariantDefaults(appConfig),
152
178
  effectiveSilent: options.silent || themeConfig.silent === true
@@ -165,9 +191,10 @@ const runThemeMode = async (options, context) => {
165
191
  process.exitCode = 1;
166
192
  return;
167
193
  }
168
- const { themeConfig, colorModes, entry, appConfig, appVariantDefaults } = setup;
194
+ const { themeConfig, colorModes, entries, appConfig, appVariantDefaults } = setup;
169
195
  effectiveSilent = setup.effectiveSilent;
170
196
  log = createLogger({ silent: effectiveSilent });
197
+ const entryDirs = entries.map((entry) => entry.absolutePath);
171
198
  if (!effectiveSilent) log.spinStop("✅", "Theme configuration loaded");
172
199
  if (themeConfig.config && appConfig === defaultTokensConfig) log.warn(`App config not found: ${themeConfig.config}, using defaults`);
173
200
  const packageDirs = [];
@@ -175,7 +202,7 @@ const runThemeMode = async (options, context) => {
175
202
  const genStartTime = performance.now();
176
203
  const genLog = opts?.isWatch ? createLogger({ silent: true }) : log;
177
204
  genLog.spinStart("Scanning app code...");
178
- const appScanResult = await scanDirectoryForSafelist(path.join(workspaceDir, entry), colorModes, context.variants, context.autoVariants, context.componentData, appVariantDefaults);
205
+ const appScanResult = await scanDirectoriesForSafelist(entryDirs, colorModes, context.variants, context.autoVariants, context.componentData, appVariantDefaults);
179
206
  genLog.spinStop("✅", `Scanned ${appScanResult.filesScanned} files`);
180
207
  genLog.spinStart("Generating main CSS...");
181
208
  const inheritedClasses = [...appScanResult.safelist];
@@ -201,7 +228,7 @@ const runThemeMode = async (options, context) => {
201
228
  const allMotionComponents = [...inheritedComponents];
202
229
  const mainCssResult = await generateCSS([...themeConfig.css?.safelist ?? [], ...mainSafelist], appConfig, {
203
230
  scope: options.scope,
204
- contentDir: path.join(workspaceDir, entry),
231
+ contentDir: entryDirs,
205
232
  cssOptions: themeConfig.css,
206
233
  safeVarPrefixes: [...getMotionVarPrefixes(context.componentData, allMotionComponents), ...getConfigurableCssVariables()]
207
234
  });
@@ -228,12 +255,14 @@ const runThemeMode = async (options, context) => {
228
255
  };
229
256
  await generateThemeModeCSS();
230
257
  if (options.watch) {
231
- const entryDir = path.join(workspaceDir, entry);
232
- const { watchDirs, filteredPackageDirs } = getWatchDirectoryGroups(entryDir, [entryDir, ...packageDirs]);
258
+ const entryWatchTargets = getEntryWatchTargets(entries);
259
+ const { filteredPackageDirs } = getWatchDirectoryGroups(getWatchDirs(entryWatchTargets.map((target) => target.watchPath)), [...entryDirs, ...packageDirs]);
233
260
  if (!effectiveSilent) {
234
261
  log.newline();
235
262
  log.print(`${magenta("Watching for changes...")}`);
236
- log.listItem(`App: ${entryDir}`);
263
+ entryDirs.forEach((entryDir) => {
264
+ log.listItem(`App: ${entryDir}`);
265
+ });
237
266
  filteredPackageDirs.forEach((dir) => {
238
267
  log.listItem(`Package: ${dir}`);
239
268
  });
@@ -259,9 +288,13 @@ const runThemeMode = async (options, context) => {
259
288
  log.print(message);
260
289
  }
261
290
  });
262
- watchSourceFiles(watchDirs, createDebouncedAction(() => {
291
+ const watchDebounce = themeConfig.css?.watchDebounce ?? 100;
292
+ watchSourceFiles([...entryWatchTargets, ...filteredPackageDirs.filter((packageDir) => !entryWatchTargets.some((target) => isCoveredByRecursiveWatch(target.watchPath, packageDir))).map((watchPath) => ({
293
+ watchPath,
294
+ recursive: true
295
+ }))], createDebouncedAction(() => {
263
296
  regenerate();
264
- }, themeConfig.css?.watchDebounce ?? 100));
297
+ }, watchDebounce));
265
298
  await new Promise(() => {});
266
299
  }
267
300
  } catch (error) {
@@ -39,8 +39,8 @@ interface UDSCSSOptimizationOptions {
39
39
  interface UDSThemeConfig {
40
40
  /** Path to app's uds.config (relative to project root) */
41
41
  config?: string;
42
- /** Entry directory for app code scanning (default: '/src/') */
43
- entry?: string;
42
+ /** Entry directory path or .tsx file path, or a list of those paths (default: './src') */
43
+ entry?: string | string[];
44
44
  /** Suppress log output during generation (default: false) */
45
45
  silent?: boolean;
46
46
  /**
@@ -39,8 +39,8 @@ interface UDSCSSOptimizationOptions {
39
39
  interface UDSThemeConfig {
40
40
  /** Path to app's uds.config (relative to project root) */
41
41
  config?: string;
42
- /** Entry directory for app code scanning (default: '/src/') */
43
- entry?: string;
42
+ /** Entry directory path or .tsx file path, or a list of those paths (default: './src') */
43
+ entry?: string | string[];
44
44
  /** Suppress log output during generation (default: false) */
45
45
  silent?: boolean;
46
46
  /**
@@ -2,6 +2,7 @@
2
2
  const require_runtime = require('../../../../_virtual/_rolldown/runtime.cjs');
3
3
  const require_index = require('../../../../css-tokens/dist/index.cjs');
4
4
  const require_print = require('../../../../cli/dist/lib/print.cjs');
5
+ const require_entryPoints = require('../../utils/entryPoints.cjs');
5
6
  const require_spinner = require('../../../../cli/dist/lib/spinner.cjs');
6
7
  const require_tsMorph = require('../../utils/tsMorph.cjs');
7
8
  let node_path = require("node:path");
@@ -30,13 +31,17 @@ const getFiles = async (entry) => {
30
31
  try {
31
32
  const workspaceDir = process.env.PWD || process.cwd();
32
33
  if (!workspaceDir) throw new Error("Workspace directory not found.");
33
- return await (0, fast_glob.default)(["**/*.jsx", "**/*.tsx"], {
34
- cwd: node_path.default.join(workspaceDir, entry),
35
- absolute: true,
36
- ignore: ["**/node_modules/**"]
37
- });
38
- } catch {
39
- throw new Error(`Couldn't find the entry directory: ${entry}. Please make sure it exists.`);
34
+ const files = await Promise.all(require_entryPoints.resolveEntryPaths(entry, workspaceDir, require_entryPoints.DEFAULT_ENTRY).map((entryPath) => {
35
+ if (entryPath.kind === "file") return [entryPath.absolutePath];
36
+ return (0, fast_glob.default)(["**/*.jsx", "**/*.tsx"], {
37
+ cwd: entryPath.absolutePath,
38
+ absolute: true,
39
+ ignore: ["**/node_modules/**"]
40
+ });
41
+ }));
42
+ return [...new Set(files.flat())];
43
+ } catch (error) {
44
+ throw error instanceof Error ? error : /* @__PURE__ */ new Error(`Couldn't find the entry directory: ${entry}. Please make sure it exists.`);
40
45
  }
41
46
  };
42
47
  /**
@@ -219,7 +224,13 @@ const scanGetStylesReferences = (project, variants, packageJson) => {
219
224
  }
220
225
  return usedProps;
221
226
  };
222
- async function purge(variants, packageJson, generatedPurgeCssData, { config: configPath = process.env.UDS_OUT_FILE ?? "./uds.config.ts", output = "dist/safelist.ts", entry = "/src/" }) {
227
+ const applyPurgeDefaults = (options = {}) => ({
228
+ config: options.config ?? process.env.UDS_OUT_FILE ?? "./uds.config.ts",
229
+ output: options.output ?? "dist/safelist.ts",
230
+ entry: options.entry ?? require_entryPoints.DEFAULT_ENTRY
231
+ });
232
+ async function purge(variants, packageJson, generatedPurgeCssData, options = {}) {
233
+ const { config: configPath, output, entry } = applyPurgeDefaults(options);
223
234
  const workspaceDir = process.env.PWD || process.cwd();
224
235
  if (!workspaceDir) throw new Error("Workspace directory not found.");
225
236
  const project = new ts_morph.Project({ tsConfigFilePath: node_path.default.join(workspaceDir, "/tsconfig.json") });
@@ -1,6 +1,7 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
2
  import { DARK_COLOR_MODE_CLASSNAME, LARGE_SCALE_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME, MEDIUM_SCALE_MODE_CLASSNAME, SMALL_SCALE_MODE_CLASSNAME, XLARGE_SCALE_MODE_CLASSNAME, XSMALL_SCALE_MODE_CLASSNAME, XXLARGE_SCALE_MODE_CLASSNAME, XXXLARGE_SCALE_MODE_CLASSNAME } from "../../../../css-tokens/dist/index.js";
3
3
  import { print } from "../../../../cli/dist/lib/print.js";
4
+ import { DEFAULT_ENTRY, resolveEntryPaths } from "../../utils/entryPoints.js";
4
5
  import { spinStart, spinStop } from "../../../../cli/dist/lib/spinner.js";
5
6
  import { findReferencesAsJsxElements, getUsedPropsInReference } from "../../utils/tsMorph.js";
6
7
  import path from "node:path";
@@ -27,13 +28,17 @@ const getFiles = async (entry) => {
27
28
  try {
28
29
  const workspaceDir = process.env.PWD || process.cwd();
29
30
  if (!workspaceDir) throw new Error("Workspace directory not found.");
30
- return await fg(["**/*.jsx", "**/*.tsx"], {
31
- cwd: path.join(workspaceDir, entry),
32
- absolute: true,
33
- ignore: ["**/node_modules/**"]
34
- });
35
- } catch {
36
- throw new Error(`Couldn't find the entry directory: ${entry}. Please make sure it exists.`);
31
+ const files = await Promise.all(resolveEntryPaths(entry, workspaceDir, DEFAULT_ENTRY).map((entryPath) => {
32
+ if (entryPath.kind === "file") return [entryPath.absolutePath];
33
+ return fg(["**/*.jsx", "**/*.tsx"], {
34
+ cwd: entryPath.absolutePath,
35
+ absolute: true,
36
+ ignore: ["**/node_modules/**"]
37
+ });
38
+ }));
39
+ return [...new Set(files.flat())];
40
+ } catch (error) {
41
+ throw error instanceof Error ? error : /* @__PURE__ */ new Error(`Couldn't find the entry directory: ${entry}. Please make sure it exists.`);
37
42
  }
38
43
  };
39
44
  /**
@@ -216,7 +221,13 @@ const scanGetStylesReferences = (project, variants, packageJson) => {
216
221
  }
217
222
  return usedProps;
218
223
  };
219
- async function purge(variants, packageJson, generatedPurgeCssData, { config: configPath = process.env.UDS_OUT_FILE ?? "./uds.config.ts", output = "dist/safelist.ts", entry = "/src/" }) {
224
+ const applyPurgeDefaults = (options = {}) => ({
225
+ config: options.config ?? process.env.UDS_OUT_FILE ?? "./uds.config.ts",
226
+ output: options.output ?? "dist/safelist.ts",
227
+ entry: options.entry ?? DEFAULT_ENTRY
228
+ });
229
+ async function purge(variants, packageJson, generatedPurgeCssData, options = {}) {
230
+ const { config: configPath, output, entry } = applyPurgeDefaults(options);
220
231
  const workspaceDir = process.env.PWD || process.cwd();
221
232
  if (!workspaceDir) throw new Error("Workspace directory not found.");
222
233
  const project = new Project({ tsConfigFilePath: path.join(workspaceDir, "/tsconfig.json") });
@@ -1,6 +1,7 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
2
  const require_runtime = require('../../../../_virtual/_rolldown/runtime.cjs');
3
3
  const require_purgeFromCode = require('./purgeFromCode.cjs');
4
+ const require_entryPoints = require('../../utils/entryPoints.cjs');
4
5
  const require_safelist = require('./utils/safelist.cjs');
5
6
  const require_files = require('./utils/files.cjs');
6
7
  let node_path = require("node:path");
@@ -24,7 +25,7 @@ const clearWarnings = () => {
24
25
  * between CLI and playground.
25
26
  */
26
27
  const purgeOptimized = async (options) => {
27
- const { entry = "/src/", output = "dist/safelist.ts", colorModes = ["dark"], variants, autoVariants, componentData } = options;
28
+ const { entry = require_entryPoints.DEFAULT_ENTRY, output = "dist/safelist.ts", colorModes = ["dark"], variants, autoVariants, componentData } = options;
28
29
  const startTime = performance.now();
29
30
  clearWarnings();
30
31
  const workspaceDir = process.env.PWD ?? process.cwd();
@@ -1,5 +1,6 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
2
  import { purgeFromCodeOptimized } from "./purgeFromCode.js";
3
+ import { DEFAULT_ENTRY } from "../../utils/entryPoints.js";
3
4
  import { deduplicateSafelist, getThemeAndScaleClasses, saveSafelistToFile } from "./utils/safelist.js";
4
5
  import { scanForFiles } from "./utils/files.js";
5
6
  import path from "node:path";
@@ -21,7 +22,7 @@ const clearWarnings = () => {
21
22
  * between CLI and playground.
22
23
  */
23
24
  const purgeOptimized = async (options) => {
24
- const { entry = "/src/", output = "dist/safelist.ts", colorModes = ["dark"], variants, autoVariants, componentData } = options;
25
+ const { entry = DEFAULT_ENTRY, output = "dist/safelist.ts", colorModes = ["dark"], variants, autoVariants, componentData } = options;
25
26
  const startTime = performance.now();
26
27
  clearWarnings();
27
28
  const workspaceDir = process.env.PWD ?? process.cwd();
@@ -266,12 +266,32 @@ const purgeFromCodeOptimized = async (code, options) => {
266
266
  */
267
267
  const findComponentReferences = (sourceFile, componentName) => {
268
268
  const references = [];
269
+ const seenTags = /* @__PURE__ */ new Set();
270
+ const collectMatchingTags = (localName) => {
271
+ sourceFile.getDescendants().filter((node) => ts_morph.Node.isJsxOpeningElement(node) || ts_morph.Node.isJsxSelfClosingElement(node)).forEach((node) => {
272
+ const tagName = node.getTagNameNode().getText();
273
+ if (tagName === localName || tagName.startsWith(`${localName}.`)) {
274
+ const key = `${tagName}:${node.getStart()}`;
275
+ if (!seenTags.has(key)) {
276
+ seenTags.add(key);
277
+ references.push(node);
278
+ }
279
+ }
280
+ });
281
+ };
269
282
  sourceFile.getImportDeclarations().forEach((importDecl) => {
270
283
  if (!isUdsComponentModule(getModuleSpecifierValue(importDecl))) return;
271
284
  importDecl.getNamedImports().forEach((namedImport) => {
272
285
  if (namedImport.getName() === componentName) {
273
- const identifier = namedImport.getFirstDescendantByKindOrThrow(ts_morph.ts.SyntaxKind.Identifier);
274
- references.push(...require_jsx.findJsxReferences(identifier));
286
+ const localName = namedImport.getAliasNode()?.getText() ?? componentName;
287
+ require_jsx.findJsxReferences(namedImport.getFirstDescendantByKindOrThrow(ts_morph.ts.SyntaxKind.Identifier)).forEach((reference) => {
288
+ const key = `${reference.getTagNameNode().getText()}:${reference.getStart()}`;
289
+ if (!seenTags.has(key)) {
290
+ seenTags.add(key);
291
+ references.push(reference);
292
+ }
293
+ });
294
+ collectMatchingTags(localName);
275
295
  }
276
296
  });
277
297
  });
@@ -265,12 +265,32 @@ const purgeFromCodeOptimized = async (code, options) => {
265
265
  */
266
266
  const findComponentReferences = (sourceFile, componentName) => {
267
267
  const references = [];
268
+ const seenTags = /* @__PURE__ */ new Set();
269
+ const collectMatchingTags = (localName) => {
270
+ sourceFile.getDescendants().filter((node) => Node.isJsxOpeningElement(node) || Node.isJsxSelfClosingElement(node)).forEach((node) => {
271
+ const tagName = node.getTagNameNode().getText();
272
+ if (tagName === localName || tagName.startsWith(`${localName}.`)) {
273
+ const key = `${tagName}:${node.getStart()}`;
274
+ if (!seenTags.has(key)) {
275
+ seenTags.add(key);
276
+ references.push(node);
277
+ }
278
+ }
279
+ });
280
+ };
268
281
  sourceFile.getImportDeclarations().forEach((importDecl) => {
269
282
  if (!isUdsComponentModule(getModuleSpecifierValue(importDecl))) return;
270
283
  importDecl.getNamedImports().forEach((namedImport) => {
271
284
  if (namedImport.getName() === componentName) {
272
- const identifier = namedImport.getFirstDescendantByKindOrThrow(ts.SyntaxKind.Identifier);
273
- references.push(...findJsxReferences(identifier));
285
+ const localName = namedImport.getAliasNode()?.getText() ?? componentName;
286
+ findJsxReferences(namedImport.getFirstDescendantByKindOrThrow(ts.SyntaxKind.Identifier)).forEach((reference) => {
287
+ const key = `${reference.getTagNameNode().getText()}:${reference.getStart()}`;
288
+ if (!seenTags.has(key)) {
289
+ seenTags.add(key);
290
+ references.push(reference);
291
+ }
292
+ });
293
+ collectMatchingTags(localName);
274
294
  }
275
295
  });
276
296
  });
@@ -1,6 +1,7 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
2
  const require_runtime = require('../../../../../_virtual/_rolldown/runtime.cjs');
3
3
  const require_index = require('../../../../../motion-tokens/dist/index.cjs');
4
+ const require_entryPoints = require('../../../utils/entryPoints.cjs');
4
5
  let node_path = require("node:path");
5
6
  node_path = require_runtime.__toESM(node_path);
6
7
  let node_fs = require("node:fs");
@@ -19,7 +20,7 @@ let knownComponents = null;
19
20
  */
20
21
  let componentPaths = null;
21
22
  let scannedComponentsDir = null;
22
- const scanComponentFilePaths = async (componentsDir) => (0, fast_glob.default)("**/*.tsx", {
23
+ const scanComponentFilePaths = async (componentsDir) => (0, fast_glob.default)(require_entryPoints.getAllowedEntryFileGlobPatterns(), {
23
24
  cwd: componentsDir,
24
25
  absolute: true
25
26
  });
@@ -34,8 +35,8 @@ const scanComponentFiles = async (componentsDir) => {
34
35
  const nextComponentPaths = componentPaths;
35
36
  const nextKnownComponents = knownComponents;
36
37
  (await scanComponentFilePaths(componentsDir)).forEach((file) => {
37
- if (file.includes(".test.") || file.endsWith("index.tsx")) return;
38
- const fileName = node_path.default.basename(file, ".tsx");
38
+ if (file.includes(".test.") || node_path.default.basename(require_entryPoints.stripAllowedEntryFileExtension(file)) === "index") return;
39
+ const fileName = node_path.default.basename(require_entryPoints.stripAllowedEntryFileExtension(file));
39
40
  if (/^[A-Z]/.test(fileName)) {
40
41
  nextComponentPaths.set(fileName, file);
41
42
  nextKnownComponents.add(fileName);
@@ -110,7 +111,7 @@ const analyzeVariantSpreadAssignment = (prop, styleProps, getStylesLiterals, pro
110
111
  const analyzeComponent = (project, componentPath) => {
111
112
  const sourceFile = project.getSourceFile(componentPath);
112
113
  if (!sourceFile) return null;
113
- const componentName = node_path.default.basename(componentPath, ".tsx");
114
+ const componentName = node_path.default.basename(require_entryPoints.stripAllowedEntryFileExtension(componentPath));
114
115
  const defaultProps = /* @__PURE__ */ new Map();
115
116
  const componentPropNames = /* @__PURE__ */ new Set();
116
117
  const styleProps = [];