@yahoo/uds-create-cli 5.81.2 → 5.82.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yahoo/uds-create-cli",
3
- "version": "5.81.2",
3
+ "version": "5.82.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,10 +32,10 @@
32
32
  "@modelcontextprotocol/sdk": "^1.32.2",
33
33
  "@orpc/client": "^1.13.9",
34
34
  "@orpc/contract": "^1.13.9",
35
- "@yahoo/uds-create-config": "5.81.2",
36
- "@yahoo/uds-create-loader": "5.81.2",
37
- "@yahoo/uds-create-types": "5.81.2",
38
- "@yahoo/uds-create-utils": "5.81.2",
35
+ "@yahoo/uds-create-config": "5.82.1",
36
+ "@yahoo/uds-create-loader": "5.82.1",
37
+ "@yahoo/uds-create-types": "5.82.1",
38
+ "@yahoo/uds-create-utils": "5.82.1",
39
39
  "esbuild": "^0.27.4",
40
40
  "ts-morph": "^27.0.2",
41
41
  "get-tsconfig": "^4.10.0",
@@ -52,13 +52,13 @@
52
52
  "lodash": "^4.17.23",
53
53
  "prettier": "^3.8.1"
54
54
  },
55
- "udsSchemaVersion": 20261105185042,
55
+ "udsSchemaVersion": 20261106185419,
56
56
  "optionalDependencies": {
57
- "@yahoo/uds-create-cli-darwin-arm64": "5.81.2",
58
- "@yahoo/uds-create-cli-darwin-x64": "5.81.2",
59
- "@yahoo/uds-create-cli-linux-arm64": "5.81.2",
60
- "@yahoo/uds-create-cli-linux-x64": "5.81.2",
61
- "@yahoo/uds-create-cli-linux-arm64-musl": "5.81.2",
62
- "@yahoo/uds-create-cli-linux-x64-musl": "5.81.2"
57
+ "@yahoo/uds-create-cli-darwin-arm64": "5.82.1",
58
+ "@yahoo/uds-create-cli-darwin-x64": "5.82.1",
59
+ "@yahoo/uds-create-cli-linux-arm64": "5.82.1",
60
+ "@yahoo/uds-create-cli-linux-x64": "5.82.1",
61
+ "@yahoo/uds-create-cli-linux-arm64-musl": "5.82.1",
62
+ "@yahoo/uds-create-cli-linux-x64-musl": "5.82.1"
63
63
  }
64
64
  }
@@ -78124,7 +78124,8 @@ var Modifier = defineEntity({
78124
78124
  type: external_exports.enum(WEB_ACTIVATIONS).describe("How the modifier activates, such as `selector` or `media`."),
78125
78125
  value: external_exports.union([external_exports.string(), external_exports.lazy(() => Composite)]).describe("The selector or query it activates on, or a composite ref."),
78126
78126
  media: external_exports.string().min(1).optional().describe("A media query a selector modifier also needs, as `hover` applies only under `(hover: hover)` so a tap on a touch screen does not leave it stuck."),
78127
- declarations: external_exports.record(external_exports.string(), external_exports.string()).optional().describe("Declarations every rule under the modifier sets first, as `before` sets `content: var(--tw-content)` so the pseudo-element renders.")
78127
+ declarations: external_exports.record(external_exports.string(), external_exports.string()).optional().describe("Declarations every rule under the modifier sets first, as `before` sets `content: var(--tw-content)` so the pseudo-element renders."),
78128
+ classPrefix: external_exports.string().regex(/^[^\s:]+$/, { error: "a class prefix is one class segment, with no space or `:`." }).optional().describe("What a class names the modifier by, before the `:`, as `*` in `*:p-2`. Defaults to the modifier's leaf.")
78128
78129
  }).check((ctx) => {
78129
78130
  const { type, value } = ctx.value;
78130
78131
  const wantsRef = type === "composite";
@@ -78141,6 +78142,10 @@ var Modifier = defineEntity({
78141
78142
  answeredHere: true,
78142
78143
  invariants: (config2) => modifierInvariants(config2)
78143
78144
  });
78145
+ function modifierClassPrefix(modifier) {
78146
+ const { classPrefix } = modifier.body;
78147
+ return typeof classPrefix === "string" ? classPrefix : modifier.leaf;
78148
+ }
78144
78149
  function modifierInvariants(config2) {
78145
78150
  const problems = [];
78146
78151
  const items = Modifier.list(config2);
@@ -78149,6 +78154,13 @@ function modifierInvariants(config2) {
78149
78154
  const above = typedAncestor(config2, group.path);
78150
78155
  if (above) problems.push(`Modifier group "${group.path}" is typed but sits under the typed group "${above.group}"; a typed group is the axis and nests under folders only.`);
78151
78156
  }
78157
+ const byClassPrefix = /* @__PURE__ */ new Map();
78158
+ for (const item of items) {
78159
+ const prefix2 = modifierClassPrefix(item);
78160
+ const taken = byClassPrefix.get(prefix2);
78161
+ if (taken) problems.push(`Modifiers "${taken}" and "${item.path}" are both written \`${prefix2}:\` in a class; a class prefix names one modifier.`);
78162
+ byClassPrefix.set(prefix2, item.path);
78163
+ }
78152
78164
  for (const item of items) {
78153
78165
  const axis = typedAncestor(config2, item.path);
78154
78166
  if (axis && item.path !== `${axis.group}/${item.leaf}`) problems.push(`Modifier "${item.path}" is nested inside the typed group "${axis.group}"; an axis holds its options directly.`);
@@ -79011,7 +79023,12 @@ function expandStylePropEntries(config2, path2, opts) {
79011
79023
  if (!prop) return [];
79012
79024
  const values2 = prop.toJSON().values ?? [];
79013
79025
  const members2 = (target2) => memberEntries(config2, target2, opts);
79014
- return values2.flatMap((entry) => leavesOfStylePropValue(entry, members2));
79026
+ const expanded = values2.map((entry) => ({
79027
+ fromRef: isRef2(entry),
79028
+ leaves: leavesOfStylePropValue(entry, members2)
79029
+ }));
79030
+ const listed = new Set(expanded.flatMap(({ fromRef, leaves: leaves2 }) => fromRef ? [] : leaves2.map(({ leaf }) => leaf)));
79031
+ return expanded.flatMap(({ fromRef, leaves: leaves2 }) => fromRef ? leaves2.filter(({ leaf }) => !listed.has(leaf)) : leaves2);
79015
79032
  }
79016
79033
  function stylePropValueLeaves(config2, path2, opts) {
79017
79034
  return stylePropEntries(config2, path2, opts).map((entry) => entry.leaf);
@@ -88372,6 +88389,8 @@ var Converter = class {
88372
88389
  breakpoints;
88373
88390
  /** Each modifier's class prefix (`md`) → the prop key its bag is written under (`_md`). */
88374
88391
  modifierKeys;
88392
+ /** The classes a modifier's selector names on another element (`.peer`, `.group`). */
88393
+ markerClasses;
88375
88394
  constructor(options, grammar) {
88376
88395
  this.options = options;
88377
88396
  this.grammar = grammar;
@@ -88391,13 +88410,20 @@ var Converter = class {
88391
88410
  const max2 = /max-width:\s*(\d+(?:\.\d+)?)px/.exec(value);
88392
88411
  if (!min2 && !max2) continue;
88393
88412
  const active = (!min2 || width >= Number(min2[1])) && (!max2 || width <= Number(max2[1]));
88394
- breakpoints.set(modifier.leaf, {
88413
+ breakpoints.set(modifierClassPrefix(modifier), {
88395
88414
  active,
88396
88415
  rank: min2 ? Number(min2[1]) : 0
88397
88416
  });
88398
88417
  }
88399
88418
  this.breakpoints = breakpoints;
88400
- this.modifierKeys = new Map(options.config.list("modifier").map((modifier) => [modifier.leaf, `_${modifier.leaf}`]));
88419
+ const markers = /* @__PURE__ */ new Set();
88420
+ for (const modifier of options.config.list("modifier")) {
88421
+ const { type, value } = modifier.toJSON();
88422
+ if (type !== "selector" || typeof value !== "string") continue;
88423
+ for (const [, name] of value.matchAll(/\.(-?[A-Za-z_][\w-]*)/g)) markers.add(name);
88424
+ }
88425
+ this.markerClasses = markers;
88426
+ this.modifierKeys = new Map(options.config.list("modifier").map((modifier) => [modifierClassPrefix(modifier), `_${modifier.leaf}`]));
88401
88427
  }
88402
88428
  convertTop(el) {
88403
88429
  return this.convert(el);
@@ -88477,15 +88503,22 @@ var Converter = class {
88477
88503
  plain(el, convertKids = () => this.plainChildren(el)) {
88478
88504
  const tag = el.tagName.toLowerCase();
88479
88505
  if (FORBIDDEN_TAGS.has(tag)) return [];
88480
- if (el.hasAttribute(FOLD)) return this.pinFolded(el, convertKids());
88481
- if ([...inlineDeclarations(el), ...declarationsOf(el.getAttribute("data-uds-computed") ?? "")].find(([property]) => property === "display")?.[1].trim() === "contents") return convertKids();
88506
+ let kidsOf = convertKids;
88507
+ if (el.hasAttribute(FOLD) && !this.placesItself(el)) {
88508
+ const kids = convertKids();
88509
+ if (kids.length <= 1) return this.pinFolded(el, kids);
88510
+ kidsOf = () => kids;
88511
+ }
88512
+ if ([...inlineDeclarations(el), ...declarationsOf(el.getAttribute("data-uds-computed") ?? "")].find(([property]) => property === "display")?.[1].trim() === "contents") return kidsOf();
88482
88513
  const { className: className2, style, paints } = this.plainStyle(el);
88483
88514
  const attrs = plainAttributes(el);
88484
88515
  if (tag === "img" && !attrs.src) return [];
88485
- const children = VOID_TAGS.has(tag) ? [] : convertKids();
88516
+ const children = VOID_TAGS.has(tag) ? [] : kidsOf();
88486
88517
  const text = children.length === 0 ? plainText(el) : "";
88487
- if (children.length === 0 && !text && !VOID_TAGS.has(tag) && !paints && !sizesItself(el) && !el.hasAttribute(EMBED_SPACE_ATTR)) return [];
88488
- if (!(className2 !== "" || Object.keys(style).length > 0 || Object.keys(attrs).length > 0) && GROUPING_TAGS.has(tag)) {
88518
+ if (children.length === 0 && !text && !VOID_TAGS.has(tag) && !paints && !sizesItself(el) && !el.hasAttribute(EMBED_SPACE_ATTR) && !holdsGridCell(el)) return [];
88519
+ const carries = className2 !== "" || Object.keys(style).length > 0 || Object.keys(attrs).length > 0;
88520
+ const holdsCell = children.length === 0 && !text && holdsGridCell(el);
88521
+ if (!carries && GROUPING_TAGS.has(tag) && children.length <= 1 && !holdsCell) {
88489
88522
  if (text) return this.plainTextRun(text);
88490
88523
  return children;
88491
88524
  }
@@ -88673,6 +88706,7 @@ var Converter = class {
88673
88706
  classes.push(...owned.length < each.atoms.size ? this.narrowed(each, new Set(owned)) : [each.bare]);
88674
88707
  }
88675
88708
  fromDeclarations(declarationsOf(el.getAttribute("data-uds-computed") ?? ""));
88709
+ for (const cls of classesOf(el)) if (this.markerClasses.has(cls)) classes.push(cls);
88676
88710
  return {
88677
88711
  className: [...new Set(classes)].join(" "),
88678
88712
  style,
@@ -88709,6 +88743,20 @@ var Converter = class {
88709
88743
  }
88710
88744
  }
88711
88745
  /**
88746
+ * Whether an element's classes or computed styles place it in its parent's grid or flex row (a
88747
+ * column span, its own alignment, a flex share). Folding it would leave its child unplaced, so a
88748
+ * card spanning two columns would take one.
88749
+ */
88750
+ placesItself(el) {
88751
+ if (declarationsOf(el.getAttribute("data-uds-computed") ?? "").some(([property]) => PLACEMENT_PROPERTY.test(property))) return true;
88752
+ return classesOf(el).some((cls) => {
88753
+ const read = this.readModifiedClass(cls);
88754
+ if (!read || read.modifiers.length > 0) return false;
88755
+ const { properties = [] } = this.options.config.resolve("style-property", read.style.path)?.toJSON() ?? {};
88756
+ return properties.some((property) => PLACEMENT_PROPERTY.test(property));
88757
+ });
88758
+ }
88759
+ /**
88712
88760
  * The content of an unmarked wrapper the capture folded, with the wrapper's measured box written
88713
88761
  * onto it when it is one element: the wrapper's sizing (a flex share, a fixed size) no longer reaches
88714
88762
  * the child, so the child keeps the box it had.
@@ -88843,7 +88891,7 @@ var Converter = class {
88843
88891
  const important = /^!|!$/.test(leaf);
88844
88892
  if (important) leaf = leaf.replace(/^!|!$/, "");
88845
88893
  if (important) rank += IMPORTANT_RANK;
88846
- const style = this.grammar.styleProp(leaf);
88894
+ const style = this.grammar.styleProp(leaf) ?? this.grammar.styleProp(FADED_CLASS.exec(leaf)?.[1] ?? "");
88847
88895
  return style ? {
88848
88896
  modifiers,
88849
88897
  style,
@@ -89590,6 +89638,8 @@ var ROOT_ATTRIBUTE_PROPS = [
89590
89638
  "placeholder"
89591
89639
  ];
89592
89640
  var PAINT_PROPERTY = /^(background|border-(top-|right-|bottom-|left-)?(width|color)|box-shadow|outline)/;
89641
+ var FADED_CLASS = /^(.+)\/(?:100|\d{1,2}(?:\.\d+)?)$/;
89642
+ var PLACEMENT_PROPERTY = /^(grid-(column|row|area)(-start|-end)?|(align|justify|place)-self|order|flex(-grow)?)$/;
89593
89643
  var GROUPING_TAGS = /* @__PURE__ */ new Set(["div", "span"]);
89594
89644
  var VOID_TAGS = /* @__PURE__ */ new Set([
89595
89645
  "img",
@@ -89617,6 +89667,7 @@ var PLAIN_ATTRIBUTES = {
89617
89667
  rowspan: "rowSpan",
89618
89668
  for: "htmlFor"
89619
89669
  };
89670
+ var BOOLEAN_ATTRIBUTES = ["open", "disabled"];
89620
89671
  function plainAttributes(el) {
89621
89672
  const out = {};
89622
89673
  const tag = el.tagName.toLowerCase();
@@ -89631,6 +89682,17 @@ function plainAttributes(el) {
89631
89682
  const value = tag === "textarea" ? el.textContent ?? "" : el.getAttribute("value");
89632
89683
  if (value) out.defaultValue = value;
89633
89684
  }
89685
+ if (tag === "input" && el.hasAttribute("checked")) out.defaultChecked = true;
89686
+ for (const attr of BOOLEAN_ATTRIBUTES) if (el.hasAttribute(attr)) out[attr] = true;
89687
+ if (tag === "option") {
89688
+ const value = el.getAttribute("value");
89689
+ if (value !== null && value !== void 0) out.value = value;
89690
+ }
89691
+ if (tag === "select") {
89692
+ const chosen = el.querySelector("option[selected]");
89693
+ const value = chosen?.getAttribute("value") ?? chosen?.textContent;
89694
+ if (value) out.defaultValue = value;
89695
+ }
89634
89696
  return out;
89635
89697
  }
89636
89698
  function plainText(el) {
@@ -89650,6 +89712,9 @@ function camelCase3(property) {
89650
89712
  function isImage(el) {
89651
89713
  return el.tagName.toLowerCase() === "img" && !el.hasAttribute("data-uds-component");
89652
89714
  }
89715
+ function isFieldControl(el) {
89716
+ return isField(el) || el.tagName.toLowerCase() === "select";
89717
+ }
89653
89718
  function isField(el) {
89654
89719
  const tag = el.tagName.toLowerCase();
89655
89720
  return tag === "input" || tag === "textarea";
@@ -89711,6 +89776,11 @@ var SIZING_PROPERTY = /* @__PURE__ */ new Set([
89711
89776
  "min-height",
89712
89777
  "flex-basis"
89713
89778
  ]);
89779
+ function holdsGridCell(el) {
89780
+ const parent = el.parentElement;
89781
+ if (!parent) return false;
89782
+ return declarationsOf(parent.getAttribute("data-uds-computed") ?? "").some(([property, value]) => property === "display" && /^(inline-)?grid$/.test(value.trim()));
89783
+ }
89714
89784
  function sizesItself(el) {
89715
89785
  return inlineDeclarations(el).some(([property, value]) => {
89716
89786
  const size = value.trim().toLowerCase();
@@ -89811,7 +89881,7 @@ function nearestRoot(el) {
89811
89881
  function visible(el) {
89812
89882
  const style = el.getAttribute("style") ?? "";
89813
89883
  if (/display:\s*none/.test(style)) return false;
89814
- if (hiddenInline(el) && /position:\s*(absolute|fixed)/.test(style)) return false;
89884
+ if (hiddenInline(el) && /position:\s*(absolute|fixed)/.test(style) && !(isFieldControl(el) && !/visibility:\s*hidden/.test(style))) return false;
89815
89885
  if (el.hasAttribute("hidden")) return false;
89816
89886
  if (el.getAttribute("role") === "tooltip") return false;
89817
89887
  if (el.getAttribute("data-uds-props")?.includes('"hidden":true')) return false;
@@ -90671,7 +90741,7 @@ var Entity = class {
90671
90741
  };
90672
90742
 
90673
90743
  // ../config/dist/framework/schema-version.js
90674
- var CURRENT_SCHEMA_VERSION = 20261105185042;
90744
+ var CURRENT_SCHEMA_VERSION = 20261106185419;
90675
90745
  var SETTINGS_AS_KIND_VERSION = 20260908171448;
90676
90746
  var SchemaVersionTooNew = class extends ConfigFormatError {
90677
90747
  found;
@@ -90691,7 +90761,7 @@ function registerSchemaMigrations(...migrations) {
90691
90761
  for (const migration of migrations) {
90692
90762
  if (migration.version !== 1 && !isMintTimestamp(migration.version)) throw new Error(`Schema migration version ${migration.version} is not a mint timestamp \u2014 mint one with \`date +%Y%m%d%H%M%S\`, like a supabase migration.`);
90693
90763
  if (REGISTERED.has(migration.version)) throw new Error(`A schema migration at version ${migration.version} is already registered.`);
90694
- if (migration.version > 20261105185042) throw new Error(`Schema migration ${migration.version} is newer than CURRENT_SCHEMA_VERSION (${CURRENT_SCHEMA_VERSION}) \u2014 a stale branch merged, or the mint forgot to bump the constant. Re-mint: set CURRENT_SCHEMA_VERSION to the newest migration version.`);
90764
+ if (migration.version > 20261106185419) throw new Error(`Schema migration ${migration.version} is newer than CURRENT_SCHEMA_VERSION (${CURRENT_SCHEMA_VERSION}) \u2014 a stale branch merged, or the mint forgot to bump the constant. Re-mint: set CURRENT_SCHEMA_VERSION to the newest migration version.`);
90695
90765
  REGISTERED.set(migration.version, migration);
90696
90766
  }
90697
90767
  }
@@ -90722,7 +90792,7 @@ function pendingFor(version2, target2, options) {
90722
90792
  return [...(options?.migrations ?? REGISTERED).values()].filter((m) => m.version > version2 && m.version <= target2).sort((a, b) => a.version - b.version);
90723
90793
  }
90724
90794
  function upgradeSerializedConfig(json2, options) {
90725
- const target2 = options?.target ?? 20261105185042;
90795
+ const target2 = options?.target ?? 20261106185419;
90726
90796
  const version2 = detectedWireVersion(json2);
90727
90797
  if (version2 > target2) throw new SchemaVersionTooNew(version2, target2);
90728
90798
  const raw = json2;
@@ -97859,7 +97929,7 @@ var Config = class Config2 {
97859
97929
  * links from the provided sources. A declared `linkedKind` with no provided source throws. */
97860
97930
  hydrateFrom(stored, options) {
97861
97931
  const claimed = schemaVersionOf(stored);
97862
- if (claimed > 20261105185042) throw new SchemaVersionTooNew(claimed);
97932
+ if (claimed > 20261106185419) throw new SchemaVersionTooNew(claimed);
97863
97933
  const wire = upgradeSerializedConfig(stored);
97864
97934
  if (!Array.isArray(wire.ownedKinds) || typeof wire.items !== "object" || wire.items === null) throw new ConfigFormatError(`Config "${stored.name ?? "system-config"}" cannot be hydrated: this is not a serialized config-v2 config (no "ownedKinds"/"items"). A pre-cutover build artifact converts through the registered cutover migration \u2014 import the config type's module (e.g. \`configs/system\`) before hydrating.`);
97865
97935
  const leftover = wire.options;
@@ -101592,6 +101662,13 @@ var sourcesStoredMigration = {
101592
101662
  }
101593
101663
  };
101594
101664
 
101665
+ // ../config/dist/migrations/20261106185419_modifier_class_prefix.js
101666
+ var MODIFIER_CLASS_PREFIX_VERSION = 20261106185419;
101667
+ var modifierClassPrefixMigration = {
101668
+ version: MODIFIER_CLASS_PREFIX_VERSION,
101669
+ up: (json2) => json2
101670
+ };
101671
+
101595
101672
  // ../../node_modules/css-tree/lib/generator/sourceMap.js
101596
101673
  var import_source_map_generator = __toESM(require_source_map_generator(), 1);
101597
101674
  var trackNodes = /* @__PURE__ */ new Set(["Atrule", "Selector", "Declaration"]);
@@ -104338,6 +104415,7 @@ if (!registeredSchemaMigrations().has(20261102193912)) registerSchemaMigrations(
104338
104415
  if (!registeredSchemaMigrations().has(20261103115059)) registerSchemaMigrations(sourcesAuthoringMigration);
104339
104416
  if (!registeredSchemaMigrations().has(20261104151013)) registerSchemaMigrations(buildDebugMigration);
104340
104417
  if (!registeredSchemaMigrations().has(20261105185042)) registerSchemaMigrations(sourcesStoredMigration);
104418
+ if (!registeredSchemaMigrations().has(20261106185419)) registerSchemaMigrations(modifierClassPrefixMigration);
104341
104419
 
104342
104420
  // ../config/dist/capture/node-ops.js
104343
104421
  var DEFAULT_WIDTH = 1600;