@yahoo/uds 3.153.2 → 3.154.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 (65) hide show
  1. package/dist/automated-config/dist/generated/generatedConfigs.cjs +10 -0
  2. package/dist/automated-config/dist/generated/generatedConfigs.d.cts +10 -0
  3. package/dist/automated-config/dist/generated/generatedConfigs.d.ts +10 -0
  4. package/dist/automated-config/dist/generated/generatedConfigs.js +10 -0
  5. package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +10 -0
  6. package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +10 -0
  7. package/dist/automated-config/dist/properties.cjs +101 -87
  8. package/dist/automated-config/dist/properties.d.cts +2 -0
  9. package/dist/automated-config/dist/properties.d.ts +2 -0
  10. package/dist/automated-config/dist/properties.js +101 -87
  11. package/dist/automated-config/dist/types/ComponentConfig.d.cts +2 -0
  12. package/dist/automated-config/dist/types/ComponentConfig.d.ts +2 -0
  13. package/dist/automated-config/dist/utils/buildConfigSchema.cjs +18 -0
  14. package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +5 -1
  15. package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +5 -1
  16. package/dist/automated-config/dist/utils/buildConfigSchema.js +18 -0
  17. package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +2 -2
  18. package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
  19. package/dist/automated-config/dist/utils/getPaginationControlWidthPx.cjs +68 -0
  20. package/dist/automated-config/dist/utils/getPaginationControlWidthPx.d.cts +49 -0
  21. package/dist/automated-config/dist/utils/getPaginationControlWidthPx.d.ts +49 -0
  22. package/dist/automated-config/dist/utils/getPaginationControlWidthPx.js +66 -0
  23. package/dist/automated-config/dist/utils/index.cjs +55 -17
  24. package/dist/automated-config/dist/utils/index.d.cts +2 -0
  25. package/dist/automated-config/dist/utils/index.d.ts +2 -0
  26. package/dist/automated-config/dist/utils/index.js +55 -17
  27. package/dist/cli/commands/sync.cjs +21 -4
  28. package/dist/cli/commands/sync.d.cts +2 -1
  29. package/dist/cli/commands/sync.d.ts +2 -1
  30. package/dist/cli/commands/sync.js +21 -5
  31. package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
  32. package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
  33. package/dist/config/dist/index.cjs +979 -969
  34. package/dist/config/dist/index.js +979 -969
  35. package/dist/css/dist/packages/automated-config/dist/properties.cjs +101 -87
  36. package/dist/css/dist/packages/automated-config/dist/properties.js +101 -87
  37. package/dist/css/dist/packages/config/dist/index.cjs +979 -969
  38. package/dist/css/dist/packages/config/dist/index.js +979 -969
  39. package/dist/index.cjs +3 -0
  40. package/dist/index.d.cts +2 -1
  41. package/dist/index.d.ts +2 -1
  42. package/dist/index.js +2 -1
  43. package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.cjs +10 -0
  44. package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +10 -0
  45. package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.cjs +101 -87
  46. package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.js +101 -87
  47. package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.cjs +54 -17
  48. package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.js +54 -17
  49. package/dist/tailwind-internal/dist/packages/config/dist/index.cjs +979 -969
  50. package/dist/tailwind-internal/dist/packages/config/dist/index.js +979 -969
  51. package/dist/tokens/automation/index.cjs +3 -0
  52. package/dist/tokens/automation/index.d.cts +2 -1
  53. package/dist/tokens/automation/index.d.ts +2 -1
  54. package/dist/tokens/automation/index.js +2 -1
  55. package/dist/tokens/index.cjs +3 -0
  56. package/dist/tokens/index.d.cts +2 -1
  57. package/dist/tokens/index.d.ts +2 -1
  58. package/dist/tokens/index.js +2 -1
  59. package/dist/uds/generated/componentData.cjs +263 -263
  60. package/dist/uds/generated/componentData.js +263 -263
  61. package/dist/uds/generated/migrationSchemaVersion.cjs +5 -0
  62. package/dist/uds/generated/migrationSchemaVersion.js +5 -0
  63. package/generated/componentData.json +356 -356
  64. package/generated/migrationSchemaVersion.ts +7 -0
  65. package/package.json +1 -1
@@ -13,6 +13,7 @@ const require_config = require("../dist/utils/rules/config.cjs");
13
13
  const require_colors = require("../dist/lib/colors.cjs");
14
14
  const require_print = require("../dist/lib/print.cjs");
15
15
  const require_box = require("../dist/lib/box.cjs");
16
+ const require_migrationSchemaVersion = require("../../uds/generated/migrationSchemaVersion.cjs");
16
17
  let node_path = require("node:path");
17
18
  node_path = require_runtime.__toESM(node_path, 1);
18
19
  let node_fs = require("node:fs");
@@ -24,7 +25,7 @@ const STAGING_ENDPOINT = "https://staging.config.uds.build";
24
25
  const BETA_ENDPOINT = "https://configurator-git-beta-yahoo-design.vercel.app";
25
26
  const getConfigEndpoint = (id, autoMigrate, packageVersion) => {
26
27
  const isDevelopment = packageVersion.endsWith("-development");
27
- const suffix = autoMigrate && !isDevelopment ? `/api/config/for-package-version?branchId=${id}&packageVersion=${packageVersion}` : `/api/config?id=${id}`;
28
+ const suffix = autoMigrate && !isDevelopment ? `/api/config/for-package-version?branchId=${id}&packageVersion=${packageVersion}&schemaVersion=${require_migrationSchemaVersion.MIGRATION_SCHEMA_VERSION}` : `/api/config?id=${id}`;
28
29
  switch (process.env.DATABASE) {
29
30
  case "staging": return `${STAGING_ENDPOINT}${suffix}`;
30
31
  case "beta": return `${BETA_ENDPOINT}${suffix}`;
@@ -58,8 +59,12 @@ const syncCommand = {
58
59
  const packageVersion = _yahoo_uds_package_json.default.version;
59
60
  const fetchUrl = getConfigEndpoint(id, autoMigrate, packageVersion);
60
61
  const fullPath = node_path.default.resolve(process.cwd(), outputPath);
62
+ if (process.env.DEBUG_UDS_CLI === "1") require_print.print(`[uds:debug] fetchUrl=${fetchUrl}`);
61
63
  require_print.print(require_colors.yellow("Fetching from configurator..."));
62
64
  let config;
65
+ let degraded = false;
66
+ let warnings = [];
67
+ let nonReversibleMigrations = [];
63
68
  if (process.env.DATABASE === "test") config = require_defaultTokensConfig.defaultTokensConfig;
64
69
  else {
65
70
  const resp = await fetch(fetchUrl);
@@ -67,7 +72,11 @@ const syncCommand = {
67
72
  if (resp.status === 401) throw new Error(`${resp.status} error: ${resp.statusText}\nYou're not authorized to fetch from ${fetchUrl}\nMake sure you have a valid VERCEL_PROTECTION_BYPASS token in your root .env.local`);
68
73
  throw new Error(`Error fetching config id '${id}'. Does it exist in the Configurator?`);
69
74
  }
70
- config = (await resp.json()).config;
75
+ const data = await resp.json();
76
+ config = data.config;
77
+ degraded = data.degraded === true;
78
+ warnings = Array.isArray(data.warnings) ? data.warnings : [];
79
+ nonReversibleMigrations = Array.isArray(data.nonReversibleMigrations) ? data.nonReversibleMigrations : [];
71
80
  }
72
81
  if (!config) throw new Error("Config JSON could not be parsed.");
73
82
  const serializedConfig = require_serializeToJS.serializeToJS(config);
@@ -94,7 +103,7 @@ const syncCommand = {
94
103
  exportsTS.push(`export const runtimeConfig: UDSConfigContextType = {
95
104
  bottomSheet: bottomSheetRuntimeConfig,
96
105
  breakpoints: breakpointsRuntimeConfig,
97
- modal: modalRuntimeConfig,
106
+ modal: modalRuntimeConfig,
98
107
  popover: popoverRuntimeConfig,
99
108
  toast: toastRuntimeConfig,
100
109
  tooltip: tooltipRuntimeConfig,
@@ -102,7 +111,7 @@ const syncCommand = {
102
111
  exportsJS.push(`export const runtimeConfig = {
103
112
  bottomSheet: bottomSheetRuntimeConfig,
104
113
  breakpoints: breakpointsRuntimeConfig,
105
- modal: modalRuntimeConfig,
114
+ modal: modalRuntimeConfig,
106
115
  popover: popoverRuntimeConfig,
107
116
  toast: toastRuntimeConfig,
108
117
  tooltip: tooltipRuntimeConfig,
@@ -111,6 +120,13 @@ const syncCommand = {
111
120
  const configContentJs = `${exportsJS.join("\n\n")}\n`;
112
121
  (0, node_fs.writeFileSync)(fullPath, outFileExtension === "js" ? configContentJs : configContentTs);
113
122
  require_print.print(require_colors.green(`✅ Synced UDS config ${id} to ${fullPath}`));
123
+ if (degraded || warnings.length > 0) {
124
+ const lines = [require_colors.bold(require_colors.yellow("⚠️ Auto-migration was degraded."))];
125
+ if (nonReversibleMigrations.length > 0) lines.push(`Non-reversible migrations applied: ${nonReversibleMigrations.join(", ")}.`);
126
+ for (const warning of warnings) lines.push(warning);
127
+ lines.push(`Open the configurator to restore an accurate config: https://config.uds.build/branches/${id}`);
128
+ require_box.printBox(lines);
129
+ }
114
130
  const staleEditors = require_config.getEditorsWithStaleRules(process.cwd());
115
131
  if (staleEditors.length > 0) require_box.printBox([require_colors.bold(`Updated UDS rules are available for ${staleEditors.join(" and ")}.`), `Run ${require_colors.cyan("`uds editor-rules`")} to update.`]);
116
132
  } catch (error) {
@@ -121,5 +137,6 @@ const syncCommand = {
121
137
  }
122
138
  };
123
139
  //#endregion
140
+ exports.getConfigEndpoint = getConfigEndpoint;
124
141
  exports.isAutoMigrateEnabled = isAutoMigrateEnabled;
125
142
  exports.syncCommand = syncCommand;
@@ -2,6 +2,7 @@
2
2
  import { Props } from "@yahoo/uds-cli/lib";
3
3
 
4
4
  //#region src/cli/commands/sync.d.ts
5
+ declare const getConfigEndpoint: (id: string, autoMigrate: boolean, packageVersion: string) => string;
5
6
  type CLIOptions = Record<string, string | boolean | undefined>;
6
7
  declare const isAutoMigrateEnabled: (options: CLIOptions) => boolean;
7
8
  declare const syncCommand: {
@@ -15,4 +16,4 @@ declare const syncCommand: {
15
16
  }: Props) => Promise<void>;
16
17
  };
17
18
  //#endregion
18
- export { isAutoMigrateEnabled, syncCommand };
19
+ export { getConfigEndpoint, isAutoMigrateEnabled, syncCommand };
@@ -2,6 +2,7 @@
2
2
  import { Props } from "@yahoo/uds-cli/lib";
3
3
 
4
4
  //#region src/cli/commands/sync.d.ts
5
+ declare const getConfigEndpoint: (id: string, autoMigrate: boolean, packageVersion: string) => string;
5
6
  type CLIOptions = Record<string, string | boolean | undefined>;
6
7
  declare const isAutoMigrateEnabled: (options: CLIOptions) => boolean;
7
8
  declare const syncCommand: {
@@ -15,4 +16,4 @@ declare const syncCommand: {
15
16
  }: Props) => Promise<void>;
16
17
  };
17
18
  //#endregion
18
- export { isAutoMigrateEnabled, syncCommand };
19
+ export { getConfigEndpoint, isAutoMigrateEnabled, syncCommand };
@@ -11,6 +11,7 @@ import { getEditorsWithStaleRules } from "../dist/utils/rules/config.js";
11
11
  import { bold, cyan, green, magenta, red, yellow } from "../dist/lib/colors.js";
12
12
  import { print } from "../dist/lib/print.js";
13
13
  import { printBox } from "../dist/lib/box.js";
14
+ import { MIGRATION_SCHEMA_VERSION } from "../../uds/generated/migrationSchemaVersion.js";
14
15
  import path from "node:path";
15
16
  import { writeFileSync } from "node:fs";
16
17
  import packageJSON from "@yahoo/uds/package.json" with { type: "json" };
@@ -20,7 +21,7 @@ const STAGING_ENDPOINT = "https://staging.config.uds.build";
20
21
  const BETA_ENDPOINT = "https://configurator-git-beta-yahoo-design.vercel.app";
21
22
  const getConfigEndpoint = (id, autoMigrate, packageVersion) => {
22
23
  const isDevelopment = packageVersion.endsWith("-development");
23
- const suffix = autoMigrate && !isDevelopment ? `/api/config/for-package-version?branchId=${id}&packageVersion=${packageVersion}` : `/api/config?id=${id}`;
24
+ const suffix = autoMigrate && !isDevelopment ? `/api/config/for-package-version?branchId=${id}&packageVersion=${packageVersion}&schemaVersion=${MIGRATION_SCHEMA_VERSION}` : `/api/config?id=${id}`;
24
25
  switch (process.env.DATABASE) {
25
26
  case "staging": return `${STAGING_ENDPOINT}${suffix}`;
26
27
  case "beta": return `${BETA_ENDPOINT}${suffix}`;
@@ -54,8 +55,12 @@ const syncCommand = {
54
55
  const packageVersion = packageJSON.version;
55
56
  const fetchUrl = getConfigEndpoint(id, autoMigrate, packageVersion);
56
57
  const fullPath = path.resolve(process.cwd(), outputPath);
58
+ if (process.env.DEBUG_UDS_CLI === "1") print(`[uds:debug] fetchUrl=${fetchUrl}`);
57
59
  print(yellow("Fetching from configurator..."));
58
60
  let config;
61
+ let degraded = false;
62
+ let warnings = [];
63
+ let nonReversibleMigrations = [];
59
64
  if (process.env.DATABASE === "test") config = defaultTokensConfig;
60
65
  else {
61
66
  const resp = await fetch(fetchUrl);
@@ -63,7 +68,11 @@ const syncCommand = {
63
68
  if (resp.status === 401) throw new Error(`${resp.status} error: ${resp.statusText}\nYou're not authorized to fetch from ${fetchUrl}\nMake sure you have a valid VERCEL_PROTECTION_BYPASS token in your root .env.local`);
64
69
  throw new Error(`Error fetching config id '${id}'. Does it exist in the Configurator?`);
65
70
  }
66
- config = (await resp.json()).config;
71
+ const data = await resp.json();
72
+ config = data.config;
73
+ degraded = data.degraded === true;
74
+ warnings = Array.isArray(data.warnings) ? data.warnings : [];
75
+ nonReversibleMigrations = Array.isArray(data.nonReversibleMigrations) ? data.nonReversibleMigrations : [];
67
76
  }
68
77
  if (!config) throw new Error("Config JSON could not be parsed.");
69
78
  const serializedConfig = serializeToJS(config);
@@ -90,7 +99,7 @@ const syncCommand = {
90
99
  exportsTS.push(`export const runtimeConfig: UDSConfigContextType = {
91
100
  bottomSheet: bottomSheetRuntimeConfig,
92
101
  breakpoints: breakpointsRuntimeConfig,
93
- modal: modalRuntimeConfig,
102
+ modal: modalRuntimeConfig,
94
103
  popover: popoverRuntimeConfig,
95
104
  toast: toastRuntimeConfig,
96
105
  tooltip: tooltipRuntimeConfig,
@@ -98,7 +107,7 @@ const syncCommand = {
98
107
  exportsJS.push(`export const runtimeConfig = {
99
108
  bottomSheet: bottomSheetRuntimeConfig,
100
109
  breakpoints: breakpointsRuntimeConfig,
101
- modal: modalRuntimeConfig,
110
+ modal: modalRuntimeConfig,
102
111
  popover: popoverRuntimeConfig,
103
112
  toast: toastRuntimeConfig,
104
113
  tooltip: tooltipRuntimeConfig,
@@ -107,6 +116,13 @@ const syncCommand = {
107
116
  const configContentJs = `${exportsJS.join("\n\n")}\n`;
108
117
  writeFileSync(fullPath, outFileExtension === "js" ? configContentJs : configContentTs);
109
118
  print(green(`✅ Synced UDS config ${id} to ${fullPath}`));
119
+ if (degraded || warnings.length > 0) {
120
+ const lines = [bold(yellow("⚠️ Auto-migration was degraded."))];
121
+ if (nonReversibleMigrations.length > 0) lines.push(`Non-reversible migrations applied: ${nonReversibleMigrations.join(", ")}.`);
122
+ for (const warning of warnings) lines.push(warning);
123
+ lines.push(`Open the configurator to restore an accurate config: https://config.uds.build/branches/${id}`);
124
+ printBox(lines);
125
+ }
110
126
  const staleEditors = getEditorsWithStaleRules(process.cwd());
111
127
  if (staleEditors.length > 0) printBox([bold(`Updated UDS rules are available for ${staleEditors.join(" and ")}.`), `Run ${cyan("`uds editor-rules`")} to update.`]);
112
128
  } catch (error) {
@@ -117,4 +133,4 @@ const syncCommand = {
117
133
  }
118
134
  };
119
135
  //#endregion
120
- export { isAutoMigrateEnabled, syncCommand };
136
+ export { getConfigEndpoint, isAutoMigrateEnabled, syncCommand };
@@ -87,6 +87,6 @@ interface MenuItemCheckboxProps extends Omit<PressableProps, 'asChild'>, HtmlBut
87
87
  *
88
88
  * @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item)
89
89
  **/
90
- declare const MenuItemCheckbox: _$react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "active" | "rootProps" | "hideEndIcon"> & _$react.RefAttributes<HTMLDivElement>>;
90
+ declare const MenuItemCheckbox: _$react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "active" | "hideEndIcon" | "rootProps"> & _$react.RefAttributes<HTMLDivElement>>;
91
91
  //#endregion
92
92
  export { MenuItemCheckbox, type MenuItemCheckboxProps };
@@ -88,6 +88,6 @@ interface MenuItemCheckboxProps extends Omit<PressableProps, 'asChild'>, HtmlBut
88
88
  *
89
89
  * @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item)
90
90
  **/
91
- declare const MenuItemCheckbox: _$react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "active" | "rootProps" | "hideEndIcon"> & _$react.RefAttributes<HTMLDivElement>>;
91
+ declare const MenuItemCheckbox: _$react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "active" | "hideEndIcon" | "rootProps"> & _$react.RefAttributes<HTMLDivElement>>;
92
92
  //#endregion
93
93
  export { MenuItemCheckbox, type MenuItemCheckboxProps };