@pyreon/storybook 0.13.0 → 0.14.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.
package/lib/preset.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"preset.js","names":[],"sources":["../src/preset.ts"],"sourcesContent":["/**\n * Storybook preset for @pyreon/storybook.\n *\n * This file is loaded by Storybook's server when the user sets\n * `framework: \"@pyreon/storybook\"` in their `.storybook/main.ts`.\n *\n * It tells Storybook:\n * - Which renderer to use (via the preview entry)\n * - What framework name to report\n */\n\nimport { dirname, join } from 'node:path'\n\nfunction _getAbsolutePath(value: string): string {\n return dirname(require.resolve(join(value, 'package.json')))\n}\n\nexport const addons: string[] = []\n\nexport const previewAnnotations: string[] = [join(__dirname, 'preview')]\n\nexport const core = {\n renderer: '@pyreon/storybook',\n}\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAa,SAAmB,EAAE;AAElC,MAAa,qBAA+B,CAAC,KAAK,WAAW,UAAU,CAAC;AAExE,MAAa,OAAO,EAClB,UAAU,qBACX"}
1
+ {"version":3,"file":"preset.js","names":[],"sources":["../src/preset.ts"],"sourcesContent":["/**\n * Storybook preset for @pyreon/storybook.\n *\n * This file is loaded by Storybook's server when the user sets\n * `framework: \"@pyreon/storybook\"` in their `.storybook/main.ts`.\n *\n * It tells Storybook:\n * - Which renderer to use (via the preview entry)\n * - What framework name to report\n */\n\nimport { join } from 'node:path'\n\nexport const addons: string[] = []\n\nexport const previewAnnotations: string[] = [join(__dirname, 'preview')]\n\nexport const core = {\n renderer: '@pyreon/storybook',\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,SAAmB,EAAE;AAElC,MAAa,qBAA+B,CAAC,KAAK,WAAW,UAAU,CAAC;AAExE,MAAa,OAAO,EAClB,UAAU,qBACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"preset2.d.ts","names":[],"sources":["../../../src/preset.ts"],"mappings":";;AAiBA;;;;;AAEA;;;;cAFa,MAAA;AAAA,cAEA,kBAAA;AAAA,cAEA,IAAA;EAEZ,QAAA;AAAA"}
1
+ {"version":3,"file":"preset2.d.ts","names":[],"sources":["../../../src/preset.ts"],"mappings":";;AAaA;;;;;AAEA;;;;cAFa,MAAA;AAAA,cAEA,kBAAA;AAAA,cAEA,IAAA;EAEZ,QAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyreon/storybook",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Storybook renderer for Pyreon — mount, render, and interact with Pyreon components in Storybook",
5
5
  "homepage": "https://github.com/pyreon/pyreon/tree/main/packages/storybook#readme",
6
6
  "bugs": {
@@ -52,9 +52,9 @@
52
52
  "lint": "oxlint ."
53
53
  },
54
54
  "peerDependencies": {
55
- "@pyreon/core": "^0.13.0",
56
- "@pyreon/reactivity": "^0.13.0",
57
- "@pyreon/runtime-dom": "^0.13.0",
55
+ "@pyreon/core": "^0.14.0",
56
+ "@pyreon/reactivity": "^0.14.0",
57
+ "@pyreon/runtime-dom": "^0.14.0",
58
58
  "storybook": ">=8.0.0"
59
59
  }
60
60
  }
package/src/preset.ts CHANGED
@@ -9,11 +9,7 @@
9
9
  * - What framework name to report
10
10
  */
11
11
 
12
- import { dirname, join } from 'node:path'
13
-
14
- function _getAbsolutePath(value: string): string {
15
- return dirname(require.resolve(join(value, 'package.json')))
16
- }
12
+ import { join } from 'node:path'
17
13
 
18
14
  export const addons: string[] = []
19
15
 
@@ -0,0 +1,24 @@
1
+ import { describe, expect, it } from 'vitest'
2
+ import { addons, core, previewAnnotations } from '../preset'
3
+
4
+ // Coverage gap closed in PR #323. The Storybook preset module is loaded
5
+ // by Storybook's framework discovery at config-load time; its exports
6
+ // are read by Storybook itself and not by Pyreon code. Smoke-test the
7
+ // shape so a typo or accidental rename surfaces here.
8
+
9
+ describe('storybook preset module', () => {
10
+ it('exports addons as an empty array (no addons preset by default)', () => {
11
+ expect(Array.isArray(addons)).toBe(true)
12
+ expect(addons).toHaveLength(0)
13
+ })
14
+
15
+ it('exports previewAnnotations with a single entry pointing at the preview module', () => {
16
+ expect(Array.isArray(previewAnnotations)).toBe(true)
17
+ expect(previewAnnotations).toHaveLength(1)
18
+ expect(previewAnnotations[0]).toMatch(/preview$/)
19
+ })
20
+
21
+ it('exports core.renderer set to the @pyreon/storybook framework name', () => {
22
+ expect(core).toEqual({ renderer: '@pyreon/storybook' })
23
+ })
24
+ })