vite-plugin-storybook-nextjs 3.0.3--canary.ca2a5b0.0 → 3.0.3--canary.68.2eff9c3.0
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/index.cjs +455 -40
- package/dist/index.js +451 -35
- package/dist/mocks/storybook.global.cjs +117 -18
- package/dist/mocks/storybook.global.js +115 -16
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import path2, { resolve, join as join$1 } from 'path';
|
|
2
1
|
import { createRequire } from 'module';
|
|
3
2
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
4
3
|
import fs3 from 'fs';
|
|
@@ -21,7 +20,6 @@ import { getParserOptions } from 'next/dist/build/swc/options.js';
|
|
|
21
20
|
import nextServerConfig from 'next/dist/server/config.js';
|
|
22
21
|
import { PHASE_DEVELOPMENT_SERVER, PHASE_TEST, PHASE_PRODUCTION_BUILD } from 'next/dist/shared/lib/constants.js';
|
|
23
22
|
import MagicString from 'magic-string';
|
|
24
|
-
import { join, resolve as resolve$1, sep } from 'path/posix';
|
|
25
23
|
import { decode, encode } from 'querystring';
|
|
26
24
|
import { imageSize } from 'image-size';
|
|
27
25
|
|
|
@@ -502,7 +500,7 @@ var require_semver = __commonJS({
|
|
|
502
500
|
var require_parse = __commonJS({
|
|
503
501
|
"node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js"(exports, module) {
|
|
504
502
|
var SemVer = require_semver();
|
|
505
|
-
var
|
|
503
|
+
var parse2 = (version, options, throwErrors = false) => {
|
|
506
504
|
if (version instanceof SemVer) {
|
|
507
505
|
return version;
|
|
508
506
|
}
|
|
@@ -515,16 +513,16 @@ var require_parse = __commonJS({
|
|
|
515
513
|
throw er;
|
|
516
514
|
}
|
|
517
515
|
};
|
|
518
|
-
module.exports =
|
|
516
|
+
module.exports = parse2;
|
|
519
517
|
}
|
|
520
518
|
});
|
|
521
519
|
|
|
522
520
|
// node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js
|
|
523
521
|
var require_valid = __commonJS({
|
|
524
522
|
"node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js"(exports, module) {
|
|
525
|
-
var
|
|
523
|
+
var parse2 = require_parse();
|
|
526
524
|
var valid = (version, options) => {
|
|
527
|
-
const v =
|
|
525
|
+
const v = parse2(version, options);
|
|
528
526
|
return v ? v.version : null;
|
|
529
527
|
};
|
|
530
528
|
module.exports = valid;
|
|
@@ -534,9 +532,9 @@ var require_valid = __commonJS({
|
|
|
534
532
|
// node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js
|
|
535
533
|
var require_clean = __commonJS({
|
|
536
534
|
"node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js"(exports, module) {
|
|
537
|
-
var
|
|
535
|
+
var parse2 = require_parse();
|
|
538
536
|
var clean = (version, options) => {
|
|
539
|
-
const s =
|
|
537
|
+
const s = parse2(version.trim().replace(/^[=v]+/, ""), options);
|
|
540
538
|
return s ? s.version : null;
|
|
541
539
|
};
|
|
542
540
|
module.exports = clean;
|
|
@@ -569,10 +567,10 @@ var require_inc = __commonJS({
|
|
|
569
567
|
// node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js
|
|
570
568
|
var require_diff = __commonJS({
|
|
571
569
|
"node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js"(exports, module) {
|
|
572
|
-
var
|
|
570
|
+
var parse2 = require_parse();
|
|
573
571
|
var diff = (version1, version2) => {
|
|
574
|
-
const v1 =
|
|
575
|
-
const v2 =
|
|
572
|
+
const v1 = parse2(version1, null, true);
|
|
573
|
+
const v2 = parse2(version2, null, true);
|
|
576
574
|
const comparison = v1.compare(v2);
|
|
577
575
|
if (comparison === 0) {
|
|
578
576
|
return null;
|
|
@@ -639,9 +637,9 @@ var require_patch = __commonJS({
|
|
|
639
637
|
// node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js
|
|
640
638
|
var require_prerelease = __commonJS({
|
|
641
639
|
"node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
642
|
-
var
|
|
640
|
+
var parse2 = require_parse();
|
|
643
641
|
var prerelease = (version, options) => {
|
|
644
|
-
const parsed =
|
|
642
|
+
const parsed = parse2(version, options);
|
|
645
643
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
646
644
|
};
|
|
647
645
|
module.exports = prerelease;
|
|
@@ -813,7 +811,7 @@ var require_cmp = __commonJS({
|
|
|
813
811
|
var require_coerce = __commonJS({
|
|
814
812
|
"node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js"(exports, module) {
|
|
815
813
|
var SemVer = require_semver();
|
|
816
|
-
var
|
|
814
|
+
var parse2 = require_parse();
|
|
817
815
|
var { safeRe: re, t } = require_re();
|
|
818
816
|
var coerce = (version, options) => {
|
|
819
817
|
if (version instanceof SemVer) {
|
|
@@ -848,7 +846,7 @@ var require_coerce = __commonJS({
|
|
|
848
846
|
const patch = match[4] || "0";
|
|
849
847
|
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
850
848
|
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
851
|
-
return
|
|
849
|
+
return parse2(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
852
850
|
};
|
|
853
851
|
module.exports = coerce;
|
|
854
852
|
}
|
|
@@ -1849,7 +1847,7 @@ var require_semver2 = __commonJS({
|
|
|
1849
1847
|
var constants = require_constants();
|
|
1850
1848
|
var SemVer = require_semver();
|
|
1851
1849
|
var identifiers = require_identifiers();
|
|
1852
|
-
var
|
|
1850
|
+
var parse2 = require_parse();
|
|
1853
1851
|
var valid = require_valid();
|
|
1854
1852
|
var clean = require_clean();
|
|
1855
1853
|
var inc = require_inc();
|
|
@@ -1887,7 +1885,7 @@ var require_semver2 = __commonJS({
|
|
|
1887
1885
|
var simplifyRange = require_simplify();
|
|
1888
1886
|
var subset = require_subset();
|
|
1889
1887
|
module.exports = {
|
|
1890
|
-
parse,
|
|
1888
|
+
parse: parse2,
|
|
1891
1889
|
valid,
|
|
1892
1890
|
clean,
|
|
1893
1891
|
inc,
|
|
@@ -1935,6 +1933,424 @@ var require_semver2 = __commonJS({
|
|
|
1935
1933
|
};
|
|
1936
1934
|
}
|
|
1937
1935
|
});
|
|
1936
|
+
|
|
1937
|
+
// node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
1938
|
+
var _lazyMatch = () => {
|
|
1939
|
+
var __lib__ = (() => {
|
|
1940
|
+
var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
|
|
1941
|
+
for (var n in e) m(r, n, { get: e[n], enumerable: true });
|
|
1942
|
+
}, H = (r, e, n, a) => {
|
|
1943
|
+
if (e && typeof e == "object" || typeof e == "function") for (let t of G(e)) !T.call(r, t) && t !== n && m(r, t, { get: () => e[t], enumerable: !(a = V(e, t)) || a.enumerable });
|
|
1944
|
+
return r;
|
|
1945
|
+
}, J = (r) => H(m({}, "__esModule", { value: true }), r), w = {};
|
|
1946
|
+
q(w, { default: () => re });
|
|
1947
|
+
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) => {
|
|
1948
|
+
const e = /* @__PURE__ */ new Map();
|
|
1949
|
+
return (n) => {
|
|
1950
|
+
const a = e.get(n);
|
|
1951
|
+
if (a) return a;
|
|
1952
|
+
const t = r(n);
|
|
1953
|
+
return e.set(n, t), t;
|
|
1954
|
+
};
|
|
1955
|
+
}, rr = (r, e, n = {}) => {
|
|
1956
|
+
const a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
|
|
1957
|
+
if (v(e)(a) && a.index === r.length) return a.output;
|
|
1958
|
+
throw new Error(`Failed to parse at index ${a.indexMax}`);
|
|
1959
|
+
}, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
|
|
1960
|
+
const n = {};
|
|
1961
|
+
for (const a of r) {
|
|
1962
|
+
if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
|
|
1963
|
+
const t = a.charCodeAt(0);
|
|
1964
|
+
n[t] = true;
|
|
1965
|
+
}
|
|
1966
|
+
return (a) => {
|
|
1967
|
+
const t = a.index, o = a.input;
|
|
1968
|
+
for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
|
|
1969
|
+
const u = a.index;
|
|
1970
|
+
if (u > t) {
|
|
1971
|
+
if (!h(e) && !a.options.silent) {
|
|
1972
|
+
const s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
|
|
1973
|
+
h(c) || a.output.push(c);
|
|
1974
|
+
}
|
|
1975
|
+
a.indexMax = Math.max(a.indexMax, a.index);
|
|
1976
|
+
}
|
|
1977
|
+
return true;
|
|
1978
|
+
};
|
|
1979
|
+
}, nr = (r, e) => {
|
|
1980
|
+
const n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
|
|
1981
|
+
return g((o) => {
|
|
1982
|
+
t.lastIndex = o.index;
|
|
1983
|
+
const u = t.exec(o.input);
|
|
1984
|
+
if (u) {
|
|
1985
|
+
if (!h(e) && !o.options.silent) {
|
|
1986
|
+
const s = d(e) ? e(...u, o.input, String(o.index)) : e;
|
|
1987
|
+
h(s) || o.output.push(s);
|
|
1988
|
+
}
|
|
1989
|
+
return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), true;
|
|
1990
|
+
} else return false;
|
|
1991
|
+
});
|
|
1992
|
+
}, ar = (r, e) => (n) => {
|
|
1993
|
+
if (n.input.startsWith(r, n.index)) {
|
|
1994
|
+
if (!h(e) && !n.options.silent) {
|
|
1995
|
+
const t = d(e) ? e(r, n.input, String(n.index)) : e;
|
|
1996
|
+
h(t) || n.output.push(t);
|
|
1997
|
+
}
|
|
1998
|
+
return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), true;
|
|
1999
|
+
} else return false;
|
|
2000
|
+
}, C = (r, e, n, a) => {
|
|
2001
|
+
const t = v(r);
|
|
2002
|
+
return g(_(M((o) => {
|
|
2003
|
+
let u = 0;
|
|
2004
|
+
for (; u < n; ) {
|
|
2005
|
+
const s = o.index;
|
|
2006
|
+
if (!t(o) || (u += 1, o.index === s)) break;
|
|
2007
|
+
}
|
|
2008
|
+
return u >= e;
|
|
2009
|
+
})));
|
|
2010
|
+
}, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
|
|
2011
|
+
const n = r.map(v);
|
|
2012
|
+
return g(_(M((a) => {
|
|
2013
|
+
for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return false;
|
|
2014
|
+
return true;
|
|
2015
|
+
})));
|
|
2016
|
+
}, l = (r, e) => {
|
|
2017
|
+
const n = r.map(v);
|
|
2018
|
+
return g(_((a) => {
|
|
2019
|
+
for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return true;
|
|
2020
|
+
return false;
|
|
2021
|
+
}));
|
|
2022
|
+
}, M = (r, e = false) => {
|
|
2023
|
+
const n = v(r);
|
|
2024
|
+
return (a) => {
|
|
2025
|
+
const t = a.index, o = a.output.length, u = n(a);
|
|
2026
|
+
return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
|
|
2027
|
+
};
|
|
2028
|
+
}, _ = (r, e) => {
|
|
2029
|
+
const n = v(r);
|
|
2030
|
+
return n;
|
|
2031
|
+
}, g = /* @__PURE__ */ (() => {
|
|
2032
|
+
let r = 0;
|
|
2033
|
+
return (e) => {
|
|
2034
|
+
const n = v(e), a = r += 1;
|
|
2035
|
+
return (t) => {
|
|
2036
|
+
var o;
|
|
2037
|
+
if (t.options.memoization === false) return n(t);
|
|
2038
|
+
const u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
|
|
2039
|
+
if (c === false) return false;
|
|
2040
|
+
if (W(c)) return t.index = c, true;
|
|
2041
|
+
if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), true;
|
|
2042
|
+
{
|
|
2043
|
+
const Z = t.output.length;
|
|
2044
|
+
if (n(t)) {
|
|
2045
|
+
const D = t.index, U = t.output.length;
|
|
2046
|
+
if (U > Z) {
|
|
2047
|
+
const ee = t.output.slice(Z, U);
|
|
2048
|
+
s.set(u, { index: D, output: ee });
|
|
2049
|
+
} else s.set(u, D);
|
|
2050
|
+
return true;
|
|
2051
|
+
} else return s.set(u, false), false;
|
|
2052
|
+
}
|
|
2053
|
+
};
|
|
2054
|
+
};
|
|
2055
|
+
})(), E = (r) => {
|
|
2056
|
+
let e;
|
|
2057
|
+
return (n) => (e || (e = v(r())), e(n));
|
|
2058
|
+
}, v = Y((r) => {
|
|
2059
|
+
if (d(r)) return Q(r) ? E(r) : r;
|
|
2060
|
+
if (b(r) || X(r)) return i(r);
|
|
2061
|
+
if (A(r)) return x(r);
|
|
2062
|
+
if (K(r)) return l(Object.values(r));
|
|
2063
|
+
throw new Error("Invalid rule");
|
|
2064
|
+
}), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
|
|
2065
|
+
let e = "";
|
|
2066
|
+
for (; r > 0; ) {
|
|
2067
|
+
const n = (r - 1) % 26;
|
|
2068
|
+
e = P[n] + e, r = Math.floor((r - 1) / 26);
|
|
2069
|
+
}
|
|
2070
|
+
return e;
|
|
2071
|
+
}, O = (r) => {
|
|
2072
|
+
let e = 0;
|
|
2073
|
+
for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
|
|
2074
|
+
return e;
|
|
2075
|
+
}, S = (r, e) => {
|
|
2076
|
+
if (e < r) return S(e, r);
|
|
2077
|
+
const n = [];
|
|
2078
|
+
for (; r <= e; ) n.push(r++);
|
|
2079
|
+
return n;
|
|
2080
|
+
}, 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: false }).join("")), ur = (r) => {
|
|
2081
|
+
const e = {};
|
|
2082
|
+
return (n) => e[n] ?? (e[n] = r(n));
|
|
2083
|
+
}, 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) => {
|
|
2084
|
+
const n = Array.isArray(r) ? r : [r];
|
|
2085
|
+
if (!n.length) return false;
|
|
2086
|
+
const a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
|
|
2087
|
+
return a.some((s) => s.test(o));
|
|
2088
|
+
};
|
|
2089
|
+
$.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
|
|
2090
|
+
var re = $;
|
|
2091
|
+
return J(w);
|
|
2092
|
+
})();
|
|
2093
|
+
return __lib__.default || __lib__;
|
|
2094
|
+
};
|
|
2095
|
+
var _match;
|
|
2096
|
+
var zeptomatch = (path, pattern) => {
|
|
2097
|
+
if (!_match) {
|
|
2098
|
+
_match = _lazyMatch();
|
|
2099
|
+
_lazyMatch = null;
|
|
2100
|
+
}
|
|
2101
|
+
return _match(path, pattern);
|
|
2102
|
+
};
|
|
2103
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
2104
|
+
function normalizeWindowsPath(input = "") {
|
|
2105
|
+
if (!input) {
|
|
2106
|
+
return input;
|
|
2107
|
+
}
|
|
2108
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
2109
|
+
}
|
|
2110
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
2111
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
2112
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
2113
|
+
var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
2114
|
+
var _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
2115
|
+
var _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
2116
|
+
var sep = "/";
|
|
2117
|
+
var normalize = function(path) {
|
|
2118
|
+
if (path.length === 0) {
|
|
2119
|
+
return ".";
|
|
2120
|
+
}
|
|
2121
|
+
path = normalizeWindowsPath(path);
|
|
2122
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
2123
|
+
const isPathAbsolute = isAbsolute(path);
|
|
2124
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
2125
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
2126
|
+
if (path.length === 0) {
|
|
2127
|
+
if (isPathAbsolute) {
|
|
2128
|
+
return "/";
|
|
2129
|
+
}
|
|
2130
|
+
return trailingSeparator ? "./" : ".";
|
|
2131
|
+
}
|
|
2132
|
+
if (trailingSeparator) {
|
|
2133
|
+
path += "/";
|
|
2134
|
+
}
|
|
2135
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
2136
|
+
path += "/";
|
|
2137
|
+
}
|
|
2138
|
+
if (isUNCPath) {
|
|
2139
|
+
if (!isPathAbsolute) {
|
|
2140
|
+
return `//./${path}`;
|
|
2141
|
+
}
|
|
2142
|
+
return `//${path}`;
|
|
2143
|
+
}
|
|
2144
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
2145
|
+
};
|
|
2146
|
+
var join = function(...segments) {
|
|
2147
|
+
let path = "";
|
|
2148
|
+
for (const seg of segments) {
|
|
2149
|
+
if (!seg) {
|
|
2150
|
+
continue;
|
|
2151
|
+
}
|
|
2152
|
+
if (path.length > 0) {
|
|
2153
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
2154
|
+
const segLeading = seg[0] === "/";
|
|
2155
|
+
const both = pathTrailing && segLeading;
|
|
2156
|
+
if (both) {
|
|
2157
|
+
path += seg.slice(1);
|
|
2158
|
+
} else {
|
|
2159
|
+
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
2160
|
+
}
|
|
2161
|
+
} else {
|
|
2162
|
+
path += seg;
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
return normalize(path);
|
|
2166
|
+
};
|
|
2167
|
+
function cwd() {
|
|
2168
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
2169
|
+
return process.cwd().replace(/\\/g, "/");
|
|
2170
|
+
}
|
|
2171
|
+
return "/";
|
|
2172
|
+
}
|
|
2173
|
+
var resolve = function(...arguments_) {
|
|
2174
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
2175
|
+
let resolvedPath = "";
|
|
2176
|
+
let resolvedAbsolute = false;
|
|
2177
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
2178
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
2179
|
+
if (!path || path.length === 0) {
|
|
2180
|
+
continue;
|
|
2181
|
+
}
|
|
2182
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
2183
|
+
resolvedAbsolute = isAbsolute(path);
|
|
2184
|
+
}
|
|
2185
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
2186
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
2187
|
+
return `/${resolvedPath}`;
|
|
2188
|
+
}
|
|
2189
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
2190
|
+
};
|
|
2191
|
+
function normalizeString(path, allowAboveRoot) {
|
|
2192
|
+
let res = "";
|
|
2193
|
+
let lastSegmentLength = 0;
|
|
2194
|
+
let lastSlash = -1;
|
|
2195
|
+
let dots = 0;
|
|
2196
|
+
let char = null;
|
|
2197
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
2198
|
+
if (index < path.length) {
|
|
2199
|
+
char = path[index];
|
|
2200
|
+
} else if (char === "/") {
|
|
2201
|
+
break;
|
|
2202
|
+
} else {
|
|
2203
|
+
char = "/";
|
|
2204
|
+
}
|
|
2205
|
+
if (char === "/") {
|
|
2206
|
+
if (lastSlash === index - 1 || dots === 1) ;
|
|
2207
|
+
else if (dots === 2) {
|
|
2208
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
2209
|
+
if (res.length > 2) {
|
|
2210
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
2211
|
+
if (lastSlashIndex === -1) {
|
|
2212
|
+
res = "";
|
|
2213
|
+
lastSegmentLength = 0;
|
|
2214
|
+
} else {
|
|
2215
|
+
res = res.slice(0, lastSlashIndex);
|
|
2216
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
2217
|
+
}
|
|
2218
|
+
lastSlash = index;
|
|
2219
|
+
dots = 0;
|
|
2220
|
+
continue;
|
|
2221
|
+
} else if (res.length > 0) {
|
|
2222
|
+
res = "";
|
|
2223
|
+
lastSegmentLength = 0;
|
|
2224
|
+
lastSlash = index;
|
|
2225
|
+
dots = 0;
|
|
2226
|
+
continue;
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
if (allowAboveRoot) {
|
|
2230
|
+
res += res.length > 0 ? "/.." : "..";
|
|
2231
|
+
lastSegmentLength = 2;
|
|
2232
|
+
}
|
|
2233
|
+
} else {
|
|
2234
|
+
if (res.length > 0) {
|
|
2235
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
2236
|
+
} else {
|
|
2237
|
+
res = path.slice(lastSlash + 1, index);
|
|
2238
|
+
}
|
|
2239
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
2240
|
+
}
|
|
2241
|
+
lastSlash = index;
|
|
2242
|
+
dots = 0;
|
|
2243
|
+
} else if (char === "." && dots !== -1) {
|
|
2244
|
+
++dots;
|
|
2245
|
+
} else {
|
|
2246
|
+
dots = -1;
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
return res;
|
|
2250
|
+
}
|
|
2251
|
+
var isAbsolute = function(p) {
|
|
2252
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
2253
|
+
};
|
|
2254
|
+
var toNamespacedPath = function(p) {
|
|
2255
|
+
return normalizeWindowsPath(p);
|
|
2256
|
+
};
|
|
2257
|
+
var extname = function(p) {
|
|
2258
|
+
if (p === "..") return "";
|
|
2259
|
+
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
2260
|
+
return match && match[1] || "";
|
|
2261
|
+
};
|
|
2262
|
+
var relative = function(from, to) {
|
|
2263
|
+
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
2264
|
+
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
2265
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
|
2266
|
+
return _to.join("/");
|
|
2267
|
+
}
|
|
2268
|
+
const _fromCopy = [..._from];
|
|
2269
|
+
for (const segment of _fromCopy) {
|
|
2270
|
+
if (_to[0] !== segment) {
|
|
2271
|
+
break;
|
|
2272
|
+
}
|
|
2273
|
+
_from.shift();
|
|
2274
|
+
_to.shift();
|
|
2275
|
+
}
|
|
2276
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
2277
|
+
};
|
|
2278
|
+
var dirname = function(p) {
|
|
2279
|
+
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
2280
|
+
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
|
|
2281
|
+
segments[0] += "/";
|
|
2282
|
+
}
|
|
2283
|
+
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
2284
|
+
};
|
|
2285
|
+
var format = function(p) {
|
|
2286
|
+
const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
|
|
2287
|
+
const segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
|
|
2288
|
+
Boolean
|
|
2289
|
+
);
|
|
2290
|
+
return normalizeWindowsPath(
|
|
2291
|
+
p.root ? resolve(...segments) : segments.join("/")
|
|
2292
|
+
);
|
|
2293
|
+
};
|
|
2294
|
+
var basename = function(p, extension) {
|
|
2295
|
+
const segments = normalizeWindowsPath(p).split("/");
|
|
2296
|
+
let lastSegment = "";
|
|
2297
|
+
for (let i = segments.length - 1; i >= 0; i--) {
|
|
2298
|
+
const val = segments[i];
|
|
2299
|
+
if (val) {
|
|
2300
|
+
lastSegment = val;
|
|
2301
|
+
break;
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
2305
|
+
};
|
|
2306
|
+
var parse = function(p) {
|
|
2307
|
+
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
|
|
2308
|
+
const base = basename(p);
|
|
2309
|
+
const extension = extname(base);
|
|
2310
|
+
return {
|
|
2311
|
+
root,
|
|
2312
|
+
dir: dirname(p),
|
|
2313
|
+
base,
|
|
2314
|
+
ext: extension,
|
|
2315
|
+
name: base.slice(0, base.length - extension.length)
|
|
2316
|
+
};
|
|
2317
|
+
};
|
|
2318
|
+
var matchesGlob = (path, pattern) => {
|
|
2319
|
+
return zeptomatch(pattern, normalize(path));
|
|
2320
|
+
};
|
|
2321
|
+
var _path = {
|
|
2322
|
+
__proto__: null,
|
|
2323
|
+
basename,
|
|
2324
|
+
dirname,
|
|
2325
|
+
extname,
|
|
2326
|
+
format,
|
|
2327
|
+
isAbsolute,
|
|
2328
|
+
join,
|
|
2329
|
+
matchesGlob,
|
|
2330
|
+
normalize,
|
|
2331
|
+
normalizeString,
|
|
2332
|
+
parse,
|
|
2333
|
+
relative,
|
|
2334
|
+
resolve,
|
|
2335
|
+
sep,
|
|
2336
|
+
toNamespacedPath
|
|
2337
|
+
};
|
|
2338
|
+
|
|
2339
|
+
// node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
|
|
2340
|
+
var delimiter = /* @__PURE__ */ (() => globalThis.process?.platform === "win32" ? ";" : ":")();
|
|
2341
|
+
var _platforms = { posix: void 0, win32: void 0 };
|
|
2342
|
+
var mix = (del = delimiter) => {
|
|
2343
|
+
return new Proxy(_path, {
|
|
2344
|
+
get(_, prop) {
|
|
2345
|
+
if (prop === "delimiter") return del;
|
|
2346
|
+
if (prop === "posix") return posix;
|
|
2347
|
+
if (prop === "win32") return win32;
|
|
2348
|
+
return _platforms[prop] || _path[prop];
|
|
2349
|
+
}
|
|
2350
|
+
});
|
|
2351
|
+
};
|
|
2352
|
+
var posix = /* @__PURE__ */ mix(":");
|
|
2353
|
+
var win32 = /* @__PURE__ */ mix(";");
|
|
1938
2354
|
var nextDistPath = /(next[\\/]dist[\\/]shared[\\/]lib)|(next[\\/]dist[\\/]client)|(next[\\/]dist[\\/]pages)/;
|
|
1939
2355
|
var { loadEnvConfig } = nextEnv.default || nextEnv;
|
|
1940
2356
|
async function loadEnvironmentConfig(dir, dev) {
|
|
@@ -1956,7 +2372,7 @@ async function loadClosestPackageJson(dir, attempts = 1) {
|
|
|
1956
2372
|
const mainPath = attempts === 1 ? ["."] : new Array(attempts).fill("..");
|
|
1957
2373
|
try {
|
|
1958
2374
|
const file = await fs3.promises.readFile(
|
|
1959
|
-
join
|
|
2375
|
+
join(dir, ...mainPath, "package.json"),
|
|
1960
2376
|
"utf8"
|
|
1961
2377
|
);
|
|
1962
2378
|
return JSON.parse(file);
|
|
@@ -1969,8 +2385,8 @@ function findNextDirectories(dir) {
|
|
|
1969
2385
|
return findPagesDir(dir);
|
|
1970
2386
|
} catch (e) {
|
|
1971
2387
|
return {
|
|
1972
|
-
appDir:
|
|
1973
|
-
pagesDir:
|
|
2388
|
+
appDir: posix.join(dir, "app"),
|
|
2389
|
+
pagesDir: posix.join(dir, "pages")
|
|
1974
2390
|
};
|
|
1975
2391
|
}
|
|
1976
2392
|
}
|
|
@@ -2226,7 +2642,7 @@ function vitePluginNextFont() {
|
|
|
2226
2642
|
return config;
|
|
2227
2643
|
},
|
|
2228
2644
|
async resolveId(source, importer) {
|
|
2229
|
-
const
|
|
2645
|
+
const cwd2 = process.cwd();
|
|
2230
2646
|
if (!includePattern.test(source) || !importer) {
|
|
2231
2647
|
return null;
|
|
2232
2648
|
}
|
|
@@ -2242,7 +2658,7 @@ function vitePluginNextFont() {
|
|
|
2242
2658
|
return null;
|
|
2243
2659
|
}
|
|
2244
2660
|
let fontFaceDeclaration;
|
|
2245
|
-
const pathSep =
|
|
2661
|
+
const pathSep = posix.sep;
|
|
2246
2662
|
if (sourceWithoutQuery.endsWith(
|
|
2247
2663
|
["next", "font", "google", "target.css"].join(pathSep)
|
|
2248
2664
|
)) {
|
|
@@ -2251,17 +2667,17 @@ function vitePluginNextFont() {
|
|
|
2251
2667
|
if (sourceWithoutQuery.endsWith(
|
|
2252
2668
|
["next", "font", "local", "target.css"].join(pathSep)
|
|
2253
2669
|
)) {
|
|
2254
|
-
const importerDirPath =
|
|
2670
|
+
const importerDirPath = posix.dirname(fontOptions.filename);
|
|
2255
2671
|
const emitFont = async (importerRelativeFontPath) => {
|
|
2256
|
-
const fontExtension =
|
|
2257
|
-
const fontBaseName =
|
|
2672
|
+
const fontExtension = posix.extname(importerRelativeFontPath);
|
|
2673
|
+
const fontBaseName = posix.basename(
|
|
2258
2674
|
importerRelativeFontPath,
|
|
2259
2675
|
fontExtension
|
|
2260
2676
|
);
|
|
2261
|
-
const fontPath =
|
|
2677
|
+
const fontPath = posix.join(importerDirPath, importerRelativeFontPath);
|
|
2262
2678
|
if (devMode) {
|
|
2263
2679
|
return {
|
|
2264
|
-
fontPath:
|
|
2680
|
+
fontPath: posix.join(cwd2, fontPath),
|
|
2265
2681
|
fontReferenceId: void 0
|
|
2266
2682
|
};
|
|
2267
2683
|
}
|
|
@@ -2508,7 +2924,7 @@ var getVitestSWCTransformConfig = ({
|
|
|
2508
2924
|
swcPlugins: nextConfig.experimental.swcPlugins,
|
|
2509
2925
|
compiler: nextConfig?.compiler,
|
|
2510
2926
|
esm: isEsmProject,
|
|
2511
|
-
swcCacheDir:
|
|
2927
|
+
swcCacheDir: posix.join(
|
|
2512
2928
|
rootDir,
|
|
2513
2929
|
nextConfig.distDir ?? ".next",
|
|
2514
2930
|
"cache",
|
|
@@ -2521,7 +2937,7 @@ var getVitestSWCTransformConfig = ({
|
|
|
2521
2937
|
...baseOptions,
|
|
2522
2938
|
fontLoaders: {
|
|
2523
2939
|
fontLoaders: ["next/font/local", "next/font/google"],
|
|
2524
|
-
relativeFilePathFromRoot:
|
|
2940
|
+
relativeFilePathFromRoot: posix.relative(rootDir, filename)
|
|
2525
2941
|
},
|
|
2526
2942
|
cjsRequireOptimizer: {
|
|
2527
2943
|
packages: {
|
|
@@ -2639,13 +3055,13 @@ function vitePluginNextSwc(rootDir, nextConfigResolver) {
|
|
|
2639
3055
|
// src/polyfills/promise-with-resolvers.ts
|
|
2640
3056
|
if (typeof Promise.withResolvers === "undefined") {
|
|
2641
3057
|
Promise.withResolvers = () => {
|
|
2642
|
-
let
|
|
3058
|
+
let resolve2;
|
|
2643
3059
|
let reject;
|
|
2644
3060
|
const promise = new Promise((res, rej) => {
|
|
2645
|
-
|
|
3061
|
+
resolve2 = res;
|
|
2646
3062
|
reject = rej;
|
|
2647
3063
|
});
|
|
2648
|
-
return { promise, resolve:
|
|
3064
|
+
return { promise, resolve: resolve2, reject };
|
|
2649
3065
|
};
|
|
2650
3066
|
}
|
|
2651
3067
|
var vitePluginNextDynamic = () => ({
|
|
@@ -2680,7 +3096,7 @@ var getNextjsVersion = () => require3(scopedResolve("next/package.json")).versio
|
|
|
2680
3096
|
var scopedResolve = (id) => {
|
|
2681
3097
|
let scopedModulePath;
|
|
2682
3098
|
try {
|
|
2683
|
-
scopedModulePath = require3.resolve(id, { paths: [resolve
|
|
3099
|
+
scopedModulePath = require3.resolve(id, { paths: [resolve()] });
|
|
2684
3100
|
} catch (e) {
|
|
2685
3101
|
scopedModulePath = require3.resolve(id);
|
|
2686
3102
|
}
|
|
@@ -2735,8 +3151,8 @@ function vitePluginNextImage(nextConfigResolver) {
|
|
|
2735
3151
|
return null;
|
|
2736
3152
|
}
|
|
2737
3153
|
if (includePattern2.test(source) && !excludeImporterPattern.test(importer ?? "") && !importer?.startsWith(virtualImage)) {
|
|
2738
|
-
const
|
|
2739
|
-
const imagePath = importer ?
|
|
3154
|
+
const isAbsolute2 = posix.isAbsolute(id);
|
|
3155
|
+
const imagePath = importer ? isAbsolute2 ? source : posix.join(posix.dirname(importer), source) : source;
|
|
2740
3156
|
return `${virtualImage}?${encode({ imagePath })}`;
|
|
2741
3157
|
}
|
|
2742
3158
|
if (id === "next/image" && importer !== virtualNextImage) {
|