@storybook/preset-react-webpack 7.0.0-alpha.11 → 7.0.0-alpha.16
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{a as r,b as l}from"./chunk-FT25OQ4I.mjs";import{logger as p}from"@storybook/node-logger";import n from"fs";import a from"path";import u from"@storybook/semver";import{logger as h}from"@storybook/node-logger";var f=n.realpathSync(process.cwd()),s;function y({noCache:e}={}){if(s&&!e)return s;let t=n.realpathSync(a.join(f,"/node_modules/.bin/react-scripts"));try{if(/node_modules[\\/]\.bin[\\/]react-scripts/i.test(t)){let i=n.readFileSync(t,"utf8").match(/"\$basedir[\\/]([^\s]+?[\\/]bin[\\/]react-scripts\.js")/i);i&&i.length>1&&(t=a.join(f,"/node_modules/.bin/",i[1]))}}catch(c){h.warn(`Error occurred during react-scripts package path resolving: ${c}`)}s=a.join(t,"../..");let o=a.join(s,"package.json");return n.existsSync(o)||(s="react-scripts"),s}r(y,"getReactScriptsPath");function d(e="2.0.0"){try{let t=l(a.join(y(),"package.json"));return!u.gtr(e,t.version)}catch{return!1}}r(d,"isReactScriptsInstalled");var g=r(e=>{e.some(o=>{let c=typeof o=="string"?o:o.name;return/@storybook(\/|\\)preset-create-react-app/.test(c)})||(p.warn("Storybook support for Create React App is now a separate preset."),p.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."),p.warn("The built-in preset has been disabled in Storybook 6.0."))},"checkForNewPreset"),R=r((e,{presetsList:t})=>(d()&&t&&g(t),e.module?.rules?.push({test:/\.m?js$/,type:"javascript/auto"},{test:/\.m?js$/,resolve:{fullySpecified:!1}}),e),"webpackFinal");export{R as webpackFinal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{a as p,b as c}from"./chunk-FT25OQ4I.mjs";import i from"@storybook/react-docgen-typescript-plugin";import{hasDocsOrControls as n}from"@storybook/docs-tools";var y=p(async(e,t)=>{if(!n(t))return e;let s=await t.presets.apply("typescript",{}),{reactDocgen:r}=s||{};return typeof r!="string"?e:{...e,overrides:[...e?.overrides||[],{test:r==="react-docgen"?/\.(cjs|mjs|tsx?|jsx?)$/:/\.(cjs|mjs|jsx?)$/,plugins:[[c.resolve("babel-plugin-react-docgen"),{DOC_GEN_COLLECTION_NAME:"STORYBOOK_REACT_CLASSES"}]]}]}},"babel"),O=p(async(e,t)=>{if(!n(t))return e;let s=await t.presets.apply("typescript",{}),{reactDocgen:r,reactDocgenTypescriptOptions:a}=s||{};return r!=="react-docgen-typescript"?e:{...e,plugins:[...e.plugins||[],new i({...a,savePropValueAsString:!0})]}},"webpackFinal");export{y as babel,O as webpackFinal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{a as t,b as o}from"./chunk-FT25OQ4I.mjs";import{readJSON as a}from"fs-extra";import{IgnorePlugin as n}from"webpack";var l=t(async e=>{let r=await a(o.resolve("react-dom/package.json"));return{...e,plugins:[...e.plugins||[],r?.version?.startsWith("18")||r?.version?.startsWith("0.0.0")?null:new n({resourceRegExp:/react-dom\/client$/,contextRegExp:/(renderers\/react|renderers\\react|@storybook\/react|@storybook\\react)/})].filter(Boolean)}},"webpackFinal");export{l as webpackFinal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{a as t,b as s,c as i}from"./chunk-FT25OQ4I.mjs";import c from"path";import l from"@pmmmwh/react-refresh-webpack-plugin";import{logger as u}from"@storybook/node-logger";var p=t(async e=>{let r=e.configType==="DEVELOPMENT",a=await e.presets.apply("framework"),n=typeof a=="object"?a.options:{};return r&&(n.fastRefresh||i.FAST_REFRESH==="true")},"useFastRefresh"),y=t(async(e,r)=>await p(r)?{...e,plugins:[[s.resolve("react-refresh/babel"),{},"storybook-react-refresh"],...e.plugins||[]]}:e,"babel"),o=c.dirname(s.resolve("@storybook/preset-react-webpack/package.json")),m=o.includes("node_modules")?c.join(o,"../../"):c.join(o,"../../node_modules"),f=t(()=>{try{return s.resolve("react/jsx-runtime",{paths:[m]}),!0}catch{return!1}},"hasJsxRuntime"),d=t(async e=>{let r=f()?{runtime:"automatic"}:{};return{...e,presets:[...e?.presets||[],[s.resolve("@babel/preset-react"),r]],plugins:[...e?.plugins||[],s.resolve("babel-plugin-add-react-displayname")]}},"babelDefault"),k=t(async(e,r)=>await p(r)?e.plugins?.find(n=>n.constructor.name==="ReactRefreshPlugin")?(u.warn("=> React refresh is already set. You don't need to set the option"),e):(u.info("=> Using React fast refresh"),{...e,plugins:[...e.plugins||[],new l({overlay:{sockIntegration:"whm"}})]}):e,"webpackFinal");export{y as babel,d as babelDefault,k as webpackFinal};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{b as e}from"./chunk-FT25OQ4I.mjs";var o=[e.resolve("@storybook/preset-react-webpack/dist/framework-preset-react"),e.resolve("@storybook/preset-react-webpack/dist/framework-preset-react-dom-hack"),e.resolve("@storybook/preset-react-webpack/dist/framework-preset-cra"),e.resolve("@storybook/preset-react-webpack/dist/framework-preset-react-docs")];export{o as addons};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/preset-react-webpack",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.16",
|
|
4
4
|
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
"@babel/preset-flow": "^7.12.1",
|
|
75
75
|
"@babel/preset-react": "^7.12.10",
|
|
76
76
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
|
|
77
|
-
"@storybook/core-webpack": "7.0.0-alpha.
|
|
78
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
79
|
-
"@storybook/node-logger": "7.0.0-alpha.
|
|
80
|
-
"@storybook/react": "7.0.0-alpha.
|
|
77
|
+
"@storybook/core-webpack": "7.0.0-alpha.16",
|
|
78
|
+
"@storybook/docs-tools": "7.0.0-alpha.16",
|
|
79
|
+
"@storybook/node-logger": "7.0.0-alpha.16",
|
|
80
|
+
"@storybook/react": "7.0.0-alpha.16",
|
|
81
81
|
"@storybook/react-docgen-typescript-plugin": "1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0",
|
|
82
82
|
"@storybook/semver": "^7.3.2",
|
|
83
83
|
"@types/node": "^14.14.20 || ^16.0.0",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
],
|
|
125
125
|
"platform": "node"
|
|
126
126
|
},
|
|
127
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "df30e7db2b251418af106345e5722477f057ec36"
|
|
128
128
|
}
|