@storybook/cli 10.3.0-alpha.0 → 10.3.0-alpha.10
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/_node-chunks/{block-dependencies-versions-NKSIQ6JR.js → block-dependencies-versions-43X24H7Z.js} +11 -11
- package/dist/_node-chunks/{block-experimental-addon-test-6QJCXU55.js → block-experimental-addon-test-IRW7SFW7.js} +9 -9
- package/dist/_node-chunks/{block-major-version-23NPBBXR.js → block-major-version-YTVDN5ZW.js} +9 -9
- package/dist/_node-chunks/{block-node-version-NFF5W3RZ.js → block-node-version-GIFN6HUU.js} +9 -9
- package/dist/_node-chunks/{block-webpack5-frameworks-TBWAUZUI.js → block-webpack5-frameworks-X5IF2WD2.js} +11 -11
- package/dist/_node-chunks/{chunk-R5H6HL6E.js → chunk-EDYMFKPK.js} +7 -7
- package/dist/_node-chunks/chunk-FJYLYZBH.js +11 -0
- package/dist/_node-chunks/{chunk-5XZQH3A2.js → chunk-LHV5EH27.js} +6 -6
- package/dist/_node-chunks/{chunk-P6ALO57V.js → chunk-LY2ESH6Z.js} +7 -7
- package/dist/_node-chunks/{chunk-SKESF3XN.js → chunk-ZYK2YTO7.js} +15 -15
- package/dist/_node-chunks/{globby-RUNUTPXN.js → globby-6R2RE6LC.js} +8 -8
- package/dist/_node-chunks/{p-limit-GSZZD2UR.js → p-limit-YATQRB7Y.js} +7 -7
- package/dist/_node-chunks/{run-IEYIM2LR.js → run-S4WVAXNN.js} +133 -58
- package/dist/bin/index.js +7 -7
- package/package.json +4 -4
- package/dist/_node-chunks/chunk-35DYTM5R.js +0 -11
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
findOutdatedPackage
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-ZYK2YTO7.js";
|
|
15
|
+
import "./chunk-EDYMFKPK.js";
|
|
16
|
+
import "./chunk-FJYLYZBH.js";
|
|
17
|
+
import "./chunk-LY2ESH6Z.js";
|
|
18
|
+
import "./chunk-LHV5EH27.js";
|
|
19
19
|
|
|
20
20
|
// src/autoblock/block-dependencies-versions.ts
|
|
21
21
|
import { dedent } from "ts-dedent";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FJYLYZBH.js";
|
|
13
13
|
import {
|
|
14
14
|
require_semver
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LY2ESH6Z.js";
|
|
16
16
|
import {
|
|
17
17
|
__toESM
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LHV5EH27.js";
|
|
19
19
|
|
|
20
20
|
// src/autoblock/block-experimental-addon-test.ts
|
|
21
21
|
var import_semver = __toESM(require_semver(), 1);
|
package/dist/_node-chunks/{block-major-version-23NPBBXR.js → block-major-version-YTVDN5ZW.js}
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FJYLYZBH.js";
|
|
13
13
|
import {
|
|
14
14
|
require_semver
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LY2ESH6Z.js";
|
|
16
16
|
import {
|
|
17
17
|
__toESM
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LHV5EH27.js";
|
|
19
19
|
|
|
20
20
|
// src/autoblock/block-major-version.ts
|
|
21
21
|
var import_semver = __toESM(require_semver(), 1);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FJYLYZBH.js";
|
|
13
13
|
import {
|
|
14
14
|
require_semver
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LY2ESH6Z.js";
|
|
16
16
|
import {
|
|
17
17
|
__toESM
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LHV5EH27.js";
|
|
19
19
|
|
|
20
20
|
// src/autoblock/block-node-version.ts
|
|
21
21
|
var import_semver = __toESM(require_semver(), 1);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
findOutdatedPackage
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-ZYK2YTO7.js";
|
|
15
|
+
import "./chunk-EDYMFKPK.js";
|
|
16
|
+
import "./chunk-FJYLYZBH.js";
|
|
17
|
+
import "./chunk-LY2ESH6Z.js";
|
|
18
|
+
import "./chunk-LHV5EH27.js";
|
|
19
19
|
|
|
20
20
|
// src/autoblock/block-webpack5-frameworks.ts
|
|
21
21
|
var minimalVersionsMap = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
__commonJS,
|
|
14
14
|
__require,
|
|
15
15
|
__toESM
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LHV5EH27.js";
|
|
17
17
|
|
|
18
18
|
// ../../../node_modules/fast-glob/out/utils/array.js
|
|
19
19
|
var require_array = __commonJS({
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
__commonJS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LHV5EH27.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/semver/internal/constants.js
|
|
17
17
|
var require_constants = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,14 +12,14 @@ var require = CJS_COMPAT_NODE_MODULE_6bfhswp810v.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
globby,
|
|
14
14
|
globbySync
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EDYMFKPK.js";
|
|
16
16
|
import {
|
|
17
17
|
require_semver
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LY2ESH6Z.js";
|
|
19
19
|
import {
|
|
20
20
|
__commonJS,
|
|
21
21
|
__toESM
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-LHV5EH27.js";
|
|
23
23
|
|
|
24
24
|
// ../../../node_modules/picocolors/picocolors.js
|
|
25
25
|
var require_picocolors = __commonJS({
|
|
@@ -122,11 +122,11 @@ var import_picocolors2 = __toESM(require_picocolors(), 1), import_semver = __toE
|
|
|
122
122
|
// src/autoblock/index.ts
|
|
123
123
|
var blockers = () => [
|
|
124
124
|
// add/remove blockers here
|
|
125
|
-
import("./block-dependencies-versions-
|
|
126
|
-
import("./block-node-version-
|
|
127
|
-
import("./block-webpack5-frameworks-
|
|
128
|
-
import("./block-major-version-
|
|
129
|
-
import("./block-experimental-addon-test-
|
|
125
|
+
import("./block-dependencies-versions-43X24H7Z.js"),
|
|
126
|
+
import("./block-node-version-GIFN6HUU.js"),
|
|
127
|
+
import("./block-webpack5-frameworks-X5IF2WD2.js"),
|
|
128
|
+
import("./block-major-version-YTVDN5ZW.js"),
|
|
129
|
+
import("./block-experimental-addon-test-IRW7SFW7.js")
|
|
130
130
|
], autoblock = async (options, list = blockers()) => list.length === 0 ? null : await Promise.all(
|
|
131
131
|
list.map(async (i) => {
|
|
132
132
|
let blocker = (await i).blocker;
|
|
@@ -340,7 +340,7 @@ var processProject = async ({
|
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
342
|
}, collectProjects = async (options, configDirs, onProjectScanStart) => {
|
|
343
|
-
let { default: pLimit } = await import("./p-limit-
|
|
343
|
+
let { default: pLimit } = await import("./p-limit-YATQRB7Y.js"), currentCLIVersion = versions.storybook, limit = pLimit(5), projectPromises = configDirs.map(
|
|
344
344
|
(configDir) => limit(
|
|
345
345
|
() => processProject({
|
|
346
346
|
configDir,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
isGitIgnoredSync,
|
|
22
22
|
isIgnoredByIgnoreFiles,
|
|
23
23
|
isIgnoredByIgnoreFilesSync
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-EDYMFKPK.js";
|
|
25
|
+
import "./chunk-LHV5EH27.js";
|
|
26
26
|
export {
|
|
27
27
|
convertPathToPattern,
|
|
28
28
|
generateGlobTasks,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-LHV5EH27.js";
|
|
13
13
|
|
|
14
14
|
// ../../../node_modules/yocto-queue/index.js
|
|
15
15
|
var Node = class {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -25,18 +25,18 @@ import {
|
|
|
25
25
|
shortenPath,
|
|
26
26
|
updateMainConfig,
|
|
27
27
|
upgradeStorybookDependencies
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-ZYK2YTO7.js";
|
|
29
29
|
import {
|
|
30
30
|
slash
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-EDYMFKPK.js";
|
|
32
32
|
import {
|
|
33
33
|
require_semver
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-LY2ESH6Z.js";
|
|
35
35
|
import {
|
|
36
36
|
__commonJS,
|
|
37
37
|
__require,
|
|
38
38
|
__toESM
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-LHV5EH27.js";
|
|
40
40
|
|
|
41
41
|
// ../../../node_modules/envinfo/dist/envinfo.js
|
|
42
42
|
var require_envinfo = __commonJS({
|
|
@@ -4716,7 +4716,7 @@ import {
|
|
|
4716
4716
|
isCI as isCI2,
|
|
4717
4717
|
optionalEnvToBoolean as optionalEnvToBoolean3,
|
|
4718
4718
|
removeAddon as remove,
|
|
4719
|
-
versions as
|
|
4719
|
+
versions as versions5
|
|
4720
4720
|
} from "storybook/internal/common";
|
|
4721
4721
|
import { withTelemetry } from "storybook/internal/core-server";
|
|
4722
4722
|
import { CLI_COLORS as CLI_COLORS5, logTracker as logTracker4, logger as logger22 } from "storybook/internal/node-logger";
|
|
@@ -4761,7 +4761,7 @@ function leven(first, second, options) {
|
|
|
4761
4761
|
var import_picocolors16 = __toESM(require_picocolors(), 1);
|
|
4762
4762
|
|
|
4763
4763
|
// package.json
|
|
4764
|
-
var version = "10.3.0-alpha.
|
|
4764
|
+
var version = "10.3.0-alpha.10";
|
|
4765
4765
|
|
|
4766
4766
|
// src/add.ts
|
|
4767
4767
|
var import_semver = __toESM(require_semver(), 1);
|
|
@@ -5079,6 +5079,7 @@ function isValidVersion(version2) {
|
|
|
5079
5079
|
|
|
5080
5080
|
// src/automigrate/index.ts
|
|
5081
5081
|
var import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
5082
|
+
import { versions as versions3 } from "storybook/internal/common";
|
|
5082
5083
|
import { logTracker as logTracker2, logger as logger16, prompt as prompt3 } from "storybook/internal/node-logger";
|
|
5083
5084
|
import { AutomigrateError } from "storybook/internal/server-errors";
|
|
5084
5085
|
|
|
@@ -5108,18 +5109,18 @@ import { frameworkPackages, rendererPackages } from "storybook/internal/common";
|
|
|
5108
5109
|
|
|
5109
5110
|
// src/doctor/hasMultipleVersions.ts
|
|
5110
5111
|
var import_semver2 = __toESM(require_semver(), 1);
|
|
5111
|
-
function hasMultipleVersions(
|
|
5112
|
-
return
|
|
5112
|
+
function hasMultipleVersions(versions6) {
|
|
5113
|
+
return versions6.find((v) => {
|
|
5113
5114
|
let major = import_semver2.default.major(v);
|
|
5114
5115
|
if (major === 0) {
|
|
5115
5116
|
let minor = import_semver2.default.minor(v);
|
|
5116
5117
|
if (minor === 0) {
|
|
5117
5118
|
let patch = import_semver2.default.patch(v);
|
|
5118
|
-
return
|
|
5119
|
+
return versions6.some((v2) => import_semver2.default.patch(v2) !== patch);
|
|
5119
5120
|
}
|
|
5120
|
-
return
|
|
5121
|
+
return versions6.some((v2) => import_semver2.default.minor(v2) !== minor);
|
|
5121
5122
|
}
|
|
5122
|
-
return
|
|
5123
|
+
return versions6.some((v2) => import_semver2.default.major(v2) !== major);
|
|
5123
5124
|
});
|
|
5124
5125
|
}
|
|
5125
5126
|
|
|
@@ -5624,7 +5625,7 @@ import { logger as logger3 } from "storybook/internal/node-logger";
|
|
|
5624
5625
|
import { promises as fs } from "fs";
|
|
5625
5626
|
var maxConcurrentTasks = Math.max(1, os.cpus().length - 1);
|
|
5626
5627
|
async function runCodemod(globPattern = "**/*.{stories,story}.{js,jsx,ts,tsx,mjs,mjsx,mts,mtsx}", transform, { dryRun = !1, skipFormatting = !1 } = {}) {
|
|
5627
|
-
let modifiedCount = 0, unmodifiedCount = 0, errorCount = 0, { globby } = await import("./globby-
|
|
5628
|
+
let modifiedCount = 0, unmodifiedCount = 0, errorCount = 0, { globby } = await import("./globby-6R2RE6LC.js"), files = await globby(slash(globPattern), {
|
|
5628
5629
|
followSymbolicLinks: !0,
|
|
5629
5630
|
ignore: ["**/node_modules/**", "**/dist/**", "**/storybook-static/**", "**/build/**"]
|
|
5630
5631
|
});
|
|
@@ -5635,7 +5636,7 @@ Please try a different pattern.
|
|
|
5635
5636
|
`
|
|
5636
5637
|
), new Error("No files matched");
|
|
5637
5638
|
try {
|
|
5638
|
-
let pLimit = (await import("./p-limit-
|
|
5639
|
+
let pLimit = (await import("./p-limit-YATQRB7Y.js")).default, limit = pLimit(maxConcurrentTasks);
|
|
5639
5640
|
await Promise.all(
|
|
5640
5641
|
files.map(
|
|
5641
5642
|
(file) => limit(async () => {
|
|
@@ -5751,6 +5752,10 @@ function getConfigProperties(exportDecls, options) {
|
|
|
5751
5752
|
));
|
|
5752
5753
|
return properties;
|
|
5753
5754
|
}
|
|
5755
|
+
function addImportToTop(programNode, importDecl) {
|
|
5756
|
+
let firstNode = programNode.body[0];
|
|
5757
|
+
firstNode && firstNode.leadingComments && firstNode.leadingComments.length > 0 && (importDecl.comments = firstNode.leadingComments, firstNode.leadingComments = [], firstNode.comments = []), programNode.body.unshift(importDecl);
|
|
5758
|
+
}
|
|
5754
5759
|
|
|
5755
5760
|
// src/codemod/helpers/config-to-csf-factory.ts
|
|
5756
5761
|
async function configToCsfFactory(info, { configType, frameworkPackage }, { dryRun = !1, skipFormatting = !1 } = {}) {
|
|
@@ -5807,6 +5812,9 @@ ${err}`), info.source;
|
|
|
5807
5812
|
t2.objectExpression(defineConfigProps)
|
|
5808
5813
|
]);
|
|
5809
5814
|
programNode.body = removeExportDeclarations(programNode, exportDecls), programNode.body.push(t2.exportDefaultDeclaration(defineConfigCall));
|
|
5815
|
+
} else if (configType === "preview") {
|
|
5816
|
+
let defineConfigCall = t2.callExpression(t2.identifier(methodName), [t2.objectExpression([])]);
|
|
5817
|
+
programNode.body.push(t2.exportDefaultDeclaration(defineConfigCall));
|
|
5810
5818
|
}
|
|
5811
5819
|
let configImport = t2.importDeclaration(
|
|
5812
5820
|
[t2.importSpecifier(t2.identifier(methodName), t2.identifier(methodName))],
|
|
@@ -5818,7 +5826,7 @@ ${err}`), info.source;
|
|
|
5818
5826
|
(specifier) => t2.isImportSpecifier(specifier) && t2.isIdentifier(specifier.imported) && specifier.imported.name === methodName
|
|
5819
5827
|
) || existingImport.specifiers.push(
|
|
5820
5828
|
t2.importSpecifier(t2.identifier(methodName), t2.identifier(methodName))
|
|
5821
|
-
) : programNode
|
|
5829
|
+
) : addImportToTop(programNode, configImport);
|
|
5822
5830
|
let disallowList2 = ["StorybookConfig", "Preview"];
|
|
5823
5831
|
programNode.body = cleanupTypeImports(programNode, disallowList2);
|
|
5824
5832
|
let output = printConfig(config).code;
|
|
@@ -5914,8 +5922,14 @@ ${err}`), info.source;
|
|
|
5914
5922
|
let relativePath = path2.relative(path2.dirname(info.path), previewConfigPath), { dir, name } = path2.parse(relativePath);
|
|
5915
5923
|
previewPath = `${dir ? `${dir}/` : ""}${name}`, previewPath.startsWith(".") || (previewPath = `./${previewPath}`), previewPath = previewPath.replace(/\\/g, "/");
|
|
5916
5924
|
}
|
|
5917
|
-
let sbConfigImportName = hasRootLevelConfig ? "storybookPreview" : "preview", sbConfigImportSpecifier = t4.importDefaultSpecifier(t4.identifier(sbConfigImportName));
|
|
5925
|
+
let sbConfigImportName = hasRootLevelConfig ? "storybookPreview" : "preview", sbConfigImportSpecifier = t4.importDefaultSpecifier(t4.identifier(sbConfigImportName)), namespaceStoryImports = /* @__PURE__ */ new Set(), namedStoryImports = /* @__PURE__ */ new Set();
|
|
5918
5926
|
programNode.body.forEach((node) => {
|
|
5927
|
+
if (t4.isImportDeclaration(node)) {
|
|
5928
|
+
let importPath = node.source.value;
|
|
5929
|
+
/\.stories(\.(ts|tsx|js|jsx|mjs|mts))?$/.test(importPath) && node.specifiers.forEach((specifier) => {
|
|
5930
|
+
t4.isImportNamespaceSpecifier(specifier) ? namespaceStoryImports.add(specifier.local.name) : t4.isImportSpecifier(specifier) ? namedStoryImports.add(specifier.local.name) : t4.isImportDefaultSpecifier(specifier) && namespaceStoryImports.add(specifier.local.name);
|
|
5931
|
+
});
|
|
5932
|
+
}
|
|
5919
5933
|
if (t4.isImportDeclaration(node) && isValidPreviewPath(node.source.value)) {
|
|
5920
5934
|
let defaultImportSpecifier = node.specifiers.find(
|
|
5921
5935
|
(specifier) => t4.isImportDefaultSpecifier(specifier)
|
|
@@ -5923,7 +5937,7 @@ ${err}`), info.source;
|
|
|
5923
5937
|
defaultImportSpecifier ? defaultImportSpecifier.local.name !== sbConfigImportName && (sbConfigImportName = defaultImportSpecifier.local.name) : node.specifiers.push(sbConfigImportSpecifier), previewImport = node;
|
|
5924
5938
|
}
|
|
5925
5939
|
});
|
|
5926
|
-
let hasMeta = !!csf._meta;
|
|
5940
|
+
let hasMeta = !!csf._meta, storyFileImports = /* @__PURE__ */ new Set([...namespaceStoryImports, ...namedStoryImports]);
|
|
5927
5941
|
Object.entries(csf._storyExports).forEach(([exportName, decl]) => {
|
|
5928
5942
|
let id = decl.id, declarator = decl, init = t4.isVariableDeclarator(declarator) ? declarator.init : void 0;
|
|
5929
5943
|
t4.isIdentifier(id) && init && (id.typeAnnotation && (id.typeAnnotation = null), (t4.isTSSatisfiesExpression(init) || t4.isTSAsExpression(init)) && (init = init.expression), t4.isObjectExpression(init) ? (declarator.init = t4.callExpression(
|
|
@@ -5954,6 +5968,11 @@ ${err}`), info.source;
|
|
|
5954
5968
|
)
|
|
5955
5969
|
);
|
|
5956
5970
|
if (traverse3(csf._ast, {
|
|
5971
|
+
/**
|
|
5972
|
+
* Handle SAME-FILE story references.
|
|
5973
|
+
*
|
|
5974
|
+
* Examples: Primary.args → Primary.input.args meta.args → meta.input.args
|
|
5975
|
+
*/
|
|
5957
5976
|
Identifier(nodePath) {
|
|
5958
5977
|
let identifierName = nodePath.node.name, binding = nodePath.scope.getBinding(identifierName);
|
|
5959
5978
|
if (binding && storyExportDecls.has(binding.identifier.name) || identifierName === metaVariableName) {
|
|
@@ -5970,6 +5989,48 @@ ${err}`), info.source;
|
|
|
5970
5989
|
throw err;
|
|
5971
5990
|
}
|
|
5972
5991
|
}
|
|
5992
|
+
},
|
|
5993
|
+
/**
|
|
5994
|
+
* Handle CROSS-FILE story references.
|
|
5995
|
+
*
|
|
5996
|
+
* When we import stories from another file: import * as BaseStories from './Button.stories';
|
|
5997
|
+
*
|
|
5998
|
+
* And use them like: BaseStories.Primary.args
|
|
5999
|
+
*
|
|
6000
|
+
* We need to transform to: BaseStories.Primary.input.args
|
|
6001
|
+
*
|
|
6002
|
+
* Why? Because the imported file will ALSO be transformed to CSF4, where story properties are
|
|
6003
|
+
* accessed via `.input`.
|
|
6004
|
+
*/
|
|
6005
|
+
MemberExpression(nodePath) {
|
|
6006
|
+
let node = nodePath.node, innerObject = node.object;
|
|
6007
|
+
if (t4.isMemberExpression(innerObject)) {
|
|
6008
|
+
let importName = innerObject.object, storyName = innerObject.property, accessedProperty = node.property;
|
|
6009
|
+
if (t4.isIdentifier(importName) && storyFileImports.has(importName.name) && t4.isIdentifier(storyName)) {
|
|
6010
|
+
if (t4.isIdentifier(storyName, { name: "input" }) || !t4.isIdentifier(accessedProperty) || accessedProperty.name === "input" || reuseDisallowList.includes(accessedProperty.name))
|
|
6011
|
+
return;
|
|
6012
|
+
nodePath.node.object = t4.memberExpression(innerObject, t4.identifier("input")), nodePath.skip();
|
|
6013
|
+
}
|
|
6014
|
+
}
|
|
6015
|
+
if (t4.isIdentifier(innerObject) && namedStoryImports.has(innerObject.name)) {
|
|
6016
|
+
let accessedProperty = node.property;
|
|
6017
|
+
if (!t4.isIdentifier(accessedProperty) || accessedProperty.name === "input" || reuseDisallowList.includes(accessedProperty.name))
|
|
6018
|
+
return;
|
|
6019
|
+
nodePath.replaceWith(
|
|
6020
|
+
t4.memberExpression(
|
|
6021
|
+
t4.memberExpression(innerObject, t4.identifier("input")),
|
|
6022
|
+
accessedProperty
|
|
6023
|
+
)
|
|
6024
|
+
), nodePath.skip();
|
|
6025
|
+
return;
|
|
6026
|
+
}
|
|
6027
|
+
if (t4.isIdentifier(innerObject) && namespaceStoryImports.has(innerObject.name)) {
|
|
6028
|
+
let storyName = node.property;
|
|
6029
|
+
if (t4.isIdentifier(storyName, { name: "input" }))
|
|
6030
|
+
return;
|
|
6031
|
+
let parent = nodePath.parent;
|
|
6032
|
+
t4.isSpreadElement(parent) && (nodePath.replaceWith(t4.memberExpression(node, t4.identifier("input"))), nodePath.skip());
|
|
6033
|
+
}
|
|
5973
6034
|
}
|
|
5974
6035
|
}), transformedStoryExports.size === 0)
|
|
5975
6036
|
return logger5.warn(
|
|
@@ -6014,19 +6075,19 @@ Some of the detected stories [${detectedStoryNames.map((name) => `"${name}"`).jo
|
|
|
6014
6075
|
[t4.importDefaultSpecifier(t4.identifier(sbConfigImportName))],
|
|
6015
6076
|
t4.stringLiteral(previewPath)
|
|
6016
6077
|
);
|
|
6017
|
-
programNode
|
|
6078
|
+
addImportToTop(programNode, configImport);
|
|
6018
6079
|
}
|
|
6019
6080
|
return removeUnusedTypes(programNode, csf._ast), printCsf(csf).code;
|
|
6020
6081
|
}
|
|
6021
6082
|
|
|
6022
6083
|
// src/codemod/csf-factories.ts
|
|
6023
6084
|
async function runStoriesCodemod(options) {
|
|
6024
|
-
let { dryRun, packageManager, ...codemodOptions } = options;
|
|
6085
|
+
let { dryRun, packageManager, yes, glob, ...codemodOptions } = options;
|
|
6025
6086
|
try {
|
|
6026
|
-
let globString = "{stories,
|
|
6027
|
-
|
|
6087
|
+
let inSandbox = optionalEnvToBoolean(process.env.IN_STORYBOOK_SANDBOX) ?? !1, globString = glob ?? "**/*.{stories,story}.{js,jsx,ts,tsx,mjs,mjsx,mts,mtsx}";
|
|
6088
|
+
!glob && inSandbox ? globString = "{stories,src}/**/{Button,Header,Page,button,header,page}.stories.*" : !glob && !yes && (logger6.log("Please enter the glob for your stories to migrate"), globString = await prompt2.text({
|
|
6028
6089
|
message: "glob",
|
|
6029
|
-
initialValue:
|
|
6090
|
+
initialValue: globString
|
|
6030
6091
|
})), logger6.step("Applying codemod on your stories, this might take some time..."), await packageManager.runPackageCommand({
|
|
6031
6092
|
args: ["storybook", "migrate", "csf-2-to-3", `--glob="${globString}"`]
|
|
6032
6093
|
}), await runCodemod(globString, (info) => storyToCsfFactory(info, codemodOptions), {
|
|
@@ -6042,9 +6103,18 @@ async function runStoriesCodemod(options) {
|
|
|
6042
6103
|
var csfFactories = {
|
|
6043
6104
|
id: "csf-factories",
|
|
6044
6105
|
promptType: "command",
|
|
6045
|
-
async run({
|
|
6046
|
-
|
|
6047
|
-
|
|
6106
|
+
async run({
|
|
6107
|
+
dryRun,
|
|
6108
|
+
mainConfig,
|
|
6109
|
+
mainConfigPath,
|
|
6110
|
+
previewConfigPath,
|
|
6111
|
+
packageManager,
|
|
6112
|
+
configDir,
|
|
6113
|
+
yes,
|
|
6114
|
+
glob
|
|
6115
|
+
}) {
|
|
6116
|
+
let inSandbox = optionalEnvToBoolean(process.env.IN_STORYBOOK_SANDBOX) ?? !1, useSubPathImports = inSandbox;
|
|
6117
|
+
!yes && !inSandbox && (logger6.logBox(dedent3`
|
|
6048
6118
|
The CSF Factories format can benefit from using absolute imports of your ${import_picocolors7.default.cyan(previewConfigPath)} file. We can configure that for you, using subpath imports (a node standard), by adjusting the imports property of your package.json.
|
|
6049
6119
|
|
|
6050
6120
|
However, we cannot broadly recommend it for all projects, because it might not work in some monorepo setups or if you have an outdated tsconfig, use custom paths, or have type alias plugins configured in your project. You can always rerun this codemod and select another option to update your code later.
|
|
@@ -6071,7 +6141,9 @@ var csfFactories = {
|
|
|
6071
6141
|
dryRun,
|
|
6072
6142
|
packageManager,
|
|
6073
6143
|
useSubPathImports,
|
|
6074
|
-
previewConfigPath
|
|
6144
|
+
previewConfigPath,
|
|
6145
|
+
yes,
|
|
6146
|
+
glob
|
|
6075
6147
|
}), logger6.step("Applying codemod on your main config...");
|
|
6076
6148
|
let frameworkPackage = getFrameworkPackageName(mainConfig) || "@storybook/your-framework-here";
|
|
6077
6149
|
await runCodemod(
|
|
@@ -6395,7 +6467,7 @@ var addonA11yParameters = {
|
|
|
6395
6467
|
errors.push({ file: previewFileToUpdate, error });
|
|
6396
6468
|
}
|
|
6397
6469
|
}
|
|
6398
|
-
let { default: pLimit } = await import("./p-limit-
|
|
6470
|
+
let { default: pLimit } = await import("./p-limit-YATQRB7Y.js"), limit = pLimit(10);
|
|
6399
6471
|
if (await Promise.all(
|
|
6400
6472
|
storyFilesToUpdate.map(
|
|
6401
6473
|
(file) => limit(async () => {
|
|
@@ -6549,7 +6621,7 @@ var addonGlobalsApi = {
|
|
|
6549
6621
|
}
|
|
6550
6622
|
};
|
|
6551
6623
|
async function transformStoryFiles(files, options, dryRun) {
|
|
6552
|
-
let errors = [], { default: pLimit } = await import("./p-limit-
|
|
6624
|
+
let errors = [], { default: pLimit } = await import("./p-limit-YATQRB7Y.js"), limit = pLimit(10);
|
|
6553
6625
|
return await Promise.all(
|
|
6554
6626
|
files.map(
|
|
6555
6627
|
(file) => limit(async () => {
|
|
@@ -6741,7 +6813,7 @@ function transformPackageJson(content) {
|
|
|
6741
6813
|
return hasChanges ? JSON.stringify(packageJson, null, 2) : null;
|
|
6742
6814
|
}
|
|
6743
6815
|
var transformPackageJsonFiles = async (files, dryRun) => {
|
|
6744
|
-
let errors = [], { default: pLimit } = await import("./p-limit-
|
|
6816
|
+
let errors = [], { default: pLimit } = await import("./p-limit-YATQRB7Y.js"), limit = pLimit(10);
|
|
6745
6817
|
return await Promise.all(
|
|
6746
6818
|
files.map(
|
|
6747
6819
|
(file) => limit(async () => {
|
|
@@ -6780,7 +6852,7 @@ var transformPackageJsonFiles = async (files, dryRun) => {
|
|
|
6780
6852
|
dryRun
|
|
6781
6853
|
);
|
|
6782
6854
|
errors.push(...packageJsonErrors);
|
|
6783
|
-
let { globby } = await import("./globby-
|
|
6855
|
+
let { globby } = await import("./globby-6R2RE6LC.js"), configFiles = await globby([`${configDir}/**/*`]), importErrors = await transformImportFiles(
|
|
6784
6856
|
[...storiesPaths, ...configFiles].filter(Boolean),
|
|
6785
6857
|
{
|
|
6786
6858
|
...consolidatedPackages,
|
|
@@ -7133,7 +7205,7 @@ var VITE_DEFAULT_VERSION = "^7.0.0", transformMainConfig = async (mainConfigPath
|
|
|
7133
7205
|
]);
|
|
7134
7206
|
}
|
|
7135
7207
|
mainConfigPath && (logger11.debug("Updating main config file..."), await transformMainConfig(mainConfigPath, dryRun)), logger11.debug("Scanning and updating import statements...");
|
|
7136
|
-
let { globby } = await import("./globby-
|
|
7208
|
+
let { globby } = await import("./globby-6R2RE6LC.js"), configFiles = await globby([`${configDir}/**/*`]), allFiles = [...storiesPaths, ...configFiles].filter(Boolean), transformErrors = await transformImportFiles2(
|
|
7137
7209
|
allFiles,
|
|
7138
7210
|
{
|
|
7139
7211
|
"@storybook/nextjs": "@storybook/nextjs-vite"
|
|
@@ -7343,7 +7415,7 @@ var getAllDependencies = (packageJson) => Object.keys({
|
|
|
7343
7415
|
let regex = new RegExp(`(['"])${renderer}(['"])`, "g");
|
|
7344
7416
|
return regex.test(source) ? source.replace(regex, `$1${framework}$2`) : null;
|
|
7345
7417
|
}, transformSourceFiles = async (files, renderer, framework, dryRun) => {
|
|
7346
|
-
let errors = [], { default: pLimit } = await import("./p-limit-
|
|
7418
|
+
let errors = [], { default: pLimit } = await import("./p-limit-YATQRB7Y.js"), limit = pLimit(10);
|
|
7347
7419
|
return await Promise.all(
|
|
7348
7420
|
files.map(
|
|
7349
7421
|
(file) => limit(async () => {
|
|
@@ -7410,7 +7482,7 @@ var getAllDependencies = (packageJson) => Object.keys({
|
|
|
7410
7482
|
continue;
|
|
7411
7483
|
logger13.debug(`
|
|
7412
7484
|
Migrating ${rendererPackage} to ${selectedFramework}`);
|
|
7413
|
-
let { globby } = await import("./globby-
|
|
7485
|
+
let { globby } = await import("./globby-6R2RE6LC.js"), configFiles = await globby([`${configDir}/**/*`]);
|
|
7414
7486
|
await transformSourceFiles(
|
|
7415
7487
|
[...storiesPaths, ...configFiles].filter(Boolean),
|
|
7416
7488
|
rendererPackage,
|
|
@@ -7440,7 +7512,7 @@ async function renameInFile(filePath, oldText, newText) {
|
|
|
7440
7512
|
}
|
|
7441
7513
|
var getDotStorybookReferences = async (searchDir) => {
|
|
7442
7514
|
try {
|
|
7443
|
-
let { globby } = await import("./globby-
|
|
7515
|
+
let { globby } = await import("./globby-6R2RE6LC.js"), { readFile: readFile10 } = await import("node:fs/promises"), files = await globby(`${searchDir}/**/*`, {
|
|
7444
7516
|
onlyFiles: !0,
|
|
7445
7517
|
gitignore: !0
|
|
7446
7518
|
}), referencedFiles = [];
|
|
@@ -7461,7 +7533,7 @@ var getDotStorybookReferences = async (searchDir) => {
|
|
|
7461
7533
|
async check({ packageManager, mainConfigPath }) {
|
|
7462
7534
|
if (!packageManager.getAllDependencies()["@storybook/react-native"])
|
|
7463
7535
|
return null;
|
|
7464
|
-
let projectDir = mainConfigPath ? join2(mainConfigPath, "..", "..") : process.cwd(), storybookDir = join2(projectDir, ".storybook"), rnStorybookDir = join2(projectDir, ".rnstorybook"), { globby } = await import("./globby-
|
|
7536
|
+
let projectDir = mainConfigPath ? join2(mainConfigPath, "..", "..") : process.cwd(), storybookDir = join2(projectDir, ".storybook"), rnStorybookDir = join2(projectDir, ".rnstorybook"), { globby } = await import("./globby-6R2RE6LC.js"), requiresFiles = await globby(join2(storybookDir, "storybook.requires.*"));
|
|
7465
7537
|
return existsSync2(storybookDir) && requiresFiles.length > 0 && !existsSync2(rnStorybookDir) ? { storybookDir, rnStorybookDir } : null;
|
|
7466
7538
|
},
|
|
7467
7539
|
prompt() {
|
|
@@ -7680,14 +7752,12 @@ var logAvailableMigrations = () => {
|
|
|
7680
7752
|
configDir: options.configDir,
|
|
7681
7753
|
packageManagerName: options.packageManager
|
|
7682
7754
|
});
|
|
7683
|
-
if (!versionInstalled)
|
|
7684
|
-
throw new Error("Could not determine Storybook version");
|
|
7685
7755
|
if (!mainConfigPath)
|
|
7686
7756
|
throw new Error("Could not determine main config path");
|
|
7687
7757
|
let outcome = await automigrate({
|
|
7688
7758
|
...options,
|
|
7689
7759
|
packageManager,
|
|
7690
|
-
storybookVersion: versionInstalled,
|
|
7760
|
+
storybookVersion: versionInstalled || versions3.storybook,
|
|
7691
7761
|
mainConfigPath,
|
|
7692
7762
|
mainConfig,
|
|
7693
7763
|
previewConfigPath,
|
|
@@ -7724,7 +7794,8 @@ var logAvailableMigrations = () => {
|
|
|
7724
7794
|
isUpgrade,
|
|
7725
7795
|
isLatest,
|
|
7726
7796
|
storiesPaths,
|
|
7727
|
-
hasCsfFactoryPreview
|
|
7797
|
+
hasCsfFactoryPreview,
|
|
7798
|
+
glob
|
|
7728
7799
|
}) => {
|
|
7729
7800
|
if (list)
|
|
7730
7801
|
return logAvailableMigrations(), null;
|
|
@@ -7739,7 +7810,9 @@ var logAvailableMigrations = () => {
|
|
|
7739
7810
|
mainConfig,
|
|
7740
7811
|
result: null,
|
|
7741
7812
|
storybookVersion,
|
|
7742
|
-
storiesPaths
|
|
7813
|
+
storiesPaths,
|
|
7814
|
+
yes,
|
|
7815
|
+
glob
|
|
7743
7816
|
}), null;
|
|
7744
7817
|
let selectedFixes = inputFixes || allFixes.filter((fix) => !(fix.id === upgradeStorybookRelatedDependencies.id && isLatest === !1 && fixId !== upgradeStorybookRelatedDependencies.id)), fixes = fixId ? selectedFixes.filter((f) => f.id === fixId) : selectedFixes;
|
|
7745
7818
|
if (fixId && fixes.length === 0)
|
|
@@ -7876,7 +7949,8 @@ ${error.stack}`), fixSummary.failed[f.id] = error.message), fixResults[f.id] = "
|
|
|
7876
7949
|
mainConfig,
|
|
7877
7950
|
skipInstall,
|
|
7878
7951
|
storybookVersion,
|
|
7879
|
-
storiesPaths
|
|
7952
|
+
storiesPaths,
|
|
7953
|
+
yes
|
|
7880
7954
|
}), logger16.log(`\u2705 ran ${import_picocolors13.default.cyan(f.id)} migration`), fixResults[f.id] = "succeeded" /* SUCCEEDED */, fixSummary.succeeded.push(f.id), currentTaskLogger.success(`Ran ${import_picocolors13.default.cyan(f.id)} migration`);
|
|
7881
7955
|
} catch (error) {
|
|
7882
7956
|
fixResults[f.id] = "failed" /* FAILED */;
|
|
@@ -7969,7 +8043,7 @@ import {
|
|
|
7969
8043
|
JsPackageManagerFactory,
|
|
7970
8044
|
isCI,
|
|
7971
8045
|
optionalEnvToBoolean as optionalEnvToBoolean2,
|
|
7972
|
-
versions as
|
|
8046
|
+
versions as versions4
|
|
7973
8047
|
} from "storybook/internal/common";
|
|
7974
8048
|
import { logger as logger19, prompt as prompt4 } from "storybook/internal/node-logger";
|
|
7975
8049
|
var import_picocolors14 = __toESM(require_picocolors(), 1), import_semver6 = __toESM(require_semver(), 1);
|
|
@@ -8418,7 +8492,7 @@ var baseTemplates = {
|
|
|
8418
8492
|
renderer: "@storybook/html",
|
|
8419
8493
|
builder: "@storybook/builder-vite"
|
|
8420
8494
|
},
|
|
8421
|
-
skipTasks: ["e2e-tests", "bench"
|
|
8495
|
+
skipTasks: ["e2e-tests", "bench"],
|
|
8422
8496
|
initOptions: {
|
|
8423
8497
|
type: "html" /* HTML */
|
|
8424
8498
|
}
|
|
@@ -8431,7 +8505,7 @@ var baseTemplates = {
|
|
|
8431
8505
|
renderer: "@storybook/html",
|
|
8432
8506
|
builder: "@storybook/builder-vite"
|
|
8433
8507
|
},
|
|
8434
|
-
skipTasks: ["e2e-tests", "bench"
|
|
8508
|
+
skipTasks: ["e2e-tests", "bench"],
|
|
8435
8509
|
initOptions: {
|
|
8436
8510
|
type: "html" /* HTML */
|
|
8437
8511
|
}
|
|
@@ -8523,7 +8597,7 @@ var baseTemplates = {
|
|
|
8523
8597
|
useCsfFactory: !0
|
|
8524
8598
|
},
|
|
8525
8599
|
// Remove smoke-test from the list once https://github.com/storybookjs/storybook/issues/19351 is fixed.
|
|
8526
|
-
skipTasks: ["smoke-test", "e2e-tests", "bench"
|
|
8600
|
+
skipTasks: ["smoke-test", "e2e-tests", "bench"]
|
|
8527
8601
|
},
|
|
8528
8602
|
"lit-vite/default-ts": {
|
|
8529
8603
|
name: "Lit Latest (Vite | TypeScript)",
|
|
@@ -8537,7 +8611,7 @@ var baseTemplates = {
|
|
|
8537
8611
|
useCsfFactory: !0
|
|
8538
8612
|
},
|
|
8539
8613
|
// Remove smoke-test from the list once https://github.com/storybookjs/storybook/issues/19351 is fixed.
|
|
8540
|
-
skipTasks: ["smoke-test", "e2e-tests", "bench"
|
|
8614
|
+
skipTasks: ["smoke-test", "e2e-tests", "bench"]
|
|
8541
8615
|
},
|
|
8542
8616
|
"lit-rsbuild/default-ts": {
|
|
8543
8617
|
name: "Web Components Latest (RsBuild | TypeScript)",
|
|
@@ -8877,7 +8951,7 @@ var toChoices = (c) => ({ label: allTemplates[c].name, value: c }), sandbox = as
|
|
|
8877
8951
|
}) => {
|
|
8878
8952
|
let selectedConfig = allTemplates[filterValue], templateId = selectedConfig ? filterValue : null, { packageManager: pkgMgr } = options, packageManager = JsPackageManagerFactory.getPackageManager({
|
|
8879
8953
|
force: pkgMgr
|
|
8880
|
-
}), latestVersion = await packageManager.latestVersion("storybook"), nextVersion = await packageManager.latestVersion("storybook@next") ?? "0.0.0", currentVersion =
|
|
8954
|
+
}), latestVersion = await packageManager.latestVersion("storybook"), nextVersion = await packageManager.latestVersion("storybook@next") ?? "0.0.0", currentVersion = versions4.storybook, isPrerelease = (0, import_semver6.prerelease)(currentVersion), isOutdated = (0, import_semver6.lt)(currentVersion, isPrerelease ? nextVersion : latestVersion), downloadType = !isOutdated && init ? "after-storybook" : "before-storybook", branch = isPrerelease ? "next" : "main", messages2 = {
|
|
8881
8955
|
welcome: `Creating a Storybook ${import_picocolors14.default.bold(currentVersion)} sandbox..`,
|
|
8882
8956
|
notLatest: import_picocolors14.default.red(dedent14`
|
|
8883
8957
|
This version is behind the latest release, which is: ${import_picocolors14.default.bold(latestVersion)}!
|
|
@@ -9131,7 +9205,7 @@ async function promptForAutomigrations(automigrations, options) {
|
|
|
9131
9205
|
return automigrations.filter((am) => selectedIds.includes(am.fix.id));
|
|
9132
9206
|
}
|
|
9133
9207
|
async function runAutomigrationsForProjects(selectedAutomigrations, options) {
|
|
9134
|
-
let { dryRun, skipInstall, automigrations } = options, projectResults = {}, applicableAutomigrations = selectedAutomigrations.filter(
|
|
9208
|
+
let { dryRun, skipInstall, automigrations, yes } = options, projectResults = {}, applicableAutomigrations = selectedAutomigrations.filter(
|
|
9135
9209
|
(am) => am.reports.every((rep) => rep.status !== "not_applicable")
|
|
9136
9210
|
), projectAutomigrationResults = /* @__PURE__ */ new Map();
|
|
9137
9211
|
for (let automigration of automigrations)
|
|
@@ -9195,7 +9269,8 @@ async function runAutomigrationsForProjects(selectedAutomigrations, options) {
|
|
|
9195
9269
|
configDir: project2.configDir,
|
|
9196
9270
|
skipInstall,
|
|
9197
9271
|
storybookVersion: project2.storybookVersion,
|
|
9198
|
-
storiesPaths: project2.storiesPaths
|
|
9272
|
+
storiesPaths: project2.storiesPaths,
|
|
9273
|
+
yes
|
|
9199
9274
|
};
|
|
9200
9275
|
await fix.run(runOptions), fixResults[fix.id] = "succeeded" /* SUCCEEDED */, taskLog.message(CLI_COLORS3.success(`${logger20.SYMBOLS.success} ${fix.id}`));
|
|
9201
9276
|
}
|
|
@@ -9496,7 +9571,7 @@ Upgrade interrupted by user.`), allProjects.length > 1 && await sendMultiUpgrade
|
|
|
9496
9571
|
}
|
|
9497
9572
|
|
|
9498
9573
|
// src/bin/run.ts
|
|
9499
|
-
addToGlobalContext("cliVersion",
|
|
9574
|
+
addToGlobalContext("cliVersion", versions5.storybook);
|
|
9500
9575
|
var handleCommandFailure = (logFilePath) => async (error) => {
|
|
9501
9576
|
error instanceof HandledError2 || logger22.error(String(error));
|
|
9502
9577
|
try {
|
|
@@ -9570,7 +9645,7 @@ command("remove <addon>").description("Remove an addon from your Storybook").add
|
|
|
9570
9645
|
}), options.disableTelemetry || await telemetry2("remove", { addon: addonName, source: "cli" }), logger22.outro("Done!");
|
|
9571
9646
|
}).catch(handleCommandFailure(options.logfile))
|
|
9572
9647
|
);
|
|
9573
|
-
command("upgrade").description(`Upgrade your Storybook packages to v${
|
|
9648
|
+
command("upgrade").description(`Upgrade your Storybook packages to v${versions5.storybook}`).addOption(
|
|
9574
9649
|
new Option("--package-manager <type>", "Force package manager for installing deps").choices(
|
|
9575
9650
|
Object.values(PackageManagerName2)
|
|
9576
9651
|
)
|
|
@@ -9582,7 +9657,7 @@ command("upgrade").description(`Upgrade your Storybook packages to v${versions4.
|
|
|
9582
9657
|
"upgrade",
|
|
9583
9658
|
{ cliOptions: { ...options, configDir: options.configDir?.[0] } },
|
|
9584
9659
|
async () => {
|
|
9585
|
-
logger22.intro(`Storybook upgrade - v${
|
|
9660
|
+
logger22.intro(`Storybook upgrade - v${versions5.storybook}`), await upgrade(options), logger22.outro("Storybook upgrade completed!");
|
|
9586
9661
|
}
|
|
9587
9662
|
).catch(handleCommandFailure(options.logfile));
|
|
9588
9663
|
});
|
|
@@ -9629,7 +9704,7 @@ command("automigrate [fixId]").description("Check storybook for incompatibilitie
|
|
|
9629
9704
|
).option("-l --list", "List available migrations").option("-c, --config-dir <dir-name>", "Directory of Storybook configurations to migrate").option("-s --skip-install", "Skip installing deps").option(
|
|
9630
9705
|
"--renderer <renderer-pkg-name>",
|
|
9631
9706
|
"The renderer package for the framework Storybook is using."
|
|
9632
|
-
).option("--skip-doctor", "Skip doctor check").action(async (fixId, options) => {
|
|
9707
|
+
).option("--skip-doctor", "Skip doctor check").option("--glob <pattern>", "Glob pattern for story files (for csf-factories codemod)").action(async (fixId, options) => {
|
|
9633
9708
|
withTelemetry("automigrate", { cliOptions: options }, async () => {
|
|
9634
9709
|
logger22.intro(fixId ? `Running ${fixId} automigration` : "Running automigrations"), await doAutomigrate({ fixId, ...options }), logger22.outro("Done");
|
|
9635
9710
|
}).catch(handleCommandFailure(options.logfile));
|
package/dist/bin/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import CJS_COMPAT_NODE_URL_khnan0cjpze from 'node:url';
|
|
3
|
+
import CJS_COMPAT_NODE_PATH_khnan0cjpze from 'node:path';
|
|
4
|
+
import CJS_COMPAT_NODE_MODULE_khnan0cjpze from "node:module";
|
|
5
5
|
|
|
6
|
-
var __filename =
|
|
7
|
-
var __dirname =
|
|
8
|
-
var require =
|
|
6
|
+
var __filename = CJS_COMPAT_NODE_URL_khnan0cjpze.fileURLToPath(import.meta.url);
|
|
7
|
+
var __dirname = CJS_COMPAT_NODE_PATH_khnan0cjpze.dirname(__filename);
|
|
8
|
+
var require = CJS_COMPAT_NODE_MODULE_khnan0cjpze.createRequire(import.meta.url);
|
|
9
9
|
|
|
10
10
|
// ------------------------------------------------------------
|
|
11
11
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -19,4 +19,4 @@ var [majorNodeVersion, minorNodeVersion] = process.versions.node.split(".").map(
|
|
|
19
19
|
dedent`To run Storybook, you need Node.js version 20.19+ or 22.12+.
|
|
20
20
|
You are currently running Node.js ${process.version}. Please upgrade your Node.js installation.`
|
|
21
21
|
), process.exit(1));
|
|
22
|
-
import("../_node-chunks/run-
|
|
22
|
+
import("../_node-chunks/run-S4WVAXNN.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/cli",
|
|
3
|
-
"version": "10.3.0-alpha.
|
|
3
|
+
"version": "10.3.0-alpha.10",
|
|
4
4
|
"description": "Storybook CLI: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"!src/**/*"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@storybook/codemod": "10.3.0-alpha.
|
|
40
|
+
"@storybook/codemod": "10.3.0-alpha.10",
|
|
41
41
|
"@types/semver": "^7.7.1",
|
|
42
42
|
"commander": "^14.0.2",
|
|
43
|
-
"create-storybook": "10.3.0-alpha.
|
|
43
|
+
"create-storybook": "10.3.0-alpha.10",
|
|
44
44
|
"jscodeshift": "^0.15.1",
|
|
45
|
-
"storybook": "10.3.0-alpha.
|
|
45
|
+
"storybook": "10.3.0-alpha.10",
|
|
46
46
|
"ts-dedent": "^2.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_6bfhswp810v from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_6bfhswp810v from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_6bfhswp810v from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_6bfhswp810v.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_6bfhswp810v.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_6bfhswp810v.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|