@storybook/preset-react-webpack 11.0.0-alpha.0 → 11.0.0-alpha.2

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,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_9ub49deyx1 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_9ub49deyx1 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_9ub49deyx1 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_wdmm9si2g6 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_wdmm9si2g6 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_wdmm9si2g6 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_9ub49deyx1.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_9ub49deyx1.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_9ub49deyx1.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_wdmm9si2g6.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_wdmm9si2g6.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_wdmm9si2g6.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
package/dist/index.d.ts CHANGED
@@ -5,16 +5,6 @@ import { PluginOptions } from "@storybook/react-docgen-typescript-plugin";
5
5
  //#region code/presets/react-webpack/.dts-emit/code/presets/react-webpack/src/types.d.ts
6
6
  interface ReactOptions {
7
7
  strictMode?: boolean;
8
- /**
9
- * Use React's legacy root API to mount components
10
- *
11
- * React has introduced a new root API with React 18.x to enable a whole set of new features (e.g.
12
- * concurrent features) If this flag is true, the legacy Root API is used to mount components to
13
- * make it easier to migrate step by step to React 18.
14
- *
15
- * @default false
16
- */
17
- legacyRootApi?: boolean;
18
8
  }
19
9
  type TypescriptOptions = TypescriptOptions$1 & {
20
10
  /**
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_9ub49deyx1 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_9ub49deyx1 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_9ub49deyx1 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_wdmm9si2g6 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_wdmm9si2g6 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_wdmm9si2g6 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_9ub49deyx1.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_9ub49deyx1.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_9ub49deyx1.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_wdmm9si2g6.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_wdmm9si2g6.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_wdmm9si2g6.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -13,7 +13,6 @@ var require = CJS_COMPAT_NODE_MODULE_9ub49deyx1.createRequire(import.meta.url);
13
13
  // src/index.ts
14
14
  import { fileURLToPath } from "node:url";
15
15
  var addons = [
16
- fileURLToPath(import.meta.resolve("@storybook/preset-react-webpack/preset-cra")),
17
16
  fileURLToPath(import.meta.resolve("@storybook/preset-react-webpack/preset-react-docs"))
18
17
  ];
19
18
  export {
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_9ub49deyx1 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_9ub49deyx1 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_9ub49deyx1 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_wdmm9si2g6 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_wdmm9si2g6 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_wdmm9si2g6 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_9ub49deyx1.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_9ub49deyx1.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_9ub49deyx1.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_wdmm9si2g6.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_wdmm9si2g6.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_wdmm9si2g6.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/preset-react-webpack",
3
- "version": "11.0.0-alpha.0",
3
+ "version": "11.0.0-alpha.2",
4
4
  "description": "Storybook for React: Develop React Component in isolation with Hot Reloading",
5
5
  "keywords": [
6
6
  "storybook"
@@ -27,7 +27,6 @@
27
27
  "default": "./dist/index.js"
28
28
  },
29
29
  "./package.json": "./package.json",
30
- "./preset-cra": "./dist/framework-preset-cra.js",
31
30
  "./preset-react-docs": "./dist/framework-preset-react-docs.js",
32
31
  "./react-docgen-loader": "./dist/loaders/react-docgen-loader.js"
33
32
  },
@@ -39,13 +38,11 @@
39
38
  "!src/**/*"
40
39
  ],
41
40
  "dependencies": {
42
- "@storybook/core-webpack": "11.0.0-alpha.0",
41
+ "@storybook/core-webpack": "11.0.0-alpha.2",
43
42
  "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0",
44
- "@types/semver": "^7.7.1",
45
43
  "magic-string": "^1.1.0",
46
44
  "react-docgen": "^8.0.2",
47
45
  "resolve": "^1.22.8",
48
- "semver": "^7.7.3",
49
46
  "tsconfig-paths": "^4.2.0",
50
47
  "webpack": "5"
51
48
  },
@@ -55,9 +52,9 @@
55
52
  "typescript": "^6.0.3"
56
53
  },
57
54
  "peerDependencies": {
58
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
59
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
60
- "storybook": "^11.0.0-alpha.0"
55
+ "react": "^18.0.0 || ^19.0.0",
56
+ "react-dom": "^18.0.0 || ^19.0.0",
57
+ "storybook": "^11.0.0-alpha.2"
61
58
  },
62
59
  "peerDependenciesMeta": {
63
60
  "typescript": {
@@ -1,76 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_9ub49deyx1 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_9ub49deyx1 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_9ub49deyx1 from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_9ub49deyx1.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_9ub49deyx1.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_9ub49deyx1.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
-
13
- // src/framework-preset-cra.ts
14
- import { logger as logger2 } from "storybook/internal/node-logger";
15
-
16
- // src/cra-config.ts
17
- import { existsSync, readFileSync, realpathSync } from "node:fs";
18
- import { join } from "node:path";
19
- import { pathToFileURL } from "node:url";
20
- import { logger } from "storybook/internal/node-logger";
21
- import semver from "semver";
22
- var appDirectory = realpathSync(process.cwd()), reactScriptsPath;
23
- function getReactScriptsPath({ noCache } = {}) {
24
- if (reactScriptsPath && !noCache)
25
- return reactScriptsPath;
26
- let reactScriptsScriptPath = realpathSync(join(appDirectory, "/node_modules/.bin/react-scripts"));
27
- try {
28
- if (/node_modules[\\/]\.bin[\\/]react-scripts/i.test(
29
- reactScriptsScriptPath
30
- )) {
31
- let packagePathMatch = readFileSync(reactScriptsScriptPath, "utf8").match(
32
- /"\$basedir[\\/]([^\s]+?[\\/]bin[\\/]react-scripts\.js")/i
33
- );
34
- packagePathMatch && packagePathMatch.length > 1 && (reactScriptsScriptPath = join(appDirectory, "/node_modules/.bin/", packagePathMatch[1]));
35
- }
36
- } catch (e) {
37
- logger.warn(`Error occurred during react-scripts package path resolving: ${e}`);
38
- }
39
- reactScriptsPath = join(reactScriptsScriptPath, "../..");
40
- let scriptsPkgJson = join(reactScriptsPath, "package.json");
41
- return existsSync(scriptsPkgJson) || (reactScriptsPath = "react-scripts"), reactScriptsPath;
42
- }
43
- async function isReactScriptsInstalled(minimumVersion = "2.0.0") {
44
- try {
45
- let { default: reactScriptsJson } = await import(pathToFileURL(join(getReactScriptsPath(), "package.json")).href, {
46
- with: { type: "json" }
47
- });
48
- return !semver.gtr(minimumVersion, reactScriptsJson.version);
49
- } catch {
50
- return !1;
51
- }
52
- }
53
-
54
- // src/framework-preset-cra.ts
55
- var checkForNewPreset = (presetsList) => {
56
- presetsList.some((preset) => {
57
- let presetName = typeof preset == "string" ? preset : preset.name;
58
- return /@storybook(\/|\\)preset-create-react-app/.test(presetName);
59
- }) || (logger2.warn("Storybook support for Create React App is now a separate preset."), logger2.warn(
60
- "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."
61
- ), logger2.warn("The built-in preset has been disabled in Storybook 6.0."));
62
- }, webpackFinal = async (config, { presetsList }) => (await isReactScriptsInstalled() && presetsList && checkForNewPreset(presetsList), config.module?.rules?.push(
63
- {
64
- test: /\.m?js$/,
65
- type: "javascript/auto"
66
- },
67
- {
68
- test: /\.m?js$/,
69
- resolve: {
70
- fullySpecified: !1
71
- }
72
- }
73
- ), config);
74
- export {
75
- webpackFinal
76
- };