@yahoo/uds-create-config 5.82.1 → 5.84.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.
@@ -193,7 +193,16 @@ declare const ReactNativeSystemDefinition: ConfigClass<{
193
193
  }, _$zod_v4_core0.$strip>, _$zod.ZodObject<Omit<{
194
194
  cssPrefix: _$zod.ZodOptional<_$zod.ZodString>;
195
195
  cssVariables: _$zod.ZodOptional<_$zod.ZodBoolean>;
196
- }, "cssPrefix" | "cssVariables"> & {}, _$zod_v4_core0.$strip>, "token", {}, Record<never, never>, false, Record<never, never>, Record<never, never>>;
196
+ }, "cssPrefix" | "cssVariables"> & {}, _$zod_v4_core0.$strip>, "token", {
197
+ readonly get: {
198
+ readonly input: _$zod.ZodObject<{
199
+ path: _$zod.ZodType<string, string | undefined, _$zod_v4_core0.$ZodTypeInternals<string, string | undefined>>;
200
+ detail: _$zod.ZodOptional<_$zod.ZodEnum<{
201
+ full: "full";
202
+ }>>;
203
+ }, _$zod_v4_core0.$strip>;
204
+ };
205
+ }, Record<never, never>, false, Record<never, never>, Record<never, never>>;
197
206
  components: ComponentClass;
198
207
  modifiers: NativeModifierClass;
199
208
  motion: MotionClass;
@@ -42,6 +42,8 @@ import { sourcesAuthoringMigration } from "../migrations/20261103115059_sources_
42
42
  import { buildDebugMigration } from "../migrations/20261104151013_build_debug.js";
43
43
  import { sourcesStoredMigration } from "../migrations/20261105185042_sources_stored.js";
44
44
  import { modifierClassPrefixMigration } from "../migrations/20261106185419_modifier_class_prefix.js";
45
+ import { componentGetDetailMigration } from "../migrations/20261107213031_component_get_detail.js";
46
+ import { tokenGetDetailMigration } from "../migrations/20261108042210_token_get_detail.js";
45
47
  import { CanvasRole } from "../entities/system/CanvasRole.js";
46
48
  import { GlobalStyle } from "../entities/system/GlobalStyle.js";
47
49
  import { Guidance } from "../entities/system/Guidance.js";
@@ -220,5 +222,7 @@ if (!registeredSchemaMigrations().has(20261103115059)) registerSchemaMigrations(
220
222
  if (!registeredSchemaMigrations().has(20261104151013)) registerSchemaMigrations(buildDebugMigration);
221
223
  if (!registeredSchemaMigrations().has(20261105185042)) registerSchemaMigrations(sourcesStoredMigration);
222
224
  if (!registeredSchemaMigrations().has(20261106185419)) registerSchemaMigrations(modifierClassPrefixMigration);
225
+ if (!registeredSchemaMigrations().has(20261107213031)) registerSchemaMigrations(componentGetDetailMigration);
226
+ if (!registeredSchemaMigrations().has(20261108042210)) registerSchemaMigrations(tokenGetDetailMigration);
223
227
  //#endregion
224
228
  export { System };
@@ -100,6 +100,15 @@ declare const NativeToken: EntityClass<z.ZodObject<Omit<{
100
100
  }, z.core.$strip>, z.ZodObject<Omit<{
101
101
  cssPrefix: z.ZodOptional<z.ZodString>;
102
102
  cssVariables: z.ZodOptional<z.ZodBoolean>;
103
- }, "cssPrefix" | "cssVariables"> & {}, z.core.$strip>, "token", {}, Record<never, never>, false, Record<never, never>, Record<never, never>>;
103
+ }, "cssPrefix" | "cssVariables"> & {}, z.core.$strip>, "token", {
104
+ readonly get: {
105
+ readonly input: z.ZodObject<{
106
+ path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
107
+ detail: z.ZodOptional<z.ZodEnum<{
108
+ full: "full";
109
+ }>>;
110
+ }, z.core.$strip>;
111
+ };
112
+ }, Record<never, never>, false, Record<never, never>, Record<never, never>>;
104
113
  //#endregion
105
114
  export { NativeToken, nativeTokenValue };
@@ -861,6 +861,14 @@ declare const ComponentEntity: EntityClass<z.ZodObject<{
861
861
  }, z.core.$strip>;
862
862
  }, z.core.$strip>;
863
863
  };
864
+ readonly get: {
865
+ readonly input: z.ZodObject<{
866
+ path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
867
+ detail: z.ZodOptional<z.ZodEnum<{
868
+ full: "full";
869
+ }>>;
870
+ }, z.core.$strip>;
871
+ };
864
872
  readonly validate: {
865
873
  readonly input: z.ZodObject<{
866
874
  path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
@@ -2928,6 +2928,17 @@ element: refSchema })
2928
2928
  });
2929
2929
  }
2930
2930
  },
2931
+ get: {
2932
+ input: z.object({
2933
+ path: pathInput("component"),
2934
+ detail: z.enum(["full"]).optional().describe("`\"full\"` adds what an author needs: each layer's forwards and what it could still forward, and the style rules, anatomy and preview content.")
2935
+ }),
2936
+ readOnly: true,
2937
+ label: "Get",
2938
+ description: "Get one component by its qualified `path`: its props and a usage example. Pass `detail: \"full\"` for the forwards, style rules, anatomy and preview content, which editing it needs.",
2939
+ scope: "item",
2940
+ handler: (input, config) => config.resolve("component", String(input.path))
2941
+ },
2931
2942
  validate: {
2932
2943
  input: z.object({
2933
2944
  path: pathInput("component"),
@@ -92,7 +92,16 @@ declare const TokenEntity: EntityClass<z.ZodObject<{
92
92
  }, z.core.$strip>, z.ZodObject<{
93
93
  cssPrefix: z.ZodOptional<z.ZodString>;
94
94
  cssVariables: z.ZodOptional<z.ZodBoolean>;
95
- }, z.core.$strip>, "token", {}, Record<never, never>, false, Record<never, never>, Record<never, never>>;
95
+ }, z.core.$strip>, "token", {
96
+ readonly get: {
97
+ readonly input: z.ZodObject<{
98
+ path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
99
+ detail: z.ZodOptional<z.ZodEnum<{
100
+ full: "full";
101
+ }>>;
102
+ }, z.core.$strip>;
103
+ };
104
+ }, Record<never, never>, false, Record<never, never>, Record<never, never>>;
96
105
  /** A token ref as an authoring file holds it: the marker, `extend`, and the value readers. */
97
106
  type TokenReference<Path extends string> = KindRef<typeof TokenEntity, 'token', Path> & TokenReaders<Path>;
98
107
  /**
@@ -1,5 +1,6 @@
1
1
  import { isRef, kindOf, pathOf, ref, refKey, sourceOf } from "../../framework/utils/refs.js";
2
2
  import { WEB_CONFIG_NAME } from "../../configs/platform.js";
3
+ import { pathInput } from "../../framework/schemas.js";
3
4
  import { composedValueSchemas } from "./composed-values.js";
4
5
  import { defineEntity } from "../../framework/defineEntity.js";
5
6
  import { defineSubEntity, orList } from "../../framework/defineSubEntity.js";
@@ -147,7 +148,20 @@ const TokenEntity = defineEntity({
147
148
  const { value, overrides } = data;
148
149
  return { aliases: [value, ...Object.values(overrides ?? {}).map((override) => override?.value)].filter((alias) => isRef(alias) && kindOf(alias.__ref) === "token") };
149
150
  },
150
- schemas: { create: { description: `Create a token at \`<group>/<name>\` — \`data.value\` is the CSS value. The first path segment is its group, and a style property takes a whole group as one ref (\`${JSON.stringify(ref("token", "<group>"))}\`), so put the tokens one prop should offer in one group rather than listing values on the prop.` } }
151
+ schemas: {
152
+ get: {
153
+ input: z.object({
154
+ path: pathInput("token"),
155
+ detail: z.enum(["full"]).optional().describe("`\"full\"` adds the token's stored body: its value, overrides and metadata as authored.")
156
+ }),
157
+ readOnly: true,
158
+ label: "Get",
159
+ description: "Get one token by its qualified `path`: what it comes to in each mode, and the tokens it refers to on the way. Pass `detail: \"full\"` for its stored body, which editing it needs.",
160
+ scope: "item",
161
+ handler: (input, config) => config.resolve("token", String(input.path))
162
+ },
163
+ create: { description: `Create a token at \`<group>/<name>\` — \`data.value\` is the CSS value. The first path segment is its group, and a style property takes a whole group as one ref (\`${JSON.stringify(ref("token", "<group>"))}\`), so put the tokens one prop should offer in one group rather than listing values on the prop.` }
164
+ }
151
165
  });
152
166
  /**
153
167
  * Token refs add the value readers a render calls — `Token.ref('spacing/2.5').px()`. Phantoms, like a
@@ -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 = 20261106185419;
77
+ declare const SERIALIZED_CONFIG_VERSION = 20261108042210;
78
78
  interface SerializedConfig {
79
79
  /** See {@link SERIALIZED_CONFIG_VERSION}. Always written; a stored artifact may lack it. */
80
80
  readonly version: number;
@@ -6535,7 +6535,7 @@ var Config = class Config {
6535
6535
  * links from the provided sources. A declared `linkedKind` with no provided source throws. */
6536
6536
  hydrateFrom(stored, options) {
6537
6537
  const claimed = schemaVersionOf(stored);
6538
- if (claimed > 20261106185419) throw new SchemaVersionTooNew(claimed);
6538
+ if (claimed > 20261108042210) throw new SchemaVersionTooNew(claimed);
6539
6539
  const wire = upgradeSerializedConfig(stored);
6540
6540
  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 — import the config type's module (e.g. \`configs/system\`) before hydrating.`);
6541
6541
  const leftover = wire.options;
@@ -15,7 +15,7 @@ import { Patch, SerializedConfig } from "./Config.js";
15
15
  * sets this constant to its own older timestamp; the merge ref then carries a registered migration
16
16
  * newer than the constant, and the assertion fails until the author re-mints.
17
17
  */
18
- declare const CURRENT_SCHEMA_VERSION = 20261106185419;
18
+ declare const CURRENT_SCHEMA_VERSION = 20261108042210;
19
19
  /** What the walkers need to see of an envelope — loose on purpose, so a typed `SerializedConfig`
20
20
  * and a raw old-shape record both flow in without casts. */
21
21
  interface VersionStamped {
@@ -13,7 +13,7 @@ import { ConfigFormatError } from "./rejection.js";
13
13
  * sets this constant to its own older timestamp; the merge ref then carries a registered migration
14
14
  * newer than the constant, and the assertion fails until the author re-mints.
15
15
  */
16
- const CURRENT_SCHEMA_VERSION = 20261106185419;
16
+ const CURRENT_SCHEMA_VERSION = 20261108042210;
17
17
  /** The mint that moved `options` into the `settings` kind — restated here, rather than imported
18
18
  * from the migration that owns it, because that migration imports this module. */
19
19
  const SETTINGS_AS_KIND_VERSION = 20260908171448;
@@ -45,7 +45,7 @@ function registerSchemaMigrations(...migrations) {
45
45
  for (const migration of migrations) {
46
46
  if (migration.version !== 1 && !isMintTimestamp(migration.version)) throw new Error(`Schema migration version ${migration.version} is not a mint timestamp — mint one with \`date +%Y%m%d%H%M%S\`, like a supabase migration.`);
47
47
  if (REGISTERED.has(migration.version)) throw new Error(`A schema migration at version ${migration.version} is already registered.`);
48
- if (migration.version > 20261106185419) throw new Error(`Schema migration ${migration.version} is newer than CURRENT_SCHEMA_VERSION (${CURRENT_SCHEMA_VERSION}) — a stale branch merged, or the mint forgot to bump the constant. Re-mint: set CURRENT_SCHEMA_VERSION to the newest migration version.`);
48
+ if (migration.version > 20261108042210) throw new Error(`Schema migration ${migration.version} is newer than CURRENT_SCHEMA_VERSION (${CURRENT_SCHEMA_VERSION}) — a stale branch merged, or the mint forgot to bump the constant. Re-mint: set CURRENT_SCHEMA_VERSION to the newest migration version.`);
49
49
  REGISTERED.set(migration.version, migration);
50
50
  }
51
51
  }
@@ -102,7 +102,7 @@ function pendingFor(version, target, options) {
102
102
  * Already-current input passes through untouched — same reference, so hot paths pay nothing.
103
103
  */
104
104
  function upgradeSerializedConfig(json, options) {
105
- const target = options?.target ?? 20261106185419;
105
+ const target = options?.target ?? 20261108042210;
106
106
  const version = detectedWireVersion(json);
107
107
  if (version > target) throw new SchemaVersionTooNew(version, target);
108
108
  const raw = json;
@@ -160,7 +160,7 @@ function upgradedSources(json, options) {
160
160
  * meaning under the current schema and replay skips it — reported by the caller, not swallowed here.
161
161
  */
162
162
  function upgradePatch(patch, writtenAt, options) {
163
- const target = options?.target ?? 20261106185419;
163
+ const target = options?.target ?? 20261108042210;
164
164
  if (writtenAt > target) throw new SchemaVersionTooNew(writtenAt, target);
165
165
  let current = patch;
166
166
  for (const migration of pendingFor(writtenAt, target, options)) {
@@ -179,7 +179,7 @@ function upgradePatch(patch, writtenAt, options) {
179
179
  * stamp would cause.
180
180
  */
181
181
  function upgradeDraftEntries(draft, options) {
182
- const target = options?.target ?? 20261106185419;
182
+ const target = options?.target ?? 20261108042210;
183
183
  const entries = [];
184
184
  const held = [];
185
185
  const retired = [];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Additions only, so the envelope passes through as it is:
3
+ *
4
+ * - The `component/get` read takes an optional `detail: "full"`, which adds the forwards, style
5
+ * rules, anatomy and preview content to the answer. A read is never stored, so no patch moves.
6
+ */
7
+ import type { SchemaMigration } from '../framework/schema-version';
8
+ export declare const COMPONENT_GET_DETAIL_VERSION = 20261107213031;
9
+ export declare const componentGetDetailMigration: SchemaMigration;
@@ -0,0 +1,10 @@
1
+ //#region src/migrations/20261107213031_component_get_detail.ts
2
+ const COMPONENT_GET_DETAIL_VERSION = 20261107213031;
3
+ const componentGetDetailMigration = {
4
+ version: COMPONENT_GET_DETAIL_VERSION,
5
+ up(json) {
6
+ return json;
7
+ }
8
+ };
9
+ //#endregion
10
+ export { COMPONENT_GET_DETAIL_VERSION, componentGetDetailMigration };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Additions only, so the envelope passes through as it is:
3
+ *
4
+ * - The `token/get` read takes an optional `detail: "full"`, which adds the token's stored body to
5
+ * what it comes to in each mode. A read is never stored, so no patch moves.
6
+ */
7
+ import type { SchemaMigration } from '../framework/schema-version';
8
+ export declare const TOKEN_GET_DETAIL_VERSION = 20261108042210;
9
+ export declare const tokenGetDetailMigration: SchemaMigration;
@@ -0,0 +1,10 @@
1
+ //#region src/migrations/20261108042210_token_get_detail.ts
2
+ const TOKEN_GET_DETAIL_VERSION = 20261108042210;
3
+ const tokenGetDetailMigration = {
4
+ version: TOKEN_GET_DETAIL_VERSION,
5
+ up(json) {
6
+ return json;
7
+ }
8
+ };
9
+ //#endregion
10
+ export { TOKEN_GET_DETAIL_VERSION, tokenGetDetailMigration };