@storybook/react-vite 8.0.0-alpha.6 → 8.0.0-alpha.8
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.
|
@@ -724,9 +724,6 @@ type StoryId = string;
|
|
|
724
724
|
type ComponentTitle = string;
|
|
725
725
|
type StoryName = string;
|
|
726
726
|
type Tag = string;
|
|
727
|
-
interface Parameters$1 {
|
|
728
|
-
[name: string]: any;
|
|
729
|
-
}
|
|
730
727
|
|
|
731
728
|
interface Plugin {
|
|
732
729
|
(module: Program): Program;
|
|
@@ -2643,20 +2640,6 @@ type StoriesEntry = string | StoriesSpecifier;
|
|
|
2643
2640
|
interface IndexerOptions {
|
|
2644
2641
|
makeTitle: (userTitle?: string) => string;
|
|
2645
2642
|
}
|
|
2646
|
-
interface IndexedStory {
|
|
2647
|
-
id: string;
|
|
2648
|
-
name: string;
|
|
2649
|
-
tags?: Tag[];
|
|
2650
|
-
parameters?: Parameters$1;
|
|
2651
|
-
}
|
|
2652
|
-
interface IndexedCSFFile {
|
|
2653
|
-
meta: {
|
|
2654
|
-
id?: string;
|
|
2655
|
-
title?: string;
|
|
2656
|
-
tags?: Tag[];
|
|
2657
|
-
};
|
|
2658
|
-
stories: IndexedStory[];
|
|
2659
|
-
}
|
|
2660
2643
|
/**
|
|
2661
2644
|
* FIXME: This is a temporary type to allow us to deprecate the old indexer API.
|
|
2662
2645
|
* We should remove this type and the deprecated indexer API in 8.0.
|
|
@@ -2678,19 +2661,7 @@ type Indexer = BaseIndexer & {
|
|
|
2678
2661
|
* @returns A promise that resolves to an array of {@link IndexInput} objects.
|
|
2679
2662
|
*/
|
|
2680
2663
|
createIndex: (fileName: string, options: IndexerOptions) => Promise<IndexInput[]>;
|
|
2681
|
-
/**
|
|
2682
|
-
* @deprecated Use {@link index} instead
|
|
2683
|
-
*/
|
|
2684
|
-
indexer?: never;
|
|
2685
|
-
};
|
|
2686
|
-
type DeprecatedIndexer = BaseIndexer & {
|
|
2687
|
-
indexer: (fileName: string, options: IndexerOptions) => Promise<IndexedCSFFile>;
|
|
2688
|
-
createIndex?: never;
|
|
2689
2664
|
};
|
|
2690
|
-
/**
|
|
2691
|
-
* @deprecated Use {@link Indexer} instead
|
|
2692
|
-
*/
|
|
2693
|
-
type StoryIndexer = Indexer | DeprecatedIndexer;
|
|
2694
2665
|
/**
|
|
2695
2666
|
* The base input for indexing a story or docs entry.
|
|
2696
2667
|
*/
|
|
@@ -2826,10 +2797,6 @@ interface CLIOptions {
|
|
|
2826
2797
|
host?: string;
|
|
2827
2798
|
initialPath?: string;
|
|
2828
2799
|
exactPort?: boolean;
|
|
2829
|
-
/**
|
|
2830
|
-
* @deprecated Use 'staticDirs' Storybook Configuration option instead
|
|
2831
|
-
*/
|
|
2832
|
-
staticDir?: string[];
|
|
2833
2800
|
configDir?: string;
|
|
2834
2801
|
https?: boolean;
|
|
2835
2802
|
sslCa?: string[];
|
|
@@ -2991,11 +2958,6 @@ interface StorybookConfigRaw {
|
|
|
2991
2958
|
* Filter args with a "target" on the type from the render function (EXPERIMENTAL)
|
|
2992
2959
|
*/
|
|
2993
2960
|
argTypeTargetsV7?: boolean;
|
|
2994
|
-
/**
|
|
2995
|
-
* Warn when there is a pre-6.0 hierarchy separator ('.' / '|') in the story title.
|
|
2996
|
-
* Will be removed in 7.0.
|
|
2997
|
-
*/
|
|
2998
|
-
warnOnLegacyHierarchySeparator?: boolean;
|
|
2999
2961
|
/**
|
|
3000
2962
|
* Use legacy MDX1, to help smooth migration to 7.0
|
|
3001
2963
|
*/
|
|
@@ -3026,7 +2988,6 @@ interface StorybookConfigRaw {
|
|
|
3026
2988
|
babelDefault?: TransformOptions;
|
|
3027
2989
|
config?: Entry[];
|
|
3028
2990
|
previewAnnotations?: Entry[];
|
|
3029
|
-
storyIndexers?: StoryIndexer[];
|
|
3030
2991
|
experimental_indexers?: Indexer[];
|
|
3031
2992
|
docs?: DocsOptions;
|
|
3032
2993
|
previewHead?: string;
|
|
@@ -3100,11 +3061,6 @@ interface StorybookConfig$1 {
|
|
|
3100
3061
|
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
|
3101
3062
|
*/
|
|
3102
3063
|
previewAnnotations?: PresetValue<StorybookConfigRaw['previewAnnotations']>;
|
|
3103
|
-
/**
|
|
3104
|
-
* Process CSF files for the story index.
|
|
3105
|
-
* @deprecated use {@link experimental_indexers} instead
|
|
3106
|
-
*/
|
|
3107
|
-
storyIndexers?: PresetValue<StorybookConfigRaw['storyIndexers']>;
|
|
3108
3064
|
/**
|
|
3109
3065
|
* Process CSF files for the story index.
|
|
3110
3066
|
*/
|
package/dist/index.d.ts
CHANGED
package/dist/preset.d.ts
CHANGED
package/dist/preset.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __esm=(fn,res)=>function(){return fn&&(res=(0,fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var import_react_docgen,getNameOrValue,isReactForwardRefCall,actualNameHandler,actualNameHandler_default,init_actualNameHandler=__esm({"src/plugins/docgen-handlers/actualNameHandler.ts"(){"use strict";import_react_docgen=require("react-docgen"),{getNameOrValue,isReactForwardRefCall}=import_react_docgen.utils,actualNameHandler=function(documentation,componentDefinition){if((componentDefinition.isClassDeclaration()||componentDefinition.isFunctionDeclaration())&&componentDefinition.has("id"))documentation.set("actualName",getNameOrValue(componentDefinition.get("id")));else if(componentDefinition.isArrowFunctionExpression()||componentDefinition.isFunctionExpression()||isReactForwardRefCall(componentDefinition)){let currentPath=componentDefinition;for(;currentPath.parentPath;){if(currentPath.parentPath.isVariableDeclarator()){documentation.set("actualName",getNameOrValue(currentPath.parentPath.get("id")));return}if(currentPath.parentPath.isAssignmentExpression()){let leftPath=currentPath.parentPath.get("left");if(leftPath.isIdentifier()||leftPath.isLiteral()){documentation.set("actualName",getNameOrValue(leftPath));return}}currentPath=currentPath.parentPath}documentation.set("actualName","")}},actualNameHandler_default=actualNameHandler}});var react_docgen_exports={};__export(react_docgen_exports,{reactDocgen:()=>reactDocgen});function reactDocgen({include=/\.(mjs|tsx?|jsx?)$/,exclude=[/node_modules\/.*/]}={}){let cwd=process.cwd(),filter=(0,import_pluginutils.createFilter)(include,exclude);return{name:"storybook:react-docgen-plugin",enforce:"pre",async transform(src,id){let relPath=import_path.default.relative(cwd,id);if(filter(relPath))try{let docgenResults=(0,import_react_docgen2.parse)(src,{resolver:defaultResolver,handlers,importer:defaultImporter,filename:id}),s=new import_magic_string.default(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(e){if(e.code===import_react_docgen2.ERROR_CODES.MISSING_DEFINITION)return;throw e}}}}var import_path,import_pluginutils,import_react_docgen2,import_magic_string,defaultHandlers,defaultResolver,defaultImporter,handlers,init_react_docgen=__esm({"src/plugins/react-docgen.ts"(){"use strict";import_path=__toESM(require("path")),import_pluginutils=require("@rollup/pluginutils"),import_react_docgen2=require("react-docgen"),import_magic_string=__toESM(require("magic-string"));init_actualNameHandler();defaultHandlers=Object.values(import_react_docgen2.builtinHandlers).map(handler=>handler),defaultResolver=new import_react_docgen2.builtinResolvers.FindExportedDefinitionsResolver,defaultImporter=import_react_docgen2.builtinImporters.fsImporter,handlers=[...defaultHandlers,actualNameHandler_default]}});var preset_exports={};__export(preset_exports,{core:()=>core,viteFinal:()=>viteFinal});module.exports=__toCommonJS(preset_exports);var
|
|
1
|
+
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __esm=(fn,res)=>function(){return fn&&(res=(0,fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var import_react_docgen,getNameOrValue,isReactForwardRefCall,actualNameHandler,actualNameHandler_default,init_actualNameHandler=__esm({"src/plugins/docgen-handlers/actualNameHandler.ts"(){"use strict";import_react_docgen=require("react-docgen"),{getNameOrValue,isReactForwardRefCall}=import_react_docgen.utils,actualNameHandler=function(documentation,componentDefinition){if((componentDefinition.isClassDeclaration()||componentDefinition.isFunctionDeclaration())&&componentDefinition.has("id"))documentation.set("actualName",getNameOrValue(componentDefinition.get("id")));else if(componentDefinition.isArrowFunctionExpression()||componentDefinition.isFunctionExpression()||isReactForwardRefCall(componentDefinition)){let currentPath=componentDefinition;for(;currentPath.parentPath;){if(currentPath.parentPath.isVariableDeclarator()){documentation.set("actualName",getNameOrValue(currentPath.parentPath.get("id")));return}if(currentPath.parentPath.isAssignmentExpression()){let leftPath=currentPath.parentPath.get("left");if(leftPath.isIdentifier()||leftPath.isLiteral()){documentation.set("actualName",getNameOrValue(leftPath));return}}currentPath=currentPath.parentPath}documentation.set("actualName","")}},actualNameHandler_default=actualNameHandler}});var react_docgen_exports={};__export(react_docgen_exports,{reactDocgen:()=>reactDocgen});function reactDocgen({include=/\.(mjs|tsx?|jsx?)$/,exclude=[/node_modules\/.*/]}={}){let cwd=process.cwd(),filter=(0,import_pluginutils.createFilter)(include,exclude);return{name:"storybook:react-docgen-plugin",enforce:"pre",async transform(src,id){let relPath=import_path.default.relative(cwd,id);if(filter(relPath))try{let docgenResults=(0,import_react_docgen2.parse)(src,{resolver:defaultResolver,handlers,importer:defaultImporter,filename:id}),s=new import_magic_string.default(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(e){if(e.code===import_react_docgen2.ERROR_CODES.MISSING_DEFINITION)return;throw e}}}}var import_path,import_pluginutils,import_react_docgen2,import_magic_string,defaultHandlers,defaultResolver,defaultImporter,handlers,init_react_docgen=__esm({"src/plugins/react-docgen.ts"(){"use strict";import_path=__toESM(require("path")),import_pluginutils=require("@rollup/pluginutils"),import_react_docgen2=require("react-docgen"),import_magic_string=__toESM(require("magic-string"));init_actualNameHandler();defaultHandlers=Object.values(import_react_docgen2.builtinHandlers).map(handler=>handler),defaultResolver=new import_react_docgen2.builtinResolvers.FindExportedDefinitionsResolver,defaultImporter=import_react_docgen2.builtinImporters.fsImporter,handlers=[...defaultHandlers,actualNameHandler_default]}});var preset_exports={};__export(preset_exports,{core:()=>core,viteFinal:()=>viteFinal});module.exports=__toCommonJS(preset_exports);var import_path2=require("path"),getAbsolutePath=input=>(0,import_path2.dirname)(require.resolve((0,import_path2.join)(input,"package.json"))),core={builder:getAbsolutePath("@storybook/builder-vite"),renderer:getAbsolutePath("@storybook/react")},viteFinal=async(config,{presets})=>{let{plugins=[]}=config,{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:reactDocgen2}=await Promise.resolve().then(()=>(init_react_docgen(),react_docgen_exports));plugins.unshift(reactDocgen2({include:reactDocgenOption==="react-docgen"?/\.(mjs|tsx?|jsx?)$/:/\.(mjs|jsx?)$/}))}return config};0&&(module.exports={core,viteFinal});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-vite",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.8",
|
|
4
4
|
"description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -49,9 +49,8 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@joshwooding/vite-plugin-react-docgen-typescript": "0.3.0",
|
|
51
51
|
"@rollup/pluginutils": "^5.0.2",
|
|
52
|
-
"@storybook/builder-vite": "8.0.0-alpha.
|
|
53
|
-
"@storybook/react": "8.0.0-alpha.
|
|
54
|
-
"@vitejs/plugin-react": "^3.0.1",
|
|
52
|
+
"@storybook/builder-vite": "8.0.0-alpha.8",
|
|
53
|
+
"@storybook/react": "8.0.0-alpha.8",
|
|
55
54
|
"magic-string": "^0.30.0",
|
|
56
55
|
"react-docgen": "^7.0.0"
|
|
57
56
|
},
|
|
@@ -63,7 +62,7 @@
|
|
|
63
62
|
"peerDependencies": {
|
|
64
63
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
65
64
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
66
|
-
"vite": "^
|
|
65
|
+
"vite": "^4.0.0 || ^5.0.0"
|
|
67
66
|
},
|
|
68
67
|
"engines": {
|
|
69
68
|
"node": ">=16"
|