@yahoo/uds-create-config 5.77.2 → 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.
Files changed (56) hide show
  1. package/dist/configs/CanvasConfig.d.ts +1 -1
  2. package/dist/configs/react-native-system.d.ts +1 -1
  3. package/dist/configs/react-native-system.js +1 -1
  4. package/dist/configs/system.d.ts +1 -1
  5. package/dist/configs/system.js +3 -1
  6. package/dist/entities/system/{LinkedSystem.d.ts → Source.d.ts} +19 -11
  7. package/dist/entities/system/{LinkedSystem.js → Source.js} +127 -130
  8. package/dist/entities/system/component-module.js +2 -2
  9. package/dist/entities/system/copy-plan.js +5 -2
  10. package/dist/entities/system/css-motion-reach.js +6 -6
  11. package/dist/entities/system/link-declaration.d.ts +6 -68
  12. package/dist/entities/system/link-declaration.js +30 -4
  13. package/dist/entities/system/link-plan.d.ts +2 -2
  14. package/dist/entities/system/link-plan.js +44 -15
  15. package/dist/entities/system/motion-variants.js +2 -2
  16. package/dist/framework/Config.d.ts +59 -24
  17. package/dist/framework/Config.js +170 -41
  18. package/dist/framework/affected.d.ts +38 -0
  19. package/dist/framework/affected.js +191 -0
  20. package/dist/framework/changes.d.ts +1 -1
  21. package/dist/framework/changes.js +2 -2
  22. package/dist/framework/defineConfig.d.ts +3 -3
  23. package/dist/framework/defineEntity.d.ts +4 -3
  24. package/dist/framework/defineEntity.js +2 -1
  25. package/dist/framework/derived-mutations.d.ts +1 -1
  26. package/dist/framework/derived-mutations.js +1 -1
  27. package/dist/framework/inline-sources.js +2 -2
  28. package/dist/framework/projections.d.ts +14 -1
  29. package/dist/framework/projections.js +24 -1
  30. package/dist/framework/registry.d.ts +13 -7
  31. package/dist/framework/registry.js +3 -2
  32. package/dist/framework/retired-fields.d.ts +33 -0
  33. package/dist/framework/retired-fields.js +148 -0
  34. package/dist/framework/schema-version.d.ts +1 -1
  35. package/dist/framework/schema-version.js +5 -5
  36. package/dist/framework/schemas.js +1 -1
  37. package/dist/framework/signature.js +4 -1
  38. package/dist/framework/source-integrity.d.ts +2 -2
  39. package/dist/framework/source-integrity.js +2 -2
  40. package/dist/framework/sources.d.ts +3 -3
  41. package/dist/framework/sources.js +1 -1
  42. package/dist/framework/utils/content-key.js +1 -1
  43. package/dist/framework/utils/field-schema.js +7 -2
  44. package/dist/framework/utils/refs.d.ts +1 -1
  45. package/dist/framework/utils/refs.js +1 -1
  46. package/dist/index.d.ts +7 -5
  47. package/dist/index.js +6 -4
  48. package/dist/migrations/2.0.0/v1-artifact.d.ts +1 -1
  49. package/dist/migrations/20261105185042_sources_stored.d.ts +19 -0
  50. package/dist/migrations/20261105185042_sources_stored.js +125 -0
  51. package/dist/spec/links.d.ts +1 -1
  52. package/dist/spec/links.js +1 -1
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +2 -2
  55. package/dist/framework/authored-at.d.ts +0 -31
  56. package/dist/framework/authored-at.js +0 -73
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yahoo/uds-create-config",
3
- "version": "5.77.2",
3
+ "version": "5.79.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -123,5 +123,5 @@
123
123
  "files": [
124
124
  "dist"
125
125
  ],
126
- "udsSchemaVersion": 20261104151013
126
+ "udsSchemaVersion": 20261105185042
127
127
  }
@@ -1,31 +0,0 @@
1
- //#region src/framework/authored-at.d.ts
2
- /**
3
- * A stored field an author writes somewhere else in the body: `{ link: 'options.include' }` stores
4
- * `options.include` as `link`. Declared by the kind (`EntityKind.authoredAt`), and read in three
5
- * places that have to agree: `register` folds the authored spelling into the stored field, the config
6
- * emitter writes the stored field back where an author writes it, and a patch written into a
7
- * checkout lands at whichever of the two the file already spells.
8
- *
9
- * The stored field stays a spelling an author may use, so a file written before the move keeps
10
- * evaluating. A body that spells both is refused, since the two are one value.
11
- */
12
- /** Stored field → the dotted path it is authored at. */
13
- type AuthoredAt = Readonly<Record<string, string>>;
14
- /** A body as authored, with each field `authoredAt` moves folded into the field it's stored as. */
15
- declare function storedFromAuthored({
16
- body,
17
- authoredAt
18
- }: {
19
- readonly body: Record<string, unknown>;
20
- readonly authoredAt: AuthoredAt;
21
- }): Record<string, unknown>;
22
- /** A stored body as an author writes it: each field `authoredAt` moves, at the path it's authored at. */
23
- declare function authoredFromStored({
24
- body,
25
- authoredAt
26
- }: {
27
- readonly body: Record<string, unknown>;
28
- readonly authoredAt: AuthoredAt;
29
- }): Record<string, unknown>;
30
- //#endregion
31
- export { AuthoredAt, authoredFromStored, storedFromAuthored };
@@ -1,73 +0,0 @@
1
- import { isPlainObject, setAtPath } from "./utils/field-path.js";
2
- import { rejectData } from "./rejection.js";
3
- //#region src/framework/authored-at.ts
4
- /**
5
- * A stored field an author writes somewhere else in the body: `{ link: 'options.include' }` stores
6
- * `options.include` as `link`. Declared by the kind (`EntityKind.authoredAt`), and read in three
7
- * places that have to agree: `register` folds the authored spelling into the stored field, the config
8
- * emitter writes the stored field back where an author writes it, and a patch written into a
9
- * checkout lands at whichever of the two the file already spells.
10
- *
11
- * The stored field stays a spelling an author may use, so a file written before the move keeps
12
- * evaluating. A body that spells both is refused, since the two are one value.
13
- */
14
- /** The value at a dotted path, or `undefined` when nothing is there. */
15
- function valueAt(body, segments) {
16
- let at = body;
17
- for (const segment of segments) {
18
- if (!isPlainObject(at) || !Object.hasOwn(at, segment)) return void 0;
19
- at = at[segment];
20
- }
21
- return at;
22
- }
23
- /** `body` without the value at `segments`, pruning a parent the removal empties. */
24
- function without(body, segments) {
25
- const [head, ...rest] = segments;
26
- if (head === void 0 || !Object.hasOwn(body, head)) return body;
27
- const { [head]: child, ...others } = body;
28
- if (rest.length === 0) return others;
29
- if (!isPlainObject(child)) return body;
30
- const remaining = without(child, rest);
31
- return Object.keys(remaining).length === 0 ? others : {
32
- ...others,
33
- [head]: remaining
34
- };
35
- }
36
- /** `body` with `value` first among the keys of the container at `segments`. */
37
- function withFirst(body, segments, value) {
38
- const [head, ...rest] = segments;
39
- if (head === void 0) return body;
40
- if (rest.length === 0) return {
41
- [head]: value,
42
- ...body
43
- };
44
- const child = isPlainObject(body[head]) ? body[head] : {};
45
- return {
46
- ...body,
47
- [head]: withFirst(child, rest, value)
48
- };
49
- }
50
- /** A body as authored, with each field `authoredAt` moves folded into the field it's stored as. */
51
- function storedFromAuthored({ body, authoredAt }) {
52
- let stored = body;
53
- for (const [field, at] of Object.entries(authoredAt)) {
54
- const segments = at.split(".");
55
- const value = valueAt(stored, segments);
56
- if (value === void 0) continue;
57
- 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);
58
- stored = setAtPath(without(stored, segments), [field], value);
59
- }
60
- return stored;
61
- }
62
- /** A stored body as an author writes it: each field `authoredAt` moves, at the path it's authored at. */
63
- function authoredFromStored({ body, authoredAt }) {
64
- let authored = body;
65
- for (const [field, at] of Object.entries(authoredAt)) {
66
- if (authored[field] === void 0) continue;
67
- const { [field]: value, ...rest } = authored;
68
- authored = withFirst(rest, at.split("."), value);
69
- }
70
- return authored;
71
- }
72
- //#endregion
73
- export { authoredFromStored, storedFromAuthored };