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.
- package/README.md +28 -20
- package/dist/SolidComponentMetaManager-KXVARPHU.js +4 -0
- package/dist/SolidComponentMetaManager-KXVARPHU.js.map +1 -0
- package/dist/chunk-6566KBHG.js +816 -0
- package/dist/chunk-6566KBHG.js.map +1 -0
- package/dist/{chunk-4GZSFB75.js → chunk-7IQZHF5A.js} +3 -3
- package/dist/chunk-7IQZHF5A.js.map +1 -0
- package/dist/chunk-FGHVLJAL.js +42 -0
- package/dist/chunk-FGHVLJAL.js.map +1 -0
- package/dist/{chunk-XQXXS54C.js → chunk-GF3JOYAC.js} +7 -8
- package/dist/chunk-GF3JOYAC.js.map +1 -0
- package/dist/chunk-GZ3XWUGK.js +65 -0
- package/dist/chunk-GZ3XWUGK.js.map +1 -0
- package/dist/{chunk-W3QB2KPF.js → chunk-H7QHQTFU.js} +3 -3
- package/dist/{chunk-W3QB2KPF.js.map → chunk-H7QHQTFU.js.map} +1 -1
- package/dist/chunk-PZ5AY32C.js +9 -0
- package/dist/{chunk-G3PMV62Z.js.map → chunk-PZ5AY32C.js.map} +1 -1
- package/dist/{chunk-W35XFTHU.js → chunk-QRPXDQGQ.js} +4 -4
- package/dist/{chunk-W35XFTHU.js.map → chunk-QRPXDQGQ.js.map} +1 -1
- package/dist/entry-preview/argtypes.d.ts +2 -3
- package/dist/entry-preview/argtypes.js +2 -2
- package/dist/entry-preview/docs.js +2 -2
- package/dist/entry-preview/solid-1.js +2 -2
- package/dist/entry-preview/solid-2.js +2 -2
- package/dist/framework/node.d.ts +1 -2
- package/dist/framework/node.js +1 -1
- package/dist/framework/preset.d.ts +89 -3
- package/dist/framework/preset.js +394 -11
- package/dist/framework/preset.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +5 -5
- package/dist/next.d.ts +1 -2
- package/dist/next.js +5 -5
- package/dist/renderer/playwright.js +1 -1
- package/dist/renderer.js +1 -1
- package/dist/toDocgenInfo-PQOQHVB2.js +4 -0
- package/dist/toDocgenInfo-PQOQHVB2.js.map +1 -0
- package/dist/{types-CixQ_ttK.d.ts → types-3qJHo3rN.d.ts} +3 -45
- package/package.json +6 -13
- package/src/componentManifest/getComponents.ts +276 -0
- package/src/componentManifest/manifests.ts +238 -0
- package/src/componentManifest/solidComponentMeta/SolidComponentMetaManager.ts +260 -0
- package/src/componentManifest/solidComponentMeta/SolidComponentMetaProject.ts +421 -0
- package/src/componentManifest/solidComponentMeta/resolveProps.ts +494 -0
- package/src/componentManifest/solidComponentMetaPlugin.ts +67 -0
- package/src/componentManifest/toDocgenInfo.ts +57 -0
- package/src/componentManifest/types.ts +48 -0
- package/src/framework/preset.ts +14 -21
- package/src/framework/types.ts +3 -3
- package/src/renderer/docs/entry-preview-argtypes.ts +69 -4
- package/src/renderer/shared/create-define-preview.ts +0 -1
- package/src/renderer/v1/entry-preview.ts +3 -3
- package/src/renderer/v2/entry-preview.ts +8 -10
- package/template/cli-v2/js/Button.jsx +29 -0
- package/template/cli-v2/js/Button.stories.js +52 -0
- package/template/cli-v2/js/Header.jsx +54 -0
- package/template/cli-v2/js/Header.stories.js +32 -0
- package/template/cli-v2/js/Page.jsx +76 -0
- package/template/cli-v2/js/Page.stories.js +33 -0
- package/template/cli-v2/ts/Button.stories.ts +55 -0
- package/template/cli-v2/ts/Button.tsx +37 -0
- package/template/cli-v2/ts/Header.stories.ts +35 -0
- package/template/cli-v2/ts/Header.tsx +63 -0
- package/template/cli-v2/ts/Page.stories.ts +36 -0
- package/template/cli-v2/ts/Page.tsx +77 -0
- package/dist/chunk-4GZSFB75.js.map +0 -1
- package/dist/chunk-G3PMV62Z.js +0 -33
- package/dist/chunk-SHOV6BHW.js +0 -18415
- package/dist/chunk-SHOV6BHW.js.map +0 -1
- package/dist/chunk-XQXXS54C.js.map +0 -1
- package/src/renderer/docs/extractArgTypes.ts +0 -86
- package/src/renderer/docs/lib/captions.ts +0 -6
- package/src/renderer/docs/lib/defaultValues/createDefaultValue.ts +0 -87
- package/src/renderer/docs/lib/defaultValues/createFromRawDefaultProp.ts +0 -183
- package/src/renderer/docs/lib/defaultValues/generateArray.ts +0 -24
- package/src/renderer/docs/lib/defaultValues/generateObject.ts +0 -24
- package/src/renderer/docs/lib/defaultValues/index.ts +0 -2
- package/src/renderer/docs/lib/defaultValues/prettyIdentifier.ts +0 -28
- package/src/renderer/docs/lib/generateCode.ts +0 -70
- package/src/renderer/docs/lib/inspection/acornParser.test.ts +0 -257
- package/src/renderer/docs/lib/inspection/acornParser.ts +0 -241
- package/src/renderer/docs/lib/inspection/index.ts +0 -2
- package/src/renderer/docs/lib/inspection/inspectValue.ts +0 -17
- package/src/renderer/docs/lib/inspection/types.ts +0 -65
- package/src/renderer/docs/lib/isHtmlTag.ts +0 -5
- package/src/renderer/docs/propTypes/createType.ts +0 -433
- package/src/renderer/docs/propTypes/generateFuncSignature.ts +0 -70
- package/src/renderer/docs/propTypes/handleProp.ts +0 -51
- package/src/renderer/docs/propTypes/rawDefaultPropResolvers.ts +0 -36
- package/src/renderer/docs/propTypes/sortProps.ts +0 -18
- 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
|
-
-
|
|
22
|
-
- [
|
|
23
|
-
-
|
|
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
|
-
|
|
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
|
-
###
|
|
123
|
+
### Docgen
|
|
121
124
|
|
|
122
|
-
TypeScript props for
|
|
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
|
-
|
|
127
|
+
Docgen is **enabled by default**. The components manifest debugger is also enabled at:
|
|
125
128
|
|
|
126
|
-
`
|
|
127
|
-
|
|
128
|
-
|
|
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"}
|