@storybook/react-vite 7.1.0-alpha.10 → 7.1.0-alpha.12
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/dist/index.mjs +1 -0
- package/package.json +10 -11
- package/dist/chunk-R4NKYYJA.mjs +0 -1
- package/dist/preset.mjs +0 -1
- package/dist/react-docgen-IMJTCUEZ.mjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-vite",
|
|
3
|
-
"version": "7.1.0-alpha.
|
|
3
|
+
"version": "7.1.0-alpha.12",
|
|
4
4
|
"description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
7
7
|
],
|
|
8
|
-
"homepage": "https://github.com/storybookjs/storybook/tree/
|
|
8
|
+
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/react-vite",
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/storybookjs/storybook/issues"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "https://github.com/storybookjs/storybook.git",
|
|
15
|
-
"directory": "frameworks/react-vite"
|
|
15
|
+
"directory": "code/frameworks/react-vite"
|
|
16
16
|
},
|
|
17
17
|
"funding": {
|
|
18
18
|
"type": "opencollective",
|
|
@@ -21,15 +21,14 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
24
25
|
"node": "./dist/index.js",
|
|
25
26
|
"require": "./dist/index.js",
|
|
26
|
-
"import": "./dist/index.mjs"
|
|
27
|
-
"types": "./dist/index.d.ts"
|
|
27
|
+
"import": "./dist/index.mjs"
|
|
28
28
|
},
|
|
29
29
|
"./preset": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"types": "./dist/preset.d.ts"
|
|
30
|
+
"types": "./dist/preset.d.ts",
|
|
31
|
+
"require": "./dist/preset.js"
|
|
33
32
|
},
|
|
34
33
|
"./package.json": "./package.json"
|
|
35
34
|
},
|
|
@@ -50,8 +49,8 @@
|
|
|
50
49
|
"dependencies": {
|
|
51
50
|
"@joshwooding/vite-plugin-react-docgen-typescript": "0.2.1",
|
|
52
51
|
"@rollup/pluginutils": "^4.2.0",
|
|
53
|
-
"@storybook/builder-vite": "7.1.0-alpha.
|
|
54
|
-
"@storybook/react": "7.1.0-alpha.
|
|
52
|
+
"@storybook/builder-vite": "7.1.0-alpha.12",
|
|
53
|
+
"@storybook/react": "7.1.0-alpha.12",
|
|
55
54
|
"@vitejs/plugin-react": "^3.0.1",
|
|
56
55
|
"ast-types": "^0.14.2",
|
|
57
56
|
"magic-string": "^0.27.0",
|
|
@@ -80,5 +79,5 @@
|
|
|
80
79
|
],
|
|
81
80
|
"platform": "node"
|
|
82
81
|
},
|
|
83
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "8de6963fca74d5952f5cb5737e34fb4e1ddfd0f6"
|
|
84
83
|
}
|
package/dist/chunk-R4NKYYJA.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __require=(x=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(a,b)=>(typeof require<"u"?require:a)[b]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+x+'" is not supported')});export{__require};
|
package/dist/preset.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__require}from"./chunk-R4NKYYJA.mjs";import{hasVitePlugins}from"@storybook/builder-vite";import{dirname,join}from"path";var wrapForPnP=input=>dirname(__require.resolve(join(input,"package.json"))),core={builder:wrapForPnP("@storybook/builder-vite"),renderer:wrapForPnP("@storybook/react")},viteFinal=async(config,{presets})=>{let{plugins=[]}=config;if(!await hasVitePlugins(plugins,["vite:react-babel","vite:react-swc"])){let{default:react}=await import("@vitejs/plugin-react");plugins.push(react())}let{reactDocgen:reactDocgenOption,reactDocgenTypescriptOptions}=await presets.apply("typescript",{}),typescriptPresent;try{__require.resolve("typescript"),typescriptPresent=!0}catch{typescriptPresent=!1}if(reactDocgenOption==="react-docgen-typescript"&&typescriptPresent&&plugins.push(__require("@joshwooding/vite-plugin-react-docgen-typescript")({...reactDocgenTypescriptOptions,savePropValueAsString:!0})),typeof reactDocgenOption=="string"){let{reactDocgen}=await import("./react-docgen-IMJTCUEZ.mjs");plugins.unshift(reactDocgen({include:reactDocgenOption==="react-docgen"?/\.(mjs|tsx?|jsx?)$/:/\.(mjs|jsx?)$/}))}return config};export{core,viteFinal};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-R4NKYYJA.mjs";import path from"path";import{createFilter}from"@rollup/pluginutils";import{parse,handlers as docgenHandlers,resolver as docgenResolver,importers as docgenImporters}from"react-docgen";import MagicString from"magic-string";import{namedTypes as t}from"ast-types";import{getNameOrValue,isReactForwardRefCall}from"react-docgen/dist/utils";function actualNameHandler(documentation,path2,importer){if(t.ClassDeclaration.check(path2.node)||t.FunctionDeclaration.check(path2.node))documentation.set("actualName",getNameOrValue(path2.get("id")));else if(t.ArrowFunctionExpression.check(path2.node)||t.FunctionExpression.check(path2.node)||isReactForwardRefCall(path2,importer)){let currentPath=path2;for(;currentPath.parent;){if(t.VariableDeclarator.check(currentPath.parent.node)){documentation.set("actualName",getNameOrValue(currentPath.parent.get("id")));return}if(t.AssignmentExpression.check(currentPath.parent.node)){let leftPath=currentPath.parent.get("left");if(t.Identifier.check(leftPath.node)||t.Literal.check(leftPath.node)){documentation.set("actualName",getNameOrValue(leftPath));return}}currentPath=currentPath.parent}documentation.set("actualName","")}}var defaultHandlers=Object.values(docgenHandlers).map(handler=>handler),defaultResolver=docgenResolver.findAllExportedComponentDefinitions,defaultImporter=docgenImporters.makeFsImporter(),handlers=[...defaultHandlers,actualNameHandler];function reactDocgen({include=/\.(mjs|tsx?|jsx?)$/,exclude=[/node_modules\/.*/]}={}){let cwd=process.cwd(),filter=createFilter(include,exclude);return{name:"storybook:react-docgen-plugin",enforce:"pre",async transform(src,id){let relPath=path.relative(cwd,id);if(filter(relPath))try{let docgenResults=parse(src,defaultResolver,handlers,{importer:defaultImporter,filename:id}),s=new MagicString(src);return docgenResults.forEach(info=>{let{actualName,...docgenInfo}=info;if(actualName){let docNode=JSON.stringify(docgenInfo);s.append(`;${actualName}.__docgenInfo=${docNode}`)}}),{code:s.toString(),map:s.generateMap()}}catch{}}}}export{reactDocgen};
|