@yahoo/uds-create-config 5.50.0 → 5.51.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.
@@ -8,6 +8,12 @@ interface PresenceProps {
8
8
  /** `popLayout`: a leaving child is taken out of the layout at once, so the one replacing it moves
9
9
  * in without waiting. `wait`: the one replacing it enters once the leaving child's exit ends. */
10
10
  mode?: 'sync' | 'wait' | 'popLayout';
11
+ /** Called once every leaving child has finished its exit, e.g. to return focus after a menu
12
+ * closes. Not called on native, where no presence plays. */
13
+ onExitComplete?: () => void;
14
+ /** `true`: inside a child another presence is taking away, the children this one keeps play their
15
+ * exits too, and that child stays until they end. By default they stay where they are. */
16
+ propagate?: boolean;
11
17
  }
12
18
  /** See {@link PresenceProps}. Never rendered: the build replaces it. */
13
19
  declare function Presence({
@@ -1,9 +1,9 @@
1
1
  import { NATIVE_CONFIG_NAME } from "./platform.js";
2
2
  import { Font } from "../entities/system/Font.js";
3
3
  import { Package } from "../entities/system/Package.js";
4
+ import { File } from "../entities/system/File.js";
4
5
  import { Composite } from "../entities/system/Composite.js";
5
6
  import { Motion } from "../entities/system/Motion.js";
6
- import { File } from "../entities/system/File.js";
7
7
  import { Component } from "../entities/system/Component.js";
8
8
  import { Icon } from "../entities/system/Icon.js";
9
9
  import { Device } from "../entities/system/Device.js";
@@ -1,12 +1,12 @@
1
1
  import { WEB_CONFIG_NAME } from "./platform.js";
2
2
  import { Font } from "../entities/system/Font.js";
3
- import { Settings } from "../entities/system/Settings.js";
4
3
  import { Package } from "../entities/system/Package.js";
4
+ import { File } from "../entities/system/File.js";
5
+ import { Settings } from "../entities/system/Settings.js";
5
6
  import { Composite } from "../entities/system/Composite.js";
6
7
  import { Modifier } from "../entities/system/Modifier.js";
7
8
  import { StyleProperty } from "../entities/system/StyleProperty.js";
8
9
  import { Motion } from "../entities/system/Motion.js";
9
- import { File } from "../entities/system/File.js";
10
10
  import { Token } from "../entities/system/Token.js";
11
11
  import { Component } from "../entities/system/Component.js";
12
12
  import { Icon } from "../entities/system/Icon.js";
@@ -27,6 +27,7 @@ import { nativeLinearGradientsMigration } from "../migrations/20261020173914_nat
27
27
  import { linkedDirMigration } from "../migrations/20261020182408_linked_dir.js";
28
28
  import { lintSettingsMigration } from "../migrations/20261020183330_lint_settings.js";
29
29
  import { directLayerCompositesMigration } from "../migrations/20261022124223_direct_layer_composites.js";
30
+ import { cssContentScriptsMigration } from "../migrations/20261022152120_css_content_scripts.js";
30
31
  import { CanvasRole } from "../entities/system/CanvasRole.js";
31
32
  import { GlobalStyle } from "../entities/system/GlobalStyle.js";
32
33
  import { Guidance } from "../entities/system/Guidance.js";
@@ -187,5 +188,6 @@ if (!registeredSchemaMigrations().has(20261020183330)) {
187
188
  registerSchemaMigrations(lintSettingsMigration);
188
189
  registerSchemaMigrations(directLayerCompositesMigration);
189
190
  }
191
+ if (!registeredSchemaMigrations().has(20261022152120)) registerSchemaMigrations(cssContentScriptsMigration);
190
192
  //#endregion
191
193
  export { System };
@@ -9,10 +9,11 @@ import { defineEntity } from "../../framework/defineEntity.js";
9
9
  import { defineSubEntity, orList } from "../../framework/defineSubEntity.js";
10
10
  import { childrenPolicy, forwardedPropName } from "./element.js";
11
11
  import { interactionKey, interactionModifiers, isInteractionModifier } from "../../framework/interaction-conditions.js";
12
+ import { Package } from "./Package.js";
13
+ import { File } from "./File.js";
12
14
  import { translateLinkedStyleBags } from "./linked-style-values.js";
13
15
  import { listedIn } from "../../framework/utils/enumerated.js";
14
16
  import { valueSchemaOf } from "../../framework/value-domain.js";
15
- import { Package } from "./Package.js";
16
17
  import { bindPreviewGlyphs, glyphMemberRefIn } from "./glyph-identity.js";
17
18
  import { Style, addBagKeyIssues, anatomyPropValue, bagNameEdges, bagRewriteName, bindBagTokens, collectBag, compositeApplication, isPlainRecord, nativeStyleArray, openBag, styleValueFor } from "./style-bag.js";
18
19
  import { storedPreview } from "../../framework/preview-store.js";
@@ -25,7 +26,6 @@ import { instanceAt } from "../../spec/instance.js";
25
26
  import { forwardOptions, forwardsWrite } from "./component-forwards.js";
26
27
  import { assertComponentSourceInput } from "./component-source-fields.js";
27
28
  import { checkStyleSet, styleSetEdits } from "./component-style-set.js";
28
- import { File } from "./File.js";
29
29
  import { forwardRouteInvariants, refusedRoutes } from "./forward-route-invariants.js";
30
30
  import { iconDomainInvariants } from "./icon-domain-invariants.js";
31
31
  import { rootLayerInvariants } from "./root-layer-invariants.js";
@@ -1,7 +1,7 @@
1
1
  import { isRef, pathOf } from "../../framework/utils/refs.js";
2
2
  import { defineEntity } from "../../framework/defineEntity.js";
3
- import { spellValues } from "../../framework/value-domain.js";
4
3
  import { Package } from "./Package.js";
4
+ import { spellValues } from "../../framework/value-domain.js";
5
5
  import { iconMemberMetadata, iconMetadataDeclaration, iconMetadataFormat } from "./icon-metadata.js";
6
6
  import { glyphMembersOf, glyphOfLibrary, libraryGlyphFacts, recordGlyphIdentities } from "./glyph-identity.js";
7
7
  import { iconDomainInvariants } from "./icon-domain-invariants.js";
@@ -42,7 +42,8 @@ declare const CSS_DEFAULTS: {
42
42
  readonly prefix: "uds";
43
43
  readonly preflight: true;
44
44
  readonly fontFaces: true;
45
- readonly rem: "16px";
45
+ readonly rem: "16px"; /** Every script file under `src/`, in each extension a module resolver tries. */
46
+ readonly content: readonly [`src/**/*.{${string}}`];
46
47
  };
47
48
  /** The `css` section — how a web system names what it emits and where its stylesheet applies. A
48
49
  * native system declares no such section, so a native config setting one is refused. */
@@ -5,6 +5,7 @@ import { createSliceMemo } from "../../framework/memo.js";
5
5
  import { parseRootFontSize } from "../../css/root-font-size.js";
6
6
  import { buildFields } from "../../configs/build-options.js";
7
7
  import { resolveInputDir } from "../../framework/build-dirs.js";
8
+ import { SCRIPT_EXTENSIONS } from "./File.js";
8
9
  import { safelistSchema } from "./safelist.js";
9
10
  import { z } from "zod";
10
11
  //#region src/entities/system/Settings.ts
@@ -65,7 +66,9 @@ const CSS_DEFAULTS = {
65
66
  prefix: "uds",
66
67
  preflight: true,
67
68
  fontFaces: true,
68
- rem: "16px"
69
+ rem: "16px",
70
+ /** Every script file under `src/`, in each extension a module resolver tries. */
71
+ content: [`src/**/*.{${[...SCRIPT_EXTENSIONS].map((ext) => ext.slice(1)).join(",")}}`]
69
72
  };
70
73
  const cssFields = z.strictObject({
71
74
  prefix: prefix.meta({
@@ -103,8 +106,8 @@ const cssFields = z.strictObject({
103
106
  /** The files the app's stylesheet is shaken against, as globs from the config's directory. */
104
107
  content: z.array(z.string().min(1)).meta({
105
108
  title: "Content",
106
- description: "The files the build reads for the classes an app uses, as globs relative to the config's directory: `src/**/*.{ts,tsx}`, `app/**/*.tsx`, or a prebuilt package's output such as `node_modules/@acme/widgets/dist/**/*.{js,mjs}`. `.ts`, `.tsx`, `.js`, `.jsx`, `.mjs` and `.cjs` files are read for the components they render, compiled JSX included, and every file a glob names — `.html`, `.vue`, `.md` and the rest — for the classes its text spells, as in `class=\"md:flex\"`. Set, it replaces the default. Unset, `src/**/*.{ts,tsx}`.",
107
- default: ["src/**/*.{ts,tsx}"]
109
+ description: `The files the build reads for the classes an app uses, as globs relative to the config's directory: \`src/**/*.{ts,tsx}\`, \`app/**/*.tsx\`, or a prebuilt package's output such as \`node_modules/@acme/widgets/dist/**/*.{js,mjs}\`. \`.ts\`, \`.tsx\`, \`.mts\`, \`.cts\`, \`.js\`, \`.jsx\`, \`.mjs\` and \`.cjs\` files are read for the components they render, compiled JSX included, and every file a glob names — \`.html\`, \`.vue\`, \`.md\` and the rest — for the classes its text spells, as in \`class="md:flex"\`. Set, it replaces the default. Unset, \`${CSS_DEFAULTS.content[0]}\`.`,
110
+ default: [...CSS_DEFAULTS.content]
108
111
  }).optional(),
109
112
  /** What the stylesheet keeps whether or not a scanned file uses it — for a value built at runtime,
110
113
  * or one used by a file the build does not scan. See `safelist.ts` for the entry forms. */
@@ -1,8 +1,8 @@
1
1
  import { isNativeConfig } from "../../configs/platform.js";
2
2
  import { isRef, kindOf, pathOf, ref, routedSource, sourceHops, splitRef } from "../../framework/utils/refs.js";
3
3
  import { createSliceMemo } from "../../framework/memo.js";
4
- import { Settings, classPrefixOf, prefixed, varPrefixOf } from "./Settings.js";
5
4
  import { File } from "./File.js";
5
+ import { Settings, classPrefixOf, prefixed, varPrefixOf } from "./Settings.js";
6
6
  import { Component } from "./Component.js";
7
7
  import { contentKey } from "../../framework/utils/content-key.js";
8
8
  //#region src/entities/system/component-module.ts
@@ -1,6 +1,6 @@
1
1
  import { splitRef } from "../../framework/utils/refs.js";
2
- import { Settings } from "./Settings.js";
3
2
  import { SCRIPT_EXTENSIONS } from "./File.js";
3
+ import { Settings } from "./Settings.js";
4
4
  //#region src/entities/system/shipped-modules.ts
5
5
  /** A file-name part that marks a test or story (`button.test.tsx`), which no app imports. */
6
6
  const NOT_SHIPPED_MARKERS = new Set([
@@ -73,7 +73,7 @@ interface RecordedSource {
73
73
  * The dense-counter `2` a short-lived scheme stamped before the chain existed reads as the mint
74
74
  * that replaced it (see `detectedWireVersion`).
75
75
  */
76
- declare const SERIALIZED_CONFIG_VERSION = 20261022124223;
76
+ declare const SERIALIZED_CONFIG_VERSION = 20261022152120;
77
77
  interface SerializedConfig {
78
78
  /** See {@link SERIALIZED_CONFIG_VERSION}. Always written; a stored artifact may lack it. */
79
79
  readonly version: number;
@@ -5873,7 +5873,7 @@ var Config = class Config {
5873
5873
  * links from the provided sources. A declared `linkedKind` with no provided source throws. */
5874
5874
  hydrateFrom(stored, options) {
5875
5875
  const claimed = schemaVersionOf(stored);
5876
- if (claimed > 20261022124223) throw new SchemaVersionTooNew(claimed);
5876
+ if (claimed > 20261022152120) throw new SchemaVersionTooNew(claimed);
5877
5877
  const wire = upgradeSerializedConfig(stored);
5878
5878
  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.`);
5879
5879
  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 = 20261022124223;
18
+ declare const CURRENT_SCHEMA_VERSION = 20261022152120;
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 = 20261022124223;
16
+ const CURRENT_SCHEMA_VERSION = 20261022152120;
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 > 20261022124223) 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 > 20261022152120) 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 ?? 20261022124223;
105
+ const target = options?.target ?? 20261022152120;
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 ?? 20261022124223;
163
+ const target = options?.target ?? 20261022152120;
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 ?? 20261022124223;
182
+ const target = options?.target ?? 20261022152120;
183
183
  const entries = [];
184
184
  const held = [];
185
185
  const retired = [];
package/dist/index.js CHANGED
@@ -28,12 +28,13 @@ import { resolveValueType, sniffValueType } from "./css/value-type.js";
28
28
  import { parseRootFontSize } from "./css/root-font-size.js";
29
29
  import { BUILD_DEFAULTS } from "./configs/build-options.js";
30
30
  import { resolveInputDir, resolveLinkedAlias, resolveLinkedDir, resolveOutDir, resolveOutputAlias, resolveRetiredLinkedDir, resolveSourceAlias } from "./framework/build-dirs.js";
31
+ import { Package } from "./entities/system/Package.js";
32
+ import { File, SCRIPT_EXTENSIONS, isBinaryAsset } from "./entities/system/File.js";
31
33
  import { safelistEntrySchema } from "./entities/system/safelist.js";
32
34
  import { BuildSection, CSS_DEFAULTS, CssSection, LintSection, PLAYGROUND_DEFAULTS, PlaygroundSection, Settings, SystemSection, classPrefixOf, cssPrefixes, deriveInputDir, prefixed, varPrefixOf } from "./entities/system/Settings.js";
33
35
  import { TOKEN_READERS, isTokenReader, parseTokenValue, rootFontSize, spellTokenRead, tokenExists, tokenValueRow, tokenValueRows } from "./entities/system/token-values.js";
34
36
  import { CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, cssProperty, cssValueIssue, isCssProperty } from "./css/values.js";
35
37
  import { valueLeavesOf, valueSchemaOf } from "./framework/value-domain.js";
36
- import { Package } from "./entities/system/Package.js";
37
38
  import { ICON_METADATA_FORMATS, glyphExportRule, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, iconMetadataSourceFile, tablerExportName, tablerStyledExportName } from "./entities/system/icon-metadata.js";
38
39
  import { Composite } from "./entities/system/Composite.js";
39
40
  import { MODIFIER_CATEGORIES, Modifier, WEB_ACTIVATIONS, modeAxes, modifierAxes, modifierGroupFields, modifierInvariants, modifierLeaf } from "./entities/system/Modifier.js";
@@ -58,7 +59,6 @@ import { canvasCellAt, canvasDefaultCoordinate, cellAxes } from "./spec/cell.js"
58
59
  import { instanceHolding } from "./spec/instance.js";
59
60
  import { componentSourceDerivedFields } from "./entities/system/component-source-fields.js";
60
61
  import { styleSetEdits } from "./entities/system/component-style-set.js";
61
- import { File, SCRIPT_EXTENSIONS, isBinaryAsset } from "./entities/system/File.js";
62
62
  import { convertLinkedTokenValue, prepareLinkedTokenBody } from "./entities/system/linked-token-values.js";
63
63
  import { Token, defineOverride, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers } from "./entities/system/Token.js";
64
64
  import { Component, SLOT_CODE_FORMS, blankComponentBody, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef } from "./entities/system/Component.js";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * `css.content` defaults to every script file under `src/` — `.ts`, `.tsx`, `.mts`, `.cts`, `.js`,
3
+ * `.jsx`, `.mjs` and `.cjs` — where it was `.ts` and `.tsx` alone, so a JavaScript app's sources are
4
+ * shaken against too. Only the default the schema states moved: a stored `content` is kept as it was,
5
+ * and an unset one was never written, so `up` is identity and no stored draft patch is affected.
6
+ *
7
+ * Deletable once no stored config predates this version.
8
+ */
9
+ import type { SchemaMigration } from '../framework/schema-version';
10
+ export declare const CSS_CONTENT_SCRIPTS_VERSION = 20261022152120;
11
+ export declare const cssContentScriptsMigration: SchemaMigration;
@@ -0,0 +1,10 @@
1
+ //#region src/migrations/20261022152120_css_content_scripts.ts
2
+ const CSS_CONTENT_SCRIPTS_VERSION = 20261022152120;
3
+ const cssContentScriptsMigration = {
4
+ version: CSS_CONTENT_SCRIPTS_VERSION,
5
+ up(json) {
6
+ return json;
7
+ }
8
+ };
9
+ //#endregion
10
+ export { CSS_CONTENT_SCRIPTS_VERSION, cssContentScriptsMigration };