@yahoo/uds-create-cli 5.68.5 → 5.70.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 +280 -34
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yahoo/uds-create-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.70.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.70.0",
|
|
36
|
+
"@yahoo/uds-create-loader": "5.70.0",
|
|
37
|
+
"@yahoo/uds-create-types": "5.70.0",
|
|
38
|
+
"@yahoo/uds-create-utils": "5.70.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": 20261102185610,
|
|
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.70.0",
|
|
58
|
+
"@yahoo/uds-create-cli-darwin-x64": "5.70.0",
|
|
59
|
+
"@yahoo/uds-create-cli-linux-arm64": "5.70.0",
|
|
60
|
+
"@yahoo/uds-create-cli-linux-x64": "5.70.0",
|
|
61
|
+
"@yahoo/uds-create-cli-linux-arm64-musl": "5.70.0",
|
|
62
|
+
"@yahoo/uds-create-cli-linux-x64-musl": "5.70.0"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -31026,11 +31026,11 @@ var require_scope = __commonJS({
|
|
|
31026
31026
|
}
|
|
31027
31027
|
const {
|
|
31028
31028
|
init,
|
|
31029
|
-
unique:
|
|
31029
|
+
unique: unique3,
|
|
31030
31030
|
kind = "var",
|
|
31031
31031
|
id
|
|
31032
31032
|
} = opts;
|
|
31033
|
-
if (!init && !
|
|
31033
|
+
if (!init && !unique3 && (kind === "var" || kind === "let") && isAnonymousFunctionExpression(path2) && isCallExpression2(path2.parent, {
|
|
31034
31034
|
callee: path2.node
|
|
31035
31035
|
}) && path2.parent.arguments.length <= path2.node.params.length && isIdentifier4(id)) {
|
|
31036
31036
|
path2.pushContainer("params", id);
|
|
@@ -31043,12 +31043,12 @@ var require_scope = __commonJS({
|
|
|
31043
31043
|
}
|
|
31044
31044
|
const blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;
|
|
31045
31045
|
const dataKey = `declaration:${kind}:${blockHoist}`;
|
|
31046
|
-
let declarPath = !
|
|
31046
|
+
let declarPath = !unique3 && path2.getData(dataKey);
|
|
31047
31047
|
if (!declarPath) {
|
|
31048
31048
|
const declar = variableDeclaration(kind, []);
|
|
31049
31049
|
declar._blockHoist = blockHoist;
|
|
31050
31050
|
[declarPath] = path2.unshiftContainer("body", [declar]);
|
|
31051
|
-
if (!
|
|
31051
|
+
if (!unique3) path2.setData(dataKey, declarPath);
|
|
31052
31052
|
}
|
|
31053
31053
|
const declarator = variableDeclarator(id, init);
|
|
31054
31054
|
const len = declarPath.node.declarations.push(declarator);
|
|
@@ -63636,6 +63636,9 @@ function blockedBy(attempt) {
|
|
|
63636
63636
|
throw error61;
|
|
63637
63637
|
}
|
|
63638
63638
|
}
|
|
63639
|
+
function unique(refs) {
|
|
63640
|
+
return [...new Set(refs)];
|
|
63641
|
+
}
|
|
63639
63642
|
function addresses(targets) {
|
|
63640
63643
|
return targets.map((target2) => {
|
|
63641
63644
|
const { kind, qualifiedPath } = splitRef2(target2);
|
|
@@ -63652,13 +63655,17 @@ function planRename({ config: config2, kind, path: path2, to }) {
|
|
|
63652
63655
|
path: path2,
|
|
63653
63656
|
to
|
|
63654
63657
|
}]));
|
|
63655
|
-
const
|
|
63658
|
+
const moves = config2.renamedParts(kind, path2, to);
|
|
63659
|
+
const moving = [path2, ...moves.map((move2) => move2.from)];
|
|
63660
|
+
const throughSource = unique(moving.flatMap((from) => config2.sourceDependentsOf(kind, from)));
|
|
63656
63661
|
const drawn = new Set(throughSource);
|
|
63662
|
+
const moved = new Set(moving.map((from) => `${kind}:${from}`));
|
|
63657
63663
|
return {
|
|
63658
63664
|
from: path2,
|
|
63659
63665
|
to,
|
|
63660
|
-
rewrites: addresses(config2.dependentsOf(kind,
|
|
63666
|
+
rewrites: addresses(unique(moving.flatMap((from) => config2.dependentsOf(kind, from))).filter((ref2) => !drawn.has(ref2) && !moved.has(ref2))),
|
|
63661
63667
|
throughSource: addresses(throughSource),
|
|
63668
|
+
...moves.length > 0 ? { moves } : {},
|
|
63662
63669
|
...blocked === void 0 ? {} : { blocked }
|
|
63663
63670
|
};
|
|
63664
63671
|
}
|
|
@@ -65153,7 +65160,7 @@ function titleCase(kind) {
|
|
|
65153
65160
|
return kind.split(/[-_]/).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
65154
65161
|
}
|
|
65155
65162
|
function buildKind(spec2) {
|
|
65156
|
-
const { name, prepareLinkedBody, rebaseLinkedBody, layerKeys, fields, groupFields, subEntities = {}, computed, label, labelPlural, schemas: userSchemas, derived, sourceIdentity, sourceOrigin, authoredRefs, linkable, localGroupFields, emergentGroups, singleton = false, bareMember, sourceResolution, bulkAdopts, bulkExcludes, bulkOverlay, bulkDirectives, bulkOverlayWrite, nameEdges, rewriteName, styleBags, uniqueLeaves, authoredValue: authoredValue2, mentionFields, invariants, structuralBody, authoredBody, sourceType, answeredHere } = spec2;
|
|
65163
|
+
const { name, prepareLinkedBody, rebaseLinkedBody, layerKeys, fields, groupFields, subEntities = {}, computed, label, labelPlural, schemas: userSchemas, derived, sourceIdentity, sourceOrigin, authoredRefs, linkable, localGroupFields, emergentGroups, singleton = false, bareMember, sourceResolution, bulkAdopts, bulkExcludes, bulkOverlay, bulkDirectives, bulkOverlayWrite, nameEdges, rewriteName, styleBags, uniqueLeaves, parts, authoredValue: authoredValue2, mentionFields, invariants, structuralBody, authoredBody, sourceType, answeredHere } = spec2;
|
|
65157
65164
|
const allComputed = {
|
|
65158
65165
|
sources: ({ member, config: config2 }) => sourceSlugs(member, config2),
|
|
65159
65166
|
borrowedFrom: ({ config: config2, path: path2 }) => config2.borrowedFrom(name, path2),
|
|
@@ -65202,6 +65209,7 @@ function buildKind(spec2) {
|
|
|
65202
65209
|
rewriteName,
|
|
65203
65210
|
styleBags,
|
|
65204
65211
|
...uniqueLeaves ? { uniqueLeaves } : {},
|
|
65212
|
+
...parts ? { parts } : {},
|
|
65205
65213
|
...authoredValue2 ? { authoredValue: authoredValue2 } : {},
|
|
65206
65214
|
...mentionFields?.length ? { mentionFields } : {},
|
|
65207
65215
|
...invariants ? { invariants } : {},
|
|
@@ -65340,6 +65348,7 @@ function defineEntity(spec2) {
|
|
|
65340
65348
|
styleBags: spec2.styleBags,
|
|
65341
65349
|
rewriteName: spec2.rewriteName,
|
|
65342
65350
|
uniqueLeaves: spec2.uniqueLeaves,
|
|
65351
|
+
parts: spec2.parts,
|
|
65343
65352
|
authoredValue: spec2.authoredValue,
|
|
65344
65353
|
mentionFields: spec2.mentionFields,
|
|
65345
65354
|
invariants: spec2.invariants,
|
|
@@ -70853,6 +70862,29 @@ var LintSection = defineSubEntity({
|
|
|
70853
70862
|
singleton: true,
|
|
70854
70863
|
fields: lintFields
|
|
70855
70864
|
});
|
|
70865
|
+
var defaultColorValue = external_exports.union([external_exports.string().min(1), refTo("token")]);
|
|
70866
|
+
var defaultColor = external_exports.union([defaultColorValue, external_exports.strictObject({
|
|
70867
|
+
value: defaultColorValue,
|
|
70868
|
+
output: external_exports.boolean().optional()
|
|
70869
|
+
})]);
|
|
70870
|
+
var defaultsFields = external_exports.strictObject({
|
|
70871
|
+
background: defaultColor.meta({
|
|
70872
|
+
title: "Background",
|
|
70873
|
+
valueType: "color",
|
|
70874
|
+
description: "The background this system's components sit on: a CSS colour (`#ffffff`) or a token (`Token.ref('color/surface')`). The stylesheet sets it on `body`, and Create paints it behind a component's matrix cells, under the modes picked there. `{ value, output: false }` keeps it out of the stylesheet. Unset, neither paints one."
|
|
70875
|
+
}).optional(),
|
|
70876
|
+
color: defaultColor.meta({
|
|
70877
|
+
title: "Text color",
|
|
70878
|
+
valueType: "color",
|
|
70879
|
+
description: "The text colour this system's components inherit: a CSS colour or a token. The stylesheet sets it on `body`, and Create applies it to a component's matrix cells, under the modes picked there. `{ value, output: false }` keeps it out of the stylesheet. Unset, neither sets one."
|
|
70880
|
+
}).optional()
|
|
70881
|
+
});
|
|
70882
|
+
var DefaultsSection = defineSubEntity({
|
|
70883
|
+
name: "defaults",
|
|
70884
|
+
label: "Defaults",
|
|
70885
|
+
singleton: true,
|
|
70886
|
+
fields: defaultsFields
|
|
70887
|
+
});
|
|
70856
70888
|
var foldersOf = (file2) => file2.split("/").slice(0, -1);
|
|
70857
70889
|
function sharedFolders(lists) {
|
|
70858
70890
|
return lists.reduce((shared, folders) => {
|
|
@@ -70927,14 +70959,16 @@ var Settings = defineEntity({
|
|
|
70927
70959
|
build: buildFields.meta({ title: "Build" }).optional(),
|
|
70928
70960
|
css: cssFields.meta({ title: "CSS" }).optional(),
|
|
70929
70961
|
playground: playgroundFields.meta({ title: "Playground" }).optional(),
|
|
70930
|
-
lint: lintFields.meta({ title: "Lint" }).optional()
|
|
70962
|
+
lint: lintFields.meta({ title: "Lint" }).optional(),
|
|
70963
|
+
defaults: defaultsFields.meta({ title: "Defaults" }).optional()
|
|
70931
70964
|
}),
|
|
70932
70965
|
subEntities: {
|
|
70933
70966
|
system: SystemSection,
|
|
70934
70967
|
build: BuildSection,
|
|
70935
70968
|
css: CssSection,
|
|
70936
70969
|
playground: PlaygroundSection,
|
|
70937
|
-
lint: LintSection
|
|
70970
|
+
lint: LintSection,
|
|
70971
|
+
defaults: DefaultsSection
|
|
70938
70972
|
},
|
|
70939
70973
|
computed: {
|
|
70940
70974
|
/**
|
|
@@ -84646,6 +84680,14 @@ function freeLayerKey(config2, path2, hint = "el") {
|
|
|
84646
84680
|
while (taken.has(`${hint}${ordinal}`)) ordinal += 1;
|
|
84647
84681
|
return `${hint}${ordinal}`;
|
|
84648
84682
|
}
|
|
84683
|
+
function duplicateLayerKey({ config: config2, path: path2, source }) {
|
|
84684
|
+
const body = config2.resolve("component", path2)?.toJSON();
|
|
84685
|
+
const taken = /* @__PURE__ */ new Set([...Object.keys(body?.layers ?? {}), ...Object.keys(body?.anatomy ?? {})]);
|
|
84686
|
+
const base = source.replace(/\d+$/, "") || source;
|
|
84687
|
+
let ordinal = 2;
|
|
84688
|
+
while (taken.has(`${base}${ordinal}`)) ordinal += 1;
|
|
84689
|
+
return `${base}${ordinal}`;
|
|
84690
|
+
}
|
|
84649
84691
|
function asElementRef(config2, value) {
|
|
84650
84692
|
if (typeof value !== "string") return value;
|
|
84651
84693
|
const { kind, qualifiedPath } = splitRef2(value);
|
|
@@ -86146,6 +86188,7 @@ function withoutProps(conditions, names) {
|
|
|
86146
86188
|
}
|
|
86147
86189
|
var ComponentEntity = defineEntity({
|
|
86148
86190
|
kind: "component",
|
|
86191
|
+
parts: true,
|
|
86149
86192
|
rebaseLinkedBody: (args) => {
|
|
86150
86193
|
const body = { ...translateLinkedStyleBags({
|
|
86151
86194
|
...args,
|
|
@@ -86548,7 +86591,11 @@ var ComponentEntity = defineEntity({
|
|
|
86548
86591
|
let next = config2;
|
|
86549
86592
|
let previous = source;
|
|
86550
86593
|
for (let n = 0; n < count; n++) {
|
|
86551
|
-
const key2 =
|
|
86594
|
+
const key2 = duplicateLayerKey({
|
|
86595
|
+
config: next,
|
|
86596
|
+
path: path2,
|
|
86597
|
+
source
|
|
86598
|
+
});
|
|
86552
86599
|
const siblings = next.resolve("component", path2)?.toJSON()?.anatomy?.[parent]?.children ?? [];
|
|
86553
86600
|
const index = siblings.indexOf(previous) + 1;
|
|
86554
86601
|
next = next.run([{
|
|
@@ -89067,7 +89114,7 @@ function isNode(value) {
|
|
|
89067
89114
|
function literal2(value) {
|
|
89068
89115
|
return typeof value === "string" ? `'${value}'` : String(value);
|
|
89069
89116
|
}
|
|
89070
|
-
function
|
|
89117
|
+
function unique2(parts) {
|
|
89071
89118
|
return [...new Set(parts)];
|
|
89072
89119
|
}
|
|
89073
89120
|
function renderSignature(schema, options = {}) {
|
|
@@ -89088,9 +89135,9 @@ function renderSignature(schema, options = {}) {
|
|
|
89088
89135
|
return shown.join(" | ");
|
|
89089
89136
|
}
|
|
89090
89137
|
const variants2 = node2.anyOf ?? node2.oneOf;
|
|
89091
|
-
if (variants2) return
|
|
89092
|
-
if (node2.allOf) return
|
|
89093
|
-
if (Array.isArray(node2.type)) return
|
|
89138
|
+
if (variants2) return unique2(variants2.filter((member) => !isNever(member)).map((member) => render(member, remaining))).join(" | ");
|
|
89139
|
+
if (node2.allOf) return unique2(node2.allOf.map((member) => render(member, remaining))).join(" & ");
|
|
89140
|
+
if (Array.isArray(node2.type)) return unique2(node2.type.map((type) => render({
|
|
89094
89141
|
...node2,
|
|
89095
89142
|
type
|
|
89096
89143
|
}, remaining))).join(" | ");
|
|
@@ -89719,7 +89766,7 @@ var Entity = class {
|
|
|
89719
89766
|
};
|
|
89720
89767
|
|
|
89721
89768
|
// ../config/dist/framework/schema-version.js
|
|
89722
|
-
var CURRENT_SCHEMA_VERSION =
|
|
89769
|
+
var CURRENT_SCHEMA_VERSION = 20261102185610;
|
|
89723
89770
|
var SETTINGS_AS_KIND_VERSION = 20260908171448;
|
|
89724
89771
|
var SchemaVersionTooNew = class extends ConfigFormatError {
|
|
89725
89772
|
found;
|
|
@@ -89739,7 +89786,7 @@ function registerSchemaMigrations(...migrations) {
|
|
|
89739
89786
|
for (const migration of migrations) {
|
|
89740
89787
|
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.`);
|
|
89741
89788
|
if (REGISTERED.has(migration.version)) throw new Error(`A schema migration at version ${migration.version} is already registered.`);
|
|
89742
|
-
if (migration.version >
|
|
89789
|
+
if (migration.version > 20261102185610) 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.`);
|
|
89743
89790
|
REGISTERED.set(migration.version, migration);
|
|
89744
89791
|
}
|
|
89745
89792
|
}
|
|
@@ -89770,7 +89817,7 @@ function pendingFor(version2, target2, options) {
|
|
|
89770
89817
|
return [...(options?.migrations ?? REGISTERED).values()].filter((m) => m.version > version2 && m.version <= target2).sort((a, b) => a.version - b.version);
|
|
89771
89818
|
}
|
|
89772
89819
|
function upgradeSerializedConfig(json2, options) {
|
|
89773
|
-
const target2 = options?.target ??
|
|
89820
|
+
const target2 = options?.target ?? 20261102185610;
|
|
89774
89821
|
const version2 = detectedWireVersion(json2);
|
|
89775
89822
|
if (version2 > target2) throw new SchemaVersionTooNew(version2, target2);
|
|
89776
89823
|
const raw = json2;
|
|
@@ -92488,10 +92535,23 @@ var Config = class Config2 {
|
|
|
92488
92535
|
if (borrowed !== void 0 && isRef2(storedBody) && pathOf2(storedBody) === patch.path) reject("UNSUPPORTED", `Cannot rename ${patch.kind} "${patch.path}" \u2014 it carries "${borrowed}"'s own name for it. Place it at a path of your own to name it, or link it as a value.`);
|
|
92489
92536
|
const { value } = extension ? extensionChange(entry, patch.kind, patch.to, extension, false) : itemChange(entry, patch.kind, patch.to, stored);
|
|
92490
92537
|
const moved = snapshot.withRenamed(patch.kind, "item", patch.path, patch.to, value);
|
|
92491
|
-
|
|
92538
|
+
let next = this.cascadeRename(moved, `${patch.kind}:${patch.path}`, `${patch.kind}:${patch.to}`, this.entityOf(patch.kind)?.sourceIdentity ? {
|
|
92492
92539
|
from: patch.path,
|
|
92493
92540
|
to: patch.to
|
|
92494
92541
|
} : void 0);
|
|
92542
|
+
const parts = this.partMoves(snapshot, entry, patch.path, patch.to);
|
|
92543
|
+
for (const part of parts) {
|
|
92544
|
+
const taken = snapshot.get(patch.kind, part.to);
|
|
92545
|
+
if (taken && !isMintedRow(taken.toJSON())) reject("ALREADY_EXISTS", `Cannot rename ${patch.kind} "${patch.path}" to "${patch.to}" \u2014 its part "${part.from}" would land on the ${patch.kind} already at "${part.to}".`);
|
|
92546
|
+
}
|
|
92547
|
+
for (const part of parts) {
|
|
92548
|
+
const current = next.get(patch.kind, part.from);
|
|
92549
|
+
if (!current) continue;
|
|
92550
|
+
const { value: value2 } = itemChange(entry, patch.kind, part.to, current.toJSON());
|
|
92551
|
+
next = next.withRenamed(patch.kind, "item", part.from, part.to, value2);
|
|
92552
|
+
next = this.cascadeRename(next, `${patch.kind}:${part.from}`, `${patch.kind}:${part.to}`);
|
|
92553
|
+
}
|
|
92554
|
+
return next;
|
|
92495
92555
|
}
|
|
92496
92556
|
const updateSchema = dataSchema(entry.schemas, "update");
|
|
92497
92557
|
if (!updateSchema) reject("UNSUPPORTED", `${patch.kind} has no update operation`);
|
|
@@ -93110,6 +93170,22 @@ var Config = class Config2 {
|
|
|
93110
93170
|
* subgroup (`color/brand/primary`) belongs to `color` too. Getting either wrong is silent: one drags
|
|
93111
93171
|
* an unrelated group along, the other skips half of what the user sees under the heading.
|
|
93112
93172
|
*/
|
|
93173
|
+
/**
|
|
93174
|
+
* The parts a rename of `from` to `to` moves with it, for a kind that declares
|
|
93175
|
+
* {@link EntityKind.parts}: every item named under `from`, at any depth.
|
|
93176
|
+
*/
|
|
93177
|
+
partMoves(snapshot, entry, from, to) {
|
|
93178
|
+
if (!entry.parts || from === to) return [];
|
|
93179
|
+
return this.groupMembers(snapshot, entry.name, from).map(({ path: path2 }) => ({
|
|
93180
|
+
from: path2,
|
|
93181
|
+
to: `${to}${path2.slice(from.length)}`
|
|
93182
|
+
}));
|
|
93183
|
+
}
|
|
93184
|
+
/** The parts renaming `path` to `to` would move with it — see {@link EntityKind.parts}. */
|
|
93185
|
+
renamedParts(kind, path2, to) {
|
|
93186
|
+
const entry = this.entityOf(kind);
|
|
93187
|
+
return entry ? this.partMoves(this.state.snapshot, entry, path2, to) : [];
|
|
93188
|
+
}
|
|
93113
93189
|
groupMembers(snapshot, kind, group) {
|
|
93114
93190
|
const members2 = [];
|
|
93115
93191
|
for (const [path2, entity] of snapshot.slice(kind).items) if (path2.startsWith(`${group}/`)) members2.push({
|
|
@@ -96627,7 +96703,7 @@ var Config = class Config2 {
|
|
|
96627
96703
|
* links from the provided sources. A declared `linkedKind` with no provided source throws. */
|
|
96628
96704
|
hydrateFrom(stored, options) {
|
|
96629
96705
|
const claimed = schemaVersionOf(stored);
|
|
96630
|
-
if (claimed >
|
|
96706
|
+
if (claimed > 20261102185610) throw new SchemaVersionTooNew(claimed);
|
|
96631
96707
|
const wire = upgradeSerializedConfig(stored);
|
|
96632
96708
|
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.`);
|
|
96633
96709
|
const leftover = wire.options;
|
|
@@ -97963,7 +98039,15 @@ function planLinkApplied({ config: config2, input: input2 }) {
|
|
|
97963
98039
|
const shadows = [];
|
|
97964
98040
|
const gains = /* @__PURE__ */ new Map();
|
|
97965
98041
|
let leftAnywhere = false;
|
|
98042
|
+
const replacements = replacementTakes({
|
|
98043
|
+
config: config2,
|
|
98044
|
+
slug: slug2,
|
|
98045
|
+
source,
|
|
98046
|
+
input: input2
|
|
98047
|
+
});
|
|
98048
|
+
const landing = new Set(replacements.entries.map(({ kind, path: path2 }) => `${kind}:${path2}`));
|
|
97966
98049
|
const shadow2 = (kind, path2) => {
|
|
98050
|
+
if (landing.has(`${kind}:${path2}`)) return true;
|
|
97967
98051
|
const held = config2.resolve(kind, path2);
|
|
97968
98052
|
if (!held || held.borrowedFrom === slug2) return true;
|
|
97969
98053
|
if (sharedWithOrigin({
|
|
@@ -98043,7 +98127,7 @@ function planLinkApplied({ config: config2, input: input2 }) {
|
|
|
98043
98127
|
if (path2 === "*") continue;
|
|
98044
98128
|
rejectData(`Cannot link "${path2}" through "${slug2}" \u2014 the source has no ${kind} there.`, ["data", accessor]);
|
|
98045
98129
|
}
|
|
98046
|
-
const
|
|
98130
|
+
const taken2 = entries.filter((entry) => {
|
|
98047
98131
|
const fit = config2.canBorrow({
|
|
98048
98132
|
kind,
|
|
98049
98133
|
path: entry.from,
|
|
@@ -98053,12 +98137,12 @@ function planLinkApplied({ config: config2, input: input2 }) {
|
|
|
98053
98137
|
if (source.resolve(kind, path2)) rejectData(fit.error, ["data", accessor]);
|
|
98054
98138
|
return false;
|
|
98055
98139
|
}).filter((entry) => shadow2(kind, entry.from));
|
|
98056
|
-
if (
|
|
98140
|
+
if (taken2.length === entries.length) {
|
|
98057
98141
|
if (path2 !== "*") gained.push(path2);
|
|
98058
98142
|
continue;
|
|
98059
98143
|
}
|
|
98060
98144
|
whole = false;
|
|
98061
|
-
gained.push(...
|
|
98145
|
+
gained.push(...taken2.map((entry) => entry.from));
|
|
98062
98146
|
}
|
|
98063
98147
|
if (whole) gains.set(accessor, "*");
|
|
98064
98148
|
else if (gained.length > 0) gains.set(accessor, gained);
|
|
@@ -98108,12 +98192,13 @@ function planLinkApplied({ config: config2, input: input2 }) {
|
|
|
98108
98192
|
declared2 = Object.keys(next).length === 0 ? current : next;
|
|
98109
98193
|
}
|
|
98110
98194
|
const planned = [
|
|
98195
|
+
...replacements.patches,
|
|
98111
98196
|
...takes2,
|
|
98112
98197
|
...declares,
|
|
98113
98198
|
...shadows
|
|
98114
98199
|
];
|
|
98115
98200
|
let result = planned.length > 0 ? applied(config2, planned) : void 0;
|
|
98116
|
-
if (takes2.length > 0 && result && "failed" in result) throw result.failed;
|
|
98201
|
+
if ((takes2.length > 0 || replacements.patches.length > 0) && result && "failed" in result) throw result.failed;
|
|
98117
98202
|
const { dropped, stranded, patches: drops } = takes2.length > 0 && result && "config" in result ? directivesTakenFrom({
|
|
98118
98203
|
config: config2,
|
|
98119
98204
|
slug: slug2,
|
|
@@ -98124,7 +98209,74 @@ function planLinkApplied({ config: config2, input: input2 }) {
|
|
|
98124
98209
|
patches: []
|
|
98125
98210
|
};
|
|
98126
98211
|
if (drops.length > 0 && result && "config" in result) result = applied(result.config, drops);
|
|
98127
|
-
const
|
|
98212
|
+
const taken = [];
|
|
98213
|
+
const leaves2 = [];
|
|
98214
|
+
for (const entry of replacements.entries) {
|
|
98215
|
+
const { kind, accessor, path: path2, replaces, from } = entry;
|
|
98216
|
+
if (from === void 0 || !result || !("config" in result)) {
|
|
98217
|
+
taken.push({
|
|
98218
|
+
kind,
|
|
98219
|
+
path: replaces,
|
|
98220
|
+
with: path2,
|
|
98221
|
+
...from ? { from } : {},
|
|
98222
|
+
excluded: false,
|
|
98223
|
+
dropped: []
|
|
98224
|
+
});
|
|
98225
|
+
continue;
|
|
98226
|
+
}
|
|
98227
|
+
const leftOut = { [accessor]: [replaces] };
|
|
98228
|
+
const keptFor = linkedDependents({
|
|
98229
|
+
config: result.config,
|
|
98230
|
+
slug: from,
|
|
98231
|
+
data: leftOut
|
|
98232
|
+
});
|
|
98233
|
+
if (keptFor.length > 0) {
|
|
98234
|
+
taken.push({
|
|
98235
|
+
kind,
|
|
98236
|
+
path: replaces,
|
|
98237
|
+
with: path2,
|
|
98238
|
+
from,
|
|
98239
|
+
excluded: false,
|
|
98240
|
+
keptFor,
|
|
98241
|
+
dropped: []
|
|
98242
|
+
});
|
|
98243
|
+
continue;
|
|
98244
|
+
}
|
|
98245
|
+
const exclusion = planExclude({
|
|
98246
|
+
config: result.config,
|
|
98247
|
+
input: {
|
|
98248
|
+
path: from,
|
|
98249
|
+
data: leftOut
|
|
98250
|
+
}
|
|
98251
|
+
});
|
|
98252
|
+
if (exclusion.blocked !== void 0) {
|
|
98253
|
+
taken.push({
|
|
98254
|
+
kind,
|
|
98255
|
+
path: replaces,
|
|
98256
|
+
with: path2,
|
|
98257
|
+
from,
|
|
98258
|
+
excluded: false,
|
|
98259
|
+
keptBecause: exclusion.blocked,
|
|
98260
|
+
dropped: []
|
|
98261
|
+
});
|
|
98262
|
+
continue;
|
|
98263
|
+
}
|
|
98264
|
+
leaves2.push(...exclusion.patches);
|
|
98265
|
+
result = applied(result.config, exclusion.patches);
|
|
98266
|
+
taken.push({
|
|
98267
|
+
kind,
|
|
98268
|
+
path: replaces,
|
|
98269
|
+
with: path2,
|
|
98270
|
+
from,
|
|
98271
|
+
excluded: true,
|
|
98272
|
+
dropped: exclusion.dropped
|
|
98273
|
+
});
|
|
98274
|
+
}
|
|
98275
|
+
const patches = [
|
|
98276
|
+
...planned,
|
|
98277
|
+
...drops,
|
|
98278
|
+
...leaves2
|
|
98279
|
+
];
|
|
98128
98280
|
return {
|
|
98129
98281
|
plan: {
|
|
98130
98282
|
declared: declared2,
|
|
@@ -98138,6 +98290,7 @@ function planLinkApplied({ config: config2, input: input2 }) {
|
|
|
98138
98290
|
addresses: addresses2,
|
|
98139
98291
|
linked,
|
|
98140
98292
|
extended,
|
|
98293
|
+
replaced: taken,
|
|
98141
98294
|
dropped,
|
|
98142
98295
|
shared,
|
|
98143
98296
|
patches,
|
|
@@ -98149,6 +98302,71 @@ function planLinkApplied({ config: config2, input: input2 }) {
|
|
|
98149
98302
|
after: stranded.length === 0 && result && "config" in result ? result.config : void 0
|
|
98150
98303
|
};
|
|
98151
98304
|
}
|
|
98305
|
+
function replacementTakes({ config: config2, slug: slug2, source, input: input2 }) {
|
|
98306
|
+
const entries = [];
|
|
98307
|
+
const patches = [];
|
|
98308
|
+
const accessors = config2.accessors();
|
|
98309
|
+
const landing = /* @__PURE__ */ new Map();
|
|
98310
|
+
for (const [accessor, pairs] of Object.entries(input2.replace ?? {})) {
|
|
98311
|
+
const kind = accessors[accessor]?.kind;
|
|
98312
|
+
if (!kind) rejectData(`Cannot replace anything through "${slug2}" \u2014 this system has no "${accessor}".`, ["replace", accessor]);
|
|
98313
|
+
for (const [replaces, path2] of Object.entries(pairs)) {
|
|
98314
|
+
const at = [
|
|
98315
|
+
"replace",
|
|
98316
|
+
accessor,
|
|
98317
|
+
replaces
|
|
98318
|
+
];
|
|
98319
|
+
if (input2.data !== "*" && !covers({
|
|
98320
|
+
declared: input2.data,
|
|
98321
|
+
accessor,
|
|
98322
|
+
path: path2
|
|
98323
|
+
})) rejectData(`Cannot replace "${replaces}" with "${path2}" \u2014 \`data\` doesn't link "${path2}" through "${slug2}". Name it there too.`, at);
|
|
98324
|
+
if (!source.resolve(kind, path2)) rejectData(`Cannot replace "${replaces}" with "${path2}" \u2014 "${slug2}" has no ${kind} "${path2}".`, at);
|
|
98325
|
+
if (path2 === replaces) rejectData(`Cannot replace "${path2}" with itself \u2014 taking the source's "${path2}" over it is \`onLinked: 'take'\`.`, at);
|
|
98326
|
+
const twice = landing.get(`${kind}:${path2}`);
|
|
98327
|
+
if (twice !== void 0) rejectData(`Cannot replace both "${twice}" and "${replaces}" with "${path2}".`, at);
|
|
98328
|
+
const held = config2.resolve(kind, replaces);
|
|
98329
|
+
if (!held) rejectData(`Cannot replace "${replaces}" \u2014 this system has no ${kind} "${replaces}".`, at);
|
|
98330
|
+
if (held.borrowedFrom === slug2) rejectData(`Cannot replace "${replaces}" with "${path2}" \u2014 "${replaces}" already comes from "${slug2}".`, at);
|
|
98331
|
+
const occupied = config2.storedBody(kind, path2);
|
|
98332
|
+
if (occupied !== void 0 && !isMintedRow(occupied)) rejectData(`Cannot replace "${replaces}" with "${path2}" \u2014 this system already has a ${kind} of its own at "${path2}".`, at);
|
|
98333
|
+
landing.set(`${kind}:${path2}`, replaces);
|
|
98334
|
+
const from = held.borrowedFrom ?? declaredElsewhere({
|
|
98335
|
+
config: config2,
|
|
98336
|
+
slug: slug2,
|
|
98337
|
+
kind,
|
|
98338
|
+
path: replaces
|
|
98339
|
+
});
|
|
98340
|
+
const stored = config2.storedBody(kind, replaces);
|
|
98341
|
+
const minted = stored !== void 0 && isMintedRow(stored);
|
|
98342
|
+
entries.push({
|
|
98343
|
+
kind,
|
|
98344
|
+
accessor,
|
|
98345
|
+
path: path2,
|
|
98346
|
+
replaces,
|
|
98347
|
+
...from ? { from } : {}
|
|
98348
|
+
});
|
|
98349
|
+
patches.push({
|
|
98350
|
+
kind,
|
|
98351
|
+
operation: minted ? "create" : "replace",
|
|
98352
|
+
path: replaces,
|
|
98353
|
+
data: {
|
|
98354
|
+
...ref(kind, path2, slug2),
|
|
98355
|
+
extend: {}
|
|
98356
|
+
}
|
|
98357
|
+
}, {
|
|
98358
|
+
kind,
|
|
98359
|
+
operation: "rename",
|
|
98360
|
+
path: replaces,
|
|
98361
|
+
to: path2
|
|
98362
|
+
});
|
|
98363
|
+
}
|
|
98364
|
+
}
|
|
98365
|
+
return {
|
|
98366
|
+
entries,
|
|
98367
|
+
patches
|
|
98368
|
+
};
|
|
98369
|
+
}
|
|
98152
98370
|
function directivesTakenFrom({ config: config2, slug: slug2, after: after5 }) {
|
|
98153
98371
|
const key2 = (at) => `${at.slug}\0${at.accessor}\0${at.path}`;
|
|
98154
98372
|
const already = new Set(danglingDirectives(config2).map(key2));
|
|
@@ -98953,7 +99171,16 @@ var linkInput = external_exports.object({
|
|
|
98953
99171
|
data: external_exports.union([external_exports.literal("*"), external_exports.record(external_exports.string(), copyPaths)]),
|
|
98954
99172
|
/** What to do at a path another linked system provides: `'take'` makes it follow this source,
|
|
98955
99173
|
* `'keep'` leaves it where it comes from. Required when there is one; `link-plan` lists them. */
|
|
98956
|
-
onLinked: external_exports.enum(["keep", "take"]).optional()
|
|
99174
|
+
onLinked: external_exports.enum(["keep", "take"]).optional(),
|
|
99175
|
+
/**
|
|
99176
|
+
* A component this config holds under one name, replaced with the source's of another name, keyed
|
|
99177
|
+
* by accessor: `{ components: { SelectContent: 'SelectMenu' } }` replaces the `SelectContent` this
|
|
99178
|
+
* config holds with the source's `SelectMenu`. Every ref to `SelectContent` is renamed to
|
|
99179
|
+
* `SelectMenu`, so design files and code follow the way they follow a rename, and the system
|
|
99180
|
+
* `SelectContent` came through stops deriving it unless its own rows still use it. Each source path
|
|
99181
|
+
* is one `data` names; `link-plan` lists each in `replaced`. A take at the same name is `onLinked`.
|
|
99182
|
+
*/
|
|
99183
|
+
replace: external_exports.record(external_exports.string(), external_exports.record(external_exports.string().min(1), external_exports.string().min(1))).optional()
|
|
98957
99184
|
});
|
|
98958
99185
|
var unlinkInput = external_exports.object({
|
|
98959
99186
|
path: pathInput("linked-system"),
|
|
@@ -98995,7 +99222,8 @@ function linkPlanInputOf(input2) {
|
|
|
98995
99222
|
return {
|
|
98996
99223
|
path: String(input2.path),
|
|
98997
99224
|
data: input2.data,
|
|
98998
|
-
...input2.onLinked === void 0 ? {} : { onLinked: input2.onLinked }
|
|
99225
|
+
...input2.onLinked === void 0 ? {} : { onLinked: input2.onLinked },
|
|
99226
|
+
...input2.replace === void 0 ? {} : { replace: input2.replace }
|
|
98999
99227
|
};
|
|
99000
99228
|
}
|
|
99001
99229
|
function linkExample({ config: config2, path: path2 }) {
|
|
@@ -99074,7 +99302,7 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
99074
99302
|
input: linkInput,
|
|
99075
99303
|
readOnly: false,
|
|
99076
99304
|
label: "Link from",
|
|
99077
|
-
description: "Draw entities from a linked system, following the source: `data` names them by accessor \u2014 `{ tokens: ['color/brand', 'color'] }` takes an entity and a folder's members, `{ tokens: '*' }` every token, and `'*'` the whole system. What this config already holds at those paths is replaced by theirs, so run `linked-system/link-plan` with the same input first to see what that is. To hold their values as your own instead, `copy`.",
|
|
99305
|
+
description: "Draw entities from a linked system, following the source: `data` names them by accessor \u2014 `{ tokens: ['color/brand', 'color'] }` takes an entity and a folder's members, `{ tokens: '*' }` every token, and `'*'` the whole system. What this config already holds at those paths is replaced by theirs, so run `linked-system/link-plan` with the same input first to see what that is. To replace something this config holds under another name (the `SelectContent` it has with the source's `SelectMenu`), name the pair in `replace` (`{ components: { SelectContent: 'SelectMenu' } }`): every reference to the old name moves to the new one, in design files and code too. To hold their values as your own instead, `copy`.",
|
|
99078
99306
|
scope: "item",
|
|
99079
99307
|
approval: "reference-change",
|
|
99080
99308
|
title: (entity) => `Link something from ${entity}`,
|
|
@@ -99097,7 +99325,7 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
99097
99325
|
input: linkInput,
|
|
99098
99326
|
readOnly: true,
|
|
99099
99327
|
label: "Plan a link",
|
|
99100
|
-
description: "What `link` with the same input replaces \u2014 rows of yours deleted so the source shows through, every path another linked system provides (`linked`, turned into extensions when `onLinked` says take), the `options` entries another linked system holds at what a take moves, which it removes since they would apply to nothing (`dropped`), members left alone because they are already here from the same origin, paths another linked system declares that the link reaches as a different entity (`settled`), whose row stays, and why the config would refuse the link (`blocked`), a collision it would leave among them. Writes nothing.",
|
|
99328
|
+
description: "What `link` with the same input replaces \u2014 rows of yours deleted so the source shows through, every path another linked system provides (`linked`, turned into extensions when `onLinked` says take), the `options` entries another linked system holds at what a take moves, which it removes since they would apply to nothing (`dropped`), members left alone because they are already here from the same origin, paths another linked system declares that the link reaches as a different entity (`settled`), whose row stays, what `replace` replaces under another name (`replaced`: each path, what replaces it, the pin it came through, and whether it is left out of that pin or kept because rows of that pin still use it), and why the config would refuse the link (`blocked`), a collision it would leave among them. Writes nothing.",
|
|
99101
99329
|
scope: "item",
|
|
99102
99330
|
title: (entity) => `Plan a link from ${entity}`,
|
|
99103
99331
|
example: linkExample,
|
|
@@ -100027,6 +100255,22 @@ var layerPrefixMigration = {
|
|
|
100027
100255
|
up: (json2) => json2
|
|
100028
100256
|
};
|
|
100029
100257
|
|
|
100258
|
+
// ../config/dist/migrations/20261102143821_default_colors.js
|
|
100259
|
+
var DEFAULT_COLORS_VERSION = 20261102143821;
|
|
100260
|
+
var defaultColorsMigration = {
|
|
100261
|
+
version: DEFAULT_COLORS_VERSION,
|
|
100262
|
+
up(json2) {
|
|
100263
|
+
return json2;
|
|
100264
|
+
}
|
|
100265
|
+
};
|
|
100266
|
+
|
|
100267
|
+
// ../config/dist/migrations/20261102185610_link_replace.js
|
|
100268
|
+
var LINK_REPLACE_VERSION = 20261102185610;
|
|
100269
|
+
var linkReplaceMigration = {
|
|
100270
|
+
version: LINK_REPLACE_VERSION,
|
|
100271
|
+
up: (json2) => json2
|
|
100272
|
+
};
|
|
100273
|
+
|
|
100030
100274
|
// ../../node_modules/css-tree/lib/generator/sourceMap.js
|
|
100031
100275
|
var import_source_map_generator = __toESM(require_source_map_generator(), 1);
|
|
100032
100276
|
var trackNodes = /* @__PURE__ */ new Set(["Atrule", "Selector", "Declaration"]);
|
|
@@ -101288,9 +101532,9 @@ function tokenVarIndex(tokenRecord, varPrefix) {
|
|
|
101288
101532
|
const name = cssVar(void 0, "token", path2, varPrefix);
|
|
101289
101533
|
byVar.set(name, byVar.has(name) ? null : path2);
|
|
101290
101534
|
}
|
|
101291
|
-
const
|
|
101292
|
-
for (const [name, path2] of byVar) if (path2 !== null)
|
|
101293
|
-
return
|
|
101535
|
+
const unique3 = /* @__PURE__ */ new Map();
|
|
101536
|
+
for (const [name, path2] of byVar) if (path2 !== null) unique3.set(name, path2);
|
|
101537
|
+
return unique3;
|
|
101294
101538
|
}
|
|
101295
101539
|
function withTokenRefs(declarations, tokenByVar) {
|
|
101296
101540
|
return Object.fromEntries(Object.entries(declarations).map(([property, value]) => {
|
|
@@ -101332,15 +101576,15 @@ function bindFontFamilyTokens({ tokenRecord, fontRecord, globalStyleRecord, varP
|
|
|
101332
101576
|
const fonts = /* @__PURE__ */ new Map();
|
|
101333
101577
|
for (const [path2, body] of Object.entries(fontRecord)) if (body && typeof body === "object" && "fontFamily" in body) fonts.set(path2, body);
|
|
101334
101578
|
if (fonts.size === 0) return;
|
|
101335
|
-
const
|
|
101579
|
+
const unique3 = (pairs) => {
|
|
101336
101580
|
const seen = /* @__PURE__ */ new Map();
|
|
101337
101581
|
for (const [key2, path2] of pairs) seen.set(key2, seen.has(key2) ? null : path2);
|
|
101338
101582
|
const out = /* @__PURE__ */ new Map();
|
|
101339
101583
|
for (const [key2, path2] of seen) if (path2 !== null) out.set(key2, path2);
|
|
101340
101584
|
return out;
|
|
101341
101585
|
};
|
|
101342
|
-
const byLeaf =
|
|
101343
|
-
const byFamily =
|
|
101586
|
+
const byLeaf = unique3([...fonts.keys()].map((path2) => [path2.slice(path2.lastIndexOf("/") + 1), path2]));
|
|
101587
|
+
const byFamily = unique3([...fonts].map(([path2, body]) => [body.fontFamily.toLowerCase(), path2]));
|
|
101344
101588
|
const propertyPrefix = `--${varPrefix}-font-family-`;
|
|
101345
101589
|
const rootVars = /* @__PURE__ */ new Map();
|
|
101346
101590
|
for (const [name, style] of Object.entries(globalStyleRecord)) {
|
|
@@ -102763,6 +103007,8 @@ if (!registeredSchemaMigrations().has(20261027184442)) registerSchemaMigrations(
|
|
|
102763
103007
|
if (!registeredSchemaMigrations().has(20261027205147)) registerSchemaMigrations(lintIgnoreMigration);
|
|
102764
103008
|
if (!registeredSchemaMigrations().has(20261030134149)) registerSchemaMigrations(componentMapPropsMigration);
|
|
102765
103009
|
if (!registeredSchemaMigrations().has(20261030163028)) registerSchemaMigrations(layerPrefixMigration);
|
|
103010
|
+
if (!registeredSchemaMigrations().has(20261102143821)) registerSchemaMigrations(defaultColorsMigration);
|
|
103011
|
+
if (!registeredSchemaMigrations().has(20261102185610)) registerSchemaMigrations(linkReplaceMigration);
|
|
102766
103012
|
|
|
102767
103013
|
// ../config/dist/capture/node-ops.js
|
|
102768
103014
|
var DEFAULT_WIDTH = 1600;
|