@storybook/cli 10.6.0-alpha.4 → 10.6.0-alpha.6
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-HR673N7K.js → block-dependencies-versions-WHSHUKFD.js} +11 -11
- package/dist/_node-chunks/{block-experimental-addon-test-DCLDFZ2E.js → block-experimental-addon-test-6I45NX72.js} +9 -9
- package/dist/_node-chunks/{block-major-version-OEBLMJMX.js → block-major-version-OEZL5QKR.js} +9 -9
- package/dist/_node-chunks/{block-node-version-6IXSQXZM.js → block-node-version-465AJHJL.js} +9 -9
- package/dist/_node-chunks/{block-webpack5-frameworks-E266XTIE.js → block-webpack5-frameworks-TBV4TDOS.js} +11 -11
- package/dist/_node-chunks/{chunk-3GL2DDDZ.js → chunk-5QCPJBXS.js} +7 -7
- package/dist/_node-chunks/{chunk-AT3FGG3V.js → chunk-O2K4A7HW.js} +15 -15
- package/dist/_node-chunks/{chunk-NJBPJYOZ.js → chunk-PMA5P6A5.js} +6 -6
- package/dist/_node-chunks/chunk-VDIFOPOX.js +11 -0
- package/dist/_node-chunks/{chunk-ZNWTNECP.js → chunk-WR5KT47U.js} +7 -7
- package/dist/_node-chunks/{globby-NFMCQYRX.js → globby-XMBJJZHX.js} +8 -8
- package/dist/_node-chunks/{p-limit-FZKLGTY5.js → p-limit-LUFYD6QY.js} +7 -7
- package/dist/_node-chunks/{run-NJYOVFDC.js → run-KTTAY7TL.js} +448 -169
- package/dist/bin/index.js +7 -7
- package/package.json +4 -4
- package/dist/_node-chunks/chunk-G4RNUAI4.js +0 -11
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_pg8pmcd12k from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_pg8pmcd12k from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_pg8pmcd12k from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_pg8pmcd12k.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_pg8pmcd12k.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_pg8pmcd12k.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -26,18 +26,18 @@ import {
|
|
|
26
26
|
up,
|
|
27
27
|
updateMainConfig,
|
|
28
28
|
upgradeStorybookDependencies
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-O2K4A7HW.js";
|
|
30
30
|
import {
|
|
31
31
|
slash
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-WR5KT47U.js";
|
|
33
33
|
import {
|
|
34
34
|
require_semver
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-5QCPJBXS.js";
|
|
36
36
|
import {
|
|
37
37
|
__commonJS,
|
|
38
38
|
__require,
|
|
39
39
|
__toESM
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-PMA5P6A5.js";
|
|
41
41
|
|
|
42
42
|
// ../../../node_modules/envinfo/dist/envinfo.js
|
|
43
43
|
var require_envinfo = __commonJS({
|
|
@@ -4418,9 +4418,9 @@ var require_isexe = __commonJS({
|
|
|
4418
4418
|
if (typeof options == "function" && (cb = options, options = {}), !cb) {
|
|
4419
4419
|
if (typeof Promise != "function")
|
|
4420
4420
|
throw new TypeError("callback not provided");
|
|
4421
|
-
return new Promise(function(
|
|
4421
|
+
return new Promise(function(resolve4, reject) {
|
|
4422
4422
|
isexe(path4, options || {}, function(er, is) {
|
|
4423
|
-
er ? reject(er) :
|
|
4423
|
+
er ? reject(er) : resolve4(is);
|
|
4424
4424
|
});
|
|
4425
4425
|
});
|
|
4426
4426
|
}
|
|
@@ -4457,22 +4457,22 @@ var require_which = __commonJS({
|
|
|
4457
4457
|
};
|
|
4458
4458
|
}, which = (cmd, opt, cb) => {
|
|
4459
4459
|
typeof opt == "function" && (cb = opt, opt = {}), opt || (opt = {});
|
|
4460
|
-
let { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt), found = [], step = (i) => new Promise((
|
|
4460
|
+
let { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt), found = [], step = (i) => new Promise((resolve4, reject) => {
|
|
4461
4461
|
if (i === pathEnv.length)
|
|
4462
|
-
return opt.all && found.length ?
|
|
4462
|
+
return opt.all && found.length ? resolve4(found) : reject(getNotFoundError(cmd));
|
|
4463
4463
|
let ppRaw = pathEnv[i], pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw, pCmd = path4.join(pathPart, cmd), p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
4464
|
-
|
|
4465
|
-
}), subStep = (p, i, ii) => new Promise((
|
|
4464
|
+
resolve4(subStep(p, i, 0));
|
|
4465
|
+
}), subStep = (p, i, ii) => new Promise((resolve4, reject) => {
|
|
4466
4466
|
if (ii === pathExt.length)
|
|
4467
|
-
return
|
|
4467
|
+
return resolve4(step(i + 1));
|
|
4468
4468
|
let ext = pathExt[ii];
|
|
4469
4469
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
4470
4470
|
if (!er && is)
|
|
4471
4471
|
if (opt.all)
|
|
4472
4472
|
found.push(p + ext);
|
|
4473
4473
|
else
|
|
4474
|
-
return
|
|
4475
|
-
return
|
|
4474
|
+
return resolve4(p + ext);
|
|
4475
|
+
return resolve4(subStep(p, i, ii + 1));
|
|
4476
4476
|
});
|
|
4477
4477
|
});
|
|
4478
4478
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -4626,7 +4626,7 @@ var require_parse = __commonJS({
|
|
|
4626
4626
|
}
|
|
4627
4627
|
return parsed;
|
|
4628
4628
|
}
|
|
4629
|
-
function
|
|
4629
|
+
function parse3(command2, args, options) {
|
|
4630
4630
|
args && !Array.isArray(args) && (options = args, args = null), args = args ? args.slice(0) : [], options = Object.assign({}, options);
|
|
4631
4631
|
let parsed = {
|
|
4632
4632
|
command: command2,
|
|
@@ -4640,7 +4640,7 @@ var require_parse = __commonJS({
|
|
|
4640
4640
|
};
|
|
4641
4641
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
4642
4642
|
}
|
|
4643
|
-
module.exports =
|
|
4643
|
+
module.exports = parse3;
|
|
4644
4644
|
}
|
|
4645
4645
|
});
|
|
4646
4646
|
|
|
@@ -4690,19 +4690,19 @@ var require_enoent = __commonJS({
|
|
|
4690
4690
|
var require_cross_spawn = __commonJS({
|
|
4691
4691
|
"../../../node_modules/cross-spawn/index.js"(exports, module) {
|
|
4692
4692
|
"use strict";
|
|
4693
|
-
var cp = __require("child_process"),
|
|
4693
|
+
var cp = __require("child_process"), parse3 = require_parse(), enoent = require_enoent();
|
|
4694
4694
|
function spawn2(command2, args, options) {
|
|
4695
|
-
let parsed =
|
|
4695
|
+
let parsed = parse3(command2, args, options), spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
4696
4696
|
return enoent.hookChildProcess(spawned, parsed), spawned;
|
|
4697
4697
|
}
|
|
4698
4698
|
function spawnSync5(command2, args, options) {
|
|
4699
|
-
let parsed =
|
|
4699
|
+
let parsed = parse3(command2, args, options), result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
4700
4700
|
return result.error = result.error || enoent.verifyENOENTSync(result.status, parsed), result;
|
|
4701
4701
|
}
|
|
4702
4702
|
module.exports = spawn2;
|
|
4703
4703
|
module.exports.spawn = spawn2;
|
|
4704
4704
|
module.exports.sync = spawnSync5;
|
|
4705
|
-
module.exports._parse =
|
|
4705
|
+
module.exports._parse = parse3;
|
|
4706
4706
|
module.exports._enoent = enoent;
|
|
4707
4707
|
}
|
|
4708
4708
|
});
|
|
@@ -4761,7 +4761,7 @@ function leven(first, second, options) {
|
|
|
4761
4761
|
var import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
4762
4762
|
|
|
4763
4763
|
// package.json
|
|
4764
|
-
var version = "10.6.0-alpha.
|
|
4764
|
+
var version = "10.6.0-alpha.6";
|
|
4765
4765
|
|
|
4766
4766
|
// src/add.ts
|
|
4767
4767
|
var import_semver = __toESM(require_semver(), 1);
|
|
@@ -4905,87 +4905,6 @@ var hasOwnProperty = {}.hasOwnProperty;
|
|
|
4905
4905
|
var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace], own = {}.hasOwnProperty;
|
|
4906
4906
|
var isWindows = process.platform === "win32", globalCache = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
|
|
4907
4907
|
|
|
4908
|
-
// ../../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
|
4909
|
-
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
4910
|
-
function normalizeWindowsPath(input = "") {
|
|
4911
|
-
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
4912
|
-
}
|
|
4913
|
-
var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
4914
|
-
var normalize = function(path4) {
|
|
4915
|
-
if (path4.length === 0)
|
|
4916
|
-
return ".";
|
|
4917
|
-
path4 = normalizeWindowsPath(path4);
|
|
4918
|
-
let isUNCPath = path4.match(_UNC_REGEX), isPathAbsolute = isAbsolute(path4), trailingSeparator = path4[path4.length - 1] === "/";
|
|
4919
|
-
return path4 = normalizeString(path4, !isPathAbsolute), path4.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path4 += "/"), _DRIVE_LETTER_RE.test(path4) && (path4 += "/"), isUNCPath ? isPathAbsolute ? `//${path4}` : `//./${path4}` : isPathAbsolute && !isAbsolute(path4) ? `/${path4}` : path4);
|
|
4920
|
-
}, join = function(...arguments_) {
|
|
4921
|
-
if (arguments_.length === 0)
|
|
4922
|
-
return ".";
|
|
4923
|
-
let joined;
|
|
4924
|
-
for (let argument of arguments_)
|
|
4925
|
-
argument && argument.length > 0 && (joined === void 0 ? joined = argument : joined += `/${argument}`);
|
|
4926
|
-
return joined === void 0 ? "." : normalize(joined.replace(/\/\/+/g, "/"));
|
|
4927
|
-
};
|
|
4928
|
-
function cwd() {
|
|
4929
|
-
return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
|
|
4930
|
-
}
|
|
4931
|
-
var resolve = function(...arguments_) {
|
|
4932
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
4933
|
-
let resolvedPath = "", resolvedAbsolute = !1;
|
|
4934
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
4935
|
-
let path4 = index >= 0 ? arguments_[index] : cwd();
|
|
4936
|
-
!path4 || path4.length === 0 || (resolvedPath = `${path4}/${resolvedPath}`, resolvedAbsolute = isAbsolute(path4));
|
|
4937
|
-
}
|
|
4938
|
-
return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
|
|
4939
|
-
};
|
|
4940
|
-
function normalizeString(path4, allowAboveRoot) {
|
|
4941
|
-
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
|
|
4942
|
-
for (let index = 0; index <= path4.length; ++index) {
|
|
4943
|
-
if (index < path4.length)
|
|
4944
|
-
char = path4[index];
|
|
4945
|
-
else {
|
|
4946
|
-
if (char === "/")
|
|
4947
|
-
break;
|
|
4948
|
-
char = "/";
|
|
4949
|
-
}
|
|
4950
|
-
if (char === "/") {
|
|
4951
|
-
if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
|
|
4952
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
4953
|
-
if (res.length > 2) {
|
|
4954
|
-
let lastSlashIndex = res.lastIndexOf("/");
|
|
4955
|
-
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
|
|
4956
|
-
continue;
|
|
4957
|
-
} else if (res.length > 0) {
|
|
4958
|
-
res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
|
|
4959
|
-
continue;
|
|
4960
|
-
}
|
|
4961
|
-
}
|
|
4962
|
-
allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
|
|
4963
|
-
} else
|
|
4964
|
-
res.length > 0 ? res += `/${path4.slice(lastSlash + 1, index)}` : res = path4.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
|
|
4965
|
-
lastSlash = index, dots = 0;
|
|
4966
|
-
} else char === "." && dots !== -1 ? ++dots : dots = -1;
|
|
4967
|
-
}
|
|
4968
|
-
return res;
|
|
4969
|
-
}
|
|
4970
|
-
var isAbsolute = function(p) {
|
|
4971
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
4972
|
-
};
|
|
4973
|
-
var relative = function(from, to) {
|
|
4974
|
-
let _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
4975
|
-
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
|
|
4976
|
-
return _to.join("/");
|
|
4977
|
-
let _fromCopy = [..._from];
|
|
4978
|
-
for (let segment of _fromCopy) {
|
|
4979
|
-
if (_to[0] !== segment)
|
|
4980
|
-
break;
|
|
4981
|
-
_from.shift(), _to.shift();
|
|
4982
|
-
}
|
|
4983
|
-
return [..._from.map(() => ".."), ..._to].join("/");
|
|
4984
|
-
}, dirname = function(p) {
|
|
4985
|
-
let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
4986
|
-
return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
4987
|
-
};
|
|
4988
|
-
|
|
4989
4908
|
// ../../core/src/shared/utils/module.ts
|
|
4990
4909
|
var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
|
|
4991
4910
|
"importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
|
|
@@ -5678,7 +5597,7 @@ import { logger as logger3 } from "storybook/internal/node-logger";
|
|
|
5678
5597
|
import { promises as fs } from "fs";
|
|
5679
5598
|
var maxConcurrentTasks = Math.max(1, os.cpus().length - 1);
|
|
5680
5599
|
async function runCodemod(globPattern = "**/*.{stories,story}.{js,jsx,ts,tsx,mjs,mjsx,mts,mtsx}", transform, { dryRun = !1, skipFormatting = !1 } = {}) {
|
|
5681
|
-
let modifiedCount = 0, unmodifiedCount = 0, errorCount = 0, { globby } = await import("./globby-
|
|
5600
|
+
let modifiedCount = 0, unmodifiedCount = 0, errorCount = 0, { globby } = await import("./globby-XMBJJZHX.js"), files = await globby(slash(globPattern), {
|
|
5682
5601
|
followSymbolicLinks: !0,
|
|
5683
5602
|
ignore: ["**/node_modules/**", "**/dist/**", "**/storybook-static/**", "**/build/**"]
|
|
5684
5603
|
});
|
|
@@ -5689,7 +5608,7 @@ Please try a different pattern.
|
|
|
5689
5608
|
`
|
|
5690
5609
|
), new Error("No files matched");
|
|
5691
5610
|
try {
|
|
5692
|
-
let pLimit = (await import("./p-limit-
|
|
5611
|
+
let pLimit = (await import("./p-limit-LUFYD6QY.js")).default, limit = pLimit(maxConcurrentTasks);
|
|
5693
5612
|
await Promise.all(
|
|
5694
5613
|
files.map(
|
|
5695
5614
|
(file) => limit(async () => {
|
|
@@ -6400,12 +6319,302 @@ function any(names, options) {
|
|
|
6400
6319
|
if (tmp = join3(dir, names[j]), existsSync2(tmp)) return tmp;
|
|
6401
6320
|
}
|
|
6402
6321
|
|
|
6322
|
+
// ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
6323
|
+
var _lazyMatch = () => {
|
|
6324
|
+
var __lib__ = (() => {
|
|
6325
|
+
var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
|
|
6326
|
+
for (var n in e) m(r, n, { get: e[n], enumerable: !0 });
|
|
6327
|
+
}, H = (r, e, n, a) => {
|
|
6328
|
+
if (e && typeof e == "object" || typeof e == "function") for (let t11 of G(e)) !T.call(r, t11) && t11 !== n && m(r, t11, { get: () => e[t11], enumerable: !(a = V(e, t11)) || a.enumerable });
|
|
6329
|
+
return r;
|
|
6330
|
+
}, J = (r) => H(m({}, "__esModule", { value: !0 }), r), w = {};
|
|
6331
|
+
q(w, { default: () => re });
|
|
6332
|
+
var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
|
|
6333
|
+
let e = /* @__PURE__ */ new Map();
|
|
6334
|
+
return (n) => {
|
|
6335
|
+
let a = e.get(n);
|
|
6336
|
+
if (a) return a;
|
|
6337
|
+
let t11 = r(n);
|
|
6338
|
+
return e.set(n, t11), t11;
|
|
6339
|
+
};
|
|
6340
|
+
}, rr = (r, e, n = {}) => {
|
|
6341
|
+
let a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
|
|
6342
|
+
if (v(e)(a) && a.index === r.length) return a.output;
|
|
6343
|
+
throw new Error(`Failed to parse at index ${a.indexMax}`);
|
|
6344
|
+
}, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
|
|
6345
|
+
let n = {};
|
|
6346
|
+
for (let a of r) {
|
|
6347
|
+
if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
|
|
6348
|
+
let t11 = a.charCodeAt(0);
|
|
6349
|
+
n[t11] = !0;
|
|
6350
|
+
}
|
|
6351
|
+
return (a) => {
|
|
6352
|
+
let t11 = a.index, o = a.input;
|
|
6353
|
+
for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
|
|
6354
|
+
let u = a.index;
|
|
6355
|
+
if (u > t11) {
|
|
6356
|
+
if (!h(e) && !a.options.silent) {
|
|
6357
|
+
let s = a.input.slice(t11, u), c = d(e) ? e(s, o, String(t11)) : e;
|
|
6358
|
+
h(c) || a.output.push(c);
|
|
6359
|
+
}
|
|
6360
|
+
a.indexMax = Math.max(a.indexMax, a.index);
|
|
6361
|
+
}
|
|
6362
|
+
return !0;
|
|
6363
|
+
};
|
|
6364
|
+
}, nr = (r, e) => {
|
|
6365
|
+
let n = r.source, a = r.flags.replace(/y|$/, "y"), t11 = new RegExp(n, a);
|
|
6366
|
+
return g((o) => {
|
|
6367
|
+
t11.lastIndex = o.index;
|
|
6368
|
+
let u = t11.exec(o.input);
|
|
6369
|
+
if (u) {
|
|
6370
|
+
if (!h(e) && !o.options.silent) {
|
|
6371
|
+
let s = d(e) ? e(...u, o.input, String(o.index)) : e;
|
|
6372
|
+
h(s) || o.output.push(s);
|
|
6373
|
+
}
|
|
6374
|
+
return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), !0;
|
|
6375
|
+
} else return !1;
|
|
6376
|
+
});
|
|
6377
|
+
}, ar = (r, e) => (n) => {
|
|
6378
|
+
if (n.input.startsWith(r, n.index)) {
|
|
6379
|
+
if (!h(e) && !n.options.silent) {
|
|
6380
|
+
let t11 = d(e) ? e(r, n.input, String(n.index)) : e;
|
|
6381
|
+
h(t11) || n.output.push(t11);
|
|
6382
|
+
}
|
|
6383
|
+
return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), !0;
|
|
6384
|
+
} else return !1;
|
|
6385
|
+
}, C = (r, e, n, a) => {
|
|
6386
|
+
let t11 = v(r);
|
|
6387
|
+
return g(_(M((o) => {
|
|
6388
|
+
let u = 0;
|
|
6389
|
+
for (; u < n; ) {
|
|
6390
|
+
let s = o.index;
|
|
6391
|
+
if (!t11(o) || (u += 1, o.index === s)) break;
|
|
6392
|
+
}
|
|
6393
|
+
return u >= e;
|
|
6394
|
+
})));
|
|
6395
|
+
}, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
|
|
6396
|
+
let n = r.map(v);
|
|
6397
|
+
return g(_(M((a) => {
|
|
6398
|
+
for (let t11 = 0, o = n.length; t11 < o; t11++) if (!n[t11](a)) return !1;
|
|
6399
|
+
return !0;
|
|
6400
|
+
})));
|
|
6401
|
+
}, l = (r, e) => {
|
|
6402
|
+
let n = r.map(v);
|
|
6403
|
+
return g(_((a) => {
|
|
6404
|
+
for (let t11 = 0, o = n.length; t11 < o; t11++) if (n[t11](a)) return !0;
|
|
6405
|
+
return !1;
|
|
6406
|
+
}));
|
|
6407
|
+
}, M = (r, e = !1) => {
|
|
6408
|
+
let n = v(r);
|
|
6409
|
+
return (a) => {
|
|
6410
|
+
let t11 = a.index, o = a.output.length, u = n(a);
|
|
6411
|
+
return (!u || e) && (a.index = t11, a.output.length !== o && (a.output.length = o)), u;
|
|
6412
|
+
};
|
|
6413
|
+
}, _ = (r, e) => v(r), g = /* @__PURE__ */ (() => {
|
|
6414
|
+
let r = 0;
|
|
6415
|
+
return (e) => {
|
|
6416
|
+
let n = v(e), a = r += 1;
|
|
6417
|
+
return (t11) => {
|
|
6418
|
+
var o;
|
|
6419
|
+
if (t11.options.memoization === !1) return n(t11);
|
|
6420
|
+
let u = t11.index, s = (o = t11.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
|
|
6421
|
+
if (c === !1) return !1;
|
|
6422
|
+
if (W(c)) return t11.index = c, !0;
|
|
6423
|
+
if (c) return t11.index = c.index, c.output?.length && t11.output.push(...c.output), !0;
|
|
6424
|
+
{
|
|
6425
|
+
let Z = t11.output.length;
|
|
6426
|
+
if (n(t11)) {
|
|
6427
|
+
let D = t11.index, U = t11.output.length;
|
|
6428
|
+
if (U > Z) {
|
|
6429
|
+
let ee = t11.output.slice(Z, U);
|
|
6430
|
+
s.set(u, { index: D, output: ee });
|
|
6431
|
+
} else s.set(u, D);
|
|
6432
|
+
return !0;
|
|
6433
|
+
} else return s.set(u, !1), !1;
|
|
6434
|
+
}
|
|
6435
|
+
};
|
|
6436
|
+
};
|
|
6437
|
+
})(), E = (r) => {
|
|
6438
|
+
let e;
|
|
6439
|
+
return (n) => (e || (e = v(r())), e(n));
|
|
6440
|
+
}, v = Y((r) => {
|
|
6441
|
+
if (d(r)) return Q(r) ? E(r) : r;
|
|
6442
|
+
if (b(r) || X(r)) return i(r);
|
|
6443
|
+
if (A(r)) return x(r);
|
|
6444
|
+
if (K(r)) return l(Object.values(r));
|
|
6445
|
+
throw new Error("Invalid rule");
|
|
6446
|
+
}), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
|
|
6447
|
+
let e = "";
|
|
6448
|
+
for (; r > 0; ) {
|
|
6449
|
+
let n = (r - 1) % 26;
|
|
6450
|
+
e = P[n] + e, r = Math.floor((r - 1) / 26);
|
|
6451
|
+
}
|
|
6452
|
+
return e;
|
|
6453
|
+
}, O = (r) => {
|
|
6454
|
+
let e = 0;
|
|
6455
|
+
for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
|
|
6456
|
+
return e;
|
|
6457
|
+
}, S = (r, e) => {
|
|
6458
|
+
if (e < r) return S(e, r);
|
|
6459
|
+
let n = [];
|
|
6460
|
+
for (; r <= e; ) n.push(r++);
|
|
6461
|
+
return n;
|
|
6462
|
+
}, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: !1 }).join("")), ur = (r) => {
|
|
6463
|
+
let e = {};
|
|
6464
|
+
return (n) => e[n] ?? (e[n] = r(n));
|
|
6465
|
+
}, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([hr, dr]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([Sr, yr]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i("{", "(?:"), Or = i("}", ")"), Rr = i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Rr, zr, jr]), I = x([Pr, Nr, Or]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
|
|
6466
|
+
let n = Array.isArray(r) ? r : [r];
|
|
6467
|
+
if (!n.length) return !1;
|
|
6468
|
+
let a = n.map($.compile), t11 = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t11 ? "/" : "");
|
|
6469
|
+
return a.some((s) => s.test(o));
|
|
6470
|
+
};
|
|
6471
|
+
$.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
|
|
6472
|
+
var re = $;
|
|
6473
|
+
return J(w);
|
|
6474
|
+
})();
|
|
6475
|
+
return __lib__.default || __lib__;
|
|
6476
|
+
}, _match, zeptomatch = (path4, pattern) => (_match || (_match = _lazyMatch(), _lazyMatch = null), _match(path4, pattern)), _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
6477
|
+
function normalizeWindowsPath(input = "") {
|
|
6478
|
+
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
6479
|
+
}
|
|
6480
|
+
var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/, sep2 = "/", normalize2 = function(path4) {
|
|
6481
|
+
if (path4.length === 0)
|
|
6482
|
+
return ".";
|
|
6483
|
+
path4 = normalizeWindowsPath(path4);
|
|
6484
|
+
let isUNCPath = path4.match(_UNC_REGEX), isPathAbsolute = isAbsolute2(path4), trailingSeparator = path4[path4.length - 1] === "/";
|
|
6485
|
+
return path4 = normalizeString2(path4, !isPathAbsolute), path4.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path4 += "/"), _DRIVE_LETTER_RE.test(path4) && (path4 += "/"), isUNCPath ? isPathAbsolute ? `//${path4}` : `//./${path4}` : isPathAbsolute && !isAbsolute2(path4) ? `/${path4}` : path4);
|
|
6486
|
+
}, join4 = function(...segments) {
|
|
6487
|
+
let path4 = "";
|
|
6488
|
+
for (let seg of segments)
|
|
6489
|
+
if (seg)
|
|
6490
|
+
if (path4.length > 0) {
|
|
6491
|
+
let pathTrailing = path4[path4.length - 1] === "/", segLeading = seg[0] === "/";
|
|
6492
|
+
pathTrailing && segLeading ? path4 += seg.slice(1) : path4 += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
6493
|
+
} else
|
|
6494
|
+
path4 += seg;
|
|
6495
|
+
return normalize2(path4);
|
|
6496
|
+
};
|
|
6497
|
+
function cwd() {
|
|
6498
|
+
return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
|
|
6499
|
+
}
|
|
6500
|
+
var resolve2 = function(...arguments_) {
|
|
6501
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
6502
|
+
let resolvedPath = "", resolvedAbsolute = !1;
|
|
6503
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
6504
|
+
let path4 = index >= 0 ? arguments_[index] : cwd();
|
|
6505
|
+
!path4 || path4.length === 0 || (resolvedPath = `${path4}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path4));
|
|
6506
|
+
}
|
|
6507
|
+
return resolvedPath = normalizeString2(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
|
|
6508
|
+
};
|
|
6509
|
+
function normalizeString2(path4, allowAboveRoot) {
|
|
6510
|
+
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
|
|
6511
|
+
for (let index = 0; index <= path4.length; ++index) {
|
|
6512
|
+
if (index < path4.length)
|
|
6513
|
+
char = path4[index];
|
|
6514
|
+
else {
|
|
6515
|
+
if (char === "/")
|
|
6516
|
+
break;
|
|
6517
|
+
char = "/";
|
|
6518
|
+
}
|
|
6519
|
+
if (char === "/") {
|
|
6520
|
+
if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
|
|
6521
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
6522
|
+
if (res.length > 2) {
|
|
6523
|
+
let lastSlashIndex = res.lastIndexOf("/");
|
|
6524
|
+
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
|
|
6525
|
+
continue;
|
|
6526
|
+
} else if (res.length > 0) {
|
|
6527
|
+
res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
|
|
6528
|
+
continue;
|
|
6529
|
+
}
|
|
6530
|
+
}
|
|
6531
|
+
allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
|
|
6532
|
+
} else
|
|
6533
|
+
res.length > 0 ? res += `/${path4.slice(lastSlash + 1, index)}` : res = path4.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
|
|
6534
|
+
lastSlash = index, dots = 0;
|
|
6535
|
+
} else char === "." && dots !== -1 ? ++dots : dots = -1;
|
|
6536
|
+
}
|
|
6537
|
+
return res;
|
|
6538
|
+
}
|
|
6539
|
+
var isAbsolute2 = function(p) {
|
|
6540
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
6541
|
+
}, toNamespacedPath2 = function(p) {
|
|
6542
|
+
return normalizeWindowsPath(p);
|
|
6543
|
+
}, extname2 = function(p) {
|
|
6544
|
+
if (p === "..") return "";
|
|
6545
|
+
let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
6546
|
+
return match && match[1] || "";
|
|
6547
|
+
}, relative2 = function(from, to) {
|
|
6548
|
+
let _from = resolve2(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve2(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
6549
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
|
|
6550
|
+
return _to.join("/");
|
|
6551
|
+
let _fromCopy = [..._from];
|
|
6552
|
+
for (let segment of _fromCopy) {
|
|
6553
|
+
if (_to[0] !== segment)
|
|
6554
|
+
break;
|
|
6555
|
+
_from.shift(), _to.shift();
|
|
6556
|
+
}
|
|
6557
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
6558
|
+
}, dirname2 = function(p) {
|
|
6559
|
+
let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
6560
|
+
return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
|
|
6561
|
+
}, format3 = function(p) {
|
|
6562
|
+
let ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "", segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
|
|
6563
|
+
Boolean
|
|
6564
|
+
);
|
|
6565
|
+
return normalizeWindowsPath(
|
|
6566
|
+
p.root ? resolve2(...segments) : segments.join("/")
|
|
6567
|
+
);
|
|
6568
|
+
}, basename2 = function(p, extension) {
|
|
6569
|
+
let segments = normalizeWindowsPath(p).split("/"), lastSegment = "";
|
|
6570
|
+
for (let i = segments.length - 1; i >= 0; i--) {
|
|
6571
|
+
let val = segments[i];
|
|
6572
|
+
if (val) {
|
|
6573
|
+
lastSegment = val;
|
|
6574
|
+
break;
|
|
6575
|
+
}
|
|
6576
|
+
}
|
|
6577
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
6578
|
+
}, parse2 = function(p) {
|
|
6579
|
+
let root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "", base = basename2(p), extension = extname2(base);
|
|
6580
|
+
return {
|
|
6581
|
+
root,
|
|
6582
|
+
dir: dirname2(p),
|
|
6583
|
+
base,
|
|
6584
|
+
ext: extension,
|
|
6585
|
+
name: base.slice(0, base.length - extension.length)
|
|
6586
|
+
};
|
|
6587
|
+
}, matchesGlob = (path4, pattern) => zeptomatch(pattern, normalize2(path4)), _path = {
|
|
6588
|
+
__proto__: null,
|
|
6589
|
+
basename: basename2,
|
|
6590
|
+
dirname: dirname2,
|
|
6591
|
+
extname: extname2,
|
|
6592
|
+
format: format3,
|
|
6593
|
+
isAbsolute: isAbsolute2,
|
|
6594
|
+
join: join4,
|
|
6595
|
+
matchesGlob,
|
|
6596
|
+
normalize: normalize2,
|
|
6597
|
+
normalizeString: normalizeString2,
|
|
6598
|
+
parse: parse2,
|
|
6599
|
+
relative: relative2,
|
|
6600
|
+
resolve: resolve2,
|
|
6601
|
+
sep: sep2,
|
|
6602
|
+
toNamespacedPath: toNamespacedPath2
|
|
6603
|
+
};
|
|
6604
|
+
|
|
6605
|
+
// ../../../node_modules/pathe/dist/index.mjs
|
|
6606
|
+
var delimiter2 = globalThis.process?.platform === "win32" ? ";" : ":", _platforms = { posix: void 0, win32: void 0 }, mix = (del = delimiter2) => new Proxy(_path, {
|
|
6607
|
+
get(_, prop) {
|
|
6608
|
+
return prop === "delimiter" ? del : prop === "posix" ? posix : prop === "win32" ? win322 : _platforms[prop] || _path[prop];
|
|
6609
|
+
}
|
|
6610
|
+
}), posix = mix(":"), win322 = mix(";");
|
|
6611
|
+
|
|
6403
6612
|
// src/automigrate/fixes/angular-to-angular-vite.ts
|
|
6404
6613
|
var import_semver5 = __toESM(require_semver(), 1);
|
|
6405
6614
|
import { dedent as dedent5 } from "ts-dedent";
|
|
6406
6615
|
var ANGULAR_PACKAGE = "@storybook/angular", ANGULAR_VITE_PACKAGE = "@storybook/angular-vite", 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", rewriteBuilderRefs = (content) => content.replace(/@storybook\/angular:start-storybook/g, `${ANGULAR_VITE_PACKAGE}:start-storybook`).replace(/@storybook\/angular:build-storybook/g, `${ANGULAR_VITE_PACKAGE}:build-storybook`), rewriteTestStorybookScript = (content) => content.replace(/("test-storybook"\s*:\s*)"(?:[^"\\]|\\.)*"/, '$1"vitest run"'), VITE_CONFIG_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".cts", ".mts", ".cjs", ".mjs"], findExistingViteConfig = (configDir) => {
|
|
6407
|
-
let search = (
|
|
6408
|
-
extensions.map((ext) =>
|
|
6616
|
+
let search = (basename5, extensions) => any(
|
|
6617
|
+
extensions.map((ext) => basename5 + ext),
|
|
6409
6618
|
{ last: getProjectRoot(), cwd: configDir }
|
|
6410
6619
|
);
|
|
6411
6620
|
return search("vitest.workspace", [".ts", ".js", ".json"]) || search("vite.config", VITE_CONFIG_EXTENSIONS) || search("vitest.config", VITE_CONFIG_EXTENSIONS);
|
|
@@ -6652,7 +6861,7 @@ export default defineConfig({
|
|
|
6652
6861
|
let angularJsonPath = `${pkgJsonPath.replace(/[/\\]package\.json$/, "")}/angular.json`, { changed, disablesCompodoc, hasStorybookTarget, allStorybookTargetsZonelessTrue } = transformAngularJson(angularJsonPath, dryRun);
|
|
6653
6862
|
disableCompodoc ||= disablesCompodoc, hasStorybookTarget && (anyStorybookTarget = !0, allZonelessTrue = allZonelessTrue && allStorybookTargetsZonelessTrue), changed && logger7.debug(`Updated Angular CLI builder references in ${angularJsonPath}`);
|
|
6654
6863
|
}
|
|
6655
|
-
let { globby } = await import("./globby-
|
|
6864
|
+
let { globby } = await import("./globby-XMBJJZHX.js"), projectJsonFiles = await globby(["**/project.json"], {
|
|
6656
6865
|
ignore: ["**/node_modules/**", "**/dist/**"],
|
|
6657
6866
|
absolute: !0
|
|
6658
6867
|
});
|
|
@@ -6694,7 +6903,7 @@ export default defineConfig({
|
|
|
6694
6903
|
initialValue: !0
|
|
6695
6904
|
})) {
|
|
6696
6905
|
if (configDir && !findExistingViteConfig(configDir)) {
|
|
6697
|
-
let newConfigFile =
|
|
6906
|
+
let newConfigFile = resolve2(dirname2(configDir), "vitest.config.ts"), configDirRelative = relative2(dirname2(newConfigFile), configDir), formatted = await formatFileContent4(
|
|
6698
6907
|
newConfigFile,
|
|
6699
6908
|
buildAngularVitestConfig(configDirRelative)
|
|
6700
6909
|
);
|
|
@@ -6893,7 +7102,7 @@ var addonA11yParameters = {
|
|
|
6893
7102
|
errors.push({ file: previewFileToUpdate, error });
|
|
6894
7103
|
}
|
|
6895
7104
|
}
|
|
6896
|
-
let { default: pLimit } = await import("./p-limit-
|
|
7105
|
+
let { default: pLimit } = await import("./p-limit-LUFYD6QY.js"), limit = pLimit(10);
|
|
6897
7106
|
if (await Promise.all(
|
|
6898
7107
|
storyFilesToUpdate.map(
|
|
6899
7108
|
(file) => limit(async () => {
|
|
@@ -7047,7 +7256,7 @@ var addonGlobalsApi = {
|
|
|
7047
7256
|
}
|
|
7048
7257
|
};
|
|
7049
7258
|
async function transformStoryFiles(files, options, dryRun) {
|
|
7050
|
-
let errors = [], { default: pLimit } = await import("./p-limit-
|
|
7259
|
+
let errors = [], { default: pLimit } = await import("./p-limit-LUFYD6QY.js"), limit = pLimit(10);
|
|
7051
7260
|
return await Promise.all(
|
|
7052
7261
|
files.map(
|
|
7053
7262
|
(file) => limit(async () => {
|
|
@@ -7274,7 +7483,7 @@ function transformPackageJson(content) {
|
|
|
7274
7483
|
return hasChanges ? JSON.stringify(packageJson, null, 2) : null;
|
|
7275
7484
|
}
|
|
7276
7485
|
var transformPackageJsonFiles = async (files, dryRun) => {
|
|
7277
|
-
let errors = [], { default: pLimit } = await import("./p-limit-
|
|
7486
|
+
let errors = [], { default: pLimit } = await import("./p-limit-LUFYD6QY.js"), limit = pLimit(10);
|
|
7278
7487
|
return await Promise.all(
|
|
7279
7488
|
files.map(
|
|
7280
7489
|
(file) => limit(async () => {
|
|
@@ -7313,7 +7522,7 @@ var transformPackageJsonFiles = async (files, dryRun) => {
|
|
|
7313
7522
|
dryRun
|
|
7314
7523
|
);
|
|
7315
7524
|
errors.push(...packageJsonErrors);
|
|
7316
|
-
let { globby } = await import("./globby-
|
|
7525
|
+
let { globby } = await import("./globby-XMBJJZHX.js"), configFiles = await globby([`${configDir}/**/*`]), importErrors = await transformImportFiles2(
|
|
7317
7526
|
[...storiesPaths, ...configFiles].filter(Boolean),
|
|
7318
7527
|
{
|
|
7319
7528
|
...consolidatedPackages,
|
|
@@ -7669,7 +7878,7 @@ var VITE_DEFAULT_VERSION = "^7.0.0", transformMainConfig2 = async (mainConfigPat
|
|
|
7669
7878
|
]);
|
|
7670
7879
|
}
|
|
7671
7880
|
mainConfigPath && (logger13.debug("Updating main config file..."), await transformMainConfig2(mainConfigPath, dryRun)), logger13.debug("Scanning and updating import statements...");
|
|
7672
|
-
let { globby } = await import("./globby-
|
|
7881
|
+
let { globby } = await import("./globby-XMBJJZHX.js"), configFiles = await globby([`${configDir}/**/*`]), allFiles = [...storiesPaths, ...configFiles].filter(Boolean), transformErrors = await transformImportFiles3(
|
|
7673
7882
|
allFiles,
|
|
7674
7883
|
{
|
|
7675
7884
|
"@storybook/nextjs": "@storybook/nextjs-vite"
|
|
@@ -7693,9 +7902,9 @@ import { logger as logger14, prompt as prompt4 } from "storybook/internal/node-l
|
|
|
7693
7902
|
import { spawn } from "node:child_process";
|
|
7694
7903
|
var TIMEOUT = 2e3;
|
|
7695
7904
|
function checkUnixCommandExists(command2) {
|
|
7696
|
-
return new Promise((
|
|
7905
|
+
return new Promise((resolve4) => {
|
|
7697
7906
|
let proc = spawn("which", [command2]);
|
|
7698
|
-
proc.on("error", () =>
|
|
7907
|
+
proc.on("error", () => resolve4(!1)), proc.on("close", (code) => resolve4(code === 0));
|
|
7699
7908
|
});
|
|
7700
7909
|
}
|
|
7701
7910
|
async function getWriteCommand() {
|
|
@@ -7715,7 +7924,7 @@ async function getWriteCommand() {
|
|
|
7715
7924
|
}
|
|
7716
7925
|
}
|
|
7717
7926
|
function writeText(text) {
|
|
7718
|
-
return new Promise(async (
|
|
7927
|
+
return new Promise(async (resolve4, reject) => {
|
|
7719
7928
|
let command2 = await getWriteCommand();
|
|
7720
7929
|
if (!command2)
|
|
7721
7930
|
return reject(new Error("No clipboard tool found"));
|
|
@@ -7723,7 +7932,7 @@ function writeText(text) {
|
|
|
7723
7932
|
stdio: ["pipe", "ignore", "ignore"],
|
|
7724
7933
|
signal: AbortSignal.timeout(TIMEOUT)
|
|
7725
7934
|
});
|
|
7726
|
-
proc.on("error", (cause) => reject(new Error("An error occurred while copying", { cause }))), proc.on("close", (code) => code === 0 ?
|
|
7935
|
+
proc.on("error", (cause) => reject(new Error("An error occurred while copying", { cause }))), proc.on("close", (code) => code === 0 ? resolve4() : reject(new Error("An unknown error occurred while copying"))), proc.stdin.write(text), proc.stdin.end();
|
|
7727
7936
|
});
|
|
7728
7937
|
}
|
|
7729
7938
|
|
|
@@ -7747,7 +7956,7 @@ var REACT_VITE_PACKAGE = "@storybook/react-vite", TANSTACK_REACT_PACKAGE = "@sto
|
|
|
7747
7956
|
configDir,
|
|
7748
7957
|
storiesPaths
|
|
7749
7958
|
}) => {
|
|
7750
|
-
let { globby } = await import("./globby-
|
|
7959
|
+
let { globby } = await import("./globby-XMBJJZHX.js"), configFiles = configDir ? await globby([`${configDir}/**/*.{ts,tsx,js,jsx,mjs,cjs}`], {
|
|
7751
7960
|
ignore: ["**/node_modules/**", "**/dist/**"]
|
|
7752
7961
|
}) : [], candidateFiles = Array.from(
|
|
7753
7962
|
/* @__PURE__ */ new Set([...previewConfigPath ? [previewConfigPath] : [], ...configFiles, ...storiesPaths])
|
|
@@ -7966,7 +8175,7 @@ var REACT_VITE_PACKAGE = "@storybook/react-vite", TANSTACK_REACT_PACKAGE = "@sto
|
|
|
7966
8175
|
logger14.step(`Migrating from ${REACT_VITE_PACKAGE} to ${TANSTACK_REACT_PACKAGE}...`), dryRun ? logger14.debug("Dry run: Skipping package.json updates.") : (logger14.debug("Updating package.json files..."), await packageManager.removeDependencies([REACT_VITE_PACKAGE]), await packageManager.addDependencies({ type: "devDependencies", skipInstall: !0 }, [
|
|
7967
8176
|
`${TANSTACK_REACT_PACKAGE}@${storybookVersion}`
|
|
7968
8177
|
])), mainConfigPath && (logger14.debug("Updating main config file..."), await transformMainConfig3(mainConfigPath, dryRun)), logger14.debug("Scanning and updating import statements...");
|
|
7969
|
-
let { globby } = await import("./globby-
|
|
8178
|
+
let { globby } = await import("./globby-XMBJJZHX.js"), configFiles = configDir ? await globby([`${configDir}/**/*.{ts,tsx,js,jsx,mjs,cjs}`], {
|
|
7970
8179
|
ignore: ["**/node_modules/**", "**/dist/**"]
|
|
7971
8180
|
}) : [], allFiles = [...storiesPaths, ...configFiles, previewConfigPath].filter(
|
|
7972
8181
|
Boolean
|
|
@@ -8207,7 +8416,7 @@ var getAllDependencies = (packageJson) => Object.keys({
|
|
|
8207
8416
|
let regex = new RegExp(`(['"])${renderer}(['"])`, "g");
|
|
8208
8417
|
return regex.test(source) ? source.replace(regex, `$1${framework}$2`) : null;
|
|
8209
8418
|
}, transformSourceFiles = async (files, renderer, framework, dryRun) => {
|
|
8210
|
-
let errors = [], { default: pLimit } = await import("./p-limit-
|
|
8419
|
+
let errors = [], { default: pLimit } = await import("./p-limit-LUFYD6QY.js"), limit = pLimit(10);
|
|
8211
8420
|
return await Promise.all(
|
|
8212
8421
|
files.map(
|
|
8213
8422
|
(file) => limit(async () => {
|
|
@@ -8274,7 +8483,7 @@ var getAllDependencies = (packageJson) => Object.keys({
|
|
|
8274
8483
|
continue;
|
|
8275
8484
|
logger16.debug(`
|
|
8276
8485
|
Migrating ${rendererPackage} to ${selectedFramework}`);
|
|
8277
|
-
let { globby } = await import("./globby-
|
|
8486
|
+
let { globby } = await import("./globby-XMBJJZHX.js"), configFiles = await globby([`${configDir}/**/*`]);
|
|
8278
8487
|
await transformSourceFiles(
|
|
8279
8488
|
[...storiesPaths, ...configFiles].filter(Boolean),
|
|
8280
8489
|
rendererPackage,
|
|
@@ -8291,7 +8500,7 @@ Migrating ${rendererPackage} to ${selectedFramework}`);
|
|
|
8291
8500
|
|
|
8292
8501
|
// src/automigrate/fixes/rn-ondevice-addons-to-device-addons.ts
|
|
8293
8502
|
import { existsSync as existsSync3 } from "node:fs";
|
|
8294
|
-
import { basename as
|
|
8503
|
+
import { basename as basename3, dirname as dirname3, isAbsolute as isAbsolute3, join as join5, resolve as resolve3 } from "node:path";
|
|
8295
8504
|
import { findConfigFile, loadMainConfig } from "storybook/internal/common";
|
|
8296
8505
|
import { logger as logger17 } from "storybook/internal/node-logger";
|
|
8297
8506
|
|
|
@@ -8299,18 +8508,18 @@ import { logger as logger17 } from "storybook/internal/node-logger";
|
|
|
8299
8508
|
var RN_STORYBOOK_DIR = ".rnstorybook";
|
|
8300
8509
|
|
|
8301
8510
|
// src/automigrate/fixes/rn-ondevice-addons-to-device-addons.ts
|
|
8302
|
-
var resolveAbsoluteConfigDir = (configDir) =>
|
|
8303
|
-
let base =
|
|
8511
|
+
var resolveAbsoluteConfigDir = (configDir) => isAbsolute3(configDir) ? configDir : join5(process.cwd(), configDir), getSiblingStorybookConfigDir = (configDirAbs) => {
|
|
8512
|
+
let base = basename3(configDirAbs), parent = dirname3(configDirAbs);
|
|
8304
8513
|
if (base === ".storybook") {
|
|
8305
|
-
let rn =
|
|
8514
|
+
let rn = join5(parent, RN_STORYBOOK_DIR);
|
|
8306
8515
|
return existsSync3(rn) ? rn : null;
|
|
8307
8516
|
}
|
|
8308
8517
|
if (base === RN_STORYBOOK_DIR) {
|
|
8309
|
-
let web =
|
|
8518
|
+
let web = join5(parent, ".storybook");
|
|
8310
8519
|
return existsSync3(web) ? web : null;
|
|
8311
8520
|
}
|
|
8312
8521
|
return null;
|
|
8313
|
-
}, isReactNativeMain = (mainConfigPath, mainConfig) =>
|
|
8522
|
+
}, isReactNativeMain = (mainConfigPath, mainConfig) => basename3(dirname3(mainConfigPath)) === RN_STORYBOOK_DIR ? !0 : getFrameworkPackageName(mainConfig) === "@storybook/react-native", hasAddonsToRename = (cfg) => {
|
|
8314
8523
|
let addons = cfg.addons;
|
|
8315
8524
|
return !(!Array.isArray(addons) || addons.length === 0 || cfg.deviceAddons !== void 0);
|
|
8316
8525
|
}, rnOndeviceAddonsToDeviceAddons = {
|
|
@@ -8332,12 +8541,12 @@ var resolveAbsoluteConfigDir = (configDir) => isAbsolute2(configDir) ? configDir
|
|
|
8332
8541
|
let mainPath = findConfigFile("main", dir);
|
|
8333
8542
|
if (!mainPath)
|
|
8334
8543
|
continue;
|
|
8335
|
-
let resolvedMain =
|
|
8544
|
+
let resolvedMain = resolve3(mainPath);
|
|
8336
8545
|
if (seenResolvedMainPaths.has(resolvedMain))
|
|
8337
8546
|
continue;
|
|
8338
8547
|
seenResolvedMainPaths.add(resolvedMain);
|
|
8339
8548
|
let cfg;
|
|
8340
|
-
if (mainConfigPath &&
|
|
8549
|
+
if (mainConfigPath && resolve3(mainConfigPath) === resolvedMain)
|
|
8341
8550
|
cfg = mainConfig;
|
|
8342
8551
|
else
|
|
8343
8552
|
try {
|
|
@@ -8368,7 +8577,7 @@ var resolveAbsoluteConfigDir = (configDir) => isAbsolute2(configDir) ? configDir
|
|
|
8368
8577
|
// src/automigrate/fixes/rnstorybook-config.ts
|
|
8369
8578
|
import { existsSync as existsSync4 } from "node:fs";
|
|
8370
8579
|
import { readFile as readFile10, rename, writeFile as writeFile9 } from "node:fs/promises";
|
|
8371
|
-
import { join as
|
|
8580
|
+
import { join as join6 } from "node:path";
|
|
8372
8581
|
import { dedent as dedent12 } from "ts-dedent";
|
|
8373
8582
|
async function renameInFile(filePath, oldText, newText) {
|
|
8374
8583
|
try {
|
|
@@ -8380,7 +8589,7 @@ async function renameInFile(filePath, oldText, newText) {
|
|
|
8380
8589
|
}
|
|
8381
8590
|
var getDotStorybookReferences = async (searchDir) => {
|
|
8382
8591
|
try {
|
|
8383
|
-
let { globby } = await import("./globby-
|
|
8592
|
+
let { globby } = await import("./globby-XMBJJZHX.js"), { readFile: readFile12 } = await import("node:fs/promises"), files = await globby(`${searchDir}/**/*`, {
|
|
8384
8593
|
onlyFiles: !0,
|
|
8385
8594
|
gitignore: !0
|
|
8386
8595
|
}), referencedFiles = [];
|
|
@@ -8401,7 +8610,7 @@ var getDotStorybookReferences = async (searchDir) => {
|
|
|
8401
8610
|
async check({ packageManager, mainConfigPath }) {
|
|
8402
8611
|
if (!packageManager.getAllDependencies()["@storybook/react-native"])
|
|
8403
8612
|
return null;
|
|
8404
|
-
let projectDir = mainConfigPath ?
|
|
8613
|
+
let projectDir = mainConfigPath ? join6(mainConfigPath, "..", "..") : process.cwd(), storybookDir = join6(projectDir, ".storybook"), rnStorybookDir = join6(projectDir, RN_STORYBOOK_DIR), { globby } = await import("./globby-XMBJJZHX.js"), requiresFiles = await globby(join6(storybookDir, "storybook.requires.*"));
|
|
8405
8614
|
return existsSync4(storybookDir) && requiresFiles.length > 0 && !existsSync4(rnStorybookDir) ? { storybookDir, rnStorybookDir } : null;
|
|
8406
8615
|
},
|
|
8407
8616
|
prompt() {
|
|
@@ -8445,7 +8654,7 @@ var storybookPackageNameConflict = {
|
|
|
8445
8654
|
// src/automigrate/fixes/upgrade-storybook-related-dependencies.ts
|
|
8446
8655
|
var import_semver6 = __toESM(require_semver(), 1);
|
|
8447
8656
|
import { readFileSync as readFileSync4 } from "node:fs";
|
|
8448
|
-
import { dirname as
|
|
8657
|
+
import { dirname as dirname4 } from "node:path";
|
|
8449
8658
|
import { isCorePackage, isSatelliteAddon } from "storybook/internal/common";
|
|
8450
8659
|
import { logger as logger18 } from "storybook/internal/node-logger";
|
|
8451
8660
|
import { dedent as dedent14 } from "ts-dedent";
|
|
@@ -8503,7 +8712,7 @@ var upgradeStorybookRelatedDependencies = {
|
|
|
8503
8712
|
return;
|
|
8504
8713
|
let { packageName, afterVersion: version2 } = item, prefixed = `^${version2}`;
|
|
8505
8714
|
packageJson.dependencies?.[packageName] && (packageJson.dependencies[packageName] = prefixed), packageJson.devDependencies?.[packageName] && (packageJson.devDependencies[packageName] = prefixed), packageJson.peerDependencies?.[packageName] && (packageJson.peerDependencies[packageName] = prefixed);
|
|
8506
|
-
}), packageManager.writePackageJson(packageJson,
|
|
8715
|
+
}), packageManager.writePackageJson(packageJson, dirname4(packageJsonPath));
|
|
8507
8716
|
});
|
|
8508
8717
|
}
|
|
8509
8718
|
};
|
|
@@ -8873,7 +9082,7 @@ ${error.stack}`), fixSummary.failed[f.id] = error.message), fixResults[f.id] = "
|
|
|
8873
9082
|
// src/link.ts
|
|
8874
9083
|
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
8875
9084
|
import { mkdir, readFile as readFile11, writeFile as writeFile10 } from "node:fs/promises";
|
|
8876
|
-
import { basename as
|
|
9085
|
+
import { basename as basename4, extname as extname3, join as join7 } from "node:path";
|
|
8877
9086
|
import { executeCommand } from "storybook/internal/common";
|
|
8878
9087
|
import { logger as logger21 } from "storybook/internal/node-logger";
|
|
8879
9088
|
var link = async ({ target, local, start }) => {
|
|
@@ -8884,14 +9093,14 @@ var link = async ({ target, local, start }) => {
|
|
|
8884
9093
|
} catch {
|
|
8885
9094
|
throw new Error("Expected to run link from the root of the storybook monorepo");
|
|
8886
9095
|
}
|
|
8887
|
-
let reproDir = target, reproName =
|
|
9096
|
+
let reproDir = target, reproName = basename4(target);
|
|
8888
9097
|
if (!local) {
|
|
8889
|
-
let reprosDir =
|
|
9098
|
+
let reprosDir = join7(storybookDir, "../storybook-repros");
|
|
8890
9099
|
logger21.info(`Ensuring directory ${reprosDir}`), await mkdir(reprosDir, { recursive: !0 }), logger21.info(`Cloning ${target}`), await executeCommand({
|
|
8891
9100
|
command: "git",
|
|
8892
9101
|
args: ["clone", target],
|
|
8893
9102
|
cwd: reprosDir
|
|
8894
|
-
}), reproName =
|
|
9103
|
+
}), reproName = basename4(target, extname3(target)), reproDir = join7(reprosDir, reproName);
|
|
8895
9104
|
}
|
|
8896
9105
|
let version2 = (0, import_cross_spawn.sync)("yarn", ["--version"], {
|
|
8897
9106
|
cwd: reproDir,
|
|
@@ -8908,7 +9117,7 @@ var link = async ({ target, local, start }) => {
|
|
|
8908
9117
|
cwd: reproDir
|
|
8909
9118
|
}), logger21.info(`Installing ${reproName}`);
|
|
8910
9119
|
let reproPackageJson = JSON.parse(
|
|
8911
|
-
await readFile11(
|
|
9120
|
+
await readFile11(join7(reproDir, "package.json"), { encoding: "utf8" })
|
|
8912
9121
|
);
|
|
8913
9122
|
reproPackageJson.devDependencies?.vite || (reproPackageJson.devDependencies = {
|
|
8914
9123
|
...reproPackageJson.devDependencies,
|
|
@@ -8916,7 +9125,7 @@ var link = async ({ target, local, start }) => {
|
|
|
8916
9125
|
}), reproPackageJson.devDependencies = {
|
|
8917
9126
|
...reproPackageJson.devDependencies,
|
|
8918
9127
|
"@types/node": "^22"
|
|
8919
|
-
}, await writeFile10(
|
|
9128
|
+
}, await writeFile10(join7(reproDir, "package.json"), JSON.stringify(reproPackageJson, null, 2)), await executeCommand({
|
|
8920
9129
|
command: "yarn",
|
|
8921
9130
|
args: ["install"],
|
|
8922
9131
|
cwd: reproDir
|
|
@@ -8943,7 +9152,7 @@ async function migrate(migration, { glob, dryRun, list, rename: rename2, parser
|
|
|
8943
9152
|
var import_cross_spawn2 = __toESM(require_cross_spawn(), 1);
|
|
8944
9153
|
import { existsSync as existsSync5 } from "node:fs";
|
|
8945
9154
|
import { mkdir as mkdir2, readdir, rm } from "node:fs/promises";
|
|
8946
|
-
import { isAbsolute as
|
|
9155
|
+
import { isAbsolute as isAbsolute4 } from "node:path";
|
|
8947
9156
|
import { PackageManagerName } from "storybook/internal/common";
|
|
8948
9157
|
import {
|
|
8949
9158
|
JsPackageManagerFactory,
|
|
@@ -9008,7 +9217,7 @@ var baseTemplates = {
|
|
|
9008
9217
|
},
|
|
9009
9218
|
"nextjs/14-ts": {
|
|
9010
9219
|
name: "Next.js v14.2 (Webpack | TypeScript)",
|
|
9011
|
-
script: '
|
|
9220
|
+
script: 'npx create-next-app {{beforeDir}} --skip-install -e https://github.com/vercel/next.js/tree/v14.2.17/examples/hello-world && cd {{beforeDir}} && npm pkg set "dependencies.next"="^14.2.17" && yarn && git add . && git commit --amend --no-edit && cd ..',
|
|
9012
9221
|
expected: {
|
|
9013
9222
|
framework: "@storybook/nextjs",
|
|
9014
9223
|
renderer: "@storybook/react",
|
|
@@ -9032,7 +9241,7 @@ var baseTemplates = {
|
|
|
9032
9241
|
},
|
|
9033
9242
|
"nextjs/15-ts": {
|
|
9034
9243
|
name: "Next.js v15 (Webpack | TypeScript)",
|
|
9035
|
-
script: 'npx create-next-app@^15.5 {{beforeDir}} --eslint --tailwind --app --import-alias="@/*" --src-dir',
|
|
9244
|
+
script: 'npx create-next-app@^15.5 {{beforeDir}} --skip-install --eslint --tailwind --app --import-alias="@/*" --src-dir',
|
|
9036
9245
|
expected: {
|
|
9037
9246
|
framework: "@storybook/nextjs",
|
|
9038
9247
|
renderer: "@storybook/react",
|
|
@@ -9056,7 +9265,7 @@ var baseTemplates = {
|
|
|
9056
9265
|
},
|
|
9057
9266
|
"nextjs/default-ts": {
|
|
9058
9267
|
name: "Next.js Latest (Webpack | TypeScript)",
|
|
9059
|
-
script: 'npx create-next-app {{beforeDir}} --eslint --tailwind --app --import-alias="@/*" --src-dir',
|
|
9268
|
+
script: 'npx create-next-app {{beforeDir}} --skip-install --eslint --tailwind --app --import-alias="@/*" --src-dir',
|
|
9060
9269
|
expected: {
|
|
9061
9270
|
framework: "@storybook/nextjs",
|
|
9062
9271
|
renderer: "@storybook/react",
|
|
@@ -9081,7 +9290,16 @@ var baseTemplates = {
|
|
|
9081
9290
|
},
|
|
9082
9291
|
"nextjs/prerelease": {
|
|
9083
9292
|
name: "Next.js Prerelease (Webpack | TypeScript)",
|
|
9084
|
-
script: 'npx create-next-app@canary {{beforeDir}} --eslint --tailwind --app --import-alias="@/*" --src-dir',
|
|
9293
|
+
script: 'npx create-next-app@canary {{beforeDir}} --skip-install --eslint --tailwind --app --import-alias="@/*" --src-dir',
|
|
9294
|
+
// The point of this template is the canary line, and canaries are published
|
|
9295
|
+
// daily. `@next/*` covers the platform binaries, and `eslint-config-next`
|
|
9296
|
+
// is pinned to the same canary version by create-next-app.
|
|
9297
|
+
//
|
|
9298
|
+
// `@tailwindcss/turbopack` is not part of that line — `--tailwind` pulls it in,
|
|
9299
|
+
// and it is new enough that `^4` has only ever matched one release. Until it has
|
|
9300
|
+
// a second one, every release it makes is the sole candidate and the gate blocks
|
|
9301
|
+
// the whole template. Drop this entry once 4.x has some history.
|
|
9302
|
+
minAgeGateExemptions: ["next", "@next/*", "eslint-config-next", "@tailwindcss/turbopack"],
|
|
9085
9303
|
expected: {
|
|
9086
9304
|
framework: "@storybook/nextjs",
|
|
9087
9305
|
renderer: "@storybook/react",
|
|
@@ -9105,7 +9323,7 @@ var baseTemplates = {
|
|
|
9105
9323
|
},
|
|
9106
9324
|
"nextjs-vite/14-ts": {
|
|
9107
9325
|
name: "Next.js v14 (Vite | TypeScript)",
|
|
9108
|
-
script: 'npx create-next-app@^14 {{beforeDir}} --eslint --tailwind --app --import-alias="@/*" --src-dir',
|
|
9326
|
+
script: 'npx create-next-app@^14 {{beforeDir}} --skip-install --eslint --tailwind --app --import-alias="@/*" --src-dir',
|
|
9109
9327
|
expected: {
|
|
9110
9328
|
framework: "@storybook/nextjs-vite",
|
|
9111
9329
|
renderer: "@storybook/react",
|
|
@@ -9127,7 +9345,7 @@ var baseTemplates = {
|
|
|
9127
9345
|
},
|
|
9128
9346
|
"nextjs-vite/15-ts": {
|
|
9129
9347
|
name: "Next.js v15 (Vite | TypeScript)",
|
|
9130
|
-
script: 'npx create-next-app@^15 {{beforeDir}} --eslint --tailwind --app --import-alias="@/*" --src-dir',
|
|
9348
|
+
script: 'npx create-next-app@^15 {{beforeDir}} --skip-install --eslint --tailwind --app --import-alias="@/*" --src-dir',
|
|
9131
9349
|
expected: {
|
|
9132
9350
|
framework: "@storybook/nextjs-vite",
|
|
9133
9351
|
renderer: "@storybook/react",
|
|
@@ -9149,7 +9367,7 @@ var baseTemplates = {
|
|
|
9149
9367
|
},
|
|
9150
9368
|
"nextjs-vite/default-ts": {
|
|
9151
9369
|
name: "Next.js Latest (Vite | TypeScript)",
|
|
9152
|
-
script: 'npx create-next-app {{beforeDir}} --eslint --no-tailwind --app --import-alias="@/*" --src-dir',
|
|
9370
|
+
script: 'npx create-next-app {{beforeDir}} --skip-install --eslint --no-tailwind --app --import-alias="@/*" --src-dir',
|
|
9153
9371
|
expected: {
|
|
9154
9372
|
framework: "@storybook/nextjs-vite",
|
|
9155
9373
|
renderer: "@storybook/react",
|
|
@@ -9220,6 +9438,10 @@ var baseTemplates = {
|
|
|
9220
9438
|
* see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#installing
|
|
9221
9439
|
*/
|
|
9222
9440
|
script: "npm create vite --yes {{beforeDir}} -- --template react-ts",
|
|
9441
|
+
// Beta React is applied after scaffold (extraDependencies / resolutions). The allowlist
|
|
9442
|
+
// still has to live on before-storybook so later installs under the 7-day gate can
|
|
9443
|
+
// resolve those packages. `scheduler` ships in lockstep with React releases.
|
|
9444
|
+
minAgeGateExemptions: ["react", "react-dom", "types-react", "types-react-dom", "scheduler"],
|
|
9223
9445
|
expected: {
|
|
9224
9446
|
framework: "@storybook/react-vite",
|
|
9225
9447
|
renderer: "@storybook/react",
|
|
@@ -9250,7 +9472,7 @@ var baseTemplates = {
|
|
|
9250
9472
|
},
|
|
9251
9473
|
"react-webpack/18-ts": {
|
|
9252
9474
|
name: "React Latest (Webpack | TypeScript)",
|
|
9253
|
-
script: "
|
|
9475
|
+
script: "npx create-webpack5-react {{beforeDir}}",
|
|
9254
9476
|
expected: {
|
|
9255
9477
|
framework: "@storybook/react-webpack5",
|
|
9256
9478
|
renderer: "@storybook/react",
|
|
@@ -9270,7 +9492,7 @@ var baseTemplates = {
|
|
|
9270
9492
|
},
|
|
9271
9493
|
"react-webpack/17-ts": {
|
|
9272
9494
|
name: "React v17 (Webpack | TypeScript)",
|
|
9273
|
-
script: '
|
|
9495
|
+
script: 'npx create-webpack5-react {{beforeDir}} --version-react="17" --version-react-dom="17"',
|
|
9274
9496
|
expected: {
|
|
9275
9497
|
framework: "@storybook/react-webpack5",
|
|
9276
9498
|
renderer: "@storybook/react",
|
|
@@ -9294,7 +9516,12 @@ var baseTemplates = {
|
|
|
9294
9516
|
* Create a Webpack project with React beta versions.
|
|
9295
9517
|
* See https://react.dev/blog/2024/04/25/react-19-upgrade-guide#installing
|
|
9296
9518
|
*/
|
|
9297
|
-
script: '
|
|
9519
|
+
script: 'npx create-webpack5-react {{beforeDir}} --version-react="beta" --version-react-dom="beta"',
|
|
9520
|
+
// create-webpack5-react pins react@beta at scaffold time, so refresh must allow the
|
|
9521
|
+
// React beta family or the 7-day gate quarantines them. `types-react*` are the
|
|
9522
|
+
// packages behind the `@types/react@npm:types-react@beta` aliases; `scheduler`
|
|
9523
|
+
// ships in lockstep with React releases.
|
|
9524
|
+
minAgeGateExemptions: ["react", "react-dom", "types-react", "types-react-dom", "scheduler"],
|
|
9298
9525
|
expected: {
|
|
9299
9526
|
framework: "@storybook/react-webpack5",
|
|
9300
9527
|
renderer: "@storybook/react",
|
|
@@ -9322,7 +9549,7 @@ var baseTemplates = {
|
|
|
9322
9549
|
},
|
|
9323
9550
|
"react-rsbuild/default-ts": {
|
|
9324
9551
|
name: "React Latest (RsBuild | TypeScript)",
|
|
9325
|
-
script: "
|
|
9552
|
+
script: "npx create-rsbuild -d {{beforeDir}} -t react-ts --tools eslint",
|
|
9326
9553
|
expected: {
|
|
9327
9554
|
framework: "storybook-react-rsbuild",
|
|
9328
9555
|
renderer: "@storybook/react",
|
|
@@ -9342,7 +9569,7 @@ var baseTemplates = {
|
|
|
9342
9569
|
},
|
|
9343
9570
|
"solid-vite/default-ts": {
|
|
9344
9571
|
name: "SolidJS Latest (Vite | TypeScript)",
|
|
9345
|
-
script: "
|
|
9572
|
+
script: "npx create-solid {{beforeDir}} --vanilla --ts --template=with-vitest",
|
|
9346
9573
|
expected: {
|
|
9347
9574
|
framework: "storybook-solidjs-vite",
|
|
9348
9575
|
renderer: "storybook-solidjs-vite",
|
|
@@ -9352,7 +9579,7 @@ var baseTemplates = {
|
|
|
9352
9579
|
},
|
|
9353
9580
|
"tanstack-react-router/default-ts": {
|
|
9354
9581
|
name: "TanStack React Router Latest (Vite | TypeScript)",
|
|
9355
|
-
script: "npx @tanstack/cli@latest create {{beforeDir}} --tailwind --router-only",
|
|
9582
|
+
script: "npx @tanstack/cli@latest create {{beforeDir}} --no-install --tailwind --router-only",
|
|
9356
9583
|
expected: {
|
|
9357
9584
|
framework: "@storybook/tanstack-react",
|
|
9358
9585
|
renderer: "@storybook/react",
|
|
@@ -9372,7 +9599,7 @@ var baseTemplates = {
|
|
|
9372
9599
|
},
|
|
9373
9600
|
"tanstack-react-start/default-ts": {
|
|
9374
9601
|
name: "TanStack React Start Latest (Vite | TypeScript)",
|
|
9375
|
-
script: "npx @tanstack/cli@latest create {{beforeDir}} --tailwind",
|
|
9602
|
+
script: "npx @tanstack/cli@latest create {{beforeDir}} --no-install --tailwind",
|
|
9376
9603
|
expected: {
|
|
9377
9604
|
framework: "@storybook/tanstack-react",
|
|
9378
9605
|
renderer: "@storybook/react",
|
|
@@ -9393,6 +9620,8 @@ var baseTemplates = {
|
|
|
9393
9620
|
"vue3-vite/default-js": {
|
|
9394
9621
|
name: "Vue v3 (Vite | JavaScript)",
|
|
9395
9622
|
script: "npm create vite --yes {{beforeDir}} -- --template vue",
|
|
9623
|
+
// vue-component-meta@^3.3.9 pins @vue/language-core; both are inside the age gate.
|
|
9624
|
+
minAgeGateExemptions: ["vue-component-meta", "@vue/language-core"],
|
|
9396
9625
|
expected: {
|
|
9397
9626
|
framework: "@storybook/vue3-vite",
|
|
9398
9627
|
renderer: "@storybook/vue3",
|
|
@@ -9406,6 +9635,7 @@ var baseTemplates = {
|
|
|
9406
9635
|
"vue3-vite/default-ts": {
|
|
9407
9636
|
name: "Vue v3 (Vite | TypeScript)",
|
|
9408
9637
|
script: "npm create vite --yes {{beforeDir}} -- --template vue-ts",
|
|
9638
|
+
minAgeGateExemptions: ["vue-component-meta", "@vue/language-core"],
|
|
9409
9639
|
expected: {
|
|
9410
9640
|
framework: "@storybook/vue3-vite",
|
|
9411
9641
|
renderer: "@storybook/vue3",
|
|
@@ -9418,7 +9648,7 @@ var baseTemplates = {
|
|
|
9418
9648
|
},
|
|
9419
9649
|
"vue3-rsbuild/default-ts": {
|
|
9420
9650
|
name: "Vue Latest (RsBuild | TypeScript)",
|
|
9421
|
-
script: "
|
|
9651
|
+
script: "npx create-rsbuild -d {{beforeDir}} -t vue-ts --tools eslint",
|
|
9422
9652
|
expected: {
|
|
9423
9653
|
framework: "storybook-vue3-rsbuild",
|
|
9424
9654
|
renderer: "@storybook/vue3",
|
|
@@ -9473,7 +9703,7 @@ var baseTemplates = {
|
|
|
9473
9703
|
},
|
|
9474
9704
|
"html-rsbuild/default-ts": {
|
|
9475
9705
|
name: "HTML Latest (RsBuild | TypeScript)",
|
|
9476
|
-
script: "
|
|
9706
|
+
script: "npx create-rsbuild -d {{beforeDir}} -t vanilla-ts --tools eslint",
|
|
9477
9707
|
expected: {
|
|
9478
9708
|
framework: "storybook-html-rsbuild",
|
|
9479
9709
|
renderer: "@storybook/html",
|
|
@@ -9583,6 +9813,40 @@ var baseTemplates = {
|
|
|
9583
9813
|
skipTasks: ["bench"],
|
|
9584
9814
|
initOptions: { builder: "vite" /* VITE */ }
|
|
9585
9815
|
},
|
|
9816
|
+
"angular-vite/docgen-server-ts": {
|
|
9817
|
+
name: "Angular CLI Server Docgen Latest (Vite | TypeScript)",
|
|
9818
|
+
// Identical to `angular-vite/default-ts` apart from the two feature flags below. Kept as its own
|
|
9819
|
+
// template so the stable Angular sandbox keeps guarding today's browser docgen while the server
|
|
9820
|
+
// path is proven separately, rather than both riding on one configuration.
|
|
9821
|
+
script: "npx -p @angular/cli ng new angular-latest --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn --ssr",
|
|
9822
|
+
modifications: {
|
|
9823
|
+
extraDependencies: ["@angular/forms@^22", "@angular/animations@^22", "typescript@^6"],
|
|
9824
|
+
useCsfFactory: !0,
|
|
9825
|
+
// These two flags are what brings a template into docgen baseline coverage; see
|
|
9826
|
+
// `docgenServerTemplates`.
|
|
9827
|
+
mainConfig: {
|
|
9828
|
+
features: {
|
|
9829
|
+
experimentalDocgenServer: !0,
|
|
9830
|
+
componentsManifest: !0
|
|
9831
|
+
}
|
|
9832
|
+
}
|
|
9833
|
+
},
|
|
9834
|
+
extraCiSteps: {
|
|
9835
|
+
ensureMinNodeVersion: !0
|
|
9836
|
+
},
|
|
9837
|
+
expected: {
|
|
9838
|
+
framework: "@storybook/angular-vite",
|
|
9839
|
+
renderer: "@storybook/angular-vite",
|
|
9840
|
+
builder: "@storybook/builder-vite"
|
|
9841
|
+
},
|
|
9842
|
+
// This sandbox exists to guard the docgen baselines, and it differs from
|
|
9843
|
+
// `angular-vite/default-ts` only by two feature flags. Rendering, visual output and story
|
|
9844
|
+
// execution are already covered there on every run, so repeating them here would double the
|
|
9845
|
+
// Angular cost for no extra signal. `test-runner` goes with `chromatic`: skipping only the
|
|
9846
|
+
// latter swaps in a test-runner job rather than dropping one.
|
|
9847
|
+
skipTasks: ["bench", "chromatic", "test-runner"],
|
|
9848
|
+
initOptions: { builder: "vite" /* VITE */ }
|
|
9849
|
+
},
|
|
9586
9850
|
"lit-vite/default-js": {
|
|
9587
9851
|
name: "Lit Latest (Vite | JavaScript)",
|
|
9588
9852
|
script: 'npm create vite --yes {{beforeDir}} -- --template lit && cd {{beforeDir}} && echo "export default {}" > vite.config.js',
|
|
@@ -9613,7 +9877,7 @@ var baseTemplates = {
|
|
|
9613
9877
|
},
|
|
9614
9878
|
"lit-rsbuild/default-ts": {
|
|
9615
9879
|
name: "Web Components Latest (RsBuild | TypeScript)",
|
|
9616
|
-
script: "
|
|
9880
|
+
script: "npx create-rsbuild -d {{beforeDir}} -t lit-ts --tools eslint",
|
|
9617
9881
|
expected: {
|
|
9618
9882
|
framework: "storybook-web-components-rsbuild",
|
|
9619
9883
|
renderer: "@storybook/web-components",
|
|
@@ -9666,7 +9930,7 @@ var baseTemplates = {
|
|
|
9666
9930
|
// },
|
|
9667
9931
|
"ember/3-js": {
|
|
9668
9932
|
name: "Ember v3 (Webpack | JavaScript)",
|
|
9669
|
-
script: "npx --package ember-cli@3.28.1 ember new {{beforeDir}}",
|
|
9933
|
+
script: "npx --package ember-cli@3.28.1 ember new {{beforeDir}} --skip-install",
|
|
9670
9934
|
inDevelopment: !0,
|
|
9671
9935
|
expected: {
|
|
9672
9936
|
framework: "@storybook/ember",
|
|
@@ -9694,7 +9958,18 @@ var baseTemplates = {
|
|
|
9694
9958
|
// Users & CI won't see this limitation because they are not using
|
|
9695
9959
|
// yarn portals.
|
|
9696
9960
|
name: "React Native Expo Latest (Vite | TypeScript)",
|
|
9697
|
-
script: "npx create-expo-app -y {{beforeDir}}",
|
|
9961
|
+
script: "npx create-expo-app -y --no-install {{beforeDir}}",
|
|
9962
|
+
// create-expo-app pins the current SDK, whose packages are released
|
|
9963
|
+
// together and are routinely younger than the gate window.
|
|
9964
|
+
// `babel-preset-expo` is part of that set despite not matching `expo-*`.
|
|
9965
|
+
minAgeGateExemptions: [
|
|
9966
|
+
"expo",
|
|
9967
|
+
"expo-*",
|
|
9968
|
+
"@expo/*",
|
|
9969
|
+
"babel-preset-expo",
|
|
9970
|
+
"react-native",
|
|
9971
|
+
"@react-native/*"
|
|
9972
|
+
],
|
|
9698
9973
|
expected: {
|
|
9699
9974
|
framework: "@storybook/react-native-web-vite",
|
|
9700
9975
|
renderer: "@storybook/react",
|
|
@@ -9727,7 +10002,7 @@ var baseTemplates = {
|
|
|
9727
10002
|
// Users & CI won't see this limitation because they are not using
|
|
9728
10003
|
// yarn portals.
|
|
9729
10004
|
name: "React Native CLI Latest (Vite | TypeScript)",
|
|
9730
|
-
script: "npx @react-native-community/cli@latest init --install-pods=false --directory={{beforeDir}} rnapp",
|
|
10005
|
+
script: "npx @react-native-community/cli@latest init --skip-install --install-pods=false --directory={{beforeDir}} rnapp",
|
|
9731
10006
|
expected: {
|
|
9732
10007
|
framework: "@storybook/react-native-web-vite",
|
|
9733
10008
|
renderer: "@storybook/react",
|
|
@@ -9747,7 +10022,7 @@ var baseTemplates = {
|
|
|
9747
10022
|
}, internalTemplates = {
|
|
9748
10023
|
"internal/react18-webpack-babel": {
|
|
9749
10024
|
name: "React with Babel Latest (Webpack | TypeScript)",
|
|
9750
|
-
script: "
|
|
10025
|
+
script: "npx create-webpack5-react {{beforeDir}}",
|
|
9751
10026
|
expected: {
|
|
9752
10027
|
framework: "@storybook/react-webpack5",
|
|
9753
10028
|
renderer: "@storybook/react",
|
|
@@ -9778,7 +10053,7 @@ var baseTemplates = {
|
|
|
9778
10053
|
},
|
|
9779
10054
|
"internal/react16-webpack": {
|
|
9780
10055
|
name: "React 16 (Webpack | TypeScript)",
|
|
9781
|
-
script: "
|
|
10056
|
+
script: "npx create-webpack5-react {{beforeDir}} --version-react=16 --version-react-dom=16 --version-@types/react=16 --version-@types/react-dom=16",
|
|
9782
10057
|
expected: {
|
|
9783
10058
|
framework: "@storybook/react-webpack5",
|
|
9784
10059
|
renderer: "@storybook/react",
|
|
@@ -9940,6 +10215,10 @@ var baseTemplates = {
|
|
|
9940
10215
|
], daily = [
|
|
9941
10216
|
...merged,
|
|
9942
10217
|
"angular-vite/21-ts",
|
|
10218
|
+
// TODO(11.0): remove this template. The standard sandboxes ship the new docgen approach by
|
|
10219
|
+
// default from then on, so `angular-vite/default-ts` carries the baselines and this one is
|
|
10220
|
+
// redundant.
|
|
10221
|
+
"angular-vite/docgen-server-ts",
|
|
9943
10222
|
// TODO: Add this back once we resolve the React 19 issues
|
|
9944
10223
|
// 'cra/default-js',
|
|
9945
10224
|
"react-vite/default-js",
|
|
@@ -10042,7 +10321,7 @@ var toChoices = (c) => ({ label: allTemplates[c].name, value: c }), sandbox = as
|
|
|
10042
10321
|
}
|
|
10043
10322
|
)), invariant(selectedDirectory);
|
|
10044
10323
|
try {
|
|
10045
|
-
let templateDestination =
|
|
10324
|
+
let templateDestination = isAbsolute4(selectedDirectory) ? selectedDirectory : join4(process.cwd(), selectedDirectory);
|
|
10046
10325
|
logger23.log(`\u{1F3C3} Adding ${selectedConfig.name} into ${templateDestination}`), logger23.log(`\u{1F4E6} Downloading sandbox template (${import_picocolors17.default.bold(downloadType)})...`);
|
|
10047
10326
|
try {
|
|
10048
10327
|
let gitPath = `storybookjs/sandboxes/tree/${branch}/${templateId}/${downloadType}`;
|