@yahoo/uds-create-config 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/dist/configs/CanvasConfig.d.ts +1 -1
- package/dist/configs/react-native-system.d.ts +1 -1
- package/dist/configs/react-native-system.js +1 -1
- package/dist/configs/system.d.ts +1 -1
- package/dist/configs/system.js +3 -1
- package/dist/entities/system/{LinkedSystem.d.ts → Source.d.ts} +19 -11
- package/dist/entities/system/{LinkedSystem.js → Source.js} +127 -130
- package/dist/entities/system/component-module.js +2 -2
- package/dist/entities/system/copy-plan.js +5 -2
- package/dist/entities/system/css-motion-reach.js +6 -6
- package/dist/entities/system/link-declaration.d.ts +6 -68
- package/dist/entities/system/link-declaration.js +30 -4
- package/dist/entities/system/link-plan.d.ts +2 -2
- package/dist/entities/system/link-plan.js +44 -15
- package/dist/entities/system/motion-variants.js +2 -2
- package/dist/framework/Config.d.ts +44 -24
- package/dist/framework/Config.js +140 -41
- package/dist/framework/defineConfig.d.ts +3 -3
- package/dist/framework/defineEntity.d.ts +4 -3
- package/dist/framework/defineEntity.js +2 -1
- package/dist/framework/derived-mutations.d.ts +1 -1
- package/dist/framework/derived-mutations.js +1 -1
- package/dist/framework/inline-sources.js +2 -2
- package/dist/framework/registry.d.ts +13 -7
- package/dist/framework/registry.js +3 -2
- package/dist/framework/retired-fields.d.ts +33 -0
- package/dist/framework/retired-fields.js +148 -0
- package/dist/framework/schema-version.d.ts +1 -1
- package/dist/framework/schema-version.js +5 -5
- package/dist/framework/schemas.js +1 -1
- package/dist/framework/signature.js +4 -1
- package/dist/framework/source-integrity.d.ts +2 -2
- package/dist/framework/source-integrity.js +2 -2
- package/dist/framework/sources.d.ts +3 -3
- package/dist/framework/sources.js +1 -1
- package/dist/framework/utils/field-schema.js +7 -2
- package/dist/framework/utils/refs.d.ts +1 -1
- package/dist/framework/utils/refs.js +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/migrations/2.0.0/v1-artifact.d.ts +1 -1
- package/dist/migrations/20261105185042_sources_stored.d.ts +19 -0
- package/dist/migrations/20261105185042_sources_stored.js +125 -0
- package/dist/spec/links.d.ts +1 -1
- package/dist/spec/links.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/framework/authored-at.d.ts +0 -31
- package/dist/framework/authored-at.js +0 -73
|
@@ -469,7 +469,7 @@ function linkedComponentModule(config, componentPathOrRef) {
|
|
|
469
469
|
function publishedPin(config, slug) {
|
|
470
470
|
const segments = sourceHops(slug);
|
|
471
471
|
if (segments.length > 1) {
|
|
472
|
-
const { systemId, version } = (config.sourceFor(routedSource(...segments.slice(0, -1)))?.resolve("
|
|
472
|
+
const { systemId, version } = (config.sourceFor(routedSource(...segments.slice(0, -1)))?.resolve("source", segments.at(-1) ?? ""))?.toJSON() ?? {};
|
|
473
473
|
return systemId && version ? {
|
|
474
474
|
systemId,
|
|
475
475
|
version
|
|
@@ -480,7 +480,7 @@ function publishedPin(config, slug) {
|
|
|
480
480
|
for (let at = queue.shift(); at; at = queue.shift()) {
|
|
481
481
|
if (seen.has(at)) continue;
|
|
482
482
|
seen.add(at);
|
|
483
|
-
for (const entity of at.list("
|
|
483
|
+
for (const entity of at.list("source")) {
|
|
484
484
|
const { systemId, version } = entity.toJSON();
|
|
485
485
|
if (entity.path === slug && systemId && version) return {
|
|
486
486
|
systemId,
|
|
@@ -3,7 +3,7 @@ import { rejectData } from "../../framework/rejection.js";
|
|
|
3
3
|
import { kindBorrowable } from "../../framework/registry.js";
|
|
4
4
|
import { File } from "./File.js";
|
|
5
5
|
import { componentModuleFilePaths, componentRegistryImports } from "./component-module.js";
|
|
6
|
-
import { PIN_KIND, covers, declarationOf, narrowDeclaration } from "./link-declaration.js";
|
|
6
|
+
import { PIN_KIND, covers, declarationOf, includeWrite, narrowDeclaration } from "./link-declaration.js";
|
|
7
7
|
//#region src/entities/system/copy-plan.ts
|
|
8
8
|
/**
|
|
9
9
|
* The source's entries one path names: every item of the kind for `'*'`, a folder's members for a
|
|
@@ -483,7 +483,10 @@ function planCopy({ config, input }) {
|
|
|
483
483
|
kind: PIN_KIND,
|
|
484
484
|
operation: "update",
|
|
485
485
|
path: slug,
|
|
486
|
-
data: {
|
|
486
|
+
data: { ...includeWrite({
|
|
487
|
+
body: config.storedBody(PIN_KIND, slug),
|
|
488
|
+
declared: next ?? null
|
|
489
|
+
}) }
|
|
487
490
|
});
|
|
488
491
|
}
|
|
489
492
|
}
|
|
@@ -45,7 +45,7 @@ const resolvePlacements = createSliceMemo({
|
|
|
45
45
|
kinds: [
|
|
46
46
|
"component",
|
|
47
47
|
"motion",
|
|
48
|
-
"
|
|
48
|
+
"source"
|
|
49
49
|
],
|
|
50
50
|
compute: (config) => {
|
|
51
51
|
const out = [];
|
|
@@ -83,7 +83,7 @@ const cssMotionVariantGroups = createSliceMemo({
|
|
|
83
83
|
kinds: [
|
|
84
84
|
"component",
|
|
85
85
|
"motion",
|
|
86
|
-
"
|
|
86
|
+
"source"
|
|
87
87
|
],
|
|
88
88
|
compute: (config) => variantGroupsOf({
|
|
89
89
|
config,
|
|
@@ -94,7 +94,7 @@ const resolveExits = createSliceMemo({
|
|
|
94
94
|
kinds: [
|
|
95
95
|
"component",
|
|
96
96
|
"motion",
|
|
97
|
-
"
|
|
97
|
+
"source"
|
|
98
98
|
],
|
|
99
99
|
compute: (config) => {
|
|
100
100
|
const out = [];
|
|
@@ -139,7 +139,7 @@ const resolveSwapped = createSliceMemo({
|
|
|
139
139
|
kinds: [
|
|
140
140
|
"component",
|
|
141
141
|
"motion",
|
|
142
|
-
"
|
|
142
|
+
"source"
|
|
143
143
|
],
|
|
144
144
|
compute: (config) => {
|
|
145
145
|
const links = swappingLinks(config);
|
|
@@ -162,10 +162,10 @@ function swappedLinkJsMotions(config) {
|
|
|
162
162
|
return resolveSwapped(config);
|
|
163
163
|
}
|
|
164
164
|
const resolveLinkedSwaps = createSliceMemo({
|
|
165
|
-
kinds: ["
|
|
165
|
+
kinds: ["source", "motion"],
|
|
166
166
|
compute: (config) => {
|
|
167
167
|
const out = [];
|
|
168
|
-
for (const link of config.list("
|
|
168
|
+
for (const link of config.list("source")) {
|
|
169
169
|
const { options } = link.toJSON();
|
|
170
170
|
for (const [preset, entry] of Object.entries(options?.motion ?? {})) {
|
|
171
171
|
if (!isPlainObject(entry)) continue;
|
|
@@ -1,68 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* What a declaration says about one accessor: its own entry, or the record's `'*'` entry, which stands
|
|
8
|
-
* for every accessor the record doesn't name (`{ '*': '*', modifiers: ['*', '!text'] }`).
|
|
9
|
-
*/
|
|
10
|
-
export declare function entriesFor(declared: LinkDeclaration | undefined, accessor: string): '*' | readonly string[] | undefined;
|
|
11
|
-
/** The paths a list leaves out, without their `!`. */
|
|
12
|
-
export declare function excludedIn(entries: '*' | readonly string[] | undefined): string[];
|
|
13
|
-
/**
|
|
14
|
-
* Whether a declaration leaves the accessor's path out on purpose: a `!` entry names it or a folder
|
|
15
|
-
* above it. An excluded path derives no row however the link reaches it, a ref pulling it in included.
|
|
16
|
-
*/
|
|
17
|
-
export declare function excludes({ declared, accessor, path, }: {
|
|
18
|
-
declared: LinkDeclaration | undefined;
|
|
19
|
-
accessor: string;
|
|
20
|
-
path: string;
|
|
21
|
-
}): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Whether a declaration covers the accessor's path: the whole source, the kind, the path, or a folder
|
|
24
|
-
* above it, and no `!` entry leaves it out. An exclusion wins whatever else in the list reaches the
|
|
25
|
-
* path, so `['*', '!text']` is every path but `text`'s.
|
|
26
|
-
*/
|
|
27
|
-
export declare function covers({ declared, accessor, path, }: {
|
|
28
|
-
declared: LinkDeclaration | undefined;
|
|
29
|
-
accessor: string;
|
|
30
|
-
path: string;
|
|
31
|
-
}): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* A list with `paths` taken into it: each is added unless a path the list takes already reaches it,
|
|
34
|
-
* and an exclusion that would leave one out is lifted. One naming the path or a folder under it goes;
|
|
35
|
-
* one naming a folder above it is spelled out as the folder's other members, so they stay out.
|
|
36
|
-
*/
|
|
37
|
-
export declare function includePaths({ config, slug, kind, entries, paths, }: {
|
|
38
|
-
config: Config;
|
|
39
|
-
slug: string;
|
|
40
|
-
kind: string;
|
|
41
|
-
entries: readonly string[];
|
|
42
|
-
paths: readonly string[];
|
|
43
|
-
}): string[];
|
|
44
|
-
/**
|
|
45
|
-
* A list with `paths` left out: a `!` entry for each the list doesn't exclude already. A path the
|
|
46
|
-
* list names under one of them goes, since the exclusion now says it, and so does a narrower
|
|
47
|
-
* exclusion a new one reaches. A folder named above an excluded path stays, less that path. With
|
|
48
|
-
* nothing listed, the list is the exclusions alone, which still keep the paths out when a linked row
|
|
49
|
-
* reaches them.
|
|
50
|
-
*/
|
|
51
|
-
export declare function excludePaths(entries: '*' | readonly string[] | undefined, paths: readonly string[]): string[];
|
|
52
|
-
/**
|
|
53
|
-
* The declaration with `removal` taken out of it, or `undefined` when nothing stays declared.
|
|
54
|
-
*
|
|
55
|
-
* A declaration of everything is spelled out first, one kind per accessor the source has rows for, so
|
|
56
|
-
* one kind can be taken out of it; a kind taken whole is spelled out as the source's top-level paths
|
|
57
|
-
* so some can go; a declared folder above a removed path is spelled out as its other members, so the
|
|
58
|
-
* rest of it stays covered. A list that takes every path (`['*', …]`) is spelled out the same way.
|
|
59
|
-
* Its `!` entries stay, a list of them alone included, and narrowing writes none.
|
|
60
|
-
*/
|
|
61
|
-
export declare function narrowDeclaration({ config, slug, current, removal, verb, }: {
|
|
62
|
-
config: Config;
|
|
63
|
-
slug: string;
|
|
64
|
-
current: LinkDeclaration;
|
|
65
|
-
removal: ReadonlyMap<string, '*' | readonly string[]>;
|
|
66
|
-
/** The op asking, for the refusal. */
|
|
67
|
-
verb: string;
|
|
68
|
-
}): LinkDeclaration | undefined;
|
|
1
|
+
import { LinkDeclaration } from "./Source.js";
|
|
2
|
+
//#region src/entities/system/link-declaration.d.ts
|
|
3
|
+
/** What a source's body includes, as stored at `options.include`. */
|
|
4
|
+
declare function includeOf(body: unknown): LinkDeclaration | undefined;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { includeOf };
|
|
@@ -1,11 +1,37 @@
|
|
|
1
|
+
import { isPlainObject } from "../../framework/utils/field-path.js";
|
|
1
2
|
import { rejectData } from "../../framework/rejection.js";
|
|
2
3
|
//#region src/entities/system/link-declaration.ts
|
|
3
|
-
const PIN_KIND = "
|
|
4
|
-
/** The
|
|
4
|
+
const PIN_KIND = "source";
|
|
5
|
+
/** The key of `options` that holds what a source includes. Every other key is an accessor. */
|
|
6
|
+
const INCLUDE = "include";
|
|
7
|
+
/** What a source's body includes, as stored at `options.include`. */
|
|
8
|
+
function includeOf(body) {
|
|
9
|
+
const options = isPlainObject(body) ? body.options : void 0;
|
|
10
|
+
return isPlainObject(options) ? options[INCLUDE] : void 0;
|
|
11
|
+
}
|
|
12
|
+
/** A source's `options` without `include`: its directives, by accessor. */
|
|
13
|
+
function directivesOf(body) {
|
|
14
|
+
const options = isPlainObject(body) ? body.options : void 0;
|
|
15
|
+
if (!isPlainObject(options)) return [];
|
|
16
|
+
return Object.entries(options).filter(([key]) => key !== INCLUDE);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The write that sets what a source includes, or clears it when `declared` is `undefined` or `null`.
|
|
20
|
+
* A clear that would leave `options` empty removes `options`, so a source that includes nothing and
|
|
21
|
+
* adjusts nothing stores no `options` at all.
|
|
22
|
+
*/
|
|
23
|
+
function includeWrite({ body, declared }) {
|
|
24
|
+
if (declared !== void 0 && declared !== null) return { [`options.${INCLUDE}`]: declared };
|
|
25
|
+
return directivesOf(body).length === 0 ? {
|
|
26
|
+
[`options.${INCLUDE}`]: null,
|
|
27
|
+
options: null
|
|
28
|
+
} : { [`options.${INCLUDE}`]: null };
|
|
29
|
+
}
|
|
30
|
+
/** The pin's `include` as stored. */
|
|
5
31
|
function declarationOf(config, slug) {
|
|
6
32
|
const pin = config.storedBody(PIN_KIND, slug);
|
|
7
33
|
if (!pin) rejectData(`No linked system "${slug}".`);
|
|
8
|
-
return pin
|
|
34
|
+
return includeOf(pin);
|
|
9
35
|
}
|
|
10
36
|
/** An entry that leaves a path out: `'!text'`. */
|
|
11
37
|
const EXCLUDE = "!";
|
|
@@ -156,4 +182,4 @@ function narrowDeclaration({ config, slug, current, removal, verb }) {
|
|
|
156
182
|
return Object.keys(next).length === 0 ? void 0 : next;
|
|
157
183
|
}
|
|
158
184
|
//#endregion
|
|
159
|
-
export { PIN_KIND, covers, declarationOf, entriesFor, excludePaths, excludes, includePaths, narrowDeclaration };
|
|
185
|
+
export { INCLUDE, PIN_KIND, covers, declarationOf, directivesOf, entriesFor, excludePaths, excludes, includeOf, includePaths, includeWrite, narrowDeclaration };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EntityAddress } from "../../framework/plan.js";
|
|
2
|
-
import { LinkDeclaration } from "./
|
|
2
|
+
import { LinkDeclaration } from "./Source.js";
|
|
3
3
|
import { Config, Patch, SettledSource, SourceCollision, TreeNode } from "../../framework/Config.js";
|
|
4
4
|
|
|
5
5
|
//#region src/entities/system/link-plan.d.ts
|
|
6
|
-
/** What one op names, keyed by accessor the way the pin's `
|
|
6
|
+
/** What one op names, keyed by accessor the way the pin's `options.include` is: every entry of the kind, or the
|
|
7
7
|
* source's paths, where a folder names its members. `'*'` alone is every kind the source offers. */
|
|
8
8
|
type LinkPaths = '*' | Readonly<Record<string, '*' | readonly string[]>>;
|
|
9
9
|
/** What a link does at a path held through another linked system: `'take'` makes the row follow this
|
|
@@ -3,7 +3,7 @@ import { isConfigRejection, rejectData } from "../../framework/rejection.js";
|
|
|
3
3
|
import { blockedBy } from "../../framework/plan.js";
|
|
4
4
|
import { danglingDirectives, excludedCondition } from "../../framework/source-integrity.js";
|
|
5
5
|
import { sameOrigin } from "../../framework/Config.js";
|
|
6
|
-
import { PIN_KIND, covers, declarationOf, entriesFor, excludePaths, excludes, includePaths, narrowDeclaration } from "./link-declaration.js";
|
|
6
|
+
import { INCLUDE, PIN_KIND, covers, declarationOf, directivesOf, entriesFor, excludePaths, excludes, includePaths, includeWrite, narrowDeclaration } from "./link-declaration.js";
|
|
7
7
|
import { planCopy, sourceEntries } from "./copy-plan.js";
|
|
8
8
|
//#region src/entities/system/link-plan.ts
|
|
9
9
|
/** The kinds `data` names, with what to take of each. An accessor this config has no kind for is a typo, refused by name. */
|
|
@@ -237,7 +237,10 @@ function planLinkApplied({ config, input }) {
|
|
|
237
237
|
kind: PIN_KIND,
|
|
238
238
|
operation: "update",
|
|
239
239
|
path: slug,
|
|
240
|
-
data: {
|
|
240
|
+
data: { ...includeWrite({
|
|
241
|
+
body: config.storedBody(PIN_KIND, slug),
|
|
242
|
+
declared: "*"
|
|
243
|
+
}) }
|
|
241
244
|
});
|
|
242
245
|
} else {
|
|
243
246
|
const next = { ...current ?? {} };
|
|
@@ -268,7 +271,7 @@ function planLinkApplied({ config, input }) {
|
|
|
268
271
|
kind: PIN_KIND,
|
|
269
272
|
operation: "update",
|
|
270
273
|
path: slug,
|
|
271
|
-
data: { [`
|
|
274
|
+
data: { [`options.${INCLUDE}.${accessor}`]: value }
|
|
272
275
|
});
|
|
273
276
|
}
|
|
274
277
|
declared = Object.keys(next).length === 0 ? current : next;
|
|
@@ -491,7 +494,7 @@ function directivesTakenFrom({ config, slug, after }) {
|
|
|
491
494
|
}
|
|
492
495
|
const edits = [];
|
|
493
496
|
for (const pin of new Set(dropped.map((at) => at.from))) {
|
|
494
|
-
const options = config.storedBody("
|
|
497
|
+
const options = config.storedBody("source", pin).options ?? {};
|
|
495
498
|
const data = {};
|
|
496
499
|
let emptied = 0;
|
|
497
500
|
for (const [accessor, entries] of Object.entries(options)) {
|
|
@@ -601,7 +604,10 @@ function planUnlink({ config, input }) {
|
|
|
601
604
|
kind: PIN_KIND,
|
|
602
605
|
operation: "update",
|
|
603
606
|
path: slug,
|
|
604
|
-
data: {
|
|
607
|
+
data: { ...includeWrite({
|
|
608
|
+
body: config.storedBody(PIN_KIND, slug),
|
|
609
|
+
declared: null
|
|
610
|
+
}) }
|
|
605
611
|
});
|
|
606
612
|
} else {
|
|
607
613
|
const removal = /* @__PURE__ */ new Map();
|
|
@@ -634,7 +640,10 @@ function planUnlink({ config, input }) {
|
|
|
634
640
|
kind: PIN_KIND,
|
|
635
641
|
operation: "update",
|
|
636
642
|
path: slug,
|
|
637
|
-
data: {
|
|
643
|
+
data: { ...includeWrite({
|
|
644
|
+
body: config.storedBody(PIN_KIND, slug),
|
|
645
|
+
declared: declared === void 0 ? null : declared
|
|
646
|
+
}) }
|
|
638
647
|
});
|
|
639
648
|
}
|
|
640
649
|
let after;
|
|
@@ -666,8 +675,20 @@ function planUnlink({ config, input }) {
|
|
|
666
675
|
}) : [];
|
|
667
676
|
if (dropped.length > 0) {
|
|
668
677
|
const update = patches[patches.length - 1];
|
|
669
|
-
|
|
670
|
-
|
|
678
|
+
const all = config.sourceDirectives(slug).every((directive) => dropped.some((gone) => gone.accessor === directive.accessor && gone.path === directive.path));
|
|
679
|
+
patches[patches.length - 1] = all && declared === void 0 ? {
|
|
680
|
+
...update,
|
|
681
|
+
data: {
|
|
682
|
+
[`options.${INCLUDE}`]: null,
|
|
683
|
+
options: null
|
|
684
|
+
}
|
|
685
|
+
} : {
|
|
686
|
+
...update,
|
|
687
|
+
data: {
|
|
688
|
+
...update.data,
|
|
689
|
+
...Object.fromEntries(dropped.map(({ accessor, path }) => [`options.${accessor}.${path}`, null]))
|
|
690
|
+
}
|
|
691
|
+
};
|
|
671
692
|
}
|
|
672
693
|
return {
|
|
673
694
|
declared,
|
|
@@ -691,7 +712,7 @@ function deadDirectives({ config, after, slug, removed }) {
|
|
|
691
712
|
return config.sourceDirectives(slug).filter((directive) => directive.kind !== void 0 && after.resolve(directive.kind, directive.path)?.borrowedFrom !== slug && (gone.has(`${directive.kind}:${directive.path}`) || collectRefs(config.sourceOverlay(slug, directive.kind, directive.path)).some((target) => gone.has(target))));
|
|
692
713
|
}
|
|
693
714
|
/**
|
|
694
|
-
* Leave paths of a linked system out, with a `!` entry each in the pin's `
|
|
715
|
+
* Leave paths of a linked system out, with a `!` entry each in the pin's `options.include`. Stronger than
|
|
695
716
|
* `unlink`: nothing derives there however the link reaches it, a linked token naming it included,
|
|
696
717
|
* and the linked tokens' overrides under an excluded modifier are left out of the build. `link` with
|
|
697
718
|
* the same path lifts it again.
|
|
@@ -719,8 +740,7 @@ function planExclude({ config, input }) {
|
|
|
719
740
|
const declared = next;
|
|
720
741
|
const dropped = [];
|
|
721
742
|
const optionDeletes = {};
|
|
722
|
-
const
|
|
723
|
-
for (const [accessor, entries] of Object.entries(options)) {
|
|
743
|
+
for (const [accessor, entries] of directivesOf(config.storedBody(PIN_KIND, slug))) {
|
|
724
744
|
if (!entries || typeof entries !== "object") continue;
|
|
725
745
|
const kind = config.accessors()[accessor]?.kind ?? accessor;
|
|
726
746
|
for (const path of Object.keys(entries)) {
|
|
@@ -741,7 +761,10 @@ function planExclude({ config, input }) {
|
|
|
741
761
|
operation: "update",
|
|
742
762
|
path: slug,
|
|
743
763
|
data: {
|
|
744
|
-
|
|
764
|
+
...includeWrite({
|
|
765
|
+
body: config.storedBody(PIN_KIND, slug),
|
|
766
|
+
declared
|
|
767
|
+
}),
|
|
745
768
|
...optionDeletes
|
|
746
769
|
}
|
|
747
770
|
}];
|
|
@@ -941,7 +964,10 @@ function planBreak({ config, input }) {
|
|
|
941
964
|
kind: PIN_KIND,
|
|
942
965
|
operation: "update",
|
|
943
966
|
path: slug,
|
|
944
|
-
data: {
|
|
967
|
+
data: { ...includeWrite({
|
|
968
|
+
body: config.storedBody(PIN_KIND, slug),
|
|
969
|
+
declared: null
|
|
970
|
+
}) }
|
|
945
971
|
}], {
|
|
946
972
|
kind: PIN_KIND,
|
|
947
973
|
operation: "delete",
|
|
@@ -1084,7 +1110,7 @@ function planBreak({ config, input }) {
|
|
|
1084
1110
|
});
|
|
1085
1111
|
}
|
|
1086
1112
|
for (const folder of plan.folders) released.add(`${folder.kind}:${folder.path}`);
|
|
1087
|
-
patches.push(...plan.patches.filter((patch) => scoped || !(patch.kind === "
|
|
1113
|
+
patches.push(...plan.patches.filter((patch) => scoped || !(patch.kind === "source" && patch.operation === "update")));
|
|
1088
1114
|
});
|
|
1089
1115
|
if (copyBlocked !== void 0) return {
|
|
1090
1116
|
rows,
|
|
@@ -1114,7 +1140,10 @@ function planBreak({ config, input }) {
|
|
|
1114
1140
|
kind: PIN_KIND,
|
|
1115
1141
|
operation: "update",
|
|
1116
1142
|
path: slug,
|
|
1117
|
-
data: {
|
|
1143
|
+
data: { ...includeWrite({
|
|
1144
|
+
body: config.storedBody(PIN_KIND, slug),
|
|
1145
|
+
declared: null
|
|
1146
|
+
}) }
|
|
1118
1147
|
});
|
|
1119
1148
|
patches.push({
|
|
1120
1149
|
kind: PIN_KIND,
|
|
@@ -94,7 +94,7 @@ const placedMotions = createSliceMemo({
|
|
|
94
94
|
kinds: [
|
|
95
95
|
"component",
|
|
96
96
|
"motion",
|
|
97
|
-
"
|
|
97
|
+
"source"
|
|
98
98
|
],
|
|
99
99
|
compute: (config) => {
|
|
100
100
|
const out = [];
|
|
@@ -131,7 +131,7 @@ const motionVariantGroups = createSliceMemo({
|
|
|
131
131
|
kinds: [
|
|
132
132
|
"component",
|
|
133
133
|
"motion",
|
|
134
|
-
"
|
|
134
|
+
"source"
|
|
135
135
|
],
|
|
136
136
|
compute: (config) => variantGroupsOf({
|
|
137
137
|
config,
|
|
@@ -74,7 +74,7 @@ interface RecordedSource {
|
|
|
74
74
|
* The dense-counter `2` a short-lived scheme stamped before the chain existed reads as the mint
|
|
75
75
|
* that replaced it (see `detectedWireVersion`).
|
|
76
76
|
*/
|
|
77
|
-
declare const SERIALIZED_CONFIG_VERSION =
|
|
77
|
+
declare const SERIALIZED_CONFIG_VERSION = 20261105185042;
|
|
78
78
|
interface SerializedConfig {
|
|
79
79
|
/** See {@link SERIALIZED_CONFIG_VERSION}. Always written; a stored artifact may lack it. */
|
|
80
80
|
readonly version: number;
|
|
@@ -360,9 +360,9 @@ interface LiveConfig {
|
|
|
360
360
|
type SourcesBySlug = Record<string, Config | LiveConfig | SerializedConfig>;
|
|
361
361
|
/**
|
|
362
362
|
* Loaded sources ready to attach, keyed by the source kind's accessor name and then by the item's
|
|
363
|
-
* slug — `{
|
|
363
|
+
* slug — `{ sources: { yos: yahooOs } }`.
|
|
364
364
|
*
|
|
365
|
-
* The same two levels the declaration uses (`register({
|
|
365
|
+
* The same two levels the declaration uses (`register({ sources: { yos: Source.item(…) } })`),
|
|
366
366
|
* so declaring a source and handing over what it resolved to are spelled the same way. See
|
|
367
367
|
* {@link Config.registerSources}.
|
|
368
368
|
*/
|
|
@@ -380,10 +380,10 @@ type AttachedSources = Readonly<Record<string, SourcesBySlug>>;
|
|
|
380
380
|
*/
|
|
381
381
|
interface HydrationOptions {
|
|
382
382
|
/**
|
|
383
|
-
* The loaded sources to attach — {@link AttachedSources}, so `{
|
|
383
|
+
* The loaded sources to attach — {@link AttachedSources}, so `{ sources: { yos: … } }`.
|
|
384
384
|
*
|
|
385
385
|
* Nested under its own key rather than spread across this interface, because the accessor names are
|
|
386
|
-
* the config type's to choose. A
|
|
386
|
+
* the config type's to choose. A field per source accessor here would be the framework naming a kind
|
|
387
387
|
* (see `.claude/rules/config-framework-kind-agnostic.md`), and a config declaring `linkedPackages`
|
|
388
388
|
* would have no way to hydrate at all. `patches` shares this level, which is why the sources cannot
|
|
389
389
|
* simply be this interface.
|
|
@@ -694,6 +694,20 @@ declare class Config {
|
|
|
694
694
|
* was registered into this instance. `undefined` for a kind this config doesn't know. The single
|
|
695
695
|
* accessor every internal read routes through. */
|
|
696
696
|
entityOf(kind: string): EntityKind | undefined;
|
|
697
|
+
/** An op address (`linked-system/link`) with its kind segment named as the kind is now. */
|
|
698
|
+
currentAddress(address: string): string;
|
|
699
|
+
/** `patch`, addressed to the kind it names now, with its data at the fields the kind has now. This
|
|
700
|
+
* is the patch as it is recorded, so it depends on nothing but the patch. */
|
|
701
|
+
private patchUnderCurrentKind;
|
|
702
|
+
/**
|
|
703
|
+
* `patch` as it lands on `snapshot`: a whole write of a moved field's container keeps the value
|
|
704
|
+
* stored there ({@link keptThroughContainerWrite}). Judged at each landing rather than written into
|
|
705
|
+
* the recorded patch, so a replay onto a base that has changed the field since keeps that base's
|
|
706
|
+
* value, not the one stored when the patch was first applied.
|
|
707
|
+
*/
|
|
708
|
+
private patchAsItLands;
|
|
709
|
+
/** `kind`, or the kind it names now when it's a retired name ({@link EntityKind.retiredKinds}). */
|
|
710
|
+
currentKind(kind: string): string;
|
|
697
711
|
/** Every key a style rule's layer bag takes that a kind owns, with the kind that owns it. See
|
|
698
712
|
* {@link LayerKey}. */
|
|
699
713
|
layerKeys(): ReadonlyMap<string, LayerKey & {
|
|
@@ -731,6 +745,12 @@ declare class Config {
|
|
|
731
745
|
* The single-op half of {@link run}, which is the door a caller uses.
|
|
732
746
|
*/
|
|
733
747
|
private dispatch;
|
|
748
|
+
/**
|
|
749
|
+
* An op's input with any field the kind has moved (`EntityKind.retiredFields`) written at its
|
|
750
|
+
* current path: folded into a whole body, renamed in an update's delta. A member op addresses a
|
|
751
|
+
* sub-collection, which no retired field names.
|
|
752
|
+
*/
|
|
753
|
+
private underCurrentFields;
|
|
734
754
|
/**
|
|
735
755
|
* A whole-body op's input with a bare ref put in the kind's primary field, so an op takes the same
|
|
736
756
|
* shorthand `apply` does (`wholeBodyChange`): `Token.ref('x@ds')` is a token body at either door.
|
|
@@ -967,7 +987,7 @@ declare class Config {
|
|
|
967
987
|
* in.
|
|
968
988
|
*
|
|
969
989
|
* Checked rather than assumed. "The slug namespace is flat" is a property of the ref grammar, and
|
|
970
|
-
* nothing was making the data honour it: a config declaring `
|
|
990
|
+
* nothing was making the data honour it: a config declaring `sources: { ds }` and
|
|
971
991
|
* `linkedPackages: { ds }` registered clean, `sourceSlugs()` answered `['ds', 'ds']`, and every read
|
|
972
992
|
* through `@ds` picked a winner. Unreachable while a config declares one source kind, and the first
|
|
973
993
|
* thing to go wrong the day it declares two — which is exactly what `sources` exists to allow.
|
|
@@ -995,7 +1015,7 @@ declare class Config {
|
|
|
995
1015
|
* `apply` and {@link run} are two doors on one wall. A {@link Patch} is one of the framework's own
|
|
996
1016
|
* verbs (`create`, `update`, `rename`, `sub-update`, …) with its body already in stored shape, and
|
|
997
1017
|
* `apply` performs exactly that one and records it. A {@link ConfigOp} is anything the catalog
|
|
998
|
-
* addresses — those same verbs, and custom ops such as `
|
|
1018
|
+
* addresses — those same verbs, and custom ops such as `source/copy` that decompose into
|
|
999
1019
|
* several patches — and `run` parses its input against the op's own schema and hands it to the op's
|
|
1000
1020
|
* handler, which for a standard verb is a call to `apply`. So `apply` is what a handler and a
|
|
1001
1021
|
* replay call, and `run` is what a caller calls: a tool, an editor gesture, a commit. A caller
|
|
@@ -1017,13 +1037,13 @@ declare class Config {
|
|
|
1017
1037
|
* A delete records more than one patch when items declare they cannot outlive the target
|
|
1018
1038
|
* ({@link EntityKind.structuralBody}): a delete per dependent, leaves first, then the target, as
|
|
1019
1039
|
* one changeset. `id` then names the first of them and the changeset. */
|
|
1020
|
-
apply(
|
|
1040
|
+
apply(written: Patch, id?: string): this;
|
|
1021
1041
|
/**
|
|
1022
1042
|
* {@link apply} for exactly the patch it is given: a delete takes nothing with it. For replaying a
|
|
1023
1043
|
* patch as it was recorded, since a recorded delete's cascade was recorded beside it, ahead of it.
|
|
1024
1044
|
* Deleting again what the base gained since would remove it with no patch saying so.
|
|
1025
1045
|
*/
|
|
1026
|
-
applyRecorded(
|
|
1046
|
+
applyRecorded(written: Patch, id?: string): this;
|
|
1027
1047
|
/**
|
|
1028
1048
|
* `run` with each kind's invariants judged once, on the config it returns, rather than after every
|
|
1029
1049
|
* `apply` inside it. An invariant walks its whole kind, so a pass that writes a row per entity and
|
|
@@ -1412,7 +1432,7 @@ declare class Config {
|
|
|
1412
1432
|
/** Resolve one derived member — base ⊕ sparse override, with `computed` fields evaluated on read
|
|
1413
1433
|
* (never stored). Returns `undefined` for a path that doesn't derive. */
|
|
1414
1434
|
private resolveDerived;
|
|
1415
|
-
resolve(
|
|
1435
|
+
resolve(written: string, path: string): Entity | undefined;
|
|
1416
1436
|
/**
|
|
1417
1437
|
* Whether this config holds `target`'s entity, at the path the source spells it, through `slug`.
|
|
1418
1438
|
*
|
|
@@ -1615,13 +1635,13 @@ declare class Config {
|
|
|
1615
1635
|
* accessor name, then by the item's slug:
|
|
1616
1636
|
*
|
|
1617
1637
|
* ```ts
|
|
1618
|
-
* Config.registerSources({
|
|
1638
|
+
* Config.registerSources({ sources: { yos: yahooOs } })
|
|
1619
1639
|
* ```
|
|
1620
1640
|
*
|
|
1621
|
-
* The same two levels `register` takes (`{
|
|
1641
|
+
* The same two levels `register` takes (`{ sources: { yos: Source.item(…) } }`) and the
|
|
1622
1642
|
* same two `fromJSON(json, { sources })` takes, so one gesture — declare a source, then hand
|
|
1623
1643
|
* over what it resolved to — reads identically at all three. A flat `{ yos }` said nothing about
|
|
1624
|
-
* which collection `yos` came from, which is fine while `
|
|
1644
|
+
* which collection `yos` came from, which is fine while `source` is the only source kind and
|
|
1625
1645
|
* wrong the day there is a second.
|
|
1626
1646
|
*
|
|
1627
1647
|
* Immutable like every other authoring step: the sources ride on the derived config, and every later
|
|
@@ -1732,7 +1752,7 @@ declare class Config {
|
|
|
1732
1752
|
*
|
|
1733
1753
|
* Answers the slug, which is the kind-agnostic half and therefore the half that belongs here. Turning
|
|
1734
1754
|
* a slug into the typed pin behind it is the source kind's own business (`sourceOfGroup` beside
|
|
1735
|
-
* `
|
|
1755
|
+
* `Source`) — a `Config` method could only hand back a bare `Entity`, and the rule above would
|
|
1736
1756
|
* then be stated once per source kind instead of once.
|
|
1737
1757
|
*/
|
|
1738
1758
|
groupSource({
|
|
@@ -1809,7 +1829,7 @@ declare class Config {
|
|
|
1809
1829
|
* stores, so refusing on that shape would lock a pointer we declared. See `borrowedSlug`.
|
|
1810
1830
|
*/
|
|
1811
1831
|
/**
|
|
1812
|
-
* The pin whose `
|
|
1832
|
+
* The pin whose `options.include` covers `kind:path` and whose source has a row there, so the build
|
|
1813
1833
|
* mints the source's row at the path on its next pass. `undefined` when no declaration covers the
|
|
1814
1834
|
* path, or the declaring source is attached and lacks it. A source that isn't attached is taken at
|
|
1815
1835
|
* its declaration's word.
|
|
@@ -1854,7 +1874,7 @@ declare class Config {
|
|
|
1854
1874
|
path: string;
|
|
1855
1875
|
}[];
|
|
1856
1876
|
/**
|
|
1857
|
-
* Whether one of a declared source's paths is adopted here — covered by the pin's `
|
|
1877
|
+
* Whether one of a declared source's paths is adopted here — covered by the pin's `options.include`.
|
|
1858
1878
|
*
|
|
1859
1879
|
* The question a spelling turns on: an adopted path is addressed bare, because the build mints a
|
|
1860
1880
|
* row for it at the path the source spells, and everything else is addressed qualified. The two are
|
|
@@ -2613,7 +2633,7 @@ declare class Config {
|
|
|
2613
2633
|
* in which fields they set are different sources, and collapsing them would share one cache entry.
|
|
2614
2634
|
*
|
|
2615
2635
|
* Derived rather than spelled, which is what makes it right for kinds nobody has written — it covers
|
|
2616
|
-
* whatever fields a kind actually declares instead of the three `
|
|
2636
|
+
* whatever fields a kind actually declares instead of the three `source` happens to have. The
|
|
2617
2637
|
* key it replaces was `${systemId}@${version}`, which a repo-local source cannot state at all;
|
|
2618
2638
|
* that is the case the walk using it had to pre-skip.
|
|
2619
2639
|
*/
|
|
@@ -2627,7 +2647,7 @@ declare class Config {
|
|
|
2627
2647
|
*
|
|
2628
2648
|
* A row borrowed or copied through a pin is asked of that pin's source in turn, so a system linked
|
|
2629
2649
|
* to a system linked to a foundation answers with the foundation. A row a materialized artifact
|
|
2630
|
-
* flattened to a literal has no pointer left, so the pin whose `
|
|
2650
|
+
* flattened to a literal has no pointer left, so the pin whose `options.include` covers the path
|
|
2631
2651
|
* stands in, provided the row still reads as the source's ({@link matchesSource}); one the
|
|
2632
2652
|
* publisher changed is its own, and so is a linked row this config lays a value of its own over: the
|
|
2633
2653
|
* Bridge's `spectrum/blue/0` points at Yahoo OS's with the Bridge's colours on it, which is the
|
|
@@ -2647,7 +2667,7 @@ declare class Config {
|
|
|
2647
2667
|
path: string;
|
|
2648
2668
|
}): Origin | undefined;
|
|
2649
2669
|
/**
|
|
2650
|
-
* The pin whose `
|
|
2670
|
+
* The pin whose `options.include` covers `kind:path` while the row there still reads as that
|
|
2651
2671
|
* source's: how a row a materialized artifact flattened to a literal is traced back to the pin it
|
|
2652
2672
|
* came through. `undefined` when no declaration covers it, or the row differs from the source's.
|
|
2653
2673
|
*/
|
|
@@ -2695,8 +2715,8 @@ declare class Config {
|
|
|
2695
2715
|
*/
|
|
2696
2716
|
private sourceKindFor;
|
|
2697
2717
|
/**
|
|
2698
|
-
* Every source kind by the accessor name its config type declares it under — `
|
|
2699
|
-
* `
|
|
2718
|
+
* Every source kind by the accessor name its config type declares it under — `sources` →
|
|
2719
|
+
* `source`.
|
|
2700
2720
|
*
|
|
2701
2721
|
* The accessor name is what every source-shaped argument is keyed by ({@link AttachedSources},
|
|
2702
2722
|
* `register`, `Config.load`'s resolvers), because it's the name an author writes, where the kind is
|
|
@@ -2793,7 +2813,7 @@ declare class Config {
|
|
|
2793
2813
|
* {@link retired} answers true for. Both answers are cached per snapshot, so either is safe in a dep
|
|
2794
2814
|
* array.
|
|
2795
2815
|
*/
|
|
2796
|
-
list(
|
|
2816
|
+
list(written: string, opts?: ListOptions): Entity[];
|
|
2797
2817
|
/** The total list behind {@link list}. */
|
|
2798
2818
|
private allOf;
|
|
2799
2819
|
/** A kind's items as a nested folder/file tree, built from the qualified paths at any
|
|
@@ -2851,9 +2871,9 @@ declare class Config {
|
|
|
2851
2871
|
* every sourced ref dangles, and emitters, integrity checks and memos all read exactly there.
|
|
2852
2872
|
*
|
|
2853
2873
|
* `sources` is keyed the way every other source-shaped argument is — by the source kind's accessor
|
|
2854
|
-
* name, `{
|
|
2874
|
+
* name, `{ sources: resolver }` — so the resolver set, the declaration, and
|
|
2855
2875
|
* {@link registerSources} all spell the same key. Each resolver is the kind's own
|
|
2856
|
-
* (`
|
|
2876
|
+
* (`SystemSourceResolver`), and its answer is validated against the schemas that kind declares.
|
|
2857
2877
|
*
|
|
2858
2878
|
* Reads the source entities off a throwaway bare parse, resolves them all, then hydrates once with
|
|
2859
2879
|
* whatever came back attached. The bare parse is cheap and is what lets a resolver be handed the
|