@storybook/preset-react-webpack 7.0.7 → 7.0.9
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/framework-preset-react-docs.d.ts +1 -1
- package/dist/framework-preset-react.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +3 -1
- package/dist/{types-b181cc47.d.ts → types-0c56fb69.d.ts} +1 -1
- package/package.json +18 -18
- package/dist/chunk-R4NKYYJA.mjs +0 -1
- package/dist/framework-preset-cra.mjs +0 -1
- package/dist/framework-preset-react-docs.mjs +0 -1
- package/dist/framework-preset-react.mjs +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StorybookConfig } from './types-
|
|
2
|
-
export { R as ReactOptions, T as TypescriptOptions } from './types-
|
|
1
|
+
import { S as StorybookConfig } from './types-0c56fb69.js';
|
|
2
|
+
export { R as ReactOptions, T as TypescriptOptions } from './types-0c56fb69.js';
|
|
3
3
|
export { BuilderResult } from '@storybook/core-webpack';
|
|
4
4
|
import '@storybook/react-docgen-typescript-plugin';
|
|
5
5
|
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
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')});var addons=[__require.resolve("@storybook/preset-react-webpack/dist/framework-preset-react"),__require.resolve("@storybook/preset-react-webpack/dist/framework-preset-cra"),__require.resolve("@storybook/preset-react-webpack/dist/framework-preset-react-docs")];
|
|
2
|
+
|
|
3
|
+
export { addons };
|
|
@@ -24,7 +24,7 @@ type TypescriptOptions = TypescriptOptions$1 & {
|
|
|
24
24
|
* Configures `react-docgen-typescript-plugin`
|
|
25
25
|
*
|
|
26
26
|
* @default
|
|
27
|
-
* @see https://github.com/storybookjs/storybook/blob/next/lib/builder-webpack5/src/config/defaults.js#L4-L6
|
|
27
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/builder-webpack5/src/config/defaults.js#L4-L6
|
|
28
28
|
*/
|
|
29
29
|
reactDocgenTypescriptOptions: PluginOptions;
|
|
30
30
|
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/preset-react-webpack",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.9",
|
|
4
4
|
"description": "Storybook for React: Develop React Component 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/presets/react-webpack",
|
|
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": "presets/react-webpack"
|
|
15
|
+
"directory": "code/presets/react-webpack"
|
|
16
16
|
},
|
|
17
17
|
"funding": {
|
|
18
18
|
"type": "opencollective",
|
|
@@ -21,31 +21,31 @@
|
|
|
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
|
+
"types": "./dist/index.d.ts",
|
|
30
31
|
"node": "./dist/index.js",
|
|
31
32
|
"require": "./dist/index.js",
|
|
32
|
-
"import": "./dist/index.mjs"
|
|
33
|
-
"types": "./dist/index.d.ts"
|
|
33
|
+
"import": "./dist/index.mjs"
|
|
34
34
|
},
|
|
35
35
|
"./dist/framework-preset-cra": {
|
|
36
|
+
"types": "./dist/framework-preset-cra.d.ts",
|
|
36
37
|
"require": "./dist/framework-preset-cra.js",
|
|
37
|
-
"import": "./dist/framework-preset-cra.mjs"
|
|
38
|
-
"types": "./dist/framework-preset-cra.d.ts"
|
|
38
|
+
"import": "./dist/framework-preset-cra.mjs"
|
|
39
39
|
},
|
|
40
40
|
"./dist/framework-preset-react-docs": {
|
|
41
|
+
"types": "./dist/framework-preset-react-docs.d.ts",
|
|
41
42
|
"require": "./dist/framework-preset-react-docs.js",
|
|
42
|
-
"import": "./dist/framework-preset-react-docs.mjs"
|
|
43
|
-
"types": "./dist/framework-preset-react-docs.d.ts"
|
|
43
|
+
"import": "./dist/framework-preset-react-docs.mjs"
|
|
44
44
|
},
|
|
45
45
|
"./dist/framework-preset-react": {
|
|
46
|
+
"types": "./dist/framework-preset-react.d.ts",
|
|
46
47
|
"require": "./dist/framework-preset-react.js",
|
|
47
|
-
"import": "./dist/framework-preset-react.mjs"
|
|
48
|
-
"types": "./dist/framework-preset-react.d.ts"
|
|
48
|
+
"import": "./dist/framework-preset-react.mjs"
|
|
49
49
|
},
|
|
50
50
|
"./package.json": "./package.json"
|
|
51
51
|
},
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"@babel/preset-flow": "^7.18.6",
|
|
67
67
|
"@babel/preset-react": "^7.18.6",
|
|
68
68
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
|
|
69
|
-
"@storybook/core-webpack": "7.0.
|
|
70
|
-
"@storybook/docs-tools": "7.0.
|
|
71
|
-
"@storybook/node-logger": "7.0.
|
|
72
|
-
"@storybook/react": "7.0.
|
|
69
|
+
"@storybook/core-webpack": "7.0.9",
|
|
70
|
+
"@storybook/docs-tools": "7.0.9",
|
|
71
|
+
"@storybook/node-logger": "7.0.9",
|
|
72
|
+
"@storybook/react": "7.0.9",
|
|
73
73
|
"@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0",
|
|
74
74
|
"@types/node": "^16.0.0",
|
|
75
75
|
"@types/semver": "^7.3.4",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
],
|
|
112
112
|
"platform": "node"
|
|
113
113
|
},
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "797cfd6f12f94a65617c65f25b2d6546a689bf1b"
|
|
115
115
|
}
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__require}from"./chunk-R4NKYYJA.mjs";import{logger as logger2}from"@storybook/node-logger";import fs from"fs";import path from"path";import semver from"semver";import{logger}from"@storybook/node-logger";var appDirectory=fs.realpathSync(process.cwd()),reactScriptsPath;function getReactScriptsPath({noCache}={}){if(reactScriptsPath&&!noCache)return reactScriptsPath;let reactScriptsScriptPath=fs.realpathSync(path.join(appDirectory,"/node_modules/.bin/react-scripts"));try{if(/node_modules[\\/]\.bin[\\/]react-scripts/i.test(reactScriptsScriptPath)){let packagePathMatch=fs.readFileSync(reactScriptsScriptPath,"utf8").match(/"\$basedir[\\/]([^\s]+?[\\/]bin[\\/]react-scripts\.js")/i);packagePathMatch&&packagePathMatch.length>1&&(reactScriptsScriptPath=path.join(appDirectory,"/node_modules/.bin/",packagePathMatch[1]))}}catch(e){logger.warn(`Error occurred during react-scripts package path resolving: ${e}`)}reactScriptsPath=path.join(reactScriptsScriptPath,"../..");let scriptsPkgJson=path.join(reactScriptsPath,"package.json");return fs.existsSync(scriptsPkgJson)||(reactScriptsPath="react-scripts"),reactScriptsPath}function isReactScriptsInstalled(requiredVersion="2.0.0"){try{let reactScriptsJson=__require(path.join(getReactScriptsPath(),"package.json"));return!semver.gtr(requiredVersion,reactScriptsJson.version)}catch{return!1}}var checkForNewPreset=presetsList=>{presetsList.some(preset=>{let presetName=typeof preset=="string"?preset:preset.name;return/@storybook(\/|\\)preset-create-react-app/.test(presetName)})||(logger2.warn("Storybook support for Create React App is now a separate preset."),logger2.warn("To use the new preset, install `@storybook/preset-create-react-app` and add it to the list of `addons` in your `.storybook/main.js` config file."),logger2.warn("The built-in preset has been disabled in Storybook 6.0."))},webpackFinal=(config,{presetsList})=>(isReactScriptsInstalled()&&presetsList&&checkForNewPreset(presetsList),config.module?.rules?.push({test:/\.m?js$/,type:"javascript/auto"},{test:/\.m?js$/,resolve:{fullySpecified:!1}}),config);export{webpackFinal};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__require}from"./chunk-R4NKYYJA.mjs";import ReactDocgenTypescriptPlugin from"@storybook/react-docgen-typescript-plugin";import{hasDocsOrControls}from"@storybook/docs-tools";var babel=async(config,options)=>{if(!hasDocsOrControls(options))return config;let typescriptOptions=await options.presets.apply("typescript",{}),{reactDocgen}=typescriptOptions||{};return typeof reactDocgen!="string"?config:{...config,overrides:[...config?.overrides||[],{test:reactDocgen==="react-docgen"?/\.(cjs|mjs|tsx?|jsx?)$/:/\.(cjs|mjs|jsx?)$/,plugins:[[__require.resolve("babel-plugin-react-docgen")]]}]}},webpackFinal=async(config,options)=>{if(!hasDocsOrControls(options))return config;let typescriptOptions=await options.presets.apply("typescript",{}),{reactDocgen,reactDocgenTypescriptOptions}=typescriptOptions||{};return reactDocgen!=="react-docgen-typescript"?config:{...config,plugins:[...config.plugins||[],new ReactDocgenTypescriptPlugin({...reactDocgenTypescriptOptions,savePropValueAsString:!0})]}};export{babel,webpackFinal};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__require}from"./chunk-R4NKYYJA.mjs";import{dirname,join}from"path";import ReactRefreshWebpackPlugin from"@pmmmwh/react-refresh-webpack-plugin";import{logger}from"@storybook/node-logger";var wrapForPnP=input=>dirname(__require.resolve(join(input,"package.json"))),applyFastRefresh=async options=>{let isDevelopment=options.configType==="DEVELOPMENT",framework=await options.presets.apply("framework"),reactOptions=typeof framework=="object"?framework.options:{};return isDevelopment&&(reactOptions.fastRefresh||process.env.FAST_REFRESH==="true")},babel=async(config,options)=>await applyFastRefresh(options)?{...config,plugins:[[__require.resolve("react-refresh/babel"),{},"storybook-react-refresh"],...config.plugins||[]]}:config,storybookReactDirName=wrapForPnP("@storybook/preset-react-webpack"),context=storybookReactDirName.includes("node_modules")?join(storybookReactDirName,"../../"):join(storybookReactDirName,"../../node_modules"),hasJsxRuntime=()=>{try{return __require.resolve("react/jsx-runtime",{paths:[context]}),!0}catch{return!1}},babelDefault=async config=>{let presetReactOptions=hasJsxRuntime()?{runtime:"automatic"}:{};return{...config,presets:[...config?.presets||[],[__require.resolve("@babel/preset-react"),presetReactOptions]],plugins:[...config?.plugins||[],__require.resolve("babel-plugin-add-react-displayname")]}},webpackFinal=async(config,options)=>await applyFastRefresh(options)?config.plugins?.find(p=>p.constructor.name==="ReactRefreshPlugin")?(logger.warn("=> React refresh is already set. You don't need to set the option"),config):(logger.info("=> Using React fast refresh"),{...config,plugins:[...config.plugins||[],new ReactRefreshWebpackPlugin({overlay:{sockIntegration:"whm"}})]}):config;export{babel,babelDefault,webpackFinal};
|