@yahoo/uds-create-cli 5.65.0 → 5.66.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 +10 -10
- package/subprocess/transform-runner.mjs +339 -71
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yahoo/uds-create-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.66.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
32
32
|
"@orpc/client": "^1.13.9",
|
|
33
33
|
"@orpc/contract": "^1.13.9",
|
|
34
|
-
"@yahoo/uds-create-config": "5.
|
|
35
|
-
"@yahoo/uds-create-loader": "5.
|
|
36
|
-
"@yahoo/uds-create-types": "5.
|
|
37
|
-
"@yahoo/uds-create-utils": "5.
|
|
34
|
+
"@yahoo/uds-create-config": "5.66.1",
|
|
35
|
+
"@yahoo/uds-create-loader": "5.66.1",
|
|
36
|
+
"@yahoo/uds-create-types": "5.66.1",
|
|
37
|
+
"@yahoo/uds-create-utils": "5.66.1",
|
|
38
38
|
"esbuild": "^0.27.4",
|
|
39
39
|
"ts-morph": "^27.0.2",
|
|
40
40
|
"get-tsconfig": "^4.10.0",
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"lodash": "^4.17.23",
|
|
52
52
|
"prettier": "^3.8.1"
|
|
53
53
|
},
|
|
54
|
-
"udsSchemaVersion":
|
|
54
|
+
"udsSchemaVersion": 20261030134149,
|
|
55
55
|
"optionalDependencies": {
|
|
56
|
-
"@yahoo/uds-create-cli-darwin-arm64": "5.
|
|
57
|
-
"@yahoo/uds-create-cli-darwin-x64": "5.
|
|
58
|
-
"@yahoo/uds-create-cli-linux-arm64": "5.
|
|
59
|
-
"@yahoo/uds-create-cli-linux-x64": "5.
|
|
56
|
+
"@yahoo/uds-create-cli-darwin-arm64": "5.66.1",
|
|
57
|
+
"@yahoo/uds-create-cli-darwin-x64": "5.66.1",
|
|
58
|
+
"@yahoo/uds-create-cli-linux-arm64": "5.66.1",
|
|
59
|
+
"@yahoo/uds-create-cli-linux-x64": "5.66.1"
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -78898,20 +78898,20 @@ function expandMemberEntries(config2, target2, opts) {
|
|
|
78898
78898
|
path: qualify(path2)
|
|
78899
78899
|
}];
|
|
78900
78900
|
}
|
|
78901
|
-
const
|
|
78901
|
+
const leafOf7 = (memberPath) => memberPath.startsWith(`${path2}/`) ? memberPath.slice(path2.length + 1) : memberPath;
|
|
78902
78902
|
const theirs = owner.members(kind, path2);
|
|
78903
78903
|
if (source === void 0) return theirs.filter((member) => offered(owner, member.path)).map((member) => ({
|
|
78904
|
-
leaf:
|
|
78904
|
+
leaf: leafOf7(member.path),
|
|
78905
78905
|
path: member.path
|
|
78906
78906
|
}));
|
|
78907
78907
|
const ours = config2.members(kind, path2);
|
|
78908
78908
|
const held = new Set(ours.map((member) => member.path));
|
|
78909
78909
|
const covered = new Set(theirs.map((member) => member.path));
|
|
78910
78910
|
return [...theirs.filter((member) => offered(held.has(member.path) ? config2 : owner, member.path)).map((member) => ({
|
|
78911
|
-
leaf:
|
|
78911
|
+
leaf: leafOf7(member.path),
|
|
78912
78912
|
path: held.has(member.path) ? member.path : qualify(member.path)
|
|
78913
78913
|
})), ...ours.filter((member) => !covered.has(member.path) && offered(config2, member.path)).map((member) => ({
|
|
78914
|
-
leaf:
|
|
78914
|
+
leaf: leafOf7(member.path),
|
|
78915
78915
|
path: member.path
|
|
78916
78916
|
}))];
|
|
78917
78917
|
}
|
|
@@ -83406,6 +83406,224 @@ function instanceAt({ config: config2, spec: spec2, elementKey }) {
|
|
|
83406
83406
|
return new Instance(config2, elementKey, component.path, element2);
|
|
83407
83407
|
}
|
|
83408
83408
|
|
|
83409
|
+
// ../config/dist/framework/config-op.js
|
|
83410
|
+
function editOp(edit) {
|
|
83411
|
+
if ("op" in edit && typeof edit.op === "object" && edit.op !== null) {
|
|
83412
|
+
const { op, id } = edit;
|
|
83413
|
+
return {
|
|
83414
|
+
op,
|
|
83415
|
+
id
|
|
83416
|
+
};
|
|
83417
|
+
}
|
|
83418
|
+
return { op: edit };
|
|
83419
|
+
}
|
|
83420
|
+
function opVerb(op) {
|
|
83421
|
+
return op.field === void 0 ? op.operation : `${op.operation}/${op.field}`;
|
|
83422
|
+
}
|
|
83423
|
+
function addressOf(op) {
|
|
83424
|
+
return `${op.kind}/${opVerb(op)}`;
|
|
83425
|
+
}
|
|
83426
|
+
function inputOf(op) {
|
|
83427
|
+
const { kind: _kind, operation: _operation, field: _field, ...input2 } = op;
|
|
83428
|
+
return input2;
|
|
83429
|
+
}
|
|
83430
|
+
function opOf({ kind, verb, input: input2 = {} }) {
|
|
83431
|
+
const slash = verb.indexOf("/");
|
|
83432
|
+
if (slash === -1) return {
|
|
83433
|
+
...input2,
|
|
83434
|
+
kind,
|
|
83435
|
+
operation: verb
|
|
83436
|
+
};
|
|
83437
|
+
return {
|
|
83438
|
+
...input2,
|
|
83439
|
+
kind,
|
|
83440
|
+
operation: verb.slice(0, slash),
|
|
83441
|
+
field: verb.slice(slash + 1)
|
|
83442
|
+
};
|
|
83443
|
+
}
|
|
83444
|
+
|
|
83445
|
+
// ../config/dist/spec/rewrite-refs.js
|
|
83446
|
+
function nestedBag(value) {
|
|
83447
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
83448
|
+
}
|
|
83449
|
+
function modifierBlock(config2, key2, value, renames) {
|
|
83450
|
+
if (!key2.startsWith("_")) return void 0;
|
|
83451
|
+
const leaf = key2.slice(1);
|
|
83452
|
+
return config2.resolve("modifier", leaf) !== void 0 || renames.some((rename) => rename.kind === "modifier" && (leafOf2(rename.from) === leaf || leafOf2(rename.to) === leaf)) ? nestedBag(value) : void 0;
|
|
83453
|
+
}
|
|
83454
|
+
var leafOf2 = (path2) => path2.slice(path2.lastIndexOf("/") + 1);
|
|
83455
|
+
function layerComponent(config2, component, layer) {
|
|
83456
|
+
const element2 = Component.get(config2, component)?.layers?.[layer];
|
|
83457
|
+
return isRef2(element2) ? pathOf2(element2.__ref) : void 0;
|
|
83458
|
+
}
|
|
83459
|
+
|
|
83460
|
+
// ../config/dist/spec/prop-mapping.js
|
|
83461
|
+
var propMappingRuleSchema = external_exports.object({
|
|
83462
|
+
when: external_exports.record(external_exports.string(), external_exports.union([
|
|
83463
|
+
external_exports.string(),
|
|
83464
|
+
external_exports.number(),
|
|
83465
|
+
external_exports.boolean()
|
|
83466
|
+
])).describe('The stored values an instance must hold for the rule to apply, every one of them: { "variant": "brand-secondary" }.'),
|
|
83467
|
+
set: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe('The props to write: { "color": "brand", "prominence": "outline" }.'),
|
|
83468
|
+
unset: external_exports.array(external_exports.string()).optional().describe("The props to remove. A prop the rule matches on stays unless it is named here, so a removed prop has to be.")
|
|
83469
|
+
});
|
|
83470
|
+
var propMappingRulesSchema = external_exports.array(propMappingRuleSchema).min(1).describe("Every rule whose `when` matches an instance as stored applies to it, so separate props are mapped by separate rules, and a combination by one rule naming both.");
|
|
83471
|
+
function valueRefusal(config2, component, prop, value) {
|
|
83472
|
+
if (typeof value !== "string" || value.startsWith("[")) return void 0;
|
|
83473
|
+
if (prop.kind === "variant" || prop.kind === "slot") return prop.values && !prop.values.includes(value) ? `"${value}", which isn't one of its values (${prop.values.join(", ")})` : void 0;
|
|
83474
|
+
const declaration = resolveComponentProps(config2, component)[prop.name];
|
|
83475
|
+
const domain2 = declaration ? propValueDomain(config2, declaration) : null;
|
|
83476
|
+
return domain2 && !domain2.accepts(value) ? `"${value}", which isn't one of its values (${domain2.leaves.slice(0, 12).join(", ")}${domain2.leaves.length > 12 ? ", \u2026" : ""})` : void 0;
|
|
83477
|
+
}
|
|
83478
|
+
function propMappingErrors(config2, mapping) {
|
|
83479
|
+
if (!config2.resolve("component", mapping.component)) return [`No component "${mapping.component}"`];
|
|
83480
|
+
const errors = [];
|
|
83481
|
+
mapping.rules.forEach((rule, i) => {
|
|
83482
|
+
if (Object.keys(rule.when).length === 0) errors.push(`Rule ${i + 1} matches every instance: name what it matches in \`when\``);
|
|
83483
|
+
for (const [name, value] of Object.entries(rule.set ?? {})) {
|
|
83484
|
+
const prop = surfaceProp(config2, mapping.component, name);
|
|
83485
|
+
if (!prop) {
|
|
83486
|
+
errors.push(`Rule ${i + 1} sets "${name}", which ${mapping.component} doesn't have`);
|
|
83487
|
+
continue;
|
|
83488
|
+
}
|
|
83489
|
+
const refusal2 = valueRefusal(config2, mapping.component, prop, value);
|
|
83490
|
+
if (refusal2) errors.push(`Rule ${i + 1} sets ${name} to ${refusal2}`);
|
|
83491
|
+
}
|
|
83492
|
+
});
|
|
83493
|
+
return errors;
|
|
83494
|
+
}
|
|
83495
|
+
function mapBag(bag, rules) {
|
|
83496
|
+
const matched = rules.filter((rule) => Object.entries(rule.when).every(([name, value]) => name in bag && bag[name] === value));
|
|
83497
|
+
if (matched.length === 0) return { kind: "same" };
|
|
83498
|
+
const writes = /* @__PURE__ */ new Map();
|
|
83499
|
+
const removes = /* @__PURE__ */ new Set();
|
|
83500
|
+
const disagreed = /* @__PURE__ */ new Set();
|
|
83501
|
+
for (const rule of matched) {
|
|
83502
|
+
for (const [name, value] of Object.entries(rule.set ?? {})) {
|
|
83503
|
+
if (writes.has(name) && writes.get(name) !== value) disagreed.add(name);
|
|
83504
|
+
writes.set(name, value);
|
|
83505
|
+
}
|
|
83506
|
+
for (const name of rule.unset ?? []) removes.add(name);
|
|
83507
|
+
}
|
|
83508
|
+
if (disagreed.size > 0) return {
|
|
83509
|
+
kind: "conflict",
|
|
83510
|
+
props: [...disagreed]
|
|
83511
|
+
};
|
|
83512
|
+
const next = {};
|
|
83513
|
+
for (const [name, value] of Object.entries(bag)) if (writes.has(name)) {
|
|
83514
|
+
next[name] = writes.get(name);
|
|
83515
|
+
writes.delete(name);
|
|
83516
|
+
} else if (!removes.has(name)) next[name] = value;
|
|
83517
|
+
for (const [name, value] of writes) next[name] = value;
|
|
83518
|
+
return Object.keys(next).length === Object.keys(bag).length && Object.entries(next).every(([name, value]) => bag[name] === value) ? { kind: "same" } : {
|
|
83519
|
+
kind: "changed",
|
|
83520
|
+
bag: next
|
|
83521
|
+
};
|
|
83522
|
+
}
|
|
83523
|
+
function mapProps(walk, component, props, at) {
|
|
83524
|
+
let next;
|
|
83525
|
+
if (component === walk.mapping.component) {
|
|
83526
|
+
const outcome2 = mapBag(props, walk.mapping.rules);
|
|
83527
|
+
if (outcome2.kind === "conflict") walk.conflicts.push({
|
|
83528
|
+
element: walk.element,
|
|
83529
|
+
at,
|
|
83530
|
+
props: outcome2.props
|
|
83531
|
+
});
|
|
83532
|
+
else if (outcome2.kind === "changed") {
|
|
83533
|
+
next = outcome2.bag;
|
|
83534
|
+
walk.changed++;
|
|
83535
|
+
}
|
|
83536
|
+
}
|
|
83537
|
+
for (const [key2, value] of Object.entries(next ?? props)) {
|
|
83538
|
+
let rewritten;
|
|
83539
|
+
if (key2 === "layerProps") rewritten = component ? mapLayerProps(walk, component, value, `${at}.${key2}`) : void 0;
|
|
83540
|
+
else {
|
|
83541
|
+
const block = modifierBlock(walk.config, key2, value, []);
|
|
83542
|
+
rewritten = block ? mapProps(walk, component, block, `${at}.${key2}`) : void 0;
|
|
83543
|
+
}
|
|
83544
|
+
if (!rewritten) continue;
|
|
83545
|
+
next ??= { ...props };
|
|
83546
|
+
next[key2] = rewritten;
|
|
83547
|
+
}
|
|
83548
|
+
return next;
|
|
83549
|
+
}
|
|
83550
|
+
function mapLayerProps(walk, component, layerProps2, at) {
|
|
83551
|
+
const bags = nestedBag(layerProps2);
|
|
83552
|
+
if (!bags) return void 0;
|
|
83553
|
+
let next;
|
|
83554
|
+
for (const [layer, value] of Object.entries(bags)) {
|
|
83555
|
+
const bag = nestedBag(value);
|
|
83556
|
+
if (!bag) continue;
|
|
83557
|
+
const rewritten = mapProps(walk, layerComponent(walk.config, component, layer), bag, `${at}.${layer}`);
|
|
83558
|
+
if (!rewritten) continue;
|
|
83559
|
+
next ??= { ...bags };
|
|
83560
|
+
next[layer] = rewritten;
|
|
83561
|
+
}
|
|
83562
|
+
return next;
|
|
83563
|
+
}
|
|
83564
|
+
function componentOf(type) {
|
|
83565
|
+
if (typeof type !== "string") return void 0;
|
|
83566
|
+
if (!type.includes(":")) return pathOf2(`component:${type}`);
|
|
83567
|
+
return kindOf2(type) === "component" ? pathOf2(type) : void 0;
|
|
83568
|
+
}
|
|
83569
|
+
function applyPropMapping(config2, spec2, mapping) {
|
|
83570
|
+
let elements;
|
|
83571
|
+
let changed = 0;
|
|
83572
|
+
const conflicts = [];
|
|
83573
|
+
for (const [key2, element2] of Object.entries(spec2.elements ?? {})) {
|
|
83574
|
+
if (!element2?.props) continue;
|
|
83575
|
+
const walk = {
|
|
83576
|
+
config: config2,
|
|
83577
|
+
mapping,
|
|
83578
|
+
element: key2,
|
|
83579
|
+
conflicts,
|
|
83580
|
+
changed: 0
|
|
83581
|
+
};
|
|
83582
|
+
const props = mapProps(walk, componentOf(element2.type), element2.props, "props");
|
|
83583
|
+
if (!props) continue;
|
|
83584
|
+
elements ??= { ...spec2.elements };
|
|
83585
|
+
elements[key2] = {
|
|
83586
|
+
...element2,
|
|
83587
|
+
props
|
|
83588
|
+
};
|
|
83589
|
+
changed += walk.changed;
|
|
83590
|
+
}
|
|
83591
|
+
return elements ? {
|
|
83592
|
+
spec: {
|
|
83593
|
+
...spec2,
|
|
83594
|
+
elements
|
|
83595
|
+
},
|
|
83596
|
+
changed,
|
|
83597
|
+
conflicts
|
|
83598
|
+
} : {
|
|
83599
|
+
spec: spec2,
|
|
83600
|
+
changed: 0,
|
|
83601
|
+
conflicts
|
|
83602
|
+
};
|
|
83603
|
+
}
|
|
83604
|
+
function mapComponentProps(config2, mapping, instances) {
|
|
83605
|
+
const errors = propMappingErrors(config2, mapping);
|
|
83606
|
+
if (errors.length > 0) return {
|
|
83607
|
+
ok: false,
|
|
83608
|
+
errors
|
|
83609
|
+
};
|
|
83610
|
+
const { spec: spec2, conflicts } = applyPropMapping(config2, { elements: Object.fromEntries(instances.map((props, i) => [String(i), {
|
|
83611
|
+
type: `component:${mapping.component}`,
|
|
83612
|
+
props
|
|
83613
|
+
}])) }, mapping);
|
|
83614
|
+
return {
|
|
83615
|
+
ok: true,
|
|
83616
|
+
instances: instances.map((props, i) => {
|
|
83617
|
+
const after5 = spec2.elements?.[String(i)]?.props ?? props;
|
|
83618
|
+
return {
|
|
83619
|
+
props: after5,
|
|
83620
|
+
changed: after5 !== props,
|
|
83621
|
+
conflicts: conflicts.filter((conflict) => conflict.element === String(i)).flatMap((conflict) => conflict.props)
|
|
83622
|
+
};
|
|
83623
|
+
})
|
|
83624
|
+
};
|
|
83625
|
+
}
|
|
83626
|
+
|
|
83409
83627
|
// ../config/dist/entities/system/component-forwards.js
|
|
83410
83628
|
function siteOf({ config: config2, path: path2, layer, member }) {
|
|
83411
83629
|
const body = member ?? config2.resolve("component", path2)?.toJSON();
|
|
@@ -83533,7 +83751,7 @@ function bagKey(modifier) {
|
|
|
83533
83751
|
const name = modifier.startsWith("_") ? modifier.slice(1) : modifier;
|
|
83534
83752
|
return `_${name.slice(name.lastIndexOf("/") + 1)}`;
|
|
83535
83753
|
}
|
|
83536
|
-
function
|
|
83754
|
+
function addressOf2({ layer, modifiers, prop }) {
|
|
83537
83755
|
return [
|
|
83538
83756
|
"layers",
|
|
83539
83757
|
layer,
|
|
@@ -83628,7 +83846,7 @@ function styleSetEdits({ config: config2, path: path2, changes, isInteraction })
|
|
|
83628
83846
|
...pins,
|
|
83629
83847
|
[bagKey(change.state)]: true
|
|
83630
83848
|
};
|
|
83631
|
-
const address2 =
|
|
83849
|
+
const address2 = addressOf2({
|
|
83632
83850
|
layer,
|
|
83633
83851
|
modifiers: nested,
|
|
83634
83852
|
prop
|
|
@@ -83636,14 +83854,14 @@ function styleSetEdits({ config: config2, path: path2, changes, isInteraction })
|
|
|
83636
83854
|
ruleAt(condition).delta[address2] = change.value;
|
|
83637
83855
|
if (clear && !change.ownRuleOnly) reaching.add(`${canonicalCondition(condition)}
|
|
83638
83856
|
${address2}`);
|
|
83639
|
-
if (clear) ruleAt(pins).delta[
|
|
83857
|
+
if (clear) ruleAt(pins).delta[addressOf2({
|
|
83640
83858
|
layer,
|
|
83641
83859
|
modifiers: [change.state, ...nested],
|
|
83642
83860
|
prop
|
|
83643
83861
|
})] = null;
|
|
83644
83862
|
continue;
|
|
83645
83863
|
}
|
|
83646
|
-
const address =
|
|
83864
|
+
const address = addressOf2({
|
|
83647
83865
|
layer,
|
|
83648
83866
|
modifiers: change.state ? [change.state, ...nested] : nested,
|
|
83649
83867
|
prop
|
|
@@ -84261,9 +84479,9 @@ function overrideModifiers(on) {
|
|
|
84261
84479
|
return (Array.isArray(on) ? on : [on]).filter(isRef2).map(pathOf2);
|
|
84262
84480
|
}
|
|
84263
84481
|
function overrideKey(on) {
|
|
84264
|
-
return overrideModifiers(on).map(
|
|
84482
|
+
return overrideModifiers(on).map(leafOf3).sort((a, b) => a.localeCompare(b)).join("&");
|
|
84265
84483
|
}
|
|
84266
|
-
var
|
|
84484
|
+
var leafOf3 = (path2) => path2.slice(path2.lastIndexOf("/") + 1);
|
|
84267
84485
|
function declaredCondition(config2) {
|
|
84268
84486
|
const canonical = (ref2) => {
|
|
84269
84487
|
if (sourceOf2(ref2) !== void 0) return ref2;
|
|
@@ -86817,6 +87035,55 @@ var ComponentEntity = defineEntity({
|
|
|
86817
87035
|
data: { props: exampleProps(config2, path2) }
|
|
86818
87036
|
}),
|
|
86819
87037
|
handler: (input2, config2) => validateComponentProps(config2, String(input2.path), input2.data.props ?? {})
|
|
87038
|
+
},
|
|
87039
|
+
"map-props": {
|
|
87040
|
+
input: external_exports.object({
|
|
87041
|
+
path: pathInput("component"),
|
|
87042
|
+
data: external_exports.object({ rules: propMappingRulesSchema })
|
|
87043
|
+
}),
|
|
87044
|
+
readOnly: false,
|
|
87045
|
+
approval: "reference-change",
|
|
87046
|
+
label: "Map props",
|
|
87047
|
+
description: "Move a component's instances onto its props as they are now, after its API changed: `variant: 'primary'` becomes `color: 'brand', prominence: 'solid'`. It changes nothing in the config. Where it runs decides what it moves: in Create, the instances in the branch's design files; in a checkout (`uds config edit`, the local UDS MCP), the call sites in the project's source. Refuses a rule that writes a prop or value the component doesn't take. Run it with `plan: true` first: the plan says what it would move, and writes nothing.",
|
|
87048
|
+
scope: "item",
|
|
87049
|
+
title: (entity) => `Map ${entity} props`,
|
|
87050
|
+
example: ({ config: config2, path: path2 }) => {
|
|
87051
|
+
const { data, ...rest } = exampleMapping(config2, path2);
|
|
87052
|
+
return {
|
|
87053
|
+
...rest,
|
|
87054
|
+
data: { rules: data.rules }
|
|
87055
|
+
};
|
|
87056
|
+
},
|
|
87057
|
+
handler: (input2, config2) => {
|
|
87058
|
+
const errors = propMappingErrors(config2, {
|
|
87059
|
+
component: String(input2.path),
|
|
87060
|
+
rules: input2.data.rules
|
|
87061
|
+
});
|
|
87062
|
+
if (errors.length > 0) rejectData(errors.join(" "));
|
|
87063
|
+
return config2;
|
|
87064
|
+
}
|
|
87065
|
+
},
|
|
87066
|
+
"map-props-plan": {
|
|
87067
|
+
input: external_exports.object({
|
|
87068
|
+
path: pathInput("component"),
|
|
87069
|
+
data: external_exports.object({
|
|
87070
|
+
rules: propMappingRulesSchema,
|
|
87071
|
+
instances: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())).default([]).describe("Instances' props as they are stored or written: each comes back with the rules applied.")
|
|
87072
|
+
})
|
|
87073
|
+
}),
|
|
87074
|
+
readOnly: true,
|
|
87075
|
+
label: "Plan a props mapping",
|
|
87076
|
+
description: "Try a mapping on some instances' props before `map-props` applies it: refuses a rule that writes a prop or value the component doesn't take, and returns each given instance's props with the rules applied. Writes nothing.",
|
|
87077
|
+
scope: "item",
|
|
87078
|
+
title: (entity) => `Plan mapping ${entity} props`,
|
|
87079
|
+
example: ({ config: config2, path: path2 }) => exampleMapping(config2, path2),
|
|
87080
|
+
handler: (input2, config2) => {
|
|
87081
|
+
const data = input2.data;
|
|
87082
|
+
return mapComponentProps(config2, {
|
|
87083
|
+
component: String(input2.path),
|
|
87084
|
+
rules: data.rules
|
|
87085
|
+
}, data.instances ?? []);
|
|
87086
|
+
}
|
|
86820
87087
|
}
|
|
86821
87088
|
},
|
|
86822
87089
|
invariants: (config2) => [
|
|
@@ -86930,6 +87197,32 @@ function exampleProps(config2, componentPath) {
|
|
|
86930
87197
|
}
|
|
86931
87198
|
return {};
|
|
86932
87199
|
}
|
|
87200
|
+
function exampleMapping(config2, componentPath) {
|
|
87201
|
+
const instance = exampleProps(config2, componentPath);
|
|
87202
|
+
const [name, value] = Object.entries(instance)[0] ?? [];
|
|
87203
|
+
if (name === void 0 || value === void 0) return {
|
|
87204
|
+
path: componentPath,
|
|
87205
|
+
data: {
|
|
87206
|
+
rules: [{
|
|
87207
|
+
when: { variant: "primary" },
|
|
87208
|
+
unset: ["variant"]
|
|
87209
|
+
}],
|
|
87210
|
+
instances: [{ variant: "primary" }]
|
|
87211
|
+
}
|
|
87212
|
+
};
|
|
87213
|
+
const decl = config2.resolve("component", componentPath)?.toJSON()?.props?.[name];
|
|
87214
|
+
const next = (decl ? propValueDomain(config2, decl)?.leaves ?? [] : []).find((leaf) => leaf !== value) ?? value;
|
|
87215
|
+
return {
|
|
87216
|
+
path: componentPath,
|
|
87217
|
+
data: {
|
|
87218
|
+
rules: [{
|
|
87219
|
+
when: { [name]: value },
|
|
87220
|
+
set: { [name]: next }
|
|
87221
|
+
}],
|
|
87222
|
+
instances: [instance]
|
|
87223
|
+
}
|
|
87224
|
+
};
|
|
87225
|
+
}
|
|
86933
87226
|
|
|
86934
87227
|
// ../config/dist/framework/prop-surface.js
|
|
86935
87228
|
function isValueSlot(decl) {
|
|
@@ -87158,6 +87451,9 @@ function boundProp(config2, layers, decl, seen) {
|
|
|
87158
87451
|
if (!farBody) return void 0;
|
|
87159
87452
|
return propName in resolveComponentProps(config2, target2) || propName in (farBody.props ?? {}) ? void 0 : undeclared;
|
|
87160
87453
|
}
|
|
87454
|
+
function surfaceProp(config2, componentPath, name) {
|
|
87455
|
+
return surfaceProps(config2, componentPath).find((prop) => prop.name === name);
|
|
87456
|
+
}
|
|
87161
87457
|
function computeForwardClaims(config2, componentPath) {
|
|
87162
87458
|
const body = Component.get(config2, componentPath)?.toJSON();
|
|
87163
87459
|
const own2 = /* @__PURE__ */ new Set();
|
|
@@ -88746,42 +89042,6 @@ var Device = defineEntity({
|
|
|
88746
89042
|
})
|
|
88747
89043
|
});
|
|
88748
89044
|
|
|
88749
|
-
// ../config/dist/framework/config-op.js
|
|
88750
|
-
function editOp(edit) {
|
|
88751
|
-
if ("op" in edit && typeof edit.op === "object" && edit.op !== null) {
|
|
88752
|
-
const { op, id } = edit;
|
|
88753
|
-
return {
|
|
88754
|
-
op,
|
|
88755
|
-
id
|
|
88756
|
-
};
|
|
88757
|
-
}
|
|
88758
|
-
return { op: edit };
|
|
88759
|
-
}
|
|
88760
|
-
function opVerb(op) {
|
|
88761
|
-
return op.field === void 0 ? op.operation : `${op.operation}/${op.field}`;
|
|
88762
|
-
}
|
|
88763
|
-
function addressOf2(op) {
|
|
88764
|
-
return `${op.kind}/${opVerb(op)}`;
|
|
88765
|
-
}
|
|
88766
|
-
function inputOf(op) {
|
|
88767
|
-
const { kind: _kind, operation: _operation, field: _field, ...input2 } = op;
|
|
88768
|
-
return input2;
|
|
88769
|
-
}
|
|
88770
|
-
function opOf({ kind, verb, input: input2 = {} }) {
|
|
88771
|
-
const slash = verb.indexOf("/");
|
|
88772
|
-
if (slash === -1) return {
|
|
88773
|
-
...input2,
|
|
88774
|
-
kind,
|
|
88775
|
-
operation: verb
|
|
88776
|
-
};
|
|
88777
|
-
return {
|
|
88778
|
-
...input2,
|
|
88779
|
-
kind,
|
|
88780
|
-
operation: verb.slice(0, slash),
|
|
88781
|
-
field: verb.slice(slash + 1)
|
|
88782
|
-
};
|
|
88783
|
-
}
|
|
88784
|
-
|
|
88785
89045
|
// ../config/dist/framework/signature.js
|
|
88786
89046
|
function isNever(node2) {
|
|
88787
89047
|
return node2.not !== void 0 && typeof node2.not === "object" && Object.keys(node2.not).length === 0 && Object.keys(node2).length === 1;
|
|
@@ -89446,7 +89706,7 @@ var Entity = class {
|
|
|
89446
89706
|
};
|
|
89447
89707
|
|
|
89448
89708
|
// ../config/dist/framework/schema-version.js
|
|
89449
|
-
var CURRENT_SCHEMA_VERSION =
|
|
89709
|
+
var CURRENT_SCHEMA_VERSION = 20261030134149;
|
|
89450
89710
|
var SETTINGS_AS_KIND_VERSION = 20260908171448;
|
|
89451
89711
|
var SchemaVersionTooNew = class extends ConfigFormatError {
|
|
89452
89712
|
found;
|
|
@@ -89466,7 +89726,7 @@ function registerSchemaMigrations(...migrations) {
|
|
|
89466
89726
|
for (const migration of migrations) {
|
|
89467
89727
|
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.`);
|
|
89468
89728
|
if (REGISTERED.has(migration.version)) throw new Error(`A schema migration at version ${migration.version} is already registered.`);
|
|
89469
|
-
if (migration.version >
|
|
89729
|
+
if (migration.version > 20261030134149) 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.`);
|
|
89470
89730
|
REGISTERED.set(migration.version, migration);
|
|
89471
89731
|
}
|
|
89472
89732
|
}
|
|
@@ -89497,7 +89757,7 @@ function pendingFor(version2, target2, options) {
|
|
|
89497
89757
|
return [...(options?.migrations ?? REGISTERED).values()].filter((m) => m.version > version2 && m.version <= target2).sort((a, b) => a.version - b.version);
|
|
89498
89758
|
}
|
|
89499
89759
|
function upgradeSerializedConfig(json2, options) {
|
|
89500
|
-
const target2 = options?.target ??
|
|
89760
|
+
const target2 = options?.target ?? 20261030134149;
|
|
89501
89761
|
const version2 = detectedWireVersion(json2);
|
|
89502
89762
|
if (version2 > target2) throw new SchemaVersionTooNew(version2, target2);
|
|
89503
89763
|
const raw = json2;
|
|
@@ -90469,7 +90729,7 @@ function groupsAbove(source, items) {
|
|
|
90469
90729
|
return groups;
|
|
90470
90730
|
}
|
|
90471
90731
|
var recordedSourceCache = /* @__PURE__ */ new WeakMap();
|
|
90472
|
-
function
|
|
90732
|
+
function leafOf4(field) {
|
|
90473
90733
|
const slash = field.lastIndexOf("/");
|
|
90474
90734
|
return slash === -1 ? field : field.slice(slash + 1);
|
|
90475
90735
|
}
|
|
@@ -90520,7 +90780,7 @@ function collectionIn(def, patch) {
|
|
|
90520
90780
|
const outer = def[outerField];
|
|
90521
90781
|
const holder = isPlainObject(outer) ? outer[String(patch.owner)] : void 0;
|
|
90522
90782
|
if (!isPlainObject(holder)) reject("NOT_FOUND", `No ${outerField}/${patch.owner} on ${patch.kind} "${patch.path}"`);
|
|
90523
|
-
const field =
|
|
90783
|
+
const field = leafOf4(patch.field);
|
|
90524
90784
|
const collection = holder[field];
|
|
90525
90785
|
if (collection === void 0) return {};
|
|
90526
90786
|
if (!isPlainObject(collection) || isRef2(collection)) reject("UNSUPPORTED", `"${patch.owner}" on ${patch.kind} "${patch.path}" does not enumerate its own ${field}`);
|
|
@@ -90537,7 +90797,7 @@ function storeCollection(def, patch, next) {
|
|
|
90537
90797
|
const outer = { ...def[outerField] };
|
|
90538
90798
|
outer[owner] = {
|
|
90539
90799
|
...outer[owner],
|
|
90540
|
-
[
|
|
90800
|
+
[leafOf4(patch.field)]: next
|
|
90541
90801
|
};
|
|
90542
90802
|
return {
|
|
90543
90803
|
...def,
|
|
@@ -91080,7 +91340,7 @@ var Config = class Config2 {
|
|
|
91080
91340
|
try {
|
|
91081
91341
|
const start = next.state.pending.length;
|
|
91082
91342
|
const produced = next.dispatch(op, id);
|
|
91083
|
-
if (!(produced instanceof Config2)) reject("UNSUPPORTED", `${
|
|
91343
|
+
if (!(produced instanceof Config2)) reject("UNSUPPORTED", `${addressOf(op)} is a read, not an edit.`);
|
|
91084
91344
|
next = produced;
|
|
91085
91345
|
ranges.push({
|
|
91086
91346
|
opIndex,
|
|
@@ -91136,7 +91396,7 @@ var Config = class Config2 {
|
|
|
91136
91396
|
const account = `${opVerb(op)}-plan`;
|
|
91137
91397
|
const declared2 = next.entityOf(op.kind)?.schemas[account];
|
|
91138
91398
|
if (declared2?.readOnly && declared2.handler) impact.push({
|
|
91139
|
-
op:
|
|
91399
|
+
op: addressOf(op),
|
|
91140
91400
|
answer: next.dispatch({
|
|
91141
91401
|
...op,
|
|
91142
91402
|
operation: account,
|
|
@@ -91144,7 +91404,7 @@ var Config = class Config2 {
|
|
|
91144
91404
|
})
|
|
91145
91405
|
});
|
|
91146
91406
|
const produced = next.dispatch(op);
|
|
91147
|
-
if (!(produced instanceof Config2)) reject("UNSUPPORTED", `${
|
|
91407
|
+
if (!(produced instanceof Config2)) reject("UNSUPPORTED", `${addressOf(op)} is a read, not an edit.`);
|
|
91148
91408
|
next = produced;
|
|
91149
91409
|
}
|
|
91150
91410
|
const patches = next.state.pending.slice(this.state.pending.length);
|
|
@@ -92429,7 +92689,7 @@ var Config = class Config2 {
|
|
|
92429
92689
|
const renamed = {};
|
|
92430
92690
|
for (const key2 of Object.keys(collection)) renamed[key2 === patch.key ? patch.to : key2] = collection[key2];
|
|
92431
92691
|
def = store(def, renamed);
|
|
92432
|
-
const refKind =
|
|
92692
|
+
const refKind = leafOf4(patch.field).replace(/s$/, "");
|
|
92433
92693
|
def = rewriteRefs(def, `${refKind}:${refPathOf(patch, patch.key)}`, `${refKind}:${refPathOf(patch, patch.to)}`);
|
|
92434
92694
|
def = renameNamedValues(sub, def, patch.owner, patch.key, patch.to);
|
|
92435
92695
|
def = renameKeyedByName(sub, def, patch.key, patch.to);
|
|
@@ -92452,7 +92712,7 @@ var Config = class Config2 {
|
|
|
92452
92712
|
def = renameKeyedByName(sub, def, patch.key, void 0);
|
|
92453
92713
|
def = renameListedNames(sub, def, patch.key, void 0);
|
|
92454
92714
|
def = dropVacated(entry, sub, def);
|
|
92455
|
-
def = dropOrphans(sub, def, `${
|
|
92715
|
+
def = dropOrphans(sub, def, `${leafOf4(patch.field).replace(/s$/, "")}:${refPathOf(patch, patch.key)}`, sub?.namespaces ? {
|
|
92456
92716
|
kind: sub.namespaces,
|
|
92457
92717
|
path: patch.key
|
|
92458
92718
|
} : void 0, patch.owner === void 0 ? {
|
|
@@ -94306,9 +94566,9 @@ var Config = class Config2 {
|
|
|
94306
94566
|
*/
|
|
94307
94567
|
displayLabelOf(target2) {
|
|
94308
94568
|
const { path: path2, member, marked } = splitRef2(target2);
|
|
94309
|
-
if (member) return
|
|
94310
|
-
if (!marked) return
|
|
94311
|
-
return this.resolveRef(target2)?.displayLabel ??
|
|
94569
|
+
if (member) return leafOf4(member);
|
|
94570
|
+
if (!marked) return leafOf4(path2);
|
|
94571
|
+
return this.resolveRef(target2)?.displayLabel ?? leafOf4(path2);
|
|
94312
94572
|
}
|
|
94313
94573
|
/**
|
|
94314
94574
|
* The `data` schema for a mutation `verb`, narrowed to one target entity — the same per-owner
|
|
@@ -96354,7 +96614,7 @@ var Config = class Config2 {
|
|
|
96354
96614
|
* links from the provided sources. A declared `linkedKind` with no provided source throws. */
|
|
96355
96615
|
hydrateFrom(stored, options) {
|
|
96356
96616
|
const claimed = schemaVersionOf(stored);
|
|
96357
|
-
if (claimed >
|
|
96617
|
+
if (claimed > 20261030134149) throw new SchemaVersionTooNew(claimed);
|
|
96358
96618
|
const wire = upgradeSerializedConfig(stored);
|
|
96359
96619
|
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.`);
|
|
96360
96620
|
const leftover = wire.options;
|
|
@@ -99740,6 +100000,13 @@ var lintIgnoreMigration = {
|
|
|
99740
100000
|
up: (json2) => json2
|
|
99741
100001
|
};
|
|
99742
100002
|
|
|
100003
|
+
// ../config/dist/migrations/20261030134149_component_map_props.js
|
|
100004
|
+
var COMPONENT_MAP_PROPS_VERSION = 20261030134149;
|
|
100005
|
+
var componentMapPropsMigration = {
|
|
100006
|
+
version: COMPONENT_MAP_PROPS_VERSION,
|
|
100007
|
+
up: (json2) => json2
|
|
100008
|
+
};
|
|
100009
|
+
|
|
99743
100010
|
// ../../node_modules/css-tree/lib/generator/sourceMap.js
|
|
99744
100011
|
var import_source_map_generator = __toESM(require_source_map_generator(), 1);
|
|
99745
100012
|
var trackNodes = /* @__PURE__ */ new Set(["Atrule", "Selector", "Declaration"]);
|
|
@@ -101492,7 +101759,7 @@ var before3 = external_exports.looseObject({ items: external_exports.looseObject
|
|
|
101492
101759
|
previewWhen: external_exports.array(external_exports.unknown()).optional()
|
|
101493
101760
|
})).optional() }).optional() });
|
|
101494
101761
|
var after3 = external_exports.looseObject({ items: external_exports.looseObject({ component: external_exports.record(external_exports.string(), external_exports.looseObject({ preview: external_exports.record(external_exports.string(), external_exports.unknown()).optional() })).optional() }).optional() });
|
|
101495
|
-
function
|
|
101762
|
+
function leafOf5(value) {
|
|
101496
101763
|
if (isPlainObject(value) && typeof value.__ref === "string") {
|
|
101497
101764
|
const path2 = /^[^:]*:(.*)$/.exec(value.__ref)?.[1] ?? value.__ref;
|
|
101498
101765
|
return /([^/]*)$/.exec(path2)?.[1] ?? path2;
|
|
@@ -101501,7 +101768,7 @@ function leafOf4(value) {
|
|
|
101501
101768
|
}
|
|
101502
101769
|
function keyOf(when) {
|
|
101503
101770
|
const entries = Object.entries(isPlainObject(when) ? when : {}).filter(([, value]) => value !== void 0 && value !== null).sort(([a], [b]) => a.localeCompare(b));
|
|
101504
|
-
return entries.length === 0 ? UNCONDITIONAL : entries.map(([prop, value]) => `${prop}=${
|
|
101771
|
+
return entries.length === 0 ? UNCONDITIONAL : entries.map(([prop, value]) => `${prop}=${leafOf5(value)}`).join("&");
|
|
101505
101772
|
}
|
|
101506
101773
|
function foldedPreview({ preview, previewProps, previewWhen }) {
|
|
101507
101774
|
const keyed = isPlainObject(preview) ? { ...preview } : {};
|
|
@@ -102232,7 +102499,7 @@ var linkedComponentModulesMigration = {
|
|
|
102232
102499
|
|
|
102233
102500
|
// ../config/dist/migrations/20261013154037_component_states.js
|
|
102234
102501
|
var COMPONENT_STATES_VERSION = 20261013154037;
|
|
102235
|
-
function
|
|
102502
|
+
function leafOf6(value) {
|
|
102236
102503
|
if (isPlainObject(value) && typeof value.__ref === "string") return /([^/]*)$/.exec(value.__ref)?.[1] ?? value.__ref;
|
|
102237
102504
|
return value;
|
|
102238
102505
|
}
|
|
@@ -102251,8 +102518,8 @@ function foldedStates(body) {
|
|
|
102251
102518
|
const fallback = defaults?.[name];
|
|
102252
102519
|
states[name] = {
|
|
102253
102520
|
type: "variant",
|
|
102254
|
-
value: value.map((member) => String(
|
|
102255
|
-
...typeof
|
|
102521
|
+
value: value.map((member) => String(leafOf6(member))),
|
|
102522
|
+
...typeof leafOf6(fallback) === "string" ? { default: leafOf6(fallback) } : {}
|
|
102256
102523
|
};
|
|
102257
102524
|
} else states[name] = { type: "boolean" };
|
|
102258
102525
|
if (defaults) delete defaults[name];
|
|
@@ -102261,7 +102528,7 @@ function foldedStates(body) {
|
|
|
102261
102528
|
const plainWhen = (entry) => {
|
|
102262
102529
|
if (!isPlainObject(entry) || !isPlainObject(entry.when)) return entry;
|
|
102263
102530
|
const when = { ...entry.when };
|
|
102264
|
-
for (const name of movedVariants) if (name in when) when[name] =
|
|
102531
|
+
for (const name of movedVariants) if (name in when) when[name] = leafOf6(when[name]);
|
|
102265
102532
|
return {
|
|
102266
102533
|
...entry,
|
|
102267
102534
|
when
|
|
@@ -102474,6 +102741,7 @@ if (!registeredSchemaMigrations().has(20261023152030)) registerSchemaMigrations(
|
|
|
102474
102741
|
if (!registeredSchemaMigrations().has(20261026125912)) registerSchemaMigrations(timingValueMigration);
|
|
102475
102742
|
if (!registeredSchemaMigrations().has(20261027184442)) registerSchemaMigrations(variantValuesListWithBodiesMigration);
|
|
102476
102743
|
if (!registeredSchemaMigrations().has(20261027205147)) registerSchemaMigrations(lintIgnoreMigration);
|
|
102744
|
+
if (!registeredSchemaMigrations().has(20261030134149)) registerSchemaMigrations(componentMapPropsMigration);
|
|
102477
102745
|
|
|
102478
102746
|
// ../config/dist/capture/node-ops.js
|
|
102479
102747
|
var DEFAULT_WIDTH = 1600;
|
|
@@ -102737,7 +103005,7 @@ function insert(config2, input2) {
|
|
|
102737
103005
|
}
|
|
102738
103006
|
const slot = input2.data.slotProp;
|
|
102739
103007
|
if (slot !== void 0) {
|
|
102740
|
-
const component =
|
|
103008
|
+
const component = componentOf2({
|
|
102741
103009
|
config: config2,
|
|
102742
103010
|
body: parent
|
|
102743
103011
|
});
|
|
@@ -102764,7 +103032,7 @@ function insert(config2, input2) {
|
|
|
102764
103032
|
});
|
|
102765
103033
|
return patches;
|
|
102766
103034
|
}
|
|
102767
|
-
function
|
|
103035
|
+
function componentOf2({ config: config2, body }) {
|
|
102768
103036
|
if (!body.type) return void 0;
|
|
102769
103037
|
const { system } = attachedSystem(config2);
|
|
102770
103038
|
const entity = system.resolve("component", pathOf2(body.type));
|
|
@@ -102980,7 +103248,7 @@ function reparent({ config: config2, path: path2, parent, slotProp: slot, index
|
|
|
102980
103248
|
if (subtreeOf(config2, path2).includes(to)) return rejectData(`"${to}" is inside "${path2}".`, ["data", "parent"]);
|
|
102981
103249
|
const target2 = bodyOf2(config2, to, ["data", "parent"]);
|
|
102982
103250
|
const moving = config2.resolve("node", path2)?.body?.type;
|
|
102983
|
-
const component =
|
|
103251
|
+
const component = componentOf2({
|
|
102984
103252
|
config: config2,
|
|
102985
103253
|
body: target2
|
|
102986
103254
|
});
|
|
@@ -103020,7 +103288,7 @@ function wrap(config2, input2) {
|
|
|
103020
103288
|
slug: slug2
|
|
103021
103289
|
});
|
|
103022
103290
|
const slotName = input2.data.container.slotProp ?? "children";
|
|
103023
|
-
const component =
|
|
103291
|
+
const component = componentOf2({
|
|
103024
103292
|
config: config2,
|
|
103025
103293
|
body: { type }
|
|
103026
103294
|
});
|