@yahoo/uds-create-cli 5.82.0 → 5.83.0
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 +12 -12
- package/subprocess/transform-runner.mjs +109 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yahoo/uds-create-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.83.0",
|
|
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.
|
|
36
|
-
"@yahoo/uds-create-loader": "5.
|
|
37
|
-
"@yahoo/uds-create-types": "5.
|
|
38
|
-
"@yahoo/uds-create-utils": "5.
|
|
35
|
+
"@yahoo/uds-create-config": "5.83.0",
|
|
36
|
+
"@yahoo/uds-create-loader": "5.83.0",
|
|
37
|
+
"@yahoo/uds-create-types": "5.83.0",
|
|
38
|
+
"@yahoo/uds-create-utils": "5.83.0",
|
|
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":
|
|
55
|
+
"udsSchemaVersion": 20261108042210,
|
|
56
56
|
"optionalDependencies": {
|
|
57
|
-
"@yahoo/uds-create-cli-darwin-arm64": "5.
|
|
58
|
-
"@yahoo/uds-create-cli-darwin-x64": "5.
|
|
59
|
-
"@yahoo/uds-create-cli-linux-arm64": "5.
|
|
60
|
-
"@yahoo/uds-create-cli-linux-x64": "5.
|
|
61
|
-
"@yahoo/uds-create-cli-linux-arm64-musl": "5.
|
|
62
|
-
"@yahoo/uds-create-cli-linux-x64-musl": "5.
|
|
57
|
+
"@yahoo/uds-create-cli-darwin-arm64": "5.83.0",
|
|
58
|
+
"@yahoo/uds-create-cli-darwin-x64": "5.83.0",
|
|
59
|
+
"@yahoo/uds-create-cli-linux-arm64": "5.83.0",
|
|
60
|
+
"@yahoo/uds-create-cli-linux-x64": "5.83.0",
|
|
61
|
+
"@yahoo/uds-create-cli-linux-arm64-musl": "5.83.0",
|
|
62
|
+
"@yahoo/uds-create-cli-linux-x64-musl": "5.83.0"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -84683,7 +84683,20 @@ var TokenEntity = defineEntity({
|
|
|
84683
84683
|
const { value, overrides } = data;
|
|
84684
84684
|
return { aliases: [value, ...Object.values(overrides ?? {}).map((override) => override?.value)].filter((alias) => isRef2(alias) && kindOf2(alias.__ref) === "token") };
|
|
84685
84685
|
},
|
|
84686
|
-
schemas: {
|
|
84686
|
+
schemas: {
|
|
84687
|
+
get: {
|
|
84688
|
+
input: external_exports.object({
|
|
84689
|
+
path: pathInput("token"),
|
|
84690
|
+
detail: external_exports.enum(["full"]).optional().describe('`"full"` adds the token\'s stored body: its value, overrides and metadata as authored.')
|
|
84691
|
+
}),
|
|
84692
|
+
readOnly: true,
|
|
84693
|
+
label: "Get",
|
|
84694
|
+
description: 'Get one token by its qualified `path`: what it comes to in each mode, and the tokens it refers to on the way. Pass `detail: "full"` for its stored body, which editing it needs.',
|
|
84695
|
+
scope: "item",
|
|
84696
|
+
handler: (input2, config2) => config2.resolve("token", String(input2.path))
|
|
84697
|
+
},
|
|
84698
|
+
create: { description: `Create a token at \`<group>/<name>\` \u2014 \`data.value\` is the CSS value. The first path segment is its group, and a style property takes a whole group as one ref (\`${JSON.stringify(ref("token", "<group>"))}\`), so put the tokens one prop should offer in one group rather than listing values on the prop.` }
|
|
84699
|
+
}
|
|
84687
84700
|
});
|
|
84688
84701
|
var baseTokenRef = TokenEntity.ref.bind(TokenEntity);
|
|
84689
84702
|
function tokenRef(path2) {
|
|
@@ -87172,6 +87185,17 @@ var ComponentEntity = defineEntity({
|
|
|
87172
87185
|
});
|
|
87173
87186
|
}
|
|
87174
87187
|
},
|
|
87188
|
+
get: {
|
|
87189
|
+
input: external_exports.object({
|
|
87190
|
+
path: pathInput("component"),
|
|
87191
|
+
detail: external_exports.enum(["full"]).optional().describe('`"full"` adds what an author needs: each layer\'s forwards and what it could still forward, and the style rules, anatomy and preview content.')
|
|
87192
|
+
}),
|
|
87193
|
+
readOnly: true,
|
|
87194
|
+
label: "Get",
|
|
87195
|
+
description: 'Get one component by its qualified `path`: its props and a usage example. Pass `detail: "full"` for the forwards, style rules, anatomy and preview content, which editing it needs.',
|
|
87196
|
+
scope: "item",
|
|
87197
|
+
handler: (input2, config2) => config2.resolve("component", String(input2.path))
|
|
87198
|
+
},
|
|
87175
87199
|
validate: {
|
|
87176
87200
|
input: external_exports.object({
|
|
87177
87201
|
path: pathInput("component"),
|
|
@@ -88389,6 +88413,8 @@ var Converter = class {
|
|
|
88389
88413
|
breakpoints;
|
|
88390
88414
|
/** Each modifier's class prefix (`md`) → the prop key its bag is written under (`_md`). */
|
|
88391
88415
|
modifierKeys;
|
|
88416
|
+
/** The classes a modifier's selector names on another element (`.peer`, `.group`). */
|
|
88417
|
+
markerClasses;
|
|
88392
88418
|
constructor(options, grammar) {
|
|
88393
88419
|
this.options = options;
|
|
88394
88420
|
this.grammar = grammar;
|
|
@@ -88414,6 +88440,13 @@ var Converter = class {
|
|
|
88414
88440
|
});
|
|
88415
88441
|
}
|
|
88416
88442
|
this.breakpoints = breakpoints;
|
|
88443
|
+
const markers = /* @__PURE__ */ new Set();
|
|
88444
|
+
for (const modifier of options.config.list("modifier")) {
|
|
88445
|
+
const { type, value } = modifier.toJSON();
|
|
88446
|
+
if (type !== "selector" || typeof value !== "string") continue;
|
|
88447
|
+
for (const [, name] of value.matchAll(/\.(-?[A-Za-z_][\w-]*)/g)) markers.add(name);
|
|
88448
|
+
}
|
|
88449
|
+
this.markerClasses = markers;
|
|
88417
88450
|
this.modifierKeys = new Map(options.config.list("modifier").map((modifier) => [modifierClassPrefix(modifier), `_${modifier.leaf}`]));
|
|
88418
88451
|
}
|
|
88419
88452
|
convertTop(el) {
|
|
@@ -88494,15 +88527,22 @@ var Converter = class {
|
|
|
88494
88527
|
plain(el, convertKids = () => this.plainChildren(el)) {
|
|
88495
88528
|
const tag = el.tagName.toLowerCase();
|
|
88496
88529
|
if (FORBIDDEN_TAGS.has(tag)) return [];
|
|
88497
|
-
|
|
88498
|
-
if (
|
|
88530
|
+
let kidsOf = convertKids;
|
|
88531
|
+
if (el.hasAttribute(FOLD) && !this.placesItself(el)) {
|
|
88532
|
+
const kids = convertKids();
|
|
88533
|
+
if (kids.length <= 1) return this.pinFolded(el, kids);
|
|
88534
|
+
kidsOf = () => kids;
|
|
88535
|
+
}
|
|
88536
|
+
if ([...inlineDeclarations(el), ...declarationsOf(el.getAttribute("data-uds-computed") ?? "")].find(([property]) => property === "display")?.[1].trim() === "contents") return kidsOf();
|
|
88499
88537
|
const { className: className2, style, paints } = this.plainStyle(el);
|
|
88500
88538
|
const attrs = plainAttributes(el);
|
|
88501
88539
|
if (tag === "img" && !attrs.src) return [];
|
|
88502
|
-
const children = VOID_TAGS.has(tag) ? [] :
|
|
88540
|
+
const children = VOID_TAGS.has(tag) ? [] : kidsOf();
|
|
88503
88541
|
const text = children.length === 0 ? plainText(el) : "";
|
|
88504
|
-
if (children.length === 0 && !text && !VOID_TAGS.has(tag) && !paints && !sizesItself(el) && !el.hasAttribute(EMBED_SPACE_ATTR)) return [];
|
|
88505
|
-
|
|
88542
|
+
if (children.length === 0 && !text && !VOID_TAGS.has(tag) && !paints && !sizesItself(el) && !el.hasAttribute(EMBED_SPACE_ATTR) && !holdsGridCell(el)) return [];
|
|
88543
|
+
const carries = className2 !== "" || Object.keys(style).length > 0 || Object.keys(attrs).length > 0;
|
|
88544
|
+
const holdsCell = children.length === 0 && !text && holdsGridCell(el);
|
|
88545
|
+
if (!carries && GROUPING_TAGS.has(tag) && children.length <= 1 && !holdsCell) {
|
|
88506
88546
|
if (text) return this.plainTextRun(text);
|
|
88507
88547
|
return children;
|
|
88508
88548
|
}
|
|
@@ -88690,6 +88730,7 @@ var Converter = class {
|
|
|
88690
88730
|
classes.push(...owned.length < each.atoms.size ? this.narrowed(each, new Set(owned)) : [each.bare]);
|
|
88691
88731
|
}
|
|
88692
88732
|
fromDeclarations(declarationsOf(el.getAttribute("data-uds-computed") ?? ""));
|
|
88733
|
+
for (const cls of classesOf(el)) if (this.markerClasses.has(cls)) classes.push(cls);
|
|
88693
88734
|
return {
|
|
88694
88735
|
className: [...new Set(classes)].join(" "),
|
|
88695
88736
|
style,
|
|
@@ -88726,6 +88767,20 @@ var Converter = class {
|
|
|
88726
88767
|
}
|
|
88727
88768
|
}
|
|
88728
88769
|
/**
|
|
88770
|
+
* Whether an element's classes or computed styles place it in its parent's grid or flex row (a
|
|
88771
|
+
* column span, its own alignment, a flex share). Folding it would leave its child unplaced, so a
|
|
88772
|
+
* card spanning two columns would take one.
|
|
88773
|
+
*/
|
|
88774
|
+
placesItself(el) {
|
|
88775
|
+
if (declarationsOf(el.getAttribute("data-uds-computed") ?? "").some(([property]) => PLACEMENT_PROPERTY.test(property))) return true;
|
|
88776
|
+
return classesOf(el).some((cls) => {
|
|
88777
|
+
const read = this.readModifiedClass(cls);
|
|
88778
|
+
if (!read || read.modifiers.length > 0) return false;
|
|
88779
|
+
const { properties = [] } = this.options.config.resolve("style-property", read.style.path)?.toJSON() ?? {};
|
|
88780
|
+
return properties.some((property) => PLACEMENT_PROPERTY.test(property));
|
|
88781
|
+
});
|
|
88782
|
+
}
|
|
88783
|
+
/**
|
|
88729
88784
|
* The content of an unmarked wrapper the capture folded, with the wrapper's measured box written
|
|
88730
88785
|
* onto it when it is one element: the wrapper's sizing (a flex share, a fixed size) no longer reaches
|
|
88731
88786
|
* the child, so the child keeps the box it had.
|
|
@@ -88860,7 +88915,7 @@ var Converter = class {
|
|
|
88860
88915
|
const important = /^!|!$/.test(leaf);
|
|
88861
88916
|
if (important) leaf = leaf.replace(/^!|!$/, "");
|
|
88862
88917
|
if (important) rank += IMPORTANT_RANK;
|
|
88863
|
-
const style = this.grammar.styleProp(leaf);
|
|
88918
|
+
const style = this.grammar.styleProp(leaf) ?? this.grammar.styleProp(FADED_CLASS.exec(leaf)?.[1] ?? "");
|
|
88864
88919
|
return style ? {
|
|
88865
88920
|
modifiers,
|
|
88866
88921
|
style,
|
|
@@ -89607,6 +89662,8 @@ var ROOT_ATTRIBUTE_PROPS = [
|
|
|
89607
89662
|
"placeholder"
|
|
89608
89663
|
];
|
|
89609
89664
|
var PAINT_PROPERTY = /^(background|border-(top-|right-|bottom-|left-)?(width|color)|box-shadow|outline)/;
|
|
89665
|
+
var FADED_CLASS = /^(.+)\/(?:100|\d{1,2}(?:\.\d+)?)$/;
|
|
89666
|
+
var PLACEMENT_PROPERTY = /^(grid-(column|row|area)(-start|-end)?|(align|justify|place)-self|order|flex(-grow)?)$/;
|
|
89610
89667
|
var GROUPING_TAGS = /* @__PURE__ */ new Set(["div", "span"]);
|
|
89611
89668
|
var VOID_TAGS = /* @__PURE__ */ new Set([
|
|
89612
89669
|
"img",
|
|
@@ -89634,6 +89691,7 @@ var PLAIN_ATTRIBUTES = {
|
|
|
89634
89691
|
rowspan: "rowSpan",
|
|
89635
89692
|
for: "htmlFor"
|
|
89636
89693
|
};
|
|
89694
|
+
var BOOLEAN_ATTRIBUTES = ["open", "disabled"];
|
|
89637
89695
|
function plainAttributes(el) {
|
|
89638
89696
|
const out = {};
|
|
89639
89697
|
const tag = el.tagName.toLowerCase();
|
|
@@ -89648,6 +89706,17 @@ function plainAttributes(el) {
|
|
|
89648
89706
|
const value = tag === "textarea" ? el.textContent ?? "" : el.getAttribute("value");
|
|
89649
89707
|
if (value) out.defaultValue = value;
|
|
89650
89708
|
}
|
|
89709
|
+
if (tag === "input" && el.hasAttribute("checked")) out.defaultChecked = true;
|
|
89710
|
+
for (const attr of BOOLEAN_ATTRIBUTES) if (el.hasAttribute(attr)) out[attr] = true;
|
|
89711
|
+
if (tag === "option") {
|
|
89712
|
+
const value = el.getAttribute("value");
|
|
89713
|
+
if (value !== null && value !== void 0) out.value = value;
|
|
89714
|
+
}
|
|
89715
|
+
if (tag === "select") {
|
|
89716
|
+
const chosen = el.querySelector("option[selected]");
|
|
89717
|
+
const value = chosen?.getAttribute("value") ?? chosen?.textContent;
|
|
89718
|
+
if (value) out.defaultValue = value;
|
|
89719
|
+
}
|
|
89651
89720
|
return out;
|
|
89652
89721
|
}
|
|
89653
89722
|
function plainText(el) {
|
|
@@ -89667,6 +89736,9 @@ function camelCase3(property) {
|
|
|
89667
89736
|
function isImage(el) {
|
|
89668
89737
|
return el.tagName.toLowerCase() === "img" && !el.hasAttribute("data-uds-component");
|
|
89669
89738
|
}
|
|
89739
|
+
function isFieldControl(el) {
|
|
89740
|
+
return isField(el) || el.tagName.toLowerCase() === "select";
|
|
89741
|
+
}
|
|
89670
89742
|
function isField(el) {
|
|
89671
89743
|
const tag = el.tagName.toLowerCase();
|
|
89672
89744
|
return tag === "input" || tag === "textarea";
|
|
@@ -89728,6 +89800,11 @@ var SIZING_PROPERTY = /* @__PURE__ */ new Set([
|
|
|
89728
89800
|
"min-height",
|
|
89729
89801
|
"flex-basis"
|
|
89730
89802
|
]);
|
|
89803
|
+
function holdsGridCell(el) {
|
|
89804
|
+
const parent = el.parentElement;
|
|
89805
|
+
if (!parent) return false;
|
|
89806
|
+
return declarationsOf(parent.getAttribute("data-uds-computed") ?? "").some(([property, value]) => property === "display" && /^(inline-)?grid$/.test(value.trim()));
|
|
89807
|
+
}
|
|
89731
89808
|
function sizesItself(el) {
|
|
89732
89809
|
return inlineDeclarations(el).some(([property, value]) => {
|
|
89733
89810
|
const size = value.trim().toLowerCase();
|
|
@@ -89828,7 +89905,7 @@ function nearestRoot(el) {
|
|
|
89828
89905
|
function visible(el) {
|
|
89829
89906
|
const style = el.getAttribute("style") ?? "";
|
|
89830
89907
|
if (/display:\s*none/.test(style)) return false;
|
|
89831
|
-
if (hiddenInline(el) && /position:\s*(absolute|fixed)/.test(style)) return false;
|
|
89908
|
+
if (hiddenInline(el) && /position:\s*(absolute|fixed)/.test(style) && !(isFieldControl(el) && !/visibility:\s*hidden/.test(style))) return false;
|
|
89832
89909
|
if (el.hasAttribute("hidden")) return false;
|
|
89833
89910
|
if (el.getAttribute("role") === "tooltip") return false;
|
|
89834
89911
|
if (el.getAttribute("data-uds-props")?.includes('"hidden":true')) return false;
|
|
@@ -90688,7 +90765,7 @@ var Entity = class {
|
|
|
90688
90765
|
};
|
|
90689
90766
|
|
|
90690
90767
|
// ../config/dist/framework/schema-version.js
|
|
90691
|
-
var CURRENT_SCHEMA_VERSION =
|
|
90768
|
+
var CURRENT_SCHEMA_VERSION = 20261108042210;
|
|
90692
90769
|
var SETTINGS_AS_KIND_VERSION = 20260908171448;
|
|
90693
90770
|
var SchemaVersionTooNew = class extends ConfigFormatError {
|
|
90694
90771
|
found;
|
|
@@ -90708,7 +90785,7 @@ function registerSchemaMigrations(...migrations) {
|
|
|
90708
90785
|
for (const migration of migrations) {
|
|
90709
90786
|
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.`);
|
|
90710
90787
|
if (REGISTERED.has(migration.version)) throw new Error(`A schema migration at version ${migration.version} is already registered.`);
|
|
90711
|
-
if (migration.version >
|
|
90788
|
+
if (migration.version > 20261108042210) 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.`);
|
|
90712
90789
|
REGISTERED.set(migration.version, migration);
|
|
90713
90790
|
}
|
|
90714
90791
|
}
|
|
@@ -90739,7 +90816,7 @@ function pendingFor(version2, target2, options) {
|
|
|
90739
90816
|
return [...(options?.migrations ?? REGISTERED).values()].filter((m) => m.version > version2 && m.version <= target2).sort((a, b) => a.version - b.version);
|
|
90740
90817
|
}
|
|
90741
90818
|
function upgradeSerializedConfig(json2, options) {
|
|
90742
|
-
const target2 = options?.target ??
|
|
90819
|
+
const target2 = options?.target ?? 20261108042210;
|
|
90743
90820
|
const version2 = detectedWireVersion(json2);
|
|
90744
90821
|
if (version2 > target2) throw new SchemaVersionTooNew(version2, target2);
|
|
90745
90822
|
const raw = json2;
|
|
@@ -97876,7 +97953,7 @@ var Config = class Config2 {
|
|
|
97876
97953
|
* links from the provided sources. A declared `linkedKind` with no provided source throws. */
|
|
97877
97954
|
hydrateFrom(stored, options) {
|
|
97878
97955
|
const claimed = schemaVersionOf(stored);
|
|
97879
|
-
if (claimed >
|
|
97956
|
+
if (claimed > 20261108042210) throw new SchemaVersionTooNew(claimed);
|
|
97880
97957
|
const wire = upgradeSerializedConfig(stored);
|
|
97881
97958
|
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.`);
|
|
97882
97959
|
const leftover = wire.options;
|
|
@@ -101616,6 +101693,24 @@ var modifierClassPrefixMigration = {
|
|
|
101616
101693
|
up: (json2) => json2
|
|
101617
101694
|
};
|
|
101618
101695
|
|
|
101696
|
+
// ../config/dist/migrations/20261107213031_component_get_detail.js
|
|
101697
|
+
var COMPONENT_GET_DETAIL_VERSION = 20261107213031;
|
|
101698
|
+
var componentGetDetailMigration = {
|
|
101699
|
+
version: COMPONENT_GET_DETAIL_VERSION,
|
|
101700
|
+
up(json2) {
|
|
101701
|
+
return json2;
|
|
101702
|
+
}
|
|
101703
|
+
};
|
|
101704
|
+
|
|
101705
|
+
// ../config/dist/migrations/20261108042210_token_get_detail.js
|
|
101706
|
+
var TOKEN_GET_DETAIL_VERSION = 20261108042210;
|
|
101707
|
+
var tokenGetDetailMigration = {
|
|
101708
|
+
version: TOKEN_GET_DETAIL_VERSION,
|
|
101709
|
+
up(json2) {
|
|
101710
|
+
return json2;
|
|
101711
|
+
}
|
|
101712
|
+
};
|
|
101713
|
+
|
|
101619
101714
|
// ../../node_modules/css-tree/lib/generator/sourceMap.js
|
|
101620
101715
|
var import_source_map_generator = __toESM(require_source_map_generator(), 1);
|
|
101621
101716
|
var trackNodes = /* @__PURE__ */ new Set(["Atrule", "Selector", "Declaration"]);
|
|
@@ -104363,6 +104458,8 @@ if (!registeredSchemaMigrations().has(20261103115059)) registerSchemaMigrations(
|
|
|
104363
104458
|
if (!registeredSchemaMigrations().has(20261104151013)) registerSchemaMigrations(buildDebugMigration);
|
|
104364
104459
|
if (!registeredSchemaMigrations().has(20261105185042)) registerSchemaMigrations(sourcesStoredMigration);
|
|
104365
104460
|
if (!registeredSchemaMigrations().has(20261106185419)) registerSchemaMigrations(modifierClassPrefixMigration);
|
|
104461
|
+
if (!registeredSchemaMigrations().has(20261107213031)) registerSchemaMigrations(componentGetDetailMigration);
|
|
104462
|
+
if (!registeredSchemaMigrations().has(20261108042210)) registerSchemaMigrations(tokenGetDetailMigration);
|
|
104366
104463
|
|
|
104367
104464
|
// ../config/dist/capture/node-ops.js
|
|
104368
104465
|
var DEFAULT_WIDTH = 1600;
|