@yahoo/uds-create-cli 5.94.3 → 5.94.5

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.94.3",
3
+ "version": "5.94.5",
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.94.3",
36
- "@yahoo/uds-create-loader": "5.94.3",
37
- "@yahoo/uds-create-types": "5.94.3",
38
- "@yahoo/uds-create-utils": "5.94.3",
35
+ "@yahoo/uds-create-config": "5.94.5",
36
+ "@yahoo/uds-create-loader": "5.94.5",
37
+ "@yahoo/uds-create-types": "5.94.5",
38
+ "@yahoo/uds-create-utils": "5.94.5",
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": 20261112145536,
55
+ "udsSchemaVersion": 20261112154943,
56
56
  "optionalDependencies": {
57
- "@yahoo/uds-create-cli-darwin-arm64": "5.94.3",
58
- "@yahoo/uds-create-cli-darwin-x64": "5.94.3",
59
- "@yahoo/uds-create-cli-linux-arm64": "5.94.3",
60
- "@yahoo/uds-create-cli-linux-x64": "5.94.3",
61
- "@yahoo/uds-create-cli-linux-arm64-musl": "5.94.3",
62
- "@yahoo/uds-create-cli-linux-x64-musl": "5.94.3"
57
+ "@yahoo/uds-create-cli-darwin-arm64": "5.94.5",
58
+ "@yahoo/uds-create-cli-darwin-x64": "5.94.5",
59
+ "@yahoo/uds-create-cli-linux-arm64": "5.94.5",
60
+ "@yahoo/uds-create-cli-linux-x64": "5.94.5",
61
+ "@yahoo/uds-create-cli-linux-arm64-musl": "5.94.5",
62
+ "@yahoo/uds-create-cli-linux-x64-musl": "5.94.5"
63
63
  }
64
64
  }
@@ -73439,6 +73439,7 @@ function defineSubEntity(spec2) {
73439
73439
  keyedByNameIn: spec2.keyedByNameIn,
73440
73440
  listedIn: spec2.listedIn,
73441
73441
  orphans: spec2.orphans,
73442
+ renameRefusal: spec2.renameRefusal,
73442
73443
  ref: (kind, path2, member2) => memberRef(kind, path2, spec2.name, member2),
73443
73444
  get: (config2, owner, member2, ownerMember) => {
73444
73445
  if (spec2.singleton) return memberOn(config2, owner);
@@ -78943,6 +78944,15 @@ function listedIn(domain2) {
78943
78944
  if (Array.isArray(domain2)) return domain2.filter((value) => typeof value === "string");
78944
78945
  return typeof domain2 === "object" && domain2 !== null ? Object.keys(domain2) : void 0;
78945
78946
  }
78947
+ function booleanValuesIn(domain2) {
78948
+ const out = /* @__PURE__ */ new Set();
78949
+ if (typeof domain2 !== "object" || domain2 === null || Array.isArray(domain2)) return out;
78950
+ for (const name of ["true", "false"]) {
78951
+ const body = domain2[name];
78952
+ if (typeof body === "object" && body !== null && body.boolean === true) out.add(name);
78953
+ }
78954
+ return out;
78955
+ }
78946
78956
 
78947
78957
  // ../config/dist/entities/system/linked-style-values.js
78948
78958
  function translateLinkedStyleBags({ body, source, config: config2, bags, owner }) {
@@ -79021,6 +79031,15 @@ function spellValues(values2) {
79021
79031
  function oneOf(values2) {
79022
79032
  return values2.length > 0 ? external_exports.enum(values2, { error: () => `one of ${spellValues(values2)}` }) : void 0;
79023
79033
  }
79034
+ function listedSchema(domain2, listed) {
79035
+ const booleans = booleanValuesIn(domain2);
79036
+ if (booleans.size === 0) return oneOf(listed);
79037
+ const names = listed.filter((name) => !booleans.has(name));
79038
+ const spelled4 = [...booleans];
79039
+ const forms = [external_exports.literal(spelled4.map((name) => name === "true")), external_exports.enum(spelled4).transform((name) => name === "true")];
79040
+ if (names.length > 0) forms.push(external_exports.enum(names));
79041
+ return external_exports.union(forms, { error: () => names.length > 0 ? `${[...booleans].join(", ")}, or one of ${spellValues(names)}` : [...booleans].join(" or ") });
79042
+ }
79024
79043
  var arbitraryValue = external_exports.string().regex(/^\[.+\]$/, 'Expected an off-system literal like "[13px]"');
79025
79044
  function stylePropertyOf(ref2, config2) {
79026
79045
  if (kindOf2(ref2) !== STYLE_PROPERTY || memberOf2(ref2) !== void 0) return;
@@ -79114,7 +79133,7 @@ function valueSchemaOf(declaration, config2, seen = /* @__PURE__ */ new Set()) {
79114
79133
  return buildRefListDomainSchema(targets, config2, seen);
79115
79134
  }
79116
79135
  const listed = listedIn(domain2);
79117
- if (listed) return oneOf(listed) ?? external_exports.unknown();
79136
+ if (listed) return listedSchema(domain2, listed) ?? external_exports.unknown();
79118
79137
  if (typeof domain2 === "boolean") return external_exports.boolean();
79119
79138
  if (typeof domain2 === "string") return external_exports.string();
79120
79139
  if (typeof domain2 === "number") return external_exports.number();
@@ -79499,7 +79518,11 @@ var Style = defineSubEntity({
79499
79518
  otherwise: value
79500
79519
  });
79501
79520
  }
79502
- if (declared2) return value;
79521
+ if (declared2) {
79522
+ const booleans = [...booleanValuesIn(declared2.value)];
79523
+ if (declared2.type !== "variant" || booleans.length === 0) return value;
79524
+ return external_exports.union([external_exports.enum(booleans).transform((name) => name === "true"), value]);
79525
+ }
79503
79526
  if (!config2.resolve("style-property", key2)) return value;
79504
79527
  return bound(config2, {
79505
79528
  type: "styleProperty",
@@ -86619,9 +86642,17 @@ var variantValueFields = external_exports.strictObject({
86619
86642
  /** Withdrawn from new work, exactly as a component's own `deprecated` is: still valid wherever
86620
86643
  * it is already used, left out of surfaces that offer values. The alternative to deleting it,
86621
86644
  * which takes its styling with it. */
86622
- deprecated: external_exports.boolean().optional()
86645
+ deprecated: external_exports.boolean().optional(),
86646
+ /** The member stands for the boolean its name spells, so `true` and `false` are what code passes
86647
+ * and a rule tests, beside the variant's other names (`checked`: `true`, `false`,
86648
+ * `'indeterminate'`). Only a value named `true` or `false` may carry it. */
86649
+ boolean: external_exports.boolean().optional()
86623
86650
  });
86624
- var listedVariantValue = external_exports.union([external_exports.string(), variantValueFields.extend({ value: external_exports.string() })]);
86651
+ var listedVariantValue = external_exports.union([
86652
+ external_exports.string(),
86653
+ external_exports.boolean(),
86654
+ variantValueFields.omit({ boolean: true }).extend({ value: external_exports.union([external_exports.string(), external_exports.boolean()]) })
86655
+ ]);
86625
86656
  var VariantValue = defineSubEntity({
86626
86657
  name: "value",
86627
86658
  label: "Value",
@@ -86635,13 +86666,18 @@ var VariantValue = defineSubEntity({
86635
86666
  "styles",
86636
86667
  "preview",
86637
86668
  "defaultPropsWhen"
86638
- ]
86669
+ ],
86670
+ renameRefusal: (member) => member?.boolean ? "it stands for a boolean, which its name spells. Delete it and add the value under its new name instead." : void 0
86639
86671
  });
86640
86672
  var variantDomain = external_exports.union([
86641
86673
  external_exports.array(listedVariantValue).transform((values2) => Object.fromEntries(values2.map((entry) => {
86642
86674
  if (typeof entry === "string") return [entry, {}];
86675
+ if (typeof entry === "boolean") return [String(entry), { boolean: true }];
86643
86676
  const { value, ...body } = entry;
86644
- return [value, body];
86677
+ return typeof value === "boolean" ? [String(value), {
86678
+ ...body,
86679
+ boolean: true
86680
+ }] : [value, body];
86645
86681
  }))),
86646
86682
  external_exports.array(refSchema).min(1),
86647
86683
  refSchema,
@@ -86710,6 +86746,23 @@ function propShapeWith(when) {
86710
86746
  value: variantDomain,
86711
86747
  required: external_exports.boolean().optional(),
86712
86748
  when
86749
+ }).check((ctx) => {
86750
+ const { value } = ctx.value;
86751
+ if (typeof value !== "object" || value === null || isRef2(value)) return;
86752
+ if (Array.isArray(value)) return;
86753
+ for (const [name, body] of Object.entries(value)) {
86754
+ if (!body?.boolean || name === "true" || name === "false") continue;
86755
+ ctx.issues.push({
86756
+ code: "custom",
86757
+ input: ctx.value,
86758
+ path: [
86759
+ "value",
86760
+ name,
86761
+ "boolean"
86762
+ ],
86763
+ message: `Only a value named \`true\` or \`false\` stands for a boolean; \`${name}\` is a name.`
86764
+ });
86765
+ }
86713
86766
  }),
86714
86767
  external_exports.strictObject({
86715
86768
  type: external_exports.literal("forward"),
@@ -86791,7 +86844,7 @@ var PROP_TYPES = [
86791
86844
  "number",
86792
86845
  "boolean"
86793
86846
  ];
86794
- var PROP_DESCRIPTION = 'What the prop is. A style property the component exposes, `{ "type": "styleProperty", "value": { "__ref": "style-property:<name>" } }`, which is what a primitive\'s props mostly are and what makes a style rule\'s bag key valid on it; a closed set of names a style rule keys on, `{ "type": "variant", "value": ["sm", "lg"] }`, where a value that carries a label is written in place as `{ "value": "md", "label": "Medium" }`; content, `{ "type": "slot", "text": true }`, or a slot whose own value is a library member, `{ "type": "slot", "value": { "__ref": "icon:<library>" } }`, which code may also fill with the forms it lists under `code` (`["node", "element", "render"]`); or a plain `string`, `number` or `boolean`. An id no two instances share is `{ "type": "string", "uniqueId": true }`; a prop naming one adds `"uniqueIdRef": { "__ref": "component:<path>#props/<id>" }`, and with both is one per id. `null` hides a prop an inherited layer would expose. A prop that applies only under a condition on a sibling carries `when`, the record a style rule uses: `{ "type": "string", "when": { "type": "color" } }` shows it for one value, `{ "when": { "type": ["default", "header"] } }` for several.';
86847
+ var PROP_DESCRIPTION = 'What the prop is. A style property the component exposes, `{ "type": "styleProperty", "value": { "__ref": "style-property:<name>" } }`, which is what a primitive\'s props mostly are and what makes a style rule\'s bag key valid on it; a closed set of names a style rule keys on, `{ "type": "variant", "value": ["sm", "lg"] }`, where a value that carries a label is written in place as `{ "value": "md", "label": "Medium" }`, and `true` and `false` may sit beside names (`[true, false, "indeterminate"]`); content, `{ "type": "slot", "text": true }`, or a slot whose own value is a library member, `{ "type": "slot", "value": { "__ref": "icon:<library>" } }`, which code may also fill with the forms it lists under `code` (`["node", "element", "render"]`); or a plain `string`, `number` or `boolean`. An id no two instances share is `{ "type": "string", "uniqueId": true }`; a prop naming one adds `"uniqueIdRef": { "__ref": "component:<path>#props/<id>" }`, and with both is one per id. `null` hides a prop an inherited layer would expose. A prop that applies only under a condition on a sibling carries `when`, the record a style rule uses: `{ "type": "string", "when": { "type": "color" } }` shows it for one value, `{ "when": { "type": ["default", "header"] } }` for several.';
86795
86848
  var Prop = defineSubEntity({
86796
86849
  name: "prop",
86797
86850
  label: "Prop",
@@ -87032,7 +87085,7 @@ function conditionValue(prop, declaration, config2) {
87032
87085
  if (scalar3) return scalar3;
87033
87086
  const domain2 = valueSchemaOf(declaration, config2);
87034
87087
  if (!ownsItsValues(declaration)) return domain2;
87035
- return external_exports.union([domain2, refSchema]).transform((value) => isRef2(value) ? value : valueRef(prop, String(value)));
87088
+ return external_exports.union([domain2, refSchema]).transform((value) => isRef2(value) || typeof value === "boolean" ? value : valueRef(prop, String(value)));
87036
87089
  }
87037
87090
  function stateConditionValue(declaration) {
87038
87091
  const decl = declaration;
@@ -89311,12 +89364,14 @@ function surfaceProps(config2, componentPath, seen = /* @__PURE__ */ new Set())
89311
89364
  }
89312
89365
  if (decl.type === "variant") {
89313
89366
  const iconLibraries2 = variantIconLibraries(config2, decl.value);
89367
+ const booleans = [...booleanValuesIn(decl.value)];
89314
89368
  props.push(conditioned({
89315
89369
  name,
89316
89370
  kind: "variant",
89317
89371
  required: required2,
89318
89372
  values: propValueDomain(config2, decl)?.leaves ?? [],
89319
- ...iconLibraries2 !== void 0 ? { iconLibraries: iconLibraries2 } : {}
89373
+ ...iconLibraries2 !== void 0 ? { iconLibraries: iconLibraries2 } : {},
89374
+ ...booleans.length > 0 ? { booleans } : {}
89320
89375
  }, when));
89321
89376
  continue;
89322
89377
  }
@@ -92498,7 +92553,7 @@ var Entity = class {
92498
92553
  };
92499
92554
 
92500
92555
  // ../config/dist/framework/schema-version.js
92501
- var CURRENT_SCHEMA_VERSION = 20261112145536;
92556
+ var CURRENT_SCHEMA_VERSION = 20261112154943;
92502
92557
  var SETTINGS_AS_KIND_VERSION = 20260908171448;
92503
92558
  var SchemaVersionTooNew = class extends ConfigFormatError {
92504
92559
  found;
@@ -92518,7 +92573,7 @@ function registerSchemaMigrations(...migrations) {
92518
92573
  for (const migration of migrations) {
92519
92574
  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.`);
92520
92575
  if (REGISTERED.has(migration.version)) throw new Error(`A schema migration at version ${migration.version} is already registered.`);
92521
- if (migration.version > 20261112145536) 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.`);
92576
+ if (migration.version > 20261112154943) 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.`);
92522
92577
  REGISTERED.set(migration.version, migration);
92523
92578
  }
92524
92579
  }
@@ -92549,7 +92604,7 @@ function pendingFor(version2, target2, options) {
92549
92604
  return [...(options?.migrations ?? REGISTERED).values()].filter((m) => m.version > version2 && m.version <= target2).sort((a, b) => a.version - b.version);
92550
92605
  }
92551
92606
  function upgradeSerializedConfig(json2, options) {
92552
- const target2 = options?.target ?? 20261112145536;
92607
+ const target2 = options?.target ?? 20261112154943;
92553
92608
  const version2 = detectedWireVersion(json2);
92554
92609
  if (version2 > target2) throw new SchemaVersionTooNew(version2, target2);
92555
92610
  const raw = json2;
@@ -93715,18 +93770,26 @@ function storeCollection(def, patch, next) {
93715
93770
  [outerField]: outer
93716
93771
  };
93717
93772
  }
93718
- function dropOrphans(sub, def, target2, namespace, keyed) {
93773
+ function dropOrphans(sub, def, target2, namespace, keyed, held) {
93719
93774
  if (!sub?.orphans?.length) return def;
93720
93775
  let out = def;
93721
93776
  for (const field of sub.orphans) {
93722
93777
  const collection = out[field];
93723
93778
  if (!isPlainObject2(collection)) continue;
93724
93779
  const keyedFields = Object.entries(keyed?.subEntities[field]?.namesMembersOf ?? {}).filter(([, names]) => names === keyed?.collection).map(([record2]) => record2);
93780
+ const heldFields = Object.entries(held?.subEntities[field]?.namesMembersOf ?? {}).filter(([, names]) => names === held?.collection).map(([record2]) => record2);
93781
+ const holdsLiteral = (value) => typeof value === "boolean" && String(value) === held?.key;
93725
93782
  const kept = Object.fromEntries(Object.entries(collection).filter(([, member]) => {
93726
93783
  if (keyed && isPlainObject2(member) && keyedFields.some((record2) => {
93727
93784
  const names = member[record2];
93728
93785
  return isPlainObject2(names) && Object.hasOwn(names, keyed.key);
93729
93786
  })) return false;
93787
+ if (held && isPlainObject2(member) && heldFields.some((record2) => {
93788
+ const names = member[record2];
93789
+ if (!isPlainObject2(names)) return false;
93790
+ const value = names[held.owner];
93791
+ return Array.isArray(value) ? value.some(holdsLiteral) : holdsLiteral(value);
93792
+ })) return false;
93730
93793
  const refs = collectRefs(member);
93731
93794
  if (refs.includes(target2)) return false;
93732
93795
  if (!namespace) return true;
@@ -93757,7 +93820,9 @@ function renameValueAt(node2, path2, owner, from, to) {
93757
93820
  if (head === void 0) return node2;
93758
93821
  if (rest.length === 0) {
93759
93822
  const record2 = node2[head];
93760
- if (!isPlainObject2(record2) || record2[owner] !== from) return node2;
93823
+ if (!isPlainObject2(record2)) return node2;
93824
+ const held = record2[owner];
93825
+ if (held !== from && !(typeof held === "boolean" && String(held) === from)) return node2;
93761
93826
  const next = { ...record2 };
93762
93827
  if (to === void 0) delete next[owner];
93763
93828
  else next[owner] = to;
@@ -95702,6 +95767,8 @@ var Config = class Config2 {
95702
95767
  } else if (patch.operation === "sub-rename") {
95703
95768
  if (!(patch.key in collection)) reject("NOT_FOUND", `No ${patch.field}/${patch.key} on ${patch.kind} "${patch.path}"`);
95704
95769
  if (patch.to in collection) reject("ALREADY_EXISTS", `${patch.kind} "${patch.path}" already has ${patch.field}/${patch.to}`);
95770
+ const refusal2 = sub?.renameRefusal?.(collection[patch.key]);
95771
+ if (refusal2) reject("UNSUPPORTED", `Cannot rename ${patch.field}/${patch.key} on ${patch.kind} "${patch.path}": ${refusal2}`);
95705
95772
  memberRename = {
95706
95773
  from: memberRef(patch.kind, patch.path, patch.field, patch.key).__ref,
95707
95774
  to: memberRef(patch.kind, patch.path, patch.field, patch.to).__ref
@@ -95739,7 +95806,12 @@ var Config = class Config2 {
95739
95806
  collection: patch.field,
95740
95807
  key: patch.key,
95741
95808
  subEntities: entry.subEntities
95742
- } : void 0);
95809
+ } : void 0, patch.owner === void 0 ? void 0 : {
95810
+ collection: patch.field.split("/").slice(0, -1).join("/"),
95811
+ owner: patch.owner,
95812
+ key: patch.key,
95813
+ subEntities: entry.subEntities
95814
+ });
95743
95815
  }
95744
95816
  const next = snapshot.withChanges([itemChange(entry, patch.kind, patch.path, def)]);
95745
95817
  if (!memberRename) return next;
@@ -99743,7 +99815,7 @@ var Config = class Config2 {
99743
99815
  * links from the provided sources. A declared `linkedKind` with no provided source throws. */
99744
99816
  hydrateFrom(stored, options) {
99745
99817
  const claimed = schemaVersionOf(stored);
99746
- if (claimed > 20261112145536) throw new SchemaVersionTooNew(claimed);
99818
+ if (claimed > 20261112154943) throw new SchemaVersionTooNew(claimed);
99747
99819
  const wire = upgradeSerializedConfig(stored);
99748
99820
  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.`);
99749
99821
  const leftover = wire.options;
@@ -103555,6 +103627,15 @@ var nativeLintLocationsMigration = {
103555
103627
  }
103556
103628
  };
103557
103629
 
103630
+ // ../config/dist/migrations/20261112154943_variant_booleans.js
103631
+ var VARIANT_BOOLEANS_VERSION = 20261112154943;
103632
+ var variantBooleansMigration = {
103633
+ version: VARIANT_BOOLEANS_VERSION,
103634
+ up(json2) {
103635
+ return json2;
103636
+ }
103637
+ };
103638
+
103558
103639
  // ../../node_modules/css-tree/lib/generator/sourceMap.js
103559
103640
  var import_source_map_generator = __toESM(require_source_map_generator(), 1);
103560
103641
  var trackNodes = /* @__PURE__ */ new Set(["Atrule", "Selector", "Declaration"]);
@@ -106310,6 +106391,7 @@ if (!registeredSchemaMigrations().has(20261109214535)) registerSchemaMigrations(
106310
106391
  if (!registeredSchemaMigrations().has(20261110145811)) registerSchemaMigrations(computedVisibilityMigration);
106311
106392
  if (!registeredSchemaMigrations().has(20261110171151)) registerSchemaMigrations(anatomyNodeStatesMigration);
106312
106393
  if (!registeredSchemaMigrations().has(20261112145536)) registerSchemaMigrations(nativeLintLocationsMigration);
106394
+ if (!registeredSchemaMigrations().has(20261112154943)) registerSchemaMigrations(variantBooleansMigration);
106313
106395
 
106314
106396
  // ../config/dist/capture/node-ops.js
106315
106397
  var DEFAULT_WIDTH = 1600;