lecodes-cli 2.0.8 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +151 -95
- package/package.json +8 -8
- package/runtime/sdk-types.json +1 -1
- package/runtime/web/VERSION.json +3 -3
- package/runtime/web/assets/creator-2d-BSJoqaE1.wasm +0 -0
- package/runtime/web/assets/{creator-2d-CYlV77UR.js → creator-2d-DG2jJnoQ.js} +1 -1
- package/runtime/web/assets/creator-ui-Bu2prHDl.wasm +0 -0
- package/runtime/web/assets/creator-ui-HDloYDcM.js +1 -0
- package/runtime/web/player.js +15 -15
- package/runtime/web-lite/assets/{index-3CbsYWmo.js → index-BttBnvIf.js} +1 -1
- package/runtime/web-lite/assets/pager-DpGa2uaE.js +1 -0
- package/runtime/web-lite/assets/scene3d-D8LdhX0V.js +888 -0
- package/runtime/web-lite/features.json +3 -3
- package/runtime/web-lite/lite.js +21 -10
- package/src/dev/webRunner.ts +1 -1
- package/runtime/web/assets/creator-2d-nG7rGEmq.wasm +0 -0
- package/runtime/web/assets/creator-ui-CbtoaRlz.js +0 -1
- package/runtime/web/assets/creator-ui-DZaoxIpX.wasm +0 -0
- package/runtime/web-lite/assets/pager-Db5BY7FB.js +0 -1
- package/runtime/web-lite/assets/scene3d-CX7MAqmN.js +0 -866
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var package_default;
|
|
|
52
52
|
var init_package = __esm(() => {
|
|
53
53
|
package_default = {
|
|
54
54
|
name: "lecodes-cli",
|
|
55
|
-
version: "2.0.
|
|
55
|
+
version: "2.0.10",
|
|
56
56
|
dependencies: {
|
|
57
57
|
"@letary/chisel": "^0.13.0",
|
|
58
58
|
jimp: "^1.6.1",
|
|
@@ -76,7 +76,7 @@ var init_package = __esm(() => {
|
|
|
76
76
|
},
|
|
77
77
|
peerDependencies: {
|
|
78
78
|
"lecodes-design": "^0.11.0",
|
|
79
|
-
"lecodes-headless": "^2.0.
|
|
79
|
+
"lecodes-headless": "^2.0.10",
|
|
80
80
|
"lecodes-3d-editor": "^0.9.0",
|
|
81
81
|
"lecodes-assets": "^0.2.1",
|
|
82
82
|
"heic-decode": "^2.1.0",
|
|
@@ -146,7 +146,7 @@ var init_package = __esm(() => {
|
|
|
146
146
|
});
|
|
147
147
|
|
|
148
148
|
// ../../sdk/src/version.ts
|
|
149
|
-
var SDK_VERSION = "2.0.
|
|
149
|
+
var SDK_VERSION = "2.0.10", sdkMajor = (version) => {
|
|
150
150
|
const m = version?.match(/^(\d+)\.\d+\.\d+/);
|
|
151
151
|
return m ? Number(m[1]) : null;
|
|
152
152
|
}, bundleSdkVersion = (head) => head.slice(0, 2000).match(/^\/\/ sdk: (\d+\.\d+\.\d+\S*)/m)?.[1] ?? null, bundleRunsOn = (bundleVersion, hostVersion) => sdkMajor(bundleVersion) !== null && sdkMajor(bundleVersion) === sdkMajor(hostVersion);
|
|
@@ -1211,7 +1211,7 @@ var init_peerInstall = __esm(() => {
|
|
|
1211
1211
|
});
|
|
1212
1212
|
|
|
1213
1213
|
// ../../sdk/src/compile/assetMacro.ts
|
|
1214
|
-
var ASSET_RE, ASSET_CALL_RE, hasAssetMacro = (src) => src.includes("asset("), maskNonCode = (src) => {
|
|
1214
|
+
var ASSET_RE, ASSET_CALL_RE, hasAssetMacro = (src) => src.includes("asset("), maskNonCode = (src, onString) => {
|
|
1215
1215
|
const out = src.split("");
|
|
1216
1216
|
const blank = (from, to) => {
|
|
1217
1217
|
for (let k = from;k < to && k < out.length; k++)
|
|
@@ -1265,6 +1265,7 @@ var ASSET_RE, ASSET_CALL_RE, hasAssetMacro = (src) => src.includes("asset("), ma
|
|
|
1265
1265
|
if (c2 === "'" || c2 === '"') {
|
|
1266
1266
|
const start = i;
|
|
1267
1267
|
i++;
|
|
1268
|
+
let closed = false;
|
|
1268
1269
|
while (i < src.length) {
|
|
1269
1270
|
const q = src[i];
|
|
1270
1271
|
if (q === "\\") {
|
|
@@ -1272,10 +1273,16 @@ var ASSET_RE, ASSET_CALL_RE, hasAssetMacro = (src) => src.includes("asset("), ma
|
|
|
1272
1273
|
continue;
|
|
1273
1274
|
}
|
|
1274
1275
|
i++;
|
|
1275
|
-
if (q === c2
|
|
1276
|
+
if (q === c2) {
|
|
1277
|
+
closed = true;
|
|
1278
|
+
break;
|
|
1279
|
+
}
|
|
1280
|
+
if (q === `
|
|
1276
1281
|
`)
|
|
1277
1282
|
break;
|
|
1278
1283
|
}
|
|
1284
|
+
if (closed && onString)
|
|
1285
|
+
onString(start, i);
|
|
1279
1286
|
blank(start, i);
|
|
1280
1287
|
continue;
|
|
1281
1288
|
}
|
|
@@ -1304,6 +1311,47 @@ var ASSET_RE, ASSET_CALL_RE, hasAssetMacro = (src) => src.includes("asset("), ma
|
|
|
1304
1311
|
i++;
|
|
1305
1312
|
}
|
|
1306
1313
|
return out.join("");
|
|
1314
|
+
}, BARE_PATH_EXT, CODE_EXT, IMPORT_BEFORE, normalizePath = (path) => {
|
|
1315
|
+
const out = [];
|
|
1316
|
+
for (const part of path.split("/")) {
|
|
1317
|
+
if (part === "" || part === ".")
|
|
1318
|
+
continue;
|
|
1319
|
+
if (part === "..") {
|
|
1320
|
+
out.pop();
|
|
1321
|
+
continue;
|
|
1322
|
+
}
|
|
1323
|
+
out.push(part);
|
|
1324
|
+
}
|
|
1325
|
+
return "/" + out.join("/");
|
|
1326
|
+
}, collectPathLiterals = (src, filePath, exists, taken = []) => {
|
|
1327
|
+
const refs = [];
|
|
1328
|
+
const dir = filePath.slice(0, filePath.lastIndexOf("/"));
|
|
1329
|
+
maskNonCode(src, (start, end) => {
|
|
1330
|
+
const value = src.slice(start + 1, end - 1);
|
|
1331
|
+
if (value.length === 0 || value.length > 256)
|
|
1332
|
+
return;
|
|
1333
|
+
if (!BARE_PATH_EXT.test(value) || CODE_EXT.test(value))
|
|
1334
|
+
return;
|
|
1335
|
+
if (/[\s:*?"'`<>|\\]/.test(value))
|
|
1336
|
+
return;
|
|
1337
|
+
if (taken.some((t) => start >= t.index && start < t.index + t.length))
|
|
1338
|
+
return;
|
|
1339
|
+
if (IMPORT_BEFORE.test(src.slice(Math.max(0, start - 32), start)))
|
|
1340
|
+
return;
|
|
1341
|
+
const relative2 = value.startsWith("./") || value.startsWith("../");
|
|
1342
|
+
const rooted = value.startsWith("/");
|
|
1343
|
+
const candidates = rooted ? [normalizePath(value)] : relative2 ? [normalizePath(`${dir}/${value}`), normalizePath(value)] : [normalizePath(value), normalizePath(`${dir}/${value}`)];
|
|
1344
|
+
const found = candidates.find(exists);
|
|
1345
|
+
if (found === undefined && !relative2 && !rooted && !value.includes("/"))
|
|
1346
|
+
return;
|
|
1347
|
+
let line = 1;
|
|
1348
|
+
for (let k = 0;k < start; k++)
|
|
1349
|
+
if (src[k] === `
|
|
1350
|
+
`)
|
|
1351
|
+
line++;
|
|
1352
|
+
refs.push(found !== undefined ? { path: found, index: start, length: end - start, line } : { path: value, index: start, length: end - start, line, missing: true });
|
|
1353
|
+
});
|
|
1354
|
+
return refs;
|
|
1307
1355
|
}, collectAssetMacros = (src, filePath) => {
|
|
1308
1356
|
const mask = maskNonCode(src);
|
|
1309
1357
|
const refs = [];
|
|
@@ -1353,6 +1401,9 @@ var ASSET_RE, ASSET_CALL_RE, hasAssetMacro = (src) => src.includes("asset("), ma
|
|
|
1353
1401
|
var init_assetMacro = __esm(() => {
|
|
1354
1402
|
ASSET_RE = /(?<![.\w$])asset\(\s*(["'])((?:[^"'\\]|\\.)*)\1\s*\)/g;
|
|
1355
1403
|
ASSET_CALL_RE = /(?<![.\w$])asset\(/g;
|
|
1404
|
+
BARE_PATH_EXT = /\.(png|jpe?g|webp|gif|avif|bmp|svg|mp3|wav|ogg|m4a|aac|flac|mp4|webm|mov|m4v|glb|gltf|ktx2|hdr|exr|ttf|otf|woff2?|bin|bake|filamat)$/i;
|
|
1405
|
+
CODE_EXT = /\.([tj]sx?|mjs|cjs|json)$/i;
|
|
1406
|
+
IMPORT_BEFORE = /(?:\bfrom|\bimport|\bimport\s*\(|\brequire\s*\()\s*$/;
|
|
1356
1407
|
});
|
|
1357
1408
|
|
|
1358
1409
|
// ../../sdk/src/compile/detectEntry.ts
|
|
@@ -1612,7 +1663,6 @@ var init_chisel = __esm(() => {
|
|
|
1612
1663
|
"setContent",
|
|
1613
1664
|
"keepAlive",
|
|
1614
1665
|
"url",
|
|
1615
|
-
"attachTo",
|
|
1616
1666
|
"detents",
|
|
1617
1667
|
"dismissible",
|
|
1618
1668
|
"transition",
|
|
@@ -1837,6 +1887,10 @@ var resolveInject = () => {
|
|
|
1837
1887
|
}, assertAssetsExist = (refs, files) => {
|
|
1838
1888
|
const missing = [];
|
|
1839
1889
|
for (const { file, ref } of refs) {
|
|
1890
|
+
if (ref.missing) {
|
|
1891
|
+
missing.push(`file not found: ${ref.path} (${file.replace(/^\//, "")}:${ref.line})`);
|
|
1892
|
+
continue;
|
|
1893
|
+
}
|
|
1840
1894
|
if (!ref.path.startsWith("./") && !ref.path.startsWith("../") && !ref.path.startsWith("/"))
|
|
1841
1895
|
continue;
|
|
1842
1896
|
const dir = file.slice(0, file.lastIndexOf("/"));
|
|
@@ -1861,8 +1915,10 @@ var resolveInject = () => {
|
|
|
1861
1915
|
if (hasImportStatement(src))
|
|
1862
1916
|
src = rewriteLibraryImports(src, slugs);
|
|
1863
1917
|
scanSources[path] = src;
|
|
1864
|
-
|
|
1865
|
-
|
|
1918
|
+
const macros = hasAssetMacro(src) ? collectAssetMacros(src, path) : [];
|
|
1919
|
+
const paths = collectPathLiterals(src, path, (rootPath) => files[rootPath] !== undefined, macros);
|
|
1920
|
+
const found = macros.concat(paths).sort((a, b) => a.index - b.index);
|
|
1921
|
+
if (found.length > 0) {
|
|
1866
1922
|
for (const ref of found)
|
|
1867
1923
|
assetRefs.push({ file: path, ref });
|
|
1868
1924
|
src = desugarAssetMacros(src, path, found);
|
|
@@ -3849,7 +3905,7 @@ var require_typescript = __commonJS((exports, module) => {
|
|
|
3849
3905
|
nodeStartsNewLexicalEnvironment: () => nodeStartsNewLexicalEnvironment,
|
|
3850
3906
|
noop: () => noop,
|
|
3851
3907
|
noopFileWatcher: () => noopFileWatcher,
|
|
3852
|
-
normalizePath: () =>
|
|
3908
|
+
normalizePath: () => normalizePath2,
|
|
3853
3909
|
normalizeSlashes: () => normalizeSlashes,
|
|
3854
3910
|
normalizeSpans: () => normalizeSpans,
|
|
3855
3911
|
not: () => not,
|
|
@@ -9650,13 +9706,13 @@ ${lanes.join(`
|
|
|
9650
9706
|
const parentWatcher = cache.get(parentDirPath);
|
|
9651
9707
|
if (!parentWatcher)
|
|
9652
9708
|
return false;
|
|
9653
|
-
const target =
|
|
9709
|
+
const target = normalizePath2(realpath(parentDir));
|
|
9654
9710
|
let hasChanges2;
|
|
9655
9711
|
let newChildWatches;
|
|
9656
9712
|
if (filePathComparer(target, parentDir) === 0) {
|
|
9657
9713
|
hasChanges2 = enumerateInsertsAndDeletes(fileSystemEntryExists(parentDir, 1) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => {
|
|
9658
9714
|
const childFullName = getNormalizedAbsolutePath(child, parentDir);
|
|
9659
|
-
return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName,
|
|
9715
|
+
return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, normalizePath2(realpath(childFullName))) === 0 ? childFullName : undefined;
|
|
9660
9716
|
}) : emptyArray, parentWatcher.childWatches, (child, childWatcher) => filePathComparer(child, childWatcher.dirName), createAndAddChildDirectoryWatcher, closeFileWatcher, addChildDirectoryWatcher);
|
|
9661
9717
|
} else if (parentWatcher.targetWatcher && filePathComparer(target, parentWatcher.targetWatcher.dirName) === 0) {
|
|
9662
9718
|
hasChanges2 = false;
|
|
@@ -9712,7 +9768,7 @@ ${lanes.join(`
|
|
|
9712
9768
|
function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
|
|
9713
9769
|
return (eventName, relativeFileName) => {
|
|
9714
9770
|
if (eventName === "rename") {
|
|
9715
|
-
const fileName = !relativeFileName ? directoryName :
|
|
9771
|
+
const fileName = !relativeFileName ? directoryName : normalizePath2(combinePaths(directoryName, relativeFileName));
|
|
9716
9772
|
if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames2, getCurrentDirectory)) {
|
|
9717
9773
|
callback(fileName);
|
|
9718
9774
|
}
|
|
@@ -10569,7 +10625,7 @@ ${lanes.join(`
|
|
|
10569
10625
|
return path;
|
|
10570
10626
|
}
|
|
10571
10627
|
function resolvePath(path, ...paths) {
|
|
10572
|
-
return
|
|
10628
|
+
return normalizePath2(some(paths) ? combinePaths(path, ...paths) : normalizeSlashes(path));
|
|
10573
10629
|
}
|
|
10574
10630
|
function getNormalizedPathComponents(path, currentDirectory) {
|
|
10575
10631
|
return reducePathComponents(getPathComponents(path, currentDirectory));
|
|
@@ -10649,7 +10705,7 @@ ${lanes.join(`
|
|
|
10649
10705
|
}
|
|
10650
10706
|
return normalized ?? (length2 > rootLength ? removeTrailingDirectorySeparator(path) : path);
|
|
10651
10707
|
}
|
|
10652
|
-
function
|
|
10708
|
+
function normalizePath2(path) {
|
|
10653
10709
|
path = normalizeSlashes(path);
|
|
10654
10710
|
let normalized = simpleNormalizePath(path);
|
|
10655
10711
|
if (normalized !== undefined) {
|
|
@@ -10683,7 +10739,7 @@ ${lanes.join(`
|
|
|
10683
10739
|
return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory));
|
|
10684
10740
|
}
|
|
10685
10741
|
function toPath(fileName, basePath, getCanonicalFileName) {
|
|
10686
|
-
const nonCanonicalizedPath = isRootedDiskPath(fileName) ?
|
|
10742
|
+
const nonCanonicalizedPath = isRootedDiskPath(fileName) ? normalizePath2(fileName) : getNormalizedAbsolutePath(fileName, basePath);
|
|
10687
10743
|
return getCanonicalFileName(nonCanonicalizedPath);
|
|
10688
10744
|
}
|
|
10689
10745
|
function removeTrailingDirectorySeparator(path) {
|
|
@@ -16255,7 +16311,7 @@ ${lanes.join(`
|
|
|
16255
16311
|
}
|
|
16256
16312
|
setUILocale(locale);
|
|
16257
16313
|
function trySetLanguageAndTerritory(language2, territory2, errors2) {
|
|
16258
|
-
const compilerFilePath =
|
|
16314
|
+
const compilerFilePath = normalizePath2(sys2.getExecutingFilePath());
|
|
16259
16315
|
const containingDirectoryPath = getDirectoryPath(compilerFilePath);
|
|
16260
16316
|
let filePath = combinePaths(containingDirectoryPath, language2);
|
|
16261
16317
|
if (territory2) {
|
|
@@ -21517,7 +21573,7 @@ ${lanes.join(`
|
|
|
21517
21573
|
try {
|
|
21518
21574
|
writeFile2(path, data, writeByteOrderMark);
|
|
21519
21575
|
} catch {
|
|
21520
|
-
ensureDirectoriesExist(getDirectoryPath(
|
|
21576
|
+
ensureDirectoriesExist(getDirectoryPath(normalizePath2(path)), createDirectory, directoryExists);
|
|
21521
21577
|
writeFile2(path, data, writeByteOrderMark);
|
|
21522
21578
|
}
|
|
21523
21579
|
}
|
|
@@ -23425,8 +23481,8 @@ ${lanes.join(`
|
|
|
23425
23481
|
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
|
|
23426
23482
|
}
|
|
23427
23483
|
function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory) {
|
|
23428
|
-
path =
|
|
23429
|
-
currentDirectory =
|
|
23484
|
+
path = normalizePath2(path);
|
|
23485
|
+
currentDirectory = normalizePath2(currentDirectory);
|
|
23430
23486
|
const absolutePath = combinePaths(currentDirectory, path);
|
|
23431
23487
|
return {
|
|
23432
23488
|
includeFilePatterns: map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), (pattern) => `^${pattern}$`),
|
|
@@ -23440,8 +23496,8 @@ ${lanes.join(`
|
|
|
23440
23496
|
return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i");
|
|
23441
23497
|
}
|
|
23442
23498
|
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath) {
|
|
23443
|
-
path =
|
|
23444
|
-
currentDirectory =
|
|
23499
|
+
path = normalizePath2(path);
|
|
23500
|
+
currentDirectory = normalizePath2(currentDirectory);
|
|
23445
23501
|
const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory);
|
|
23446
23502
|
const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames2));
|
|
23447
23503
|
const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames2);
|
|
@@ -23495,7 +23551,7 @@ ${lanes.join(`
|
|
|
23495
23551
|
if (includes) {
|
|
23496
23552
|
const includeBasePaths = [];
|
|
23497
23553
|
for (const include of includes) {
|
|
23498
|
-
const absolute = isRootedDiskPath(include) ? include :
|
|
23554
|
+
const absolute = isRootedDiskPath(include) ? include : normalizePath2(combinePaths(path, include));
|
|
23499
23555
|
includeBasePaths.push(getIncludeBasePath(absolute));
|
|
23500
23556
|
}
|
|
23501
23557
|
includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2));
|
|
@@ -33145,7 +33201,7 @@ ${lanes.join(`
|
|
|
33145
33201
|
IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
|
|
33146
33202
|
PrivateIdentifierConstructor2 = objectAllocator.getPrivateIdentifierConstructor();
|
|
33147
33203
|
SourceFileConstructor2 = objectAllocator.getSourceFileConstructor();
|
|
33148
|
-
fileName =
|
|
33204
|
+
fileName = normalizePath2(_fileName);
|
|
33149
33205
|
sourceText = _sourceText;
|
|
33150
33206
|
languageVersion = _languageVersion;
|
|
33151
33207
|
syntaxCursor = _syntaxCursor;
|
|
@@ -41770,7 +41826,7 @@ ${lanes.join(`
|
|
|
41770
41826
|
const options = handleOptionConfigDirTemplateSubstitution(extend(existingOptions, parsedConfig.options || {}), configDirTemplateSubstitutionOptions, basePath);
|
|
41771
41827
|
const watchOptions = handleWatchOptionsConfigDirTemplateSubstitution(existingWatchOptions && parsedConfig.watchOptions ? extend(existingWatchOptions, parsedConfig.watchOptions) : parsedConfig.watchOptions || existingWatchOptions, basePath);
|
|
41772
41828
|
options.configFilePath = configFileName && normalizeSlashes(configFileName);
|
|
41773
|
-
const basePathForFileNames =
|
|
41829
|
+
const basePathForFileNames = normalizePath2(configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath);
|
|
41774
41830
|
const configFileSpecs = getConfigFileSpecs();
|
|
41775
41831
|
if (sourceFile)
|
|
41776
41832
|
sourceFile.configFileSpecs = configFileSpecs;
|
|
@@ -42307,7 +42363,7 @@ ${lanes.join(`
|
|
|
42307
42363
|
var invalidTrailingRecursionPattern = /(?:^|\/)\*\*\/?$/;
|
|
42308
42364
|
var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/;
|
|
42309
42365
|
function getFileNamesFromConfigSpecs(configFileSpecs, basePath, options, host, extraFileExtensions = emptyArray) {
|
|
42310
|
-
basePath =
|
|
42366
|
+
basePath = normalizePath2(basePath);
|
|
42311
42367
|
const keyMapper = createGetCanonicalFileName(host.useCaseSensitiveFileNames);
|
|
42312
42368
|
const literalFileMap = /* @__PURE__ */ new Map;
|
|
42313
42369
|
const wildcardFileMap = /* @__PURE__ */ new Map;
|
|
@@ -42357,7 +42413,7 @@ ${lanes.join(`
|
|
|
42357
42413
|
const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = spec;
|
|
42358
42414
|
if (!length(validatedIncludeSpecs) || !length(validatedExcludeSpecs))
|
|
42359
42415
|
return false;
|
|
42360
|
-
basePath =
|
|
42416
|
+
basePath = normalizePath2(basePath);
|
|
42361
42417
|
const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
42362
42418
|
if (validatedFilesSpec) {
|
|
42363
42419
|
for (const fileName of validatedFilesSpec) {
|
|
@@ -42379,7 +42435,7 @@ ${lanes.join(`
|
|
|
42379
42435
|
return matchesExcludeWorker(pathToCheck, filter(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)), useCaseSensitiveFileNames2, currentDirectory);
|
|
42380
42436
|
}
|
|
42381
42437
|
function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath) {
|
|
42382
|
-
const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(
|
|
42438
|
+
const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath2(currentDirectory), basePath), "exclude");
|
|
42383
42439
|
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames2);
|
|
42384
42440
|
if (!excludeRegex)
|
|
42385
42441
|
return false;
|
|
@@ -42418,7 +42474,7 @@ ${lanes.join(`
|
|
|
42418
42474
|
if (include !== undefined) {
|
|
42419
42475
|
const recursiveKeys = [];
|
|
42420
42476
|
for (const file of include) {
|
|
42421
|
-
const spec =
|
|
42477
|
+
const spec = normalizePath2(combinePaths(basePath, file));
|
|
42422
42478
|
if (excludeRegex && excludeRegex.test(spec)) {
|
|
42423
42479
|
continue;
|
|
42424
42480
|
}
|
|
@@ -42713,7 +42769,7 @@ ${lanes.join(`
|
|
|
42713
42769
|
}
|
|
42714
42770
|
return;
|
|
42715
42771
|
}
|
|
42716
|
-
const path =
|
|
42772
|
+
const path = normalizePath2(combinePaths(baseDirectory, fileName));
|
|
42717
42773
|
if (state.traceEnabled) {
|
|
42718
42774
|
trace(state.host, Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path);
|
|
42719
42775
|
}
|
|
@@ -42796,7 +42852,7 @@ ${lanes.join(`
|
|
|
42796
42852
|
}
|
|
42797
42853
|
function getDefaultTypeRoots(currentDirectory) {
|
|
42798
42854
|
let typeRoots;
|
|
42799
|
-
forEachAncestorDirectory(
|
|
42855
|
+
forEachAncestorDirectory(normalizePath2(currentDirectory), (directory) => {
|
|
42800
42856
|
const atTypes = combinePaths(directory, nodeModulesAtTypes);
|
|
42801
42857
|
(typeRoots ?? (typeRoots = [])).push(atTypes);
|
|
42802
42858
|
});
|
|
@@ -43048,7 +43104,7 @@ ${lanes.join(`
|
|
|
43048
43104
|
for (const root of typeRoots) {
|
|
43049
43105
|
if (host.directoryExists(root)) {
|
|
43050
43106
|
for (const typeDirectivePath of host.getDirectories(root)) {
|
|
43051
|
-
const normalized =
|
|
43107
|
+
const normalized = normalizePath2(typeDirectivePath);
|
|
43052
43108
|
const packageJsonPath = combinePaths(root, normalized, "package.json");
|
|
43053
43109
|
const isNotNeededPackage = host.fileExists(packageJsonPath) && readJson2(packageJsonPath, host).typings === null;
|
|
43054
43110
|
if (!isNotNeededPackage) {
|
|
@@ -43468,11 +43524,11 @@ ${lanes.join(`
|
|
|
43468
43524
|
if (state.traceEnabled) {
|
|
43469
43525
|
trace(state.host, Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0, moduleName);
|
|
43470
43526
|
}
|
|
43471
|
-
const candidate =
|
|
43527
|
+
const candidate = normalizePath2(combinePaths(containingDirectory, moduleName));
|
|
43472
43528
|
let matchedRootDir;
|
|
43473
43529
|
let matchedNormalizedPrefix;
|
|
43474
43530
|
for (const rootDir of state.compilerOptions.rootDirs) {
|
|
43475
|
-
let normalizedRoot =
|
|
43531
|
+
let normalizedRoot = normalizePath2(rootDir);
|
|
43476
43532
|
if (!endsWith(normalizedRoot, directorySeparator)) {
|
|
43477
43533
|
normalizedRoot += directorySeparator;
|
|
43478
43534
|
}
|
|
@@ -43504,7 +43560,7 @@ ${lanes.join(`
|
|
|
43504
43560
|
if (rootDir === matchedRootDir) {
|
|
43505
43561
|
continue;
|
|
43506
43562
|
}
|
|
43507
|
-
const candidate2 = combinePaths(
|
|
43563
|
+
const candidate2 = combinePaths(normalizePath2(rootDir), suffix);
|
|
43508
43564
|
if (state.traceEnabled) {
|
|
43509
43565
|
trace(state.host, Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, rootDir, candidate2);
|
|
43510
43566
|
}
|
|
@@ -43528,7 +43584,7 @@ ${lanes.join(`
|
|
|
43528
43584
|
if (state.traceEnabled) {
|
|
43529
43585
|
trace(state.host, Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName);
|
|
43530
43586
|
}
|
|
43531
|
-
const candidate =
|
|
43587
|
+
const candidate = normalizePath2(combinePaths(baseUrl, moduleName));
|
|
43532
43588
|
if (state.traceEnabled) {
|
|
43533
43589
|
trace(state.host, Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2, moduleName, baseUrl, candidate);
|
|
43534
43590
|
}
|
|
@@ -43705,14 +43761,14 @@ ${lanes.join(`
|
|
|
43705
43761
|
const combined = combinePaths(containingDirectory, moduleName);
|
|
43706
43762
|
const parts = getPathComponents(combined);
|
|
43707
43763
|
const lastPart = lastOrUndefined(parts);
|
|
43708
|
-
const path = lastPart === "." || lastPart === ".." ? ensureTrailingDirectorySeparator(
|
|
43764
|
+
const path = lastPart === "." || lastPart === ".." ? ensureTrailingDirectorySeparator(normalizePath2(combined)) : normalizePath2(combined);
|
|
43709
43765
|
return { path, parts };
|
|
43710
43766
|
}
|
|
43711
43767
|
function realPath(path, host, traceEnabled) {
|
|
43712
43768
|
if (!host.realpath) {
|
|
43713
43769
|
return path;
|
|
43714
43770
|
}
|
|
43715
|
-
const real =
|
|
43771
|
+
const real = normalizePath2(host.realpath(path));
|
|
43716
43772
|
if (traceEnabled) {
|
|
43717
43773
|
trace(host, Diagnostics.Resolving_real_path_for_0_result_1, path, real);
|
|
43718
43774
|
}
|
|
@@ -43758,7 +43814,7 @@ ${lanes.join(`
|
|
|
43758
43814
|
return path.includes(nodeModulesPathPart);
|
|
43759
43815
|
}
|
|
43760
43816
|
function parseNodeModuleFromPath(resolved, isFolder) {
|
|
43761
|
-
const path =
|
|
43817
|
+
const path = normalizePath2(resolved);
|
|
43762
43818
|
const idx = path.lastIndexOf(nodeModulesPathPart);
|
|
43763
43819
|
if (idx === -1) {
|
|
43764
43820
|
return;
|
|
@@ -44524,7 +44580,7 @@ ${lanes.join(`
|
|
|
44524
44580
|
}
|
|
44525
44581
|
function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
|
|
44526
44582
|
var _a, _b;
|
|
44527
|
-
const candidate =
|
|
44583
|
+
const candidate = normalizePath2(combinePaths(nodeModulesDirectory, moduleName));
|
|
44528
44584
|
const { packageName, rest } = parsePackageName(moduleName);
|
|
44529
44585
|
const packageDirectory = combinePaths(nodeModulesDirectory, packageName);
|
|
44530
44586
|
let rootPackageInfo;
|
|
@@ -44577,7 +44633,7 @@ ${lanes.join(`
|
|
|
44577
44633
|
}
|
|
44578
44634
|
const resolved = forEach(paths[matchedPatternText], (subst) => {
|
|
44579
44635
|
const path = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
|
|
44580
|
-
const candidate =
|
|
44636
|
+
const candidate = normalizePath2(combinePaths(baseDirectory, path));
|
|
44581
44637
|
if (state.traceEnabled) {
|
|
44582
44638
|
trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);
|
|
44583
44639
|
}
|
|
@@ -44675,7 +44731,7 @@ ${lanes.join(`
|
|
|
44675
44731
|
if (resolutionFromCache) {
|
|
44676
44732
|
return resolutionFromCache;
|
|
44677
44733
|
}
|
|
44678
|
-
const searchName =
|
|
44734
|
+
const searchName = normalizePath2(combinePaths(directory, moduleName));
|
|
44679
44735
|
return toSearchResult(loadModuleFromFileNoPackageId(extensions, searchName, false, state));
|
|
44680
44736
|
});
|
|
44681
44737
|
if (resolved2)
|
|
@@ -44687,7 +44743,7 @@ ${lanes.join(`
|
|
|
44687
44743
|
return resolved3;
|
|
44688
44744
|
}
|
|
44689
44745
|
} else {
|
|
44690
|
-
const candidate =
|
|
44746
|
+
const candidate = normalizePath2(combinePaths(containingDirectory, moduleName));
|
|
44691
44747
|
return toSearchResult(loadModuleFromFileNoPackageId(extensions, candidate, false, state));
|
|
44692
44748
|
}
|
|
44693
44749
|
}
|
|
@@ -48102,7 +48158,7 @@ ${lanes.join(`
|
|
|
48102
48158
|
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) {
|
|
48103
48159
|
for (const key in paths) {
|
|
48104
48160
|
for (const patternText2 of paths[key]) {
|
|
48105
|
-
const normalized =
|
|
48161
|
+
const normalized = normalizePath2(patternText2);
|
|
48106
48162
|
const pattern = getRelativePathIfInSameVolume(normalized, baseDirectory, getCanonicalFileName) ?? normalized;
|
|
48107
48163
|
const indexOfStar = pattern.indexOf("*");
|
|
48108
48164
|
const candidates = allowedEndings.map((ending) => ({
|
|
@@ -103371,7 +103427,7 @@ ${lanes.join(`
|
|
|
103371
103427
|
return getOutputs();
|
|
103372
103428
|
}
|
|
103373
103429
|
function getOutputFileNames(commandLine2, inputFileName, ignoreCase) {
|
|
103374
|
-
inputFileName =
|
|
103430
|
+
inputFileName = normalizePath2(inputFileName);
|
|
103375
103431
|
Debug.assert(contains(commandLine2.fileNames, inputFileName), `Expected fileName to be present in command line`);
|
|
103376
103432
|
const { addOutput, getOutputs } = createAddOutput();
|
|
103377
103433
|
if (commandLine2.options.outFile) {
|
|
@@ -103635,7 +103691,7 @@ ${lanes.join(`
|
|
|
103635
103691
|
}
|
|
103636
103692
|
return sourceMapDir;
|
|
103637
103693
|
}
|
|
103638
|
-
return getDirectoryPath(
|
|
103694
|
+
return getDirectoryPath(normalizePath2(filePath));
|
|
103639
103695
|
}
|
|
103640
103696
|
function getSourceMappingURL(mapOptions, sourceMapGenerator, filePath, sourceMapFilePath, sourceFile) {
|
|
103641
103697
|
if (mapOptions.inlineSourceMap) {
|
|
@@ -103651,7 +103707,7 @@ ${lanes.join(`
|
|
|
103651
103707
|
}
|
|
103652
103708
|
if (getRootLength(sourceMapDir) === 0) {
|
|
103653
103709
|
sourceMapDir = combinePaths(host.getCommonSourceDirectory(), sourceMapDir);
|
|
103654
|
-
return encodeURI(getRelativePathToDirectoryOrUrl(getDirectoryPath(
|
|
103710
|
+
return encodeURI(getRelativePathToDirectoryOrUrl(getDirectoryPath(normalizePath2(filePath)), combinePaths(sourceMapDir, sourceMapFile), host.getCurrentDirectory(), host.getCanonicalFileName, true));
|
|
103655
103711
|
} else {
|
|
103656
103712
|
return encodeURI(combinePaths(sourceMapDir, sourceMapFile));
|
|
103657
103713
|
}
|
|
@@ -107674,7 +107730,7 @@ ${lanes.join(`
|
|
|
107674
107730
|
return entries;
|
|
107675
107731
|
}
|
|
107676
107732
|
function getBaseNameOfFileName(fileName) {
|
|
107677
|
-
return getBaseFileName(
|
|
107733
|
+
return getBaseFileName(normalizePath2(fileName));
|
|
107678
107734
|
}
|
|
107679
107735
|
function createCachedFileSystemEntries(rootDir, rootDirPath) {
|
|
107680
107736
|
var _a;
|
|
@@ -108096,7 +108152,7 @@ ${lanes.join(`
|
|
|
108096
108152
|
function resolveTripleslashReference(moduleName, containingFile) {
|
|
108097
108153
|
const basePath = getDirectoryPath(containingFile);
|
|
108098
108154
|
const referencedFileName = isRootedDiskPath(moduleName) ? moduleName : combinePaths(basePath, moduleName);
|
|
108099
|
-
return
|
|
108155
|
+
return normalizePath2(referencedFileName);
|
|
108100
108156
|
}
|
|
108101
108157
|
function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, getCanonicalFileName) {
|
|
108102
108158
|
let commonPathComponents;
|
|
@@ -108177,7 +108233,7 @@ ${lanes.join(`
|
|
|
108177
108233
|
return false;
|
|
108178
108234
|
}
|
|
108179
108235
|
function getDefaultLibLocation() {
|
|
108180
|
-
return getDirectoryPath(
|
|
108236
|
+
return getDirectoryPath(normalizePath2(system.getExecutingFilePath()));
|
|
108181
108237
|
}
|
|
108182
108238
|
const newLine = getNewLineCharacter(options);
|
|
108183
108239
|
const realpath = system.realpath && ((path) => system.realpath(path));
|
|
@@ -110047,7 +110103,7 @@ ${lanes.join(`
|
|
|
110047
110103
|
return configFileParsingDiagnostics || emptyArray;
|
|
110048
110104
|
}
|
|
110049
110105
|
function processRootFile(fileName, isDefaultLib, ignoreNoDefaultLib, reason) {
|
|
110050
|
-
processSourceFile(
|
|
110106
|
+
processSourceFile(normalizePath2(fileName), isDefaultLib, ignoreNoDefaultLib, undefined, reason);
|
|
110051
110107
|
}
|
|
110052
110108
|
function fileReferenceIsEqualTo(a, b) {
|
|
110053
110109
|
return a.fileName === b.fileName;
|
|
@@ -111264,7 +111320,7 @@ ${lanes.join(`
|
|
|
111264
111320
|
const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory));
|
|
111265
111321
|
if ((_a = symlinkCache.getSymlinkedDirectories()) == null ? undefined : _a.has(directoryPath))
|
|
111266
111322
|
return;
|
|
111267
|
-
const real =
|
|
111323
|
+
const real = normalizePath2(originalRealpath.call(host.compilerHost, directory));
|
|
111268
111324
|
let realPath2;
|
|
111269
111325
|
if (real === directory || (realPath2 = ensureTrailingDirectorySeparator(host.toPath(real))) === directoryPath) {
|
|
111270
111326
|
symlinkCache.setSymlinkedDirectory(directoryPath, false);
|
|
@@ -113422,7 +113478,7 @@ ${lanes.join(`
|
|
|
113422
113478
|
}
|
|
113423
113479
|
function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, isRootWatchable, getCurrentDirectory, preferNonRecursiveWatch) {
|
|
113424
113480
|
const failedLookupPathComponents = getPathComponents(failedLookupLocationPath);
|
|
113425
|
-
failedLookupLocation = isRootedDiskPath(failedLookupLocation) ?
|
|
113481
|
+
failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath2(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
|
|
113426
113482
|
const failedLookupComponents = getPathComponents(failedLookupLocation);
|
|
113427
113483
|
const perceivedOsRootLength = perceivedOsRootLengthForWatching(failedLookupPathComponents, failedLookupPathComponents.length);
|
|
113428
113484
|
if (failedLookupPathComponents.length <= perceivedOsRootLength + 1)
|
|
@@ -113483,7 +113539,7 @@ ${lanes.join(`
|
|
|
113483
113539
|
if (isRootWatchable && isInDirectoryPath(rootPathComponents, typeRootPathComponents)) {
|
|
113484
113540
|
return rootPath;
|
|
113485
113541
|
}
|
|
113486
|
-
typeRoot = isRootedDiskPath(typeRoot) ?
|
|
113542
|
+
typeRoot = isRootedDiskPath(typeRoot) ? normalizePath2(typeRoot) : getNormalizedAbsolutePath(typeRoot, getCurrentDirectory());
|
|
113487
113543
|
const toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(getPathComponents(typeRoot), typeRootPathComponents, typeRootPathComponents.length, perceivedOsRootLengthForWatching(typeRootPathComponents, typeRootPathComponents.length), typeRootPathComponents.indexOf("node_modules"), rootPathComponents, typeRootPathComponents.lastIndexOf("node_modules"), preferNonRecursiveWatch);
|
|
113488
113544
|
return toWatch && filterCustomPath(toWatch.dirPath) ? toWatch.dirPath : undefined;
|
|
113489
113545
|
}
|
|
@@ -114764,7 +114820,7 @@ ${lanes.join(`
|
|
|
114764
114820
|
};
|
|
114765
114821
|
}
|
|
114766
114822
|
function createProgramHost(system, createProgram2) {
|
|
114767
|
-
const getDefaultLibLocation = memoize(() => getDirectoryPath(
|
|
114823
|
+
const getDefaultLibLocation = memoize(() => getDirectoryPath(normalizePath2(system.getExecutingFilePath())));
|
|
114768
114824
|
return {
|
|
114769
114825
|
useCaseSensitiveFileNames: () => system.useCaseSensitiveFileNames,
|
|
114770
114826
|
getNewLine: () => system.newLine,
|
|
@@ -117330,7 +117386,7 @@ ${lanes.join(`
|
|
|
117330
117386
|
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Option_project_cannot_be_mixed_with_source_files_on_a_command_line));
|
|
117331
117387
|
return sys2.exit(1);
|
|
117332
117388
|
}
|
|
117333
|
-
const fileOrDirectory =
|
|
117389
|
+
const fileOrDirectory = normalizePath2(commandLine2.options.project);
|
|
117334
117390
|
if (!fileOrDirectory || sys2.directoryExists(fileOrDirectory)) {
|
|
117335
117391
|
configFileName = combinePaths(fileOrDirectory, "tsconfig.json");
|
|
117336
117392
|
if (!sys2.fileExists(configFileName)) {
|
|
@@ -117345,12 +117401,12 @@ ${lanes.join(`
|
|
|
117345
117401
|
}
|
|
117346
117402
|
}
|
|
117347
117403
|
} else if (commandLine2.fileNames.length === 0) {
|
|
117348
|
-
const searchPath =
|
|
117404
|
+
const searchPath = normalizePath2(sys2.getCurrentDirectory());
|
|
117349
117405
|
configFileName = findConfigFile(searchPath, (fileName) => sys2.fileExists(fileName));
|
|
117350
117406
|
}
|
|
117351
117407
|
if (commandLine2.fileNames.length === 0 && !configFileName) {
|
|
117352
117408
|
if (commandLine2.options.showConfig) {
|
|
117353
|
-
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0,
|
|
117409
|
+
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0, normalizePath2(sys2.getCurrentDirectory())));
|
|
117354
117410
|
} else {
|
|
117355
117411
|
printVersion(sys2);
|
|
117356
117412
|
printHelp(sys2, commandLine2);
|
|
@@ -117783,7 +117839,7 @@ ${lanes.join(`
|
|
|
117783
117839
|
}
|
|
117784
117840
|
function writeConfigFile(sys2, reportDiagnostic, options, fileNames) {
|
|
117785
117841
|
const currentDirectory = sys2.getCurrentDirectory();
|
|
117786
|
-
const file =
|
|
117842
|
+
const file = normalizePath2(combinePaths(currentDirectory, "tsconfig.json"));
|
|
117787
117843
|
if (sys2.fileExists(file)) {
|
|
117788
117844
|
reportDiagnostic(createCompilerDiagnostic(Diagnostics.A_tsconfig_json_file_is_already_defined_at_Colon_0, file));
|
|
117789
117845
|
} else {
|
|
@@ -118761,7 +118817,7 @@ ${lanes.join(`
|
|
|
118761
118817
|
}
|
|
118762
118818
|
const inferredTypings = /* @__PURE__ */ new Map;
|
|
118763
118819
|
fileNames = mapDefined(fileNames, (fileName) => {
|
|
118764
|
-
const path =
|
|
118820
|
+
const path = normalizePath2(fileName);
|
|
118765
118821
|
if (hasJSFileExtension(path)) {
|
|
118766
118822
|
return path;
|
|
118767
118823
|
}
|
|
@@ -118839,14 +118895,14 @@ ${lanes.join(`
|
|
|
118839
118895
|
if (getBaseFileName(manifestPath22) !== manifestName) {
|
|
118840
118896
|
return false;
|
|
118841
118897
|
}
|
|
118842
|
-
const pathComponents2 = getPathComponents(
|
|
118898
|
+
const pathComponents2 = getPathComponents(normalizePath2(manifestPath22));
|
|
118843
118899
|
const isScoped = pathComponents2[pathComponents2.length - 3][0] === "@";
|
|
118844
118900
|
return isScoped && toFileNameLowerCase(pathComponents2[pathComponents2.length - 4]) === modulesDirName || !isScoped && toFileNameLowerCase(pathComponents2[pathComponents2.length - 3]) === modulesDirName;
|
|
118845
118901
|
});
|
|
118846
118902
|
if (log2)
|
|
118847
118903
|
log2(`Searching for typing names in ${packagesFolderPath}; all files: ${JSON.stringify(dependencyManifestNames)}`);
|
|
118848
118904
|
for (const manifestPath22 of dependencyManifestNames) {
|
|
118849
|
-
const normalizedFileName =
|
|
118905
|
+
const normalizedFileName = normalizePath2(manifestPath22);
|
|
118850
118906
|
const result2 = readConfigFile(normalizedFileName, (path) => host.readFile(path));
|
|
118851
118907
|
const manifest2 = result2.config;
|
|
118852
118908
|
if (!manifest2.name) {
|
|
@@ -120800,7 +120856,7 @@ ${lanes.join(`
|
|
|
120800
120856
|
}
|
|
120801
120857
|
function getMappedLocation(location, sourceMapper, fileExists) {
|
|
120802
120858
|
const mapsTo = sourceMapper.tryGetSourcePosition(location);
|
|
120803
|
-
return mapsTo && (!fileExists || fileExists(
|
|
120859
|
+
return mapsTo && (!fileExists || fileExists(normalizePath2(mapsTo.fileName)) ? mapsTo : undefined);
|
|
120804
120860
|
}
|
|
120805
120861
|
function getMappedDocumentSpan(documentSpan, sourceMapper, fileExists) {
|
|
120806
120862
|
const { fileName, textSpan } = documentSpan;
|
|
@@ -123876,7 +123932,7 @@ ${lanes.join(`
|
|
|
123876
123932
|
}
|
|
123877
123933
|
}
|
|
123878
123934
|
function combineNormal(pathA, pathB) {
|
|
123879
|
-
return
|
|
123935
|
+
return normalizePath2(combinePaths(pathA, pathB));
|
|
123880
123936
|
}
|
|
123881
123937
|
function combinePathsSafe(pathA, pathB) {
|
|
123882
123938
|
return ensurePathIsNonModuleName(combineNormal(pathA, pathB));
|
|
@@ -124954,7 +125010,7 @@ interface Symbol {
|
|
|
124954
125010
|
}
|
|
124955
125011
|
const newLine = getNewLineCharacter(options);
|
|
124956
125012
|
const compilerHost = {
|
|
124957
|
-
getSourceFile: (fileName) => fileName ===
|
|
125013
|
+
getSourceFile: (fileName) => fileName === normalizePath2(inputFileName) ? sourceFile : fileName === normalizePath2(barebonesLibName) ? barebonesLibSourceFile : undefined,
|
|
124958
125014
|
writeFile: (name, text) => {
|
|
124959
125015
|
if (fileExtensionIs(name, ".map")) {
|
|
124960
125016
|
Debug.assertEqual(sourceMapText, undefined, "Unexpected multiple source map outputs, file:", name);
|
|
@@ -125659,7 +125715,7 @@ interface Symbol {
|
|
|
125659
125715
|
switch (node.kind) {
|
|
125660
125716
|
case 307:
|
|
125661
125717
|
const sourceFile = node;
|
|
125662
|
-
return isExternalModule(sourceFile) ? `"${escapeString(getBaseFileName(removeFileExtension(
|
|
125718
|
+
return isExternalModule(sourceFile) ? `"${escapeString(getBaseFileName(removeFileExtension(normalizePath2(sourceFile.fileName))))}"` : "<global>";
|
|
125663
125719
|
case 277:
|
|
125664
125720
|
return isExportAssignment(node) && node.isExportEquals ? "export=" : "default";
|
|
125665
125721
|
case 219:
|
|
@@ -126684,7 +126740,7 @@ interface Symbol {
|
|
|
126684
126740
|
const cfg = program.getCompilerOptions().configFile;
|
|
126685
126741
|
if (!cfg)
|
|
126686
126742
|
return;
|
|
126687
|
-
const newFileAbsolutePath =
|
|
126743
|
+
const newFileAbsolutePath = normalizePath2(combinePaths(oldFileName, "..", newFileNameWithExtension));
|
|
126688
126744
|
const newFilePath = getRelativePathFromFile(cfg.fileName, newFileAbsolutePath, getCanonicalFileName);
|
|
126689
126745
|
const cfgObject = cfg.statements[0] && tryCast(cfg.statements[0].expression, isObjectLiteralExpression);
|
|
126690
126746
|
const filesProp = cfgObject && find2(cfgObject.properties, (prop) => isPropertyAssignment(prop) && isStringLiteral(prop.name) && prop.name.text === "files");
|
|
@@ -131944,8 +132000,8 @@ ${newComment.split(`
|
|
|
131944
132000
|
return ts_FindAllReferences_exports.getImplementationsAtPosition(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position);
|
|
131945
132001
|
}
|
|
131946
132002
|
function getDocumentHighlights(fileName, position, filesToSearch) {
|
|
131947
|
-
const normalizedFileName =
|
|
131948
|
-
Debug.assert(filesToSearch.some((f) =>
|
|
132003
|
+
const normalizedFileName = normalizePath2(fileName);
|
|
132004
|
+
Debug.assert(filesToSearch.some((f) => normalizePath2(f) === normalizedFileName));
|
|
131949
132005
|
synchronizeHostData();
|
|
131950
132006
|
const sourceFilesToSearch = mapDefined(filesToSearch, (fileName2) => program.getSourceFile(fileName2));
|
|
131951
132007
|
const sourceFile = getValidSourceFile(fileName);
|
|
@@ -132765,7 +132821,7 @@ ${newComment.split(`
|
|
|
132765
132821
|
}
|
|
132766
132822
|
function getDefaultLibFilePath(options) {
|
|
132767
132823
|
if (sys) {
|
|
132768
|
-
return combinePaths(getDirectoryPath(
|
|
132824
|
+
return combinePaths(getDirectoryPath(normalizePath2(sys.getExecutingFilePath())), getDefaultLibFileName(options));
|
|
132769
132825
|
}
|
|
132770
132826
|
throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. ");
|
|
132771
132827
|
}
|
|
@@ -146754,7 +146810,7 @@ ${newComment.split(`
|
|
|
146754
146810
|
return moduleResolutionUsesNodeModules(moduleResolution) ? getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions) : extensions;
|
|
146755
146811
|
}
|
|
146756
146812
|
function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase) {
|
|
146757
|
-
rootDirs = rootDirs.map((rootDirectory) => ensureTrailingDirectorySeparator(
|
|
146813
|
+
rootDirs = rootDirs.map((rootDirectory) => ensureTrailingDirectorySeparator(normalizePath2(isRootedDiskPath(rootDirectory) ? rootDirectory : combinePaths(basePath, rootDirectory))));
|
|
146758
146814
|
const relativeDirectory = firstDefined(rootDirs, (rootDirectory) => containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined);
|
|
146759
146815
|
return deduplicate([...rootDirs.map((rootDirectory) => combinePaths(rootDirectory, relativeDirectory)), scriptDirectory].map((baseDir) => removeTrailingDirectorySeparator(baseDir)), equateStringsCaseSensitive, compareStringsCaseSensitive);
|
|
146760
146816
|
}
|
|
@@ -146803,7 +146859,7 @@ ${newComment.split(`
|
|
|
146803
146859
|
const files = tryReadDirectory(host, baseDirectory, extensionOptions.extensionsToSearch, undefined, ["./*"]);
|
|
146804
146860
|
if (files) {
|
|
146805
146861
|
for (let filePath of files) {
|
|
146806
|
-
filePath =
|
|
146862
|
+
filePath = normalizePath2(filePath);
|
|
146807
146863
|
if (exclude && comparePaths(filePath, exclude, scriptDirectory, ignoreCase) === 0) {
|
|
146808
146864
|
continue;
|
|
146809
146865
|
}
|
|
@@ -146814,7 +146870,7 @@ ${newComment.split(`
|
|
|
146814
146870
|
const directories = tryGetDirectories(host, baseDirectory);
|
|
146815
146871
|
if (directories) {
|
|
146816
146872
|
for (const directory of directories) {
|
|
146817
|
-
const directoryName = getBaseFileName(
|
|
146873
|
+
const directoryName = getBaseFileName(normalizePath2(directory));
|
|
146818
146874
|
if (directoryName !== "@types") {
|
|
146819
146875
|
result.add(directoryResult(directoryName));
|
|
146820
146876
|
}
|
|
@@ -146894,7 +146950,7 @@ ${newComment.split(`
|
|
|
146894
146950
|
const result = createNameAndKindSet();
|
|
146895
146951
|
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
146896
146952
|
if (baseUrl) {
|
|
146897
|
-
const absolute =
|
|
146953
|
+
const absolute = normalizePath2(combinePaths(host.getCurrentDirectory(), baseUrl));
|
|
146898
146954
|
getCompletionEntriesForDirectoryFragment(fragment, absolute, extensionOptions, program, host, moduleSpecifierResolutionHost, false, undefined, result);
|
|
146899
146955
|
}
|
|
146900
146956
|
if (paths) {
|
|
@@ -147041,10 +147097,10 @@ ${newComment.split(`
|
|
|
147041
147097
|
const outDir = program.getCompilerOptions().outDir;
|
|
147042
147098
|
const declarationDir = program.getCompilerOptions().declarationDir;
|
|
147043
147099
|
const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory;
|
|
147044
|
-
const baseDirectory =
|
|
147100
|
+
const baseDirectory = normalizePath2(combinePaths(packageDirectory, expandedPrefixDirectory));
|
|
147045
147101
|
const possibleInputBaseDirectoryForOutDir = isImports && outDir && getPossibleOriginalInputPathWithoutChangingExt(baseDirectory, ignoreCase, outDir, getCommonSourceDirectory2);
|
|
147046
147102
|
const possibleInputBaseDirectoryForDeclarationDir = isImports && declarationDir && getPossibleOriginalInputPathWithoutChangingExt(baseDirectory, ignoreCase, declarationDir, getCommonSourceDirectory2);
|
|
147047
|
-
const normalizedSuffix =
|
|
147103
|
+
const normalizedSuffix = normalizePath2(parsed.suffix);
|
|
147048
147104
|
const declarationExtension = normalizedSuffix && getDeclarationEmitExtensionForPath("_" + normalizedSuffix);
|
|
147049
147105
|
const inputExtension = normalizedSuffix ? getPossibleOriginalInputExtensionForExtension("_" + normalizedSuffix) : undefined;
|
|
147050
147106
|
const matchingSuffixes = [
|
|
@@ -147089,7 +147145,7 @@ ${newComment.split(`
|
|
|
147089
147145
|
}
|
|
147090
147146
|
function trimPrefixAndSuffix(path, prefix) {
|
|
147091
147147
|
return firstDefined(matchingSuffixes, (suffix) => {
|
|
147092
|
-
const inner = withoutStartAndEnd(
|
|
147148
|
+
const inner = withoutStartAndEnd(normalizePath2(path), prefix, suffix);
|
|
147093
147149
|
return inner === undefined ? undefined : removeLeadingDirectorySeparator(inner);
|
|
147094
147150
|
});
|
|
147095
147151
|
}
|
|
@@ -159112,7 +159168,7 @@ ${options.prefix}` : `
|
|
|
159112
159168
|
nodeStartsNewLexicalEnvironment: () => nodeStartsNewLexicalEnvironment,
|
|
159113
159169
|
noop: () => noop,
|
|
159114
159170
|
noopFileWatcher: () => noopFileWatcher,
|
|
159115
|
-
normalizePath: () =>
|
|
159171
|
+
normalizePath: () => normalizePath2,
|
|
159116
159172
|
normalizeSlashes: () => normalizeSlashes,
|
|
159117
159173
|
normalizeSpans: () => normalizeSpans,
|
|
159118
159174
|
not: () => not,
|
|
@@ -160117,7 +160173,7 @@ ${options.prefix}` : `
|
|
|
160117
160173
|
Errors2.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument;
|
|
160118
160174
|
})(Errors || (Errors = {}));
|
|
160119
160175
|
function toNormalizedPath(fileName) {
|
|
160120
|
-
return
|
|
160176
|
+
return normalizePath2(fileName);
|
|
160121
160177
|
}
|
|
160122
160178
|
function normalizedPathToPath(normalizedPath, currentDirectory, getCanonicalFileName) {
|
|
160123
160179
|
const f = isRootedDiskPath(normalizedPath) ? normalizedPath : getNormalizedAbsolutePath(normalizedPath, currentDirectory);
|
|
@@ -161181,7 +161237,7 @@ ${options.prefix}` : `
|
|
|
161181
161237
|
return this.currentDirectory;
|
|
161182
161238
|
}
|
|
161183
161239
|
getDefaultLibFileName() {
|
|
161184
|
-
const nodeModuleBinDir = getDirectoryPath(
|
|
161240
|
+
const nodeModuleBinDir = getDirectoryPath(normalizePath2(this.projectService.getExecutingFilePath()));
|
|
161185
161241
|
return combinePaths(nodeModuleBinDir, getDefaultLibFileName(this.compilerOptions));
|
|
161186
161242
|
}
|
|
161187
161243
|
useCaseSensitiveFileNames() {
|
|
@@ -168270,7 +168326,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
168270
168326
|
if (!fileName) {
|
|
168271
168327
|
return;
|
|
168272
168328
|
}
|
|
168273
|
-
const file =
|
|
168329
|
+
const file = normalizePath2(fileName);
|
|
168274
168330
|
this.projectService.closeClientFile(file);
|
|
168275
168331
|
}
|
|
168276
168332
|
mapLocationNavigationBarItems(items, scriptInfo) {
|
|
@@ -168756,7 +168812,7 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
168756
168812
|
}
|
|
168757
168813
|
getCanonicalFileName(fileName) {
|
|
168758
168814
|
const name = this.host.useCaseSensitiveFileNames ? fileName : toFileNameLowerCase(fileName);
|
|
168759
|
-
return
|
|
168815
|
+
return normalizePath2(name);
|
|
168760
168816
|
}
|
|
168761
168817
|
exit() {}
|
|
168762
168818
|
notRequired(request) {
|
|
@@ -169925,7 +169981,7 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
169925
169981
|
});
|
|
169926
169982
|
|
|
169927
169983
|
// ../../sdk/src/compile/serverTypes.ts
|
|
169928
|
-
var
|
|
169984
|
+
var normalizePath2 = (path) => {
|
|
169929
169985
|
const parts = [];
|
|
169930
169986
|
for (const part of path.split("\\").join("/").split("/")) {
|
|
169931
169987
|
if (!part || part === ".")
|
|
@@ -169994,11 +170050,11 @@ var normalizePath = (path) => {
|
|
|
169994
170050
|
continue;
|
|
169995
170051
|
if (!/\.[tj]sx?$/.test(e.path))
|
|
169996
170052
|
continue;
|
|
169997
|
-
files.set(
|
|
170053
|
+
files.set(normalizePath2(e.path), e.text);
|
|
169998
170054
|
}
|
|
169999
170055
|
files.set(FILE_TYPE_PATH, `interface File { readonly __lecodesFile: true, readonly name: string, readonly size: number, readonly type: string }
|
|
170000
170056
|
`);
|
|
170001
|
-
const roots = [...new Set([...Object.keys(modules).map(
|
|
170057
|
+
const roots = [...new Set([...Object.keys(modules).map(normalizePath2).filter((p) => files.has(p)), ...files.keys()])];
|
|
170002
170058
|
const options = {
|
|
170003
170059
|
target: ts.ScriptTarget.ESNext,
|
|
170004
170060
|
module: ts.ModuleKind.ESNext,
|
|
@@ -170014,10 +170070,10 @@ var normalizePath = (path) => {
|
|
|
170014
170070
|
const defaultLibDir = defaultLibPath.slice(0, defaultLibPath.lastIndexOf("/"));
|
|
170015
170071
|
const sys = ts.sys;
|
|
170016
170072
|
const host = {
|
|
170017
|
-
fileExists: (p) => files.has(
|
|
170018
|
-
readFile: (p) => files.get(
|
|
170073
|
+
fileExists: (p) => files.has(normalizePath2(p)) || p.split("\\").join("/").startsWith(defaultLibDir) && sys.fileExists(p),
|
|
170074
|
+
readFile: (p) => files.get(normalizePath2(p)) ?? (p.split("\\").join("/").startsWith(defaultLibDir) ? sys.readFile(p) : undefined),
|
|
170019
170075
|
getSourceFile: (p, lang) => {
|
|
170020
|
-
const text = files.get(
|
|
170076
|
+
const text = files.get(normalizePath2(p)) ?? (p.split("\\").join("/").startsWith(defaultLibDir) ? sys.readFile(p) : undefined);
|
|
170021
170077
|
return text === undefined ? undefined : ts.createSourceFile(p, text, lang, true);
|
|
170022
170078
|
},
|
|
170023
170079
|
getDefaultLibFileName: (o) => ts.getDefaultLibFilePath(o),
|
|
@@ -170038,7 +170094,7 @@ var normalizePath = (path) => {
|
|
|
170038
170094
|
const sync2 = [];
|
|
170039
170095
|
const awaitable = (type) => !!(type.flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown)) || (type.flags & ts.TypeFlags.Union ? type.types.every(awaitable) : !!type.getProperty("then"));
|
|
170040
170096
|
for (const [path, exports] of Object.entries(modules)) {
|
|
170041
|
-
const sf = program.getSourceFile(
|
|
170097
|
+
const sf = program.getSourceFile(normalizePath2(path));
|
|
170042
170098
|
if (!sf) {
|
|
170043
170099
|
warnings.push(`${path}: not in the TS program`);
|
|
170044
170100
|
continue;
|
|
@@ -170115,7 +170171,7 @@ var normalizePath = (path) => {
|
|
|
170115
170171
|
throw new WrongSideGlobalError(wrongSide);
|
|
170116
170172
|
const unawaited = [];
|
|
170117
170173
|
for (const path of Object.keys(modules)) {
|
|
170118
|
-
const sf = program.getSourceFile(
|
|
170174
|
+
const sf = program.getSourceFile(normalizePath2(path));
|
|
170119
170175
|
if (sf)
|
|
170120
170176
|
unawaited.push(...unawaitedUserQueries(ts, sf, serverModuleId(path)));
|
|
170121
170177
|
}
|
|
@@ -170458,12 +170514,12 @@ ${lines.join(`
|
|
|
170458
170514
|
if (e.type !== "text" || isServerPath(e.path) || !/\.[tj]sx?$/.test(e.path))
|
|
170459
170515
|
continue;
|
|
170460
170516
|
const src = e.text ?? "";
|
|
170461
|
-
const dir =
|
|
170517
|
+
const dir = normalizePath3(e.path).replace(/\/[^/]*$/, "");
|
|
170462
170518
|
const locals = [];
|
|
170463
170519
|
for (const m of src.matchAll(/import\s*\{([^}]*)\}\s*from\s*["']([^"']+)["']/g)) {
|
|
170464
170520
|
if (!m[2].startsWith("."))
|
|
170465
170521
|
continue;
|
|
170466
|
-
const names = channels.get(
|
|
170522
|
+
const names = channels.get(normalizePath3(`${dir}/${m[2]}`).replace(/\.[tj]s$/, ""));
|
|
170467
170523
|
if (!names)
|
|
170468
170524
|
continue;
|
|
170469
170525
|
for (const part of m[1].split(",")) {
|
|
@@ -170499,7 +170555,7 @@ ${lines.join(`
|
|
|
170499
170555
|
`)}
|
|
170500
170556
|
;(globalThis as any).__lecodesServer = { modules: { ${entries.join(", ")} }, manifest: ${JSON.stringify(manifest)} }
|
|
170501
170557
|
`;
|
|
170502
|
-
},
|
|
170558
|
+
}, normalizePath3 = (path) => {
|
|
170503
170559
|
const parts = [];
|
|
170504
170560
|
for (const part of path.split("\\").join("/").split("/")) {
|
|
170505
170561
|
if (!part || part === ".")
|
|
@@ -170515,7 +170571,7 @@ ${lines.join(`
|
|
|
170515
170571
|
for (const e of entries) {
|
|
170516
170572
|
if (e.type !== "text" || !isServerPath(e.path))
|
|
170517
170573
|
continue;
|
|
170518
|
-
out[
|
|
170574
|
+
out[normalizePath3(e.path)] = scanServerExports(e.text ?? "", serverModuleId(e.path));
|
|
170519
170575
|
}
|
|
170520
170576
|
return out;
|
|
170521
170577
|
}, stubServerEntries = (entries, serverUrl) => entries.map((e) => e.type === "text" && isServerPath(e.path) ? { ...e, text: serverStubSource(e.path, scanServerExports(e.text ?? "", serverModuleId(e.path)), serverUrl) } : e), compileServerBundle = async (opts) => {
|
|
@@ -170524,7 +170580,7 @@ ${lines.join(`
|
|
|
170524
170580
|
return null;
|
|
170525
170581
|
const files = {};
|
|
170526
170582
|
for (const e of opts.entries) {
|
|
170527
|
-
const path =
|
|
170583
|
+
const path = normalizePath3(e.path);
|
|
170528
170584
|
if (/^\/design\//.test(path))
|
|
170529
170585
|
continue;
|
|
170530
170586
|
if (e.type !== "text" || path.toLowerCase().endsWith(".svg")) {
|
|
@@ -224981,7 +225037,7 @@ var LITE = {
|
|
|
224981
225037
|
entry: "lite.js",
|
|
224982
225038
|
vendored: "web-lite",
|
|
224983
225039
|
build: [],
|
|
224984
|
-
sources: ["hosts/web-lite/src", "hosts/web-lite/index.html", "renderers/web-lite/src", "renderers/web-shared/src", "hosts/web-player/src/dev.ts"]
|
|
225040
|
+
sources: ["hosts/web-lite/src", "hosts/web-lite/index.html", "renderers/web-lite/src", "renderers/web-shared/src", "hosts/web-player/src/dev.ts", "engines/gl-lite/src"]
|
|
224985
225041
|
};
|
|
224986
225042
|
var resolveLiteRunner = (log2 = () => {}) => resolve17(LITE, log2);
|
|
224987
225043
|
var resolveWebRunner = (log2 = () => {}) => {
|