@takazudo/zdtp 0.1.0-next.0 → 0.1.0-next.1

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/CHANGELOG.md CHANGED
@@ -1,6 +1,32 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 0.1.0-next.1
4
+
5
+ ### Fixed — Astro consumers: `@takazudo/zdtp/astro` value import broke real npm installs ([#308](https://github.com/Takazudo/zudo-design-token-panel/issues/308))
6
+
7
+ - The documented Astro host import
8
+ `import { DesignTokenPanelHost } from '@takazudo/zdtp/astro'` forced
9
+ `dist/astro/index.js` to statically `import` the raw `.astro` component.
10
+ Under a `file:` workspace link Vite compiled it, but as a real
11
+ `node_modules` dependency it was externalized, so Node hit the raw `.astro`
12
+ at prerender and threw `ERR_UNKNOWN_FILE_EXTENSION`. **Every real npm Astro
13
+ consumer following the README crashed at build time.**
14
+ - **Fix**: the `@takazudo/zdtp/astro` entry is now JS-helpers-and-types only —
15
+ it no longer re-exports the component value, so the crashing `.astro`
16
+ literal can't appear in the bundled JS. Import the host component directly
17
+ from its dedicated subexport, which the consumer's own Astro toolchain
18
+ compiles natively:
19
+
20
+ ```astro
21
+ import DesignTokenPanelHost from '@takazudo/zdtp/astro/DesignTokenPanelHost.astro';
22
+ ```
23
+
24
+ Type-only imports (`import type { PanelConfig } from '@takazudo/zdtp/astro'`)
25
+ are unchanged — they are erased at build. The `./astro/host-adapter`
26
+ side-effect import is unchanged. Docs (README, PORTABLE-CONTRACT, doc-site
27
+ recipes) updated to the direct-subexport form.
28
+
29
+ ## 0.1.0-next.0
4
30
 
5
31
  ### Renamed — npm package is now `@takazudo/zdtp`
6
32
 
package/README.md CHANGED
@@ -290,7 +290,7 @@ The `<DesignTokenPanelHost>` component AND a paired `<script>` block that loads
290
290
  ---
291
291
  // src/layouts/Layout.astro
292
292
  import { ClientRouter } from 'astro:transitions';
293
- import { DesignTokenPanelHost } from '@takazudo/zdtp/astro';
293
+ import DesignTokenPanelHost from '@takazudo/zdtp/astro/DesignTokenPanelHost.astro';
294
294
  import { myPanelConfig } from '../lib/my-panel-config';
295
295
  import '@takazudo/zdtp/styles';
296
296
  ---
@@ -736,7 +736,7 @@ export const myPanelConfig: PanelConfig = {
736
736
 
737
737
  ```astro
738
738
  ---
739
- import { DesignTokenPanelHost } from '@takazudo/zdtp/astro';
739
+ import DesignTokenPanelHost from '@takazudo/zdtp/astro/DesignTokenPanelHost.astro';
740
740
  import { myPanelConfig } from '../lib/my-panel-config';
741
741
  ---
742
742
 
@@ -999,7 +999,7 @@ This recipe walks through wiring the panel into a project that does not currentl
999
999
 
1000
1000
  ```astro
1001
1001
  ---
1002
- import { DesignTokenPanelHost } from '@takazudo/zdtp/astro';
1002
+ import DesignTokenPanelHost from '@takazudo/zdtp/astro/DesignTokenPanelHost.astro';
1003
1003
  import { myPanelConfig } from '../lib/panel-config';
1004
1004
  ---
1005
1005
 
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * ```astro
9
9
  * ---
10
- * import { DesignTokenPanelHost } from '@takazudo/zdtp/astro';
10
+ * import DesignTokenPanelHost from '@takazudo/zdtp/astro/DesignTokenPanelHost.astro';
11
11
  * import { panelConfig } from './my-design-token-config';
12
12
  * // Required side-effect import for the package's bundled chrome CSS —
13
13
  * // Vite library mode strips the source CSS import from the emitted JS,
@@ -1,24 +1,27 @@
1
1
  /**
2
- * Astro sub-export entry.
2
+ * Astro sub-export entry — JS helpers and TypeScript types only.
3
3
  *
4
- * Consumers import the host component via:
4
+ * The host **component** is NOT re-exported here. Import it directly from
5
+ * its dedicated `.astro` subexport so the consumer's Astro toolchain
6
+ * compiles it natively:
5
7
  *
6
8
  * ```astro
7
- * import { DesignTokenPanelHost } from '@takazudo/zdtp/astro';
9
+ * import DesignTokenPanelHost from '@takazudo/zdtp/astro/DesignTokenPanelHost.astro';
8
10
  * ```
9
11
  *
10
- * The named-export pattern is preserved verbatim through the lib build:
11
- * `vite.config.ts` marks `*.astro` external (regex) so Vite leaves the
12
- * `from './DesignTokenPanelHost.astro'` literal in `dist/astro/index.js`,
13
- * and a postbuild copy step (`scripts/copy-astro-assets.mjs`) places the
14
- * raw `.astro` file alongside it. The consumer's own Astro toolchain then
15
- * resolves the relative path at build time.
12
+ * Why not `import { DesignTokenPanelHost } from '@takazudo/zdtp/astro'`?
13
+ * That named-export form forced `dist/astro/index.js` to statically
14
+ * `import ... from './DesignTokenPanelHost.astro'`. As a `file:` workspace
15
+ * link Vite compiles the `.astro`; as a real node_modules dependency it is
16
+ * externalized, so Node hits the raw `.astro` at prerender and throws
17
+ * `ERR_UNKNOWN_FILE_EXTENSION` (zdtp#308). Keeping this entry value-free
18
+ * means that crash can't be reintroduced by following the docs.
16
19
  *
17
- * `PanelConfig` is re-exported here so callers don't need a deep
18
- * `@takazudo/zdtp/dist/config/panel-config` import to
19
- * type their config object.
20
+ * Type-only imports from this entry (`import type { PanelConfig } ...`) are
21
+ * erased at build and stay safe — `PanelConfig` is re-exported here so
22
+ * callers don't need a deep `@takazudo/zdtp/dist/config/panel-config`
23
+ * import to type their config object.
20
24
  */
21
- export { default as DesignTokenPanelHost } from './DesignTokenPanelHost.astro';
22
25
  export type { PanelConfig } from '../config/panel-config';
23
26
  export type { ColorScheme, ColorRef } from '../config/color-schemes';
24
27
  export type { ColorClusterConfig } from '../state/tweak-state';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/astro/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC/E,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGrE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAK9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAKvD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAKvG,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnG,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/astro/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGrE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAK9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAKvD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAKvG,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnG,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,7 +1,6 @@
1
- import { default as t } from "./DesignTokenPanelHost.astro";
2
- import { s as d } from "../panel-config-DP2_P7dD.js";
3
- import { c as r } from "../color-schemes-CgzOBqGO.js";
4
- import { F as g, G as f, a as l, S as z } from "../manifest-DCReQE0k.js";
1
+ import { s as t } from "../panel-config-DP2_P7dD.js";
2
+ import { c as d } from "../color-schemes-CgzOBqGO.js";
3
+ import { F as r, G as m, a as g, S as z } from "../manifest-DCReQE0k.js";
5
4
  const e = {
6
5
  colorScheme: "Default Dark",
7
6
  colorMode: !1
@@ -41,14 +40,13 @@ const e = {
41
40
  active: "--zd-semantic-active"
42
41
  };
43
42
  export {
44
- t as DesignTokenPanelHost,
45
- g as FONT_GROUP_ORDER,
46
- f as GROUP_ORDER,
47
- l as GROUP_TITLES,
43
+ r as FONT_GROUP_ORDER,
44
+ m as GROUP_ORDER,
45
+ g as GROUP_TITLES,
48
46
  s as SEMANTIC_CSS_NAMES,
49
47
  c as SEMANTIC_DEFAULTS_ZD,
50
48
  z as SIZE_GROUP_ORDER,
51
- r as colorSchemes,
49
+ d as colorSchemes,
52
50
  e as panelSettings,
53
- d as setPanelColorPresets
51
+ t as setPanelColorPresets
54
52
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takazudo/zdtp",
3
- "version": "0.1.0-next.0",
3
+ "version": "0.1.0-next.1",
4
4
  "description": "Dynamic design-token tweak panel — host-config-driven, framework-agnostic Preact UI.",
5
5
  "private": false,
6
6
  "license": "MIT",