@storybook/react 10.6.0-alpha.5 → 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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h2cb86pu2u from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h2cb86pu2u from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h2cb86pu2u from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h2cb86pu2u.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h2cb86pu2u.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h2cb86pu2u.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -610,8 +610,8 @@ var require_common = __commonJS({
|
|
|
610
610
|
"use strict";
|
|
611
611
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
612
612
|
exports.resolveFileLanguageId = resolveFileLanguageId2;
|
|
613
|
-
function resolveFileLanguageId2(
|
|
614
|
-
switch (
|
|
613
|
+
function resolveFileLanguageId2(path2) {
|
|
614
|
+
switch (path2.split(".").pop()) {
|
|
615
615
|
case "js":
|
|
616
616
|
return "javascript";
|
|
617
617
|
case "cjs":
|
|
@@ -756,11 +756,11 @@ var require_decorateLanguageServiceHost = __commonJS({
|
|
|
756
756
|
var resolveModuleName_1 = require_resolveModuleName(), utils_1 = require_utils2();
|
|
757
757
|
function decorateLanguageServiceHost(ts, language, languageServiceHost) {
|
|
758
758
|
let pluginExtensions = language.plugins.map((plugin) => plugin.typescript?.extraFileExtensions.map((ext) => "." + ext.extension) ?? []).flat(), scripts = /* @__PURE__ */ new Map(), crashFileNames = /* @__PURE__ */ new Set(), readDirectory = languageServiceHost.readDirectory?.bind(languageServiceHost), resolveModuleNameLiterals = languageServiceHost.resolveModuleNameLiterals?.bind(languageServiceHost), resolveModuleNames = languageServiceHost.resolveModuleNames?.bind(languageServiceHost), getScriptSnapshot = languageServiceHost.getScriptSnapshot.bind(languageServiceHost), getScriptKind = languageServiceHost.getScriptKind?.bind(languageServiceHost);
|
|
759
|
-
if (readDirectory && (languageServiceHost.readDirectory = (
|
|
759
|
+
if (readDirectory && (languageServiceHost.readDirectory = (path2, extensions, exclude, include, depth) => {
|
|
760
760
|
if (extensions)
|
|
761
761
|
for (let ext of pluginExtensions)
|
|
762
762
|
extensions.includes(ext) || (extensions = [...extensions, ext]);
|
|
763
|
-
return readDirectory(
|
|
763
|
+
return readDirectory(path2, extensions, exclude, include, depth);
|
|
764
764
|
}), pluginExtensions.length) {
|
|
765
765
|
let resolveModuleName = (0, resolveModuleName_1.createResolveModuleName)(ts, ts.sys.getFileSize, languageServiceHost, language.plugins, (fileName) => language.scripts.get(fileName)), moduleResolutionCache = languageServiceHost.getModuleResolutionCache?.();
|
|
766
766
|
resolveModuleNameLiterals && (languageServiceHost.resolveModuleNameLiterals = (moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, ...rest) => {
|
|
@@ -1062,8 +1062,8 @@ var require_decorateProgram = __commonJS({
|
|
|
1062
1062
|
return getBindAndCheckDiagnostics(actualSourceFile, cancellationToken).map((d) => (0, transform_1.transformDiagnostic)(language, d, program, !0)).filter((d) => !!d).filter((d) => !serviceScript || language.scripts.get(d.file.fileName) === sourceScript);
|
|
1063
1063
|
} else
|
|
1064
1064
|
return getBindAndCheckDiagnostics(void 0, cancellationToken).map((d) => (0, transform_1.transformDiagnostic)(language, d, program, !0)).filter((d) => !!d);
|
|
1065
|
-
}, program.getSourceFileByPath = (
|
|
1066
|
-
let sourceFile = getSourceFileByPath(
|
|
1065
|
+
}, program.getSourceFileByPath = (path2) => {
|
|
1066
|
+
let sourceFile = getSourceFileByPath(path2);
|
|
1067
1067
|
return sourceFile && (0, transform_1.fillSourceFileText)(language, sourceFile), sourceFile;
|
|
1068
1068
|
};
|
|
1069
1069
|
}
|
|
@@ -1832,14 +1832,14 @@ var require_proxyLanguageService = __commonJS({
|
|
|
1832
1832
|
var require_path_browserify = __commonJS({
|
|
1833
1833
|
"../../../node_modules/path-browserify/index.js"(exports, module) {
|
|
1834
1834
|
"use strict";
|
|
1835
|
-
function assertPath(
|
|
1836
|
-
if (typeof
|
|
1837
|
-
throw new TypeError("Path must be a string. Received " + JSON.stringify(
|
|
1838
|
-
}
|
|
1839
|
-
function normalizeStringPosix(
|
|
1840
|
-
for (var res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, code, i2 = 0; i2 <=
|
|
1841
|
-
if (i2 <
|
|
1842
|
-
code =
|
|
1835
|
+
function assertPath(path2) {
|
|
1836
|
+
if (typeof path2 != "string")
|
|
1837
|
+
throw new TypeError("Path must be a string. Received " + JSON.stringify(path2));
|
|
1838
|
+
}
|
|
1839
|
+
function normalizeStringPosix(path2, allowAboveRoot) {
|
|
1840
|
+
for (var res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, code, i2 = 0; i2 <= path2.length; ++i2) {
|
|
1841
|
+
if (i2 < path2.length)
|
|
1842
|
+
code = path2.charCodeAt(i2);
|
|
1843
1843
|
else {
|
|
1844
1844
|
if (code === 47)
|
|
1845
1845
|
break;
|
|
@@ -1862,7 +1862,7 @@ var require_path_browserify = __commonJS({
|
|
|
1862
1862
|
}
|
|
1863
1863
|
allowAboveRoot && (res.length > 0 ? res += "/.." : res = "..", lastSegmentLength = 2);
|
|
1864
1864
|
} else
|
|
1865
|
-
res.length > 0 ? res += "/" +
|
|
1865
|
+
res.length > 0 ? res += "/" + path2.slice(lastSlash + 1, i2) : res = path2.slice(lastSlash + 1, i2), lastSegmentLength = i2 - lastSlash - 1;
|
|
1866
1866
|
lastSlash = i2, dots = 0;
|
|
1867
1867
|
} else code === 46 && dots !== -1 ? ++dots : dots = -1;
|
|
1868
1868
|
}
|
|
@@ -1872,22 +1872,22 @@ var require_path_browserify = __commonJS({
|
|
|
1872
1872
|
var dir = pathObject.dir || pathObject.root, base2 = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
|
|
1873
1873
|
return dir ? dir === pathObject.root ? dir + base2 : dir + sep3 + base2 : base2;
|
|
1874
1874
|
}
|
|
1875
|
-
var
|
|
1875
|
+
var posix2 = {
|
|
1876
1876
|
// path.resolve([from ...], to)
|
|
1877
1877
|
resolve: function() {
|
|
1878
1878
|
for (var resolvedPath = "", resolvedAbsolute = !1, cwd2, i2 = arguments.length - 1; i2 >= -1 && !resolvedAbsolute; i2--) {
|
|
1879
|
-
var
|
|
1880
|
-
i2 >= 0 ?
|
|
1879
|
+
var path2;
|
|
1880
|
+
i2 >= 0 ? path2 = arguments[i2] : (cwd2 === void 0 && (cwd2 = process.cwd()), path2 = cwd2), assertPath(path2), path2.length !== 0 && (resolvedPath = path2 + "/" + resolvedPath, resolvedAbsolute = path2.charCodeAt(0) === 47);
|
|
1881
1881
|
}
|
|
1882
1882
|
return resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute), resolvedAbsolute ? resolvedPath.length > 0 ? "/" + resolvedPath : "/" : resolvedPath.length > 0 ? resolvedPath : ".";
|
|
1883
1883
|
},
|
|
1884
|
-
normalize: function(
|
|
1885
|
-
if (assertPath(
|
|
1886
|
-
var isAbsolute3 =
|
|
1887
|
-
return
|
|
1884
|
+
normalize: function(path2) {
|
|
1885
|
+
if (assertPath(path2), path2.length === 0) return ".";
|
|
1886
|
+
var isAbsolute3 = path2.charCodeAt(0) === 47, trailingSeparator = path2.charCodeAt(path2.length - 1) === 47;
|
|
1887
|
+
return path2 = normalizeStringPosix(path2, !isAbsolute3), path2.length === 0 && !isAbsolute3 && (path2 = "."), path2.length > 0 && trailingSeparator && (path2 += "/"), isAbsolute3 ? "/" + path2 : path2;
|
|
1888
1888
|
},
|
|
1889
|
-
isAbsolute: function(
|
|
1890
|
-
return assertPath(
|
|
1889
|
+
isAbsolute: function(path2) {
|
|
1890
|
+
return assertPath(path2), path2.length > 0 && path2.charCodeAt(0) === 47;
|
|
1891
1891
|
},
|
|
1892
1892
|
join: function() {
|
|
1893
1893
|
if (arguments.length === 0)
|
|
@@ -1896,10 +1896,10 @@ var require_path_browserify = __commonJS({
|
|
|
1896
1896
|
var arg = arguments[i2];
|
|
1897
1897
|
assertPath(arg), arg.length > 0 && (joined === void 0 ? joined = arg : joined += "/" + arg);
|
|
1898
1898
|
}
|
|
1899
|
-
return joined === void 0 ? "." :
|
|
1899
|
+
return joined === void 0 ? "." : posix2.normalize(joined);
|
|
1900
1900
|
},
|
|
1901
1901
|
relative: function(from, to) {
|
|
1902
|
-
if (assertPath(from), assertPath(to), from === to || (from =
|
|
1902
|
+
if (assertPath(from), assertPath(to), from === to || (from = posix2.resolve(from), to = posix2.resolve(to), from === to)) return "";
|
|
1903
1903
|
for (var fromStart = 1; fromStart < from.length && from.charCodeAt(fromStart) === 47; ++fromStart)
|
|
1904
1904
|
;
|
|
1905
1905
|
for (var fromEnd = from.length, fromLen = fromEnd - fromStart, toStart = 1; toStart < to.length && to.charCodeAt(toStart) === 47; ++toStart)
|
|
@@ -1924,30 +1924,30 @@ var require_path_browserify = __commonJS({
|
|
|
1924
1924
|
(i2 === fromEnd || from.charCodeAt(i2) === 47) && (out.length === 0 ? out += ".." : out += "/..");
|
|
1925
1925
|
return out.length > 0 ? out + to.slice(toStart + lastCommonSep) : (toStart += lastCommonSep, to.charCodeAt(toStart) === 47 && ++toStart, to.slice(toStart));
|
|
1926
1926
|
},
|
|
1927
|
-
_makeLong: function(
|
|
1928
|
-
return
|
|
1927
|
+
_makeLong: function(path2) {
|
|
1928
|
+
return path2;
|
|
1929
1929
|
},
|
|
1930
|
-
dirname: function(
|
|
1931
|
-
if (assertPath(
|
|
1932
|
-
for (var code =
|
|
1933
|
-
if (code =
|
|
1930
|
+
dirname: function(path2) {
|
|
1931
|
+
if (assertPath(path2), path2.length === 0) return ".";
|
|
1932
|
+
for (var code = path2.charCodeAt(0), hasRoot = code === 47, end = -1, matchedSlash = !0, i2 = path2.length - 1; i2 >= 1; --i2)
|
|
1933
|
+
if (code = path2.charCodeAt(i2), code === 47) {
|
|
1934
1934
|
if (!matchedSlash) {
|
|
1935
1935
|
end = i2;
|
|
1936
1936
|
break;
|
|
1937
1937
|
}
|
|
1938
1938
|
} else
|
|
1939
1939
|
matchedSlash = !1;
|
|
1940
|
-
return end === -1 ? hasRoot ? "/" : "." : hasRoot && end === 1 ? "//" :
|
|
1940
|
+
return end === -1 ? hasRoot ? "/" : "." : hasRoot && end === 1 ? "//" : path2.slice(0, end);
|
|
1941
1941
|
},
|
|
1942
|
-
basename: function(
|
|
1942
|
+
basename: function(path2, ext) {
|
|
1943
1943
|
if (ext !== void 0 && typeof ext != "string") throw new TypeError('"ext" argument must be a string');
|
|
1944
|
-
assertPath(
|
|
1944
|
+
assertPath(path2);
|
|
1945
1945
|
var start = 0, end = -1, matchedSlash = !0, i2;
|
|
1946
|
-
if (ext !== void 0 && ext.length > 0 && ext.length <=
|
|
1947
|
-
if (ext.length ===
|
|
1946
|
+
if (ext !== void 0 && ext.length > 0 && ext.length <= path2.length) {
|
|
1947
|
+
if (ext.length === path2.length && ext === path2) return "";
|
|
1948
1948
|
var extIdx = ext.length - 1, firstNonSlashEnd = -1;
|
|
1949
|
-
for (i2 =
|
|
1950
|
-
var code =
|
|
1949
|
+
for (i2 = path2.length - 1; i2 >= 0; --i2) {
|
|
1950
|
+
var code = path2.charCodeAt(i2);
|
|
1951
1951
|
if (code === 47) {
|
|
1952
1952
|
if (!matchedSlash) {
|
|
1953
1953
|
start = i2 + 1;
|
|
@@ -1956,22 +1956,22 @@ var require_path_browserify = __commonJS({
|
|
|
1956
1956
|
} else
|
|
1957
1957
|
firstNonSlashEnd === -1 && (matchedSlash = !1, firstNonSlashEnd = i2 + 1), extIdx >= 0 && (code === ext.charCodeAt(extIdx) ? --extIdx === -1 && (end = i2) : (extIdx = -1, end = firstNonSlashEnd));
|
|
1958
1958
|
}
|
|
1959
|
-
return start === end ? end = firstNonSlashEnd : end === -1 && (end =
|
|
1959
|
+
return start === end ? end = firstNonSlashEnd : end === -1 && (end = path2.length), path2.slice(start, end);
|
|
1960
1960
|
} else {
|
|
1961
|
-
for (i2 =
|
|
1962
|
-
if (
|
|
1961
|
+
for (i2 = path2.length - 1; i2 >= 0; --i2)
|
|
1962
|
+
if (path2.charCodeAt(i2) === 47) {
|
|
1963
1963
|
if (!matchedSlash) {
|
|
1964
1964
|
start = i2 + 1;
|
|
1965
1965
|
break;
|
|
1966
1966
|
}
|
|
1967
1967
|
} else end === -1 && (matchedSlash = !1, end = i2 + 1);
|
|
1968
|
-
return end === -1 ? "" :
|
|
1968
|
+
return end === -1 ? "" : path2.slice(start, end);
|
|
1969
1969
|
}
|
|
1970
1970
|
},
|
|
1971
|
-
extname: function(
|
|
1972
|
-
assertPath(
|
|
1973
|
-
for (var startDot = -1, startPart = 0, end = -1, matchedSlash = !0, preDotState = 0, i2 =
|
|
1974
|
-
var code =
|
|
1971
|
+
extname: function(path2) {
|
|
1972
|
+
assertPath(path2);
|
|
1973
|
+
for (var startDot = -1, startPart = 0, end = -1, matchedSlash = !0, preDotState = 0, i2 = path2.length - 1; i2 >= 0; --i2) {
|
|
1974
|
+
var code = path2.charCodeAt(i2);
|
|
1975
1975
|
if (code === 47) {
|
|
1976
1976
|
if (!matchedSlash) {
|
|
1977
1977
|
startPart = i2 + 1;
|
|
@@ -1983,21 +1983,21 @@ var require_path_browserify = __commonJS({
|
|
|
1983
1983
|
}
|
|
1984
1984
|
return startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
|
|
1985
1985
|
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
1986
|
-
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1 ? "" :
|
|
1986
|
+
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1 ? "" : path2.slice(startDot, end);
|
|
1987
1987
|
},
|
|
1988
1988
|
format: function(pathObject) {
|
|
1989
1989
|
if (pathObject === null || typeof pathObject != "object")
|
|
1990
1990
|
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
|
|
1991
1991
|
return _format("/", pathObject);
|
|
1992
1992
|
},
|
|
1993
|
-
parse: function(
|
|
1994
|
-
assertPath(
|
|
1993
|
+
parse: function(path2) {
|
|
1994
|
+
assertPath(path2);
|
|
1995
1995
|
var ret = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
1996
|
-
if (
|
|
1997
|
-
var code =
|
|
1996
|
+
if (path2.length === 0) return ret;
|
|
1997
|
+
var code = path2.charCodeAt(0), isAbsolute3 = code === 47, start;
|
|
1998
1998
|
isAbsolute3 ? (ret.root = "/", start = 1) : start = 0;
|
|
1999
|
-
for (var startDot = -1, startPart = 0, end = -1, matchedSlash = !0, i2 =
|
|
2000
|
-
if (code =
|
|
1999
|
+
for (var startDot = -1, startPart = 0, end = -1, matchedSlash = !0, i2 = path2.length - 1, preDotState = 0; i2 >= start; --i2) {
|
|
2000
|
+
if (code = path2.charCodeAt(i2), code === 47) {
|
|
2001
2001
|
if (!matchedSlash) {
|
|
2002
2002
|
startPart = i2 + 1;
|
|
2003
2003
|
break;
|
|
@@ -2008,15 +2008,15 @@ var require_path_browserify = __commonJS({
|
|
|
2008
2008
|
}
|
|
2009
2009
|
return startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
|
|
2010
2010
|
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
2011
|
-
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1 ? end !== -1 && (startPart === 0 && isAbsolute3 ? ret.base = ret.name =
|
|
2011
|
+
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1 ? end !== -1 && (startPart === 0 && isAbsolute3 ? ret.base = ret.name = path2.slice(1, end) : ret.base = ret.name = path2.slice(startPart, end)) : (startPart === 0 && isAbsolute3 ? (ret.name = path2.slice(1, startDot), ret.base = path2.slice(1, end)) : (ret.name = path2.slice(startPart, startDot), ret.base = path2.slice(startPart, end)), ret.ext = path2.slice(startDot, end)), startPart > 0 ? ret.dir = path2.slice(0, startPart - 1) : isAbsolute3 && (ret.dir = "/"), ret;
|
|
2012
2012
|
},
|
|
2013
2013
|
sep: "/",
|
|
2014
2014
|
delimiter: ":",
|
|
2015
2015
|
win32: null,
|
|
2016
2016
|
posix: null
|
|
2017
2017
|
};
|
|
2018
|
-
|
|
2019
|
-
module.exports =
|
|
2018
|
+
posix2.posix = posix2;
|
|
2019
|
+
module.exports = posix2;
|
|
2020
2020
|
}
|
|
2021
2021
|
});
|
|
2022
2022
|
|
|
@@ -2026,7 +2026,7 @@ var require_createProject = __commonJS({
|
|
|
2026
2026
|
"use strict";
|
|
2027
2027
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
2028
2028
|
exports.createLanguageServiceHost = createLanguageServiceHost2;
|
|
2029
|
-
var language_core_1 = require_language_core(),
|
|
2029
|
+
var language_core_1 = require_language_core(), path2 = require_path_browserify(), utils_1 = require_utils2(), resolveModuleName_1 = require_resolveModuleName();
|
|
2030
2030
|
function createLanguageServiceHost2(ts, sys, language, asScriptId, projectHost) {
|
|
2031
2031
|
let pluginExtensions = language.plugins.map((plugin) => plugin.typescript?.extraFileExtensions.map((ext) => "." + ext.extension) ?? []).flat(), scriptVersions = new language_core_1.FileMap(sys.useCaseSensitiveFileNames), lastProjectVersion, tsProjectVersion = 0, tsFileRegistry = new language_core_1.FileMap(sys.useCaseSensitiveFileNames), tsFileDirRegistry = new language_core_1.FileMap(sys.useCaseSensitiveFileNames), extraScriptRegistry = new language_core_1.FileMap(sys.useCaseSensitiveFileNames), lastTsVirtualFileSnapshots = /* @__PURE__ */ new Set(), lastOtherVirtualFileSnapshots = /* @__PURE__ */ new Set(), languageServiceHost = {
|
|
2032
2032
|
...sys,
|
|
@@ -2088,7 +2088,7 @@ var require_createProject = __commonJS({
|
|
|
2088
2088
|
if (serviceScript)
|
|
2089
2089
|
return serviceScript.scriptKind;
|
|
2090
2090
|
}
|
|
2091
|
-
switch (
|
|
2091
|
+
switch (path2.extname(fileName)) {
|
|
2092
2092
|
case ".js":
|
|
2093
2093
|
case ".cjs":
|
|
2094
2094
|
case ".mjs":
|
|
@@ -2755,23 +2755,23 @@ var require_path = __commonJS({
|
|
|
2755
2755
|
function isAnyDirectorySeparator(charCode) {
|
|
2756
2756
|
return charCode === 47 || charCode === 92;
|
|
2757
2757
|
}
|
|
2758
|
-
function isRootedDiskPath(
|
|
2759
|
-
return getEncodedRootLength(
|
|
2758
|
+
function isRootedDiskPath(path2) {
|
|
2759
|
+
return getEncodedRootLength(path2) > 0;
|
|
2760
2760
|
}
|
|
2761
2761
|
function hasExtension(fileName) {
|
|
2762
2762
|
return (0, core_1.stringContains)(getBaseFileName(fileName), ".");
|
|
2763
2763
|
}
|
|
2764
|
-
function fileExtensionIs(
|
|
2765
|
-
return
|
|
2764
|
+
function fileExtensionIs(path2, extension) {
|
|
2765
|
+
return path2.length > extension.length && (0, core_1.endsWith)(path2, extension);
|
|
2766
2766
|
}
|
|
2767
|
-
function fileExtensionIsOneOf(
|
|
2767
|
+
function fileExtensionIsOneOf(path2, extensions) {
|
|
2768
2768
|
for (let extension of extensions)
|
|
2769
|
-
if (fileExtensionIs(
|
|
2769
|
+
if (fileExtensionIs(path2, extension))
|
|
2770
2770
|
return !0;
|
|
2771
2771
|
return !1;
|
|
2772
2772
|
}
|
|
2773
|
-
function hasTrailingDirectorySeparator(
|
|
2774
|
-
return
|
|
2773
|
+
function hasTrailingDirectorySeparator(path2) {
|
|
2774
|
+
return path2.length > 0 && isAnyDirectorySeparator(path2.charCodeAt(path2.length - 1));
|
|
2775
2775
|
}
|
|
2776
2776
|
function isVolumeCharacter(charCode) {
|
|
2777
2777
|
return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90;
|
|
@@ -2787,94 +2787,94 @@ var require_path = __commonJS({
|
|
|
2787
2787
|
}
|
|
2788
2788
|
return -1;
|
|
2789
2789
|
}
|
|
2790
|
-
function getEncodedRootLength(
|
|
2791
|
-
if (!
|
|
2790
|
+
function getEncodedRootLength(path2) {
|
|
2791
|
+
if (!path2)
|
|
2792
2792
|
return 0;
|
|
2793
|
-
let ch0 =
|
|
2793
|
+
let ch0 = path2.charCodeAt(0);
|
|
2794
2794
|
if (ch0 === 47 || ch0 === 92) {
|
|
2795
|
-
if (
|
|
2795
|
+
if (path2.charCodeAt(1) !== ch0)
|
|
2796
2796
|
return 1;
|
|
2797
|
-
let p1 =
|
|
2798
|
-
return p1 < 0 ?
|
|
2797
|
+
let p1 = path2.indexOf(ch0 === 47 ? exports.directorySeparator : altDirectorySeparator, 2);
|
|
2798
|
+
return p1 < 0 ? path2.length : p1 + 1;
|
|
2799
2799
|
}
|
|
2800
|
-
if (isVolumeCharacter(ch0) &&
|
|
2801
|
-
let ch2 =
|
|
2800
|
+
if (isVolumeCharacter(ch0) && path2.charCodeAt(1) === 58) {
|
|
2801
|
+
let ch2 = path2.charCodeAt(2);
|
|
2802
2802
|
if (ch2 === 47 || ch2 === 92)
|
|
2803
2803
|
return 3;
|
|
2804
|
-
if (
|
|
2804
|
+
if (path2.length === 2)
|
|
2805
2805
|
return 2;
|
|
2806
2806
|
}
|
|
2807
|
-
let schemeEnd =
|
|
2807
|
+
let schemeEnd = path2.indexOf(urlSchemeSeparator);
|
|
2808
2808
|
if (schemeEnd !== -1) {
|
|
2809
|
-
let authorityStart = schemeEnd + urlSchemeSeparator.length, authorityEnd =
|
|
2809
|
+
let authorityStart = schemeEnd + urlSchemeSeparator.length, authorityEnd = path2.indexOf(exports.directorySeparator, authorityStart);
|
|
2810
2810
|
if (authorityEnd !== -1) {
|
|
2811
|
-
let scheme =
|
|
2812
|
-
if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(
|
|
2813
|
-
let volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(
|
|
2811
|
+
let scheme = path2.slice(0, schemeEnd), authority = path2.slice(authorityStart, authorityEnd);
|
|
2812
|
+
if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path2.charCodeAt(authorityEnd + 1))) {
|
|
2813
|
+
let volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path2, authorityEnd + 2);
|
|
2814
2814
|
if (volumeSeparatorEnd !== -1) {
|
|
2815
|
-
if (
|
|
2815
|
+
if (path2.charCodeAt(volumeSeparatorEnd) === 47)
|
|
2816
2816
|
return ~(volumeSeparatorEnd + 1);
|
|
2817
|
-
if (volumeSeparatorEnd ===
|
|
2817
|
+
if (volumeSeparatorEnd === path2.length)
|
|
2818
2818
|
return ~volumeSeparatorEnd;
|
|
2819
2819
|
}
|
|
2820
2820
|
}
|
|
2821
2821
|
return ~(authorityEnd + 1);
|
|
2822
2822
|
}
|
|
2823
|
-
return ~
|
|
2823
|
+
return ~path2.length;
|
|
2824
2824
|
}
|
|
2825
2825
|
return 0;
|
|
2826
2826
|
}
|
|
2827
|
-
function getRootLength(
|
|
2828
|
-
let rootLength = getEncodedRootLength(
|
|
2827
|
+
function getRootLength(path2) {
|
|
2828
|
+
let rootLength = getEncodedRootLength(path2);
|
|
2829
2829
|
return rootLength < 0 ? ~rootLength : rootLength;
|
|
2830
2830
|
}
|
|
2831
|
-
function getDirectoryPath(
|
|
2832
|
-
|
|
2833
|
-
let rootLength = getRootLength(
|
|
2834
|
-
return rootLength ===
|
|
2831
|
+
function getDirectoryPath(path2) {
|
|
2832
|
+
path2 = normalizeSlashes(path2);
|
|
2833
|
+
let rootLength = getRootLength(path2);
|
|
2834
|
+
return rootLength === path2.length ? path2 : (path2 = removeTrailingDirectorySeparator(path2), path2.slice(0, Math.max(rootLength, path2.lastIndexOf(exports.directorySeparator))));
|
|
2835
2835
|
}
|
|
2836
|
-
function getBaseFileName(
|
|
2837
|
-
if (
|
|
2836
|
+
function getBaseFileName(path2, extensions, ignoreCase) {
|
|
2837
|
+
if (path2 = normalizeSlashes(path2), getRootLength(path2) === path2.length)
|
|
2838
2838
|
return "";
|
|
2839
|
-
|
|
2840
|
-
let name =
|
|
2839
|
+
path2 = removeTrailingDirectorySeparator(path2);
|
|
2840
|
+
let name = path2.slice(Math.max(getRootLength(path2), path2.lastIndexOf(exports.directorySeparator) + 1)), extension = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(name, extensions, ignoreCase) : void 0;
|
|
2841
2841
|
return extension ? name.slice(0, name.length - extension.length) : name;
|
|
2842
2842
|
}
|
|
2843
|
-
function tryGetExtensionFromPath(
|
|
2844
|
-
if ((0, core_1.startsWith)(extension, ".") || (extension = "." + extension),
|
|
2845
|
-
let pathExtension =
|
|
2843
|
+
function tryGetExtensionFromPath(path2, extension, stringEqualityComparer) {
|
|
2844
|
+
if ((0, core_1.startsWith)(extension, ".") || (extension = "." + extension), path2.length >= extension.length && path2.charCodeAt(path2.length - extension.length) === 46) {
|
|
2845
|
+
let pathExtension = path2.slice(path2.length - extension.length);
|
|
2846
2846
|
if (stringEqualityComparer(pathExtension, extension))
|
|
2847
2847
|
return pathExtension;
|
|
2848
2848
|
}
|
|
2849
2849
|
}
|
|
2850
|
-
function getAnyExtensionFromPathWorker(
|
|
2850
|
+
function getAnyExtensionFromPathWorker(path2, extensions, stringEqualityComparer) {
|
|
2851
2851
|
if (typeof extensions == "string")
|
|
2852
|
-
return tryGetExtensionFromPath(
|
|
2852
|
+
return tryGetExtensionFromPath(path2, extensions, stringEqualityComparer) || "";
|
|
2853
2853
|
for (let extension of extensions) {
|
|
2854
|
-
let result = tryGetExtensionFromPath(
|
|
2854
|
+
let result = tryGetExtensionFromPath(path2, extension, stringEqualityComparer);
|
|
2855
2855
|
if (result)
|
|
2856
2856
|
return result;
|
|
2857
2857
|
}
|
|
2858
2858
|
return "";
|
|
2859
2859
|
}
|
|
2860
|
-
function getAnyExtensionFromPath(
|
|
2860
|
+
function getAnyExtensionFromPath(path2, extensions, ignoreCase) {
|
|
2861
2861
|
if (extensions)
|
|
2862
|
-
return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(
|
|
2863
|
-
let baseFileName = getBaseFileName(
|
|
2862
|
+
return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path2), extensions, ignoreCase ? core_1.equateStringsCaseInsensitive : core_1.equateStringsCaseSensitive);
|
|
2863
|
+
let baseFileName = getBaseFileName(path2), extensionIndex = baseFileName.lastIndexOf(".");
|
|
2864
2864
|
return extensionIndex >= 0 ? baseFileName.substring(extensionIndex) : "";
|
|
2865
2865
|
}
|
|
2866
|
-
function pathComponents(
|
|
2867
|
-
let root =
|
|
2866
|
+
function pathComponents(path2, rootLength) {
|
|
2867
|
+
let root = path2.substring(0, rootLength), rest = path2.substring(rootLength).split(exports.directorySeparator);
|
|
2868
2868
|
return rest.length && !(0, core_1.lastOrUndefined)(rest) && rest.pop(), [root, ...rest];
|
|
2869
2869
|
}
|
|
2870
|
-
function getPathComponents(
|
|
2871
|
-
return
|
|
2870
|
+
function getPathComponents(path2, currentDirectory = "") {
|
|
2871
|
+
return path2 = combinePaths(currentDirectory, path2), pathComponents(path2, getRootLength(path2));
|
|
2872
2872
|
}
|
|
2873
2873
|
function getPathFromPathComponents(pathComponents2) {
|
|
2874
2874
|
return pathComponents2.length === 0 ? "" : (pathComponents2[0] && ensureTrailingDirectorySeparator(pathComponents2[0])) + pathComponents2.slice(1).join(exports.directorySeparator);
|
|
2875
2875
|
}
|
|
2876
|
-
function normalizeSlashes(
|
|
2877
|
-
return
|
|
2876
|
+
function normalizeSlashes(path2) {
|
|
2877
|
+
return path2.indexOf("\\") !== -1 ? path2.replace(backslashRegExp, exports.directorySeparator) : path2;
|
|
2878
2878
|
}
|
|
2879
2879
|
function reducePathComponents(components) {
|
|
2880
2880
|
if (!(0, core_1.some)(components))
|
|
@@ -2897,29 +2897,29 @@ var require_path = __commonJS({
|
|
|
2897
2897
|
}
|
|
2898
2898
|
return reduced;
|
|
2899
2899
|
}
|
|
2900
|
-
function combinePaths(
|
|
2901
|
-
|
|
2900
|
+
function combinePaths(path2, ...paths) {
|
|
2901
|
+
path2 && (path2 = normalizeSlashes(path2));
|
|
2902
2902
|
for (let relativePath of paths)
|
|
2903
|
-
relativePath && (relativePath = normalizeSlashes(relativePath), !
|
|
2904
|
-
return
|
|
2903
|
+
relativePath && (relativePath = normalizeSlashes(relativePath), !path2 || getRootLength(relativePath) !== 0 ? path2 = relativePath : path2 = ensureTrailingDirectorySeparator(path2) + relativePath);
|
|
2904
|
+
return path2;
|
|
2905
2905
|
}
|
|
2906
|
-
function getNormalizedPathComponents(
|
|
2907
|
-
return reducePathComponents(getPathComponents(
|
|
2906
|
+
function getNormalizedPathComponents(path2, currentDirectory) {
|
|
2907
|
+
return reducePathComponents(getPathComponents(path2, currentDirectory));
|
|
2908
2908
|
}
|
|
2909
|
-
function normalizePath(
|
|
2910
|
-
if (
|
|
2911
|
-
return
|
|
2912
|
-
let simplified =
|
|
2913
|
-
if (simplified !==
|
|
2914
|
-
return
|
|
2915
|
-
let normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(
|
|
2916
|
-
return normalized && hasTrailingDirectorySeparator(
|
|
2909
|
+
function normalizePath(path2) {
|
|
2910
|
+
if (path2 = normalizeSlashes(path2), !relativePathSegmentRegExp.test(path2))
|
|
2911
|
+
return path2;
|
|
2912
|
+
let simplified = path2.replace(/\/\.\//g, "/").replace(/^\.\//, "");
|
|
2913
|
+
if (simplified !== path2 && (path2 = simplified, !relativePathSegmentRegExp.test(path2)))
|
|
2914
|
+
return path2;
|
|
2915
|
+
let normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path2)));
|
|
2916
|
+
return normalized && hasTrailingDirectorySeparator(path2) ? ensureTrailingDirectorySeparator(normalized) : normalized;
|
|
2917
2917
|
}
|
|
2918
|
-
function removeTrailingDirectorySeparator(
|
|
2919
|
-
return hasTrailingDirectorySeparator(
|
|
2918
|
+
function removeTrailingDirectorySeparator(path2) {
|
|
2919
|
+
return hasTrailingDirectorySeparator(path2) ? path2.substr(0, path2.length - 1) : path2;
|
|
2920
2920
|
}
|
|
2921
|
-
function ensureTrailingDirectorySeparator(
|
|
2922
|
-
return hasTrailingDirectorySeparator(
|
|
2921
|
+
function ensureTrailingDirectorySeparator(path2) {
|
|
2922
|
+
return hasTrailingDirectorySeparator(path2) ? path2 : path2 + exports.directorySeparator;
|
|
2923
2923
|
}
|
|
2924
2924
|
var relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;
|
|
2925
2925
|
function containsPath(parent, child, currentDirectory, ignoreCase) {
|
|
@@ -3014,34 +3014,34 @@ var require_utilities = __commonJS({
|
|
|
3014
3014
|
function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
|
|
3015
3015
|
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
|
|
3016
3016
|
}
|
|
3017
|
-
function getFileMatcherPatterns(
|
|
3018
|
-
|
|
3019
|
-
let absolutePath = (0, path_1.combinePaths)(currentDirectory,
|
|
3017
|
+
function getFileMatcherPatterns(path2, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
|
|
3018
|
+
path2 = (0, path_1.normalizePath)(path2), currentDirectory = (0, path_1.normalizePath)(currentDirectory);
|
|
3019
|
+
let absolutePath = (0, path_1.combinePaths)(currentDirectory, path2);
|
|
3020
3020
|
return {
|
|
3021
3021
|
includeFilePatterns: (0, core_1.map)(getRegularExpressionsForWildcards(includes, absolutePath, "files"), (pattern) => `^${pattern}$`),
|
|
3022
3022
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
3023
3023
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
3024
3024
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
3025
|
-
basePaths: getBasePaths(
|
|
3025
|
+
basePaths: getBasePaths(path2, includes, useCaseSensitiveFileNames)
|
|
3026
3026
|
};
|
|
3027
3027
|
}
|
|
3028
3028
|
function getRegexFromPattern(pattern, useCaseSensitiveFileNames) {
|
|
3029
3029
|
return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i");
|
|
3030
3030
|
}
|
|
3031
|
-
function matchFiles(
|
|
3032
|
-
|
|
3033
|
-
let patterns = getFileMatcherPatterns(
|
|
3031
|
+
function matchFiles(path2, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
|
|
3032
|
+
path2 = (0, path_1.normalizePath)(path2), currentDirectory = (0, path_1.normalizePath)(currentDirectory);
|
|
3033
|
+
let patterns = getFileMatcherPatterns(path2, excludes, includes, useCaseSensitiveFileNames, currentDirectory), includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames)), includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames), excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames), results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]], visited = /* @__PURE__ */ new Map(), toCanonical = (0, core_1.createGetCanonicalFileName)(useCaseSensitiveFileNames);
|
|
3034
3034
|
for (let basePath of patterns.basePaths)
|
|
3035
3035
|
visitDirectory(basePath, (0, path_1.combinePaths)(currentDirectory, basePath), depth);
|
|
3036
3036
|
return (0, core_1.flatten)(results);
|
|
3037
|
-
function visitDirectory(
|
|
3037
|
+
function visitDirectory(path3, absolutePath, depth2) {
|
|
3038
3038
|
let canonicalPath = toCanonical(realpath(absolutePath));
|
|
3039
3039
|
if (visited.has(canonicalPath))
|
|
3040
3040
|
return;
|
|
3041
3041
|
visited.set(canonicalPath, !0);
|
|
3042
|
-
let { files, directories } = getFileSystemEntries(
|
|
3042
|
+
let { files, directories } = getFileSystemEntries(path3);
|
|
3043
3043
|
for (let current2 of (0, core_1.sort)(files, core_1.compareStringsCaseSensitive)) {
|
|
3044
|
-
let name = (0, path_1.combinePaths)(
|
|
3044
|
+
let name = (0, path_1.combinePaths)(path3, current2), absoluteName = (0, path_1.combinePaths)(absolutePath, current2);
|
|
3045
3045
|
if (!(extensions && !(0, path_1.fileExtensionIsOneOf)(name, extensions)) && !(excludeRegex && excludeRegex.test(absoluteName)))
|
|
3046
3046
|
if (!includeFileRegexes)
|
|
3047
3047
|
results[0].push(name);
|
|
@@ -3052,22 +3052,22 @@ var require_utilities = __commonJS({
|
|
|
3052
3052
|
}
|
|
3053
3053
|
if (!(depth2 !== void 0 && (depth2--, depth2 === 0)))
|
|
3054
3054
|
for (let current2 of (0, core_1.sort)(directories, core_1.compareStringsCaseSensitive)) {
|
|
3055
|
-
let name = (0, path_1.combinePaths)(
|
|
3055
|
+
let name = (0, path_1.combinePaths)(path3, current2), absoluteName = (0, path_1.combinePaths)(absolutePath, current2);
|
|
3056
3056
|
(!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName)) && visitDirectory(name, absoluteName, depth2);
|
|
3057
3057
|
}
|
|
3058
3058
|
}
|
|
3059
3059
|
}
|
|
3060
|
-
function getBasePaths(
|
|
3061
|
-
let basePaths = [
|
|
3060
|
+
function getBasePaths(path2, includes, useCaseSensitiveFileNames) {
|
|
3061
|
+
let basePaths = [path2];
|
|
3062
3062
|
if (includes) {
|
|
3063
3063
|
let includeBasePaths = [];
|
|
3064
3064
|
for (let include of includes) {
|
|
3065
|
-
let absolute2 = (0, path_1.isRootedDiskPath)(include) ? include : (0, path_1.normalizePath)((0, path_1.combinePaths)(
|
|
3065
|
+
let absolute2 = (0, path_1.isRootedDiskPath)(include) ? include : (0, path_1.normalizePath)((0, path_1.combinePaths)(path2, include));
|
|
3066
3066
|
includeBasePaths.push(getIncludeBasePath(absolute2));
|
|
3067
3067
|
}
|
|
3068
3068
|
includeBasePaths.sort((0, core_1.getStringComparer)(!useCaseSensitiveFileNames));
|
|
3069
3069
|
for (let includeBasePath of includeBasePaths)
|
|
3070
|
-
(0, core_1.every)(basePaths, (basePath) => !(0, path_1.containsPath)(basePath, includeBasePath,
|
|
3070
|
+
(0, core_1.every)(basePaths, (basePath) => !(0, path_1.containsPath)(basePath, includeBasePath, path2, !useCaseSensitiveFileNames)) && basePaths.push(includeBasePath);
|
|
3071
3071
|
}
|
|
3072
3072
|
return basePaths;
|
|
3073
3073
|
}
|
|
@@ -3084,7 +3084,7 @@ var require_createSys = __commonJS({
|
|
|
3084
3084
|
"use strict";
|
|
3085
3085
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3086
3086
|
exports.createSys = createSys;
|
|
3087
|
-
var
|
|
3087
|
+
var path2 = require_path_browserify(), vscode_uri_1 = require_umd(), utilities_1 = require_utilities(), currentCwd = "";
|
|
3088
3088
|
function createSys(sys, env, getCurrentDirectory, uriConverter) {
|
|
3089
3089
|
let version2 = 0, caseSensitive = sys?.useCaseSensitiveFileNames ?? !1, root = {
|
|
3090
3090
|
name: "",
|
|
@@ -3094,7 +3094,7 @@ var require_createSys = __commonJS({
|
|
|
3094
3094
|
}, promises = /* @__PURE__ */ new Set(), fileWatcher = env.onDidChangeWatchedFiles?.(({ changes }) => {
|
|
3095
3095
|
version2++;
|
|
3096
3096
|
for (let change of changes) {
|
|
3097
|
-
let changeUri = vscode_uri_1.URI.parse(change.uri), fileName = uriConverter.asFileName(changeUri), dirName =
|
|
3097
|
+
let changeUri = vscode_uri_1.URI.parse(change.uri), fileName = uriConverter.asFileName(changeUri), dirName = path2.dirname(fileName), baseName = path2.basename(fileName), fileExists2 = change.type === 1 || change.type === 2;
|
|
3098
3098
|
getDir(dirName, fileExists2).files.set(normalizeFileId(baseName), fileExists2 ? {
|
|
3099
3099
|
name: baseName,
|
|
3100
3100
|
stat: {
|
|
@@ -3159,11 +3159,11 @@ var require_createSys = __commonJS({
|
|
|
3159
3159
|
}
|
|
3160
3160
|
return sys.resolvePath(fsPath).replace(/\\/g, "/");
|
|
3161
3161
|
}
|
|
3162
|
-
return
|
|
3162
|
+
return path2.resolve(fsPath).replace(/\\/g, "/");
|
|
3163
3163
|
}
|
|
3164
3164
|
function readFile(fileName, encoding) {
|
|
3165
3165
|
fileName = resolvePath(fileName);
|
|
3166
|
-
let dirPath =
|
|
3166
|
+
let dirPath = path2.dirname(fileName), dir = getDir(dirPath), name = path2.basename(fileName);
|
|
3167
3167
|
return readFileWorker(fileName, encoding, dir), dir.files.get(normalizeFileId(name))?.text;
|
|
3168
3168
|
}
|
|
3169
3169
|
function directoryExists(dirName) {
|
|
@@ -3204,7 +3204,7 @@ var require_createSys = __commonJS({
|
|
|
3204
3204
|
}
|
|
3205
3205
|
function getFile(fileName) {
|
|
3206
3206
|
fileName = resolvePath(fileName);
|
|
3207
|
-
let dirPath =
|
|
3207
|
+
let dirPath = path2.dirname(fileName), baseName = path2.basename(fileName), dir = getDir(dirPath), file = dir.files.get(normalizeFileId(baseName));
|
|
3208
3208
|
return file || dir.files.set(normalizeFileId(baseName), file = {
|
|
3209
3209
|
name: baseName,
|
|
3210
3210
|
requestedStat: !1,
|
|
@@ -3223,11 +3223,11 @@ var require_createSys = __commonJS({
|
|
|
3223
3223
|
files: [...dir.files.values()].filter((file) => file.stat?.type === 1).map((file) => file.name),
|
|
3224
3224
|
directories: [...dir.dirs.values()].filter((dir2) => dir2.exists).map((dir2) => dir2.name)
|
|
3225
3225
|
};
|
|
3226
|
-
}, sys?.realpath ? ((
|
|
3226
|
+
}, sys?.realpath ? ((path3) => sys.realpath(path3)) : ((path3) => path3));
|
|
3227
3227
|
return [...new Set(matches)];
|
|
3228
3228
|
}
|
|
3229
3229
|
function readFileWorker(fileName, encoding, dir) {
|
|
3230
|
-
let name =
|
|
3230
|
+
let name = path2.basename(fileName), file = dir.files.get(normalizeFileId(name));
|
|
3231
3231
|
if (file || dir.files.set(normalizeFileId(name), file = {
|
|
3232
3232
|
name,
|
|
3233
3233
|
requestedStat: !1,
|
|
@@ -3301,9 +3301,9 @@ var require_createSys = __commonJS({
|
|
|
3301
3301
|
return updated;
|
|
3302
3302
|
}
|
|
3303
3303
|
function getDir(dirName, markExists = !1) {
|
|
3304
|
-
let dirNames = [], currentDirPath = dirName, currentDirName =
|
|
3304
|
+
let dirNames = [], currentDirPath = dirName, currentDirName = path2.basename(currentDirPath), lastDirPath;
|
|
3305
3305
|
for (; lastDirPath !== currentDirPath; )
|
|
3306
|
-
lastDirPath = currentDirPath, dirNames.push(currentDirName), currentDirPath =
|
|
3306
|
+
lastDirPath = currentDirPath, dirNames.push(currentDirName), currentDirPath = path2.dirname(currentDirPath), currentDirName = path2.basename(currentDirPath);
|
|
3307
3307
|
let currentDir = root;
|
|
3308
3308
|
for (let i2 = dirNames.length - 1; i2 >= 0; i2--) {
|
|
3309
3309
|
let nextDirName = dirNames[i2];
|
|
@@ -3543,19 +3543,19 @@ var require_estraverse = __commonJS({
|
|
|
3543
3543
|
}, Reference.prototype.remove = function() {
|
|
3544
3544
|
return Array.isArray(this.parent) ? (this.parent.splice(this.key, 1), !0) : (this.replace(null), !1);
|
|
3545
3545
|
};
|
|
3546
|
-
function Element(node,
|
|
3547
|
-
this.node = node, this.path =
|
|
3546
|
+
function Element(node, path2, wrap, ref2) {
|
|
3547
|
+
this.node = node, this.path = path2, this.wrap = wrap, this.ref = ref2;
|
|
3548
3548
|
}
|
|
3549
3549
|
function Controller() {
|
|
3550
3550
|
}
|
|
3551
3551
|
Controller.prototype.path = function() {
|
|
3552
3552
|
var i2, iz, j, jz, result, element;
|
|
3553
|
-
function addToPath(result2,
|
|
3554
|
-
if (Array.isArray(
|
|
3555
|
-
for (j = 0, jz =
|
|
3556
|
-
result2.push(
|
|
3553
|
+
function addToPath(result2, path3) {
|
|
3554
|
+
if (Array.isArray(path3))
|
|
3555
|
+
for (j = 0, jz = path3.length; j < jz; ++j)
|
|
3556
|
+
result2.push(path3[j]);
|
|
3557
3557
|
else
|
|
3558
|
-
result2.push(
|
|
3558
|
+
result2.push(path3);
|
|
3559
3559
|
}
|
|
3560
3560
|
if (!this.__current.path)
|
|
3561
3561
|
return null;
|
|
@@ -4133,18 +4133,18 @@ var require_util = __commonJS({
|
|
|
4133
4133
|
}
|
|
4134
4134
|
exports.urlGenerate = urlGenerate;
|
|
4135
4135
|
function normalize2(aPath) {
|
|
4136
|
-
var
|
|
4136
|
+
var path2 = aPath, url = urlParse(aPath);
|
|
4137
4137
|
if (url) {
|
|
4138
4138
|
if (!url.path)
|
|
4139
4139
|
return aPath;
|
|
4140
|
-
|
|
4140
|
+
path2 = url.path;
|
|
4141
4141
|
}
|
|
4142
|
-
for (var isAbsolute3 = exports.isAbsolute(
|
|
4142
|
+
for (var isAbsolute3 = exports.isAbsolute(path2), parts = path2.split(/\/+/), part, up3 = 0, i2 = parts.length - 1; i2 >= 0; i2--)
|
|
4143
4143
|
part = parts[i2], part === "." ? parts.splice(i2, 1) : part === ".." ? up3++ : up3 > 0 && (part === "" ? (parts.splice(i2 + 1, up3), up3 = 0) : (parts.splice(i2, 2), up3--));
|
|
4144
|
-
return
|
|
4144
|
+
return path2 = parts.join("/"), path2 === "" && (path2 = isAbsolute3 ? "/" : "."), url ? (url.path = path2, urlGenerate(url)) : path2;
|
|
4145
4145
|
}
|
|
4146
4146
|
exports.normalize = normalize2;
|
|
4147
|
-
function
|
|
4147
|
+
function join5(aRoot, aPath) {
|
|
4148
4148
|
aRoot === "" && (aRoot = "."), aPath === "" && (aPath = ".");
|
|
4149
4149
|
var aPathUrl = urlParse(aPath), aRootUrl = urlParse(aRoot);
|
|
4150
4150
|
if (aRootUrl && (aRoot = aRootUrl.path || "/"), aPathUrl && !aPathUrl.scheme)
|
|
@@ -4156,7 +4156,7 @@ var require_util = __commonJS({
|
|
|
4156
4156
|
var joined = aPath.charAt(0) === "/" ? aPath : normalize2(aRoot.replace(/\/+$/, "") + "/" + aPath);
|
|
4157
4157
|
return aRootUrl ? (aRootUrl.path = joined, urlGenerate(aRootUrl)) : joined;
|
|
4158
4158
|
}
|
|
4159
|
-
exports.join =
|
|
4159
|
+
exports.join = join5;
|
|
4160
4160
|
exports.isAbsolute = function(aPath) {
|
|
4161
4161
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
4162
4162
|
};
|
|
@@ -4228,7 +4228,7 @@ var require_util = __commonJS({
|
|
|
4228
4228
|
var index = parsed.path.lastIndexOf("/");
|
|
4229
4229
|
index >= 0 && (parsed.path = parsed.path.substring(0, index + 1));
|
|
4230
4230
|
}
|
|
4231
|
-
sourceURL =
|
|
4231
|
+
sourceURL = join5(urlGenerate(parsed), sourceURL);
|
|
4232
4232
|
}
|
|
4233
4233
|
return normalize2(sourceURL);
|
|
4234
4234
|
}
|
|
@@ -5372,7 +5372,7 @@ var require_escodegen = __commonJS({
|
|
|
5372
5372
|
function noEmptySpace() {
|
|
5373
5373
|
return space || " ";
|
|
5374
5374
|
}
|
|
5375
|
-
function
|
|
5375
|
+
function join5(left, right) {
|
|
5376
5376
|
var leftSource, rightSource, leftCharCode, rightCharCode;
|
|
5377
5377
|
return leftSource = toSourceNodeWhenNeeded(left).toString(), leftSource.length === 0 ? [right] : (rightSource = toSourceNodeWhenNeeded(right).toString(), rightSource.length === 0 ? [left] : (leftCharCode = leftSource.charCodeAt(leftSource.length - 1), rightCharCode = rightSource.charCodeAt(0), (leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode) || leftCharCode === 47 && rightCharCode === 105 ? [left, noEmptySpace(), right] : esutils.code.isWhiteSpace(leftCharCode) || esutils.code.isLineTerminator(leftCharCode) || esutils.code.isWhiteSpace(rightCharCode) || esutils.code.isLineTerminator(rightCharCode) ? [left, right] : [left, space, right]));
|
|
5378
5378
|
}
|
|
@@ -5508,7 +5508,7 @@ var require_escodegen = __commonJS({
|
|
|
5508
5508
|
return withIndent(function() {
|
|
5509
5509
|
stmt.left.type === Syntax.VariableDeclaration ? withIndent(function() {
|
|
5510
5510
|
result.push(stmt.left.kind + noEmptySpace()), result.push(that.generateStatement(stmt.left.declarations[0], S_FFFF));
|
|
5511
|
-
}) : result.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT)), result =
|
|
5511
|
+
}) : result.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT)), result = join5(result, operator), result = [join5(
|
|
5512
5512
|
result,
|
|
5513
5513
|
that.generateExpression(stmt.right, Precedence.Assignment, E_TTT)
|
|
5514
5514
|
), ")"];
|
|
@@ -5556,14 +5556,14 @@ var require_escodegen = __commonJS({
|
|
|
5556
5556
|
},
|
|
5557
5557
|
ClassDeclaration: function(stmt, flags) {
|
|
5558
5558
|
var result, fragment;
|
|
5559
|
-
return result = ["class"], stmt.id && (result =
|
|
5559
|
+
return result = ["class"], stmt.id && (result = join5(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT))), stmt.superClass && (fragment = join5("extends", this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT)), result = join5(result, fragment)), result.push(space), result.push(this.generateStatement(stmt.body, S_TFFT)), result;
|
|
5560
5560
|
},
|
|
5561
5561
|
DirectiveStatement: function(stmt, flags) {
|
|
5562
5562
|
return extra.raw && stmt.raw ? stmt.raw + this.semicolon(flags) : escapeDirective(stmt.directive) + this.semicolon(flags);
|
|
5563
5563
|
},
|
|
5564
5564
|
DoWhileStatement: function(stmt, flags) {
|
|
5565
|
-
var result =
|
|
5566
|
-
return result = this.maybeBlockSuffix(stmt.body, result),
|
|
5565
|
+
var result = join5("do", this.maybeBlock(stmt.body, S_TFFF));
|
|
5566
|
+
return result = this.maybeBlockSuffix(stmt.body, result), join5(result, [
|
|
5567
5567
|
"while" + space + "(",
|
|
5568
5568
|
this.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
|
|
5569
5569
|
")" + this.semicolon(flags)
|
|
@@ -5588,15 +5588,15 @@ var require_escodegen = __commonJS({
|
|
|
5588
5588
|
},
|
|
5589
5589
|
ExportDefaultDeclaration: function(stmt, flags) {
|
|
5590
5590
|
var result = ["export"], bodyFlags;
|
|
5591
|
-
return bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF, result =
|
|
5591
|
+
return bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF, result = join5(result, "default"), isStatement(stmt.declaration) ? result = join5(result, this.generateStatement(stmt.declaration, bodyFlags)) : result = join5(result, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags)), result;
|
|
5592
5592
|
},
|
|
5593
5593
|
ExportNamedDeclaration: function(stmt, flags) {
|
|
5594
5594
|
var result = ["export"], bodyFlags, that = this;
|
|
5595
|
-
return bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF, stmt.declaration ?
|
|
5595
|
+
return bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF, stmt.declaration ? join5(result, this.generateStatement(stmt.declaration, bodyFlags)) : (stmt.specifiers && (stmt.specifiers.length === 0 ? result = join5(result, "{" + space + "}") : stmt.specifiers[0].type === Syntax.ExportBatchSpecifier ? result = join5(result, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT)) : (result = join5(result, "{"), withIndent(function(indent2) {
|
|
5596
5596
|
var i2, iz;
|
|
5597
5597
|
for (result.push(newline), i2 = 0, iz = stmt.specifiers.length; i2 < iz; ++i2)
|
|
5598
5598
|
result.push(indent2), result.push(that.generateExpression(stmt.specifiers[i2], Precedence.Sequence, E_TTT)), i2 + 1 < iz && result.push("," + newline);
|
|
5599
|
-
}), endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) || result.push(newline), result.push(base2 + "}")), stmt.source ? result =
|
|
5599
|
+
}), endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) || result.push(newline), result.push(base2 + "}")), stmt.source ? result = join5(result, [
|
|
5600
5600
|
"from" + space,
|
|
5601
5601
|
// ModuleSpecifier
|
|
5602
5602
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
@@ -5644,16 +5644,16 @@ var require_escodegen = __commonJS({
|
|
|
5644
5644
|
this.semicolon(flags)
|
|
5645
5645
|
] : (result = [
|
|
5646
5646
|
"import"
|
|
5647
|
-
], cursor = 0, stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier && (result =
|
|
5647
|
+
], cursor = 0, stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier && (result = join5(result, [
|
|
5648
5648
|
this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)
|
|
5649
|
-
]), ++cursor), stmt.specifiers[cursor] && (cursor !== 0 && result.push(","), stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier ? result =
|
|
5649
|
+
]), ++cursor), stmt.specifiers[cursor] && (cursor !== 0 && result.push(","), stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier ? result = join5(result, [
|
|
5650
5650
|
space,
|
|
5651
5651
|
this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)
|
|
5652
5652
|
]) : (result.push(space + "{"), stmt.specifiers.length - cursor === 1 ? (result.push(space), result.push(this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)), result.push(space + "}" + space)) : (withIndent(function(indent2) {
|
|
5653
5653
|
var i2, iz;
|
|
5654
5654
|
for (result.push(newline), i2 = cursor, iz = stmt.specifiers.length; i2 < iz; ++i2)
|
|
5655
5655
|
result.push(indent2), result.push(that.generateExpression(stmt.specifiers[i2], Precedence.Sequence, E_TTT)), i2 + 1 < iz && result.push("," + newline);
|
|
5656
|
-
}), endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) || result.push(newline), result.push(base2 + "}" + space)))), result =
|
|
5656
|
+
}), endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) || result.push(newline), result.push(base2 + "}" + space)))), result = join5(result, [
|
|
5657
5657
|
"from" + space,
|
|
5658
5658
|
// ModuleSpecifier
|
|
5659
5659
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
@@ -5681,7 +5681,7 @@ var require_escodegen = __commonJS({
|
|
|
5681
5681
|
return stmt.declarations.length > 1 ? withIndent(block) : block(), result.push(this.semicolon(flags)), result;
|
|
5682
5682
|
},
|
|
5683
5683
|
ThrowStatement: function(stmt, flags) {
|
|
5684
|
-
return [
|
|
5684
|
+
return [join5(
|
|
5685
5685
|
"throw",
|
|
5686
5686
|
this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
|
|
5687
5687
|
), this.semicolon(flags)];
|
|
@@ -5690,18 +5690,18 @@ var require_escodegen = __commonJS({
|
|
|
5690
5690
|
var result, i2, iz, guardedHandlers;
|
|
5691
5691
|
if (result = ["try", this.maybeBlock(stmt.block, S_TFFF)], result = this.maybeBlockSuffix(stmt.block, result), stmt.handlers)
|
|
5692
5692
|
for (i2 = 0, iz = stmt.handlers.length; i2 < iz; ++i2)
|
|
5693
|
-
result =
|
|
5693
|
+
result = join5(result, this.generateStatement(stmt.handlers[i2], S_TFFF)), (stmt.finalizer || i2 + 1 !== iz) && (result = this.maybeBlockSuffix(stmt.handlers[i2].body, result));
|
|
5694
5694
|
else {
|
|
5695
5695
|
for (guardedHandlers = stmt.guardedHandlers || [], i2 = 0, iz = guardedHandlers.length; i2 < iz; ++i2)
|
|
5696
|
-
result =
|
|
5696
|
+
result = join5(result, this.generateStatement(guardedHandlers[i2], S_TFFF)), (stmt.finalizer || i2 + 1 !== iz) && (result = this.maybeBlockSuffix(guardedHandlers[i2].body, result));
|
|
5697
5697
|
if (stmt.handler)
|
|
5698
5698
|
if (Array.isArray(stmt.handler))
|
|
5699
5699
|
for (i2 = 0, iz = stmt.handler.length; i2 < iz; ++i2)
|
|
5700
|
-
result =
|
|
5700
|
+
result = join5(result, this.generateStatement(stmt.handler[i2], S_TFFF)), (stmt.finalizer || i2 + 1 !== iz) && (result = this.maybeBlockSuffix(stmt.handler[i2].body, result));
|
|
5701
5701
|
else
|
|
5702
|
-
result =
|
|
5702
|
+
result = join5(result, this.generateStatement(stmt.handler, S_TFFF)), stmt.finalizer && (result = this.maybeBlockSuffix(stmt.handler.body, result));
|
|
5703
5703
|
}
|
|
5704
|
-
return stmt.finalizer && (result =
|
|
5704
|
+
return stmt.finalizer && (result = join5(result, ["finally", this.maybeBlock(stmt.finalizer, S_TFFF)])), result;
|
|
5705
5705
|
},
|
|
5706
5706
|
SwitchStatement: function(stmt, flags) {
|
|
5707
5707
|
var result, fragment, i2, iz, bodyFlags, that = this;
|
|
@@ -5720,7 +5720,7 @@ var require_escodegen = __commonJS({
|
|
|
5720
5720
|
var result, fragment, i2, iz, bodyFlags, that = this;
|
|
5721
5721
|
return withIndent(function() {
|
|
5722
5722
|
for (stmt.test ? result = [
|
|
5723
|
-
|
|
5723
|
+
join5("case", that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)),
|
|
5724
5724
|
":"
|
|
5725
5725
|
] : result = ["default:"], i2 = 0, iz = stmt.consequent.length, iz && stmt.consequent[0].type === Syntax.BlockStatement && (fragment = that.maybeBlock(stmt.consequent[0], S_TFFF), result.push(fragment), i2 = 1), i2 !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) && result.push(newline), bodyFlags = S_TFFF; i2 < iz; ++i2)
|
|
5726
5726
|
i2 === iz - 1 && flags & F_SEMICOLON_OPT && (bodyFlags |= F_SEMICOLON_OPT), fragment = addIndent(that.generateStatement(stmt.consequent[i2], bodyFlags)), result.push(fragment), i2 + 1 !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString()) && result.push(newline);
|
|
@@ -5734,7 +5734,7 @@ var require_escodegen = __commonJS({
|
|
|
5734
5734
|
that.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
|
|
5735
5735
|
")"
|
|
5736
5736
|
];
|
|
5737
|
-
}), semicolonOptional = flags & F_SEMICOLON_OPT, bodyFlags = S_TFFF, semicolonOptional && (bodyFlags |= F_SEMICOLON_OPT), stmt.alternate ? (result.push(this.maybeBlock(stmt.consequent, S_TFFF)), result = this.maybeBlockSuffix(stmt.consequent, result), stmt.alternate.type === Syntax.IfStatement ? result =
|
|
5737
|
+
}), semicolonOptional = flags & F_SEMICOLON_OPT, bodyFlags = S_TFFF, semicolonOptional && (bodyFlags |= F_SEMICOLON_OPT), stmt.alternate ? (result.push(this.maybeBlock(stmt.consequent, S_TFFF)), result = this.maybeBlockSuffix(stmt.consequent, result), stmt.alternate.type === Syntax.IfStatement ? result = join5(result, ["else ", this.generateStatement(stmt.alternate, bodyFlags)]) : result = join5(result, join5("else", this.maybeBlock(stmt.alternate, bodyFlags)))) : result.push(this.maybeBlock(stmt.consequent, bodyFlags)), result;
|
|
5738
5738
|
},
|
|
5739
5739
|
ForStatement: function(stmt, flags) {
|
|
5740
5740
|
var result, that = this;
|
|
@@ -5768,7 +5768,7 @@ var require_escodegen = __commonJS({
|
|
|
5768
5768
|
];
|
|
5769
5769
|
},
|
|
5770
5770
|
ReturnStatement: function(stmt, flags) {
|
|
5771
|
-
return stmt.argument ? [
|
|
5771
|
+
return stmt.argument ? [join5(
|
|
5772
5772
|
"return",
|
|
5773
5773
|
this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
|
|
5774
5774
|
), this.semicolon(flags)] : ["return" + this.semicolon(flags)];
|
|
@@ -5824,7 +5824,7 @@ var require_escodegen = __commonJS({
|
|
|
5824
5824
|
},
|
|
5825
5825
|
BinaryExpression: function(expr, precedence, flags) {
|
|
5826
5826
|
var result, leftPrecedence, rightPrecedence, currentPrecedence, fragment, leftSource;
|
|
5827
|
-
return currentPrecedence = BinaryPrecedence[expr.operator], leftPrecedence = expr.operator === "**" ? Precedence.Postfix : currentPrecedence, rightPrecedence = expr.operator === "**" ? currentPrecedence : currentPrecedence + 1, currentPrecedence < precedence && (flags |= F_ALLOW_IN), fragment = this.generateExpression(expr.left, leftPrecedence, flags), leftSource = fragment.toString(), leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0)) ? result = [fragment, noEmptySpace(), expr.operator] : result =
|
|
5827
|
+
return currentPrecedence = BinaryPrecedence[expr.operator], leftPrecedence = expr.operator === "**" ? Precedence.Postfix : currentPrecedence, rightPrecedence = expr.operator === "**" ? currentPrecedence : currentPrecedence + 1, currentPrecedence < precedence && (flags |= F_ALLOW_IN), fragment = this.generateExpression(expr.left, leftPrecedence, flags), leftSource = fragment.toString(), leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0)) ? result = [fragment, noEmptySpace(), expr.operator] : result = join5(fragment, expr.operator), fragment = this.generateExpression(expr.right, rightPrecedence, flags), expr.operator === "/" && fragment.toString().charAt(0) === "/" || expr.operator.slice(-1) === "<" && fragment.toString().slice(0, 3) === "!--" ? (result.push(noEmptySpace()), result.push(fragment)) : result = join5(result, fragment), expr.operator === "in" && !(flags & F_ALLOW_IN) ? ["(", result, ")"] : (expr.operator === "||" || expr.operator === "&&") && flags & F_FOUND_COALESCE ? ["(", result, ")"] : parenthesize(result, currentPrecedence, precedence);
|
|
5828
5828
|
},
|
|
5829
5829
|
CallExpression: function(expr, precedence, flags) {
|
|
5830
5830
|
var result, i2, iz;
|
|
@@ -5839,7 +5839,7 @@ var require_escodegen = __commonJS({
|
|
|
5839
5839
|
},
|
|
5840
5840
|
NewExpression: function(expr, precedence, flags) {
|
|
5841
5841
|
var result, length, i2, iz, itemFlags;
|
|
5842
|
-
if (length = expr.arguments.length, itemFlags = flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0 ? E_TFT : E_TFF, result =
|
|
5842
|
+
if (length = expr.arguments.length, itemFlags = flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0 ? E_TFT : E_TFF, result = join5(
|
|
5843
5843
|
"new",
|
|
5844
5844
|
this.generateExpression(expr.callee, Precedence.New, itemFlags)
|
|
5845
5845
|
), !(flags & F_ALLOW_UNPARATH_NEW) || parentheses || length > 0) {
|
|
@@ -5859,17 +5859,17 @@ var require_escodegen = __commonJS({
|
|
|
5859
5859
|
},
|
|
5860
5860
|
UnaryExpression: function(expr, precedence, flags) {
|
|
5861
5861
|
var result, fragment, rightCharCode, leftSource, leftCharCode;
|
|
5862
|
-
return fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT), space === "" ? result =
|
|
5862
|
+
return fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT), space === "" ? result = join5(expr.operator, fragment) : (result = [expr.operator], expr.operator.length > 2 ? result = join5(result, fragment) : (leftSource = toSourceNodeWhenNeeded(result).toString(), leftCharCode = leftSource.charCodeAt(leftSource.length - 1), rightCharCode = fragment.toString().charCodeAt(0), ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode)) && result.push(noEmptySpace()), result.push(fragment))), parenthesize(result, Precedence.Unary, precedence);
|
|
5863
5863
|
},
|
|
5864
5864
|
YieldExpression: function(expr, precedence, flags) {
|
|
5865
5865
|
var result;
|
|
5866
|
-
return expr.delegate ? result = "yield*" : result = "yield", expr.argument && (result =
|
|
5866
|
+
return expr.delegate ? result = "yield*" : result = "yield", expr.argument && (result = join5(
|
|
5867
5867
|
result,
|
|
5868
5868
|
this.generateExpression(expr.argument, Precedence.Yield, E_TTT)
|
|
5869
5869
|
)), parenthesize(result, Precedence.Yield, precedence);
|
|
5870
5870
|
},
|
|
5871
5871
|
AwaitExpression: function(expr, precedence, flags) {
|
|
5872
|
-
var result =
|
|
5872
|
+
var result = join5(
|
|
5873
5873
|
expr.all ? "await*" : "await",
|
|
5874
5874
|
this.generateExpression(expr.argument, Precedence.Await, E_TTT)
|
|
5875
5875
|
);
|
|
@@ -5915,18 +5915,18 @@ var require_escodegen = __commonJS({
|
|
|
5915
5915
|
},
|
|
5916
5916
|
ClassExpression: function(expr, precedence, flags) {
|
|
5917
5917
|
var result, fragment;
|
|
5918
|
-
return result = ["class"], expr.id && (result =
|
|
5918
|
+
return result = ["class"], expr.id && (result = join5(result, this.generateExpression(expr.id, Precedence.Sequence, E_TTT))), expr.superClass && (fragment = join5("extends", this.generateExpression(expr.superClass, Precedence.Unary, E_TTT)), result = join5(result, fragment)), result.push(space), result.push(this.generateStatement(expr.body, S_TFFT)), result;
|
|
5919
5919
|
},
|
|
5920
5920
|
MethodDefinition: function(expr, precedence, flags) {
|
|
5921
5921
|
var result, fragment;
|
|
5922
5922
|
return expr.static ? result = ["static" + space] : result = [], expr.kind === "get" || expr.kind === "set" ? fragment = [
|
|
5923
|
-
|
|
5923
|
+
join5(expr.kind, this.generatePropertyKey(expr.key, expr.computed)),
|
|
5924
5924
|
this.generateFunctionBody(expr.value)
|
|
5925
5925
|
] : fragment = [
|
|
5926
5926
|
generateMethodPrefix(expr),
|
|
5927
5927
|
this.generatePropertyKey(expr.key, expr.computed),
|
|
5928
5928
|
this.generateFunctionBody(expr.value)
|
|
5929
|
-
],
|
|
5929
|
+
], join5(result, fragment);
|
|
5930
5930
|
},
|
|
5931
5931
|
Property: function(expr, precedence, flags) {
|
|
5932
5932
|
return expr.kind === "get" || expr.kind === "set" ? [
|
|
@@ -6017,8 +6017,8 @@ var require_escodegen = __commonJS({
|
|
|
6017
6017
|
var result, i2, iz, fragment, that = this;
|
|
6018
6018
|
return result = expr.type === Syntax.GeneratorExpression ? ["("] : ["["], extra.moz.comprehensionExpressionStartsWithAssignment && (fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT), result.push(fragment)), expr.blocks && withIndent(function() {
|
|
6019
6019
|
for (i2 = 0, iz = expr.blocks.length; i2 < iz; ++i2)
|
|
6020
|
-
fragment = that.generateExpression(expr.blocks[i2], Precedence.Sequence, E_TTT), i2 > 0 || extra.moz.comprehensionExpressionStartsWithAssignment ? result =
|
|
6021
|
-
}), expr.filter && (result =
|
|
6020
|
+
fragment = that.generateExpression(expr.blocks[i2], Precedence.Sequence, E_TTT), i2 > 0 || extra.moz.comprehensionExpressionStartsWithAssignment ? result = join5(result, fragment) : result.push(fragment);
|
|
6021
|
+
}), expr.filter && (result = join5(result, "if" + space), fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT), result = join5(result, ["(", fragment, ")"])), extra.moz.comprehensionExpressionStartsWithAssignment || (fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT), result = join5(result, fragment)), result.push(expr.type === Syntax.GeneratorExpression ? ")" : "]"), result;
|
|
6022
6022
|
},
|
|
6023
6023
|
ComprehensionBlock: function(expr, precedence, flags) {
|
|
6024
6024
|
var fragment;
|
|
@@ -6026,7 +6026,7 @@ var require_escodegen = __commonJS({
|
|
|
6026
6026
|
expr.left.kind,
|
|
6027
6027
|
noEmptySpace(),
|
|
6028
6028
|
this.generateStatement(expr.left.declarations[0], S_FFFF)
|
|
6029
|
-
] : fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT), fragment =
|
|
6029
|
+
] : fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT), fragment = join5(fragment, expr.of ? "of" : "in"), fragment = join5(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT)), ["for" + space + "(", fragment, ")"];
|
|
6030
6030
|
},
|
|
6031
6031
|
SpreadElement: function(expr, precedence, flags) {
|
|
6032
6032
|
return [
|
|
@@ -6167,7 +6167,7 @@ __export(acorn_exports, {
|
|
|
6167
6167
|
lineBreak: () => lineBreak,
|
|
6168
6168
|
lineBreakG: () => lineBreakG,
|
|
6169
6169
|
nonASCIIwhitespace: () => nonASCIIwhitespace,
|
|
6170
|
-
parse: () =>
|
|
6170
|
+
parse: () => parse3,
|
|
6171
6171
|
parseExpressionAt: () => parseExpressionAt2,
|
|
6172
6172
|
tokContexts: () => types,
|
|
6173
6173
|
tokTypes: () => types$1,
|
|
@@ -6335,7 +6335,7 @@ function stringToNumber(str, isLegacyOctalNumericLiteral) {
|
|
|
6335
6335
|
function stringToBigInt(str) {
|
|
6336
6336
|
return typeof BigInt != "function" ? null : BigInt(str.replace(/_/g, ""));
|
|
6337
6337
|
}
|
|
6338
|
-
function
|
|
6338
|
+
function parse3(input, options) {
|
|
6339
6339
|
return Parser.parse(input, options);
|
|
6340
6340
|
}
|
|
6341
6341
|
function parseExpressionAt2(input, pos, options) {
|
|
@@ -6629,8 +6629,8 @@ var astralIdentifierCodes, astralIdentifierStartCodes, nonASCIIidentifierChars,
|
|
|
6629
6629
|
return new this(options, input).parse();
|
|
6630
6630
|
};
|
|
6631
6631
|
Parser.parseExpressionAt = function(input, pos, options) {
|
|
6632
|
-
var
|
|
6633
|
-
return
|
|
6632
|
+
var parser = new this(options, input, pos);
|
|
6633
|
+
return parser.nextToken(), parser.parseExpression();
|
|
6634
6634
|
};
|
|
6635
6635
|
Parser.tokenizer = function(input, options) {
|
|
6636
6636
|
return new this(options, input);
|
|
@@ -7958,8 +7958,8 @@ var astralIdentifierCodes, astralIdentifierStartCodes, nonASCIIidentifierChars,
|
|
|
7958
7958
|
return scope;
|
|
7959
7959
|
}
|
|
7960
7960
|
};
|
|
7961
|
-
Node = function(
|
|
7962
|
-
this.type = "", this.start = pos, this.end = 0,
|
|
7961
|
+
Node = function(parser, pos, loc) {
|
|
7962
|
+
this.type = "", this.start = pos, this.end = 0, parser.options.locations && (this.loc = new SourceLocation(parser, loc)), parser.options.directSourceFile && (this.sourceFile = parser.options.directSourceFile), parser.options.ranges && (this.range = [pos, 0]);
|
|
7963
7963
|
}, pp$2 = Parser.prototype;
|
|
7964
7964
|
pp$2.startNode = function() {
|
|
7965
7965
|
return new Node(this, this.start, this.startLoc);
|
|
@@ -8016,8 +8016,8 @@ var astralIdentifierCodes, astralIdentifierStartCodes, nonASCIIidentifierChars,
|
|
|
8016
8016
|
BranchID.prototype.sibling = function() {
|
|
8017
8017
|
return new BranchID(this.parent, this.base);
|
|
8018
8018
|
};
|
|
8019
|
-
RegExpValidationState = function(
|
|
8020
|
-
this.parser =
|
|
8019
|
+
RegExpValidationState = function(parser) {
|
|
8020
|
+
this.parser = parser, this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = /* @__PURE__ */ Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
8021
8021
|
};
|
|
8022
8022
|
RegExpValidationState.prototype.reset = function(start, pattern, flags) {
|
|
8023
8023
|
var unicodeSets = flags.indexOf("v") !== -1, unicode = flags.indexOf("u") !== -1;
|
|
@@ -10534,11 +10534,11 @@ var require_filesystem = __commonJS({
|
|
|
10534
10534
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
10535
10535
|
exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = void 0;
|
|
10536
10536
|
var fs = __require("fs");
|
|
10537
|
-
function fileExistsSync(
|
|
10538
|
-
if (!fs.existsSync(
|
|
10537
|
+
function fileExistsSync(path2) {
|
|
10538
|
+
if (!fs.existsSync(path2))
|
|
10539
10539
|
return !1;
|
|
10540
10540
|
try {
|
|
10541
|
-
var stats = fs.statSync(
|
|
10541
|
+
var stats = fs.statSync(path2);
|
|
10542
10542
|
return stats.isFile();
|
|
10543
10543
|
} catch {
|
|
10544
10544
|
return !1;
|
|
@@ -10550,8 +10550,8 @@ var require_filesystem = __commonJS({
|
|
|
10550
10550
|
return __require(packageJsonPath);
|
|
10551
10551
|
}
|
|
10552
10552
|
exports.readJsonFromDiskSync = readJsonFromDiskSync;
|
|
10553
|
-
function readJsonFromDiskAsync(
|
|
10554
|
-
fs.readFile(
|
|
10553
|
+
function readJsonFromDiskAsync(path2, callback) {
|
|
10554
|
+
fs.readFile(path2, "utf8", function(err, result) {
|
|
10555
10555
|
if (err || !result)
|
|
10556
10556
|
return callback();
|
|
10557
10557
|
var json = JSON.parse(result);
|
|
@@ -10559,16 +10559,16 @@ var require_filesystem = __commonJS({
|
|
|
10559
10559
|
});
|
|
10560
10560
|
}
|
|
10561
10561
|
exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
|
|
10562
|
-
function fileExistsAsync(
|
|
10563
|
-
fs.stat(
|
|
10562
|
+
function fileExistsAsync(path2, callback2) {
|
|
10563
|
+
fs.stat(path2, function(err, stats) {
|
|
10564
10564
|
if (err)
|
|
10565
10565
|
return callback2(void 0, !1);
|
|
10566
10566
|
callback2(void 0, stats ? stats.isFile() : !1);
|
|
10567
10567
|
});
|
|
10568
10568
|
}
|
|
10569
10569
|
exports.fileExistsAsync = fileExistsAsync;
|
|
10570
|
-
function removeExtension(
|
|
10571
|
-
return
|
|
10570
|
+
function removeExtension(path2) {
|
|
10571
|
+
return path2.substring(0, path2.lastIndexOf(".")) || path2;
|
|
10572
10572
|
}
|
|
10573
10573
|
exports.removeExtension = removeExtension;
|
|
10574
10574
|
}
|
|
@@ -10580,14 +10580,14 @@ var require_mapping_entry = __commonJS({
|
|
|
10580
10580
|
"use strict";
|
|
10581
10581
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
10582
10582
|
exports.getAbsoluteMappingEntries = void 0;
|
|
10583
|
-
var
|
|
10583
|
+
var path2 = __require("path");
|
|
10584
10584
|
function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
|
|
10585
10585
|
for (var sortedKeys = sortByLongestPrefix(Object.keys(paths)), absolutePaths = [], _i = 0, sortedKeys_1 = sortedKeys; _i < sortedKeys_1.length; _i++) {
|
|
10586
10586
|
var key = sortedKeys_1[_i];
|
|
10587
10587
|
absolutePaths.push({
|
|
10588
10588
|
pattern: key,
|
|
10589
10589
|
paths: paths[key].map(function(pathToResolve) {
|
|
10590
|
-
return
|
|
10590
|
+
return path2.resolve(absoluteBaseUrl, pathToResolve);
|
|
10591
10591
|
})
|
|
10592
10592
|
});
|
|
10593
10593
|
}
|
|
@@ -10615,7 +10615,7 @@ var require_try_path = __commonJS({
|
|
|
10615
10615
|
"use strict";
|
|
10616
10616
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
10617
10617
|
exports.exhaustiveTypeException = exports.getStrippedPath = exports.getPathsToTry = void 0;
|
|
10618
|
-
var
|
|
10618
|
+
var path2 = __require("path"), path_1 = __require("path"), filesystem_1 = require_filesystem();
|
|
10619
10619
|
function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
|
|
10620
10620
|
if (!(!absolutePathMappings || !requestedModule || requestedModule[0] === ".")) {
|
|
10621
10621
|
for (var pathsToTry = [], _i = 0, absolutePathMappings_1 = absolutePathMappings; _i < absolutePathMappings_1.length; _i++) {
|
|
@@ -10627,9 +10627,9 @@ var require_try_path = __commonJS({
|
|
|
10627
10627
|
return { type: "extension", path: physicalPath + e };
|
|
10628
10628
|
})), pathsToTry.push({
|
|
10629
10629
|
type: "package",
|
|
10630
|
-
path:
|
|
10630
|
+
path: path2.join(physicalPath, "/package.json")
|
|
10631
10631
|
});
|
|
10632
|
-
var indexPath =
|
|
10632
|
+
var indexPath = path2.join(physicalPath, "/index");
|
|
10633
10633
|
pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
|
|
10634
10634
|
return { type: "index", path: indexPath + e };
|
|
10635
10635
|
}));
|
|
@@ -10671,7 +10671,7 @@ var require_match_path_sync = __commonJS({
|
|
|
10671
10671
|
"use strict";
|
|
10672
10672
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
10673
10673
|
exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
|
|
10674
|
-
var
|
|
10674
|
+
var path2 = __require("path"), Filesystem = require_filesystem(), MappingEntry = require_mapping_entry(), TryPath = require_try_path();
|
|
10675
10675
|
function createMatchPath2(absoluteBaseUrl, paths, mainFields, addMatchAll) {
|
|
10676
10676
|
mainFields === void 0 && (mainFields = ["main"]), addMatchAll === void 0 && (addMatchAll = !0);
|
|
10677
10677
|
var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
|
|
@@ -10693,7 +10693,7 @@ var require_match_path_sync = __commonJS({
|
|
|
10693
10693
|
return obj[key];
|
|
10694
10694
|
}, packageJson);
|
|
10695
10695
|
if (candidateMapping && typeof candidateMapping == "string") {
|
|
10696
|
-
var candidateFilePath =
|
|
10696
|
+
var candidateFilePath = path2.join(path2.dirname(packageJsonPath), candidateMapping);
|
|
10697
10697
|
if (fileExists(candidateFilePath))
|
|
10698
10698
|
return candidateFilePath;
|
|
10699
10699
|
}
|
|
@@ -10726,7 +10726,7 @@ var require_match_path_async = __commonJS({
|
|
|
10726
10726
|
"use strict";
|
|
10727
10727
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
10728
10728
|
exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = void 0;
|
|
10729
|
-
var
|
|
10729
|
+
var path2 = __require("path"), TryPath = require_try_path(), MappingEntry = require_mapping_entry(), Filesystem = require_filesystem();
|
|
10730
10730
|
function createMatchPathAsync(absoluteBaseUrl, paths, mainFields, addMatchAll) {
|
|
10731
10731
|
mainFields === void 0 && (mainFields = ["main"]), addMatchAll === void 0 && (addMatchAll = !0);
|
|
10732
10732
|
var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
|
|
@@ -10753,7 +10753,7 @@ var require_match_path_async = __commonJS({
|
|
|
10753
10753
|
}, packageJson);
|
|
10754
10754
|
if (typeof mainFieldMapping != "string")
|
|
10755
10755
|
return tryNext();
|
|
10756
|
-
var mappedFilePath =
|
|
10756
|
+
var mappedFilePath = path2.join(path2.dirname(packageJsonPath), mainFieldMapping);
|
|
10757
10757
|
fileExistsAsync(mappedFilePath, function(err, exists) {
|
|
10758
10758
|
return err ? doneCallback(err) : exists ? doneCallback(void 0, mappedFilePath) : tryNext();
|
|
10759
10759
|
});
|
|
@@ -11665,7 +11665,7 @@ var require_tsconfig_loader = __commonJS({
|
|
|
11665
11665
|
};
|
|
11666
11666
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
11667
11667
|
exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = void 0;
|
|
11668
|
-
var
|
|
11668
|
+
var path2 = __require("path"), fs = __require("fs"), JSON5 = require_lib(), StripBom = require_strip_bom();
|
|
11669
11669
|
function tsConfigLoader(_a) {
|
|
11670
11670
|
var getEnv = _a.getEnv, cwd2 = _a.cwd, _b = _a.loadSync, loadSync = _b === void 0 ? loadSyncDefault : _b, TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT"), TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL"), loadResult = loadSync(cwd2, TS_NODE_PROJECT, TS_NODE_BASEURL);
|
|
11671
11671
|
return loadResult;
|
|
@@ -11688,22 +11688,22 @@ var require_tsconfig_loader = __commonJS({
|
|
|
11688
11688
|
}
|
|
11689
11689
|
function resolveConfigPath(cwd2, filename) {
|
|
11690
11690
|
if (filename) {
|
|
11691
|
-
var absolutePath = fs.lstatSync(filename).isDirectory() ?
|
|
11691
|
+
var absolutePath = fs.lstatSync(filename).isDirectory() ? path2.resolve(filename, "./tsconfig.json") : path2.resolve(cwd2, filename);
|
|
11692
11692
|
return absolutePath;
|
|
11693
11693
|
}
|
|
11694
11694
|
if (fs.statSync(cwd2).isFile())
|
|
11695
|
-
return
|
|
11695
|
+
return path2.resolve(cwd2);
|
|
11696
11696
|
var configAbsolutePath = walkForTsConfig(cwd2);
|
|
11697
|
-
return configAbsolutePath ?
|
|
11697
|
+
return configAbsolutePath ? path2.resolve(configAbsolutePath) : void 0;
|
|
11698
11698
|
}
|
|
11699
11699
|
function walkForTsConfig(directory, readdirSync) {
|
|
11700
11700
|
readdirSync === void 0 && (readdirSync = fs.readdirSync);
|
|
11701
11701
|
for (var files = readdirSync(directory), filesToCheck = ["tsconfig.json", "jsconfig.json"], _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) {
|
|
11702
11702
|
var fileToCheck = filesToCheck_1[_i];
|
|
11703
11703
|
if (files.indexOf(fileToCheck) !== -1)
|
|
11704
|
-
return
|
|
11704
|
+
return path2.join(directory, fileToCheck);
|
|
11705
11705
|
}
|
|
11706
|
-
var parentDirectory =
|
|
11706
|
+
var parentDirectory = path2.dirname(directory);
|
|
11707
11707
|
if (directory !== parentDirectory)
|
|
11708
11708
|
return walkForTsConfig(parentDirectory, readdirSync);
|
|
11709
11709
|
}
|
|
@@ -11732,12 +11732,12 @@ var require_tsconfig_loader = __commonJS({
|
|
|
11732
11732
|
function loadTsconfigFromExtends(configFilePath, extendedConfigValue, existsSync3, readFileSync2) {
|
|
11733
11733
|
var _a;
|
|
11734
11734
|
typeof extendedConfigValue == "string" && extendedConfigValue.indexOf(".json") === -1 && (extendedConfigValue += ".json");
|
|
11735
|
-
var currentDir =
|
|
11736
|
-
extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync3(extendedConfigPath) && (extendedConfigPath =
|
|
11735
|
+
var currentDir = path2.dirname(configFilePath), extendedConfigPath = path2.join(currentDir, extendedConfigValue);
|
|
11736
|
+
extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync3(extendedConfigPath) && (extendedConfigPath = path2.join(currentDir, "node_modules", extendedConfigValue));
|
|
11737
11737
|
var config = loadTsconfig(extendedConfigPath, existsSync3, readFileSync2) || {};
|
|
11738
11738
|
if (!((_a = config.compilerOptions) === null || _a === void 0) && _a.baseUrl) {
|
|
11739
|
-
var extendsDir =
|
|
11740
|
-
config.compilerOptions.baseUrl =
|
|
11739
|
+
var extendsDir = path2.dirname(extendedConfigValue);
|
|
11740
|
+
config.compilerOptions.baseUrl = path2.join(extendsDir, config.compilerOptions.baseUrl);
|
|
11741
11741
|
}
|
|
11742
11742
|
return config;
|
|
11743
11743
|
}
|
|
@@ -11753,7 +11753,7 @@ var require_config_loader = __commonJS({
|
|
|
11753
11753
|
"use strict";
|
|
11754
11754
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
11755
11755
|
exports.configLoader = exports.loadConfig = void 0;
|
|
11756
|
-
var TsConfigLoader2 = require_tsconfig_loader(),
|
|
11756
|
+
var TsConfigLoader2 = require_tsconfig_loader(), path2 = __require("path");
|
|
11757
11757
|
function loadConfig2(cwd2) {
|
|
11758
11758
|
return cwd2 === void 0 && (cwd2 = process.cwd()), configLoader({ cwd: cwd2 });
|
|
11759
11759
|
}
|
|
@@ -11761,7 +11761,7 @@ var require_config_loader = __commonJS({
|
|
|
11761
11761
|
function configLoader(_a) {
|
|
11762
11762
|
var cwd2 = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
|
|
11763
11763
|
if (explicitParams) {
|
|
11764
|
-
var absoluteBaseUrl =
|
|
11764
|
+
var absoluteBaseUrl = path2.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path2.join(cwd2, explicitParams.baseUrl);
|
|
11765
11765
|
return {
|
|
11766
11766
|
resultType: "success",
|
|
11767
11767
|
configFileAbsolutePath: "",
|
|
@@ -11782,7 +11782,7 @@ var require_config_loader = __commonJS({
|
|
|
11782
11782
|
resultType: "success",
|
|
11783
11783
|
configFileAbsolutePath: loadResult.tsConfigPath,
|
|
11784
11784
|
baseUrl: loadResult.baseUrl,
|
|
11785
|
-
absoluteBaseUrl:
|
|
11785
|
+
absoluteBaseUrl: path2.resolve(path2.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
|
|
11786
11786
|
paths: loadResult.paths || {},
|
|
11787
11787
|
addMatchAll: loadResult.baseUrl !== void 0
|
|
11788
11788
|
} : {
|
|
@@ -12073,11 +12073,11 @@ var require_caller = __commonJS({
|
|
|
12073
12073
|
var require_path_parse = __commonJS({
|
|
12074
12074
|
"../../../node_modules/path-parse/index.js"(exports, module) {
|
|
12075
12075
|
"use strict";
|
|
12076
|
-
var isWindows = process.platform === "win32", splitWindowsRe = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,
|
|
12076
|
+
var isWindows = process.platform === "win32", splitWindowsRe = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, win322 = {};
|
|
12077
12077
|
function win32SplitPath(filename) {
|
|
12078
12078
|
return splitWindowsRe.exec(filename).slice(1);
|
|
12079
12079
|
}
|
|
12080
|
-
|
|
12080
|
+
win322.parse = function(pathString) {
|
|
12081
12081
|
if (typeof pathString != "string")
|
|
12082
12082
|
throw new TypeError(
|
|
12083
12083
|
"Parameter 'pathString' must be a string, not " + typeof pathString
|
|
@@ -12093,11 +12093,11 @@ var require_path_parse = __commonJS({
|
|
|
12093
12093
|
name: allParts[3]
|
|
12094
12094
|
};
|
|
12095
12095
|
};
|
|
12096
|
-
var splitPathRe = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,
|
|
12096
|
+
var splitPathRe = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/, posix2 = {};
|
|
12097
12097
|
function posixSplitPath(filename) {
|
|
12098
12098
|
return splitPathRe.exec(filename).slice(1);
|
|
12099
12099
|
}
|
|
12100
|
-
|
|
12100
|
+
posix2.parse = function(pathString) {
|
|
12101
12101
|
if (typeof pathString != "string")
|
|
12102
12102
|
throw new TypeError(
|
|
12103
12103
|
"Parameter 'pathString' must be a string, not " + typeof pathString
|
|
@@ -12113,16 +12113,16 @@ var require_path_parse = __commonJS({
|
|
|
12113
12113
|
name: allParts[3]
|
|
12114
12114
|
};
|
|
12115
12115
|
};
|
|
12116
|
-
isWindows ? module.exports =
|
|
12117
|
-
module.exports.posix =
|
|
12118
|
-
module.exports.win32 =
|
|
12116
|
+
isWindows ? module.exports = win322.parse : module.exports = posix2.parse;
|
|
12117
|
+
module.exports.posix = posix2.parse;
|
|
12118
|
+
module.exports.win32 = win322.parse;
|
|
12119
12119
|
}
|
|
12120
12120
|
});
|
|
12121
12121
|
|
|
12122
12122
|
// ../../../node_modules/resolve/lib/node-modules-paths.js
|
|
12123
12123
|
var require_node_modules_paths = __commonJS({
|
|
12124
12124
|
"../../../node_modules/resolve/lib/node-modules-paths.js"(exports, module) {
|
|
12125
|
-
var
|
|
12125
|
+
var path2 = __require("path"), parse7 = path2.parse || require_path_parse(), driveLetterRegex = /^([A-Za-z]:)/, uncPathRegex = /^\\\\/;
|
|
12126
12126
|
function getNodeModulesDirs(absoluteStart, modules) {
|
|
12127
12127
|
var prefix = "/";
|
|
12128
12128
|
driveLetterRegex.test(absoluteStart) ? prefix = "" : uncPathRegex.test(absoluteStart) && (prefix = "\\\\");
|
|
@@ -12130,7 +12130,7 @@ var require_node_modules_paths = __commonJS({
|
|
|
12130
12130
|
paths.push(parsed.dir), parsed = parse7(parsed.dir);
|
|
12131
12131
|
return paths.reduce(function(dirs, aPath) {
|
|
12132
12132
|
return dirs.concat(modules.map(function(moduleDir) {
|
|
12133
|
-
return
|
|
12133
|
+
return path2.resolve(prefix, aPath, moduleDir);
|
|
12134
12134
|
}));
|
|
12135
12135
|
}, []);
|
|
12136
12136
|
}
|
|
@@ -12154,7 +12154,7 @@ var require_node_modules_paths = __commonJS({
|
|
|
12154
12154
|
// ../../../node_modules/resolve/lib/normalize-options.js
|
|
12155
12155
|
var require_normalize_options = __commonJS({
|
|
12156
12156
|
"../../../node_modules/resolve/lib/normalize-options.js"(exports, module) {
|
|
12157
|
-
var
|
|
12157
|
+
var path2 = __require("path");
|
|
12158
12158
|
module.exports = function(_, opts) {
|
|
12159
12159
|
if (opts = opts || {}, opts.forceNodeResolution || !process.versions.pnp)
|
|
12160
12160
|
return opts;
|
|
@@ -12162,7 +12162,7 @@ var require_normalize_options = __commonJS({
|
|
|
12162
12162
|
let parts = request.match(/^((?:@[^/]+\/)?[^/]+)(\/.*)?/);
|
|
12163
12163
|
if (!parts)
|
|
12164
12164
|
throw new Error(`Assertion failed: Expected the "resolve" package to call the "paths" callback with package names only (got "${request}")`);
|
|
12165
|
-
basedir.charAt(basedir.length - 1) !== "/" && (basedir =
|
|
12165
|
+
basedir.charAt(basedir.length - 1) !== "/" && (basedir = path2.join(basedir, "/"));
|
|
12166
12166
|
let api = findPnpApi(basedir);
|
|
12167
12167
|
if (api === null)
|
|
12168
12168
|
return;
|
|
@@ -12174,7 +12174,7 @@ var require_normalize_options = __commonJS({
|
|
|
12174
12174
|
}
|
|
12175
12175
|
if (manifestPath === null)
|
|
12176
12176
|
throw new Error(`Assertion failed: The resolution thinks that "${parts[1]}" is a Node builtin`);
|
|
12177
|
-
let packagePath =
|
|
12177
|
+
let packagePath = path2.dirname(manifestPath), unqualifiedPath = typeof parts[2] < "u" ? path2.join(packagePath, parts[2]) : packagePath;
|
|
12178
12178
|
return { packagePath, unqualifiedPath };
|
|
12179
12179
|
}, runPnpResolutionOnArray = (request, paths2) => {
|
|
12180
12180
|
for (let i2 = 0; i2 < paths2.length; i2++) {
|
|
@@ -12190,8 +12190,8 @@ var require_normalize_options = __commonJS({
|
|
|
12190
12190
|
let pathsToTest = [basedir].concat(originalPaths), resolution = runPnpResolutionOnArray(request, pathsToTest);
|
|
12191
12191
|
if (resolution == null)
|
|
12192
12192
|
return getNodeModulePaths().concat(originalPaths);
|
|
12193
|
-
let nodeModules =
|
|
12194
|
-
return request.match(/^@[^/]+\//) && (nodeModules =
|
|
12193
|
+
let nodeModules = path2.dirname(resolution.packagePath);
|
|
12194
|
+
return request.match(/^@[^/]+\//) && (nodeModules = path2.dirname(nodeModules)), [nodeModules];
|
|
12195
12195
|
}, isInsideIterator = !1;
|
|
12196
12196
|
return opts.__skipPackageIterator || (opts.packageIterator = function(request, basedir, getCandidates, opts2) {
|
|
12197
12197
|
isInsideIterator = !0;
|
|
@@ -12494,11 +12494,11 @@ var require_type = __commonJS({
|
|
|
12494
12494
|
// ../../../node_modules/resolve/lib/async.js
|
|
12495
12495
|
var require_async = __commonJS({
|
|
12496
12496
|
"../../../node_modules/resolve/lib/async.js"(exports, module) {
|
|
12497
|
-
var fs = __require("fs"), getHomedir = require_homedir(),
|
|
12497
|
+
var fs = __require("fs"), getHomedir = require_homedir(), path2 = __require("path"), caller = require_caller(), nodeModulesPaths = require_node_modules_paths(), normalizeOptions = require_normalize_options(), isCore = require_is_core_module(), $Error = require_es_errors(), $TypeError = require_type(), realpathFS = process.platform !== "win32" && fs.realpath && typeof fs.realpath.native == "function" ? fs.realpath.native : fs.realpath, relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/, windowsDriveRegex = /^\w:[/\\]*$/, nodeModulesRegex = /[/\\]node_modules[/\\]*$/, homedir = getHomedir();
|
|
12498
12498
|
function defaultPaths() {
|
|
12499
12499
|
return homedir ? [
|
|
12500
|
-
|
|
12501
|
-
|
|
12500
|
+
path2.join(homedir, ".node_modules"),
|
|
12501
|
+
path2.join(homedir, ".node_libraries")
|
|
12502
12502
|
] : [];
|
|
12503
12503
|
}
|
|
12504
12504
|
var defaultIsFile = function(file, cb) {
|
|
@@ -12531,7 +12531,7 @@ var require_async = __commonJS({
|
|
|
12531
12531
|
}
|
|
12532
12532
|
function getPackageCandidates(x, start, opts) {
|
|
12533
12533
|
for (var dirs = nodeModulesPaths(start, opts, x), i2 = 0; i2 < dirs.length; i2++)
|
|
12534
|
-
dirs[i2] =
|
|
12534
|
+
dirs[i2] = path2.join(dirs[i2], x);
|
|
12535
12535
|
return dirs;
|
|
12536
12536
|
}
|
|
12537
12537
|
module.exports = function(x, options, callback) {
|
|
@@ -12550,9 +12550,9 @@ var require_async = __commonJS({
|
|
|
12550
12550
|
cb(conflictErr);
|
|
12551
12551
|
});
|
|
12552
12552
|
}
|
|
12553
|
-
var packageIterator = opts.packageIterator, extensions = opts.extensions || [".js"], includeCoreModules = opts.includeCoreModules !== !1, basedir = opts.basedir ||
|
|
12553
|
+
var packageIterator = opts.packageIterator, extensions = opts.extensions || [".js"], includeCoreModules = opts.includeCoreModules !== !1, basedir = opts.basedir || path2.dirname(caller()), parent = opts.filename || basedir;
|
|
12554
12554
|
opts.paths = opts.paths || defaultPaths();
|
|
12555
|
-
var absoluteStart =
|
|
12555
|
+
var absoluteStart = path2.resolve(basedir);
|
|
12556
12556
|
maybeRealpath(
|
|
12557
12557
|
realpath,
|
|
12558
12558
|
absoluteStart,
|
|
@@ -12564,7 +12564,7 @@ var require_async = __commonJS({
|
|
|
12564
12564
|
var res;
|
|
12565
12565
|
function init(basedir2) {
|
|
12566
12566
|
if (relativePathRegex.test(x))
|
|
12567
|
-
res =
|
|
12567
|
+
res = path2.resolve(basedir2, x), (x === "." || x === ".." || x.slice(-1) === "/") && (res += "/"), x.slice(-1) === "/" && res === basedir2 ? loadAsDirectory(res, opts.package, onfile) : loadAsFile(res, opts.package, onfile);
|
|
12568
12568
|
else {
|
|
12569
12569
|
if (includeCoreModules && isCore(x))
|
|
12570
12570
|
return cb(null, x);
|
|
@@ -12602,14 +12602,14 @@ var require_async = __commonJS({
|
|
|
12602
12602
|
function load(exts2, x3, loadPackage) {
|
|
12603
12603
|
if (exts2.length === 0) return cb2(null, void 0, loadPackage);
|
|
12604
12604
|
var file = x3 + exts2[0], pkg = loadPackage;
|
|
12605
|
-
pkg ? onpkg(null, pkg) : loadpkg(
|
|
12605
|
+
pkg ? onpkg(null, pkg) : loadpkg(path2.dirname(file), onpkg);
|
|
12606
12606
|
function onpkg(err2, pkg_, dir) {
|
|
12607
12607
|
if (pkg = pkg_, err2) return cb2(err2);
|
|
12608
12608
|
if (dir && pkg && opts.pathFilter) {
|
|
12609
|
-
var rfile =
|
|
12609
|
+
var rfile = path2.relative(dir, file), rel = rfile.slice(0, rfile.length - exts2[0].length), r = opts.pathFilter(pkg, x3, rel);
|
|
12610
12610
|
if (r) return load(
|
|
12611
12611
|
[""].concat(extensions),
|
|
12612
|
-
|
|
12612
|
+
path2.resolve(dir, r),
|
|
12613
12613
|
pkg
|
|
12614
12614
|
);
|
|
12615
12615
|
}
|
|
@@ -12625,10 +12625,10 @@ var require_async = __commonJS({
|
|
|
12625
12625
|
function loadpkg(dir, cb2) {
|
|
12626
12626
|
if (dir === "" || dir === "/" || process.platform === "win32" && windowsDriveRegex.test(dir) || nodeModulesRegex.test(dir)) return cb2(null);
|
|
12627
12627
|
maybeRealpath(realpath, dir, opts, function(unwrapErr, pkgdir) {
|
|
12628
|
-
if (unwrapErr) return loadpkg(
|
|
12629
|
-
var pkgfile =
|
|
12628
|
+
if (unwrapErr) return loadpkg(path2.dirname(dir), cb2);
|
|
12629
|
+
var pkgfile = path2.join(pkgdir, "package.json");
|
|
12630
12630
|
isFile2(pkgfile, function(err2, ex) {
|
|
12631
|
-
if (!ex) return loadpkg(
|
|
12631
|
+
if (!ex) return loadpkg(path2.dirname(dir), cb2);
|
|
12632
12632
|
readPackage(readFile, pkgfile, function(err3, pkgParam) {
|
|
12633
12633
|
if (err3)
|
|
12634
12634
|
return cb2(err3);
|
|
@@ -12642,10 +12642,10 @@ var require_async = __commonJS({
|
|
|
12642
12642
|
var cb2 = callback2, fpkg = loadAsDirectoryPackage;
|
|
12643
12643
|
typeof fpkg == "function" && (cb2 = fpkg, fpkg = opts.package), maybeRealpath(realpath, x2, opts, function(unwrapErr, pkgdir) {
|
|
12644
12644
|
if (unwrapErr) return cb2(unwrapErr);
|
|
12645
|
-
var pkgfile =
|
|
12645
|
+
var pkgfile = path2.join(pkgdir, "package.json");
|
|
12646
12646
|
isFile2(pkgfile, function(err2, ex) {
|
|
12647
12647
|
if (err2) return cb2(err2);
|
|
12648
|
-
if (!ex) return loadAsFile(
|
|
12648
|
+
if (!ex) return loadAsFile(path2.join(x2, "index"), fpkg, cb2);
|
|
12649
12649
|
readPackage(readFile, pkgfile, function(err3, pkgParam) {
|
|
12650
12650
|
if (err3) return cb2(err3);
|
|
12651
12651
|
var pkg = pkgParam;
|
|
@@ -12654,20 +12654,20 @@ var require_async = __commonJS({
|
|
|
12654
12654
|
var mainError = new $TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
|
|
12655
12655
|
return mainError.code = "INVALID_PACKAGE_MAIN", cb2(mainError);
|
|
12656
12656
|
}
|
|
12657
|
-
(pkg.main === "." || pkg.main === "./") && (pkg.main = "index"), loadAsFile(
|
|
12657
|
+
(pkg.main === "." || pkg.main === "./") && (pkg.main = "index"), loadAsFile(path2.resolve(x2, pkg.main), pkg, function(err4, m, pkg2) {
|
|
12658
12658
|
if (err4) return cb2(err4);
|
|
12659
12659
|
if (m) return cb2(null, m, pkg2);
|
|
12660
|
-
if (!pkg2) return loadAsFile(
|
|
12661
|
-
var dir =
|
|
12660
|
+
if (!pkg2) return loadAsFile(path2.join(x2, "index"), pkg2, cb2);
|
|
12661
|
+
var dir = path2.resolve(x2, pkg2.main);
|
|
12662
12662
|
loadAsDirectory(dir, pkg2, function(err5, n, pkg3) {
|
|
12663
12663
|
if (err5) return cb2(err5);
|
|
12664
12664
|
if (n) return cb2(null, n, pkg3);
|
|
12665
|
-
loadAsFile(
|
|
12665
|
+
loadAsFile(path2.join(x2, "index"), pkg3, cb2);
|
|
12666
12666
|
});
|
|
12667
12667
|
});
|
|
12668
12668
|
return;
|
|
12669
12669
|
}
|
|
12670
|
-
loadAsFile(
|
|
12670
|
+
loadAsFile(path2.join(x2, "/index"), pkg, cb2);
|
|
12671
12671
|
});
|
|
12672
12672
|
});
|
|
12673
12673
|
});
|
|
@@ -12675,7 +12675,7 @@ var require_async = __commonJS({
|
|
|
12675
12675
|
function processDirs(cb2, dirs) {
|
|
12676
12676
|
if (dirs.length === 0) return cb2(null, void 0);
|
|
12677
12677
|
var dir = dirs[0];
|
|
12678
|
-
isDirectory(
|
|
12678
|
+
isDirectory(path2.dirname(dir), isdir);
|
|
12679
12679
|
function isdir(err2, isdir2) {
|
|
12680
12680
|
if (err2) return cb2(err2);
|
|
12681
12681
|
if (!isdir2) return processDirs(cb2, dirs.slice(1));
|
|
@@ -12898,11 +12898,11 @@ var require_is_core = __commonJS({
|
|
|
12898
12898
|
// ../../../node_modules/resolve/lib/sync.js
|
|
12899
12899
|
var require_sync = __commonJS({
|
|
12900
12900
|
"../../../node_modules/resolve/lib/sync.js"(exports, module) {
|
|
12901
|
-
var isCore = require_is_core_module(), fs = __require("fs"),
|
|
12901
|
+
var isCore = require_is_core_module(), fs = __require("fs"), path2 = __require("path"), $Error = require_es_errors(), $TypeError = require_type(), getHomedir = require_homedir(), caller = require_caller(), nodeModulesPaths = require_node_modules_paths(), normalizeOptions = require_normalize_options(), realpathFS = process.platform !== "win32" && fs.realpathSync && typeof fs.realpathSync.native == "function" ? fs.realpathSync.native : fs.realpathSync, relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/, windowsDriveRegex = /^\w:[/\\]*$/, nodeModulesRegex = /[/\\]node_modules[/\\]*$/, homedir = getHomedir();
|
|
12902
12902
|
function defaultPaths() {
|
|
12903
12903
|
return homedir ? [
|
|
12904
|
-
|
|
12905
|
-
|
|
12904
|
+
path2.join(homedir, ".node_modules"),
|
|
12905
|
+
path2.join(homedir, ".node_libraries")
|
|
12906
12906
|
] : [];
|
|
12907
12907
|
}
|
|
12908
12908
|
var defaultIsFile = function(file) {
|
|
@@ -12943,7 +12943,7 @@ var require_sync = __commonJS({
|
|
|
12943
12943
|
}
|
|
12944
12944
|
function getPackageCandidates(x, start, opts) {
|
|
12945
12945
|
for (var dirs = nodeModulesPaths(start, opts, x), i2 = 0; i2 < dirs.length; i2++)
|
|
12946
|
-
dirs[i2] =
|
|
12946
|
+
dirs[i2] = path2.join(dirs[i2], x);
|
|
12947
12947
|
return dirs;
|
|
12948
12948
|
}
|
|
12949
12949
|
module.exports = function(x, options) {
|
|
@@ -12952,11 +12952,11 @@ var require_sync = __commonJS({
|
|
|
12952
12952
|
var opts = normalizeOptions(x, options), isFile2 = opts.isFile || defaultIsFile, readFileSync2 = opts.readFileSync || fs.readFileSync, isDirectory = opts.isDirectory || defaultIsDir, realpathSync = opts.realpathSync || defaultRealpathSync, readPackageSync = opts.readPackageSync || defaultReadPackageSync;
|
|
12953
12953
|
if (opts.readFileSync && opts.readPackageSync)
|
|
12954
12954
|
throw new $TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
12955
|
-
var packageIterator = opts.packageIterator, extensions = opts.extensions || [".js"], includeCoreModules = opts.includeCoreModules !== !1, basedir = opts.basedir ||
|
|
12955
|
+
var packageIterator = opts.packageIterator, extensions = opts.extensions || [".js"], includeCoreModules = opts.includeCoreModules !== !1, basedir = opts.basedir || path2.dirname(caller()), parent = opts.filename || basedir;
|
|
12956
12956
|
opts.paths = opts.paths || defaultPaths();
|
|
12957
|
-
var absoluteStart = maybeRealpathSync(realpathSync,
|
|
12957
|
+
var absoluteStart = maybeRealpathSync(realpathSync, path2.resolve(basedir), opts);
|
|
12958
12958
|
if (relativePathRegex.test(x)) {
|
|
12959
|
-
var res =
|
|
12959
|
+
var res = path2.resolve(absoluteStart, x);
|
|
12960
12960
|
(x === "." || x === ".." || x.slice(-1) === "/") && (res += "/");
|
|
12961
12961
|
var m = loadAsFileSync(res) || loadAsDirectorySync(res);
|
|
12962
12962
|
if (m) return maybeRealpathSync(realpathSync, m, opts);
|
|
@@ -12969,10 +12969,10 @@ var require_sync = __commonJS({
|
|
|
12969
12969
|
var err = new $Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
12970
12970
|
throw err.code = "MODULE_NOT_FOUND", err;
|
|
12971
12971
|
function loadAsFileSync(x2) {
|
|
12972
|
-
var pkg = loadpkg(
|
|
12972
|
+
var pkg = loadpkg(path2.dirname(x2));
|
|
12973
12973
|
if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
|
|
12974
|
-
var rfile =
|
|
12975
|
-
r && (x2 =
|
|
12974
|
+
var rfile = path2.relative(pkg.dir, x2), r = opts.pathFilter(pkg.pkg, x2, rfile);
|
|
12975
|
+
r && (x2 = path2.resolve(pkg.dir, r));
|
|
12976
12976
|
}
|
|
12977
12977
|
if (isFile2(x2))
|
|
12978
12978
|
return x2;
|
|
@@ -12984,9 +12984,9 @@ var require_sync = __commonJS({
|
|
|
12984
12984
|
}
|
|
12985
12985
|
function loadpkg(dir) {
|
|
12986
12986
|
if (!(dir === "" || dir === "/") && !(process.platform === "win32" && windowsDriveRegex.test(dir)) && !nodeModulesRegex.test(dir)) {
|
|
12987
|
-
var pkgfile =
|
|
12987
|
+
var pkgfile = path2.join(maybeRealpathSync(realpathSync, dir, opts), "package.json");
|
|
12988
12988
|
if (!isFile2(pkgfile))
|
|
12989
|
-
return loadpkg(
|
|
12989
|
+
return loadpkg(path2.dirname(dir));
|
|
12990
12990
|
var pkg = readPackageSync(readFileSync2, pkgfile);
|
|
12991
12991
|
return pkg && opts.packageFilter && (pkg = opts.packageFilter(
|
|
12992
12992
|
pkg,
|
|
@@ -12996,7 +12996,7 @@ var require_sync = __commonJS({
|
|
|
12996
12996
|
}
|
|
12997
12997
|
}
|
|
12998
12998
|
function loadAsDirectorySync(x2) {
|
|
12999
|
-
var pkgfile =
|
|
12999
|
+
var pkgfile = path2.join(maybeRealpathSync(realpathSync, x2, opts), "/package.json");
|
|
13000
13000
|
if (isFile2(pkgfile)) {
|
|
13001
13001
|
try {
|
|
13002
13002
|
var pkg = readPackageSync(readFileSync2, pkgfile);
|
|
@@ -13013,22 +13013,22 @@ var require_sync = __commonJS({
|
|
|
13013
13013
|
}
|
|
13014
13014
|
(pkg.main === "." || pkg.main === "./") && (pkg.main = "index");
|
|
13015
13015
|
try {
|
|
13016
|
-
var m2 = loadAsFileSync(
|
|
13016
|
+
var m2 = loadAsFileSync(path2.resolve(x2, pkg.main));
|
|
13017
13017
|
if (m2) return m2;
|
|
13018
|
-
var n2 = loadAsDirectorySync(
|
|
13018
|
+
var n2 = loadAsDirectorySync(path2.resolve(x2, pkg.main));
|
|
13019
13019
|
if (n2) return n2;
|
|
13020
13020
|
} catch {
|
|
13021
13021
|
}
|
|
13022
13022
|
}
|
|
13023
13023
|
}
|
|
13024
|
-
return loadAsFileSync(
|
|
13024
|
+
return loadAsFileSync(path2.join(x2, "/index"));
|
|
13025
13025
|
}
|
|
13026
13026
|
function loadNodeModulesSync(x2, start) {
|
|
13027
13027
|
for (var thunk = function() {
|
|
13028
13028
|
return getPackageCandidates(x2, start, opts);
|
|
13029
13029
|
}, dirs = packageIterator ? packageIterator(x2, start, thunk, opts) : thunk(), i2 = 0; i2 < dirs.length; i2++) {
|
|
13030
13030
|
var dir = dirs[i2];
|
|
13031
|
-
if (isDirectory(
|
|
13031
|
+
if (isDirectory(path2.dirname(dir))) {
|
|
13032
13032
|
var m2 = loadAsFileSync(dir);
|
|
13033
13033
|
if (m2) return m2;
|
|
13034
13034
|
var n2 = loadAsDirectorySync(dir);
|
|
@@ -13060,7 +13060,10 @@ import { logger as logger2 } from "storybook/internal/node-logger";
|
|
|
13060
13060
|
|
|
13061
13061
|
// src/componentManifest/utils.ts
|
|
13062
13062
|
import { readFileSync, statSync as statSync2 } from "node:fs";
|
|
13063
|
-
import {
|
|
13063
|
+
import {
|
|
13064
|
+
findTsconfigPath as findTsconfigPathCommon,
|
|
13065
|
+
resolveImport
|
|
13066
|
+
} from "storybook/internal/common";
|
|
13064
13067
|
import { logger } from "storybook/internal/node-logger";
|
|
13065
13068
|
|
|
13066
13069
|
// ../../../node_modules/empathic/find.mjs
|
|
@@ -13160,20 +13163,19 @@ var memoStore = /* @__PURE__ */ new WeakMap(), asyncMemoStore = /* @__PURE__ */
|
|
|
13160
13163
|
return mtimeMs !== void 0 && textFileCache.set(filePath, { mtimeMs, content }), content;
|
|
13161
13164
|
}, cachedFindUp = cached(up2, { name: "findUp" }), cachedResolveImport = cached(resolveImport, {
|
|
13162
13165
|
name: "resolveImport"
|
|
13163
|
-
}),
|
|
13164
|
-
(cwd2) =>
|
|
13165
|
-
|
|
13166
|
-
|
|
13167
|
-
|
|
13168
|
-
if (found)
|
|
13169
|
-
return found;
|
|
13170
|
-
}
|
|
13171
|
-
},
|
|
13172
|
-
{ name: "findTsconfigPath" }
|
|
13166
|
+
}), findTsconfigPath = cached(
|
|
13167
|
+
(cwd2) => findTsconfigPathCommon(cwd2),
|
|
13168
|
+
{
|
|
13169
|
+
name: "findTsconfigPath"
|
|
13170
|
+
}
|
|
13173
13171
|
);
|
|
13174
13172
|
|
|
13175
13173
|
// src/componentManifest/componentMeta/ComponentMetaProject.ts
|
|
13176
13174
|
var import_language_core = __toESM(require_language_core(), 1), import_typescript = __toESM(require_typescript(), 1);
|
|
13175
|
+
import {
|
|
13176
|
+
ProgramBackedProject,
|
|
13177
|
+
ProjectFileTracker
|
|
13178
|
+
} from "storybook/internal/component-meta";
|
|
13177
13179
|
import * as path from "path";
|
|
13178
13180
|
|
|
13179
13181
|
// src/componentManifest/componentMeta/componentMetaExtractor.ts
|
|
@@ -13869,116 +13871,68 @@ function hasExportModifier(typescript, node) {
|
|
|
13869
13871
|
}
|
|
13870
13872
|
|
|
13871
13873
|
// src/componentManifest/componentMeta/ComponentMetaProject.ts
|
|
13872
|
-
var ComponentMetaProject = class {
|
|
13874
|
+
var ComponentMetaProject = class extends ProgramBackedProject {
|
|
13873
13875
|
constructor(typescript, commandLine, configFileName, fsFileSnapshots = /* @__PURE__ */ new Map(), getCommandLineFn, documentRegistry) {
|
|
13876
|
+
super();
|
|
13874
13877
|
this.typescript = typescript;
|
|
13875
13878
|
this.commandLine = commandLine;
|
|
13876
13879
|
this.configFileName = configFileName;
|
|
13877
|
-
this.fsFileSnapshots = fsFileSnapshots;
|
|
13878
|
-
this.getCommandLineFn = getCommandLineFn;
|
|
13879
13880
|
this.documentRegistry = documentRegistry;
|
|
13880
|
-
|
|
13881
|
-
this.shouldCheckRootFiles = !1;
|
|
13882
|
-
/** Entries to extract — set by the generator, replayed during warmup for targeted type resolution. */
|
|
13881
|
+
/** Entries to extract - set by the generator, replayed during warmup for targeted type resolution. */
|
|
13883
13882
|
this.entries = [];
|
|
13883
|
+
this.files = new ProjectFileTracker(
|
|
13884
|
+
typescript,
|
|
13885
|
+
commandLine,
|
|
13886
|
+
fsFileSnapshots,
|
|
13887
|
+
(text) => typescript.ScriptSnapshot.fromString(text),
|
|
13888
|
+
getCommandLineFn
|
|
13889
|
+
);
|
|
13884
13890
|
let language = (0, import_language_core.createLanguage)(
|
|
13885
13891
|
[{ getLanguageId: (fileName) => (0, import_typescript.resolveFileLanguageId)(fileName) }],
|
|
13886
13892
|
new import_language_core.FileMap(typescript.sys.useCaseSensitiveFileNames),
|
|
13887
13893
|
(fileName, includeFsFiles) => {
|
|
13888
13894
|
if (!includeFsFiles)
|
|
13889
13895
|
return;
|
|
13890
|
-
let
|
|
13891
|
-
if (!cache || cache[0] !== modifiedTime)
|
|
13892
|
-
if (typescript.sys.fileExists(fileName)) {
|
|
13893
|
-
let text = typescript.sys.readFile(fileName), snapshot2 = text !== void 0 ? typescript.ScriptSnapshot.fromString(text) : void 0;
|
|
13894
|
-
fsFileSnapshots.set(fileName, [modifiedTime, snapshot2]);
|
|
13895
|
-
} else
|
|
13896
|
-
fsFileSnapshots.set(fileName, [modifiedTime, void 0]);
|
|
13897
|
-
let snapshot = fsFileSnapshots.get(fileName)?.[1];
|
|
13896
|
+
let snapshot = this.files.getSnapshot(fileName);
|
|
13898
13897
|
snapshot ? language.scripts.set(fileName, snapshot) : language.scripts.delete(fileName);
|
|
13899
13898
|
}
|
|
13900
13899
|
), projectHost = {
|
|
13901
13900
|
getCurrentDirectory: () => configFileName ? path.dirname(configFileName) : commandLine.options.rootDir ?? process.cwd(),
|
|
13902
13901
|
getCompilationSettings: () => this.commandLine.options,
|
|
13903
13902
|
getProjectReferences: () => this.commandLine.projectReferences,
|
|
13904
|
-
getProjectVersion
|
|
13905
|
-
|
|
13903
|
+
// getProjectVersion gates the language service's host re-sync; the tracker funnels every
|
|
13904
|
+
// invalidation into it.
|
|
13905
|
+
getProjectVersion: () => this.files.getProjectVersion(),
|
|
13906
|
+
getScriptFileNames: () => this.files.getScriptFileNames()
|
|
13906
13907
|
}, { languageServiceHost } = (0, import_typescript.createLanguageServiceHost)(
|
|
13907
13908
|
typescript,
|
|
13908
13909
|
typescript.sys,
|
|
13909
13910
|
language,
|
|
13910
13911
|
(s) => s,
|
|
13911
|
-
// asScriptId
|
|
13912
|
+
// asScriptId - identity for React (no URI mapping needed)
|
|
13912
13913
|
projectHost
|
|
13913
13914
|
);
|
|
13914
|
-
this.
|
|
13915
|
+
this.service = typescript.createLanguageService(languageServiceHost, this.documentRegistry);
|
|
13915
13916
|
}
|
|
13916
13917
|
getCommandLine() {
|
|
13917
13918
|
return this.commandLine;
|
|
13918
13919
|
}
|
|
13919
|
-
dispose() {
|
|
13920
|
-
clearTimeout(this.warmupTimer), this.ls.dispose();
|
|
13921
|
-
}
|
|
13922
13920
|
// ---------------------------------------------------------------------------
|
|
13923
13921
|
// Project management
|
|
13924
13922
|
// ---------------------------------------------------------------------------
|
|
13925
|
-
/**
|
|
13926
|
-
|
|
13927
|
-
|
|
13928
|
-
*/
|
|
13929
|
-
ensureFiles(fileNames) {
|
|
13930
|
-
let added = !1;
|
|
13931
|
-
for (let fileName of fileNames)
|
|
13932
|
-
this.commandLine.fileNames.includes(fileName) || (this.commandLine.fileNames.push(fileName), added = !0);
|
|
13933
|
-
added && this.projectVersion++;
|
|
13934
|
-
}
|
|
13935
|
-
/**
|
|
13936
|
-
* Adapted from:
|
|
13937
|
-
* https://github.com/volarjs/volar.js/blob/882cd56d46a13d272f34e451f495d3d62251969a/packages/kit/lib/createChecker.ts#L436-L447
|
|
13938
|
-
*/
|
|
13939
|
-
checkRootFilesUpdate() {
|
|
13940
|
-
if (!this.shouldCheckRootFiles || (this.shouldCheckRootFiles = !1, !this.getCommandLineFn))
|
|
13941
|
-
return;
|
|
13942
|
-
let newCommandLine = this.getCommandLineFn();
|
|
13943
|
-
arrayItemsEqual(newCommandLine.fileNames, this.commandLine.fileNames) || (this.commandLine.fileNames = newCommandLine.fileNames, this.projectVersion++);
|
|
13923
|
+
/** Cancels the warmup the base does not know about. */
|
|
13924
|
+
dispose() {
|
|
13925
|
+
clearTimeout(this.warmupTimer), super.dispose();
|
|
13944
13926
|
}
|
|
13945
13927
|
getSourceFile(fileName) {
|
|
13946
|
-
return this.
|
|
13947
|
-
}
|
|
13948
|
-
hasSourceFile(fileName) {
|
|
13949
|
-
return !!this.getSourceFile(fileName);
|
|
13950
|
-
}
|
|
13951
|
-
/**
|
|
13952
|
-
* Get all non-node_modules source file paths from the TS program. Used by ComponentMetaManager to
|
|
13953
|
-
* watch directories for file changes.
|
|
13954
|
-
*/
|
|
13955
|
-
getSourceFilePaths() {
|
|
13956
|
-
let program = this.ls.getProgram();
|
|
13957
|
-
return program ? program.getSourceFiles().map((sf) => sf.fileName.replace(/\\/g, "/")).filter((f) => !f.includes("node_modules")) : [];
|
|
13928
|
+
return this.service.getProgram()?.getSourceFile(fileName);
|
|
13958
13929
|
}
|
|
13959
|
-
/**
|
|
13960
|
-
* Adapted from:
|
|
13961
|
-
* https://github.com/volarjs/volar.js/blob/882cd56d46a13d272f34e451f495d3d62251969a/packages/kit/lib/createChecker.ts#L409-L432
|
|
13962
|
-
*
|
|
13963
|
-
* Created events only set shouldCheckRootFiles (version bump happens in checkRootFilesUpdate if
|
|
13964
|
-
* the file list actually changed). Deleted/created break early since they trigger a full config
|
|
13965
|
-
* reparse — processing remaining changes is unnecessary.
|
|
13966
|
-
*/
|
|
13967
13930
|
onFilesChanged(changes) {
|
|
13968
|
-
|
|
13969
|
-
|
|
13970
|
-
|
|
13971
|
-
|
|
13972
|
-
|
|
13973
|
-
program?.getSourceFile(filePath) && this.projectVersion++;
|
|
13974
|
-
else if (type === "deleted") {
|
|
13975
|
-
program?.getSourceFile(filePath) && this.projectVersion++, this.shouldCheckRootFiles = !0;
|
|
13976
|
-
break;
|
|
13977
|
-
} else if (type === "created") {
|
|
13978
|
-
this.shouldCheckRootFiles = !0;
|
|
13979
|
-
break;
|
|
13980
|
-
}
|
|
13981
|
-
this.projectVersion !== oldVersion && this.entries.length > 0 && (clearTimeout(this.warmupTimer), this.warmupTimer = setTimeout(() => {
|
|
13931
|
+
let program = this.service.getProgram();
|
|
13932
|
+
this.files.onFilesChanged(
|
|
13933
|
+
changes,
|
|
13934
|
+
(fileName) => !!program?.getSourceFile(fileName)
|
|
13935
|
+
) && this.entries.length > 0 && (clearTimeout(this.warmupTimer), this.warmupTimer = setTimeout(() => {
|
|
13982
13936
|
try {
|
|
13983
13937
|
this.extractPropsFromStories(this.entries);
|
|
13984
13938
|
} catch {
|
|
@@ -13986,15 +13940,15 @@ var ComponentMetaProject = class {
|
|
|
13986
13940
|
}, 100), this.warmupTimer?.unref?.());
|
|
13987
13941
|
}
|
|
13988
13942
|
// ---------------------------------------------------------------------------
|
|
13989
|
-
// Primary extraction method
|
|
13943
|
+
// Primary extraction method - probe-free
|
|
13990
13944
|
// ---------------------------------------------------------------------------
|
|
13991
13945
|
extractPropsFromStories(entries) {
|
|
13992
13946
|
this.entries = entries;
|
|
13993
13947
|
let allFiles = entries.flatMap(
|
|
13994
13948
|
(entry) => entry.component?.path ? [entry.storyPath, entry.component.path] : [entry.storyPath]
|
|
13995
13949
|
);
|
|
13996
|
-
this.ensureFiles(allFiles), this.ensureFresh(allFiles);
|
|
13997
|
-
let program = this.
|
|
13950
|
+
this.files.ensureFiles(allFiles), this.files.ensureFresh(allFiles);
|
|
13951
|
+
let program = this.service.getProgram();
|
|
13998
13952
|
if (!program)
|
|
13999
13953
|
return;
|
|
14000
13954
|
let checker = program.getTypeChecker(), serializationContextByComponentPath = /* @__PURE__ */ new Map();
|
|
@@ -14051,31 +14005,12 @@ var ComponentMetaProject = class {
|
|
|
14051
14005
|
continue;
|
|
14052
14006
|
}
|
|
14053
14007
|
}
|
|
14054
|
-
/**
|
|
14055
|
-
* Check mtime for specific files and bump projectVersion if any changed.
|
|
14056
|
-
*
|
|
14057
|
-
* This bypasses the sync() gate in createLanguageServiceHost — sync() only runs when
|
|
14058
|
-
* projectVersion changes, so mtime-based cache alone can't detect stale files. We do a targeted
|
|
14059
|
-
* mtime check for the files we're about to extract from, ensuring freshness even when the
|
|
14060
|
-
* fs.watch event hasn't arrived yet (race with HMR) or was missed entirely.
|
|
14061
|
-
*/
|
|
14062
|
-
ensureFresh(fileNames) {
|
|
14063
|
-
let stale = !1;
|
|
14064
|
-
for (let fileName of fileNames) {
|
|
14065
|
-
let cache = this.fsFileSnapshots.get(fileName);
|
|
14066
|
-
if (!cache)
|
|
14067
|
-
continue;
|
|
14068
|
-
let currentMtime = this.typescript.sys.getModifiedTime?.(fileName)?.valueOf();
|
|
14069
|
-
cache[0] !== currentMtime && (this.fsFileSnapshots.delete(fileName), stale = !0);
|
|
14070
|
-
}
|
|
14071
|
-
stale && this.projectVersion++;
|
|
14072
|
-
}
|
|
14073
14008
|
// ---------------------------------------------------------------------------
|
|
14074
14009
|
// Internal helpers
|
|
14075
14010
|
// ---------------------------------------------------------------------------
|
|
14076
14011
|
/**
|
|
14077
14012
|
* Path 2 fallback: resolve the component type from the story file's `meta.component` property.
|
|
14078
|
-
* Only works when the user explicitly set `component:` in the meta
|
|
14013
|
+
* Only works when the user explicitly set `component:` in the meta - no node means no
|
|
14079
14014
|
* extraction.
|
|
14080
14015
|
*/
|
|
14081
14016
|
resolveFromMetaComponent(checker, storySourceFile, componentRef) {
|
|
@@ -14097,7 +14032,7 @@ var ComponentMetaProject = class {
|
|
|
14097
14032
|
metaComponentInitializer
|
|
14098
14033
|
))
|
|
14099
14034
|
return;
|
|
14100
|
-
let componentType = checker.getTypeOfSymbol(componentProp), selectedSymbol =
|
|
14035
|
+
let componentType = checker.getTypeOfSymbol(componentProp), selectedSymbol = checker.getSymbolAtLocation(metaComponentInitializer);
|
|
14101
14036
|
if (memberAccess) {
|
|
14102
14037
|
let prop = componentType.getProperty(memberAccess);
|
|
14103
14038
|
if (prop)
|
|
@@ -14114,15 +14049,6 @@ var ComponentMetaProject = class {
|
|
|
14114
14049
|
};
|
|
14115
14050
|
}
|
|
14116
14051
|
};
|
|
14117
|
-
function arrayItemsEqual(a, b) {
|
|
14118
|
-
if (a.length !== b.length)
|
|
14119
|
-
return !1;
|
|
14120
|
-
let set = new Set(a);
|
|
14121
|
-
for (let file of b)
|
|
14122
|
-
if (!set.has(file))
|
|
14123
|
-
return !1;
|
|
14124
|
-
return !0;
|
|
14125
|
-
}
|
|
14126
14052
|
|
|
14127
14053
|
// src/componentManifest/componentMeta/ComponentMetaManager.ts
|
|
14128
14054
|
import { isFileInDir, sortTSConfigs } from "storybook/internal/component-meta";
|
|
@@ -14201,123 +14127,6 @@ var ComponentMetaManager = class extends BaseComponentMetaManager {
|
|
|
14201
14127
|
}
|
|
14202
14128
|
};
|
|
14203
14129
|
|
|
14204
|
-
// ../../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
|
14205
|
-
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
14206
|
-
function normalizeWindowsPath(input = "") {
|
|
14207
|
-
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
14208
|
-
}
|
|
14209
|
-
var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, sep = "/", delimiter = ":", normalize = function(path3) {
|
|
14210
|
-
if (path3.length === 0)
|
|
14211
|
-
return ".";
|
|
14212
|
-
path3 = normalizeWindowsPath(path3);
|
|
14213
|
-
let isUNCPath = path3.match(_UNC_REGEX), isPathAbsolute = isAbsolute2(path3), trailingSeparator = path3[path3.length - 1] === "/";
|
|
14214
|
-
return path3 = normalizeString(path3, !isPathAbsolute), path3.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path3 += "/"), _DRIVE_LETTER_RE.test(path3) && (path3 += "/"), isUNCPath ? isPathAbsolute ? `//${path3}` : `//./${path3}` : isPathAbsolute && !isAbsolute2(path3) ? `/${path3}` : path3);
|
|
14215
|
-
}, join3 = function(...arguments_) {
|
|
14216
|
-
if (arguments_.length === 0)
|
|
14217
|
-
return ".";
|
|
14218
|
-
let joined;
|
|
14219
|
-
for (let argument of arguments_)
|
|
14220
|
-
argument && argument.length > 0 && (joined === void 0 ? joined = argument : joined += `/${argument}`);
|
|
14221
|
-
return joined === void 0 ? "." : normalize(joined.replace(/\/\/+/g, "/"));
|
|
14222
|
-
};
|
|
14223
|
-
function cwd() {
|
|
14224
|
-
return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
|
|
14225
|
-
}
|
|
14226
|
-
var resolve2 = function(...arguments_) {
|
|
14227
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
14228
|
-
let resolvedPath = "", resolvedAbsolute = !1;
|
|
14229
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
14230
|
-
let path3 = index >= 0 ? arguments_[index] : cwd();
|
|
14231
|
-
!path3 || path3.length === 0 || (resolvedPath = `${path3}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path3));
|
|
14232
|
-
}
|
|
14233
|
-
return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
|
|
14234
|
-
};
|
|
14235
|
-
function normalizeString(path3, allowAboveRoot) {
|
|
14236
|
-
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
|
|
14237
|
-
for (let index = 0; index <= path3.length; ++index) {
|
|
14238
|
-
if (index < path3.length)
|
|
14239
|
-
char = path3[index];
|
|
14240
|
-
else {
|
|
14241
|
-
if (char === "/")
|
|
14242
|
-
break;
|
|
14243
|
-
char = "/";
|
|
14244
|
-
}
|
|
14245
|
-
if (char === "/") {
|
|
14246
|
-
if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
|
|
14247
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
14248
|
-
if (res.length > 2) {
|
|
14249
|
-
let lastSlashIndex = res.lastIndexOf("/");
|
|
14250
|
-
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
|
|
14251
|
-
continue;
|
|
14252
|
-
} else if (res.length > 0) {
|
|
14253
|
-
res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
|
|
14254
|
-
continue;
|
|
14255
|
-
}
|
|
14256
|
-
}
|
|
14257
|
-
allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
|
|
14258
|
-
} else
|
|
14259
|
-
res.length > 0 ? res += `/${path3.slice(lastSlash + 1, index)}` : res = path3.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
|
|
14260
|
-
lastSlash = index, dots = 0;
|
|
14261
|
-
} else char === "." && dots !== -1 ? ++dots : dots = -1;
|
|
14262
|
-
}
|
|
14263
|
-
return res;
|
|
14264
|
-
}
|
|
14265
|
-
var isAbsolute2 = function(p) {
|
|
14266
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
14267
|
-
}, toNamespacedPath = function(p) {
|
|
14268
|
-
return normalizeWindowsPath(p);
|
|
14269
|
-
}, _EXTNAME_RE = /.(\.[^./]+)$/, extname = function(p) {
|
|
14270
|
-
let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
14271
|
-
return match && match[1] || "";
|
|
14272
|
-
}, relative = function(from, to) {
|
|
14273
|
-
let _from = resolve2(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve2(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
14274
|
-
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
|
|
14275
|
-
return _to.join("/");
|
|
14276
|
-
let _fromCopy = [..._from];
|
|
14277
|
-
for (let segment of _fromCopy) {
|
|
14278
|
-
if (_to[0] !== segment)
|
|
14279
|
-
break;
|
|
14280
|
-
_from.shift(), _to.shift();
|
|
14281
|
-
}
|
|
14282
|
-
return [..._from.map(() => ".."), ..._to].join("/");
|
|
14283
|
-
}, dirname3 = function(p) {
|
|
14284
|
-
let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
14285
|
-
return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
|
|
14286
|
-
}, format = function(p) {
|
|
14287
|
-
let segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean);
|
|
14288
|
-
return normalizeWindowsPath(
|
|
14289
|
-
p.root ? resolve2(...segments) : segments.join("/")
|
|
14290
|
-
);
|
|
14291
|
-
}, basename = function(p, extension) {
|
|
14292
|
-
let lastSegment = normalizeWindowsPath(p).split("/").pop();
|
|
14293
|
-
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
14294
|
-
}, parse = function(p) {
|
|
14295
|
-
let root = normalizeWindowsPath(p).split("/").shift() || "/", base2 = basename(p), extension = extname(base2);
|
|
14296
|
-
return {
|
|
14297
|
-
root,
|
|
14298
|
-
dir: dirname3(p),
|
|
14299
|
-
base: base2,
|
|
14300
|
-
ext: extension,
|
|
14301
|
-
name: base2.slice(0, base2.length - extension.length)
|
|
14302
|
-
};
|
|
14303
|
-
}, path2 = {
|
|
14304
|
-
__proto__: null,
|
|
14305
|
-
basename,
|
|
14306
|
-
delimiter,
|
|
14307
|
-
dirname: dirname3,
|
|
14308
|
-
extname,
|
|
14309
|
-
format,
|
|
14310
|
-
isAbsolute: isAbsolute2,
|
|
14311
|
-
join: join3,
|
|
14312
|
-
normalize,
|
|
14313
|
-
normalizeString,
|
|
14314
|
-
parse,
|
|
14315
|
-
relative,
|
|
14316
|
-
resolve: resolve2,
|
|
14317
|
-
sep,
|
|
14318
|
-
toNamespacedPath
|
|
14319
|
-
};
|
|
14320
|
-
|
|
14321
14130
|
// src/extractProps.ts
|
|
14322
14131
|
import {
|
|
14323
14132
|
TypeSystem,
|
|
@@ -14510,7 +14319,7 @@ function parseExpression(expression) {
|
|
|
14510
14319
|
return null;
|
|
14511
14320
|
}
|
|
14512
14321
|
}
|
|
14513
|
-
function
|
|
14322
|
+
function parse4(value) {
|
|
14514
14323
|
let ast = acornParser.parse(`(${value})`, { ecmaVersion: 2020 }), parsingResult = {
|
|
14515
14324
|
inferredType: { type: "Unknown" /* UNKNOWN */ },
|
|
14516
14325
|
ast
|
|
@@ -14528,7 +14337,7 @@ function parse5(value) {
|
|
|
14528
14337
|
// src/docs/lib/inspection/inspectValue.ts
|
|
14529
14338
|
function inspectValue(value) {
|
|
14530
14339
|
try {
|
|
14531
|
-
return { ...
|
|
14340
|
+
return { ...parse4(value) };
|
|
14532
14341
|
} catch {
|
|
14533
14342
|
}
|
|
14534
14343
|
return { inferredType: { type: "Unknown" /* UNKNOWN */ } };
|
|
@@ -15509,16 +15318,16 @@ var extractArgTypes = (component) => {
|
|
|
15509
15318
|
// src/componentManifest/reactDocgen.ts
|
|
15510
15319
|
var import_ts_dedent2 = __toESM(require_dist(), 1), TsconfigPaths = __toESM(require_lib2(), 1);
|
|
15511
15320
|
import { existsSync as existsSync2 } from "node:fs";
|
|
15512
|
-
import { dirname as
|
|
15321
|
+
import { dirname as dirname3, sep } from "node:path";
|
|
15513
15322
|
import { babelParse, types as t } from "storybook/internal/babel";
|
|
15514
|
-
import { supportedExtensions as supportedExtensions2 } from "storybook/internal/common";
|
|
15323
|
+
import { findTsconfigPathForPath, supportedExtensions as supportedExtensions2 } from "storybook/internal/common";
|
|
15515
15324
|
import { extractJSDocInfo } from "storybook/internal/csf-tools";
|
|
15516
15325
|
import { logger as logger3 } from "storybook/internal/node-logger";
|
|
15517
15326
|
import {
|
|
15518
15327
|
builtinHandlers as docgenHandlers,
|
|
15519
15328
|
builtinResolvers as docgenResolver,
|
|
15520
15329
|
makeFsImporter,
|
|
15521
|
-
parse as
|
|
15330
|
+
parse as parse5
|
|
15522
15331
|
} from "react-docgen";
|
|
15523
15332
|
|
|
15524
15333
|
// src/componentManifest/reactDocgen/actualNameHandler.ts
|
|
@@ -15563,16 +15372,16 @@ var ReactDocgenResolveError = class extends Error {
|
|
|
15563
15372
|
// src/componentManifest/reactDocgen/exportNameHandler.ts
|
|
15564
15373
|
import { utils as utils2 } from "react-docgen";
|
|
15565
15374
|
var { isReactForwardRefCall: isReactForwardRefCall2 } = utils2;
|
|
15566
|
-
function nameFromId(
|
|
15567
|
-
if (
|
|
15568
|
-
if (
|
|
15569
|
-
return
|
|
15570
|
-
if (
|
|
15571
|
-
return
|
|
15375
|
+
function nameFromId(path2) {
|
|
15376
|
+
if (path2) {
|
|
15377
|
+
if (path2.isIdentifier())
|
|
15378
|
+
return path2.node.name;
|
|
15379
|
+
if (path2.isStringLiteral())
|
|
15380
|
+
return path2.node.value;
|
|
15572
15381
|
}
|
|
15573
15382
|
}
|
|
15574
|
-
function isInlineDefaultExport(
|
|
15575
|
-
let p =
|
|
15383
|
+
function isInlineDefaultExport(path2) {
|
|
15384
|
+
let p = path2;
|
|
15576
15385
|
for (; p && p.parentPath; ) {
|
|
15577
15386
|
if (p.parentPath.isExportDefaultDeclaration())
|
|
15578
15387
|
return !0;
|
|
@@ -15580,8 +15389,8 @@ function isInlineDefaultExport(path3) {
|
|
|
15580
15389
|
}
|
|
15581
15390
|
return !1;
|
|
15582
15391
|
}
|
|
15583
|
-
function findProgram(
|
|
15584
|
-
let found =
|
|
15392
|
+
function findProgram(path2) {
|
|
15393
|
+
let found = path2.findParent((p) => p.isProgram());
|
|
15585
15394
|
return found && found.isProgram() ? found : void 0;
|
|
15586
15395
|
}
|
|
15587
15396
|
function getLocalName(componentDefinition, fallback) {
|
|
@@ -15678,9 +15487,9 @@ function getMatchingDocgen(docgens, component) {
|
|
|
15678
15487
|
)
|
|
15679
15488
|
) ?? docgens[0];
|
|
15680
15489
|
}
|
|
15681
|
-
function matchPath(id,
|
|
15682
|
-
|
|
15683
|
-
let tsconfig = getTsConfig(
|
|
15490
|
+
function matchPath(id, importerPath) {
|
|
15491
|
+
importerPath ??= process.cwd();
|
|
15492
|
+
let tsconfig = getTsConfig(importerPath);
|
|
15684
15493
|
return tsconfig.resultType === "success" ? TsconfigPaths.createMatchPath(tsconfig.absoluteBaseUrl, tsconfig.paths, [
|
|
15685
15494
|
"browser",
|
|
15686
15495
|
"module",
|
|
@@ -15688,19 +15497,19 @@ function matchPath(id, basedir) {
|
|
|
15688
15497
|
])(id, void 0, void 0, supportedExtensions2) ?? id : id;
|
|
15689
15498
|
}
|
|
15690
15499
|
var getTsConfig = cached(
|
|
15691
|
-
(
|
|
15692
|
-
let tsconfigPath =
|
|
15693
|
-
return TsconfigPaths.loadConfig(tsconfigPath);
|
|
15500
|
+
(path2) => {
|
|
15501
|
+
let tsconfigPath = findTsconfigPathForPath(path2);
|
|
15502
|
+
return tsconfigPath ? TsconfigPaths.loadConfig(tsconfigPath) : { resultType: "failed", message: "Couldn't find tsconfig.json" };
|
|
15694
15503
|
},
|
|
15695
15504
|
{ name: "getTsConfig" }
|
|
15696
15505
|
), parseWithReactDocgen = cached(
|
|
15697
|
-
(code,
|
|
15506
|
+
(code, path2) => parse5(code, {
|
|
15698
15507
|
resolver: defaultResolver2,
|
|
15699
15508
|
handlers,
|
|
15700
15509
|
importer: getReactDocgenImporter(),
|
|
15701
|
-
filename:
|
|
15510
|
+
filename: path2
|
|
15702
15511
|
}),
|
|
15703
|
-
{ key: (code,
|
|
15512
|
+
{ key: (code, path2) => path2, name: "parseWithReactDocgen" }
|
|
15704
15513
|
), getExportPaths = cached(
|
|
15705
15514
|
(code, filePath) => {
|
|
15706
15515
|
let ast;
|
|
@@ -15709,10 +15518,10 @@ var getTsConfig = cached(
|
|
|
15709
15518
|
} catch {
|
|
15710
15519
|
return [];
|
|
15711
15520
|
}
|
|
15712
|
-
let basedir =
|
|
15521
|
+
let basedir = dirname3(filePath);
|
|
15713
15522
|
return ast.program.body.flatMap(
|
|
15714
15523
|
(statement) => t.isExportAllDeclaration(statement) ? [statement.source.value] : t.isExportNamedDeclaration(statement) && statement.source && !statement.declaration ? [statement.source.value] : []
|
|
15715
|
-
).map((id) => matchPath(id,
|
|
15524
|
+
).map((id) => matchPath(id, filePath)).flatMap((id) => {
|
|
15716
15525
|
try {
|
|
15717
15526
|
return [cachedResolveImport(id, { basedir })];
|
|
15718
15527
|
} catch (e) {
|
|
@@ -15722,13 +15531,13 @@ var getTsConfig = cached(
|
|
|
15722
15531
|
},
|
|
15723
15532
|
{ name: "getExportPaths" }
|
|
15724
15533
|
), gatherDocgensForPath = cached(
|
|
15725
|
-
(
|
|
15726
|
-
if (
|
|
15534
|
+
(path2, depth) => {
|
|
15535
|
+
if (path2.includes("node_modules"))
|
|
15727
15536
|
return {
|
|
15728
15537
|
docgens: [],
|
|
15729
15538
|
errors: [
|
|
15730
15539
|
{
|
|
15731
|
-
path:
|
|
15540
|
+
path: path2,
|
|
15732
15541
|
code: "/* File in node_modules */",
|
|
15733
15542
|
name: "Component file in node_modules",
|
|
15734
15543
|
message: import_ts_dedent2.dedent`
|
|
@@ -15757,16 +15566,16 @@ var getTsConfig = cached(
|
|
|
15757
15566
|
};
|
|
15758
15567
|
let code;
|
|
15759
15568
|
try {
|
|
15760
|
-
code = cachedReadFileSync(
|
|
15569
|
+
code = cachedReadFileSync(path2, "utf-8");
|
|
15761
15570
|
} catch {
|
|
15762
15571
|
return {
|
|
15763
15572
|
docgens: [],
|
|
15764
15573
|
errors: [
|
|
15765
15574
|
{
|
|
15766
|
-
path:
|
|
15575
|
+
path: path2,
|
|
15767
15576
|
code: "/* File not found or unreadable */",
|
|
15768
15577
|
name: "Component file could not be read",
|
|
15769
|
-
message: `Could not read the component file located at "${
|
|
15578
|
+
message: `Could not read the component file located at "${path2}".
|
|
15770
15579
|
Prefer relative imports if possible.`
|
|
15771
15580
|
}
|
|
15772
15581
|
]
|
|
@@ -15777,7 +15586,7 @@ Prefer relative imports if possible.`
|
|
|
15777
15586
|
docgens: [],
|
|
15778
15587
|
errors: [
|
|
15779
15588
|
{
|
|
15780
|
-
path:
|
|
15589
|
+
path: path2,
|
|
15781
15590
|
code,
|
|
15782
15591
|
name: "Max re-export depth exceeded",
|
|
15783
15592
|
message: import_ts_dedent2.dedent`
|
|
@@ -15789,10 +15598,10 @@ Prefer relative imports if possible.`
|
|
|
15789
15598
|
}
|
|
15790
15599
|
]
|
|
15791
15600
|
};
|
|
15792
|
-
let exportPaths = getExportPaths(code,
|
|
15601
|
+
let exportPaths = getExportPaths(code, path2).map((p) => gatherDocgensForPath(p, depth + 1)), docgens = exportPaths.flatMap((r) => r.docgens), errors = exportPaths.flatMap((r) => r.errors);
|
|
15793
15602
|
try {
|
|
15794
15603
|
return {
|
|
15795
|
-
docgens: [...parseWithReactDocgen(code,
|
|
15604
|
+
docgens: [...parseWithReactDocgen(code, path2), ...docgens],
|
|
15796
15605
|
errors
|
|
15797
15606
|
};
|
|
15798
15607
|
} catch (e) {
|
|
@@ -15801,7 +15610,7 @@ Prefer relative imports if possible.`
|
|
|
15801
15610
|
docgens,
|
|
15802
15611
|
errors: [
|
|
15803
15612
|
{
|
|
15804
|
-
path:
|
|
15613
|
+
path: path2,
|
|
15805
15614
|
code,
|
|
15806
15615
|
name: "No component definition found",
|
|
15807
15616
|
message: import_ts_dedent2.dedent`
|
|
@@ -15816,8 +15625,8 @@ Prefer relative imports if possible.`
|
|
|
15816
15625
|
},
|
|
15817
15626
|
{ name: "gatherDocgensWithTrace", key: (filePath) => filePath }
|
|
15818
15627
|
), getReactDocgen = cached(
|
|
15819
|
-
(
|
|
15820
|
-
let { docgens, errors } = gatherDocgensForPath(
|
|
15628
|
+
(path2, component) => {
|
|
15629
|
+
let { docgens, errors } = gatherDocgensForPath(path2, 0), docgen = getMatchingDocgen(docgens, component);
|
|
15821
15630
|
return docgen ? { type: "success", data: docgen } : { type: "error", error: {
|
|
15822
15631
|
name: errors.at(-1)?.name ?? "No component definition found",
|
|
15823
15632
|
message: errors.map(
|
|
@@ -15832,15 +15641,15 @@ Prefer relative imports if possible.`
|
|
|
15832
15641
|
`)
|
|
15833
15642
|
} };
|
|
15834
15643
|
},
|
|
15835
|
-
{ name: "getReactDocgen", key: (
|
|
15644
|
+
{ name: "getReactDocgen", key: (path2, component) => path2 + JSON.stringify(component) }
|
|
15836
15645
|
);
|
|
15837
15646
|
function getReactDocgenImporter() {
|
|
15838
15647
|
return makeFsImporter((filename, basedir) => {
|
|
15839
15648
|
let mappedFilenameByPaths = matchPath(filename, basedir), result = cachedResolveImport(mappedFilenameByPaths, { basedir });
|
|
15840
|
-
if (result.includes(`${
|
|
15649
|
+
if (result.includes(`${sep}react-native${sep}index.js`)) {
|
|
15841
15650
|
let replaced = result.replace(
|
|
15842
|
-
`${
|
|
15843
|
-
`${
|
|
15651
|
+
`${sep}react-native${sep}index.js`,
|
|
15652
|
+
`${sep}react-native-web${sep}dist${sep}index.js`
|
|
15844
15653
|
);
|
|
15845
15654
|
if (existsSync2(replaced) && supportedExtensions2.find((ext) => result.endsWith(ext)))
|
|
15846
15655
|
return replaced;
|
|
@@ -15855,150 +15664,295 @@ function getImportTag(docgen) {
|
|
|
15855
15664
|
return (jsdocComment ? extractJSDocInfo(jsdocComment).tags : void 0)?.import?.[0];
|
|
15856
15665
|
}
|
|
15857
15666
|
|
|
15858
|
-
//
|
|
15859
|
-
|
|
15860
|
-
|
|
15861
|
-
var
|
|
15862
|
-
|
|
15863
|
-
|
|
15864
|
-
|
|
15865
|
-
|
|
15866
|
-
|
|
15867
|
-
|
|
15868
|
-
|
|
15869
|
-
|
|
15870
|
-
|
|
15667
|
+
// ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
15668
|
+
var _lazyMatch = () => {
|
|
15669
|
+
var __lib__ = (() => {
|
|
15670
|
+
var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
|
|
15671
|
+
for (var n in e) m(r, n, { get: e[n], enumerable: !0 });
|
|
15672
|
+
}, H = (r, e, n, a) => {
|
|
15673
|
+
if (e && typeof e == "object" || typeof e == "function") for (let t5 of G(e)) !T.call(r, t5) && t5 !== n && m(r, t5, { get: () => e[t5], enumerable: !(a = V(e, t5)) || a.enumerable });
|
|
15674
|
+
return r;
|
|
15675
|
+
}, J = (r) => H(m({}, "__esModule", { value: !0 }), r), w = {};
|
|
15676
|
+
q(w, { default: () => re });
|
|
15677
|
+
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) => {
|
|
15678
|
+
let e = /* @__PURE__ */ new Map();
|
|
15679
|
+
return (n) => {
|
|
15680
|
+
let a = e.get(n);
|
|
15681
|
+
if (a) return a;
|
|
15682
|
+
let t5 = r(n);
|
|
15683
|
+
return e.set(n, t5), t5;
|
|
15684
|
+
};
|
|
15685
|
+
}, rr = (r, e, n = {}) => {
|
|
15686
|
+
let a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
|
|
15687
|
+
if (v(e)(a) && a.index === r.length) return a.output;
|
|
15688
|
+
throw new Error(`Failed to parse at index ${a.indexMax}`);
|
|
15689
|
+
}, i2 = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
|
|
15690
|
+
let n = {};
|
|
15691
|
+
for (let a of r) {
|
|
15692
|
+
if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
|
|
15693
|
+
let t5 = a.charCodeAt(0);
|
|
15694
|
+
n[t5] = !0;
|
|
15695
|
+
}
|
|
15696
|
+
return (a) => {
|
|
15697
|
+
let t5 = a.index, o = a.input;
|
|
15698
|
+
for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
|
|
15699
|
+
let u = a.index;
|
|
15700
|
+
if (u > t5) {
|
|
15701
|
+
if (!h(e) && !a.options.silent) {
|
|
15702
|
+
let s = a.input.slice(t5, u), c = d(e) ? e(s, o, String(t5)) : e;
|
|
15703
|
+
h(c) || a.output.push(c);
|
|
15704
|
+
}
|
|
15705
|
+
a.indexMax = Math.max(a.indexMax, a.index);
|
|
15706
|
+
}
|
|
15707
|
+
return !0;
|
|
15708
|
+
};
|
|
15709
|
+
}, nr = (r, e) => {
|
|
15710
|
+
let n = r.source, a = r.flags.replace(/y|$/, "y"), t5 = new RegExp(n, a);
|
|
15711
|
+
return g((o) => {
|
|
15712
|
+
t5.lastIndex = o.index;
|
|
15713
|
+
let u = t5.exec(o.input);
|
|
15714
|
+
if (u) {
|
|
15715
|
+
if (!h(e) && !o.options.silent) {
|
|
15716
|
+
let s = d(e) ? e(...u, o.input, String(o.index)) : e;
|
|
15717
|
+
h(s) || o.output.push(s);
|
|
15718
|
+
}
|
|
15719
|
+
return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), !0;
|
|
15720
|
+
} else return !1;
|
|
15721
|
+
});
|
|
15722
|
+
}, ar = (r, e) => (n) => {
|
|
15723
|
+
if (n.input.startsWith(r, n.index)) {
|
|
15724
|
+
if (!h(e) && !n.options.silent) {
|
|
15725
|
+
let t5 = d(e) ? e(r, n.input, String(n.index)) : e;
|
|
15726
|
+
h(t5) || n.output.push(t5);
|
|
15727
|
+
}
|
|
15728
|
+
return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), !0;
|
|
15729
|
+
} else return !1;
|
|
15730
|
+
}, C = (r, e, n, a) => {
|
|
15731
|
+
let t5 = v(r);
|
|
15732
|
+
return g(_(M((o) => {
|
|
15733
|
+
let u = 0;
|
|
15734
|
+
for (; u < n; ) {
|
|
15735
|
+
let s = o.index;
|
|
15736
|
+
if (!t5(o) || (u += 1, o.index === s)) break;
|
|
15737
|
+
}
|
|
15738
|
+
return u >= e;
|
|
15739
|
+
})));
|
|
15740
|
+
}, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
|
|
15741
|
+
let n = r.map(v);
|
|
15742
|
+
return g(_(M((a) => {
|
|
15743
|
+
for (let t5 = 0, o = n.length; t5 < o; t5++) if (!n[t5](a)) return !1;
|
|
15744
|
+
return !0;
|
|
15745
|
+
})));
|
|
15746
|
+
}, l = (r, e) => {
|
|
15747
|
+
let n = r.map(v);
|
|
15748
|
+
return g(_((a) => {
|
|
15749
|
+
for (let t5 = 0, o = n.length; t5 < o; t5++) if (n[t5](a)) return !0;
|
|
15750
|
+
return !1;
|
|
15751
|
+
}));
|
|
15752
|
+
}, M = (r, e = !1) => {
|
|
15753
|
+
let n = v(r);
|
|
15754
|
+
return (a) => {
|
|
15755
|
+
let t5 = a.index, o = a.output.length, u = n(a);
|
|
15756
|
+
return (!u || e) && (a.index = t5, a.output.length !== o && (a.output.length = o)), u;
|
|
15757
|
+
};
|
|
15758
|
+
}, _ = (r, e) => v(r), g = /* @__PURE__ */ (() => {
|
|
15759
|
+
let r = 0;
|
|
15760
|
+
return (e) => {
|
|
15761
|
+
let n = v(e), a = r += 1;
|
|
15762
|
+
return (t5) => {
|
|
15763
|
+
var o;
|
|
15764
|
+
if (t5.options.memoization === !1) return n(t5);
|
|
15765
|
+
let u = t5.index, s = (o = t5.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
|
|
15766
|
+
if (c === !1) return !1;
|
|
15767
|
+
if (W(c)) return t5.index = c, !0;
|
|
15768
|
+
if (c) return t5.index = c.index, c.output?.length && t5.output.push(...c.output), !0;
|
|
15769
|
+
{
|
|
15770
|
+
let Z = t5.output.length;
|
|
15771
|
+
if (n(t5)) {
|
|
15772
|
+
let D = t5.index, U = t5.output.length;
|
|
15773
|
+
if (U > Z) {
|
|
15774
|
+
let ee = t5.output.slice(Z, U);
|
|
15775
|
+
s.set(u, { index: D, output: ee });
|
|
15776
|
+
} else s.set(u, D);
|
|
15777
|
+
return !0;
|
|
15778
|
+
} else return s.set(u, !1), !1;
|
|
15779
|
+
}
|
|
15780
|
+
};
|
|
15781
|
+
};
|
|
15782
|
+
})(), E = (r) => {
|
|
15783
|
+
let e;
|
|
15784
|
+
return (n) => (e || (e = v(r())), e(n));
|
|
15785
|
+
}, v = Y((r) => {
|
|
15786
|
+
if (d(r)) return Q(r) ? E(r) : r;
|
|
15787
|
+
if (b(r) || X(r)) return i2(r);
|
|
15788
|
+
if (A(r)) return x(r);
|
|
15789
|
+
if (K(r)) return l(Object.values(r));
|
|
15790
|
+
throw new Error("Invalid rule");
|
|
15791
|
+
}), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
|
|
15792
|
+
let e = "";
|
|
15793
|
+
for (; r > 0; ) {
|
|
15794
|
+
let n = (r - 1) % 26;
|
|
15795
|
+
e = P[n] + e, r = Math.floor((r - 1) / 26);
|
|
15796
|
+
}
|
|
15797
|
+
return e;
|
|
15798
|
+
}, O = (r) => {
|
|
15799
|
+
let e = 0;
|
|
15800
|
+
for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
|
|
15801
|
+
return e;
|
|
15802
|
+
}, S = (r, e) => {
|
|
15803
|
+
if (e < r) return S(e, r);
|
|
15804
|
+
let n = [];
|
|
15805
|
+
for (; r <= e; ) n.push(r++);
|
|
15806
|
+
return n;
|
|
15807
|
+
}, 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) => {
|
|
15808
|
+
let e = {};
|
|
15809
|
+
return (n) => e[n] ?? (e[n] = r(n));
|
|
15810
|
+
}, sr = i2(/^\*\*\/\*$/, ".*"), cr = i2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i2(/\\./, p), pr = i2(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i2(/./, p), hr = i2(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i2(/^(!!)+/, ""), fr = l([hr, dr]), xr = i2(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i2(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i2(/\/(\*\*)$/, "(?:/.*|$)"), _r = i2(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i2(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i2(/\*/, "[^/]*"), N = l([Sr, yr]), k = i2("?", "[^/]"), $r = i2("[", p), wr = i2("]", p), Ar = i2(/[!^]/, "^/"), br = i2(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i2(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i2(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i2("{", "(?:"), Or = i2("}", ")"), Rr = i2(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i2(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i2(/([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 = i2("{", "(?:"), Br = i2("}", ")"), Ir = i2(",", "|"), Fr = i2(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i2(/[^}]/, 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 = i2(/\\./, p), qr = i2(/./, p), Hr = i2(/\*\*\*+/, "*"), Jr = i2(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i2(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
|
|
15811
|
+
let n = Array.isArray(r) ? r : [r];
|
|
15812
|
+
if (!n.length) return !1;
|
|
15813
|
+
let a = n.map($.compile), t5 = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t5 ? "/" : "");
|
|
15814
|
+
return a.some((s) => s.test(o));
|
|
15815
|
+
};
|
|
15816
|
+
$.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
|
|
15817
|
+
var re = $;
|
|
15818
|
+
return J(w);
|
|
15819
|
+
})();
|
|
15820
|
+
return __lib__.default || __lib__;
|
|
15821
|
+
}, _match, zeptomatch = (path2, pattern) => (_match || (_match = _lazyMatch(), _lazyMatch = null), _match(path2, pattern)), _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
15822
|
+
function normalizeWindowsPath(input = "") {
|
|
15823
|
+
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
15824
|
+
}
|
|
15825
|
+
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 = "/", normalize = function(path2) {
|
|
15826
|
+
if (path2.length === 0)
|
|
15827
|
+
return ".";
|
|
15828
|
+
path2 = normalizeWindowsPath(path2);
|
|
15829
|
+
let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute2(path2), trailingSeparator = path2[path2.length - 1] === "/";
|
|
15830
|
+
return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute2(path2) ? `/${path2}` : path2);
|
|
15831
|
+
}, join3 = function(...segments) {
|
|
15832
|
+
let path2 = "";
|
|
15833
|
+
for (let seg of segments)
|
|
15834
|
+
if (seg)
|
|
15835
|
+
if (path2.length > 0) {
|
|
15836
|
+
let pathTrailing = path2[path2.length - 1] === "/", segLeading = seg[0] === "/";
|
|
15837
|
+
pathTrailing && segLeading ? path2 += seg.slice(1) : path2 += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
15838
|
+
} else
|
|
15839
|
+
path2 += seg;
|
|
15840
|
+
return normalize(path2);
|
|
15871
15841
|
};
|
|
15872
|
-
function
|
|
15873
|
-
|
|
15874
|
-
if (!typescript.isExpressionStatement(statement))
|
|
15875
|
-
continue;
|
|
15876
|
-
let expr = statement.expression;
|
|
15877
|
-
if (typescript.isBinaryExpression(expr) && expr.operatorToken.kind === typescript.SyntaxKind.EqualsToken && typescript.isPropertyAccessExpression(expr.left) && expr.left.name.text === "displayName" && typescript.isIdentifier(expr.left.expression) && expr.left.expression.text === identifierName && typescript.isStringLiteral(expr.right))
|
|
15878
|
-
return expr.right.text;
|
|
15879
|
-
}
|
|
15842
|
+
function cwd() {
|
|
15843
|
+
return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
|
|
15880
15844
|
}
|
|
15881
|
-
|
|
15882
|
-
|
|
15883
|
-
|
|
15884
|
-
|
|
15885
|
-
|
|
15886
|
-
|
|
15887
|
-
|
|
15888
|
-
|
|
15889
|
-
|
|
15890
|
-
|
|
15891
|
-
|
|
15892
|
-
|
|
15893
|
-
|
|
15894
|
-
|
|
15895
|
-
|
|
15896
|
-
|
|
15897
|
-
|
|
15898
|
-
|
|
15899
|
-
let displayNameValue = findDisplayNameAssignment(typescript, sourceFile, resolvedName);
|
|
15900
|
-
displayNameValue && result.set(displayNameValue, exportName);
|
|
15845
|
+
var resolve3 = function(...arguments_) {
|
|
15846
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
15847
|
+
let resolvedPath = "", resolvedAbsolute = !1;
|
|
15848
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
15849
|
+
let path2 = index >= 0 ? arguments_[index] : cwd();
|
|
15850
|
+
!path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path2));
|
|
15851
|
+
}
|
|
15852
|
+
return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
|
|
15853
|
+
};
|
|
15854
|
+
function normalizeString(path2, allowAboveRoot) {
|
|
15855
|
+
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
|
|
15856
|
+
for (let index = 0; index <= path2.length; ++index) {
|
|
15857
|
+
if (index < path2.length)
|
|
15858
|
+
char = path2[index];
|
|
15859
|
+
else {
|
|
15860
|
+
if (char === "/")
|
|
15861
|
+
break;
|
|
15862
|
+
char = "/";
|
|
15901
15863
|
}
|
|
15864
|
+
if (char === "/") {
|
|
15865
|
+
if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
|
|
15866
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
15867
|
+
if (res.length > 2) {
|
|
15868
|
+
let lastSlashIndex = res.lastIndexOf("/");
|
|
15869
|
+
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
|
|
15870
|
+
continue;
|
|
15871
|
+
} else if (res.length > 0) {
|
|
15872
|
+
res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
|
|
15873
|
+
continue;
|
|
15874
|
+
}
|
|
15875
|
+
}
|
|
15876
|
+
allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
|
|
15877
|
+
} else
|
|
15878
|
+
res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
|
|
15879
|
+
lastSlash = index, dots = 0;
|
|
15880
|
+
} else char === "." && dots !== -1 ? ++dots : dots = -1;
|
|
15902
15881
|
}
|
|
15903
|
-
return
|
|
15904
|
-
}
|
|
15905
|
-
var cachedCompilerOptions, cachedFileNames, previousProgram, parser, cachedParserOptionsKey;
|
|
15906
|
-
function invalidateParser() {
|
|
15907
|
-
parser = void 0, cachedCompilerOptions = void 0, cachedFileNames = void 0, cachedParserOptionsKey = void 0;
|
|
15882
|
+
return res;
|
|
15908
15883
|
}
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
|
|
15912
|
-
|
|
15913
|
-
|
|
15914
|
-
if (
|
|
15915
|
-
|
|
15916
|
-
|
|
15917
|
-
|
|
15918
|
-
|
|
15919
|
-
|
|
15920
|
-
|
|
15921
|
-
|
|
15922
|
-
|
|
15923
|
-
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
);
|
|
15927
|
-
let program = typescript.createProgram(
|
|
15928
|
-
cachedFileNames ?? [],
|
|
15929
|
-
cachedCompilerOptions,
|
|
15930
|
-
void 0,
|
|
15931
|
-
previousProgram
|
|
15932
|
-
);
|
|
15933
|
-
previousProgram = program;
|
|
15934
|
-
let parserOptions = {
|
|
15935
|
-
shouldExtractLiteralValuesFromEnum: !0,
|
|
15936
|
-
shouldRemoveUndefinedFromOptional: !0,
|
|
15937
|
-
...userOptions,
|
|
15938
|
-
// Always force savePropValueAsString so default values are in a consistent format
|
|
15939
|
-
savePropValueAsString: !0
|
|
15940
|
-
};
|
|
15941
|
-
parser = {
|
|
15942
|
-
program,
|
|
15943
|
-
fileParser: reactDocgenTypescript.withCompilerOptions(cachedCompilerOptions, parserOptions)
|
|
15944
|
-
}, cachedParserOptionsKey = optionsKey;
|
|
15884
|
+
var isAbsolute2 = function(p) {
|
|
15885
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
15886
|
+
}, toNamespacedPath = function(p) {
|
|
15887
|
+
return normalizeWindowsPath(p);
|
|
15888
|
+
}, extname = function(p) {
|
|
15889
|
+
if (p === "..") return "";
|
|
15890
|
+
let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
15891
|
+
return match && match[1] || "";
|
|
15892
|
+
}, relative = function(from, to) {
|
|
15893
|
+
let _from = resolve3(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve3(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
15894
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
|
|
15895
|
+
return _to.join("/");
|
|
15896
|
+
let _fromCopy = [..._from];
|
|
15897
|
+
for (let segment of _fromCopy) {
|
|
15898
|
+
if (_to[0] !== segment)
|
|
15899
|
+
break;
|
|
15900
|
+
_from.shift(), _to.shift();
|
|
15945
15901
|
}
|
|
15946
|
-
return
|
|
15947
|
-
}
|
|
15948
|
-
|
|
15949
|
-
|
|
15950
|
-
|
|
15951
|
-
|
|
15952
|
-
|
|
15953
|
-
|
|
15954
|
-
|
|
15955
|
-
|
|
15956
|
-
|
|
15957
|
-
}
|
|
15958
|
-
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
|
|
15962
|
-
|
|
15963
|
-
|
|
15964
|
-
|
|
15965
|
-
|
|
15966
|
-
|
|
15967
|
-
|
|
15968
|
-
|
|
15969
|
-
|
|
15970
|
-
|
|
15971
|
-
|
|
15972
|
-
|
|
15973
|
-
|
|
15974
|
-
|
|
15975
|
-
`Looked for: componentName=${componentName}, localImportName=${localImportName ?? "<none>"}, importName=${importName ?? "<none>"}.`
|
|
15976
|
-
].join(`
|
|
15977
|
-
`)
|
|
15902
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
15903
|
+
}, dirname4 = function(p) {
|
|
15904
|
+
let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
15905
|
+
return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
|
|
15906
|
+
}, format = function(p) {
|
|
15907
|
+
let ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "", segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
|
|
15908
|
+
Boolean
|
|
15909
|
+
);
|
|
15910
|
+
return normalizeWindowsPath(
|
|
15911
|
+
p.root ? resolve3(...segments) : segments.join("/")
|
|
15912
|
+
);
|
|
15913
|
+
}, basename = function(p, extension) {
|
|
15914
|
+
let segments = normalizeWindowsPath(p).split("/"), lastSegment = "";
|
|
15915
|
+
for (let i2 = segments.length - 1; i2 >= 0; i2--) {
|
|
15916
|
+
let val = segments[i2];
|
|
15917
|
+
if (val) {
|
|
15918
|
+
lastSegment = val;
|
|
15919
|
+
break;
|
|
15920
|
+
}
|
|
15921
|
+
}
|
|
15922
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
15923
|
+
}, parse6 = function(p) {
|
|
15924
|
+
let root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "", base2 = basename(p), extension = extname(base2);
|
|
15925
|
+
return {
|
|
15926
|
+
root,
|
|
15927
|
+
dir: dirname4(p),
|
|
15928
|
+
base: base2,
|
|
15929
|
+
ext: extension,
|
|
15930
|
+
name: base2.slice(0, base2.length - extension.length)
|
|
15978
15931
|
};
|
|
15979
|
-
}
|
|
15980
|
-
|
|
15981
|
-
|
|
15982
|
-
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
|
|
15990
|
-
|
|
15991
|
-
|
|
15992
|
-
|
|
15993
|
-
|
|
15994
|
-
|
|
15995
|
-
|
|
15996
|
-
|
|
15997
|
-
|
|
15998
|
-
|
|
15999
|
-
|
|
16000
|
-
|
|
16001
|
-
|
|
15932
|
+
}, matchesGlob = (path2, pattern) => zeptomatch(pattern, normalize(path2)), _path = {
|
|
15933
|
+
__proto__: null,
|
|
15934
|
+
basename,
|
|
15935
|
+
dirname: dirname4,
|
|
15936
|
+
extname,
|
|
15937
|
+
format,
|
|
15938
|
+
isAbsolute: isAbsolute2,
|
|
15939
|
+
join: join3,
|
|
15940
|
+
matchesGlob,
|
|
15941
|
+
normalize,
|
|
15942
|
+
normalizeString,
|
|
15943
|
+
parse: parse6,
|
|
15944
|
+
relative,
|
|
15945
|
+
resolve: resolve3,
|
|
15946
|
+
sep: sep2,
|
|
15947
|
+
toNamespacedPath
|
|
15948
|
+
};
|
|
15949
|
+
|
|
15950
|
+
// ../../../node_modules/pathe/dist/index.mjs
|
|
15951
|
+
var delimiter = globalThis.process?.platform === "win32" ? ";" : ":", _platforms = { posix: void 0, win32: void 0 }, mix = (del = delimiter) => new Proxy(_path, {
|
|
15952
|
+
get(_, prop) {
|
|
15953
|
+
return prop === "delimiter" ? del : prop === "posix" ? posix : prop === "win32" ? win32 : _platforms[prop] || _path[prop];
|
|
15954
|
+
}
|
|
15955
|
+
}), posix = mix(":"), win32 = mix(";");
|
|
16002
15956
|
|
|
16003
15957
|
// src/componentManifest/generateCodeSnippet.ts
|
|
16004
15958
|
import { types as t2 } from "storybook/internal/babel";
|
|
@@ -16182,23 +16136,226 @@ function transformArgsSpreadsInJsx(node, merged) {
|
|
|
16182
16136
|
return { node: t2.jsxFragment(node.openingFragment, node.closingFragment, fragChildren), changed };
|
|
16183
16137
|
}
|
|
16184
16138
|
|
|
16139
|
+
// src/componentManifest/reactDocgenTypescript.ts
|
|
16140
|
+
import { dirname as dirname5, join as join4, resolve as resolve4 } from "node:path";
|
|
16141
|
+
import { logger as logger4 } from "storybook/internal/node-logger";
|
|
16142
|
+
var typeScriptPromise, reactDocgenTypescriptPromise, loadTypeScript = () => typeScriptPromise ??= import("typescript"), loadReactDocgenTypescript = () => reactDocgenTypescriptPromise ??= import("react-docgen-typescript"), LARGE_NON_USER_SOURCE_THRESHOLD = 30, getPropSource = (prop) => prop.parent?.fileName ?? prop.declarations?.[0]?.fileName, getLargeNonUserPropSources = (props) => {
|
|
16143
|
+
let countBySource = /* @__PURE__ */ new Map();
|
|
16144
|
+
for (let prop of Object.values(props)) {
|
|
16145
|
+
let source = getPropSource(prop);
|
|
16146
|
+
(source?.includes("node_modules") || source?.endsWith(".d.ts")) && countBySource.set(source, (countBySource.get(source) ?? 0) + 1);
|
|
16147
|
+
}
|
|
16148
|
+
let largeNonUserSources = /* @__PURE__ */ new Set();
|
|
16149
|
+
for (let [source, count] of countBySource)
|
|
16150
|
+
count > LARGE_NON_USER_SOURCE_THRESHOLD && largeNonUserSources.add(source);
|
|
16151
|
+
return largeNonUserSources;
|
|
16152
|
+
};
|
|
16153
|
+
function findDisplayNameAssignment(typescript, sourceFile, identifierName) {
|
|
16154
|
+
for (let statement of sourceFile.statements) {
|
|
16155
|
+
if (!typescript.isExpressionStatement(statement))
|
|
16156
|
+
continue;
|
|
16157
|
+
let expr = statement.expression;
|
|
16158
|
+
if (typescript.isBinaryExpression(expr) && expr.operatorToken.kind === typescript.SyntaxKind.EqualsToken && typescript.isPropertyAccessExpression(expr.left) && expr.left.name.text === "displayName" && typescript.isIdentifier(expr.left.expression) && expr.left.expression.text === identifierName && typescript.isStringLiteral(expr.right))
|
|
16159
|
+
return expr.right.text;
|
|
16160
|
+
}
|
|
16161
|
+
}
|
|
16162
|
+
function getExportNameMap(typescript, checker, sourceFile) {
|
|
16163
|
+
let moduleSymbol = checker.getSymbolAtLocation(sourceFile);
|
|
16164
|
+
if (!moduleSymbol)
|
|
16165
|
+
return /* @__PURE__ */ new Map();
|
|
16166
|
+
let result = /* @__PURE__ */ new Map(), fileName = sourceFile.fileName.replace(/.*\//, "").replace(/\.[^.]+$/, "");
|
|
16167
|
+
for (let exportSymbol of checker.getExportsOfModule(moduleSymbol)) {
|
|
16168
|
+
let resolved = exportSymbol.flags & typescript.SymbolFlags.Alias ? checker.getAliasedSymbol(exportSymbol) : exportSymbol, declaration = resolved.valueDeclaration ?? resolved.getDeclarations()?.[0];
|
|
16169
|
+
if (!declaration)
|
|
16170
|
+
continue;
|
|
16171
|
+
let type = checker.getTypeOfSymbolAtLocation(resolved, declaration), isStateless = type.getCallSignatures().some((sig) => {
|
|
16172
|
+
let params = sig.getParameters();
|
|
16173
|
+
return params.length === 1 || params.length > 0 && params[0].getName() === "props";
|
|
16174
|
+
}), isStateful = type.getConstructSignatures().some(
|
|
16175
|
+
(sig) => sig.getReturnType().getProperty("props") !== void 0
|
|
16176
|
+
);
|
|
16177
|
+
if (isStateless || isStateful) {
|
|
16178
|
+
let exportName = exportSymbol.getName(), resolvedName = resolved.getName();
|
|
16179
|
+
result.set(resolvedName, exportName), exportName === "default" && result.set(fileName, "default");
|
|
16180
|
+
let displayNameValue = findDisplayNameAssignment(typescript, sourceFile, resolvedName);
|
|
16181
|
+
displayNameValue && result.set(displayNameValue, exportName);
|
|
16182
|
+
}
|
|
16183
|
+
}
|
|
16184
|
+
return result;
|
|
16185
|
+
}
|
|
16186
|
+
var previousProgramsByConfigKey = /* @__PURE__ */ new Map(), parserCache = /* @__PURE__ */ new Map(), parserBuilds = /* @__PURE__ */ new Map();
|
|
16187
|
+
function invalidateParser() {
|
|
16188
|
+
parserCache = /* @__PURE__ */ new Map(), parserBuilds = /* @__PURE__ */ new Map(), previousProgramsByConfigKey.clear();
|
|
16189
|
+
}
|
|
16190
|
+
async function getParser(filePath, userOptions) {
|
|
16191
|
+
let [typescript, reactDocgenTypescript] = await Promise.all([
|
|
16192
|
+
loadTypeScript(),
|
|
16193
|
+
loadReactDocgenTypescript()
|
|
16194
|
+
]), optionsKey = JSON.stringify(userOptions ?? {}), configPath = findOwningTsconfigPath(typescript, process.cwd(), filePath) ?? findTsconfigPath(process.cwd()), configKey = configPath ?? "<no-tsconfig>", parserKey = `${configKey}::${optionsKey}`, cachedParser = parserCache.get(parserKey);
|
|
16195
|
+
if (cachedParser)
|
|
16196
|
+
return { ...cachedParser, typescript };
|
|
16197
|
+
let pendingParser = parserBuilds.get(parserKey);
|
|
16198
|
+
if (pendingParser)
|
|
16199
|
+
return { ...await pendingParser, typescript };
|
|
16200
|
+
let buildParser = (async () => {
|
|
16201
|
+
let compilerOptions = { noErrorTruncation: !0, strict: !0 }, fileNames = [];
|
|
16202
|
+
if (configPath) {
|
|
16203
|
+
let parsed = parseTsconfig(typescript, configPath);
|
|
16204
|
+
compilerOptions = { ...parsed.options, noErrorTruncation: !0 }, fileNames = parsed.fileNames;
|
|
16205
|
+
} else
|
|
16206
|
+
logger4.warn(
|
|
16207
|
+
"No tsconfig.json (or tsconfig.base.json / tsconfig.app.json) found. TypeScript component props will not be documented by react-docgen-typescript. Create a tsconfig.json in your project root to enable automatic controls."
|
|
16208
|
+
);
|
|
16209
|
+
let program = typescript.createProgram(
|
|
16210
|
+
fileNames,
|
|
16211
|
+
compilerOptions,
|
|
16212
|
+
void 0,
|
|
16213
|
+
previousProgramsByConfigKey.get(configKey)
|
|
16214
|
+
);
|
|
16215
|
+
previousProgramsByConfigKey.set(configKey, program);
|
|
16216
|
+
let parserOptions = {
|
|
16217
|
+
shouldExtractLiteralValuesFromEnum: !0,
|
|
16218
|
+
shouldRemoveUndefinedFromOptional: !0,
|
|
16219
|
+
...userOptions,
|
|
16220
|
+
// Always force savePropValueAsString so default values are in a consistent format
|
|
16221
|
+
savePropValueAsString: !0
|
|
16222
|
+
}, state = {
|
|
16223
|
+
program,
|
|
16224
|
+
fileParser: reactDocgenTypescript.withCompilerOptions(compilerOptions, parserOptions)
|
|
16225
|
+
};
|
|
16226
|
+
return parserCache.set(parserKey, state), state;
|
|
16227
|
+
})();
|
|
16228
|
+
parserBuilds.set(parserKey, buildParser);
|
|
16229
|
+
try {
|
|
16230
|
+
return { ...await buildParser, typescript };
|
|
16231
|
+
} finally {
|
|
16232
|
+
parserBuilds.delete(parserKey);
|
|
16233
|
+
}
|
|
16234
|
+
}
|
|
16235
|
+
function matchComponentDoc(docs, {
|
|
16236
|
+
importName,
|
|
16237
|
+
localImportName,
|
|
16238
|
+
componentName
|
|
16239
|
+
}) {
|
|
16240
|
+
if (docs.length !== 0)
|
|
16241
|
+
return docs.length === 1 ? docs[0] : docs.find(
|
|
16242
|
+
(doc) => doc.exportName === importName || doc.exportName === localImportName || doc.displayName === importName || doc.displayName === localImportName || doc.displayName === componentName
|
|
16243
|
+
);
|
|
16244
|
+
}
|
|
16245
|
+
function getReactDocgenTypescriptError(path2, {
|
|
16246
|
+
importName,
|
|
16247
|
+
localImportName,
|
|
16248
|
+
componentName
|
|
16249
|
+
}, docs) {
|
|
16250
|
+
return docs.length === 0 ? {
|
|
16251
|
+
name: "react-docgen-typescript found no component docs",
|
|
16252
|
+
message: [
|
|
16253
|
+
`File: ${path2}`,
|
|
16254
|
+
"react-docgen-typescript did not return any component docs for this file."
|
|
16255
|
+
].join(`
|
|
16256
|
+
`)
|
|
16257
|
+
} : {
|
|
16258
|
+
name: "react-docgen-typescript could not match component docs",
|
|
16259
|
+
message: [
|
|
16260
|
+
`File: ${path2}`,
|
|
16261
|
+
"react-docgen-typescript returned component docs for this file, but none matched the story's component import.",
|
|
16262
|
+
`Looked for: componentName=${componentName}, localImportName=${localImportName ?? "<none>"}, importName=${importName ?? "<none>"}.`
|
|
16263
|
+
].join(`
|
|
16264
|
+
`)
|
|
16265
|
+
};
|
|
16266
|
+
}
|
|
16267
|
+
var parseWithReactDocgenTypescript = asyncCache(
|
|
16268
|
+
async (filePath, userOptions) => {
|
|
16269
|
+
let { program, fileParser, typescript } = await getParser(filePath, userOptions), checker = program.getTypeChecker(), sourceFile = program.getSourceFile(filePath), docs = fileParser.parseWithProgramProvider(filePath, () => program), exportNameMap = sourceFile ? getExportNameMap(typescript, checker, sourceFile) : /* @__PURE__ */ new Map();
|
|
16270
|
+
return docs.map((doc) => {
|
|
16271
|
+
let largeNonUserSources = getLargeNonUserPropSources(doc.props);
|
|
16272
|
+
return {
|
|
16273
|
+
...doc,
|
|
16274
|
+
// Use name-based lookup: displayName is the resolved symbol name, so look it up in the
|
|
16275
|
+
// export map to get the public export name. Falls back to displayName when not aliased.
|
|
16276
|
+
exportName: exportNameMap.get(doc.displayName) ?? doc.displayName,
|
|
16277
|
+
// Filter out bulk props from non-user sources (React built-ins, DOM, CSS-in-JS system props)
|
|
16278
|
+
props: Object.fromEntries(
|
|
16279
|
+
Object.entries(doc.props).filter(([, prop]) => {
|
|
16280
|
+
let source = getPropSource(prop);
|
|
16281
|
+
return !source || !largeNonUserSources.has(source);
|
|
16282
|
+
})
|
|
16283
|
+
)
|
|
16284
|
+
};
|
|
16285
|
+
});
|
|
16286
|
+
},
|
|
16287
|
+
{ name: "parseWithReactDocgenTypescript" }
|
|
16288
|
+
), findOwningTsconfigPath = cached(
|
|
16289
|
+
(typescript, cwd2, filePath) => {
|
|
16290
|
+
let configPath = findTsconfigPath(cwd2);
|
|
16291
|
+
if (configPath)
|
|
16292
|
+
return findTsconfigPathIncludingFile(typescript, configPath, filePath, /* @__PURE__ */ new Set()) ?? configPath;
|
|
16293
|
+
},
|
|
16294
|
+
{
|
|
16295
|
+
key: (typescript, cwd2, filePath) => `${normalizeFileName(typescript, resolve4(cwd2))}::${normalizeFileName(
|
|
16296
|
+
typescript,
|
|
16297
|
+
resolve4(filePath)
|
|
16298
|
+
)}`,
|
|
16299
|
+
name: "findOwningTsconfigPath"
|
|
16300
|
+
}
|
|
16301
|
+
);
|
|
16302
|
+
function findTsconfigPathIncludingFile(typescript, configPath, filePath, seenConfigPaths) {
|
|
16303
|
+
let normalizedConfigPath = normalizeFileName(typescript, configPath);
|
|
16304
|
+
if (seenConfigPaths.has(normalizedConfigPath))
|
|
16305
|
+
return;
|
|
16306
|
+
seenConfigPaths.add(normalizedConfigPath);
|
|
16307
|
+
let { config, parsed } = readTsconfig(typescript, configPath);
|
|
16308
|
+
if (parsed.fileNames.some((name) => isSameFileName(typescript, name, filePath)))
|
|
16309
|
+
return configPath;
|
|
16310
|
+
for (let referencedConfigPath of getReferencedTsconfigPaths(typescript, configPath, config)) {
|
|
16311
|
+
let matchingConfigPath = findTsconfigPathIncludingFile(
|
|
16312
|
+
typescript,
|
|
16313
|
+
referencedConfigPath,
|
|
16314
|
+
filePath,
|
|
16315
|
+
seenConfigPaths
|
|
16316
|
+
);
|
|
16317
|
+
if (matchingConfigPath)
|
|
16318
|
+
return matchingConfigPath;
|
|
16319
|
+
}
|
|
16320
|
+
}
|
|
16321
|
+
function getReferencedTsconfigPaths(typescript, configPath, config) {
|
|
16322
|
+
return (Array.isArray(config?.references) ? config.references : []).map((reference) => reference.path).filter((referencePath) => typeof referencePath == "string").map((referencePath) => resolve4(dirname5(configPath), referencePath)).map(
|
|
16323
|
+
(referencePath) => referencePath.endsWith(".json") ? referencePath : join4(referencePath, "tsconfig.json")
|
|
16324
|
+
).filter((referencePath) => typescript.sys.fileExists(referencePath));
|
|
16325
|
+
}
|
|
16326
|
+
function parseTsconfig(typescript, configPath) {
|
|
16327
|
+
return readTsconfig(typescript, configPath).parsed;
|
|
16328
|
+
}
|
|
16329
|
+
function readTsconfig(typescript, configPath) {
|
|
16330
|
+
let { config } = typescript.readConfigFile(configPath, typescript.sys.readFile);
|
|
16331
|
+
return {
|
|
16332
|
+
config,
|
|
16333
|
+
parsed: typescript.parseJsonConfigFileContent(config, typescript.sys, dirname5(configPath))
|
|
16334
|
+
};
|
|
16335
|
+
}
|
|
16336
|
+
function isSameFileName(typescript, left, right) {
|
|
16337
|
+
return normalizeFileName(typescript, left) === normalizeFileName(typescript, right);
|
|
16338
|
+
}
|
|
16339
|
+
function normalizeFileName(typescript, fileName) {
|
|
16340
|
+
let normalized = resolve4(fileName).replace(/\\/g, "/");
|
|
16341
|
+
return typescript.sys.useCaseSensitiveFileNames ? normalized : normalized.toLowerCase();
|
|
16342
|
+
}
|
|
16343
|
+
|
|
16185
16344
|
// src/componentManifest/resolveComponents.ts
|
|
16186
|
-
import { recast
|
|
16345
|
+
import { recast } from "storybook/internal/babel";
|
|
16187
16346
|
import { storyNameFromExport } from "storybook/internal/csf";
|
|
16188
16347
|
import { extractStoryJSDocInfo, loadCsf } from "storybook/internal/csf-tools";
|
|
16189
16348
|
|
|
16190
16349
|
// src/componentManifest/getComponentImports.ts
|
|
16191
16350
|
import { dirname as dirname6 } from "node:path";
|
|
16192
|
-
import {
|
|
16351
|
+
import { types as t3 } from "storybook/internal/babel";
|
|
16193
16352
|
import {
|
|
16353
|
+
buildImportStatements,
|
|
16194
16354
|
collectImportBindings,
|
|
16195
|
-
|
|
16196
|
-
isTypeSpecifier
|
|
16355
|
+
resolveComponentImport
|
|
16197
16356
|
} from "storybook/internal/csf-tools";
|
|
16198
16357
|
import { logger as logger5 } from "storybook/internal/node-logger";
|
|
16199
|
-
var baseIdentifier = (component) => component.split(".")[0] ?? component,
|
|
16200
|
-
arr.find(eq2) || arr.push(item);
|
|
16201
|
-
}, getComponents = async ({
|
|
16358
|
+
var baseIdentifier = (component) => component.split(".")[0] ?? component, getComponents = async ({
|
|
16202
16359
|
csf,
|
|
16203
16360
|
storyFilePath,
|
|
16204
16361
|
typescriptOptions = {},
|
|
@@ -16241,36 +16398,12 @@ var baseIdentifier = (component) => component.split(".")[0] ?? component, addUni
|
|
|
16241
16398
|
);
|
|
16242
16399
|
return (await Promise.all(
|
|
16243
16400
|
filteredComponents.map(async (c) => {
|
|
16244
|
-
let
|
|
16245
|
-
|
|
16246
|
-
|
|
16247
|
-
|
|
16248
|
-
localImportName: ns,
|
|
16249
|
-
importId: direct.importId,
|
|
16250
|
-
importName: mem,
|
|
16251
|
-
namespace: ns,
|
|
16252
|
-
member: mem,
|
|
16253
|
-
jsxDepth: depth
|
|
16254
|
-
} : {
|
|
16255
|
-
componentName: c,
|
|
16256
|
-
localImportName: ns,
|
|
16257
|
-
importId: direct.importId,
|
|
16258
|
-
importName: direct.importName,
|
|
16259
|
-
member: mem,
|
|
16260
|
-
jsxDepth: depth
|
|
16261
|
-
} : { componentName: c, member: mem, jsxDepth: depth };
|
|
16262
|
-
})() : (() => {
|
|
16263
|
-
let direct = localToImport.get(c);
|
|
16264
|
-
return direct ? {
|
|
16265
|
-
componentName: c,
|
|
16266
|
-
localImportName: c,
|
|
16267
|
-
importId: direct.importId,
|
|
16268
|
-
importName: direct.importName,
|
|
16269
|
-
jsxDepth: depth
|
|
16270
|
-
} : { componentName: c, jsxDepth: depth };
|
|
16271
|
-
})(), path3, isPackage = !1;
|
|
16401
|
+
let component = {
|
|
16402
|
+
...resolveComponentImport(c, localToImport),
|
|
16403
|
+
jsxDepth: componentDepth.get(c)
|
|
16404
|
+
}, path2, isPackage = !1;
|
|
16272
16405
|
try {
|
|
16273
|
-
component.importId && storyFilePath && (
|
|
16406
|
+
component.importId && storyFilePath && (path2 = cachedResolveImport(matchPath(component.importId, dirname6(storyFilePath)), {
|
|
16274
16407
|
basedir: dirname6(storyFilePath)
|
|
16275
16408
|
}));
|
|
16276
16409
|
} catch (e) {
|
|
@@ -16281,34 +16414,34 @@ var baseIdentifier = (component) => component.split(".")[0] ?? component, addUni
|
|
|
16281
16414
|
} catch {
|
|
16282
16415
|
}
|
|
16283
16416
|
let componentWithPackage = { ...component, isPackage };
|
|
16284
|
-
if (
|
|
16417
|
+
if (path2) {
|
|
16285
16418
|
if (docgenEngine === "react-docgen-typescript") {
|
|
16286
16419
|
let reactDocgenTypescript, reactDocgenTypescriptError;
|
|
16287
16420
|
try {
|
|
16288
|
-
let docs = await parseWithReactDocgenTypescript(
|
|
16289
|
-
reactDocgenTypescript = matchComponentDoc(docs, component), reactDocgenTypescript || (reactDocgenTypescriptError = getReactDocgenTypescriptError(
|
|
16421
|
+
let docs = await parseWithReactDocgenTypescript(path2, reactDocgenTypescriptOptions);
|
|
16422
|
+
reactDocgenTypescript = matchComponentDoc(docs, component), reactDocgenTypescript || (reactDocgenTypescriptError = getReactDocgenTypescriptError(path2, component, docs));
|
|
16290
16423
|
} catch (e) {
|
|
16291
16424
|
let message = e instanceof Error ? e.message : String(e);
|
|
16292
|
-
logger5.debug(`react-docgen-typescript failed for ${
|
|
16425
|
+
logger5.debug(`react-docgen-typescript failed for ${path2}: ${message}`), reactDocgenTypescriptError = {
|
|
16293
16426
|
name: "react-docgen-typescript parse error",
|
|
16294
|
-
message: `File: ${
|
|
16427
|
+
message: `File: ${path2}
|
|
16295
16428
|
${message}`
|
|
16296
16429
|
};
|
|
16297
16430
|
}
|
|
16298
16431
|
let importOverride = reactDocgenTypescript ? getImportTag(reactDocgenTypescript) : void 0;
|
|
16299
16432
|
return {
|
|
16300
16433
|
...componentWithPackage,
|
|
16301
|
-
path:
|
|
16434
|
+
path: path2,
|
|
16302
16435
|
...reactDocgenTypescript ? { reactDocgenTypescript } : {},
|
|
16303
16436
|
...reactDocgenTypescriptError ? { reactDocgenTypescriptError } : {},
|
|
16304
16437
|
importOverride
|
|
16305
16438
|
};
|
|
16306
16439
|
}
|
|
16307
16440
|
if (docgenEngine === "react-docgen") {
|
|
16308
|
-
let reactDocgen = getReactDocgen(
|
|
16441
|
+
let reactDocgen = getReactDocgen(path2, componentWithPackage);
|
|
16309
16442
|
return {
|
|
16310
16443
|
...componentWithPackage,
|
|
16311
|
-
path:
|
|
16444
|
+
path: path2,
|
|
16312
16445
|
reactDocgen,
|
|
16313
16446
|
importOverride: reactDocgen.type === "success" ? getImportTag(reactDocgen.data) : void 0
|
|
16314
16447
|
};
|
|
@@ -16316,151 +16449,12 @@ ${message}`
|
|
|
16316
16449
|
if (docgenEngine === "react-component-meta")
|
|
16317
16450
|
return {
|
|
16318
16451
|
...componentWithPackage,
|
|
16319
|
-
path:
|
|
16452
|
+
path: path2
|
|
16320
16453
|
};
|
|
16321
16454
|
}
|
|
16322
16455
|
return componentWithPackage;
|
|
16323
16456
|
})
|
|
16324
16457
|
)).sort((a, b) => a.componentName.localeCompare(b.componentName));
|
|
16325
|
-
}, getImports = ({
|
|
16326
|
-
components,
|
|
16327
|
-
packageName
|
|
16328
|
-
}) => {
|
|
16329
|
-
let withSource = components.filter((c) => !!c.importId).map((c, idx) => {
|
|
16330
|
-
let importId = c.importId, overrideSource = (() => {
|
|
16331
|
-
if (c.importOverride)
|
|
16332
|
-
try {
|
|
16333
|
-
let src = babelParse2(c.importOverride).program.body.find((n) => t3.isImportDeclaration(n))?.source?.value;
|
|
16334
|
-
return typeof src == "string" ? src : void 0;
|
|
16335
|
-
} catch {
|
|
16336
|
-
return;
|
|
16337
|
-
}
|
|
16338
|
-
})(), rewritten = overrideSource !== void 0 ? overrideSource : (
|
|
16339
|
-
// only rewrite to the package name it the import id is not already a valid package
|
|
16340
|
-
// tsconfig paths such as ~/components/Button and components/Button are not seen as packages
|
|
16341
|
-
packageName && !c.isPackage ? packageName : importId
|
|
16342
|
-
);
|
|
16343
|
-
return { c, src: t3.stringLiteral(rewritten), key: rewritten, ord: idx };
|
|
16344
|
-
}), orderOfSource = {};
|
|
16345
|
-
for (let w of withSource)
|
|
16346
|
-
orderOfSource[w.key] === void 0 && (orderOfSource[w.key] = w.ord);
|
|
16347
|
-
let buckets = /* @__PURE__ */ new Map(), ensureBucket = (key, src) => {
|
|
16348
|
-
let prev = buckets.get(key);
|
|
16349
|
-
if (prev)
|
|
16350
|
-
return prev;
|
|
16351
|
-
let b = {
|
|
16352
|
-
source: src,
|
|
16353
|
-
defaults: [],
|
|
16354
|
-
namespaces: [],
|
|
16355
|
-
named: [],
|
|
16356
|
-
order: orderOfSource[key] ?? 0
|
|
16357
|
-
};
|
|
16358
|
-
return buckets.set(key, b), b;
|
|
16359
|
-
};
|
|
16360
|
-
for (let { c, src, key } of withSource) {
|
|
16361
|
-
let b = ensureBucket(key, src), rewritten = src.value !== c.importId, overrideSpec = (() => {
|
|
16362
|
-
if (c.importOverride)
|
|
16363
|
-
try {
|
|
16364
|
-
let decl = babelParse2(c.importOverride).program.body.find((n) => t3.isImportDeclaration(n));
|
|
16365
|
-
if (!decl)
|
|
16366
|
-
return;
|
|
16367
|
-
let spec = (decl.specifiers ?? []).find((s) => !isTypeSpecifier(s));
|
|
16368
|
-
return spec ? t3.isImportNamespaceSpecifier(spec) ? { kind: "namespace", local: spec.local.name } : t3.isImportDefaultSpecifier(spec) ? { kind: "default" } : t3.isImportSpecifier(spec) ? { kind: "named", imported: t3.isIdentifier(spec.imported) ? spec.imported.name : spec.imported.value } : void 0 : void 0;
|
|
16369
|
-
} catch {
|
|
16370
|
-
return;
|
|
16371
|
-
}
|
|
16372
|
-
})();
|
|
16373
|
-
if (overrideSpec) {
|
|
16374
|
-
if (overrideSpec.kind === "namespace") {
|
|
16375
|
-
let ns = t3.identifier(overrideSpec.local);
|
|
16376
|
-
addUniqueBy(b.namespaces, ns, (n) => n.name === ns.name);
|
|
16377
|
-
continue;
|
|
16378
|
-
}
|
|
16379
|
-
if (!c.localImportName)
|
|
16380
|
-
continue;
|
|
16381
|
-
if (overrideSpec.kind === "default") {
|
|
16382
|
-
let id = t3.identifier(c.localImportName);
|
|
16383
|
-
addUniqueBy(b.defaults, id, (d) => d.name === id.name);
|
|
16384
|
-
continue;
|
|
16385
|
-
}
|
|
16386
|
-
if (overrideSpec.kind === "named") {
|
|
16387
|
-
let local = t3.identifier(c.localImportName), imported = t3.identifier(overrideSpec.imported);
|
|
16388
|
-
addUniqueBy(
|
|
16389
|
-
b.named,
|
|
16390
|
-
t3.importSpecifier(local, imported),
|
|
16391
|
-
(n) => n.local.name === local.name && importedName(n.imported) === imported.name
|
|
16392
|
-
);
|
|
16393
|
-
continue;
|
|
16394
|
-
}
|
|
16395
|
-
}
|
|
16396
|
-
if (c.namespace) {
|
|
16397
|
-
if (rewritten) {
|
|
16398
|
-
if (!c.importName)
|
|
16399
|
-
continue;
|
|
16400
|
-
let member = c.importName, id = t3.identifier(member);
|
|
16401
|
-
addUniqueBy(
|
|
16402
|
-
b.named,
|
|
16403
|
-
t3.importSpecifier(id, id),
|
|
16404
|
-
(n) => n.local.name === member && importedName(n.imported) === member
|
|
16405
|
-
);
|
|
16406
|
-
} else {
|
|
16407
|
-
let ns = t3.identifier(c.namespace);
|
|
16408
|
-
addUniqueBy(b.namespaces, ns, (n) => n.name === ns.name);
|
|
16409
|
-
}
|
|
16410
|
-
continue;
|
|
16411
|
-
}
|
|
16412
|
-
if (c.importName === "default") {
|
|
16413
|
-
if (!c.localImportName)
|
|
16414
|
-
continue;
|
|
16415
|
-
if (rewritten) {
|
|
16416
|
-
let id = t3.identifier(c.localImportName);
|
|
16417
|
-
addUniqueBy(
|
|
16418
|
-
b.named,
|
|
16419
|
-
t3.importSpecifier(id, id),
|
|
16420
|
-
(n) => n.local.name === id.name && importedName(n.imported) === id.name
|
|
16421
|
-
);
|
|
16422
|
-
} else {
|
|
16423
|
-
let id = t3.identifier(c.localImportName);
|
|
16424
|
-
addUniqueBy(b.defaults, id, (d) => d.name === id.name);
|
|
16425
|
-
}
|
|
16426
|
-
continue;
|
|
16427
|
-
}
|
|
16428
|
-
if (c.importName) {
|
|
16429
|
-
if (!c.localImportName)
|
|
16430
|
-
continue;
|
|
16431
|
-
let local = t3.identifier(c.localImportName), imported = t3.identifier(c.importName);
|
|
16432
|
-
addUniqueBy(
|
|
16433
|
-
b.named,
|
|
16434
|
-
t3.importSpecifier(local, imported),
|
|
16435
|
-
(n) => n.local.name === local.name && importedName(n.imported) === imported.name
|
|
16436
|
-
);
|
|
16437
|
-
continue;
|
|
16438
|
-
}
|
|
16439
|
-
}
|
|
16440
|
-
let merged = [], printDecl = (specs, src) => {
|
|
16441
|
-
let node = t3.importDeclaration(specs, src), code = recast.print(node, {}).code;
|
|
16442
|
-
merged.push(code);
|
|
16443
|
-
}, sortedBuckets = Array.from(buckets.values()).sort((a, b) => a.order - b.order);
|
|
16444
|
-
for (let bucket of sortedBuckets) {
|
|
16445
|
-
let { source, defaults, namespaces, named } = bucket;
|
|
16446
|
-
if (!(defaults.length === 0 && namespaces.length === 0 && named.length === 0))
|
|
16447
|
-
if (namespaces.length > 0) {
|
|
16448
|
-
let firstSpecs = [];
|
|
16449
|
-
defaults[0] && firstSpecs.push(t3.importDefaultSpecifier(defaults[0])), firstSpecs.push(t3.importNamespaceSpecifier(namespaces[0])), printDecl(firstSpecs, source), named.length > 0 && printDecl(named, source);
|
|
16450
|
-
for (let d of defaults.slice(1))
|
|
16451
|
-
printDecl([t3.importDefaultSpecifier(d)], source);
|
|
16452
|
-
for (let ns of namespaces.slice(1))
|
|
16453
|
-
printDecl([t3.importNamespaceSpecifier(ns)], source);
|
|
16454
|
-
} else {
|
|
16455
|
-
if (defaults.length > 0 || named.length > 0) {
|
|
16456
|
-
let specs = [];
|
|
16457
|
-
defaults[0] && specs.push(t3.importDefaultSpecifier(defaults[0])), specs.push(...named), printDecl(specs, source);
|
|
16458
|
-
}
|
|
16459
|
-
for (let d of defaults.slice(1))
|
|
16460
|
-
printDecl([t3.importDefaultSpecifier(d)], source);
|
|
16461
|
-
}
|
|
16462
|
-
}
|
|
16463
|
-
return merged;
|
|
16464
16458
|
};
|
|
16465
16459
|
|
|
16466
16460
|
// src/componentManifest/subcomponents.ts
|
|
@@ -16564,7 +16558,7 @@ function extractStorySnippets(csf, componentName, filterStoryIds) {
|
|
|
16564
16558
|
return {
|
|
16565
16559
|
id: story.id,
|
|
16566
16560
|
name,
|
|
16567
|
-
snippet:
|
|
16561
|
+
snippet: recast.print(getCodeSnippet(csf, storyExport, componentName)).code,
|
|
16568
16562
|
description,
|
|
16569
16563
|
summary
|
|
16570
16564
|
};
|
|
@@ -16577,10 +16571,14 @@ function extractStorySnippets(csf, componentName, filterStoryIds) {
|
|
|
16577
16571
|
|
|
16578
16572
|
// src/componentManifest/buildReactComponentDocgen.ts
|
|
16579
16573
|
import { getComponentIdFromEntry } from "storybook/internal/common";
|
|
16580
|
-
import {
|
|
16574
|
+
import {
|
|
16575
|
+
buildImportStatements as buildImportStatements2,
|
|
16576
|
+
extractComponentDescription,
|
|
16577
|
+
extractDescription
|
|
16578
|
+
} from "storybook/internal/csf-tools";
|
|
16581
16579
|
function getPackageInfo(componentPath, fallbackPath) {
|
|
16582
16580
|
let nearestPkg = cachedFindUp("package.json", {
|
|
16583
|
-
cwd:
|
|
16581
|
+
cwd: posix.dirname(componentPath ?? fallbackPath)
|
|
16584
16582
|
});
|
|
16585
16583
|
try {
|
|
16586
16584
|
if (!nearestPkg)
|
|
@@ -16593,10 +16591,13 @@ function getPackageInfo(componentPath, fallbackPath) {
|
|
|
16593
16591
|
}
|
|
16594
16592
|
function getFallbackImport(packageName, componentName) {
|
|
16595
16593
|
let exportName = componentName?.split(".").at(-1);
|
|
16596
|
-
return packageName && exportName ?
|
|
16594
|
+
return packageName && exportName ? buildImportStatements2({
|
|
16595
|
+
refs: [{ importId: packageName, importName: exportName, localImportName: exportName }]
|
|
16596
|
+
}).join(`
|
|
16597
|
+
`) : "";
|
|
16597
16598
|
}
|
|
16598
16599
|
function relativizeComponentMetaPaths(doc) {
|
|
16599
|
-
let relativize = (fileName) =>
|
|
16600
|
+
let relativize = (fileName) => posix.relative(process.cwd(), fileName), relativizeProp = (prop) => ({
|
|
16600
16601
|
...prop,
|
|
16601
16602
|
parent: prop.parent ? { ...prop.parent, fileName: relativize(prop.parent.fileName) } : prop.parent,
|
|
16602
16603
|
declarations: prop.declarations?.map((declaration) => ({
|
|
@@ -16633,7 +16634,7 @@ function createSubcomponentDocgen({
|
|
|
16633
16634
|
packageName,
|
|
16634
16635
|
storyFilePath
|
|
16635
16636
|
}) {
|
|
16636
|
-
let imports =
|
|
16637
|
+
let imports = buildImportStatements2({ refs: component ? [component] : [], packageName }).join(`
|
|
16637
16638
|
`).trim() || getFallbackImport(packageName, component?.componentName), {
|
|
16638
16639
|
reactDocgen,
|
|
16639
16640
|
reactDocgenTypescript,
|
|
@@ -16672,7 +16673,7 @@ function buildStoryDocsFromResolved({
|
|
|
16672
16673
|
allComponents,
|
|
16673
16674
|
filterStoryIds
|
|
16674
16675
|
}) {
|
|
16675
|
-
let id = getComponentIdFromEntry(entry), title = entry.title.split("/").at(-1).replace(/\s+/g, ""), packageName = getPackageInfo(component?.path, storyPath), fallbackImport = getFallbackImport(packageName, componentName), imports =
|
|
16676
|
+
let id = getComponentIdFromEntry(entry), title = entry.title.split("/").at(-1).replace(/\s+/g, ""), packageName = getPackageInfo(component?.path, storyPath), fallbackImport = getFallbackImport(packageName, componentName), imports = buildImportStatements2({ refs: allComponents, packageName }).join(`
|
|
16676
16677
|
`).trim() || fallbackImport, storyEntries = extractStorySnippets(csf, component?.componentName, filterStoryIds);
|
|
16677
16678
|
return {
|
|
16678
16679
|
id,
|
|
@@ -16796,15 +16797,14 @@ function buildReactComponentDocgenFromResolved({
|
|
|
16796
16797
|
}
|
|
16797
16798
|
|
|
16798
16799
|
export {
|
|
16799
|
-
join3 as join,
|
|
16800
|
-
dirname3 as dirname,
|
|
16801
|
-
path2 as path,
|
|
16802
16800
|
extractArgTypes,
|
|
16803
16801
|
invalidateCache,
|
|
16804
16802
|
cachedReadFileSync,
|
|
16805
16803
|
parseWithReactDocgen,
|
|
16806
|
-
|
|
16804
|
+
join3 as join,
|
|
16805
|
+
posix,
|
|
16807
16806
|
getCodeSnippet,
|
|
16807
|
+
invalidateParser,
|
|
16808
16808
|
resolveStoryFileComponents,
|
|
16809
16809
|
buildStoryDocsFromResolved,
|
|
16810
16810
|
buildComponentDocgenFromResolved,
|