@yahoo/uds-create-cli 5.78.0 → 5.79.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 +508 -239
|
@@ -10769,14 +10769,14 @@ var require_lib = __commonJS({
|
|
|
10769
10769
|
};
|
|
10770
10770
|
var mixinPluginNames = Object.keys(mixinPlugins);
|
|
10771
10771
|
var ExpressionParser = class extends LValParser {
|
|
10772
|
-
checkProto(prop,
|
|
10772
|
+
checkProto(prop, isRecord4, sawProto, refExpressionErrors) {
|
|
10773
10773
|
if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) {
|
|
10774
10774
|
return sawProto;
|
|
10775
10775
|
}
|
|
10776
10776
|
const key2 = prop.key;
|
|
10777
10777
|
const name = key2.type === "Identifier" ? key2.name : key2.value;
|
|
10778
10778
|
if (name === "__proto__") {
|
|
10779
|
-
if (
|
|
10779
|
+
if (isRecord4) {
|
|
10780
10780
|
this.raise(Errors.RecordNoProto, key2);
|
|
10781
10781
|
return true;
|
|
10782
10782
|
}
|
|
@@ -11834,8 +11834,8 @@ var require_lib = __commonJS({
|
|
|
11834
11834
|
parseTemplateSubstitution() {
|
|
11835
11835
|
return this.parseExpression();
|
|
11836
11836
|
}
|
|
11837
|
-
parseObjectLike(close, isPattern,
|
|
11838
|
-
if (
|
|
11837
|
+
parseObjectLike(close, isPattern, isRecord4, refExpressionErrors) {
|
|
11838
|
+
if (isRecord4) {
|
|
11839
11839
|
this.expectPlugin("recordAndTuple");
|
|
11840
11840
|
}
|
|
11841
11841
|
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
@@ -11860,9 +11860,9 @@ var require_lib = __commonJS({
|
|
|
11860
11860
|
prop = this.parseBindingProperty();
|
|
11861
11861
|
} else {
|
|
11862
11862
|
prop = this.parsePropertyDefinition(refExpressionErrors);
|
|
11863
|
-
sawProto = this.checkProto(prop,
|
|
11863
|
+
sawProto = this.checkProto(prop, isRecord4, sawProto, refExpressionErrors);
|
|
11864
11864
|
}
|
|
11865
|
-
if (
|
|
11865
|
+
if (isRecord4 && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") {
|
|
11866
11866
|
this.raise(Errors.InvalidRecordProperty, prop);
|
|
11867
11867
|
}
|
|
11868
11868
|
if (prop.shorthand) {
|
|
@@ -11875,7 +11875,7 @@ var require_lib = __commonJS({
|
|
|
11875
11875
|
let type = "ObjectExpression";
|
|
11876
11876
|
if (isPattern) {
|
|
11877
11877
|
type = "ObjectPattern";
|
|
11878
|
-
} else if (
|
|
11878
|
+
} else if (isRecord4) {
|
|
11879
11879
|
type = "RecordExpression";
|
|
11880
11880
|
}
|
|
11881
11881
|
return this.finishNode(node2, type);
|
|
@@ -63709,12 +63709,17 @@ function partializeShape(shape2, keep) {
|
|
|
63709
63709
|
}
|
|
63710
63710
|
let inner = field;
|
|
63711
63711
|
let description = inner.description;
|
|
63712
|
+
let deprecated = inner.meta()?.deprecated === true;
|
|
63712
63713
|
while (inner instanceof external_exports.ZodOptional || inner instanceof external_exports.ZodDefault) {
|
|
63713
63714
|
inner = inner.unwrap();
|
|
63714
63715
|
description ??= inner.description;
|
|
63716
|
+
deprecated ||= inner.meta()?.deprecated === true;
|
|
63715
63717
|
}
|
|
63716
63718
|
const delta = inner.nullable().optional();
|
|
63717
|
-
out[key2] = description ? delta.
|
|
63719
|
+
out[key2] = description || deprecated ? delta.meta({
|
|
63720
|
+
...description ? { description } : {},
|
|
63721
|
+
...deprecated ? { deprecated } : {}
|
|
63722
|
+
}) : delta;
|
|
63718
63723
|
}
|
|
63719
63724
|
return out;
|
|
63720
63725
|
}
|
|
@@ -64668,7 +64673,7 @@ function defaultSchemas(kind, declaredFields, groupFields, subEntities, { single
|
|
|
64668
64673
|
* design, so `update` can never dissolve one. `create` refuses an occupied path, and
|
|
64669
64674
|
* delete-then-create is refused by any referrer and drops the item to the end of its collection.
|
|
64670
64675
|
*
|
|
64671
|
-
* So this exists for edits that are a whole body by nature: a `
|
|
64676
|
+
* So this exists for edits that are a whole body by nature: a `source/copy` landing the
|
|
64672
64677
|
* literal a pointer stood for, or a `link` turning a row of yours into an extension through a pin
|
|
64673
64678
|
* — one state replacing another rather than a field changing.
|
|
64674
64679
|
*
|
|
@@ -65160,7 +65165,7 @@ function titleCase(kind) {
|
|
|
65160
65165
|
return kind.split(/[-_]/).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
65161
65166
|
}
|
|
65162
65167
|
function buildKind(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,
|
|
65168
|
+
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, retiredFields, retiredKinds, sourceType, answeredHere } = spec2;
|
|
65164
65169
|
const allComputed = {
|
|
65165
65170
|
sources: ({ member, config: config2 }) => sourceSlugs(member, config2),
|
|
65166
65171
|
borrowedFrom: ({ config: config2, path: path2 }) => config2.borrowedFrom(name, path2),
|
|
@@ -65215,7 +65220,8 @@ function buildKind(spec2) {
|
|
|
65215
65220
|
...invariants ? { invariants } : {},
|
|
65216
65221
|
...structuralBody ? { structuralBody } : {},
|
|
65217
65222
|
...authoredBody ? { authoredBody } : {},
|
|
65218
|
-
...
|
|
65223
|
+
...retiredFields ? { retiredFields } : {},
|
|
65224
|
+
...retiredKinds?.length ? { retiredKinds } : {},
|
|
65219
65225
|
...sourceType ? { sourceType } : {},
|
|
65220
65226
|
...answeredHere ? { answeredHere: true } : {}
|
|
65221
65227
|
};
|
|
@@ -65355,7 +65361,8 @@ function defineEntity(spec2) {
|
|
|
65355
65361
|
invariants: spec2.invariants,
|
|
65356
65362
|
structuralBody: spec2.structuralBody,
|
|
65357
65363
|
authoredBody: spec2.authoredBody,
|
|
65358
|
-
|
|
65364
|
+
retiredFields: spec2.retiredFields,
|
|
65365
|
+
retiredKinds: spec2.retiredKinds,
|
|
65359
65366
|
sourceType: spec2.sourceType,
|
|
65360
65367
|
answeredHere: spec2.answeredHere
|
|
65361
65368
|
});
|
|
@@ -81117,7 +81124,7 @@ var resolvePlacements = createSliceMemo({
|
|
|
81117
81124
|
kinds: [
|
|
81118
81125
|
"component",
|
|
81119
81126
|
"motion",
|
|
81120
|
-
"
|
|
81127
|
+
"source"
|
|
81121
81128
|
],
|
|
81122
81129
|
compute: (config2) => {
|
|
81123
81130
|
const out = [];
|
|
@@ -81149,7 +81156,7 @@ var cssMotionVariantGroups = createSliceMemo({
|
|
|
81149
81156
|
kinds: [
|
|
81150
81157
|
"component",
|
|
81151
81158
|
"motion",
|
|
81152
|
-
"
|
|
81159
|
+
"source"
|
|
81153
81160
|
],
|
|
81154
81161
|
compute: (config2) => variantGroupsOf({
|
|
81155
81162
|
config: config2,
|
|
@@ -81160,7 +81167,7 @@ var resolveExits = createSliceMemo({
|
|
|
81160
81167
|
kinds: [
|
|
81161
81168
|
"component",
|
|
81162
81169
|
"motion",
|
|
81163
|
-
"
|
|
81170
|
+
"source"
|
|
81164
81171
|
],
|
|
81165
81172
|
compute: (config2) => {
|
|
81166
81173
|
const out = [];
|
|
@@ -81200,7 +81207,7 @@ var resolveSwapped = createSliceMemo({
|
|
|
81200
81207
|
kinds: [
|
|
81201
81208
|
"component",
|
|
81202
81209
|
"motion",
|
|
81203
|
-
"
|
|
81210
|
+
"source"
|
|
81204
81211
|
],
|
|
81205
81212
|
compute: (config2) => {
|
|
81206
81213
|
const links2 = swappingLinks(config2);
|
|
@@ -81216,10 +81223,10 @@ var resolveSwapped = createSliceMemo({
|
|
|
81216
81223
|
}
|
|
81217
81224
|
});
|
|
81218
81225
|
var resolveLinkedSwaps = createSliceMemo({
|
|
81219
|
-
kinds: ["
|
|
81226
|
+
kinds: ["source", "motion"],
|
|
81220
81227
|
compute: (config2) => {
|
|
81221
81228
|
const out = [];
|
|
81222
|
-
for (const link2 of config2.list("
|
|
81229
|
+
for (const link2 of config2.list("source")) {
|
|
81223
81230
|
const { options } = link2.toJSON();
|
|
81224
81231
|
for (const [preset, entry] of Object.entries(options?.motion ?? {})) {
|
|
81225
81232
|
if (!isPlainObject(entry)) continue;
|
|
@@ -81580,7 +81587,7 @@ var placedMotions = createSliceMemo({
|
|
|
81580
81587
|
kinds: [
|
|
81581
81588
|
"component",
|
|
81582
81589
|
"motion",
|
|
81583
|
-
"
|
|
81590
|
+
"source"
|
|
81584
81591
|
],
|
|
81585
81592
|
compute: (config2) => {
|
|
81586
81593
|
const out = [];
|
|
@@ -81608,7 +81615,7 @@ var motionVariantGroups = createSliceMemo({
|
|
|
81608
81615
|
kinds: [
|
|
81609
81616
|
"component",
|
|
81610
81617
|
"motion",
|
|
81611
|
-
"
|
|
81618
|
+
"source"
|
|
81612
81619
|
],
|
|
81613
81620
|
compute: (config2) => variantGroupsOf({
|
|
81614
81621
|
config: config2,
|
|
@@ -89954,7 +89961,7 @@ function renderSignature(schema, options = {}) {
|
|
|
89954
89961
|
return typeof node2.type === "string" ? node2.type : "unknown";
|
|
89955
89962
|
};
|
|
89956
89963
|
const renderObject = (node2, remaining) => {
|
|
89957
|
-
const entries = Object.entries(node2.properties ?? {});
|
|
89964
|
+
const entries = Object.entries(node2.properties ?? {}).filter(([, value]) => value.deprecated !== true);
|
|
89958
89965
|
if (entries.length === 1 && entries[0]?.[0] === "__ref") return "ref";
|
|
89959
89966
|
if (entries.length === 0) {
|
|
89960
89967
|
if (isNode(node2.additionalProperties)) {
|
|
@@ -90445,39 +90452,6 @@ function titleOf(config2, op) {
|
|
|
90445
90452
|
return `${op.label} ${noun}`;
|
|
90446
90453
|
}
|
|
90447
90454
|
|
|
90448
|
-
// ../config/dist/framework/authored-at.js
|
|
90449
|
-
function valueAt3(body, segments) {
|
|
90450
|
-
let at = body;
|
|
90451
|
-
for (const segment of segments) {
|
|
90452
|
-
if (!isPlainObject(at) || !Object.hasOwn(at, segment)) return void 0;
|
|
90453
|
-
at = at[segment];
|
|
90454
|
-
}
|
|
90455
|
-
return at;
|
|
90456
|
-
}
|
|
90457
|
-
function without(body, segments) {
|
|
90458
|
-
const [head, ...rest] = segments;
|
|
90459
|
-
if (head === void 0 || !Object.hasOwn(body, head)) return body;
|
|
90460
|
-
const { [head]: child, ...others } = body;
|
|
90461
|
-
if (rest.length === 0) return others;
|
|
90462
|
-
if (!isPlainObject(child)) return body;
|
|
90463
|
-
const remaining = without(child, rest);
|
|
90464
|
-
return Object.keys(remaining).length === 0 ? others : {
|
|
90465
|
-
...others,
|
|
90466
|
-
[head]: remaining
|
|
90467
|
-
};
|
|
90468
|
-
}
|
|
90469
|
-
function storedFromAuthored({ body, authoredAt }) {
|
|
90470
|
-
let stored = body;
|
|
90471
|
-
for (const [field, at] of Object.entries(authoredAt)) {
|
|
90472
|
-
const segments = at.split(".");
|
|
90473
|
-
const value = valueAt3(stored, segments);
|
|
90474
|
-
if (value === void 0) continue;
|
|
90475
|
-
if (stored[field] !== void 0) rejectData(`\`${at}\` and \`${field}\` are one value, so a body sets only one of them. \`${field}\` is the deprecated spelling.`, segments);
|
|
90476
|
-
stored = setAtPath(without(stored, segments), [field], value);
|
|
90477
|
-
}
|
|
90478
|
-
return stored;
|
|
90479
|
-
}
|
|
90480
|
-
|
|
90481
90455
|
// ../config/dist/framework/authoring.js
|
|
90482
90456
|
function isAuthored(value) {
|
|
90483
90457
|
if (typeof value !== "object" && typeof value !== "function") return false;
|
|
@@ -90604,7 +90578,7 @@ var Entity = class {
|
|
|
90604
90578
|
};
|
|
90605
90579
|
|
|
90606
90580
|
// ../config/dist/framework/schema-version.js
|
|
90607
|
-
var CURRENT_SCHEMA_VERSION =
|
|
90581
|
+
var CURRENT_SCHEMA_VERSION = 20261105185042;
|
|
90608
90582
|
var SETTINGS_AS_KIND_VERSION = 20260908171448;
|
|
90609
90583
|
var SchemaVersionTooNew = class extends ConfigFormatError {
|
|
90610
90584
|
found;
|
|
@@ -90624,7 +90598,7 @@ function registerSchemaMigrations(...migrations) {
|
|
|
90624
90598
|
for (const migration of migrations) {
|
|
90625
90599
|
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.`);
|
|
90626
90600
|
if (REGISTERED.has(migration.version)) throw new Error(`A schema migration at version ${migration.version} is already registered.`);
|
|
90627
|
-
if (migration.version >
|
|
90601
|
+
if (migration.version > 20261105185042) throw new Error(`Schema migration ${migration.version} is newer than CURRENT_SCHEMA_VERSION (${CURRENT_SCHEMA_VERSION}) \u2014 a stale branch merged, or the mint forgot to bump the constant. Re-mint: set CURRENT_SCHEMA_VERSION to the newest migration version.`);
|
|
90628
90602
|
REGISTERED.set(migration.version, migration);
|
|
90629
90603
|
}
|
|
90630
90604
|
}
|
|
@@ -90655,7 +90629,7 @@ function pendingFor(version2, target2, options) {
|
|
|
90655
90629
|
return [...(options?.migrations ?? REGISTERED).values()].filter((m) => m.version > version2 && m.version <= target2).sort((a, b) => a.version - b.version);
|
|
90656
90630
|
}
|
|
90657
90631
|
function upgradeSerializedConfig(json2, options) {
|
|
90658
|
-
const target2 = options?.target ??
|
|
90632
|
+
const target2 = options?.target ?? 20261105185042;
|
|
90659
90633
|
const version2 = detectedWireVersion(json2);
|
|
90660
90634
|
if (version2 > target2) throw new SchemaVersionTooNew(version2, target2);
|
|
90661
90635
|
const raw = json2;
|
|
@@ -90720,6 +90694,115 @@ function stamp(patch, id = crypto.randomUUID(), changeset) {
|
|
|
90720
90694
|
} : stamped;
|
|
90721
90695
|
}
|
|
90722
90696
|
|
|
90697
|
+
// ../config/dist/framework/retired-fields.js
|
|
90698
|
+
function valueAt3(body, segments) {
|
|
90699
|
+
let at = body;
|
|
90700
|
+
for (const segment of segments) {
|
|
90701
|
+
if (!isPlainObject(at) || !Object.hasOwn(at, segment)) return void 0;
|
|
90702
|
+
at = at[segment];
|
|
90703
|
+
}
|
|
90704
|
+
return at;
|
|
90705
|
+
}
|
|
90706
|
+
function without(body, segments) {
|
|
90707
|
+
const [head, ...rest] = segments;
|
|
90708
|
+
if (head === void 0 || !Object.hasOwn(body, head)) return body;
|
|
90709
|
+
const { [head]: child, ...others } = body;
|
|
90710
|
+
if (rest.length === 0) return others;
|
|
90711
|
+
if (!isPlainObject(child)) return body;
|
|
90712
|
+
const remaining = without(child, rest);
|
|
90713
|
+
return Object.keys(remaining).length === 0 ? others : {
|
|
90714
|
+
...others,
|
|
90715
|
+
[head]: remaining
|
|
90716
|
+
};
|
|
90717
|
+
}
|
|
90718
|
+
function refuseBoth({ retired, current }) {
|
|
90719
|
+
rejectData(`\`${current}\` and \`${retired}\` are one value, so they can't both be set. \`${retired}\` is the deprecated spelling.`, current.split("."));
|
|
90720
|
+
}
|
|
90721
|
+
function foldRetiredFields({ body, retired }) {
|
|
90722
|
+
let folded = body;
|
|
90723
|
+
for (const [old, current] of Object.entries(retired)) {
|
|
90724
|
+
const from = old.split(".");
|
|
90725
|
+
const value = valueAt3(folded, from);
|
|
90726
|
+
if (value === void 0 || value === null) continue;
|
|
90727
|
+
const to = current.split(".");
|
|
90728
|
+
if (valueAt3(folded, to) !== void 0) refuseBoth({
|
|
90729
|
+
retired: old,
|
|
90730
|
+
current
|
|
90731
|
+
});
|
|
90732
|
+
folded = setAtPath(without(folded, from), to, value);
|
|
90733
|
+
}
|
|
90734
|
+
return folded;
|
|
90735
|
+
}
|
|
90736
|
+
function deltaUnderCurrentFields({ delta, retired }) {
|
|
90737
|
+
const renamed = (key2) => {
|
|
90738
|
+
for (const [old, current] of Object.entries(retired)) {
|
|
90739
|
+
if (key2 === old) return current;
|
|
90740
|
+
if (key2.startsWith(`${old}.`)) return `${current}${key2.slice(old.length)}`;
|
|
90741
|
+
}
|
|
90742
|
+
return key2;
|
|
90743
|
+
};
|
|
90744
|
+
if (!Object.keys(delta).some((key2) => renamed(key2) !== key2)) return delta;
|
|
90745
|
+
const out = {};
|
|
90746
|
+
for (const [key2, value] of Object.entries(delta)) {
|
|
90747
|
+
const to = renamed(key2);
|
|
90748
|
+
if (to !== key2 && Object.hasOwn(delta, to)) refuseBoth({
|
|
90749
|
+
retired: key2,
|
|
90750
|
+
current: to
|
|
90751
|
+
});
|
|
90752
|
+
out[to] = value;
|
|
90753
|
+
}
|
|
90754
|
+
return out;
|
|
90755
|
+
}
|
|
90756
|
+
function keptThroughContainerWrite({ delta, retired, stored }) {
|
|
90757
|
+
if (!stored) return delta;
|
|
90758
|
+
let kept = delta;
|
|
90759
|
+
for (const [old, current] of Object.entries(retired)) {
|
|
90760
|
+
const [container, ...inside] = current.split(".");
|
|
90761
|
+
if (container === void 0 || inside.length === 0) continue;
|
|
90762
|
+
if (!Object.hasOwn(kept, container)) continue;
|
|
90763
|
+
const names = (path2) => Object.keys(kept).some((key2) => key2 === path2 || key2.startsWith(`${path2}.`));
|
|
90764
|
+
if (names(old) || names(current)) continue;
|
|
90765
|
+
const value = valueAt3(stored, current.split("."));
|
|
90766
|
+
if (value === void 0) continue;
|
|
90767
|
+
const written = kept[container];
|
|
90768
|
+
if (written !== null && !isPlainObject(written)) continue;
|
|
90769
|
+
if (isPlainObject(written) && valueAt3(written, inside) !== void 0) continue;
|
|
90770
|
+
kept = {
|
|
90771
|
+
...kept,
|
|
90772
|
+
[container]: setAtPath(isPlainObject(written) ? written : {}, inside, value)
|
|
90773
|
+
};
|
|
90774
|
+
}
|
|
90775
|
+
return kept;
|
|
90776
|
+
}
|
|
90777
|
+
function withEmptiedContainersCleared({ delta, retired, stored }) {
|
|
90778
|
+
if (!stored) return delta;
|
|
90779
|
+
let cleared = delta;
|
|
90780
|
+
for (const current of Object.values(retired)) {
|
|
90781
|
+
const [container, ...inside] = current.split(".");
|
|
90782
|
+
if (container === void 0 || inside.length === 0) continue;
|
|
90783
|
+
if (cleared[current] !== null || Object.hasOwn(cleared, container)) continue;
|
|
90784
|
+
if (Object.keys(cleared).some((key2) => key2 !== current && key2.startsWith(`${container}.`))) continue;
|
|
90785
|
+
const held = stored[container];
|
|
90786
|
+
if (!isPlainObject(held) || Object.keys(without(held, inside)).length > 0) continue;
|
|
90787
|
+
cleared = {
|
|
90788
|
+
...cleared,
|
|
90789
|
+
[container]: null
|
|
90790
|
+
};
|
|
90791
|
+
}
|
|
90792
|
+
return cleared;
|
|
90793
|
+
}
|
|
90794
|
+
function withoutClearsInsideClears({ delta, retired }) {
|
|
90795
|
+
let applied3 = delta;
|
|
90796
|
+
for (const current of Object.values(retired)) {
|
|
90797
|
+
const [container] = current.split(".");
|
|
90798
|
+
if (container === void 0 || container === current) continue;
|
|
90799
|
+
if (applied3[container] !== null || applied3[current] !== null) continue;
|
|
90800
|
+
const { [current]: _inside, ...rest } = applied3;
|
|
90801
|
+
applied3 = rest;
|
|
90802
|
+
}
|
|
90803
|
+
return applied3;
|
|
90804
|
+
}
|
|
90805
|
+
|
|
90723
90806
|
// ../config/dist/framework/ref-graph.js
|
|
90724
90807
|
var key = (target2) => isRef2(target2) ? target2.__ref : target2;
|
|
90725
90808
|
function edgesOf(ref2, data, extra = [], linkKinds = [], singletonKinds = []) {
|
|
@@ -91475,6 +91558,7 @@ function nameEdgeReaders(entities) {
|
|
|
91475
91558
|
for (const [kind, entry] of entities) if (entry.nameEdges) readers.set(kind, entry.nameEdges);
|
|
91476
91559
|
return readers;
|
|
91477
91560
|
}
|
|
91561
|
+
var retiredKindsByEntities = /* @__PURE__ */ new WeakMap();
|
|
91478
91562
|
var layerKeysByEntities = /* @__PURE__ */ new WeakMap();
|
|
91479
91563
|
function linkKindsOf(entities) {
|
|
91480
91564
|
const kinds = [];
|
|
@@ -91565,7 +91649,7 @@ function rejectCollisions(collisions2) {
|
|
|
91565
91649
|
throw new ConfigRejection([{
|
|
91566
91650
|
code: "SOURCE_COLLISION",
|
|
91567
91651
|
collisions: collisions2,
|
|
91568
|
-
message: `This would leave ${collisions2.length} ${one ? "path" : "paths"} offered by ${by} as different things, so neither applies: ${shown}${rest}. Take ${one ? "it" : "each"} from the system ${one ? "it" : "each"} should follow (\`
|
|
91652
|
+
message: `This would leave ${collisions2.length} ${one ? "path" : "paths"} offered by ${by} as different things, so neither applies: ${shown}${rest}. Take ${one ? "it" : "each"} from the system ${one ? "it" : "each"} should follow (\`source/link\` with \`onLinked: 'take'\`), or make the link that only reaches ${one ? "it" : "them"} \`hybrid\`, so it uses what this system already has.`
|
|
91569
91653
|
}]);
|
|
91570
91654
|
}
|
|
91571
91655
|
var parentSnapshotOf = /* @__PURE__ */ new WeakMap();
|
|
@@ -92096,7 +92180,65 @@ var Config = class Config2 {
|
|
|
92096
92180
|
* was registered into this instance. `undefined` for a kind this config doesn't know. The single
|
|
92097
92181
|
* accessor every internal read routes through. */
|
|
92098
92182
|
entityOf(kind) {
|
|
92099
|
-
return this.state.entities.get(kind);
|
|
92183
|
+
return this.state.entities.get(kind) ?? this.state.entities.get(this.currentKind(kind));
|
|
92184
|
+
}
|
|
92185
|
+
/** An op address (`linked-system/link`) with its kind segment named as the kind is now. */
|
|
92186
|
+
currentAddress(address) {
|
|
92187
|
+
const slash = address.indexOf("/");
|
|
92188
|
+
if (slash <= 0) return address;
|
|
92189
|
+
const kind = address.slice(0, slash);
|
|
92190
|
+
const current = this.currentKind(kind);
|
|
92191
|
+
return current === kind ? address : `${current}${address.slice(slash)}`;
|
|
92192
|
+
}
|
|
92193
|
+
/** `patch`, addressed to the kind it names now, with its data at the fields the kind has now. This
|
|
92194
|
+
* is the patch as it is recorded, so it depends on nothing but the patch. */
|
|
92195
|
+
patchUnderCurrentKind(patch) {
|
|
92196
|
+
const kind = this.currentKind(patch.kind);
|
|
92197
|
+
const addressed2 = kind === patch.kind ? patch : {
|
|
92198
|
+
...patch,
|
|
92199
|
+
kind
|
|
92200
|
+
};
|
|
92201
|
+
if (!("data" in addressed2) || "field" in addressed2) return addressed2;
|
|
92202
|
+
const data = this.underCurrentFields(kind, addressed2.operation, { data: addressed2.data }).data;
|
|
92203
|
+
return data === addressed2.data ? addressed2 : {
|
|
92204
|
+
...addressed2,
|
|
92205
|
+
data
|
|
92206
|
+
};
|
|
92207
|
+
}
|
|
92208
|
+
/**
|
|
92209
|
+
* `patch` as it lands on `snapshot`: a whole write of a moved field's container keeps the value
|
|
92210
|
+
* stored there ({@link keptThroughContainerWrite}). Judged at each landing rather than written into
|
|
92211
|
+
* the recorded patch, so a replay onto a base that has changed the field since keeps that base's
|
|
92212
|
+
* value, not the one stored when the patch was first applied.
|
|
92213
|
+
*/
|
|
92214
|
+
patchAsItLands(patch, snapshot) {
|
|
92215
|
+
if (patch.operation !== "update" || !("data" in patch) || "field" in patch) return patch;
|
|
92216
|
+
const retired = this.entityOf(patch.kind)?.retiredFields;
|
|
92217
|
+
if (!retired || !isPlainObject(patch.data)) return patch;
|
|
92218
|
+
const stored = snapshot.get(patch.kind, patch.path)?.toJSON();
|
|
92219
|
+
const data = withEmptiedContainersCleared({
|
|
92220
|
+
delta: keptThroughContainerWrite({
|
|
92221
|
+
delta: patch.data,
|
|
92222
|
+
retired,
|
|
92223
|
+
stored
|
|
92224
|
+
}),
|
|
92225
|
+
retired,
|
|
92226
|
+
stored
|
|
92227
|
+
});
|
|
92228
|
+
return data === patch.data ? patch : {
|
|
92229
|
+
...patch,
|
|
92230
|
+
data
|
|
92231
|
+
};
|
|
92232
|
+
}
|
|
92233
|
+
/** `kind`, or the kind it names now when it's a retired name ({@link EntityKind.retiredKinds}). */
|
|
92234
|
+
currentKind(kind) {
|
|
92235
|
+
if (this.state.entities.has(kind)) return kind;
|
|
92236
|
+
const cached2 = retiredKindsByEntities.get(this.state.entities);
|
|
92237
|
+
if (cached2) return cached2.get(kind) ?? kind;
|
|
92238
|
+
const retired = /* @__PURE__ */ new Map();
|
|
92239
|
+
for (const [name, entity] of this.state.entities) for (const old of entity.retiredKinds ?? []) retired.set(old, name);
|
|
92240
|
+
retiredKindsByEntities.set(this.state.entities, retired);
|
|
92241
|
+
return retired.get(kind) ?? kind;
|
|
92100
92242
|
}
|
|
92101
92243
|
/** Every key a style rule's layer bag takes that a kind owns, with the kind that owns it. See
|
|
92102
92244
|
* {@link LayerKey}. */
|
|
@@ -92158,12 +92300,16 @@ var Config = class Config2 {
|
|
|
92158
92300
|
*
|
|
92159
92301
|
* The single-op half of {@link run}, which is the door a caller uses.
|
|
92160
92302
|
*/
|
|
92161
|
-
dispatch(
|
|
92162
|
-
const
|
|
92303
|
+
dispatch(written, id) {
|
|
92304
|
+
const kind = this.currentKind(written.kind);
|
|
92305
|
+
const op = kind === written.kind ? written : {
|
|
92306
|
+
...written,
|
|
92307
|
+
kind
|
|
92308
|
+
};
|
|
92163
92309
|
const verb = opVerb(op);
|
|
92164
92310
|
const entry = kind === "config" ? configSchemas(this.name)[verb] : this.entityOf(kind)?.schemas[verb];
|
|
92165
92311
|
if (!entry?.handler) reject("UNSUPPORTED", `${kind} has no ${verb} operation`);
|
|
92166
|
-
const input2 = this.wholeBodyShorthand(kind, verb, op);
|
|
92312
|
+
const input2 = this.underCurrentFields(kind, verb, this.wholeBodyShorthand(kind, verb, op));
|
|
92167
92313
|
let schema = resolveInputSchema(entry.input, {
|
|
92168
92314
|
config: this,
|
|
92169
92315
|
body: input2.data
|
|
@@ -92175,6 +92321,30 @@ var Config = class Config2 {
|
|
|
92175
92321
|
return this.named(produced, { id });
|
|
92176
92322
|
}
|
|
92177
92323
|
/**
|
|
92324
|
+
* An op's input with any field the kind has moved (`EntityKind.retiredFields`) written at its
|
|
92325
|
+
* current path: folded into a whole body, renamed in an update's delta. A member op addresses a
|
|
92326
|
+
* sub-collection, which no retired field names.
|
|
92327
|
+
*/
|
|
92328
|
+
underCurrentFields(kind, verb, input2) {
|
|
92329
|
+
const retired = this.entityOf(kind)?.retiredFields;
|
|
92330
|
+
if (!retired || !isPlainObject(input2.data)) return input2;
|
|
92331
|
+
if (verb === "create" || verb === "replace") return {
|
|
92332
|
+
...input2,
|
|
92333
|
+
data: foldRetiredFields({
|
|
92334
|
+
body: input2.data,
|
|
92335
|
+
retired
|
|
92336
|
+
})
|
|
92337
|
+
};
|
|
92338
|
+
if (verb === "update") return {
|
|
92339
|
+
...input2,
|
|
92340
|
+
data: deltaUnderCurrentFields({
|
|
92341
|
+
delta: input2.data,
|
|
92342
|
+
retired
|
|
92343
|
+
})
|
|
92344
|
+
};
|
|
92345
|
+
return input2;
|
|
92346
|
+
}
|
|
92347
|
+
/**
|
|
92178
92348
|
* A whole-body op's input with a bare ref put in the kind's primary field, so an op takes the same
|
|
92179
92349
|
* shorthand `apply` does (`wholeBodyChange`): `Token.ref('x@ds')` is a token body at either door.
|
|
92180
92350
|
* Anything else is handed back as it came.
|
|
@@ -92471,7 +92641,7 @@ var Config = class Config2 {
|
|
|
92471
92641
|
* in.
|
|
92472
92642
|
*
|
|
92473
92643
|
* Checked rather than assumed. "The slug namespace is flat" is a property of the ref grammar, and
|
|
92474
|
-
* nothing was making the data honour it: a config declaring `
|
|
92644
|
+
* nothing was making the data honour it: a config declaring `sources: { ds }` and
|
|
92475
92645
|
* `linkedPackages: { ds }` registered clean, `sourceSlugs()` answered `['ds', 'ds']`, and every read
|
|
92476
92646
|
* through `@ds` picked a winner. Unreachable while a config declares one source kind, and the first
|
|
92477
92647
|
* thing to go wrong the day it declares two — which is exactly what `sources` exists to allow.
|
|
@@ -92531,7 +92701,7 @@ var Config = class Config2 {
|
|
|
92531
92701
|
* `apply` and {@link run} are two doors on one wall. A {@link Patch} is one of the framework's own
|
|
92532
92702
|
* verbs (`create`, `update`, `rename`, `sub-update`, …) with its body already in stored shape, and
|
|
92533
92703
|
* `apply` performs exactly that one and records it. A {@link ConfigOp} is anything the catalog
|
|
92534
|
-
* addresses — those same verbs, and custom ops such as `
|
|
92704
|
+
* addresses — those same verbs, and custom ops such as `source/copy` that decompose into
|
|
92535
92705
|
* several patches — and `run` parses its input against the op's own schema and hands it to the op's
|
|
92536
92706
|
* handler, which for a standard verb is a call to `apply`. So `apply` is what a handler and a
|
|
92537
92707
|
* replay call, and `run` is what a caller calls: a tool, an editor gesture, a commit. A caller
|
|
@@ -92553,7 +92723,8 @@ var Config = class Config2 {
|
|
|
92553
92723
|
* A delete records more than one patch when items declare they cannot outlive the target
|
|
92554
92724
|
* ({@link EntityKind.structuralBody}): a delete per dependent, leaves first, then the target, as
|
|
92555
92725
|
* one changeset. `id` then names the first of them and the changeset. */
|
|
92556
|
-
apply(
|
|
92726
|
+
apply(written, id) {
|
|
92727
|
+
const patch = this.patchUnderCurrentKind(written);
|
|
92557
92728
|
const dependents = this.structuralDependentsOf({ patch });
|
|
92558
92729
|
if (dependents.length === 0) return this.applyRecorded(patch, id);
|
|
92559
92730
|
const since = this.state.pending.length;
|
|
@@ -92567,7 +92738,8 @@ var Config = class Config2 {
|
|
|
92567
92738
|
* patch as it was recorded, since a recorded delete's cascade was recorded beside it, ahead of it.
|
|
92568
92739
|
* Deleting again what the base gained since would remove it with no patch saying so.
|
|
92569
92740
|
*/
|
|
92570
|
-
applyRecorded(
|
|
92741
|
+
applyRecorded(written, id) {
|
|
92742
|
+
const patch = this.patchUnderCurrentKind(written);
|
|
92571
92743
|
const deferred = this.state.deferredInvariants;
|
|
92572
92744
|
if (deferred?.open) deferred.kinds.add(patch.kind);
|
|
92573
92745
|
const applied3 = this.applyPatch(patch, id, !deferred?.open);
|
|
@@ -92622,7 +92794,8 @@ var Config = class Config2 {
|
|
|
92622
92794
|
}
|
|
92623
92795
|
}
|
|
92624
92796
|
/** {@link apply}, with the kind's invariants judged now or left to the batch that called this. */
|
|
92625
|
-
applyPatch(
|
|
92797
|
+
applyPatch(written, id, checked) {
|
|
92798
|
+
const patch = this.patchUnderCurrentKind(written);
|
|
92626
92799
|
const snapshot = this.computeApply(this.state.snapshot, patch, "write", checked);
|
|
92627
92800
|
const sourceIdentity = this.entityOf(patch.kind)?.sourceIdentity;
|
|
92628
92801
|
let { recorded, sources, sourceStates } = this.state;
|
|
@@ -92671,7 +92844,7 @@ var Config = class Config2 {
|
|
|
92671
92844
|
*/
|
|
92672
92845
|
applyAll(requested) {
|
|
92673
92846
|
if (requested.length === 0) return this;
|
|
92674
|
-
const patches = this.withStructuralDependents(requested);
|
|
92847
|
+
const patches = this.withStructuralDependents(requested.map((patch) => this.patchUnderCurrentKind(patch)));
|
|
92675
92848
|
const changeset = patches.length > 1 ? crypto.randomUUID() : void 0;
|
|
92676
92849
|
const stampOf = (patch) => stamp(patch, void 0, changeset);
|
|
92677
92850
|
const touched = new Set(patches.map((patch) => patch.kind));
|
|
@@ -93152,7 +93325,8 @@ var Config = class Config2 {
|
|
|
93152
93325
|
}));
|
|
93153
93326
|
}
|
|
93154
93327
|
/** The next snapshot for one patch, validated. Pure in `snapshot`; reads metadata off `this`. */
|
|
93155
|
-
computeApply(snapshot,
|
|
93328
|
+
computeApply(snapshot, written, mode = "write", checked = true) {
|
|
93329
|
+
const incoming = this.patchAsItLands(this.patchUnderCurrentKind(written), snapshot);
|
|
93156
93330
|
const unitChange = incoming.kind === "style-property" && incoming.operation === "update" ? {
|
|
93157
93331
|
path: incoming.path,
|
|
93158
93332
|
was: stylePropNumberUnit(this.viewOf(snapshot), incoming.path)
|
|
@@ -93407,10 +93581,14 @@ var Config = class Config2 {
|
|
|
93407
93581
|
}
|
|
93408
93582
|
const parsed = updateSchema.safeParse(checked);
|
|
93409
93583
|
if (!parsed.success) rejectInvalid(context, parsed.error);
|
|
93410
|
-
const
|
|
93584
|
+
const parsedDelta = {
|
|
93411
93585
|
...parsed.data,
|
|
93412
93586
|
...reveals
|
|
93413
93587
|
};
|
|
93588
|
+
const delta = entry.retiredFields ? withoutClearsInsideClears({
|
|
93589
|
+
delta: parsedDelta,
|
|
93590
|
+
retired: entry.retiredFields
|
|
93591
|
+
}) : parsedDelta;
|
|
93414
93592
|
const touched = touchedFields(delta, isField2);
|
|
93415
93593
|
if (extension) {
|
|
93416
93594
|
const resolved = this.at(snapshot).resolveExtension({
|
|
@@ -94153,7 +94331,8 @@ var Config = class Config2 {
|
|
|
94153
94331
|
});
|
|
94154
94332
|
return new Entity(path2, withComputed, [...entry.fieldKeys, ...Object.keys(computed)]);
|
|
94155
94333
|
}
|
|
94156
|
-
resolve(
|
|
94334
|
+
resolve(written, path2) {
|
|
94335
|
+
const kind = this.currentKind(written);
|
|
94157
94336
|
const cache = this.caches.entities;
|
|
94158
94337
|
const key2 = `${kind}\0${path2}`;
|
|
94159
94338
|
const cached2 = cache.get(key2);
|
|
@@ -94569,13 +94748,13 @@ var Config = class Config2 {
|
|
|
94569
94748
|
* accessor name, then by the item's slug:
|
|
94570
94749
|
*
|
|
94571
94750
|
* ```ts
|
|
94572
|
-
* Config.registerSources({
|
|
94751
|
+
* Config.registerSources({ sources: { yos: yahooOs } })
|
|
94573
94752
|
* ```
|
|
94574
94753
|
*
|
|
94575
|
-
* The same two levels `register` takes (`{
|
|
94754
|
+
* The same two levels `register` takes (`{ sources: { yos: Source.item(…) } }`) and the
|
|
94576
94755
|
* same two `fromJSON(json, { sources })` takes, so one gesture — declare a source, then hand
|
|
94577
94756
|
* over what it resolved to — reads identically at all three. A flat `{ yos }` said nothing about
|
|
94578
|
-
* which collection `yos` came from, which is fine while `
|
|
94757
|
+
* which collection `yos` came from, which is fine while `source` is the only source kind and
|
|
94579
94758
|
* wrong the day there is a second.
|
|
94580
94759
|
*
|
|
94581
94760
|
* Immutable like every other authoring step: the sources ride on the derived config, and every later
|
|
@@ -94745,7 +94924,7 @@ var Config = class Config2 {
|
|
|
94745
94924
|
*
|
|
94746
94925
|
* Answers the slug, which is the kind-agnostic half and therefore the half that belongs here. Turning
|
|
94747
94926
|
* a slug into the typed pin behind it is the source kind's own business (`sourceOfGroup` beside
|
|
94748
|
-
* `
|
|
94927
|
+
* `Source`) — a `Config` method could only hand back a bare `Entity`, and the rule above would
|
|
94749
94928
|
* then be stated once per source kind instead of once.
|
|
94750
94929
|
*/
|
|
94751
94930
|
groupSource({ kind, groupPath }) {
|
|
@@ -94844,7 +95023,7 @@ var Config = class Config2 {
|
|
|
94844
95023
|
* stores, so refusing on that shape would lock a pointer we declared. See `borrowedSlug`.
|
|
94845
95024
|
*/
|
|
94846
95025
|
/**
|
|
94847
|
-
* The pin whose `
|
|
95026
|
+
* The pin whose `options.include` covers `kind:path` and whose source has a row there, so the build
|
|
94848
95027
|
* mints the source's row at the path on its next pass. `undefined` when no declaration covers the
|
|
94849
95028
|
* path, or the declaring source is attached and lacks it. A source that isn't attached is taken at
|
|
94850
95029
|
* its declaration's word.
|
|
@@ -94948,16 +95127,17 @@ var Config = class Config2 {
|
|
|
94948
95127
|
path: path2,
|
|
94949
95128
|
overlay: null
|
|
94950
95129
|
});
|
|
94951
|
-
const
|
|
94952
|
-
accessor,
|
|
94953
|
-
path: path2,
|
|
94954
|
-
overlay: null
|
|
94955
|
-
}))[0]?.split(".")[0];
|
|
94956
|
-
return field ? { [field]: null } : write({
|
|
95130
|
+
const clear = write({
|
|
94957
95131
|
accessor,
|
|
94958
95132
|
path: path2,
|
|
94959
95133
|
overlay: null
|
|
94960
95134
|
});
|
|
95135
|
+
const field = Object.keys(clear)[0]?.split(".")[0];
|
|
95136
|
+
if (!field) return clear;
|
|
95137
|
+
const sourceKind = this.sourceKindFor(slug2);
|
|
95138
|
+
const body = sourceKind ? this.storedBody(sourceKind, slug2) : void 0;
|
|
95139
|
+
const left = isPlainObject(body) ? applyPathDelta(body, clear, () => true)[field] : void 0;
|
|
95140
|
+
return isPlainObject(left) && Object.keys(left).length > 0 ? clear : { [field]: null };
|
|
94961
95141
|
}
|
|
94962
95142
|
/**
|
|
94963
95143
|
* Every path a declared source's declaration says something about, with the accessor resolved to the
|
|
@@ -94988,7 +95168,7 @@ var Config = class Config2 {
|
|
|
94988
95168
|
return found;
|
|
94989
95169
|
}
|
|
94990
95170
|
/**
|
|
94991
|
-
* Whether one of a declared source's paths is adopted here — covered by the pin's `
|
|
95171
|
+
* Whether one of a declared source's paths is adopted here — covered by the pin's `options.include`.
|
|
94992
95172
|
*
|
|
94993
95173
|
* The question a spelling turns on: an adopted path is addressed bare, because the build mints a
|
|
94994
95174
|
* row for it at the path the source spells, and everything else is addressed qualified. The two are
|
|
@@ -95915,7 +96095,7 @@ var Config = class Config2 {
|
|
|
95915
96095
|
}
|
|
95916
96096
|
if (collides) rejectCollisions(derivation.collisions);
|
|
95917
96097
|
if (stranded.length === 0) return;
|
|
95918
|
-
reject("REFERRERS_BLOCK", `Cannot ${action} \u2014 it would take away ${stranded.join("; ")}. Copy what is used first (\`
|
|
96098
|
+
reject("REFERRERS_BLOCK", `Cannot ${action} \u2014 it would take away ${stranded.join("; ")}. Copy what is used first (\`source/copy\`), or break the link keeping its values (\`source/break\` with \`keep: true\`).`);
|
|
95919
96099
|
}
|
|
95920
96100
|
/**
|
|
95921
96101
|
* Whether every directive of `pin` that names `target` sits on a path that no longer derives through
|
|
@@ -96881,7 +97061,7 @@ var Config = class Config2 {
|
|
|
96881
97061
|
* in which fields they set are different sources, and collapsing them would share one cache entry.
|
|
96882
97062
|
*
|
|
96883
97063
|
* Derived rather than spelled, which is what makes it right for kinds nobody has written — it covers
|
|
96884
|
-
* whatever fields a kind actually declares instead of the three `
|
|
97064
|
+
* whatever fields a kind actually declares instead of the three `source` happens to have. The
|
|
96885
97065
|
* key it replaces was `${systemId}@${version}`, which a repo-local source cannot state at all;
|
|
96886
97066
|
* that is the case the walk using it had to pre-skip.
|
|
96887
97067
|
*/
|
|
@@ -96909,7 +97089,7 @@ var Config = class Config2 {
|
|
|
96909
97089
|
*
|
|
96910
97090
|
* A row borrowed or copied through a pin is asked of that pin's source in turn, so a system linked
|
|
96911
97091
|
* to a system linked to a foundation answers with the foundation. A row a materialized artifact
|
|
96912
|
-
* flattened to a literal has no pointer left, so the pin whose `
|
|
97092
|
+
* flattened to a literal has no pointer left, so the pin whose `options.include` covers the path
|
|
96913
97093
|
* stands in, provided the row still reads as the source's ({@link matchesSource}); one the
|
|
96914
97094
|
* publisher changed is its own, and so is a linked row this config lays a value of its own over: the
|
|
96915
97095
|
* Bridge's `spectrum/blue/0` points at Yahoo OS's with the Bridge's colours on it, which is the
|
|
@@ -96952,7 +97132,7 @@ var Config = class Config2 {
|
|
|
96952
97132
|
}
|
|
96953
97133
|
}
|
|
96954
97134
|
/**
|
|
96955
|
-
* The pin whose `
|
|
97135
|
+
* The pin whose `options.include` covers `kind:path` while the row there still reads as that
|
|
96956
97136
|
* source's: how a row a materialized artifact flattened to a literal is traced back to the pin it
|
|
96957
97137
|
* came through. `undefined` when no declaration covers it, or the row differs from the source's.
|
|
96958
97138
|
*/
|
|
@@ -97021,8 +97201,8 @@ var Config = class Config2 {
|
|
|
97021
97201
|
return this.sourceKinds().find((kind) => this.storedBody(kind, slug2) !== void 0);
|
|
97022
97202
|
}
|
|
97023
97203
|
/**
|
|
97024
|
-
* Every source kind by the accessor name its config type declares it under — `
|
|
97025
|
-
* `
|
|
97204
|
+
* Every source kind by the accessor name its config type declares it under — `sources` →
|
|
97205
|
+
* `source`.
|
|
97026
97206
|
*
|
|
97027
97207
|
* The accessor name is what every source-shaped argument is keyed by ({@link AttachedSources},
|
|
97028
97208
|
* `register`, `Config.load`'s resolvers), because it's the name an author writes, where the kind is
|
|
@@ -97194,7 +97374,8 @@ var Config = class Config2 {
|
|
|
97194
97374
|
* {@link retired} answers true for. Both answers are cached per snapshot, so either is safe in a dep
|
|
97195
97375
|
* array.
|
|
97196
97376
|
*/
|
|
97197
|
-
list(
|
|
97377
|
+
list(written, opts) {
|
|
97378
|
+
const kind = this.currentKind(written);
|
|
97198
97379
|
const all = this.allOf(kind);
|
|
97199
97380
|
if (opts?.retired !== false) return all;
|
|
97200
97381
|
const cache = this.caches.activeLists;
|
|
@@ -97370,9 +97551,9 @@ var Config = class Config2 {
|
|
|
97370
97551
|
* every sourced ref dangles, and emitters, integrity checks and memos all read exactly there.
|
|
97371
97552
|
*
|
|
97372
97553
|
* `sources` is keyed the way every other source-shaped argument is — by the source kind's accessor
|
|
97373
|
-
* name, `{
|
|
97554
|
+
* name, `{ sources: resolver }` — so the resolver set, the declaration, and
|
|
97374
97555
|
* {@link registerSources} all spell the same key. Each resolver is the kind's own
|
|
97375
|
-
* (`
|
|
97556
|
+
* (`SystemSourceResolver`), and its answer is validated against the schemas that kind declares.
|
|
97376
97557
|
*
|
|
97377
97558
|
* Reads the source entities off a throwaway bare parse, resolves them all, then hydrates once with
|
|
97378
97559
|
* whatever came back attached. The bare parse is cheap and is what lets a resolver be handed the
|
|
@@ -97585,7 +97766,7 @@ var Config = class Config2 {
|
|
|
97585
97766
|
* links from the provided sources. A declared `linkedKind` with no provided source throws. */
|
|
97586
97767
|
hydrateFrom(stored, options) {
|
|
97587
97768
|
const claimed = schemaVersionOf(stored);
|
|
97588
|
-
if (claimed >
|
|
97769
|
+
if (claimed > 20261105185042) throw new SchemaVersionTooNew(claimed);
|
|
97589
97770
|
const wire = upgradeSerializedConfig(stored);
|
|
97590
97771
|
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.`);
|
|
97591
97772
|
const leftover = wire.options;
|
|
@@ -97826,9 +98007,9 @@ function extensionChange(entry, kind, path2, raw, validate2 = false) {
|
|
|
97826
98007
|
function itemChange(entry, kind, path2, raw, validate2 = false) {
|
|
97827
98008
|
const body = isRef2(raw) || isComposedValue(raw) || typeof raw !== "object" || raw === null ? { [entry.primaryField]: raw } : raw;
|
|
97828
98009
|
let def = validate2 === "author" && entry.authoredBody ? entry.authoredBody(body) : body;
|
|
97829
|
-
if (validate2 === "author" && entry.
|
|
98010
|
+
if (validate2 === "author" && entry.retiredFields) def = foldRetiredFields({
|
|
97830
98011
|
body: def,
|
|
97831
|
-
|
|
98012
|
+
retired: entry.retiredFields
|
|
97832
98013
|
});
|
|
97833
98014
|
if (validate2) {
|
|
97834
98015
|
const parsed = wholeBodySchema(entry)?.safeParse(def);
|
|
@@ -98282,11 +98463,28 @@ function componentModuleFilePaths(config2, filePath) {
|
|
|
98282
98463
|
}
|
|
98283
98464
|
|
|
98284
98465
|
// ../config/dist/entities/system/link-declaration.js
|
|
98285
|
-
var PIN_KIND = "
|
|
98466
|
+
var PIN_KIND = "source";
|
|
98467
|
+
var INCLUDE = "include";
|
|
98468
|
+
function includeOf(body) {
|
|
98469
|
+
const options = isPlainObject(body) ? body.options : void 0;
|
|
98470
|
+
return isPlainObject(options) ? options[INCLUDE] : void 0;
|
|
98471
|
+
}
|
|
98472
|
+
function directivesOf(body) {
|
|
98473
|
+
const options = isPlainObject(body) ? body.options : void 0;
|
|
98474
|
+
if (!isPlainObject(options)) return [];
|
|
98475
|
+
return Object.entries(options).filter(([key2]) => key2 !== INCLUDE);
|
|
98476
|
+
}
|
|
98477
|
+
function includeWrite({ body, declared: declared2 }) {
|
|
98478
|
+
if (declared2 !== void 0 && declared2 !== null) return { [`options.${INCLUDE}`]: declared2 };
|
|
98479
|
+
return directivesOf(body).length === 0 ? {
|
|
98480
|
+
[`options.${INCLUDE}`]: null,
|
|
98481
|
+
options: null
|
|
98482
|
+
} : { [`options.${INCLUDE}`]: null };
|
|
98483
|
+
}
|
|
98286
98484
|
function declarationOf(config2, slug2) {
|
|
98287
98485
|
const pin = config2.storedBody(PIN_KIND, slug2);
|
|
98288
98486
|
if (!pin) rejectData(`No linked system "${slug2}".`);
|
|
98289
|
-
return pin
|
|
98487
|
+
return includeOf(pin);
|
|
98290
98488
|
}
|
|
98291
98489
|
var EXCLUDE = "!";
|
|
98292
98490
|
var reaches2 = (entry, path2) => entry === "*" || entry === path2 || path2.startsWith(`${entry}/`);
|
|
@@ -98824,7 +99022,10 @@ function planCopy({ config: config2, input: input2 }) {
|
|
|
98824
99022
|
kind: PIN_KIND,
|
|
98825
99023
|
operation: "update",
|
|
98826
99024
|
path: slug2,
|
|
98827
|
-
data: {
|
|
99025
|
+
data: { ...includeWrite({
|
|
99026
|
+
body: config2.storedBody(PIN_KIND, slug2),
|
|
99027
|
+
declared: next ?? null
|
|
99028
|
+
}) }
|
|
98828
99029
|
});
|
|
98829
99030
|
}
|
|
98830
99031
|
}
|
|
@@ -99070,7 +99271,10 @@ function planLinkApplied({ config: config2, input: input2 }) {
|
|
|
99070
99271
|
kind: PIN_KIND,
|
|
99071
99272
|
operation: "update",
|
|
99072
99273
|
path: slug2,
|
|
99073
|
-
data: {
|
|
99274
|
+
data: { ...includeWrite({
|
|
99275
|
+
body: config2.storedBody(PIN_KIND, slug2),
|
|
99276
|
+
declared: "*"
|
|
99277
|
+
}) }
|
|
99074
99278
|
});
|
|
99075
99279
|
} else {
|
|
99076
99280
|
const next = { ...current ?? {} };
|
|
@@ -99101,7 +99305,7 @@ function planLinkApplied({ config: config2, input: input2 }) {
|
|
|
99101
99305
|
kind: PIN_KIND,
|
|
99102
99306
|
operation: "update",
|
|
99103
99307
|
path: slug2,
|
|
99104
|
-
data: { [`
|
|
99308
|
+
data: { [`options.${INCLUDE}.${accessor}`]: value }
|
|
99105
99309
|
});
|
|
99106
99310
|
}
|
|
99107
99311
|
declared2 = Object.keys(next).length === 0 ? current : next;
|
|
@@ -99303,7 +99507,7 @@ function directivesTakenFrom({ config: config2, slug: slug2, after: after5 }) {
|
|
|
99303
99507
|
}
|
|
99304
99508
|
const edits = [];
|
|
99305
99509
|
for (const pin of new Set(dropped.map((at) => at.from))) {
|
|
99306
|
-
const options = config2.storedBody("
|
|
99510
|
+
const options = config2.storedBody("source", pin).options ?? {};
|
|
99307
99511
|
const data = {};
|
|
99308
99512
|
let emptied = 0;
|
|
99309
99513
|
for (const [accessor, entries] of Object.entries(options)) {
|
|
@@ -99399,7 +99603,10 @@ function planUnlink({ config: config2, input: input2 }) {
|
|
|
99399
99603
|
kind: PIN_KIND,
|
|
99400
99604
|
operation: "update",
|
|
99401
99605
|
path: slug2,
|
|
99402
|
-
data: {
|
|
99606
|
+
data: { ...includeWrite({
|
|
99607
|
+
body: config2.storedBody(PIN_KIND, slug2),
|
|
99608
|
+
declared: null
|
|
99609
|
+
}) }
|
|
99403
99610
|
});
|
|
99404
99611
|
} else {
|
|
99405
99612
|
const removal = /* @__PURE__ */ new Map();
|
|
@@ -99432,7 +99639,10 @@ function planUnlink({ config: config2, input: input2 }) {
|
|
|
99432
99639
|
kind: PIN_KIND,
|
|
99433
99640
|
operation: "update",
|
|
99434
99641
|
path: slug2,
|
|
99435
|
-
data: {
|
|
99642
|
+
data: { ...includeWrite({
|
|
99643
|
+
body: config2.storedBody(PIN_KIND, slug2),
|
|
99644
|
+
declared: declared2 === void 0 ? null : declared2
|
|
99645
|
+
}) }
|
|
99436
99646
|
});
|
|
99437
99647
|
}
|
|
99438
99648
|
let after5;
|
|
@@ -99464,8 +99674,20 @@ function planUnlink({ config: config2, input: input2 }) {
|
|
|
99464
99674
|
}) : [];
|
|
99465
99675
|
if (dropped.length > 0) {
|
|
99466
99676
|
const update = patches[patches.length - 1];
|
|
99467
|
-
|
|
99468
|
-
|
|
99677
|
+
const all = config2.sourceDirectives(slug2).every((directive) => dropped.some((gone) => gone.accessor === directive.accessor && gone.path === directive.path));
|
|
99678
|
+
patches[patches.length - 1] = all && declared2 === void 0 ? {
|
|
99679
|
+
...update,
|
|
99680
|
+
data: {
|
|
99681
|
+
[`options.${INCLUDE}`]: null,
|
|
99682
|
+
options: null
|
|
99683
|
+
}
|
|
99684
|
+
} : {
|
|
99685
|
+
...update,
|
|
99686
|
+
data: {
|
|
99687
|
+
...update.data,
|
|
99688
|
+
...Object.fromEntries(dropped.map(({ accessor, path: path2 }) => [`options.${accessor}.${path2}`, null]))
|
|
99689
|
+
}
|
|
99690
|
+
};
|
|
99469
99691
|
}
|
|
99470
99692
|
return {
|
|
99471
99693
|
declared: declared2,
|
|
@@ -99507,8 +99729,7 @@ function planExclude({ config: config2, input: input2 }) {
|
|
|
99507
99729
|
const declared2 = next;
|
|
99508
99730
|
const dropped = [];
|
|
99509
99731
|
const optionDeletes = {};
|
|
99510
|
-
const
|
|
99511
|
-
for (const [accessor, entries] of Object.entries(options)) {
|
|
99732
|
+
for (const [accessor, entries] of directivesOf(config2.storedBody(PIN_KIND, slug2))) {
|
|
99512
99733
|
if (!entries || typeof entries !== "object") continue;
|
|
99513
99734
|
const kind = config2.accessors()[accessor]?.kind ?? accessor;
|
|
99514
99735
|
for (const path2 of Object.keys(entries)) {
|
|
@@ -99529,7 +99750,10 @@ function planExclude({ config: config2, input: input2 }) {
|
|
|
99529
99750
|
operation: "update",
|
|
99530
99751
|
path: slug2,
|
|
99531
99752
|
data: {
|
|
99532
|
-
|
|
99753
|
+
...includeWrite({
|
|
99754
|
+
body: config2.storedBody(PIN_KIND, slug2),
|
|
99755
|
+
declared: declared2
|
|
99756
|
+
}),
|
|
99533
99757
|
...optionDeletes
|
|
99534
99758
|
}
|
|
99535
99759
|
}];
|
|
@@ -99706,7 +99930,10 @@ function planBreak({ config: config2, input: input2 }) {
|
|
|
99706
99930
|
kind: PIN_KIND,
|
|
99707
99931
|
operation: "update",
|
|
99708
99932
|
path: slug2,
|
|
99709
|
-
data: {
|
|
99933
|
+
data: { ...includeWrite({
|
|
99934
|
+
body: config2.storedBody(PIN_KIND, slug2),
|
|
99935
|
+
declared: null
|
|
99936
|
+
}) }
|
|
99710
99937
|
}], {
|
|
99711
99938
|
kind: PIN_KIND,
|
|
99712
99939
|
operation: "delete",
|
|
@@ -99847,7 +100074,7 @@ function planBreak({ config: config2, input: input2 }) {
|
|
|
99847
100074
|
});
|
|
99848
100075
|
}
|
|
99849
100076
|
for (const folder of plan.folders) released.add(`${folder.kind}:${folder.path}`);
|
|
99850
|
-
patches.push(...plan.patches.filter((patch) => scoped || !(patch.kind === "
|
|
100077
|
+
patches.push(...plan.patches.filter((patch) => scoped || !(patch.kind === "source" && patch.operation === "update")));
|
|
99851
100078
|
});
|
|
99852
100079
|
if (copyBlocked !== void 0) return {
|
|
99853
100080
|
rows,
|
|
@@ -99877,7 +100104,10 @@ function planBreak({ config: config2, input: input2 }) {
|
|
|
99877
100104
|
kind: PIN_KIND,
|
|
99878
100105
|
operation: "update",
|
|
99879
100106
|
path: slug2,
|
|
99880
|
-
data: {
|
|
100107
|
+
data: { ...includeWrite({
|
|
100108
|
+
body: config2.storedBody(PIN_KIND, slug2),
|
|
100109
|
+
declared: null
|
|
100110
|
+
}) }
|
|
99881
100111
|
});
|
|
99882
100112
|
patches.push({
|
|
99883
100113
|
kind: PIN_KIND,
|
|
@@ -100023,7 +100253,7 @@ function rowStateOf({ config: config2, derived, source, slug: slug2, kind, node:
|
|
|
100023
100253
|
};
|
|
100024
100254
|
}
|
|
100025
100255
|
|
|
100026
|
-
// ../config/dist/entities/system/
|
|
100256
|
+
// ../config/dist/entities/system/Source.js
|
|
100027
100257
|
var EXACT_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
100028
100258
|
var LINK_SLUG = /^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/i;
|
|
100029
100259
|
function isLinkSlug(slug2) {
|
|
@@ -100031,7 +100261,7 @@ function isLinkSlug(slug2) {
|
|
|
100031
100261
|
}
|
|
100032
100262
|
function freeExampleSlug(config2, besides) {
|
|
100033
100263
|
let slug2 = "design-system";
|
|
100034
|
-
for (let n = 2; slug2 === besides || config2.resolve("
|
|
100264
|
+
for (let n = 2; slug2 === besides || config2.resolve("source", slug2); n += 1) slug2 = `design-system-${n}`;
|
|
100035
100265
|
return slug2;
|
|
100036
100266
|
}
|
|
100037
100267
|
function renameExample({ config: config2, path: path2 }) {
|
|
@@ -100075,9 +100305,9 @@ var sourceUnavailable = external_exports.discriminatedUnion("code", [
|
|
|
100075
100305
|
]);
|
|
100076
100306
|
var copyPaths = external_exports.union([external_exports.literal("*"), external_exports.array(external_exports.string().min(1)).min(1)]);
|
|
100077
100307
|
var copyInput = external_exports.object({
|
|
100078
|
-
path: pathInput("
|
|
100308
|
+
path: pathInput("source"),
|
|
100079
100309
|
/**
|
|
100080
|
-
* What to take, keyed by accessor the way the pin's `
|
|
100310
|
+
* What to take, keyed by accessor the way the pin's `options.include` is — `{ tokens: ['color/brand', 'color'],
|
|
100081
100311
|
* icons: '*' }` — or `'*'` for every kind the source offers and this config can hold. A path that
|
|
100082
100312
|
* names a folder in the source takes its members. Copied rows keep the source's own names.
|
|
100083
100313
|
*/
|
|
@@ -100091,8 +100321,8 @@ var copyInput = external_exports.object({
|
|
|
100091
100321
|
onConflict: external_exports.enum(["skip", "replace"]).optional()
|
|
100092
100322
|
});
|
|
100093
100323
|
var linkInput = external_exports.object({
|
|
100094
|
-
path: pathInput("
|
|
100095
|
-
/** What to draw, keyed by accessor the way the pin's `
|
|
100324
|
+
path: pathInput("source"),
|
|
100325
|
+
/** What to draw, keyed by accessor the way the pin's `options.include` is, or `'*'` for everything the source
|
|
100096
100326
|
* offers. A path that names a folder in the source covers its members. */
|
|
100097
100327
|
data: external_exports.union([external_exports.literal("*"), external_exports.record(external_exports.string(), copyPaths)]),
|
|
100098
100328
|
/** What to do at a path another linked system provides: `'take'` makes it follow this source,
|
|
@@ -100109,28 +100339,28 @@ var linkInput = external_exports.object({
|
|
|
100109
100339
|
replace: external_exports.record(external_exports.string(), external_exports.record(external_exports.string().min(1), external_exports.string().min(1))).optional()
|
|
100110
100340
|
});
|
|
100111
100341
|
var unlinkInput = external_exports.object({
|
|
100112
|
-
path: pathInput("
|
|
100342
|
+
path: pathInput("source"),
|
|
100113
100343
|
/** What to stop drawing, in `link`'s shape; everything when omitted. */
|
|
100114
100344
|
data: external_exports.union([external_exports.literal("*"), external_exports.record(external_exports.string(), copyPaths)]).optional()
|
|
100115
100345
|
});
|
|
100116
100346
|
var excludeInput = external_exports.object({
|
|
100117
|
-
path: pathInput("
|
|
100118
|
-
/** What to leave out, keyed by accessor the way the pin's `
|
|
100347
|
+
path: pathInput("source"),
|
|
100348
|
+
/** What to leave out, keyed by accessor the way the pin's `options.include` is: the source's paths, where a
|
|
100119
100349
|
* folder leaves out its members. */
|
|
100120
100350
|
data: external_exports.record(external_exports.string(), external_exports.array(external_exports.string().min(1)).min(1))
|
|
100121
100351
|
});
|
|
100122
100352
|
var breakInput = external_exports.object({
|
|
100123
|
-
path: pathInput("
|
|
100353
|
+
path: pathInput("source"),
|
|
100124
100354
|
/** Whether every value drawn through the pin becomes this config's own first. */
|
|
100125
100355
|
keep: external_exports.boolean()
|
|
100126
100356
|
});
|
|
100127
100357
|
var breakPlanInput = external_exports.object({
|
|
100128
|
-
path: pathInput("
|
|
100358
|
+
path: pathInput("source"),
|
|
100129
100359
|
keep: external_exports.boolean().optional(),
|
|
100130
100360
|
/** One entity or folder detached through `copy` rather than the whole pin. */
|
|
100131
100361
|
data: external_exports.union([external_exports.literal("*"), external_exports.record(external_exports.string(), copyPaths)]).optional()
|
|
100132
100362
|
});
|
|
100133
|
-
var rowsInput = external_exports.object({ path: pathInput("
|
|
100363
|
+
var rowsInput = external_exports.object({ path: pathInput("source") });
|
|
100134
100364
|
function copyInputOf(input2) {
|
|
100135
100365
|
return {
|
|
100136
100366
|
path: String(input2.path),
|
|
@@ -100193,20 +100423,22 @@ function exampleBorrowable(config2, slug2) {
|
|
|
100193
100423
|
};
|
|
100194
100424
|
}
|
|
100195
100425
|
}
|
|
100196
|
-
var
|
|
100426
|
+
var linkDeclarationSchema = external_exports.union([external_exports.literal("*"), external_exports.record(external_exports.string(), external_exports.union([external_exports.literal("*"), external_exports.array(external_exports.string().min(1)).min(1)]))]).describe("What this system draws from the source, standing: `'*'` for everything, or a record by kind (`'*'` keys every kind it doesn't name). A list's `'!path'` entry leaves that path out.");
|
|
100427
|
+
var pinOptions = external_exports.object({ include: linkDeclarationSchema.optional() }).catchall(external_exports.record(external_exports.string(), external_exports.strictObject({
|
|
100197
100428
|
override: external_exports.union([refSchema, external_exports.record(external_exports.string(), external_exports.unknown())]).optional(),
|
|
100198
100429
|
extend: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
100199
100430
|
hidden: external_exports.boolean().optional()
|
|
100200
|
-
}).refine((entry) => entry.override !== void 0 || entry.extend !== void 0 || entry.hidden !== void 0, { message: "An `options` entry needs `override`, `extend` or `hidden`." }))).optional().describe("
|
|
100201
|
-
var
|
|
100431
|
+
}).refine((entry) => entry.override !== void 0 || entry.extend !== void 0 || entry.hidden !== void 0, { message: "An `options` entry needs `override`, `extend` or `hidden`." }))).optional().describe("What the system includes from the source (`include`), and per-entity adjustments, keyed by accessor, then path, then verb.");
|
|
100432
|
+
var SOURCE_RETIRED_FIELDS = { link: "options.include" };
|
|
100202
100433
|
var LinkedSystemDefinition = defineEntity({
|
|
100203
|
-
kind: "
|
|
100204
|
-
label: "
|
|
100205
|
-
labelPlural: "
|
|
100434
|
+
kind: "source",
|
|
100435
|
+
label: "Source",
|
|
100436
|
+
labelPlural: "Sources",
|
|
100206
100437
|
entityName: "Source",
|
|
100207
|
-
|
|
100438
|
+
retiredKinds: ["linked-system"],
|
|
100439
|
+
retiredFields: SOURCE_RETIRED_FIELDS,
|
|
100208
100440
|
invariants: (config2) => [
|
|
100209
|
-
...config2.list("
|
|
100441
|
+
...config2.list("source").filter(({ path: path2 }) => !isLinkSlug(path2)).map(({ path: path2 }) => `Link "${path2}": ${LINK_SLUG_MESSAGE}`),
|
|
100210
100442
|
...linkRedirects(config2).filter((redirect) => redirect.problem !== void 0 && redirect.problem !== "missing").map(redirectSentence),
|
|
100211
100443
|
...excludedDirectives(config2)
|
|
100212
100444
|
],
|
|
@@ -100221,7 +100453,7 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100221
100453
|
rename: { example: renameExample },
|
|
100222
100454
|
"rename-plan": { example: renameExample },
|
|
100223
100455
|
/**
|
|
100224
|
-
* Draw entities from a linked system: the pin's `
|
|
100456
|
+
* Draw entities from a linked system: the pin's `options.include` declaration grows to cover them and the
|
|
100225
100457
|
* build mints a pointer row per entity, in this one op. A row of this config's own at a covered
|
|
100226
100458
|
* path is deleted so theirs shows through; a row held through another pin becomes an extension
|
|
100227
100459
|
* through this one when `onLinked` is `'take'`, and the other pin's `options` entry there goes with
|
|
@@ -100231,7 +100463,7 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100231
100463
|
input: linkInput,
|
|
100232
100464
|
readOnly: false,
|
|
100233
100465
|
label: "Link from",
|
|
100234
|
-
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 `
|
|
100466
|
+
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 `source/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`.",
|
|
100235
100467
|
scope: "item",
|
|
100236
100468
|
approval: "reference-change",
|
|
100237
100469
|
title: (entity) => `Link something from ${entity}`,
|
|
@@ -100312,7 +100544,7 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100312
100544
|
}
|
|
100313
100545
|
},
|
|
100314
100546
|
/**
|
|
100315
|
-
* Leave part of a linked system out for good: a `!` entry per path in the pin's `
|
|
100547
|
+
* Leave part of a linked system out for good: a `!` entry per path in the pin's `options.include`. Unlike
|
|
100316
100548
|
* `unlink`, nothing derives there however the link reaches it, and the linked tokens' overrides
|
|
100317
100549
|
* under an excluded modifier are left out of the build. `link` with the same path lifts it.
|
|
100318
100550
|
*/
|
|
@@ -100358,7 +100590,7 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100358
100590
|
input: breakInput,
|
|
100359
100591
|
readOnly: false,
|
|
100360
100592
|
label: "Break link",
|
|
100361
|
-
description: "Remove a linked system. With `keep: true` every value drawn through it is copied in as your own first, and a row of yours that pointed through the pin points at the copies; with `keep: false` the rows it minted go, and a row of yours still pointing through it refuses the break. Run `
|
|
100593
|
+
description: "Remove a linked system. With `keep: true` every value drawn through it is copied in as your own first, and a row of yours that pointed through the pin points at the copies; with `keep: false` the rows it minted go, and a row of yours still pointing through it refuses the break. Run `source/break-plan` first to see every row it reaches.",
|
|
100362
100594
|
scope: "item",
|
|
100363
100595
|
approval: "destructive",
|
|
100364
100596
|
title: (entity) => `Break the link to ${entity}`,
|
|
@@ -100429,7 +100661,7 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100429
100661
|
* `extend` laid over the source's body. A folder's meta comes with its members, so a label the
|
|
100430
100662
|
* folder was inheriting becomes its own.
|
|
100431
100663
|
*
|
|
100432
|
-
* `data` is keyed the way the pin's `
|
|
100664
|
+
* `data` is keyed the way the pin's `options.include` is: by accessor, then `'*'` for every entry of the kind
|
|
100433
100665
|
* or the source's paths — an item, or a folder, which takes its members. `'*'` alone takes every
|
|
100434
100666
|
* kind the source offers and this config can hold. Kinds taken in one edit are copied together,
|
|
100435
100667
|
* which is what lets a copied component point at the copied tokens rather than back through the
|
|
@@ -100442,7 +100674,7 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100442
100674
|
input: copyInput,
|
|
100443
100675
|
readOnly: false,
|
|
100444
100676
|
label: "Copy from",
|
|
100445
|
-
description: "Take entities from a linked system as your own, holding the values the source has now and no longer following it. `data` names them by accessor: `{ tokens: ['color/brand', 'color'] }` takes an entity and a folder's members, `{ tokens: '*' }` every token, and `'*'` the whole system. What a copied entity points at comes with it, so run `
|
|
100677
|
+
description: "Take entities from a linked system as your own, holding the values the source has now and no longer following it. `data` names them by accessor: `{ tokens: ['color/brand', 'color'] }` takes an entity and a folder's members, `{ tokens: '*' }` every token, and `'*'` the whole system. What a copied entity points at comes with it, so run `source/copy-plan` with the same input first and see everything that lands. To use theirs without owning it, declare it in the pin's `options.include` instead. A whole-system copy is thousands of rows, and on a repo-backed system each one is written into `uds.config.ts`.",
|
|
100446
100678
|
scope: "item",
|
|
100447
100679
|
approval: "reference-change",
|
|
100448
100680
|
title: (entity) => `Copy something from ${entity}`,
|
|
@@ -100491,9 +100723,9 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100491
100723
|
* rather than a silent wrong answer.
|
|
100492
100724
|
*
|
|
100493
100725
|
* ```ts
|
|
100494
|
-
*
|
|
100726
|
+
* sources: {
|
|
100495
100727
|
* ds: '../design-system/uds.config.ts', // repo-local
|
|
100496
|
-
* yahooOs:
|
|
100728
|
+
* yahooOs: Source.item({ systemId, name, version }), // published
|
|
100497
100729
|
* }
|
|
100498
100730
|
* ```
|
|
100499
100731
|
*
|
|
@@ -100513,72 +100745,6 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100513
100745
|
*/
|
|
100514
100746
|
configPath: external_exports.string().min(1).optional().describe("The sibling config this link reads, as a path to its `uds.config.ts`. Wins for resolution when set."),
|
|
100515
100747
|
/**
|
|
100516
|
-
* What this system draws from that source — a standing declaration, and the thing the build turns
|
|
100517
|
-
* into rows.
|
|
100518
|
-
* ```ts
|
|
100519
|
-
* link: '*' // everything, every kind
|
|
100520
|
-
* link: { tokens: '*', icons: '*' } // those kinds whole
|
|
100521
|
-
* link: { tokens: ['color/brand', 'color/paper'] } // those entities
|
|
100522
|
-
* link: { components: ['actions'] } // a folder: its members
|
|
100523
|
-
* link: { '*': '*', modifiers: ['*', '!text'] } // everything but one folder
|
|
100524
|
-
* ```
|
|
100525
|
-
* `Config.withDerivedRows` reads it and makes a pointer row per entity it covers — on every build,
|
|
100526
|
-
* and inside the apply of any patch to this pin — so a link's cost in authored source is this one
|
|
100527
|
-
* declaration whatever the source's size, and the rows come and go with it.
|
|
100528
|
-
*
|
|
100529
|
-
* Keyed by accessor (`tokens`, `components`) rather than by kind (`token`, `component`), because
|
|
100530
|
-
* this is read in a config file, and a config file is keyed by accessor everywhere else —
|
|
100531
|
-
* `register({ tokens, components })`, `sources: { linkedSystems: … }`. Ops and refs use the kind.
|
|
100532
|
-
* `Config.accessorOf` maps between them, off the config type's own manifest, so no kind is named
|
|
100533
|
-
* here. Paths are the source's own; a path that names a folder there covers its members.
|
|
100534
|
-
*
|
|
100535
|
-
* **Standing, so a source that grows is covered without re-running anything.** The declaration is
|
|
100536
|
-
* read on every build, and what it produces is an ordinary stored row — indistinguishable from a
|
|
100537
|
-
* borrow written by hand, which is what keeps the rename gate, `inlineAllSources` when it seals an
|
|
100538
|
-
* artifact and `emitBorrowedComponents` when it emits a module all working unchanged.
|
|
100539
|
-
*
|
|
100540
|
-
* A path this config already holds is left alone, silently, whether it authored that row or
|
|
100541
|
-
* borrowed it. Local shadows a source, and that is what makes deriving over a grown source
|
|
100542
|
-
* additive rather than a set of conflicts to resolve. It is also how one of their entities is kept
|
|
100543
|
-
* out: author your own at that path, or narrow what this declares.
|
|
100544
|
-
*
|
|
100545
|
-
* Deleting a row this covers is refused ({@link EntityKind.bulkAdopts} is what reads it): the
|
|
100546
|
-
* build would make it again on the next pass, and a delete that comes back is worse than one that
|
|
100547
|
-
* was refused. To own one of their entities, `copy` it; to stop drawing it, `unlink` it.
|
|
100548
|
-
*
|
|
100549
|
-
* The gestures that write this are the kind's own ops — `link`, `unlink`, `exclude`, `break` —
|
|
100550
|
-
* each with a `-plan` read beside it, so a surface never assembles the declaration by hand.
|
|
100551
|
-
*
|
|
100552
|
-
* `'*'` means every kind that may be drawn on, which is every kind that may be borrowed — each
|
|
100553
|
-
* kind says which it is (`EntityKind.linkable`). Nothing is subtracted: a pin and a `file` aren't
|
|
100554
|
-
* borrowable, so no borrow of one exists for this to cover.
|
|
100555
|
-
*
|
|
100556
|
-
* **Leaving part of a kind out.** A record's `'*'` key stands for every accessor it doesn't name,
|
|
100557
|
-
* and a list entry `'*'` for every path, so everything but one folder is spelled
|
|
100558
|
-
* ```ts
|
|
100559
|
-
* link: { '*': '*', modifiers: ['*', '!text'] }
|
|
100560
|
-
* ```
|
|
100561
|
-
* A `!` entry leaves that path out, or a folder's members, whatever else in the list reaches it.
|
|
100562
|
-
* Unlike a path a list doesn't name, an excluded path derives no row however the link reaches it —
|
|
100563
|
-
* a linked token whose override is under a `text` modifier names that modifier, and it still
|
|
100564
|
-
* stays out — so the name is free for this config to author, and the source's entity stays
|
|
100565
|
-
* reachable qualified. A token's overrides under an excluded modifier are left out of the build
|
|
100566
|
-
* rather than refused (`unstatableConditions`), which is what a consumer without one of the
|
|
100567
|
-
* source's mode axes means. A linked component's rule keyed on one still reaches the source's
|
|
100568
|
-
* modifier, as a rule on any modifier the link doesn't take does. See `covers` and `excludes`.
|
|
100569
|
-
*
|
|
100570
|
-
* Exclusions win wherever they sit, so `['!text', '*']` is `['*', '!text']`, and a list of them
|
|
100571
|
-
* alone (`['!text']`) takes nothing by name and still keeps `text` out. An `options` entry at an
|
|
100572
|
-
* excluded path is refused (an invariant), since no row derives there for it to adjust. `exclude`
|
|
100573
|
-
* writes one (and drops such entries with it), and `link` lifts one over what it takes. `unlink`
|
|
100574
|
-
* keeps them and writes none, because a `!` also drops the overrides under the path, which
|
|
100575
|
-
* unlinking never has.
|
|
100576
|
-
*
|
|
100577
|
-
* No entity path can be misread here: `entityPathProblem` refuses a segment that starts with `!`,
|
|
100578
|
-
* a segment that is `*`, and an empty segment, wherever a path becomes an identity.
|
|
100579
|
-
*/
|
|
100580
|
-
link: external_exports.union([external_exports.literal("*"), external_exports.record(external_exports.string(), external_exports.union([external_exports.literal("*"), external_exports.array(external_exports.string().min(1)).min(1)]))]).optional().describe("What this system draws from the source, standing: `'*'` for everything, or a record by kind (`'*'` keys every kind it doesn't name). A list's `'!path'` entry leaves that path out."),
|
|
100581
|
-
/**
|
|
100582
100748
|
* What this system does to individual entities of the source, keyed by accessor, then by the path
|
|
100583
100749
|
* the source spells, then by verb.
|
|
100584
100750
|
*
|
|
@@ -100621,6 +100787,11 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100621
100787
|
*/
|
|
100622
100788
|
options: pinOptions,
|
|
100623
100789
|
/**
|
|
100790
|
+
* The spelling `options.include` had. Still typed for a body written that way, and moved to
|
|
100791
|
+
* `options.include` wherever one is written (`EntityKind.retiredFields`), so it's never stored.
|
|
100792
|
+
*/
|
|
100793
|
+
link: linkDeclarationSchema.optional().meta({ deprecated: true }).describe("Deprecated: what the source includes is `options.include`."),
|
|
100794
|
+
/**
|
|
100624
100795
|
* An npm package that ships a built system — `@acme/design-system`.
|
|
100625
100796
|
*
|
|
100626
100797
|
* The third origin, and the one a consumer outside the publisher's monorepo and off their Create
|
|
@@ -100732,7 +100903,7 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100732
100903
|
unavailable: sourceUnavailable
|
|
100733
100904
|
},
|
|
100734
100905
|
/**
|
|
100735
|
-
* Whether this pin's `
|
|
100906
|
+
* Whether this pin's `options.include` covers one of the source's entities — the derive pass's
|
|
100736
100907
|
* question and the delete gate's, answered here because `link` is this kind's field and its shape
|
|
100737
100908
|
* is this kind's to interpret.
|
|
100738
100909
|
*
|
|
@@ -100743,13 +100914,13 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100743
100914
|
* (`EntityKind.linkable`), so the claim is unreachable rather than filtered.
|
|
100744
100915
|
*/
|
|
100745
100916
|
bulkAdopts: ({ body, kind, accessor, path: path2 }) => covers({
|
|
100746
|
-
declared: body
|
|
100917
|
+
declared: includeOf(body),
|
|
100747
100918
|
accessor: accessor ?? kind,
|
|
100748
100919
|
path: path2
|
|
100749
100920
|
}),
|
|
100750
100921
|
sourceType: (body) => body.type === "hybrid" ? "hybrid" : "linked",
|
|
100751
100922
|
bulkExcludes: ({ body, kind, accessor, path: path2 }) => excludes({
|
|
100752
|
-
declared: body
|
|
100923
|
+
declared: includeOf(body),
|
|
100753
100924
|
accessor: accessor ?? kind,
|
|
100754
100925
|
path: path2
|
|
100755
100926
|
}),
|
|
@@ -100766,14 +100937,10 @@ var LinkedSystemDefinition = defineEntity({
|
|
|
100766
100937
|
* The field-path address `options` stores one entry at — accessor, then the path the source
|
|
100767
100938
|
* spells, so an edit to a minted row lands on the same key {@link directiveAt} reads back.
|
|
100768
100939
|
*/
|
|
100769
|
-
bulkDirectives: (body) => {
|
|
100770
|
-
|
|
100771
|
-
|
|
100772
|
-
|
|
100773
|
-
accessor,
|
|
100774
|
-
path: path2
|
|
100775
|
-
})) : []);
|
|
100776
|
-
},
|
|
100940
|
+
bulkDirectives: (body) => directivesOf(body).flatMap(([accessor, entries]) => isPlainObject(entries) ? Object.keys(entries).map((path2) => ({
|
|
100941
|
+
accessor,
|
|
100942
|
+
path: path2
|
|
100943
|
+
})) : []),
|
|
100777
100944
|
bulkOverlayWrite: ({ accessor, path: path2, overlay }) => ({ [`options.${accessor}.${path2}`]: overlay })
|
|
100778
100945
|
});
|
|
100779
100946
|
function storedPinBody(body) {
|
|
@@ -100786,7 +100953,7 @@ function storedPinBody(body) {
|
|
|
100786
100953
|
function storedPinOptions(options) {
|
|
100787
100954
|
const stored = {};
|
|
100788
100955
|
for (const [accessor, entries] of Object.entries(options)) {
|
|
100789
|
-
if (!isPlainObject(entries)) {
|
|
100956
|
+
if (accessor === "include" || !isPlainObject(entries)) {
|
|
100790
100957
|
stored[accessor] = entries;
|
|
100791
100958
|
continue;
|
|
100792
100959
|
}
|
|
@@ -100807,9 +100974,9 @@ function storedPinOptions(options) {
|
|
|
100807
100974
|
}
|
|
100808
100975
|
function sourceItem(def) {
|
|
100809
100976
|
if (typeof def !== "object" || def === null || isRef2(def)) return def;
|
|
100810
|
-
const body =
|
|
100977
|
+
const body = foldRetiredFields({
|
|
100811
100978
|
body: def,
|
|
100812
|
-
|
|
100979
|
+
retired: SOURCE_RETIRED_FIELDS
|
|
100813
100980
|
});
|
|
100814
100981
|
if (!isPlainObject(body.options)) return body;
|
|
100815
100982
|
return {
|
|
@@ -100819,14 +100986,14 @@ function sourceItem(def) {
|
|
|
100819
100986
|
}
|
|
100820
100987
|
var Source = Object.assign(LinkedSystemDefinition, { item: sourceItem });
|
|
100821
100988
|
function excludedDirectives(config2) {
|
|
100822
|
-
return config2.list("
|
|
100823
|
-
const body = config2.storedBody("
|
|
100824
|
-
|
|
100825
|
-
return
|
|
100826
|
-
declared:
|
|
100989
|
+
return config2.list("source").flatMap(({ path: slug2 }) => {
|
|
100990
|
+
const body = config2.storedBody("source", slug2);
|
|
100991
|
+
const declared2 = includeOf(body);
|
|
100992
|
+
return directivesOf(body).flatMap(([accessor, entries]) => isPlainObject(entries) ? Object.keys(entries).filter((path2) => excludes({
|
|
100993
|
+
declared: declared2,
|
|
100827
100994
|
accessor,
|
|
100828
100995
|
path: path2
|
|
100829
|
-
})).map((path2) => `Link "${slug2}": options.${accessor}["${path2}"] adjusts a path its \`
|
|
100996
|
+
})).map((path2) => `Link "${slug2}": options.${accessor}["${path2}"] adjusts a path its \`options.include\` excludes, which derives no row. Drop the entry, or the exclusion.`) : []);
|
|
100830
100997
|
});
|
|
100831
100998
|
}
|
|
100832
100999
|
function directiveAt(body, accessor, path2) {
|
|
@@ -100835,7 +101002,7 @@ function directiveAt(body, accessor, path2) {
|
|
|
100835
101002
|
function linkRedirects(config2) {
|
|
100836
101003
|
const kindOfAccessor = (accessor) => config2.accessors()[accessor]?.kind ?? accessor;
|
|
100837
101004
|
const declared2 = [];
|
|
100838
|
-
for (const link2 of config2.list("
|
|
101005
|
+
for (const link2 of config2.list("source")) {
|
|
100839
101006
|
const { options } = link2.toJSON();
|
|
100840
101007
|
for (const [accessor, entries] of Object.entries(options ?? {})) for (const [path2, entry] of Object.entries(entries ?? {})) {
|
|
100841
101008
|
const override = isPlainObject(entry) ? entry.override : void 0;
|
|
@@ -101231,6 +101398,107 @@ var buildDebugMigration = {
|
|
|
101231
101398
|
}
|
|
101232
101399
|
};
|
|
101233
101400
|
|
|
101401
|
+
// ../config/dist/migrations/20261105185042_sources_stored.js
|
|
101402
|
+
var SOURCES_STORED_VERSION = 20261105185042;
|
|
101403
|
+
var OLD_KIND = "linked-system";
|
|
101404
|
+
var NEW_KIND = "source";
|
|
101405
|
+
var isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
101406
|
+
var OLD_PREFIX = `${OLD_KIND}:`;
|
|
101407
|
+
var NEW_PREFIX = `${NEW_KIND}:`;
|
|
101408
|
+
var renamedMarkers = (text) => text.includes(`{${OLD_PREFIX}`) ? text.split(`{${OLD_PREFIX}`).join(`{${NEW_PREFIX}`) : text;
|
|
101409
|
+
function renamedRefs(value) {
|
|
101410
|
+
if (typeof value === "string") return renamedMarkers(value);
|
|
101411
|
+
if (Array.isArray(value)) {
|
|
101412
|
+
const mapped = value.map(renamedRefs);
|
|
101413
|
+
return mapped.some((member, index) => member !== value[index]) ? mapped : value;
|
|
101414
|
+
}
|
|
101415
|
+
if (!isRecord2(value)) return value;
|
|
101416
|
+
let changed = false;
|
|
101417
|
+
const entries = Object.entries(value).map(([key2, member]) => {
|
|
101418
|
+
if (key2 === "__ref" && typeof member === "string") {
|
|
101419
|
+
const renamedRef = member.startsWith(OLD_PREFIX) ? `${NEW_PREFIX}${member.slice(OLD_PREFIX.length)}` : member;
|
|
101420
|
+
if (renamedRef !== member) changed = true;
|
|
101421
|
+
return [key2, renamedRef];
|
|
101422
|
+
}
|
|
101423
|
+
const renamedKey2 = renamedMarkers(key2);
|
|
101424
|
+
const renamedMember = renamedRefs(member);
|
|
101425
|
+
if (renamedKey2 !== key2 || renamedMember !== member) changed = true;
|
|
101426
|
+
return [renamedKey2, renamedMember];
|
|
101427
|
+
});
|
|
101428
|
+
return changed ? Object.fromEntries(entries) : value;
|
|
101429
|
+
}
|
|
101430
|
+
function withInclude(body) {
|
|
101431
|
+
if (!isRecord2(body) || !("link" in body)) return body;
|
|
101432
|
+
const { link: link2, ...rest } = body;
|
|
101433
|
+
if (link2 === void 0 || link2 === null) return rest;
|
|
101434
|
+
const options = isRecord2(rest.options) ? rest.options : {};
|
|
101435
|
+
if ("include" in options) return rest;
|
|
101436
|
+
return {
|
|
101437
|
+
...rest,
|
|
101438
|
+
options: {
|
|
101439
|
+
include: link2,
|
|
101440
|
+
...options
|
|
101441
|
+
}
|
|
101442
|
+
};
|
|
101443
|
+
}
|
|
101444
|
+
function renamedKey(record2, transform2 = (member) => member) {
|
|
101445
|
+
if (!isRecord2(record2) || !(OLD_KIND in record2)) return record2;
|
|
101446
|
+
const { [OLD_KIND]: moved, ...rest } = record2;
|
|
101447
|
+
const members2 = isRecord2(moved) ? Object.fromEntries(Object.entries(moved).map(([path2, member]) => [path2, transform2(member)])) : moved;
|
|
101448
|
+
return {
|
|
101449
|
+
...rest,
|
|
101450
|
+
[NEW_KIND]: members2
|
|
101451
|
+
};
|
|
101452
|
+
}
|
|
101453
|
+
function sourcesStored(json2) {
|
|
101454
|
+
const ownedKinds = Array.isArray(json2.ownedKinds) ? json2.ownedKinds.map((kind) => kind === OLD_KIND ? NEW_KIND : kind) : json2.ownedKinds;
|
|
101455
|
+
return {
|
|
101456
|
+
...json2,
|
|
101457
|
+
...json2.ownedKinds === void 0 ? {} : { ownedKinds },
|
|
101458
|
+
...json2.items === void 0 ? {} : { items: renamedRefs(renamedKey(json2.items, withInclude)) },
|
|
101459
|
+
...json2.groups === void 0 ? {} : { groups: renamedRefs(renamedKey(json2.groups)) },
|
|
101460
|
+
...json2.overrides === void 0 ? {} : { overrides: renamedRefs(renamedKey(json2.overrides)) }
|
|
101461
|
+
};
|
|
101462
|
+
}
|
|
101463
|
+
function renamedDelta2(data) {
|
|
101464
|
+
if (!isRecord2(data)) return data;
|
|
101465
|
+
const out = {};
|
|
101466
|
+
for (const [key2, value] of Object.entries(data)) if (key2 === "link") out["options.include"] = value;
|
|
101467
|
+
else if (key2.startsWith("link.")) out[`options.include${key2.slice(4)}`] = value;
|
|
101468
|
+
else out[key2] = value;
|
|
101469
|
+
return out;
|
|
101470
|
+
}
|
|
101471
|
+
var sourcesStoredMigration = {
|
|
101472
|
+
version: SOURCES_STORED_VERSION,
|
|
101473
|
+
up: sourcesStored,
|
|
101474
|
+
fromSchema: external_exports.looseObject({}),
|
|
101475
|
+
toSchema: external_exports.looseObject({}).refine((json2) => {
|
|
101476
|
+
const items = json2.items;
|
|
101477
|
+
if (!isRecord2(items)) return true;
|
|
101478
|
+
if (OLD_KIND in items) return false;
|
|
101479
|
+
const sources = items[NEW_KIND];
|
|
101480
|
+
return !isRecord2(sources) || Object.values(sources).every((body) => !isRecord2(body) || !("link" in body));
|
|
101481
|
+
}, { message: "a source is stored under `source`, with what it includes at `options.include`" }),
|
|
101482
|
+
upPatch(written) {
|
|
101483
|
+
const refsRenamed = "data" in written ? renamedRefs(written.data) : void 0;
|
|
101484
|
+
const patch = "data" in written && refsRenamed !== written.data ? {
|
|
101485
|
+
...written,
|
|
101486
|
+
data: refsRenamed
|
|
101487
|
+
} : written;
|
|
101488
|
+
if (patch.kind !== OLD_KIND) return patch;
|
|
101489
|
+
const renamed = {
|
|
101490
|
+
...patch,
|
|
101491
|
+
kind: NEW_KIND
|
|
101492
|
+
};
|
|
101493
|
+
if (!("data" in renamed) || "field" in renamed) return renamed;
|
|
101494
|
+
const data = renamed.operation === "update" ? renamedDelta2(renamed.data) : withInclude(renamed.data);
|
|
101495
|
+
return {
|
|
101496
|
+
...renamed,
|
|
101497
|
+
data
|
|
101498
|
+
};
|
|
101499
|
+
}
|
|
101500
|
+
};
|
|
101501
|
+
|
|
101234
101502
|
// ../../node_modules/css-tree/lib/generator/sourceMap.js
|
|
101235
101503
|
var import_source_map_generator = __toESM(require_source_map_generator(), 1);
|
|
101236
101504
|
var trackNodes = /* @__PURE__ */ new Set(["Atrule", "Selector", "Declaration"]);
|
|
@@ -103577,8 +103845,8 @@ var startingStyleModifierMigration = {
|
|
|
103577
103845
|
|
|
103578
103846
|
// ../config/dist/migrations/20261009181635_css_motion_strict.js
|
|
103579
103847
|
var CSS_MOTION_STRICT_VERSION = 20261009181635;
|
|
103580
|
-
var
|
|
103581
|
-
var isRef3 = (value) =>
|
|
103848
|
+
var isRecord3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
103849
|
+
var isRef3 = (value) => isRecord3(value) && "__ref" in value;
|
|
103582
103850
|
var JS_ONLY = [
|
|
103583
103851
|
"whileDrag",
|
|
103584
103852
|
"layout",
|
|
@@ -103648,33 +103916,33 @@ function timingOf(level) {
|
|
|
103648
103916
|
return out;
|
|
103649
103917
|
}
|
|
103650
103918
|
function transitionOf(transition2) {
|
|
103651
|
-
const out = timingOf(
|
|
103652
|
-
const properties =
|
|
103919
|
+
const out = timingOf(isRecord3(transition2.default) ? transition2.default : transition2);
|
|
103920
|
+
const properties = isRecord3(transition2.properties) ? { ...transition2.properties } : {};
|
|
103653
103921
|
for (const [key2, value] of Object.entries(transition2)) {
|
|
103654
103922
|
if (key2 === "default" || key2 === "properties" || TIMING.has(key2)) continue;
|
|
103655
|
-
if (
|
|
103923
|
+
if (isRecord3(value) && !isRef3(value)) properties[key2] = timingOf(value);
|
|
103656
103924
|
}
|
|
103657
103925
|
if (Object.keys(properties).length > 0) out.properties = properties;
|
|
103658
103926
|
return out;
|
|
103659
103927
|
}
|
|
103660
103928
|
function stateOf2(target2) {
|
|
103661
|
-
if (!
|
|
103929
|
+
if (!isRecord3(target2)) return target2;
|
|
103662
103930
|
const { transitionEnd: _transitionEnd, ...rest } = target2;
|
|
103663
|
-
if (
|
|
103931
|
+
if (isRecord3(rest.transition)) rest.transition = transitionOf(rest.transition);
|
|
103664
103932
|
return rest;
|
|
103665
103933
|
}
|
|
103666
103934
|
function strictCssMotion(body) {
|
|
103667
|
-
if (!
|
|
103935
|
+
if (!isRecord3(body) || body.runtime !== "css") return body;
|
|
103668
103936
|
const out = { ...body };
|
|
103669
103937
|
for (const field of JS_ONLY) delete out[field];
|
|
103670
103938
|
for (const state of STATES2) if (out[state] !== void 0) out[state] = stateOf2(out[state]);
|
|
103671
|
-
if (
|
|
103672
|
-
if (
|
|
103939
|
+
if (isRecord3(out.variants)) out.variants = Object.fromEntries(Object.entries(out.variants).map(([name, target2]) => [name, stateOf2(target2)]));
|
|
103940
|
+
if (isRecord3(out.transition)) out.transition = transitionOf(out.transition);
|
|
103673
103941
|
return out;
|
|
103674
103942
|
}
|
|
103675
103943
|
function cssMotionStrict(json2) {
|
|
103676
103944
|
const items = json2.items;
|
|
103677
|
-
if (!
|
|
103945
|
+
if (!isRecord3(items) || !isRecord3(items.motion)) return json2;
|
|
103678
103946
|
const motion = Object.fromEntries(Object.entries(items.motion).map(([path2, body]) => [path2, strictCssMotion(body)]));
|
|
103679
103947
|
return {
|
|
103680
103948
|
...json2,
|
|
@@ -103690,8 +103958,8 @@ var cssMotionStrictMigration = {
|
|
|
103690
103958
|
fromSchema: external_exports.looseObject({}),
|
|
103691
103959
|
toSchema: external_exports.looseObject({}).refine((json2) => {
|
|
103692
103960
|
const items = json2.items;
|
|
103693
|
-
if (!
|
|
103694
|
-
return Object.values(items.motion).every((body) => !
|
|
103961
|
+
if (!isRecord3(items) || !isRecord3(items.motion)) return true;
|
|
103962
|
+
return Object.values(items.motion).every((body) => !isRecord3(body) || body.runtime !== "css" || JS_ONLY.every((field) => body[field] === void 0));
|
|
103695
103963
|
}, { message: "a CSS motion preset holds none of a JS preset's own fields" }),
|
|
103696
103964
|
upPatch(patch) {
|
|
103697
103965
|
if (patch.kind !== "motion" || !("data" in patch)) return patch;
|
|
@@ -103976,6 +104244,7 @@ if (!registeredSchemaMigrations().has(20261102185610)) registerSchemaMigrations(
|
|
|
103976
104244
|
if (!registeredSchemaMigrations().has(20261102193912)) registerSchemaMigrations(mapPropsFromMigration);
|
|
103977
104245
|
if (!registeredSchemaMigrations().has(20261103115059)) registerSchemaMigrations(sourcesAuthoringMigration);
|
|
103978
104246
|
if (!registeredSchemaMigrations().has(20261104151013)) registerSchemaMigrations(buildDebugMigration);
|
|
104247
|
+
if (!registeredSchemaMigrations().has(20261105185042)) registerSchemaMigrations(sourcesStoredMigration);
|
|
103979
104248
|
|
|
103980
104249
|
// ../config/dist/capture/node-ops.js
|
|
103981
104250
|
var DEFAULT_WIDTH = 1600;
|