@storybook/cli 10.6.0-alpha.7 → 10.6.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.
- package/dist/_node-chunks/{block-dependencies-versions-RS26YIGJ.js → block-dependencies-versions-K66NSFKX.js} +11 -11
- package/dist/_node-chunks/{block-experimental-addon-test-IAKOKCPP.js → block-experimental-addon-test-2KTDK5BD.js} +9 -9
- package/dist/_node-chunks/{block-major-version-CNWTEJ45.js → block-major-version-3KKM2NKD.js} +9 -9
- package/dist/_node-chunks/{block-node-version-4RXHQDKL.js → block-node-version-HHIOVV25.js} +9 -9
- package/dist/_node-chunks/{block-webpack5-frameworks-YVIFTSQ6.js → block-webpack5-frameworks-JCUIEQT7.js} +11 -11
- package/dist/_node-chunks/{chunk-N7YG2NBI.js → chunk-4WETXPOU.js} +7 -7
- package/dist/_node-chunks/chunk-7ZZ5GRHD.js +11 -0
- package/dist/_node-chunks/{chunk-6I65HBVD.js → chunk-EYFKT4JV.js} +22 -15
- package/dist/_node-chunks/{chunk-V37L2J36.js → chunk-K7G32RRY.js} +6 -6
- package/dist/_node-chunks/{chunk-YQTCVN7G.js → chunk-ROLSWKBR.js} +7 -7
- package/dist/_node-chunks/{globby-GUCLXM7R.js → globby-R2SW4D5V.js} +8 -8
- package/dist/_node-chunks/{p-limit-CS3WZCC5.js → p-limit-RWNGXLCY.js} +7 -7
- package/dist/_node-chunks/{run-JBWNAVC5.js → run-P4OYCN2K.js} +223 -87
- package/dist/bin/index.js +7 -7
- package/package.json +4 -4
- package/dist/_node-chunks/chunk-IGRDHNPH.js +0 -11
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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-EYFKT4JV.js";
|
|
15
|
+
import "./chunk-4WETXPOU.js";
|
|
16
|
+
import "./chunk-7ZZ5GRHD.js";
|
|
17
|
+
import "./chunk-ROLSWKBR.js";
|
|
18
|
+
import "./chunk-K7G32RRY.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_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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-7ZZ5GRHD.js";
|
|
13
13
|
import {
|
|
14
14
|
require_semver
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ROLSWKBR.js";
|
|
16
16
|
import {
|
|
17
17
|
__toESM
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-K7G32RRY.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-CNWTEJ45.js → block-major-version-3KKM2NKD.js}
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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-7ZZ5GRHD.js";
|
|
13
13
|
import {
|
|
14
14
|
require_semver
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ROLSWKBR.js";
|
|
16
16
|
import {
|
|
17
17
|
__toESM
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-K7G32RRY.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_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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-7ZZ5GRHD.js";
|
|
13
13
|
import {
|
|
14
14
|
require_semver
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ROLSWKBR.js";
|
|
16
16
|
import {
|
|
17
17
|
__toESM
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-K7G32RRY.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_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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-EYFKT4JV.js";
|
|
15
|
+
import "./chunk-4WETXPOU.js";
|
|
16
|
+
import "./chunk-7ZZ5GRHD.js";
|
|
17
|
+
import "./chunk-ROLSWKBR.js";
|
|
18
|
+
import "./chunk-K7G32RRY.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_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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-K7G32RRY.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_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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_koorielfsj.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
globby,
|
|
14
14
|
globbySync
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4WETXPOU.js";
|
|
16
16
|
import {
|
|
17
17
|
require_semver
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ROLSWKBR.js";
|
|
19
19
|
import {
|
|
20
20
|
__commonJS,
|
|
21
21
|
__toESM
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-K7G32RRY.js";
|
|
23
23
|
|
|
24
24
|
// ../../../node_modules/picocolors/picocolors.js
|
|
25
25
|
var require_picocolors = __commonJS({
|
|
@@ -126,11 +126,11 @@ var import_picocolors2 = __toESM(require_picocolors(), 1), import_semver = __toE
|
|
|
126
126
|
// src/autoblock/index.ts
|
|
127
127
|
var blockers = () => [
|
|
128
128
|
// add/remove blockers here
|
|
129
|
-
import("./block-dependencies-versions-
|
|
130
|
-
import("./block-node-version-
|
|
131
|
-
import("./block-webpack5-frameworks-
|
|
132
|
-
import("./block-major-version-
|
|
133
|
-
import("./block-experimental-addon-test-
|
|
129
|
+
import("./block-dependencies-versions-K66NSFKX.js"),
|
|
130
|
+
import("./block-node-version-HHIOVV25.js"),
|
|
131
|
+
import("./block-webpack5-frameworks-JCUIEQT7.js"),
|
|
132
|
+
import("./block-major-version-3KKM2NKD.js"),
|
|
133
|
+
import("./block-experimental-addon-test-2KTDK5BD.js")
|
|
134
134
|
], autoblock = async (options, list = blockers()) => list.length === 0 ? null : await Promise.all(
|
|
135
135
|
list.map(async (i) => {
|
|
136
136
|
let blocker = (await i).blocker;
|
|
@@ -152,6 +152,12 @@ import { getStorybookData } from "storybook/internal/cli";
|
|
|
152
152
|
var getFrameworkPackageName = (mainConfig) => {
|
|
153
153
|
let packageNameOrPath = typeof mainConfig?.framework == "string" ? mainConfig.framework : mainConfig?.framework?.name;
|
|
154
154
|
return packageNameOrPath ? extractFrameworkPackageName(packageNameOrPath) : null;
|
|
155
|
+
}, getRendererName = (mainConfig) => {
|
|
156
|
+
let frameworkPackageName = getFrameworkPackageName(mainConfig);
|
|
157
|
+
if (!frameworkPackageName)
|
|
158
|
+
return null;
|
|
159
|
+
let frameworkName = frameworkPackages[frameworkPackageName];
|
|
160
|
+
return frameworkToRenderer[frameworkName];
|
|
155
161
|
};
|
|
156
162
|
var updateMainConfig = async ({ mainConfigPath, dryRun }, callback) => {
|
|
157
163
|
try {
|
|
@@ -296,7 +302,7 @@ var processProject = async ({
|
|
|
296
302
|
};
|
|
297
303
|
}
|
|
298
304
|
}, collectProjects = async (options, configDirs, onProjectScanStart) => {
|
|
299
|
-
let { default: pLimit } = await import("./p-limit-
|
|
305
|
+
let { default: pLimit } = await import("./p-limit-RWNGXLCY.js"), currentCLIVersion = versions.storybook, limit = pLimit(5), projectPromises = configDirs.map(
|
|
300
306
|
(configDir) => limit(
|
|
301
307
|
() => processProject({
|
|
302
308
|
configDir,
|
|
@@ -531,6 +537,7 @@ After addressing this, you can try running the upgrade command again. You can al
|
|
|
531
537
|
export {
|
|
532
538
|
require_picocolors,
|
|
533
539
|
getFrameworkPackageName,
|
|
540
|
+
getRendererName,
|
|
534
541
|
updateMainConfig,
|
|
535
542
|
containsESMUsage,
|
|
536
543
|
containsRequireUsage,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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-K7G32RRY.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_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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-4WETXPOU.js";
|
|
25
|
+
import "./chunk-K7G32RRY.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_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.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-K7G32RRY.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_huu6hwbvfyp from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
findFilesUp,
|
|
19
19
|
getFrameworkPackageName,
|
|
20
20
|
getProjects,
|
|
21
|
+
getRendererName,
|
|
21
22
|
getStorybookData,
|
|
22
23
|
hasRequireBanner,
|
|
23
24
|
processAutoblockerResults,
|
|
@@ -26,18 +27,18 @@ import {
|
|
|
26
27
|
up,
|
|
27
28
|
updateMainConfig,
|
|
28
29
|
upgradeStorybookDependencies
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-EYFKT4JV.js";
|
|
30
31
|
import {
|
|
31
32
|
slash
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-4WETXPOU.js";
|
|
33
34
|
import {
|
|
34
35
|
require_semver
|
|
35
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-ROLSWKBR.js";
|
|
36
37
|
import {
|
|
37
38
|
__commonJS,
|
|
38
39
|
__require,
|
|
39
40
|
__toESM
|
|
40
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-K7G32RRY.js";
|
|
41
42
|
|
|
42
43
|
// ../../../node_modules/envinfo/dist/envinfo.js
|
|
43
44
|
var require_envinfo = __commonJS({
|
|
@@ -4721,7 +4722,7 @@ import {
|
|
|
4721
4722
|
import { withTelemetry } from "storybook/internal/core-server";
|
|
4722
4723
|
import { CLI_COLORS as CLI_COLORS5, logTracker as logTracker4, logger as logger27 } from "storybook/internal/node-logger";
|
|
4723
4724
|
import { addToGlobalContext, telemetry as telemetry2 } from "storybook/internal/telemetry";
|
|
4724
|
-
import { Option, program } from "commander";
|
|
4725
|
+
import { InvalidArgumentError, Option, program } from "commander";
|
|
4725
4726
|
|
|
4726
4727
|
// ../../../node_modules/leven/index.js
|
|
4727
4728
|
var array = [], characterCodeCache = [];
|
|
@@ -4761,7 +4762,7 @@ function leven(first, second, options) {
|
|
|
4761
4762
|
var import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
4762
4763
|
|
|
4763
4764
|
// package.json
|
|
4764
|
-
var version = "10.6.0-alpha.
|
|
4765
|
+
var version = "10.6.0-alpha.8";
|
|
4765
4766
|
|
|
4766
4767
|
// src/add.ts
|
|
4767
4768
|
var import_semver = __toESM(require_semver(), 1);
|
|
@@ -5597,7 +5598,7 @@ import { logger as logger3 } from "storybook/internal/node-logger";
|
|
|
5597
5598
|
import { promises as fs } from "fs";
|
|
5598
5599
|
var maxConcurrentTasks = Math.max(1, os.cpus().length - 1);
|
|
5599
5600
|
async function runCodemod(globPattern = "**/*.{stories,story}.{js,jsx,ts,tsx,mjs,mjsx,mts,mtsx}", transform, { dryRun = !1, skipFormatting = !1 } = {}) {
|
|
5600
|
-
let modifiedCount = 0, unmodifiedCount = 0, errorCount = 0, { globby } = await import("./globby-
|
|
5601
|
+
let modifiedCount = 0, unmodifiedCount = 0, errorCount = 0, { globby } = await import("./globby-R2SW4D5V.js"), files = await globby(slash(globPattern), {
|
|
5601
5602
|
followSymbolicLinks: !0,
|
|
5602
5603
|
ignore: ["**/node_modules/**", "**/dist/**", "**/storybook-static/**", "**/build/**"]
|
|
5603
5604
|
});
|
|
@@ -5608,7 +5609,7 @@ Please try a different pattern.
|
|
|
5608
5609
|
`
|
|
5609
5610
|
), new Error("No files matched");
|
|
5610
5611
|
try {
|
|
5611
|
-
let pLimit = (await import("./p-limit-
|
|
5612
|
+
let pLimit = (await import("./p-limit-RWNGXLCY.js")).default, limit = pLimit(maxConcurrentTasks);
|
|
5612
5613
|
await Promise.all(
|
|
5613
5614
|
files.map(
|
|
5614
5615
|
(file) => limit(async () => {
|
|
@@ -6304,7 +6305,8 @@ import {
|
|
|
6304
6305
|
ANALOG_VITE_PLUGIN_ANGULAR_VERSION,
|
|
6305
6306
|
AngularJSON,
|
|
6306
6307
|
editJsonText as editJsonText2,
|
|
6307
|
-
isStorybookTarget as isStorybookTarget2
|
|
6308
|
+
isStorybookTarget as isStorybookTarget2,
|
|
6309
|
+
toDevkitVersion
|
|
6308
6310
|
} from "storybook/internal/cli";
|
|
6309
6311
|
import { formatFileContent as formatFileContent5, getProjectRoot as getProjectRoot2, transformImportFiles } from "storybook/internal/common";
|
|
6310
6312
|
import { formatConfig as formatConfig3, readConfig as readConfig3 } from "storybook/internal/csf-tools";
|
|
@@ -6628,7 +6630,7 @@ var asObject = (value) => typeof value == "object" && value !== null && !Array.i
|
|
|
6628
6630
|
let targets = asObject(root?.targets);
|
|
6629
6631
|
return targets && groups.push({ pathPrefix: ["targets"], targets }), groups;
|
|
6630
6632
|
}, findWorkspaceFiles = async (basename5) => {
|
|
6631
|
-
let { globby } = await import("./globby-
|
|
6633
|
+
let { globby } = await import("./globby-R2SW4D5V.js");
|
|
6632
6634
|
return globby([`**/${basename5}`], {
|
|
6633
6635
|
cwd: getProjectRoot(),
|
|
6634
6636
|
ignore: ["**/node_modules/**", "**/dist/**", "**/storybook-static/**"],
|
|
@@ -6868,7 +6870,10 @@ var COMPODOC_PACKAGE = "@compodoc/compodoc", SET_COMPODOC_JSON = "setCompodocJso
|
|
|
6868
6870
|
};
|
|
6869
6871
|
|
|
6870
6872
|
// src/automigrate/fixes/angular-to-angular-vite.ts
|
|
6871
|
-
var ANGULAR_PACKAGE = "@storybook/angular", ANGULAR_VITE_PACKAGE2 = "@storybook/angular-vite", ANALOG_VITE_PLUGIN_PACKAGE = "@analogjs/vite-plugin-angular", FRAMEWORK_DOC_URL = "https://storybook.js.org/docs/get-started/frameworks/angular-vite", VITE_CONFIG_DOC_URL = "https://storybook.js.org/docs/builders/vite#configure",
|
|
6873
|
+
var ANGULAR_PACKAGE = "@storybook/angular", ANALOG_PACKAGE = "@analogjs/storybook-angular", ANGULAR_VITE_PACKAGE2 = "@storybook/angular-vite", ANALOG_VITE_PLUGIN_PACKAGE = "@analogjs/vite-plugin-angular", ANGULAR_BUILD_PACKAGE = "@angular/build", ANGULAR_ANIMATIONS_PACKAGE = "@angular/animations", ANGULAR_DEVKIT_ARCHITECT_PACKAGE = "@angular-devkit/architect", MIGRATABLE_FRAMEWORKS = [ANGULAR_PACKAGE, ANALOG_PACKAGE], FRAMEWORK_DOC_URL = "https://storybook.js.org/docs/get-started/frameworks/angular-vite", VITE_CONFIG_DOC_URL = "https://storybook.js.org/docs/builders/vite#configure", ANGULAR_MIN_MAJOR = 21, rewriteBuilderRefs = (content) => MIGRATABLE_FRAMEWORKS.reduce(
|
|
6874
|
+
(acc, framework) => acc.replaceAll(`${framework}:start-storybook`, `${ANGULAR_VITE_PACKAGE2}:start-storybook`).replaceAll(`${framework}:build-storybook`, `${ANGULAR_VITE_PACKAGE2}:build-storybook`),
|
|
6875
|
+
content
|
|
6876
|
+
), rewriteTestStorybookScript = (content) => content.replace(/("test-storybook"\s*:\s*)"(?:[^"\\]|\\.)*"/, '$1"vitest run"'), VITE_CONFIG_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".cts", ".mts", ".cjs", ".mjs"], findExistingViteConfig = (configDir) => {
|
|
6872
6877
|
let search = (basename5, extensions) => any(
|
|
6873
6878
|
extensions.map((ext) => basename5 + ext),
|
|
6874
6879
|
{ last: getProjectRoot2(), cwd: configDir }
|
|
@@ -6913,17 +6918,34 @@ export default defineConfig({
|
|
|
6913
6918
|
],
|
|
6914
6919
|
},
|
|
6915
6920
|
});
|
|
6916
|
-
`, transformMainConfig = async (mainConfigPath, dryRun) => {
|
|
6921
|
+
`, transformMainConfig = async (mainConfigPath, dryRun, framework) => {
|
|
6917
6922
|
try {
|
|
6918
6923
|
let content = await readFile(mainConfigPath, "utf-8");
|
|
6919
|
-
if (!content.includes(
|
|
6924
|
+
if (!content.includes(framework))
|
|
6920
6925
|
return !1;
|
|
6921
|
-
let transformed = content.replace(/@storybook\/angular(?!-vite)/g, ANGULAR_VITE_PACKAGE2);
|
|
6926
|
+
let transformed = framework === ANGULAR_PACKAGE ? content.replace(/@storybook\/angular(?!-vite)/g, ANGULAR_VITE_PACKAGE2) : content.replaceAll(framework, ANGULAR_VITE_PACKAGE2);
|
|
6922
6927
|
return transformed !== content && !dryRun && await writeFile2(mainConfigPath, transformed), transformed !== content;
|
|
6923
6928
|
} catch (error) {
|
|
6924
6929
|
return logger8.error(`Failed to update main config at ${mainConfigPath}: ${error}`), !1;
|
|
6925
6930
|
}
|
|
6926
|
-
}, rewriteStorybookBuilderRef = (ref) =>
|
|
6931
|
+
}, rewriteStorybookBuilderRef = (ref) => {
|
|
6932
|
+
for (let framework of MIGRATABLE_FRAMEWORKS) {
|
|
6933
|
+
if (ref === `${framework}:start-storybook`)
|
|
6934
|
+
return `${ANGULAR_VITE_PACKAGE2}:start-storybook`;
|
|
6935
|
+
if (ref === `${framework}:build-storybook`)
|
|
6936
|
+
return `${ANGULAR_VITE_PACKAGE2}:build-storybook`;
|
|
6937
|
+
}
|
|
6938
|
+
return null;
|
|
6939
|
+
}, isMigratableStorybookTarget = (target) => MIGRATABLE_FRAMEWORKS.some((framework) => isStorybookTarget2(target, framework)), matchMigratableFramework = (frameworkPackageName) => {
|
|
6940
|
+
if (!frameworkPackageName)
|
|
6941
|
+
return;
|
|
6942
|
+
let normalized = frameworkPackageName.replace(/\\/g, "/");
|
|
6943
|
+
return MIGRATABLE_FRAMEWORKS.find(
|
|
6944
|
+
(framework) => normalized === framework || // `@storybook/angular` must not match a path ending in `@storybook/angular-vite`, which the
|
|
6945
|
+
// leading slash guarantees.
|
|
6946
|
+
normalized.endsWith(`/${framework}`) || normalized.includes(`/.pnpm/${framework.replace("/", "+")}@`)
|
|
6947
|
+
);
|
|
6948
|
+
}, TextJsonEditor = class {
|
|
6927
6949
|
constructor(content) {
|
|
6928
6950
|
this.content = content;
|
|
6929
6951
|
}
|
|
@@ -6934,11 +6956,11 @@ export default defineConfig({
|
|
|
6934
6956
|
let changed = !1, hasStorybookTarget = !1, allZonelessTrue = !0;
|
|
6935
6957
|
for (let { pathPrefix, targets } of targetGroups)
|
|
6936
6958
|
for (let [targetName, target] of Object.entries(targets)) {
|
|
6937
|
-
if (!
|
|
6959
|
+
if (!isMigratableStorybookTarget(target) && !isStorybookTarget2(target, ANGULAR_VITE_PACKAGE2))
|
|
6938
6960
|
continue;
|
|
6939
6961
|
hasStorybookTarget = !0;
|
|
6940
6962
|
let currentRef = target.builder ?? target.executor ?? null, hasOldZonelessKey = !!target.options && "experimentalZoneless" in target.options, zonelessValue = target.options?.zoneless ?? target.options?.experimentalZoneless;
|
|
6941
|
-
if (zonelessValue !== !0 && (allZonelessTrue = !1), !
|
|
6963
|
+
if (zonelessValue !== !0 && (allZonelessTrue = !1), !isMigratableStorybookTarget(target))
|
|
6942
6964
|
continue;
|
|
6943
6965
|
let newRef = currentRef ? rewriteStorybookBuilderRef(currentRef) : null;
|
|
6944
6966
|
if (newRef) {
|
|
@@ -7001,20 +7023,31 @@ export default defineConfig({
|
|
|
7001
7023
|
`Could not add a \`zone.js\` import to ${previewConfigPath} automatically: ${error}. If your app uses zone-based change detection, add \`import 'zone.js';\` at the top of your preview.`
|
|
7002
7024
|
);
|
|
7003
7025
|
}
|
|
7026
|
+
}, getGuaranteedAngularMajor = (specifier) => {
|
|
7027
|
+
let range = specifier ? import_semver5.default.validRange(specifier) : null, major = range ? import_semver5.default.minVersion(range)?.major ?? null : null;
|
|
7028
|
+
return major === 0 ? null : major;
|
|
7004
7029
|
}, angularToAngularVite = {
|
|
7005
7030
|
id: "angular-to-angular-vite",
|
|
7006
7031
|
link: FRAMEWORK_DOC_URL,
|
|
7007
7032
|
defaultSelected: !1,
|
|
7008
7033
|
async check({ packageManager, mainConfig }) {
|
|
7009
7034
|
let allDeps = packageManager.getAllDependencies();
|
|
7010
|
-
if (
|
|
7035
|
+
if (allDeps[ANGULAR_VITE_PACKAGE2] || MIGRATABLE_FRAMEWORKS.every((pkg) => !allDeps[pkg]))
|
|
7011
7036
|
return null;
|
|
7012
|
-
let
|
|
7013
|
-
if (
|
|
7014
|
-
return
|
|
7015
|
-
`Skipped ${ANGULAR_VITE_PACKAGE2} migration: this project's Storybook framework is \`${frameworkPackageName ?? "not set"}\`, and only
|
|
7037
|
+
let angularSpecifier = await packageManager.getDeclaredVersionSpecifier("@angular/core"), frameworkPackageName = getFrameworkPackageName(mainConfig), framework = matchMigratableFramework(frameworkPackageName);
|
|
7038
|
+
if (!framework)
|
|
7039
|
+
return angularSpecifier && logger8.warn(
|
|
7040
|
+
`Skipped ${ANGULAR_VITE_PACKAGE2} migration: this project's Storybook framework is \`${frameworkPackageName ?? "not set"}\`, and only ${MIGRATABLE_FRAMEWORKS.map((pkg) => `\`${pkg}\``).join(" and ")} projects can be migrated automatically. See ${FRAMEWORK_DOC_URL} to switch frameworks by hand.`
|
|
7041
|
+
), null;
|
|
7042
|
+
let angularMajor = getGuaranteedAngularMajor(angularSpecifier);
|
|
7043
|
+
if (angularMajor !== null && angularMajor < ANGULAR_MIN_MAJOR)
|
|
7044
|
+
return logger8.warn(
|
|
7045
|
+
`Skipped ${ANGULAR_VITE_PACKAGE2} migration: it needs Angular ${ANGULAR_MIN_MAJOR}, and this project is on Angular ${angularMajor}. Run \`ng update @angular/core @angular/cli\` to upgrade, then run this migration again.`
|
|
7016
7046
|
), null;
|
|
7017
|
-
|
|
7047
|
+
angularMajor === null && logger8.warn(
|
|
7048
|
+
`Could not determine the \`@angular/core\` version, so the ${ANGULAR_VITE_PACKAGE2} migration cannot confirm this project is on Angular ${ANGULAR_MIN_MAJOR} or newer. Continuing anyway. If the migrated project fails to build, upgrade Angular first.`
|
|
7049
|
+
);
|
|
7050
|
+
let hasWebpackFinal = !1;
|
|
7018
7051
|
for (let pkgJsonPath of packageManager.packageJsonPaths) {
|
|
7019
7052
|
let dir = pkgJsonPath.replace(/[/\\]package\.json$/, "");
|
|
7020
7053
|
for (let mainName of [
|
|
@@ -7036,19 +7069,19 @@ export default defineConfig({
|
|
|
7036
7069
|
for (let pkgJsonPath of packageManager.packageJsonPaths)
|
|
7037
7070
|
try {
|
|
7038
7071
|
let raw = await readFile(pkgJsonPath, "utf-8"), pkg = JSON.parse(raw), deps = { ...pkg.dependencies ?? {}, ...pkg.devDependencies ?? {} };
|
|
7039
|
-
|
|
7072
|
+
MIGRATABLE_FRAMEWORKS.some((pkg2) => pkg2 in deps) && packageJsonFiles.push(pkgJsonPath);
|
|
7040
7073
|
} catch {
|
|
7041
7074
|
continue;
|
|
7042
7075
|
}
|
|
7043
7076
|
return {
|
|
7044
|
-
|
|
7045
|
-
angularVersion,
|
|
7077
|
+
framework,
|
|
7046
7078
|
hasWebpackFinal,
|
|
7047
|
-
packageJsonFiles
|
|
7079
|
+
packageJsonFiles,
|
|
7080
|
+
angularVersion: angularMajor === null ? null : angularSpecifier
|
|
7048
7081
|
};
|
|
7049
7082
|
},
|
|
7050
7083
|
prompt() {
|
|
7051
|
-
return "Migrate from @storybook/angular (Webpack) to @storybook/angular-vite (in preview).";
|
|
7084
|
+
return "Migrate from @storybook/angular (Webpack) or @analogjs/storybook-angular to @storybook/angular-vite (in preview).";
|
|
7052
7085
|
},
|
|
7053
7086
|
async run({
|
|
7054
7087
|
result,
|
|
@@ -7065,15 +7098,6 @@ export default defineConfig({
|
|
|
7065
7098
|
}) {
|
|
7066
7099
|
if (!result)
|
|
7067
7100
|
return;
|
|
7068
|
-
if (result.angularUnsupportedVersion) {
|
|
7069
|
-
logger8.log(
|
|
7070
|
-
dedent6`
|
|
7071
|
-
Migration skipped: Angular 21 is required.
|
|
7072
|
-
Run \`ng update @angular/core @angular/cli\` to upgrade, then try again.
|
|
7073
|
-
`
|
|
7074
|
-
);
|
|
7075
|
-
return;
|
|
7076
|
-
}
|
|
7077
7101
|
if (result.hasWebpackFinal && (logger8.logBox(
|
|
7078
7102
|
dedent6`
|
|
7079
7103
|
We detected a \`webpackFinal\` hook in your Storybook main config.
|
|
@@ -7091,11 +7115,11 @@ export default defineConfig({
|
|
|
7091
7115
|
);
|
|
7092
7116
|
return;
|
|
7093
7117
|
}
|
|
7094
|
-
if (logger8.step(`Migrating from ${
|
|
7118
|
+
if (logger8.step(`Migrating from ${result.framework} to ${ANGULAR_VITE_PACKAGE2}...`), logger8.debug("Updating main config..."), !mainConfigPath || !await transformMainConfig(mainConfigPath, dryRun, result.framework)) {
|
|
7095
7119
|
logger8.error(
|
|
7096
7120
|
dedent6`
|
|
7097
7121
|
Migration stopped: the \`framework\` field could not be rewritten in ${mainConfigPath ?? "your Storybook main config"}.
|
|
7098
|
-
That file names no \`${
|
|
7122
|
+
That file names no \`${result.framework}\`, so it most likely inherits the framework from a shared config.
|
|
7099
7123
|
Point \`framework\` at \`${ANGULAR_VITE_PACKAGE2}\` where it is declared, then run this migration again.
|
|
7100
7124
|
`
|
|
7101
7125
|
);
|
|
@@ -7104,11 +7128,22 @@ export default defineConfig({
|
|
|
7104
7128
|
if (dryRun)
|
|
7105
7129
|
logger8.debug("Dry run: Skipping dependency updates.");
|
|
7106
7130
|
else {
|
|
7107
|
-
logger8.debug("Updating dependencies..."), await packageManager.removeDependencies(
|
|
7108
|
-
|
|
7109
|
-
|
|
7131
|
+
logger8.debug("Updating dependencies..."), await packageManager.removeDependencies(
|
|
7132
|
+
result.framework === ANALOG_PACKAGE ? [ANALOG_PACKAGE, ANGULAR_PACKAGE] : [ANGULAR_PACKAGE]
|
|
7133
|
+
);
|
|
7134
|
+
let allDeps = packageManager.getAllDependencies(), { angularVersion } = result, architectVersion = toDevkitVersion(angularVersion), unpinnableAngularPeers = angularVersion ? [] : [
|
|
7135
|
+
ANGULAR_BUILD_PACKAGE,
|
|
7136
|
+
ANGULAR_ANIMATIONS_PACKAGE,
|
|
7137
|
+
ANGULAR_DEVKIT_ARCHITECT_PACKAGE
|
|
7138
|
+
].filter((pkg) => !allDeps[pkg]);
|
|
7139
|
+
unpinnableAngularPeers.length > 0 && logger8.warn(
|
|
7140
|
+
`Could not determine the \`@angular/core\` version, so ${unpinnableAngularPeers.map((pkg) => `\`${pkg}\``).join(", ")} were not added. ${ANGULAR_VITE_PACKAGE2} needs them at your Angular version, and adding them unpinned would install the next Angular major. Add them by hand before starting Storybook.`
|
|
7141
|
+
), await packageManager.addDependencies({ type: "devDependencies", skipInstall: !0 }, [
|
|
7110
7142
|
`${ANGULAR_VITE_PACKAGE2}@${storybookVersion}`,
|
|
7111
|
-
...allDeps[ANALOG_VITE_PLUGIN_PACKAGE] ? [] : [`${ANALOG_VITE_PLUGIN_PACKAGE}@${ANALOG_VITE_PLUGIN_ANGULAR_VERSION}`]
|
|
7143
|
+
...allDeps[ANALOG_VITE_PLUGIN_PACKAGE] ? [] : [`${ANALOG_VITE_PLUGIN_PACKAGE}@${ANALOG_VITE_PLUGIN_ANGULAR_VERSION}`],
|
|
7144
|
+
...allDeps[ANGULAR_BUILD_PACKAGE] || !angularVersion ? [] : [`${ANGULAR_BUILD_PACKAGE}@${angularVersion}`],
|
|
7145
|
+
...allDeps[ANGULAR_ANIMATIONS_PACKAGE] || !angularVersion ? [] : [`${ANGULAR_ANIMATIONS_PACKAGE}@${angularVersion}`],
|
|
7146
|
+
...allDeps[ANGULAR_DEVKIT_ARCHITECT_PACKAGE] || !architectVersion ? [] : [`${ANGULAR_DEVKIT_ARCHITECT_PACKAGE}@${architectVersion}`]
|
|
7112
7147
|
]);
|
|
7113
7148
|
}
|
|
7114
7149
|
let anyStorybookTarget = !1, allZonelessTrue = !0;
|
|
@@ -7137,7 +7172,7 @@ export default defineConfig({
|
|
|
7137
7172
|
mainConfig,
|
|
7138
7173
|
previewConfigPath,
|
|
7139
7174
|
packageManager,
|
|
7140
|
-
builderPackages: [ANGULAR_VITE_PACKAGE2,
|
|
7175
|
+
builderPackages: [ANGULAR_VITE_PACKAGE2, ...MIGRATABLE_FRAMEWORKS]
|
|
7141
7176
|
});
|
|
7142
7177
|
compodocSetup && await removeCompodocSetup({
|
|
7143
7178
|
result: compodocSetup,
|
|
@@ -7155,9 +7190,9 @@ export default defineConfig({
|
|
|
7155
7190
|
needsZoneJs && previewConfigPath ? await addZoneJsPreviewImport(previewConfigPath, dryRun) : needsZoneJs && !previewConfigPath && logger8.warn(
|
|
7156
7191
|
"Could not find a Storybook preview file to add the zone.js import to. If your app uses zone-based change detection, add `import 'zone.js';` at the top of your preview file manually."
|
|
7157
7192
|
), logger8.debug("Scanning and updating import statements...");
|
|
7158
|
-
let { globby } = await import("./globby-
|
|
7193
|
+
let { globby } = await import("./globby-R2SW4D5V.js"), configFiles = configDir ? await globby([`${configDir}/**/*`]) : [], allFiles = [...storiesPaths, ...configFiles].filter(Boolean), transformErrors = await transformImportFiles(
|
|
7159
7194
|
allFiles,
|
|
7160
|
-
|
|
7195
|
+
Object.fromEntries(MIGRATABLE_FRAMEWORKS.map((pkg) => [pkg, ANGULAR_VITE_PACKAGE2])),
|
|
7161
7196
|
!!dryRun
|
|
7162
7197
|
);
|
|
7163
7198
|
if (transformErrors.length > 0 && (logger8.warn(`Encountered ${transformErrors.length} error(s) during file transformation:`), transformErrors.forEach(({ file, error }) => {
|
|
@@ -7367,7 +7402,7 @@ var addonA11yParameters = {
|
|
|
7367
7402
|
errors.push({ file: previewFileToUpdate, error });
|
|
7368
7403
|
}
|
|
7369
7404
|
}
|
|
7370
|
-
let { default: pLimit } = await import("./p-limit-
|
|
7405
|
+
let { default: pLimit } = await import("./p-limit-RWNGXLCY.js"), limit = pLimit(10);
|
|
7371
7406
|
if (await Promise.all(
|
|
7372
7407
|
storyFilesToUpdate.map(
|
|
7373
7408
|
(file) => limit(async () => {
|
|
@@ -7521,7 +7556,7 @@ var addonGlobalsApi = {
|
|
|
7521
7556
|
}
|
|
7522
7557
|
};
|
|
7523
7558
|
async function transformStoryFiles(files, options, dryRun) {
|
|
7524
|
-
let errors = [], { default: pLimit } = await import("./p-limit-
|
|
7559
|
+
let errors = [], { default: pLimit } = await import("./p-limit-RWNGXLCY.js"), limit = pLimit(10);
|
|
7525
7560
|
return await Promise.all(
|
|
7526
7561
|
files.map(
|
|
7527
7562
|
(file) => limit(async () => {
|
|
@@ -7748,7 +7783,7 @@ function transformPackageJson(content) {
|
|
|
7748
7783
|
return hasChanges ? JSON.stringify(packageJson, null, 2) : null;
|
|
7749
7784
|
}
|
|
7750
7785
|
var transformPackageJsonFiles = async (files, dryRun) => {
|
|
7751
|
-
let errors = [], { default: pLimit } = await import("./p-limit-
|
|
7786
|
+
let errors = [], { default: pLimit } = await import("./p-limit-RWNGXLCY.js"), limit = pLimit(10);
|
|
7752
7787
|
return await Promise.all(
|
|
7753
7788
|
files.map(
|
|
7754
7789
|
(file) => limit(async () => {
|
|
@@ -7787,7 +7822,7 @@ var transformPackageJsonFiles = async (files, dryRun) => {
|
|
|
7787
7822
|
dryRun
|
|
7788
7823
|
);
|
|
7789
7824
|
errors.push(...packageJsonErrors);
|
|
7790
|
-
let { globby } = await import("./globby-
|
|
7825
|
+
let { globby } = await import("./globby-R2SW4D5V.js"), configFiles = await globby([`${configDir}/**/*`]), importErrors = await transformImportFiles2(
|
|
7791
7826
|
[...storiesPaths, ...configFiles].filter(Boolean),
|
|
7792
7827
|
{
|
|
7793
7828
|
...consolidatedPackages,
|
|
@@ -7860,6 +7895,71 @@ var eslintPlugin = {
|
|
|
7860
7895
|
}
|
|
7861
7896
|
};
|
|
7862
7897
|
|
|
7898
|
+
// src/automigrate/fixes/experimental-features.ts
|
|
7899
|
+
import { SupportedRenderer } from "storybook/internal/types";
|
|
7900
|
+
|
|
7901
|
+
// src/automigrate/helpers/versionBoundary.ts
|
|
7902
|
+
var import_semver6 = __toESM(require_semver(), 1), crossesVersionBoundary = (beforeVersion, targetVersion, introducedIn) => {
|
|
7903
|
+
let before = import_semver6.default.coerce(beforeVersion), target = import_semver6.default.coerce(targetVersion);
|
|
7904
|
+
return !before || !target ? !1 : import_semver6.default.lt(before, introducedIn) && import_semver6.default.gte(target, introducedIn);
|
|
7905
|
+
}, isAtOrPastVersion = (version2, introducedIn) => {
|
|
7906
|
+
let coerced = import_semver6.default.coerce(version2);
|
|
7907
|
+
return coerced !== null && import_semver6.default.gte(coerced, introducedIn);
|
|
7908
|
+
};
|
|
7909
|
+
|
|
7910
|
+
// src/automigrate/fixes/experimental-features.ts
|
|
7911
|
+
var hasDocgenProvider = (mainConfig) => getRendererName(mainConfig) === SupportedRenderer.REACT || ["@storybook/vue3-vite", "@storybook/angular-vite"].includes(
|
|
7912
|
+
getFrameworkPackageName(mainConfig) ?? ""
|
|
7913
|
+
), createExperimentalFeatureFix = ({
|
|
7914
|
+
id,
|
|
7915
|
+
name,
|
|
7916
|
+
introducedIn,
|
|
7917
|
+
link: link2,
|
|
7918
|
+
prompt: prompt9,
|
|
7919
|
+
requires,
|
|
7920
|
+
isSupported
|
|
7921
|
+
}) => ({
|
|
7922
|
+
id,
|
|
7923
|
+
link: link2,
|
|
7924
|
+
defaultSelected: !1,
|
|
7925
|
+
prompt: () => prompt9,
|
|
7926
|
+
async check({ mainConfigPath, mainConfig, beforeVersion, storybookVersion, requested }) {
|
|
7927
|
+
return !mainConfigPath || isSupported && !isSupported(mainConfig) || !isAtOrPastVersion(storybookVersion, introducedIn) || !requested && !(beforeVersion && crossesVersionBoundary(beforeVersion, storybookVersion, introducedIn)) || mainConfig.features?.[name] !== void 0 || requires && mainConfig.features?.[requires] === !1 ? null : {};
|
|
7928
|
+
},
|
|
7929
|
+
run: async ({ mainConfigPath, dryRun }) => {
|
|
7930
|
+
await updateMainConfig({ mainConfigPath, dryRun: !!dryRun }, async (main) => {
|
|
7931
|
+
main.setFieldValue(["features", name], !0);
|
|
7932
|
+
});
|
|
7933
|
+
}
|
|
7934
|
+
}), enableExperimentalReview = createExperimentalFeatureFix({
|
|
7935
|
+
id: "enable-experimental-review",
|
|
7936
|
+
name: "experimentalReview",
|
|
7937
|
+
introducedIn: "10.5.0",
|
|
7938
|
+
requires: "changeDetection",
|
|
7939
|
+
link: "https://storybook.js.org/docs/api/main-config/main-config-features#experimentalreview",
|
|
7940
|
+
prompt: "Enable experimentalReview to offer the agentic review workflow to all MCP clients, not just the storybook ai CLI."
|
|
7941
|
+
}), enableExperimentalDocgenServer = createExperimentalFeatureFix({
|
|
7942
|
+
id: "enable-experimental-docgen-server",
|
|
7943
|
+
name: "experimentalDocgenServer",
|
|
7944
|
+
introducedIn: "10.5.0",
|
|
7945
|
+
isSupported: hasDocgenProvider,
|
|
7946
|
+
link: "https://storybook.js.org/docs/api/main-config/main-config-features#experimentaldocgenserver",
|
|
7947
|
+
prompt: "Enable experimentalDocgenServer for faster startup and more accurate Controls/ArgTypes."
|
|
7948
|
+
}), FEATURE_FLAG_FIXES = {
|
|
7949
|
+
experimentalReview: enableExperimentalReview,
|
|
7950
|
+
experimentalDocgenServer: enableExperimentalDocgenServer
|
|
7951
|
+
}, resolveRequestedFeatures = (features) => {
|
|
7952
|
+
let names = features?.split(",").map((name) => name.trim()).filter(Boolean) ?? [], unknown = names.filter((name) => !Object.hasOwn(FEATURE_FLAG_FIXES, name));
|
|
7953
|
+
if (unknown.length > 0)
|
|
7954
|
+
throw new Error(
|
|
7955
|
+
`Unknown feature flag(s): ${unknown.join(", ")}. Available: ${Object.keys(FEATURE_FLAG_FIXES).join(", ")}.`
|
|
7956
|
+
);
|
|
7957
|
+
return names.map((name) => ({
|
|
7958
|
+
name,
|
|
7959
|
+
fixId: FEATURE_FLAG_FIXES[name].id
|
|
7960
|
+
}));
|
|
7961
|
+
};
|
|
7962
|
+
|
|
7863
7963
|
// src/automigrate/fixes/fix-faux-esm-require.ts
|
|
7864
7964
|
import { readFile as readFile5, writeFile as writeFile5 } from "node:fs/promises";
|
|
7865
7965
|
import { types as t10 } from "storybook/internal/babel";
|
|
@@ -8143,7 +8243,7 @@ var VITE_DEFAULT_VERSION = "^7.0.0", transformMainConfig2 = async (mainConfigPat
|
|
|
8143
8243
|
]);
|
|
8144
8244
|
}
|
|
8145
8245
|
mainConfigPath && (logger14.debug("Updating main config file..."), await transformMainConfig2(mainConfigPath, dryRun)), logger14.debug("Scanning and updating import statements...");
|
|
8146
|
-
let { globby } = await import("./globby-
|
|
8246
|
+
let { globby } = await import("./globby-R2SW4D5V.js"), configFiles = await globby([`${configDir}/**/*`]), allFiles = [...storiesPaths, ...configFiles].filter(Boolean), transformErrors = await transformImportFiles3(
|
|
8147
8247
|
allFiles,
|
|
8148
8248
|
{
|
|
8149
8249
|
"@storybook/nextjs": "@storybook/nextjs-vite"
|
|
@@ -8221,7 +8321,7 @@ var REACT_VITE_PACKAGE = "@storybook/react-vite", TANSTACK_REACT_PACKAGE = "@sto
|
|
|
8221
8321
|
configDir,
|
|
8222
8322
|
storiesPaths
|
|
8223
8323
|
}) => {
|
|
8224
|
-
let { globby } = await import("./globby-
|
|
8324
|
+
let { globby } = await import("./globby-R2SW4D5V.js"), configFiles = configDir ? await globby([`${configDir}/**/*.{ts,tsx,js,jsx,mjs,cjs}`], {
|
|
8225
8325
|
ignore: ["**/node_modules/**", "**/dist/**"]
|
|
8226
8326
|
}) : [], candidateFiles = Array.from(
|
|
8227
8327
|
/* @__PURE__ */ new Set([...previewConfigPath ? [previewConfigPath] : [], ...configFiles, ...storiesPaths])
|
|
@@ -8440,7 +8540,7 @@ var REACT_VITE_PACKAGE = "@storybook/react-vite", TANSTACK_REACT_PACKAGE = "@sto
|
|
|
8440
8540
|
logger15.step(`Migrating from ${REACT_VITE_PACKAGE} to ${TANSTACK_REACT_PACKAGE}...`), dryRun ? logger15.debug("Dry run: Skipping package.json updates.") : (logger15.debug("Updating package.json files..."), await packageManager.removeDependencies([REACT_VITE_PACKAGE]), await packageManager.addDependencies({ type: "devDependencies", skipInstall: !0 }, [
|
|
8441
8541
|
`${TANSTACK_REACT_PACKAGE}@${storybookVersion}`
|
|
8442
8542
|
])), mainConfigPath && (logger15.debug("Updating main config file..."), await transformMainConfig3(mainConfigPath, dryRun)), logger15.debug("Scanning and updating import statements...");
|
|
8443
|
-
let { globby } = await import("./globby-
|
|
8543
|
+
let { globby } = await import("./globby-R2SW4D5V.js"), configFiles = configDir ? await globby([`${configDir}/**/*.{ts,tsx,js,jsx,mjs,cjs}`], {
|
|
8444
8544
|
ignore: ["**/node_modules/**", "**/dist/**"]
|
|
8445
8545
|
}) : [], allFiles = [...storiesPaths, ...configFiles, previewConfigPath].filter(
|
|
8446
8546
|
Boolean
|
|
@@ -8681,7 +8781,7 @@ var getAllDependencies = (packageJson) => Object.keys({
|
|
|
8681
8781
|
let regex = new RegExp(`(['"])${renderer}(['"])`, "g");
|
|
8682
8782
|
return regex.test(source) ? source.replace(regex, `$1${framework}$2`) : null;
|
|
8683
8783
|
}, transformSourceFiles = async (files, renderer, framework, dryRun) => {
|
|
8684
|
-
let errors = [], { default: pLimit } = await import("./p-limit-
|
|
8784
|
+
let errors = [], { default: pLimit } = await import("./p-limit-RWNGXLCY.js"), limit = pLimit(10);
|
|
8685
8785
|
return await Promise.all(
|
|
8686
8786
|
files.map(
|
|
8687
8787
|
(file) => limit(async () => {
|
|
@@ -8748,7 +8848,7 @@ var getAllDependencies = (packageJson) => Object.keys({
|
|
|
8748
8848
|
continue;
|
|
8749
8849
|
logger17.debug(`
|
|
8750
8850
|
Migrating ${rendererPackage} to ${selectedFramework}`);
|
|
8751
|
-
let { globby } = await import("./globby-
|
|
8851
|
+
let { globby } = await import("./globby-R2SW4D5V.js"), configFiles = await globby([`${configDir}/**/*`]);
|
|
8752
8852
|
await transformSourceFiles(
|
|
8753
8853
|
[...storiesPaths, ...configFiles].filter(Boolean),
|
|
8754
8854
|
rendererPackage,
|
|
@@ -8854,7 +8954,7 @@ async function renameInFile(filePath, oldText, newText) {
|
|
|
8854
8954
|
}
|
|
8855
8955
|
var getDotStorybookReferences = async (searchDir) => {
|
|
8856
8956
|
try {
|
|
8857
|
-
let { globby } = await import("./globby-
|
|
8957
|
+
let { globby } = await import("./globby-R2SW4D5V.js"), { readFile: readFile12 } = await import("node:fs/promises"), files = await globby(`${searchDir}/**/*`, {
|
|
8858
8958
|
onlyFiles: !0,
|
|
8859
8959
|
gitignore: !0
|
|
8860
8960
|
}), referencedFiles = [];
|
|
@@ -8875,7 +8975,7 @@ var getDotStorybookReferences = async (searchDir) => {
|
|
|
8875
8975
|
async check({ packageManager, mainConfigPath }) {
|
|
8876
8976
|
if (!packageManager.getAllDependencies()["@storybook/react-native"])
|
|
8877
8977
|
return null;
|
|
8878
|
-
let projectDir = mainConfigPath ? join6(mainConfigPath, "..", "..") : process.cwd(), storybookDir = join6(projectDir, ".storybook"), rnStorybookDir = join6(projectDir, RN_STORYBOOK_DIR), { globby } = await import("./globby-
|
|
8978
|
+
let projectDir = mainConfigPath ? join6(mainConfigPath, "..", "..") : process.cwd(), storybookDir = join6(projectDir, ".storybook"), rnStorybookDir = join6(projectDir, RN_STORYBOOK_DIR), { globby } = await import("./globby-R2SW4D5V.js"), requiresFiles = await globby(join6(storybookDir, "storybook.requires.*"));
|
|
8879
8979
|
return existsSync5(storybookDir) && requiresFiles.length > 0 && !existsSync5(rnStorybookDir) ? { storybookDir, rnStorybookDir } : null;
|
|
8880
8980
|
},
|
|
8881
8981
|
prompt() {
|
|
@@ -8917,7 +9017,7 @@ var storybookPackageNameConflict = {
|
|
|
8917
9017
|
};
|
|
8918
9018
|
|
|
8919
9019
|
// src/automigrate/fixes/upgrade-storybook-related-dependencies.ts
|
|
8920
|
-
var
|
|
9020
|
+
var import_semver7 = __toESM(require_semver(), 1);
|
|
8921
9021
|
import { readFileSync as readFileSync5 } from "node:fs";
|
|
8922
9022
|
import { dirname as dirname4 } from "node:path";
|
|
8923
9023
|
import { isCorePackage, isSatelliteAddon } from "storybook/internal/common";
|
|
@@ -8952,7 +9052,7 @@ var upgradeStorybookRelatedDependencies = {
|
|
|
8952
9052
|
)
|
|
8953
9053
|
)
|
|
8954
9054
|
).map((packageName) => [packageName, allDependencies[packageName]]), upgradablePackages = (await getLatestVersions(packageManager, uniquePackages)).filter(
|
|
8955
|
-
({ afterVersion, beforeVersion, packageName }) => beforeVersion === null || afterVersion === null || allDependencies[packageName] === null ? !1 : (0,
|
|
9055
|
+
({ afterVersion, beforeVersion, packageName }) => beforeVersion === null || afterVersion === null || allDependencies[packageName] === null ? !1 : (0, import_semver7.gt)(afterVersion, beforeVersion)
|
|
8956
9056
|
);
|
|
8957
9057
|
return upgradablePackages.length > 0 ? { upgradable: upgradablePackages } : null;
|
|
8958
9058
|
},
|
|
@@ -9053,7 +9153,9 @@ var allFixes = [
|
|
|
9053
9153
|
removeDocsAutodocs,
|
|
9054
9154
|
wrapGetAbsolutePath,
|
|
9055
9155
|
fixFauxEsmRequire,
|
|
9056
|
-
storybookPackageNameConflict
|
|
9156
|
+
storybookPackageNameConflict,
|
|
9157
|
+
enableExperimentalReview,
|
|
9158
|
+
enableExperimentalDocgenServer
|
|
9057
9159
|
];
|
|
9058
9160
|
var commandFixes = [csfFactories];
|
|
9059
9161
|
|
|
@@ -9199,6 +9301,7 @@ var logAvailableMigrations = () => {
|
|
|
9199
9301
|
logger21.step("Checking possible migrations..");
|
|
9200
9302
|
let { fixResults, fixSummary, preCheckFailure, addonsToPostinstall } = await runFixes({
|
|
9201
9303
|
fixes,
|
|
9304
|
+
fixId,
|
|
9202
9305
|
packageManager,
|
|
9203
9306
|
rendererPackage,
|
|
9204
9307
|
skipInstall,
|
|
@@ -9220,6 +9323,7 @@ var logAvailableMigrations = () => {
|
|
|
9220
9323
|
};
|
|
9221
9324
|
async function runFixes({
|
|
9222
9325
|
fixes,
|
|
9326
|
+
fixId,
|
|
9223
9327
|
dryRun,
|
|
9224
9328
|
yes,
|
|
9225
9329
|
rendererPackage,
|
|
@@ -9246,7 +9350,8 @@ async function runFixes({
|
|
|
9246
9350
|
previewConfigPath,
|
|
9247
9351
|
mainConfigPath,
|
|
9248
9352
|
storiesPaths,
|
|
9249
|
-
hasCsfFactoryPreview
|
|
9353
|
+
hasCsfFactoryPreview,
|
|
9354
|
+
requested: fixId === f.id
|
|
9250
9355
|
}), logger21.debug(`End of ${import_picocolors16.default.cyan(f.id)} migration checks`);
|
|
9251
9356
|
} catch (error) {
|
|
9252
9357
|
logger21.warn(`\u26A0\uFE0F failed to check fix ${import_picocolors16.default.bold(f.id)}`), error instanceof Error && (logger21.error(`
|
|
@@ -9427,7 +9532,7 @@ import {
|
|
|
9427
9532
|
versions as versions4
|
|
9428
9533
|
} from "storybook/internal/common";
|
|
9429
9534
|
import { logger as logger24, prompt as prompt6 } from "storybook/internal/node-logger";
|
|
9430
|
-
var import_picocolors17 = __toESM(require_picocolors(), 1),
|
|
9535
|
+
var import_picocolors17 = __toESM(require_picocolors(), 1), import_semver8 = __toESM(require_semver(), 1);
|
|
9431
9536
|
import { dedent as dedent19 } from "ts-dedent";
|
|
9432
9537
|
|
|
9433
9538
|
// src/sandbox-templates.ts
|
|
@@ -9684,8 +9789,7 @@ var baseTemplates = {
|
|
|
9684
9789
|
},
|
|
9685
9790
|
modifications: {
|
|
9686
9791
|
useCsfFactory: !0,
|
|
9687
|
-
extraDevDependencies: ["prop-types", "@types/prop-types"
|
|
9688
|
-
editAddons: (addons) => [...addons, "@storybook/addon-mcp"],
|
|
9792
|
+
extraDevDependencies: ["prop-types", "@types/prop-types"],
|
|
9689
9793
|
mainConfig: {
|
|
9690
9794
|
features: {
|
|
9691
9795
|
developmentModeForBuild: !0,
|
|
@@ -10570,7 +10674,7 @@ var toChoices = (c) => ({ label: allTemplates[c].name, value: c }), sandbox = as
|
|
|
10570
10674
|
}) => {
|
|
10571
10675
|
let selectedConfig = allTemplates[filterValue], templateId = selectedConfig ? filterValue : null, packageManager = JsPackageManagerFactory.getPackageManager({
|
|
10572
10676
|
force: PackageManagerName.NPM
|
|
10573
|
-
}), latestVersion = await packageManager.latestVersion("storybook"), nextVersion = await packageManager.latestVersion("storybook@next") ?? "0.0.0", currentVersion = versions4.storybook, isPrerelease = (0,
|
|
10677
|
+
}), latestVersion = await packageManager.latestVersion("storybook"), nextVersion = await packageManager.latestVersion("storybook@next") ?? "0.0.0", currentVersion = versions4.storybook, isPrerelease = (0, import_semver8.prerelease)(currentVersion), isOutdated = (0, import_semver8.lt)(currentVersion, isPrerelease ? nextVersion : latestVersion), downloadType = !isOutdated && init ? "after-storybook" : "before-storybook", branch = isPrerelease ? "next" : "main", messages2 = {
|
|
10574
10678
|
welcome: `Creating a Storybook ${import_picocolors17.default.bold(currentVersion)} sandbox..`,
|
|
10575
10679
|
notLatest: import_picocolors17.default.red(dedent19`
|
|
10576
10680
|
This version is behind the latest release, which is: ${import_picocolors17.default.bold(latestVersion)}!
|
|
@@ -10701,7 +10805,7 @@ async function promptSelectedTemplate(choices) {
|
|
|
10701
10805
|
}
|
|
10702
10806
|
|
|
10703
10807
|
// src/upgrade.ts
|
|
10704
|
-
var import_cross_spawn3 = __toESM(require_cross_spawn(), 1), import_picocolors18 = __toESM(require_picocolors(), 1),
|
|
10808
|
+
var import_cross_spawn3 = __toESM(require_cross_spawn(), 1), import_picocolors18 = __toESM(require_picocolors(), 1), import_semver9 = __toESM(require_semver(), 1);
|
|
10705
10809
|
import { PackageManagerName as PackageManagerName2 } from "storybook/internal/common";
|
|
10706
10810
|
import {
|
|
10707
10811
|
HandledError,
|
|
@@ -10728,7 +10832,7 @@ import { dedent as dedent20 } from "ts-dedent";
|
|
|
10728
10832
|
import { CLI_COLORS as CLI_COLORS3, logger as logger25, prompt as prompt7 } from "storybook/internal/node-logger";
|
|
10729
10833
|
import { ErrorCollector, sanitizeError } from "storybook/internal/telemetry";
|
|
10730
10834
|
async function collectAutomigrationsAcrossProjects(options) {
|
|
10731
|
-
let { fixes, projects, taskLog } = options, automigrationMap = /* @__PURE__ */ new Map();
|
|
10835
|
+
let { fixes, projects, taskLog, requestedFixIds } = options, automigrationMap = /* @__PURE__ */ new Map();
|
|
10732
10836
|
logger25.debug(
|
|
10733
10837
|
`Starting automigration collection across ${projects.length} projects and ${fixes.length} fixes...`
|
|
10734
10838
|
);
|
|
@@ -10760,6 +10864,8 @@ async function collectAutomigrationsAcrossProjects(options) {
|
|
|
10760
10864
|
configDir: project.configDir,
|
|
10761
10865
|
mainConfig: project.mainConfig,
|
|
10762
10866
|
storybookVersion: project.storybookVersion,
|
|
10867
|
+
beforeVersion: project.beforeVersion,
|
|
10868
|
+
requested: requestedFixIds?.includes(fix.id),
|
|
10763
10869
|
previewConfigPath: project.previewConfigPath,
|
|
10764
10870
|
mainConfigPath: project.mainConfigPath,
|
|
10765
10871
|
storiesPaths: project.storiesPaths,
|
|
@@ -10802,14 +10908,19 @@ var formatProjectDirs = (list) => {
|
|
|
10802
10908
|
async function promptForAutomigrations(automigrations, options) {
|
|
10803
10909
|
if (automigrations.length === 0)
|
|
10804
10910
|
return [];
|
|
10805
|
-
|
|
10806
|
-
|
|
10911
|
+
let logSelection = (title, selection) => {
|
|
10912
|
+
logger25.log(title), selection.forEach(({ fix, reports: list }) => {
|
|
10807
10913
|
logger25.log(` - ${fix.id} (${formatProjectDirs(list)})`);
|
|
10808
|
-
})
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10914
|
+
});
|
|
10915
|
+
}, preselectedIds = new Set(options.preselectedIds ?? []);
|
|
10916
|
+
if (options.dryRun)
|
|
10917
|
+
return logSelection("Detected automigrations (dry run - no changes will be made):", automigrations), [];
|
|
10918
|
+
if (options.yes) {
|
|
10919
|
+
let selected = automigrations.filter(
|
|
10920
|
+
({ fix }) => preselectedIds.has(fix.id) || fix.defaultSelected !== !1 || fix.promptType === "auto"
|
|
10921
|
+
);
|
|
10922
|
+
return logSelection("Running all detected automigrations:", selected), selected;
|
|
10923
|
+
}
|
|
10813
10924
|
let choices = automigrations.map((am) => {
|
|
10814
10925
|
let hint = [];
|
|
10815
10926
|
hint.push(`${am.fix.prompt()}`), am.fix.link && hint.push(`More info: ${am.fix.link}`);
|
|
@@ -10819,7 +10930,7 @@ async function promptForAutomigrations(automigrations, options) {
|
|
|
10819
10930
|
label,
|
|
10820
10931
|
hint: hint.join(`
|
|
10821
10932
|
`),
|
|
10822
|
-
defaultSelected: am.fix.defaultSelected ?? !0
|
|
10933
|
+
defaultSelected: preselectedIds.has(am.fix.id) || (am.fix.defaultSelected ?? !0)
|
|
10823
10934
|
};
|
|
10824
10935
|
}), selectedIds = await prompt7.multiselect({
|
|
10825
10936
|
message: "Select automigrations to run",
|
|
@@ -10922,7 +11033,7 @@ async function runAutomigrationsForProjects(selectedAutomigrations, options) {
|
|
|
10922
11033
|
return projectResults;
|
|
10923
11034
|
}
|
|
10924
11035
|
async function runAutomigrations(projects, options) {
|
|
10925
|
-
let projectAutomigrationData = projects.map((project) => ({
|
|
11036
|
+
let requestedFeatures = resolveRequestedFeatures(options.features), requestedFixIds = requestedFeatures.map(({ fixId }) => fixId), projectAutomigrationData = projects.map((project) => ({
|
|
10926
11037
|
configDir: project.configDir,
|
|
10927
11038
|
packageManager: project.packageManager,
|
|
10928
11039
|
mainConfig: project.mainConfig,
|
|
@@ -10941,12 +11052,21 @@ async function runAutomigrations(projects, options) {
|
|
|
10941
11052
|
dryRun: options.dryRun,
|
|
10942
11053
|
yes: options.yes,
|
|
10943
11054
|
skipInstall: options.skipInstall,
|
|
10944
|
-
taskLog: detectingAutomigrationTask
|
|
11055
|
+
taskLog: detectingAutomigrationTask,
|
|
11056
|
+
requestedFixIds
|
|
10945
11057
|
}), successfulAutomigrations = detectedAutomigrations.filter(
|
|
10946
11058
|
(am) => am.reports.some((report) => report.status === "check_succeeded")
|
|
10947
|
-
)
|
|
11059
|
+
);
|
|
11060
|
+
requestedFeatures.filter(({ fixId }) => !successfulAutomigrations.some((am) => am.fix.id === fixId)).forEach(({ name, fixId }) => {
|
|
11061
|
+
let checkFailed = detectedAutomigrations.find((am) => am.fix.id === fixId)?.reports.some((report) => report.status === "check_failed");
|
|
11062
|
+
logger25.warn(
|
|
11063
|
+
checkFailed ? `Skipping --features ${name}: the '${fixId}' migration check failed. Run with --debug for details.` : `Skipping --features ${name}: the '${fixId}' migration does not apply here. ${name} is either already set in your main config, unsupported by your Storybook version, or missing a prerequisite.`
|
|
11064
|
+
);
|
|
11065
|
+
});
|
|
11066
|
+
let selectedAutomigrations = await promptForAutomigrations(successfulAutomigrations, {
|
|
10948
11067
|
dryRun: options.dryRun,
|
|
10949
|
-
yes: options.yes
|
|
11068
|
+
yes: options.yes,
|
|
11069
|
+
preselectedIds: requestedFixIds
|
|
10950
11070
|
}), automigrationResults = await runAutomigrationsForProjects(selectedAutomigrations, {
|
|
10951
11071
|
automigrations: detectedAutomigrations,
|
|
10952
11072
|
dryRun: options.dryRun,
|
|
@@ -11086,6 +11206,10 @@ async function sendMultiUpgradeTelemetry(options) {
|
|
|
11086
11206
|
}
|
|
11087
11207
|
}
|
|
11088
11208
|
async function upgrade(options) {
|
|
11209
|
+
if (options.features && options.skipAutomigrations)
|
|
11210
|
+
throw logger26.error(
|
|
11211
|
+
"The --features flag enables feature flags through automigrations, so it cannot be combined with --skip-automigrations."
|
|
11212
|
+
), new HandledError("--features cannot be combined with --skip-automigrations");
|
|
11089
11213
|
let projectsResult = await getProjects(options);
|
|
11090
11214
|
if (projectsResult === void 0 || projectsResult.selectedProjects.length === 0)
|
|
11091
11215
|
return;
|
|
@@ -11113,7 +11237,7 @@ Upgrade interrupted by user.`), allProjects.length > 1 && await sendMultiUpgrade
|
|
|
11113
11237
|
}))
|
|
11114
11238
|
throw new HandledError("Blockers detected");
|
|
11115
11239
|
if (storybookProjects.some((project) => {
|
|
11116
|
-
if (!project.isCanary && (0,
|
|
11240
|
+
if (!project.isCanary && (0, import_semver9.lt)(project.currentCLIVersion, project.beforeVersion))
|
|
11117
11241
|
throw new UpgradeStorybookToLowerVersionError({
|
|
11118
11242
|
beforeVersion: project.beforeVersion,
|
|
11119
11243
|
currentVersion: project.currentCLIVersion
|
|
@@ -11308,7 +11432,19 @@ command("upgrade").description(`Upgrade your Storybook packages to v${versions5.
|
|
|
11308
11432
|
new Option("--package-manager <type>", "Force package manager for installing deps").choices(
|
|
11309
11433
|
Object.values(PackageManagerName3)
|
|
11310
11434
|
)
|
|
11311
|
-
).option("-y --yes", "Skip prompting the user").
|
|
11435
|
+
).option("-y --yes", "Skip prompting the user").addOption(
|
|
11436
|
+
new Option(
|
|
11437
|
+
"--features <list>",
|
|
11438
|
+
"Comma-separated list of experimental feature flags to enable during the upgrade"
|
|
11439
|
+
).argParser((value) => {
|
|
11440
|
+
try {
|
|
11441
|
+
resolveRequestedFeatures(value);
|
|
11442
|
+
} catch (error) {
|
|
11443
|
+
throw new InvalidArgumentError(error instanceof Error ? error.message : String(error));
|
|
11444
|
+
}
|
|
11445
|
+
return value;
|
|
11446
|
+
})
|
|
11447
|
+
).option("-f --force", "force the upgrade, skipping autoblockers").option("-n --dry-run", "Only check for upgrades, do not install").option("-s --skip-check", "Skip postinstall version and automigration checks").option(
|
|
11312
11448
|
"--skip-automigrations",
|
|
11313
11449
|
"Skip running automigrations entirely (only update package versions and install)"
|
|
11314
11450
|
).option(
|
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_huu6hwbvfyp from 'node:url';
|
|
3
|
+
import CJS_COMPAT_NODE_PATH_huu6hwbvfyp from 'node:path';
|
|
4
|
+
import CJS_COMPAT_NODE_MODULE_huu6hwbvfyp from "node:module";
|
|
5
5
|
|
|
6
|
-
var __filename =
|
|
7
|
-
var __dirname =
|
|
8
|
-
var require =
|
|
6
|
+
var __filename = CJS_COMPAT_NODE_URL_huu6hwbvfyp.fileURLToPath(import.meta.url);
|
|
7
|
+
var __dirname = CJS_COMPAT_NODE_PATH_huu6hwbvfyp.dirname(__filename);
|
|
8
|
+
var require = CJS_COMPAT_NODE_MODULE_huu6hwbvfyp.createRequire(import.meta.url);
|
|
9
9
|
|
|
10
10
|
// ------------------------------------------------------------
|
|
11
11
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -20,4 +20,4 @@ isNodeVersionSupported(major, minor, patch) || (logger.error(
|
|
|
20
20
|
dedent`To run Storybook, you need Node.js version ${MIN_SUPPORTED_NODE_DESCRIPTION}.
|
|
21
21
|
You are currently running Node.js ${process.version}. Please upgrade your Node.js installation.`
|
|
22
22
|
), process.exit(1));
|
|
23
|
-
import("../_node-chunks/run-
|
|
23
|
+
import("../_node-chunks/run-P4OYCN2K.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/cli",
|
|
3
|
-
"version": "10.6.0-alpha.
|
|
3
|
+
"version": "10.6.0-alpha.8",
|
|
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.6.0-alpha.
|
|
40
|
+
"@storybook/codemod": "10.6.0-alpha.8",
|
|
41
41
|
"@types/semver": "^7.7.1",
|
|
42
42
|
"commander": "^14.0.2",
|
|
43
|
-
"create-storybook": "10.6.0-alpha.
|
|
43
|
+
"create-storybook": "10.6.0-alpha.8",
|
|
44
44
|
"jscodeshift": "^0.15.1",
|
|
45
|
-
"storybook": "10.6.0-alpha.
|
|
45
|
+
"storybook": "10.6.0-alpha.8",
|
|
46
46
|
"ts-dedent": "^2.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_koorielfsj from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_koorielfsj from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_koorielfsj from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_koorielfsj.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_koorielfsj.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_koorielfsj.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|