storybook-solidjs-vite 10.1.2 → 10.2.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.
Files changed (91) hide show
  1. package/README.md +28 -20
  2. package/dist/SolidComponentMetaManager-KXVARPHU.js +4 -0
  3. package/dist/SolidComponentMetaManager-KXVARPHU.js.map +1 -0
  4. package/dist/chunk-6566KBHG.js +816 -0
  5. package/dist/chunk-6566KBHG.js.map +1 -0
  6. package/dist/{chunk-4GZSFB75.js → chunk-7IQZHF5A.js} +3 -3
  7. package/dist/chunk-7IQZHF5A.js.map +1 -0
  8. package/dist/chunk-FGHVLJAL.js +42 -0
  9. package/dist/chunk-FGHVLJAL.js.map +1 -0
  10. package/dist/{chunk-XQXXS54C.js → chunk-GF3JOYAC.js} +7 -8
  11. package/dist/chunk-GF3JOYAC.js.map +1 -0
  12. package/dist/chunk-GZ3XWUGK.js +65 -0
  13. package/dist/chunk-GZ3XWUGK.js.map +1 -0
  14. package/dist/{chunk-W3QB2KPF.js → chunk-H7QHQTFU.js} +3 -3
  15. package/dist/{chunk-W3QB2KPF.js.map → chunk-H7QHQTFU.js.map} +1 -1
  16. package/dist/chunk-PZ5AY32C.js +9 -0
  17. package/dist/{chunk-G3PMV62Z.js.map → chunk-PZ5AY32C.js.map} +1 -1
  18. package/dist/{chunk-W35XFTHU.js → chunk-QRPXDQGQ.js} +4 -4
  19. package/dist/{chunk-W35XFTHU.js.map → chunk-QRPXDQGQ.js.map} +1 -1
  20. package/dist/entry-preview/argtypes.d.ts +2 -3
  21. package/dist/entry-preview/argtypes.js +2 -2
  22. package/dist/entry-preview/docs.js +2 -2
  23. package/dist/entry-preview/solid-1.js +2 -2
  24. package/dist/entry-preview/solid-2.js +2 -2
  25. package/dist/framework/node.d.ts +1 -2
  26. package/dist/framework/node.js +1 -1
  27. package/dist/framework/preset.d.ts +89 -3
  28. package/dist/framework/preset.js +394 -11
  29. package/dist/framework/preset.js.map +1 -1
  30. package/dist/index.d.ts +1 -2
  31. package/dist/index.js +5 -5
  32. package/dist/next.d.ts +1 -2
  33. package/dist/next.js +5 -5
  34. package/dist/renderer/playwright.js +1 -1
  35. package/dist/renderer.js +1 -1
  36. package/dist/toDocgenInfo-PQOQHVB2.js +4 -0
  37. package/dist/toDocgenInfo-PQOQHVB2.js.map +1 -0
  38. package/dist/{types-CixQ_ttK.d.ts → types-3qJHo3rN.d.ts} +3 -45
  39. package/package.json +6 -13
  40. package/src/componentManifest/getComponents.ts +276 -0
  41. package/src/componentManifest/manifests.ts +238 -0
  42. package/src/componentManifest/solidComponentMeta/SolidComponentMetaManager.ts +260 -0
  43. package/src/componentManifest/solidComponentMeta/SolidComponentMetaProject.ts +421 -0
  44. package/src/componentManifest/solidComponentMeta/resolveProps.ts +494 -0
  45. package/src/componentManifest/solidComponentMetaPlugin.ts +67 -0
  46. package/src/componentManifest/toDocgenInfo.ts +57 -0
  47. package/src/componentManifest/types.ts +48 -0
  48. package/src/framework/preset.ts +14 -21
  49. package/src/framework/types.ts +3 -3
  50. package/src/renderer/docs/entry-preview-argtypes.ts +69 -4
  51. package/src/renderer/shared/create-define-preview.ts +0 -1
  52. package/src/renderer/v1/entry-preview.ts +3 -3
  53. package/src/renderer/v2/entry-preview.ts +8 -10
  54. package/template/cli-v2/js/Button.jsx +29 -0
  55. package/template/cli-v2/js/Button.stories.js +52 -0
  56. package/template/cli-v2/js/Header.jsx +54 -0
  57. package/template/cli-v2/js/Header.stories.js +32 -0
  58. package/template/cli-v2/js/Page.jsx +76 -0
  59. package/template/cli-v2/js/Page.stories.js +33 -0
  60. package/template/cli-v2/ts/Button.stories.ts +55 -0
  61. package/template/cli-v2/ts/Button.tsx +37 -0
  62. package/template/cli-v2/ts/Header.stories.ts +35 -0
  63. package/template/cli-v2/ts/Header.tsx +63 -0
  64. package/template/cli-v2/ts/Page.stories.ts +36 -0
  65. package/template/cli-v2/ts/Page.tsx +77 -0
  66. package/dist/chunk-4GZSFB75.js.map +0 -1
  67. package/dist/chunk-G3PMV62Z.js +0 -33
  68. package/dist/chunk-SHOV6BHW.js +0 -18415
  69. package/dist/chunk-SHOV6BHW.js.map +0 -1
  70. package/dist/chunk-XQXXS54C.js.map +0 -1
  71. package/src/renderer/docs/extractArgTypes.ts +0 -86
  72. package/src/renderer/docs/lib/captions.ts +0 -6
  73. package/src/renderer/docs/lib/defaultValues/createDefaultValue.ts +0 -87
  74. package/src/renderer/docs/lib/defaultValues/createFromRawDefaultProp.ts +0 -183
  75. package/src/renderer/docs/lib/defaultValues/generateArray.ts +0 -24
  76. package/src/renderer/docs/lib/defaultValues/generateObject.ts +0 -24
  77. package/src/renderer/docs/lib/defaultValues/index.ts +0 -2
  78. package/src/renderer/docs/lib/defaultValues/prettyIdentifier.ts +0 -28
  79. package/src/renderer/docs/lib/generateCode.ts +0 -70
  80. package/src/renderer/docs/lib/inspection/acornParser.test.ts +0 -257
  81. package/src/renderer/docs/lib/inspection/acornParser.ts +0 -241
  82. package/src/renderer/docs/lib/inspection/index.ts +0 -2
  83. package/src/renderer/docs/lib/inspection/inspectValue.ts +0 -17
  84. package/src/renderer/docs/lib/inspection/types.ts +0 -65
  85. package/src/renderer/docs/lib/isHtmlTag.ts +0 -5
  86. package/src/renderer/docs/propTypes/createType.ts +0 -433
  87. package/src/renderer/docs/propTypes/generateFuncSignature.ts +0 -70
  88. package/src/renderer/docs/propTypes/handleProp.ts +0 -51
  89. package/src/renderer/docs/propTypes/rawDefaultPropResolvers.ts +0 -36
  90. package/src/renderer/docs/propTypes/sortProps.ts +0 -18
  91. package/src/renderer/docs/typeScript/handleProp.ts +0 -31
package/README.md CHANGED
@@ -15,13 +15,14 @@ Adds SolidJS support to Storybook.
15
15
 
16
16
  ## ✨ Features
17
17
 
18
- - Solid 1 and Solid 2 support
19
- - Vite-powered builder
20
- - TypeScript-first setup
21
- - ArgTypes generation from TypeScript
22
- - [CSF Next](https://storybook.js.org/docs/api/csf/csf-next) factory API (optional)
23
- - Compatible with Storybook addons
24
- - Integrated testing (Vitest, Playwright)
18
+ - [Solid 1](#solid-1) and [Solid 2](#solid-2) support
19
+ - [Vite-powered builder](https://storybook.js.org/docs/builders/vite)
20
+ - [TypeScript-first setup](https://storybook.js.org/docs/configure/integration/typescript)
21
+ - Component props show up automatically in [Controls and Docs](#docgen)
22
+ - [Storybook MCP](https://storybook.js.org/docs/ai/mcp/overview) support ([setup](#storybook-mcp))
23
+ - [CSF Next](https://storybook.js.org/docs/api/csf/csf-next) factory API ([setup](#csf-next), optional)
24
+ - [Integrated testing](https://storybook.js.org/docs/writing-tests) (Vitest, Playwright)
25
+ - [Compatible with Storybook addons](https://storybook.js.org/docs/addons)
25
26
 
26
27
  ## 🚀 Getting Started
27
28
 
@@ -79,7 +80,9 @@ Imports without `/next` often still run, but TypeScript may complain because tho
79
80
  In `main.ts` either framework name is fine: `storybook-solidjs-vite` reads the major version from your installed `solid-js`, and `storybook-solidjs-vite/next` forces Solid 2.
80
81
 
81
82
  ```ts
83
+ // Solid 1 & 2
82
84
  framework: 'storybook-solidjs-vite'
85
+ // Solid 2
83
86
  framework: 'storybook-solidjs-vite/next'
84
87
  ```
85
88
 
@@ -100,7 +103,7 @@ export default defineMain({
100
103
  // .storybook/preview.tsx
101
104
  import { definePreview } from 'storybook-solidjs-vite';
102
105
  // for Solid 2, use:
103
- // import { definePreview } from 'storybook-solidjs-vite/next';
106
+ import { definePreview } from 'storybook-solidjs-vite/next';
104
107
  ```
105
108
 
106
109
  ```ts
@@ -117,15 +120,15 @@ export const Primary = meta.story({
117
120
  });
118
121
  ```
119
122
 
120
- ### TypeScript docgen
123
+ ### Docgen
121
124
 
122
- TypeScript props for docs and controls are generated with [@joshwooding/vite-plugin-react-docgen-typescript](https://github.com/joshwooding/vite-plugin-react-docgen-typescript).
125
+ TypeScript props for **Controls**, **Docs**, and the **components manifest** come from **React component-meta** (RCM) — a TypeScript LanguageService extractor aligned with Storybook’s `react-component-meta` format.
123
126
 
124
- Configure it with framework.options.docgen in .storybook/main.ts.
127
+ Docgen is **enabled by default**. The components manifest debugger is also enabled at:
125
128
 
126
- `false` — disable docgen
127
- `true` (default) — enable docgen with the default configuration
128
- `object` override default configuration
129
+ `http://localhost:<port>/manifests/components.html`
130
+
131
+ To disable docgen:
129
132
 
130
133
  ```ts
131
134
  import type { StorybookConfig } from 'storybook-solidjs-vite';
@@ -134,12 +137,7 @@ const config: StorybookConfig = {
134
137
  framework: {
135
138
  name: 'storybook-solidjs-vite',
136
139
  options: {
137
- docgen: {
138
- savePropValueAsString: true,
139
- shouldExtractLiteralValuesFromEnum: true,
140
- propFilter: (prop: any) =>
141
- prop.parent ? !/node_modules/.test(prop.parent.fileName) : true,
142
- },
140
+ docgen: false,
143
141
  },
144
142
  },
145
143
  };
@@ -147,6 +145,16 @@ const config: StorybookConfig = {
147
145
  export default config;
148
146
  ```
149
147
 
148
+ ### Storybook MCP
149
+
150
+ Solid projects can use [Storybook MCP](https://storybook.js.org/docs/ai/mcp/overview) so AI agents can list components, read prop docs from component meta, and preview stories. Requires docgen (enabled by default) and `@storybook/addon-docs`.
151
+
152
+ ```bash
153
+ npx storybook add @storybook/addon-mcp
154
+ ```
155
+
156
+ With Storybook running, the MCP server is at `http://localhost:<port>/mcp`. Connect your agent to that URL (see [Storybook MCP docs](https://storybook.js.org/docs/ai/mcp/overview#2-add-the-mcp-server-to-your-agent)). The components manifest debugger remains at `/manifests/components.html`.
157
+
150
158
  ## 🎨 Decorators
151
159
 
152
160
  On args or globals changes, Storybook re-runs decorators and stories — the same model as React, where each update calls your functions again. Solid updates through fine-grained signals and usually does not need that.
@@ -0,0 +1,4 @@
1
+ export { DOCGEN_ENGINE, MANIFEST_DOCGEN_ENGINE, SolidComponentMetaManager, getOrCreateSolidComponentMetaManager } from './chunk-6566KBHG.js';
2
+ import './chunk-PZ5AY32C.js';
3
+ //# sourceMappingURL=SolidComponentMetaManager-KXVARPHU.js.map
4
+ //# sourceMappingURL=SolidComponentMetaManager-KXVARPHU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"SolidComponentMetaManager-KXVARPHU.js"}