@ikas/bp-storefront 1.4.0-beta.88 → 1.4.0-beta.89

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.
@@ -118,25 +118,35 @@ export type ThemeGlobals = {
118
118
  };
119
119
  };
120
120
  /**
121
- * Runtime-facing token views returned by the `@ikas/bp-storefront` getters
122
- * (`getThemeColors` / `getThemeTypography` / ...). They intentionally OMIT `name`: at runtime
123
- * a token must be identified by its STABLE `id` (color `cssVar` / `var(--<id>)`, typography
124
- * & keyframe `className`/`ref` `_<id>`, color-scheme slot a `colorsByScheme` key), NEVER by
125
- * its human name. Names are non-unique (two design assets can ship the same name) and renaming
126
- * them must not break references, so reading `.name` at render is an anti-pattern hiding it
127
- * from the return type turns that into a compile error.
121
+ * Stamps a theme-token type as its RUNTIME view returned by the `@ikas/bp-storefront` getters
122
+ * (`getThemeColors` / `getThemeTypography` / ...). `name` is removed, then re-added as a
123
+ * DEPRECATED `never`. Plainly `Omit`-ing it would only ever surface a bare "Property 'name' does
124
+ * not exist on type" re-adding it as a documented `@deprecated never` instead means a developer
125
+ * who reaches for `.name` at runtime sees the strikethrough + the explanation below on hover, and
126
+ * any actual use of the value is a type error (`never`). The agent is steered the same way.
128
127
  *
129
- * The full types above (with `name`) are still produced in the serialized {@link ThemeGlobals}
130
- * payload and surfaced by the CLI/MCP `list-theme-globals` AUTHORING read, so the agent/editor
131
- * can still discover and reuse existing tokens by name. `name` is hidden ONLY from the runtime
132
- * getter return types.
128
+ * The full types above (with a real `name: string`) are still produced in the serialized
129
+ * {@link ThemeGlobals} payload and surfaced by the CLI/MCP `list-theme-globals` AUTHORING read, so
130
+ * the agent/editor can still discover and reuse existing tokens by name. `name` is hidden ONLY at
131
+ * the runtime getter return types (the getters cast the live payload to these views).
133
132
  */
134
- export type RuntimeDesignToken = Omit<DesignToken, "name">;
135
- export type RuntimeTypographyToken = Omit<TypographyToken, "name">;
136
- export type RuntimeBreakpointToken = Omit<BreakpointToken, "name">;
137
- export type RuntimeKeyframeToken = Omit<KeyframeToken, "name">;
138
- export type RuntimeColorSchemeToken = Omit<ColorSchemeToken, "name">;
139
- export type RuntimeColorSchemeSlot = Omit<ColorSchemeSlot, "name">;
133
+ type RuntimeView<T> = Omit<T, "name"> & {
134
+ /**
135
+ * @deprecated `name` is authoring-only and is NOT exposed at runtime. Identify this token by its
136
+ * STABLE `id` instead — color → `cssVar` (`var(--<id>)`), typography & keyframe → `className` /
137
+ * `ref` (`_<id>`), color-scheme slot → a `colorsByScheme` key. Token names are non-unique (two
138
+ * design assets can ship the same name) and renaming one must not break references, so matching
139
+ * by name is unsafe. Need a human-readable label? Read it from `list_theme_globals` (MCP/CLI) or
140
+ * the editor's Styles panel — not from the runtime getters.
141
+ */
142
+ name?: never;
143
+ };
144
+ export type RuntimeDesignToken = RuntimeView<DesignToken>;
145
+ export type RuntimeTypographyToken = RuntimeView<TypographyToken>;
146
+ export type RuntimeBreakpointToken = RuntimeView<BreakpointToken>;
147
+ export type RuntimeKeyframeToken = RuntimeView<KeyframeToken>;
148
+ export type RuntimeColorSchemeToken = RuntimeView<ColorSchemeToken>;
149
+ export type RuntimeColorSchemeSlot = RuntimeView<ColorSchemeSlot>;
140
150
  /**
141
151
  * Runtime view of {@link ThemeGlobals.colorSchemes} (returned by `getThemeColorSchemes`). The
142
152
  * slot list carries only `{ id }`: slot display LABELS (the slot `name`) are authoring-only —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/bp-storefront",
3
- "version": "1.4.0-beta.88",
3
+ "version": "1.4.0-beta.89",
4
4
  "description": "A framework for the ikas blueprint storefronts.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",