@astrale-os/cli 1.0.0-beta.23 → 1.0.0-beta.24
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/astrale.js +2110 -6
- package/package.json +2 -1
- package/src/ui/__tests__/ui.test.ts +210 -3
- package/src/ui/lock.ts +1 -1
- package/src/ui/operations.ts +16 -7
- package/src/ui/project.ts +114 -0
package/dist/astrale.js
CHANGED
|
@@ -2578,7 +2578,7 @@ var package_default;
|
|
|
2578
2578
|
var init_package = __esm(() => {
|
|
2579
2579
|
package_default = {
|
|
2580
2580
|
name: "@astrale-os/cli",
|
|
2581
|
-
version: "1.0.0-beta.
|
|
2581
|
+
version: "1.0.0-beta.24",
|
|
2582
2582
|
description: "Astrale CLI — connect to existing Astrale kernels",
|
|
2583
2583
|
keywords: [
|
|
2584
2584
|
"astrale",
|
|
@@ -2649,6 +2649,7 @@ var init_package = __esm(() => {
|
|
|
2649
2649
|
jose: "^6.1.3",
|
|
2650
2650
|
ora: "^9.0.0",
|
|
2651
2651
|
"ts-morph": "^25.0.1",
|
|
2652
|
+
"tsconfig-paths": "4.2.0",
|
|
2652
2653
|
yaml: "^2.8.2",
|
|
2653
2654
|
zod: "^4.4.3"
|
|
2654
2655
|
},
|
|
@@ -84424,7 +84425,7 @@ function parseUiLock(value3) {
|
|
|
84424
84425
|
throw new UiError("UI_LOCK_INVALID", UI_LOCK_FILE + " is structurally invalid.");
|
|
84425
84426
|
}
|
|
84426
84427
|
for (const [address, item] of Object.entries(lock.items)) {
|
|
84427
|
-
if (!/^(?:(?:pattern|block)\/[a-z0-9-]+\/[a-z0-9-/]+|theme\/[a-z][a-z0-9]*(?:-[a-z0-9]+)*)$/u.test(address) || !isRecord8(item) || item.address !== address || !isDigest(item.sourceDigest) || !isRecord8(item.files)) {
|
|
84428
|
+
if (!/^(?:component\/[a-z][a-z0-9]*(?:-[a-z0-9]+)*|(?:pattern|block)\/[a-z0-9-]+\/[a-z0-9-/]+|theme\/[a-z][a-z0-9]*(?:-[a-z0-9]+)*)$/u.test(address) || !isRecord8(item) || item.address !== address || !isDigest(item.sourceDigest) || !isRecord8(item.files)) {
|
|
84428
84429
|
throw new UiError("UI_LOCK_INVALID", UI_LOCK_FILE + " contains an invalid item record.");
|
|
84429
84430
|
}
|
|
84430
84431
|
for (const [file2, expected] of Object.entries(item.files)) {
|
|
@@ -84463,6 +84464,2025 @@ var init_lock = __esm(() => {
|
|
|
84463
84464
|
init_model7();
|
|
84464
84465
|
});
|
|
84465
84466
|
|
|
84467
|
+
// node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/filesystem.js
|
|
84468
|
+
var require_filesystem2 = __commonJS(function(exports) {
|
|
84469
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
84470
|
+
exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = undefined;
|
|
84471
|
+
var fs = __require("fs");
|
|
84472
|
+
function fileExistsSync(path5) {
|
|
84473
|
+
if (!fs.existsSync(path5)) {
|
|
84474
|
+
return false;
|
|
84475
|
+
}
|
|
84476
|
+
try {
|
|
84477
|
+
var stats = fs.statSync(path5);
|
|
84478
|
+
return stats.isFile();
|
|
84479
|
+
} catch (err) {
|
|
84480
|
+
return false;
|
|
84481
|
+
}
|
|
84482
|
+
}
|
|
84483
|
+
exports.fileExistsSync = fileExistsSync;
|
|
84484
|
+
function readJsonFromDiskSync(packageJsonPath) {
|
|
84485
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
84486
|
+
return;
|
|
84487
|
+
}
|
|
84488
|
+
return __require(packageJsonPath);
|
|
84489
|
+
}
|
|
84490
|
+
exports.readJsonFromDiskSync = readJsonFromDiskSync;
|
|
84491
|
+
function readJsonFromDiskAsync(path5, callback) {
|
|
84492
|
+
fs.readFile(path5, "utf8", function(err, result) {
|
|
84493
|
+
if (err || !result) {
|
|
84494
|
+
return callback();
|
|
84495
|
+
}
|
|
84496
|
+
var json4 = JSON.parse(result);
|
|
84497
|
+
return callback(undefined, json4);
|
|
84498
|
+
});
|
|
84499
|
+
}
|
|
84500
|
+
exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
|
|
84501
|
+
function fileExistsAsync(path22, callback2) {
|
|
84502
|
+
fs.stat(path22, function(err, stats) {
|
|
84503
|
+
if (err) {
|
|
84504
|
+
return callback2(undefined, false);
|
|
84505
|
+
}
|
|
84506
|
+
callback2(undefined, stats ? stats.isFile() : false);
|
|
84507
|
+
});
|
|
84508
|
+
}
|
|
84509
|
+
exports.fileExistsAsync = fileExistsAsync;
|
|
84510
|
+
function removeExtension(path5) {
|
|
84511
|
+
return path5.substring(0, path5.lastIndexOf(".")) || path5;
|
|
84512
|
+
}
|
|
84513
|
+
exports.removeExtension = removeExtension;
|
|
84514
|
+
});
|
|
84515
|
+
|
|
84516
|
+
// node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/mapping-entry.js
|
|
84517
|
+
var require_mapping_entry = __commonJS(function(exports) {
|
|
84518
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
84519
|
+
exports.getAbsoluteMappingEntries = undefined;
|
|
84520
|
+
var path5 = __require("path");
|
|
84521
|
+
function getAbsoluteMappingEntries(absoluteBaseUrl, paths3, addMatchAll) {
|
|
84522
|
+
var sortedKeys = sortByLongestPrefix(Object.keys(paths3));
|
|
84523
|
+
var absolutePaths = [];
|
|
84524
|
+
for (var _i = 0, sortedKeys_1 = sortedKeys;_i < sortedKeys_1.length; _i++) {
|
|
84525
|
+
var key = sortedKeys_1[_i];
|
|
84526
|
+
absolutePaths.push({
|
|
84527
|
+
pattern: key,
|
|
84528
|
+
paths: paths3[key].map(function(pathToResolve) {
|
|
84529
|
+
return path5.resolve(absoluteBaseUrl, pathToResolve);
|
|
84530
|
+
})
|
|
84531
|
+
});
|
|
84532
|
+
}
|
|
84533
|
+
if (!paths3["*"] && addMatchAll) {
|
|
84534
|
+
absolutePaths.push({
|
|
84535
|
+
pattern: "*",
|
|
84536
|
+
paths: ["".concat(absoluteBaseUrl.replace(/\/$/, ""), "/*")]
|
|
84537
|
+
});
|
|
84538
|
+
}
|
|
84539
|
+
return absolutePaths;
|
|
84540
|
+
}
|
|
84541
|
+
exports.getAbsoluteMappingEntries = getAbsoluteMappingEntries;
|
|
84542
|
+
function sortByLongestPrefix(arr) {
|
|
84543
|
+
return arr.concat().sort(function(a, b) {
|
|
84544
|
+
return getPrefixLength(b) - getPrefixLength(a);
|
|
84545
|
+
});
|
|
84546
|
+
}
|
|
84547
|
+
function getPrefixLength(pattern2) {
|
|
84548
|
+
var prefixLength = pattern2.indexOf("*");
|
|
84549
|
+
return pattern2.substr(0, prefixLength).length;
|
|
84550
|
+
}
|
|
84551
|
+
});
|
|
84552
|
+
|
|
84553
|
+
// node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/try-path.js
|
|
84554
|
+
var require_try_path = __commonJS(function(exports) {
|
|
84555
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
84556
|
+
exports.exhaustiveTypeException = exports.getStrippedPath = exports.getPathsToTry = undefined;
|
|
84557
|
+
var path5 = __require("path");
|
|
84558
|
+
var path_1 = __require("path");
|
|
84559
|
+
var filesystem_1 = require_filesystem2();
|
|
84560
|
+
function getPathsToTry(extensions2, absolutePathMappings, requestedModule) {
|
|
84561
|
+
if (!absolutePathMappings || !requestedModule || requestedModule[0] === ".") {
|
|
84562
|
+
return;
|
|
84563
|
+
}
|
|
84564
|
+
var pathsToTry = [];
|
|
84565
|
+
for (var _i = 0, absolutePathMappings_1 = absolutePathMappings;_i < absolutePathMappings_1.length; _i++) {
|
|
84566
|
+
var entry2 = absolutePathMappings_1[_i];
|
|
84567
|
+
var starMatch = entry2.pattern === requestedModule ? "" : matchStar(entry2.pattern, requestedModule);
|
|
84568
|
+
if (starMatch !== undefined) {
|
|
84569
|
+
var _loop_1 = function(physicalPathPattern2) {
|
|
84570
|
+
var physicalPath = physicalPathPattern2.replace("*", starMatch);
|
|
84571
|
+
pathsToTry.push({ type: "file", path: physicalPath });
|
|
84572
|
+
pathsToTry.push.apply(pathsToTry, extensions2.map(function(e) {
|
|
84573
|
+
return { type: "extension", path: physicalPath + e };
|
|
84574
|
+
}));
|
|
84575
|
+
pathsToTry.push({
|
|
84576
|
+
type: "package",
|
|
84577
|
+
path: path5.join(physicalPath, "/package.json")
|
|
84578
|
+
});
|
|
84579
|
+
var indexPath = path5.join(physicalPath, "/index");
|
|
84580
|
+
pathsToTry.push.apply(pathsToTry, extensions2.map(function(e) {
|
|
84581
|
+
return { type: "index", path: indexPath + e };
|
|
84582
|
+
}));
|
|
84583
|
+
};
|
|
84584
|
+
for (var _a3 = 0, _b = entry2.paths;_a3 < _b.length; _a3++) {
|
|
84585
|
+
var physicalPathPattern = _b[_a3];
|
|
84586
|
+
_loop_1(physicalPathPattern);
|
|
84587
|
+
}
|
|
84588
|
+
}
|
|
84589
|
+
}
|
|
84590
|
+
return pathsToTry.length === 0 ? undefined : pathsToTry;
|
|
84591
|
+
}
|
|
84592
|
+
exports.getPathsToTry = getPathsToTry;
|
|
84593
|
+
function getStrippedPath(tryPath) {
|
|
84594
|
+
return tryPath.type === "index" ? (0, path_1.dirname)(tryPath.path) : tryPath.type === "file" ? tryPath.path : tryPath.type === "extension" ? (0, filesystem_1.removeExtension)(tryPath.path) : tryPath.type === "package" ? tryPath.path : exhaustiveTypeException(tryPath.type);
|
|
84595
|
+
}
|
|
84596
|
+
exports.getStrippedPath = getStrippedPath;
|
|
84597
|
+
function exhaustiveTypeException(check3) {
|
|
84598
|
+
throw new Error("Unknown type ".concat(check3));
|
|
84599
|
+
}
|
|
84600
|
+
exports.exhaustiveTypeException = exhaustiveTypeException;
|
|
84601
|
+
function matchStar(pattern2, search) {
|
|
84602
|
+
if (search.length < pattern2.length) {
|
|
84603
|
+
return;
|
|
84604
|
+
}
|
|
84605
|
+
if (pattern2 === "*") {
|
|
84606
|
+
return search;
|
|
84607
|
+
}
|
|
84608
|
+
var star = pattern2.indexOf("*");
|
|
84609
|
+
if (star === -1) {
|
|
84610
|
+
return;
|
|
84611
|
+
}
|
|
84612
|
+
var part1 = pattern2.substring(0, star);
|
|
84613
|
+
var part2 = pattern2.substring(star + 1);
|
|
84614
|
+
if (search.substr(0, star) !== part1) {
|
|
84615
|
+
return;
|
|
84616
|
+
}
|
|
84617
|
+
if (search.substr(search.length - part2.length) !== part2) {
|
|
84618
|
+
return;
|
|
84619
|
+
}
|
|
84620
|
+
return search.substr(star, search.length - part2.length);
|
|
84621
|
+
}
|
|
84622
|
+
});
|
|
84623
|
+
|
|
84624
|
+
// node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/match-path-sync.js
|
|
84625
|
+
var require_match_path_sync = __commonJS(function(exports) {
|
|
84626
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
84627
|
+
exports.matchFromAbsolutePaths = exports.createMatchPath = undefined;
|
|
84628
|
+
var path5 = __require("path");
|
|
84629
|
+
var Filesystem = require_filesystem2();
|
|
84630
|
+
var MappingEntry = require_mapping_entry();
|
|
84631
|
+
var TryPath = require_try_path();
|
|
84632
|
+
function createMatchPath(absoluteBaseUrl, paths3, mainFields, addMatchAll) {
|
|
84633
|
+
if (mainFields === undefined) {
|
|
84634
|
+
mainFields = ["main"];
|
|
84635
|
+
}
|
|
84636
|
+
if (addMatchAll === undefined) {
|
|
84637
|
+
addMatchAll = true;
|
|
84638
|
+
}
|
|
84639
|
+
var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths3, addMatchAll);
|
|
84640
|
+
return function(requestedModule, readJson2, fileExists2, extensions2) {
|
|
84641
|
+
return matchFromAbsolutePaths(absolutePaths, requestedModule, readJson2, fileExists2, extensions2, mainFields);
|
|
84642
|
+
};
|
|
84643
|
+
}
|
|
84644
|
+
exports.createMatchPath = createMatchPath;
|
|
84645
|
+
function matchFromAbsolutePaths(absolutePathMappings, requestedModule, readJson2, fileExists2, extensions2, mainFields) {
|
|
84646
|
+
if (readJson2 === undefined) {
|
|
84647
|
+
readJson2 = Filesystem.readJsonFromDiskSync;
|
|
84648
|
+
}
|
|
84649
|
+
if (fileExists2 === undefined) {
|
|
84650
|
+
fileExists2 = Filesystem.fileExistsSync;
|
|
84651
|
+
}
|
|
84652
|
+
if (extensions2 === undefined) {
|
|
84653
|
+
extensions2 = Object.keys(__require.extensions);
|
|
84654
|
+
}
|
|
84655
|
+
if (mainFields === undefined) {
|
|
84656
|
+
mainFields = ["main"];
|
|
84657
|
+
}
|
|
84658
|
+
var tryPaths = TryPath.getPathsToTry(extensions2, absolutePathMappings, requestedModule);
|
|
84659
|
+
if (!tryPaths) {
|
|
84660
|
+
return;
|
|
84661
|
+
}
|
|
84662
|
+
return findFirstExistingPath(tryPaths, readJson2, fileExists2, mainFields);
|
|
84663
|
+
}
|
|
84664
|
+
exports.matchFromAbsolutePaths = matchFromAbsolutePaths;
|
|
84665
|
+
function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExists2) {
|
|
84666
|
+
for (var index3 = 0;index3 < mainFields.length; index3++) {
|
|
84667
|
+
var mainFieldSelector = mainFields[index3];
|
|
84668
|
+
var candidateMapping = typeof mainFieldSelector === "string" ? packageJson[mainFieldSelector] : mainFieldSelector.reduce(function(obj, key) {
|
|
84669
|
+
return obj[key];
|
|
84670
|
+
}, packageJson);
|
|
84671
|
+
if (candidateMapping && typeof candidateMapping === "string") {
|
|
84672
|
+
var candidateFilePath = path5.join(path5.dirname(packageJsonPath), candidateMapping);
|
|
84673
|
+
if (fileExists2(candidateFilePath)) {
|
|
84674
|
+
return candidateFilePath;
|
|
84675
|
+
}
|
|
84676
|
+
}
|
|
84677
|
+
}
|
|
84678
|
+
return;
|
|
84679
|
+
}
|
|
84680
|
+
function findFirstExistingPath(tryPaths, readJson2, fileExists2, mainFields) {
|
|
84681
|
+
if (readJson2 === undefined) {
|
|
84682
|
+
readJson2 = Filesystem.readJsonFromDiskSync;
|
|
84683
|
+
}
|
|
84684
|
+
if (mainFields === undefined) {
|
|
84685
|
+
mainFields = ["main"];
|
|
84686
|
+
}
|
|
84687
|
+
for (var _i = 0, tryPaths_1 = tryPaths;_i < tryPaths_1.length; _i++) {
|
|
84688
|
+
var tryPath = tryPaths_1[_i];
|
|
84689
|
+
if (tryPath.type === "file" || tryPath.type === "extension" || tryPath.type === "index") {
|
|
84690
|
+
if (fileExists2(tryPath.path)) {
|
|
84691
|
+
return TryPath.getStrippedPath(tryPath);
|
|
84692
|
+
}
|
|
84693
|
+
} else if (tryPath.type === "package") {
|
|
84694
|
+
var packageJson = readJson2(tryPath.path);
|
|
84695
|
+
if (packageJson) {
|
|
84696
|
+
var mainFieldMappedFile = findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists2);
|
|
84697
|
+
if (mainFieldMappedFile) {
|
|
84698
|
+
return mainFieldMappedFile;
|
|
84699
|
+
}
|
|
84700
|
+
}
|
|
84701
|
+
} else {
|
|
84702
|
+
TryPath.exhaustiveTypeException(tryPath.type);
|
|
84703
|
+
}
|
|
84704
|
+
}
|
|
84705
|
+
return;
|
|
84706
|
+
}
|
|
84707
|
+
});
|
|
84708
|
+
|
|
84709
|
+
// node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/match-path-async.js
|
|
84710
|
+
var require_match_path_async = __commonJS(function(exports) {
|
|
84711
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
84712
|
+
exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = undefined;
|
|
84713
|
+
var path5 = __require("path");
|
|
84714
|
+
var TryPath = require_try_path();
|
|
84715
|
+
var MappingEntry = require_mapping_entry();
|
|
84716
|
+
var Filesystem = require_filesystem2();
|
|
84717
|
+
function createMatchPathAsync(absoluteBaseUrl, paths3, mainFields, addMatchAll) {
|
|
84718
|
+
if (mainFields === undefined) {
|
|
84719
|
+
mainFields = ["main"];
|
|
84720
|
+
}
|
|
84721
|
+
if (addMatchAll === undefined) {
|
|
84722
|
+
addMatchAll = true;
|
|
84723
|
+
}
|
|
84724
|
+
var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths3, addMatchAll);
|
|
84725
|
+
return function(requestedModule, readJson2, fileExists2, extensions2, callback) {
|
|
84726
|
+
return matchFromAbsolutePathsAsync(absolutePaths, requestedModule, readJson2, fileExists2, extensions2, callback, mainFields);
|
|
84727
|
+
};
|
|
84728
|
+
}
|
|
84729
|
+
exports.createMatchPathAsync = createMatchPathAsync;
|
|
84730
|
+
function matchFromAbsolutePathsAsync(absolutePathMappings, requestedModule, readJson2, fileExists2, extensions2, callback, mainFields) {
|
|
84731
|
+
if (readJson2 === undefined) {
|
|
84732
|
+
readJson2 = Filesystem.readJsonFromDiskAsync;
|
|
84733
|
+
}
|
|
84734
|
+
if (fileExists2 === undefined) {
|
|
84735
|
+
fileExists2 = Filesystem.fileExistsAsync;
|
|
84736
|
+
}
|
|
84737
|
+
if (extensions2 === undefined) {
|
|
84738
|
+
extensions2 = Object.keys(__require.extensions);
|
|
84739
|
+
}
|
|
84740
|
+
if (mainFields === undefined) {
|
|
84741
|
+
mainFields = ["main"];
|
|
84742
|
+
}
|
|
84743
|
+
var tryPaths = TryPath.getPathsToTry(extensions2, absolutePathMappings, requestedModule);
|
|
84744
|
+
if (!tryPaths) {
|
|
84745
|
+
return callback();
|
|
84746
|
+
}
|
|
84747
|
+
findFirstExistingPath(tryPaths, readJson2, fileExists2, callback, 0, mainFields);
|
|
84748
|
+
}
|
|
84749
|
+
exports.matchFromAbsolutePathsAsync = matchFromAbsolutePathsAsync;
|
|
84750
|
+
function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index3) {
|
|
84751
|
+
if (index3 === undefined) {
|
|
84752
|
+
index3 = 0;
|
|
84753
|
+
}
|
|
84754
|
+
if (index3 >= mainFields.length) {
|
|
84755
|
+
return doneCallback(undefined, undefined);
|
|
84756
|
+
}
|
|
84757
|
+
var tryNext = function() {
|
|
84758
|
+
return findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index3 + 1);
|
|
84759
|
+
};
|
|
84760
|
+
var mainFieldSelector = mainFields[index3];
|
|
84761
|
+
var mainFieldMapping = typeof mainFieldSelector === "string" ? packageJson[mainFieldSelector] : mainFieldSelector.reduce(function(obj, key) {
|
|
84762
|
+
return obj[key];
|
|
84763
|
+
}, packageJson);
|
|
84764
|
+
if (typeof mainFieldMapping !== "string") {
|
|
84765
|
+
return tryNext();
|
|
84766
|
+
}
|
|
84767
|
+
var mappedFilePath = path5.join(path5.dirname(packageJsonPath), mainFieldMapping);
|
|
84768
|
+
fileExistsAsync(mappedFilePath, function(err, exists) {
|
|
84769
|
+
if (err) {
|
|
84770
|
+
return doneCallback(err);
|
|
84771
|
+
}
|
|
84772
|
+
if (exists) {
|
|
84773
|
+
return doneCallback(undefined, mappedFilePath);
|
|
84774
|
+
}
|
|
84775
|
+
return tryNext();
|
|
84776
|
+
});
|
|
84777
|
+
}
|
|
84778
|
+
function findFirstExistingPath(tryPaths, readJson2, fileExists2, doneCallback, index3, mainFields) {
|
|
84779
|
+
if (index3 === undefined) {
|
|
84780
|
+
index3 = 0;
|
|
84781
|
+
}
|
|
84782
|
+
if (mainFields === undefined) {
|
|
84783
|
+
mainFields = ["main"];
|
|
84784
|
+
}
|
|
84785
|
+
var tryPath = tryPaths[index3];
|
|
84786
|
+
if (tryPath.type === "file" || tryPath.type === "extension" || tryPath.type === "index") {
|
|
84787
|
+
fileExists2(tryPath.path, function(err, exists) {
|
|
84788
|
+
if (err) {
|
|
84789
|
+
return doneCallback(err);
|
|
84790
|
+
}
|
|
84791
|
+
if (exists) {
|
|
84792
|
+
return doneCallback(undefined, TryPath.getStrippedPath(tryPath));
|
|
84793
|
+
}
|
|
84794
|
+
if (index3 === tryPaths.length - 1) {
|
|
84795
|
+
return doneCallback();
|
|
84796
|
+
}
|
|
84797
|
+
return findFirstExistingPath(tryPaths, readJson2, fileExists2, doneCallback, index3 + 1, mainFields);
|
|
84798
|
+
});
|
|
84799
|
+
} else if (tryPath.type === "package") {
|
|
84800
|
+
readJson2(tryPath.path, function(err, packageJson) {
|
|
84801
|
+
if (err) {
|
|
84802
|
+
return doneCallback(err);
|
|
84803
|
+
}
|
|
84804
|
+
if (packageJson) {
|
|
84805
|
+
return findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists2, function(mainFieldErr, mainFieldMappedFile) {
|
|
84806
|
+
if (mainFieldErr) {
|
|
84807
|
+
return doneCallback(mainFieldErr);
|
|
84808
|
+
}
|
|
84809
|
+
if (mainFieldMappedFile) {
|
|
84810
|
+
return doneCallback(undefined, mainFieldMappedFile);
|
|
84811
|
+
}
|
|
84812
|
+
return findFirstExistingPath(tryPaths, readJson2, fileExists2, doneCallback, index3 + 1, mainFields);
|
|
84813
|
+
});
|
|
84814
|
+
}
|
|
84815
|
+
return findFirstExistingPath(tryPaths, readJson2, fileExists2, doneCallback, index3 + 1, mainFields);
|
|
84816
|
+
});
|
|
84817
|
+
} else {
|
|
84818
|
+
TryPath.exhaustiveTypeException(tryPath.type);
|
|
84819
|
+
}
|
|
84820
|
+
}
|
|
84821
|
+
});
|
|
84822
|
+
|
|
84823
|
+
// node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/unicode.js
|
|
84824
|
+
var require_unicode2 = __commonJS(function(exports, module) {
|
|
84825
|
+
exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
84826
|
+
exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
|
|
84827
|
+
exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
|
|
84828
|
+
});
|
|
84829
|
+
|
|
84830
|
+
// node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/util.js
|
|
84831
|
+
var require_util = __commonJS(function(exports, module) {
|
|
84832
|
+
var unicode = require_unicode2();
|
|
84833
|
+
module.exports = {
|
|
84834
|
+
isSpaceSeparator(c) {
|
|
84835
|
+
return typeof c === "string" && unicode.Space_Separator.test(c);
|
|
84836
|
+
},
|
|
84837
|
+
isIdStartChar(c) {
|
|
84838
|
+
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
|
|
84839
|
+
},
|
|
84840
|
+
isIdContinueChar(c) {
|
|
84841
|
+
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "" || c === "" || unicode.ID_Continue.test(c));
|
|
84842
|
+
},
|
|
84843
|
+
isDigit(c) {
|
|
84844
|
+
return typeof c === "string" && /[0-9]/.test(c);
|
|
84845
|
+
},
|
|
84846
|
+
isHexDigit(c) {
|
|
84847
|
+
return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
|
|
84848
|
+
}
|
|
84849
|
+
};
|
|
84850
|
+
});
|
|
84851
|
+
|
|
84852
|
+
// node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/parse.js
|
|
84853
|
+
var require_parse = __commonJS(function(exports, module) {
|
|
84854
|
+
var util = require_util();
|
|
84855
|
+
var source2;
|
|
84856
|
+
var parseState;
|
|
84857
|
+
var stack;
|
|
84858
|
+
var pos;
|
|
84859
|
+
var line;
|
|
84860
|
+
var column;
|
|
84861
|
+
var token;
|
|
84862
|
+
var key;
|
|
84863
|
+
var root;
|
|
84864
|
+
module.exports = function parse6(text14, reviver) {
|
|
84865
|
+
source2 = String(text14);
|
|
84866
|
+
parseState = "start";
|
|
84867
|
+
stack = [];
|
|
84868
|
+
pos = 0;
|
|
84869
|
+
line = 1;
|
|
84870
|
+
column = 0;
|
|
84871
|
+
token = undefined;
|
|
84872
|
+
key = undefined;
|
|
84873
|
+
root = undefined;
|
|
84874
|
+
do {
|
|
84875
|
+
token = lex();
|
|
84876
|
+
parseStates[parseState]();
|
|
84877
|
+
} while (token.type !== "eof");
|
|
84878
|
+
if (typeof reviver === "function") {
|
|
84879
|
+
return internalize({ "": root }, "", reviver);
|
|
84880
|
+
}
|
|
84881
|
+
return root;
|
|
84882
|
+
};
|
|
84883
|
+
function internalize(holder, name, reviver) {
|
|
84884
|
+
const value3 = holder[name];
|
|
84885
|
+
if (value3 != null && typeof value3 === "object") {
|
|
84886
|
+
if (Array.isArray(value3)) {
|
|
84887
|
+
for (let i = 0;i < value3.length; i++) {
|
|
84888
|
+
const key2 = String(i);
|
|
84889
|
+
const replacement = internalize(value3, key2, reviver);
|
|
84890
|
+
if (replacement === undefined) {
|
|
84891
|
+
delete value3[key2];
|
|
84892
|
+
} else {
|
|
84893
|
+
Object.defineProperty(value3, key2, {
|
|
84894
|
+
value: replacement,
|
|
84895
|
+
writable: true,
|
|
84896
|
+
enumerable: true,
|
|
84897
|
+
configurable: true
|
|
84898
|
+
});
|
|
84899
|
+
}
|
|
84900
|
+
}
|
|
84901
|
+
} else {
|
|
84902
|
+
for (const key2 in value3) {
|
|
84903
|
+
const replacement = internalize(value3, key2, reviver);
|
|
84904
|
+
if (replacement === undefined) {
|
|
84905
|
+
delete value3[key2];
|
|
84906
|
+
} else {
|
|
84907
|
+
Object.defineProperty(value3, key2, {
|
|
84908
|
+
value: replacement,
|
|
84909
|
+
writable: true,
|
|
84910
|
+
enumerable: true,
|
|
84911
|
+
configurable: true
|
|
84912
|
+
});
|
|
84913
|
+
}
|
|
84914
|
+
}
|
|
84915
|
+
}
|
|
84916
|
+
}
|
|
84917
|
+
return reviver.call(holder, name, value3);
|
|
84918
|
+
}
|
|
84919
|
+
var lexState;
|
|
84920
|
+
var buffer;
|
|
84921
|
+
var doubleQuote;
|
|
84922
|
+
var sign2;
|
|
84923
|
+
var c;
|
|
84924
|
+
function lex() {
|
|
84925
|
+
lexState = "default";
|
|
84926
|
+
buffer = "";
|
|
84927
|
+
doubleQuote = false;
|
|
84928
|
+
sign2 = 1;
|
|
84929
|
+
for (;; ) {
|
|
84930
|
+
c = peek();
|
|
84931
|
+
const token2 = lexStates[lexState]();
|
|
84932
|
+
if (token2) {
|
|
84933
|
+
return token2;
|
|
84934
|
+
}
|
|
84935
|
+
}
|
|
84936
|
+
}
|
|
84937
|
+
function peek() {
|
|
84938
|
+
if (source2[pos]) {
|
|
84939
|
+
return String.fromCodePoint(source2.codePointAt(pos));
|
|
84940
|
+
}
|
|
84941
|
+
}
|
|
84942
|
+
function read2() {
|
|
84943
|
+
const c2 = peek();
|
|
84944
|
+
if (c2 === `
|
|
84945
|
+
`) {
|
|
84946
|
+
line++;
|
|
84947
|
+
column = 0;
|
|
84948
|
+
} else if (c2) {
|
|
84949
|
+
column += c2.length;
|
|
84950
|
+
} else {
|
|
84951
|
+
column++;
|
|
84952
|
+
}
|
|
84953
|
+
if (c2) {
|
|
84954
|
+
pos += c2.length;
|
|
84955
|
+
}
|
|
84956
|
+
return c2;
|
|
84957
|
+
}
|
|
84958
|
+
var lexStates = {
|
|
84959
|
+
default() {
|
|
84960
|
+
switch (c) {
|
|
84961
|
+
case "\t":
|
|
84962
|
+
case "\v":
|
|
84963
|
+
case "\f":
|
|
84964
|
+
case " ":
|
|
84965
|
+
case " ":
|
|
84966
|
+
case "\uFEFF":
|
|
84967
|
+
case `
|
|
84968
|
+
`:
|
|
84969
|
+
case "\r":
|
|
84970
|
+
case "\u2028":
|
|
84971
|
+
case "\u2029":
|
|
84972
|
+
read2();
|
|
84973
|
+
return;
|
|
84974
|
+
case "/":
|
|
84975
|
+
read2();
|
|
84976
|
+
lexState = "comment";
|
|
84977
|
+
return;
|
|
84978
|
+
case undefined:
|
|
84979
|
+
read2();
|
|
84980
|
+
return newToken("eof");
|
|
84981
|
+
}
|
|
84982
|
+
if (util.isSpaceSeparator(c)) {
|
|
84983
|
+
read2();
|
|
84984
|
+
return;
|
|
84985
|
+
}
|
|
84986
|
+
return lexStates[parseState]();
|
|
84987
|
+
},
|
|
84988
|
+
comment() {
|
|
84989
|
+
switch (c) {
|
|
84990
|
+
case "*":
|
|
84991
|
+
read2();
|
|
84992
|
+
lexState = "multiLineComment";
|
|
84993
|
+
return;
|
|
84994
|
+
case "/":
|
|
84995
|
+
read2();
|
|
84996
|
+
lexState = "singleLineComment";
|
|
84997
|
+
return;
|
|
84998
|
+
}
|
|
84999
|
+
throw invalidChar(read2());
|
|
85000
|
+
},
|
|
85001
|
+
multiLineComment() {
|
|
85002
|
+
switch (c) {
|
|
85003
|
+
case "*":
|
|
85004
|
+
read2();
|
|
85005
|
+
lexState = "multiLineCommentAsterisk";
|
|
85006
|
+
return;
|
|
85007
|
+
case undefined:
|
|
85008
|
+
throw invalidChar(read2());
|
|
85009
|
+
}
|
|
85010
|
+
read2();
|
|
85011
|
+
},
|
|
85012
|
+
multiLineCommentAsterisk() {
|
|
85013
|
+
switch (c) {
|
|
85014
|
+
case "*":
|
|
85015
|
+
read2();
|
|
85016
|
+
return;
|
|
85017
|
+
case "/":
|
|
85018
|
+
read2();
|
|
85019
|
+
lexState = "default";
|
|
85020
|
+
return;
|
|
85021
|
+
case undefined:
|
|
85022
|
+
throw invalidChar(read2());
|
|
85023
|
+
}
|
|
85024
|
+
read2();
|
|
85025
|
+
lexState = "multiLineComment";
|
|
85026
|
+
},
|
|
85027
|
+
singleLineComment() {
|
|
85028
|
+
switch (c) {
|
|
85029
|
+
case `
|
|
85030
|
+
`:
|
|
85031
|
+
case "\r":
|
|
85032
|
+
case "\u2028":
|
|
85033
|
+
case "\u2029":
|
|
85034
|
+
read2();
|
|
85035
|
+
lexState = "default";
|
|
85036
|
+
return;
|
|
85037
|
+
case undefined:
|
|
85038
|
+
read2();
|
|
85039
|
+
return newToken("eof");
|
|
85040
|
+
}
|
|
85041
|
+
read2();
|
|
85042
|
+
},
|
|
85043
|
+
value() {
|
|
85044
|
+
switch (c) {
|
|
85045
|
+
case "{":
|
|
85046
|
+
case "[":
|
|
85047
|
+
return newToken("punctuator", read2());
|
|
85048
|
+
case "n":
|
|
85049
|
+
read2();
|
|
85050
|
+
literal2("ull");
|
|
85051
|
+
return newToken("null", null);
|
|
85052
|
+
case "t":
|
|
85053
|
+
read2();
|
|
85054
|
+
literal2("rue");
|
|
85055
|
+
return newToken("boolean", true);
|
|
85056
|
+
case "f":
|
|
85057
|
+
read2();
|
|
85058
|
+
literal2("alse");
|
|
85059
|
+
return newToken("boolean", false);
|
|
85060
|
+
case "-":
|
|
85061
|
+
case "+":
|
|
85062
|
+
if (read2() === "-") {
|
|
85063
|
+
sign2 = -1;
|
|
85064
|
+
}
|
|
85065
|
+
lexState = "sign";
|
|
85066
|
+
return;
|
|
85067
|
+
case ".":
|
|
85068
|
+
buffer = read2();
|
|
85069
|
+
lexState = "decimalPointLeading";
|
|
85070
|
+
return;
|
|
85071
|
+
case "0":
|
|
85072
|
+
buffer = read2();
|
|
85073
|
+
lexState = "zero";
|
|
85074
|
+
return;
|
|
85075
|
+
case "1":
|
|
85076
|
+
case "2":
|
|
85077
|
+
case "3":
|
|
85078
|
+
case "4":
|
|
85079
|
+
case "5":
|
|
85080
|
+
case "6":
|
|
85081
|
+
case "7":
|
|
85082
|
+
case "8":
|
|
85083
|
+
case "9":
|
|
85084
|
+
buffer = read2();
|
|
85085
|
+
lexState = "decimalInteger";
|
|
85086
|
+
return;
|
|
85087
|
+
case "I":
|
|
85088
|
+
read2();
|
|
85089
|
+
literal2("nfinity");
|
|
85090
|
+
return newToken("numeric", Infinity);
|
|
85091
|
+
case "N":
|
|
85092
|
+
read2();
|
|
85093
|
+
literal2("aN");
|
|
85094
|
+
return newToken("numeric", NaN);
|
|
85095
|
+
case '"':
|
|
85096
|
+
case "'":
|
|
85097
|
+
doubleQuote = read2() === '"';
|
|
85098
|
+
buffer = "";
|
|
85099
|
+
lexState = "string";
|
|
85100
|
+
return;
|
|
85101
|
+
}
|
|
85102
|
+
throw invalidChar(read2());
|
|
85103
|
+
},
|
|
85104
|
+
identifierNameStartEscape() {
|
|
85105
|
+
if (c !== "u") {
|
|
85106
|
+
throw invalidChar(read2());
|
|
85107
|
+
}
|
|
85108
|
+
read2();
|
|
85109
|
+
const u = unicodeEscape();
|
|
85110
|
+
switch (u) {
|
|
85111
|
+
case "$":
|
|
85112
|
+
case "_":
|
|
85113
|
+
break;
|
|
85114
|
+
default:
|
|
85115
|
+
if (!util.isIdStartChar(u)) {
|
|
85116
|
+
throw invalidIdentifier();
|
|
85117
|
+
}
|
|
85118
|
+
break;
|
|
85119
|
+
}
|
|
85120
|
+
buffer += u;
|
|
85121
|
+
lexState = "identifierName";
|
|
85122
|
+
},
|
|
85123
|
+
identifierName() {
|
|
85124
|
+
switch (c) {
|
|
85125
|
+
case "$":
|
|
85126
|
+
case "_":
|
|
85127
|
+
case "":
|
|
85128
|
+
case "":
|
|
85129
|
+
buffer += read2();
|
|
85130
|
+
return;
|
|
85131
|
+
case "\\":
|
|
85132
|
+
read2();
|
|
85133
|
+
lexState = "identifierNameEscape";
|
|
85134
|
+
return;
|
|
85135
|
+
}
|
|
85136
|
+
if (util.isIdContinueChar(c)) {
|
|
85137
|
+
buffer += read2();
|
|
85138
|
+
return;
|
|
85139
|
+
}
|
|
85140
|
+
return newToken("identifier", buffer);
|
|
85141
|
+
},
|
|
85142
|
+
identifierNameEscape() {
|
|
85143
|
+
if (c !== "u") {
|
|
85144
|
+
throw invalidChar(read2());
|
|
85145
|
+
}
|
|
85146
|
+
read2();
|
|
85147
|
+
const u = unicodeEscape();
|
|
85148
|
+
switch (u) {
|
|
85149
|
+
case "$":
|
|
85150
|
+
case "_":
|
|
85151
|
+
case "":
|
|
85152
|
+
case "":
|
|
85153
|
+
break;
|
|
85154
|
+
default:
|
|
85155
|
+
if (!util.isIdContinueChar(u)) {
|
|
85156
|
+
throw invalidIdentifier();
|
|
85157
|
+
}
|
|
85158
|
+
break;
|
|
85159
|
+
}
|
|
85160
|
+
buffer += u;
|
|
85161
|
+
lexState = "identifierName";
|
|
85162
|
+
},
|
|
85163
|
+
sign() {
|
|
85164
|
+
switch (c) {
|
|
85165
|
+
case ".":
|
|
85166
|
+
buffer = read2();
|
|
85167
|
+
lexState = "decimalPointLeading";
|
|
85168
|
+
return;
|
|
85169
|
+
case "0":
|
|
85170
|
+
buffer = read2();
|
|
85171
|
+
lexState = "zero";
|
|
85172
|
+
return;
|
|
85173
|
+
case "1":
|
|
85174
|
+
case "2":
|
|
85175
|
+
case "3":
|
|
85176
|
+
case "4":
|
|
85177
|
+
case "5":
|
|
85178
|
+
case "6":
|
|
85179
|
+
case "7":
|
|
85180
|
+
case "8":
|
|
85181
|
+
case "9":
|
|
85182
|
+
buffer = read2();
|
|
85183
|
+
lexState = "decimalInteger";
|
|
85184
|
+
return;
|
|
85185
|
+
case "I":
|
|
85186
|
+
read2();
|
|
85187
|
+
literal2("nfinity");
|
|
85188
|
+
return newToken("numeric", sign2 * Infinity);
|
|
85189
|
+
case "N":
|
|
85190
|
+
read2();
|
|
85191
|
+
literal2("aN");
|
|
85192
|
+
return newToken("numeric", NaN);
|
|
85193
|
+
}
|
|
85194
|
+
throw invalidChar(read2());
|
|
85195
|
+
},
|
|
85196
|
+
zero() {
|
|
85197
|
+
switch (c) {
|
|
85198
|
+
case ".":
|
|
85199
|
+
buffer += read2();
|
|
85200
|
+
lexState = "decimalPoint";
|
|
85201
|
+
return;
|
|
85202
|
+
case "e":
|
|
85203
|
+
case "E":
|
|
85204
|
+
buffer += read2();
|
|
85205
|
+
lexState = "decimalExponent";
|
|
85206
|
+
return;
|
|
85207
|
+
case "x":
|
|
85208
|
+
case "X":
|
|
85209
|
+
buffer += read2();
|
|
85210
|
+
lexState = "hexadecimal";
|
|
85211
|
+
return;
|
|
85212
|
+
}
|
|
85213
|
+
return newToken("numeric", sign2 * 0);
|
|
85214
|
+
},
|
|
85215
|
+
decimalInteger() {
|
|
85216
|
+
switch (c) {
|
|
85217
|
+
case ".":
|
|
85218
|
+
buffer += read2();
|
|
85219
|
+
lexState = "decimalPoint";
|
|
85220
|
+
return;
|
|
85221
|
+
case "e":
|
|
85222
|
+
case "E":
|
|
85223
|
+
buffer += read2();
|
|
85224
|
+
lexState = "decimalExponent";
|
|
85225
|
+
return;
|
|
85226
|
+
}
|
|
85227
|
+
if (util.isDigit(c)) {
|
|
85228
|
+
buffer += read2();
|
|
85229
|
+
return;
|
|
85230
|
+
}
|
|
85231
|
+
return newToken("numeric", sign2 * Number(buffer));
|
|
85232
|
+
},
|
|
85233
|
+
decimalPointLeading() {
|
|
85234
|
+
if (util.isDigit(c)) {
|
|
85235
|
+
buffer += read2();
|
|
85236
|
+
lexState = "decimalFraction";
|
|
85237
|
+
return;
|
|
85238
|
+
}
|
|
85239
|
+
throw invalidChar(read2());
|
|
85240
|
+
},
|
|
85241
|
+
decimalPoint() {
|
|
85242
|
+
switch (c) {
|
|
85243
|
+
case "e":
|
|
85244
|
+
case "E":
|
|
85245
|
+
buffer += read2();
|
|
85246
|
+
lexState = "decimalExponent";
|
|
85247
|
+
return;
|
|
85248
|
+
}
|
|
85249
|
+
if (util.isDigit(c)) {
|
|
85250
|
+
buffer += read2();
|
|
85251
|
+
lexState = "decimalFraction";
|
|
85252
|
+
return;
|
|
85253
|
+
}
|
|
85254
|
+
return newToken("numeric", sign2 * Number(buffer));
|
|
85255
|
+
},
|
|
85256
|
+
decimalFraction() {
|
|
85257
|
+
switch (c) {
|
|
85258
|
+
case "e":
|
|
85259
|
+
case "E":
|
|
85260
|
+
buffer += read2();
|
|
85261
|
+
lexState = "decimalExponent";
|
|
85262
|
+
return;
|
|
85263
|
+
}
|
|
85264
|
+
if (util.isDigit(c)) {
|
|
85265
|
+
buffer += read2();
|
|
85266
|
+
return;
|
|
85267
|
+
}
|
|
85268
|
+
return newToken("numeric", sign2 * Number(buffer));
|
|
85269
|
+
},
|
|
85270
|
+
decimalExponent() {
|
|
85271
|
+
switch (c) {
|
|
85272
|
+
case "+":
|
|
85273
|
+
case "-":
|
|
85274
|
+
buffer += read2();
|
|
85275
|
+
lexState = "decimalExponentSign";
|
|
85276
|
+
return;
|
|
85277
|
+
}
|
|
85278
|
+
if (util.isDigit(c)) {
|
|
85279
|
+
buffer += read2();
|
|
85280
|
+
lexState = "decimalExponentInteger";
|
|
85281
|
+
return;
|
|
85282
|
+
}
|
|
85283
|
+
throw invalidChar(read2());
|
|
85284
|
+
},
|
|
85285
|
+
decimalExponentSign() {
|
|
85286
|
+
if (util.isDigit(c)) {
|
|
85287
|
+
buffer += read2();
|
|
85288
|
+
lexState = "decimalExponentInteger";
|
|
85289
|
+
return;
|
|
85290
|
+
}
|
|
85291
|
+
throw invalidChar(read2());
|
|
85292
|
+
},
|
|
85293
|
+
decimalExponentInteger() {
|
|
85294
|
+
if (util.isDigit(c)) {
|
|
85295
|
+
buffer += read2();
|
|
85296
|
+
return;
|
|
85297
|
+
}
|
|
85298
|
+
return newToken("numeric", sign2 * Number(buffer));
|
|
85299
|
+
},
|
|
85300
|
+
hexadecimal() {
|
|
85301
|
+
if (util.isHexDigit(c)) {
|
|
85302
|
+
buffer += read2();
|
|
85303
|
+
lexState = "hexadecimalInteger";
|
|
85304
|
+
return;
|
|
85305
|
+
}
|
|
85306
|
+
throw invalidChar(read2());
|
|
85307
|
+
},
|
|
85308
|
+
hexadecimalInteger() {
|
|
85309
|
+
if (util.isHexDigit(c)) {
|
|
85310
|
+
buffer += read2();
|
|
85311
|
+
return;
|
|
85312
|
+
}
|
|
85313
|
+
return newToken("numeric", sign2 * Number(buffer));
|
|
85314
|
+
},
|
|
85315
|
+
string() {
|
|
85316
|
+
switch (c) {
|
|
85317
|
+
case "\\":
|
|
85318
|
+
read2();
|
|
85319
|
+
buffer += escape();
|
|
85320
|
+
return;
|
|
85321
|
+
case '"':
|
|
85322
|
+
if (doubleQuote) {
|
|
85323
|
+
read2();
|
|
85324
|
+
return newToken("string", buffer);
|
|
85325
|
+
}
|
|
85326
|
+
buffer += read2();
|
|
85327
|
+
return;
|
|
85328
|
+
case "'":
|
|
85329
|
+
if (!doubleQuote) {
|
|
85330
|
+
read2();
|
|
85331
|
+
return newToken("string", buffer);
|
|
85332
|
+
}
|
|
85333
|
+
buffer += read2();
|
|
85334
|
+
return;
|
|
85335
|
+
case `
|
|
85336
|
+
`:
|
|
85337
|
+
case "\r":
|
|
85338
|
+
throw invalidChar(read2());
|
|
85339
|
+
case "\u2028":
|
|
85340
|
+
case "\u2029":
|
|
85341
|
+
separatorChar(c);
|
|
85342
|
+
break;
|
|
85343
|
+
case undefined:
|
|
85344
|
+
throw invalidChar(read2());
|
|
85345
|
+
}
|
|
85346
|
+
buffer += read2();
|
|
85347
|
+
},
|
|
85348
|
+
start() {
|
|
85349
|
+
switch (c) {
|
|
85350
|
+
case "{":
|
|
85351
|
+
case "[":
|
|
85352
|
+
return newToken("punctuator", read2());
|
|
85353
|
+
}
|
|
85354
|
+
lexState = "value";
|
|
85355
|
+
},
|
|
85356
|
+
beforePropertyName() {
|
|
85357
|
+
switch (c) {
|
|
85358
|
+
case "$":
|
|
85359
|
+
case "_":
|
|
85360
|
+
buffer = read2();
|
|
85361
|
+
lexState = "identifierName";
|
|
85362
|
+
return;
|
|
85363
|
+
case "\\":
|
|
85364
|
+
read2();
|
|
85365
|
+
lexState = "identifierNameStartEscape";
|
|
85366
|
+
return;
|
|
85367
|
+
case "}":
|
|
85368
|
+
return newToken("punctuator", read2());
|
|
85369
|
+
case '"':
|
|
85370
|
+
case "'":
|
|
85371
|
+
doubleQuote = read2() === '"';
|
|
85372
|
+
lexState = "string";
|
|
85373
|
+
return;
|
|
85374
|
+
}
|
|
85375
|
+
if (util.isIdStartChar(c)) {
|
|
85376
|
+
buffer += read2();
|
|
85377
|
+
lexState = "identifierName";
|
|
85378
|
+
return;
|
|
85379
|
+
}
|
|
85380
|
+
throw invalidChar(read2());
|
|
85381
|
+
},
|
|
85382
|
+
afterPropertyName() {
|
|
85383
|
+
if (c === ":") {
|
|
85384
|
+
return newToken("punctuator", read2());
|
|
85385
|
+
}
|
|
85386
|
+
throw invalidChar(read2());
|
|
85387
|
+
},
|
|
85388
|
+
beforePropertyValue() {
|
|
85389
|
+
lexState = "value";
|
|
85390
|
+
},
|
|
85391
|
+
afterPropertyValue() {
|
|
85392
|
+
switch (c) {
|
|
85393
|
+
case ",":
|
|
85394
|
+
case "}":
|
|
85395
|
+
return newToken("punctuator", read2());
|
|
85396
|
+
}
|
|
85397
|
+
throw invalidChar(read2());
|
|
85398
|
+
},
|
|
85399
|
+
beforeArrayValue() {
|
|
85400
|
+
if (c === "]") {
|
|
85401
|
+
return newToken("punctuator", read2());
|
|
85402
|
+
}
|
|
85403
|
+
lexState = "value";
|
|
85404
|
+
},
|
|
85405
|
+
afterArrayValue() {
|
|
85406
|
+
switch (c) {
|
|
85407
|
+
case ",":
|
|
85408
|
+
case "]":
|
|
85409
|
+
return newToken("punctuator", read2());
|
|
85410
|
+
}
|
|
85411
|
+
throw invalidChar(read2());
|
|
85412
|
+
},
|
|
85413
|
+
end() {
|
|
85414
|
+
throw invalidChar(read2());
|
|
85415
|
+
}
|
|
85416
|
+
};
|
|
85417
|
+
function newToken(type, value3) {
|
|
85418
|
+
return {
|
|
85419
|
+
type,
|
|
85420
|
+
value: value3,
|
|
85421
|
+
line,
|
|
85422
|
+
column
|
|
85423
|
+
};
|
|
85424
|
+
}
|
|
85425
|
+
function literal2(s) {
|
|
85426
|
+
for (const c2 of s) {
|
|
85427
|
+
const p = peek();
|
|
85428
|
+
if (p !== c2) {
|
|
85429
|
+
throw invalidChar(read2());
|
|
85430
|
+
}
|
|
85431
|
+
read2();
|
|
85432
|
+
}
|
|
85433
|
+
}
|
|
85434
|
+
function escape() {
|
|
85435
|
+
const c2 = peek();
|
|
85436
|
+
switch (c2) {
|
|
85437
|
+
case "b":
|
|
85438
|
+
read2();
|
|
85439
|
+
return "\b";
|
|
85440
|
+
case "f":
|
|
85441
|
+
read2();
|
|
85442
|
+
return "\f";
|
|
85443
|
+
case "n":
|
|
85444
|
+
read2();
|
|
85445
|
+
return `
|
|
85446
|
+
`;
|
|
85447
|
+
case "r":
|
|
85448
|
+
read2();
|
|
85449
|
+
return "\r";
|
|
85450
|
+
case "t":
|
|
85451
|
+
read2();
|
|
85452
|
+
return "\t";
|
|
85453
|
+
case "v":
|
|
85454
|
+
read2();
|
|
85455
|
+
return "\v";
|
|
85456
|
+
case "0":
|
|
85457
|
+
read2();
|
|
85458
|
+
if (util.isDigit(peek())) {
|
|
85459
|
+
throw invalidChar(read2());
|
|
85460
|
+
}
|
|
85461
|
+
return "\x00";
|
|
85462
|
+
case "x":
|
|
85463
|
+
read2();
|
|
85464
|
+
return hexEscape();
|
|
85465
|
+
case "u":
|
|
85466
|
+
read2();
|
|
85467
|
+
return unicodeEscape();
|
|
85468
|
+
case `
|
|
85469
|
+
`:
|
|
85470
|
+
case "\u2028":
|
|
85471
|
+
case "\u2029":
|
|
85472
|
+
read2();
|
|
85473
|
+
return "";
|
|
85474
|
+
case "\r":
|
|
85475
|
+
read2();
|
|
85476
|
+
if (peek() === `
|
|
85477
|
+
`) {
|
|
85478
|
+
read2();
|
|
85479
|
+
}
|
|
85480
|
+
return "";
|
|
85481
|
+
case "1":
|
|
85482
|
+
case "2":
|
|
85483
|
+
case "3":
|
|
85484
|
+
case "4":
|
|
85485
|
+
case "5":
|
|
85486
|
+
case "6":
|
|
85487
|
+
case "7":
|
|
85488
|
+
case "8":
|
|
85489
|
+
case "9":
|
|
85490
|
+
throw invalidChar(read2());
|
|
85491
|
+
case undefined:
|
|
85492
|
+
throw invalidChar(read2());
|
|
85493
|
+
}
|
|
85494
|
+
return read2();
|
|
85495
|
+
}
|
|
85496
|
+
function hexEscape() {
|
|
85497
|
+
let buffer2 = "";
|
|
85498
|
+
let c2 = peek();
|
|
85499
|
+
if (!util.isHexDigit(c2)) {
|
|
85500
|
+
throw invalidChar(read2());
|
|
85501
|
+
}
|
|
85502
|
+
buffer2 += read2();
|
|
85503
|
+
c2 = peek();
|
|
85504
|
+
if (!util.isHexDigit(c2)) {
|
|
85505
|
+
throw invalidChar(read2());
|
|
85506
|
+
}
|
|
85507
|
+
buffer2 += read2();
|
|
85508
|
+
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
85509
|
+
}
|
|
85510
|
+
function unicodeEscape() {
|
|
85511
|
+
let buffer2 = "";
|
|
85512
|
+
let count2 = 4;
|
|
85513
|
+
while (count2-- > 0) {
|
|
85514
|
+
const c2 = peek();
|
|
85515
|
+
if (!util.isHexDigit(c2)) {
|
|
85516
|
+
throw invalidChar(read2());
|
|
85517
|
+
}
|
|
85518
|
+
buffer2 += read2();
|
|
85519
|
+
}
|
|
85520
|
+
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
85521
|
+
}
|
|
85522
|
+
var parseStates = {
|
|
85523
|
+
start() {
|
|
85524
|
+
if (token.type === "eof") {
|
|
85525
|
+
throw invalidEOF();
|
|
85526
|
+
}
|
|
85527
|
+
push();
|
|
85528
|
+
},
|
|
85529
|
+
beforePropertyName() {
|
|
85530
|
+
switch (token.type) {
|
|
85531
|
+
case "identifier":
|
|
85532
|
+
case "string":
|
|
85533
|
+
key = token.value;
|
|
85534
|
+
parseState = "afterPropertyName";
|
|
85535
|
+
return;
|
|
85536
|
+
case "punctuator":
|
|
85537
|
+
pop();
|
|
85538
|
+
return;
|
|
85539
|
+
case "eof":
|
|
85540
|
+
throw invalidEOF();
|
|
85541
|
+
}
|
|
85542
|
+
},
|
|
85543
|
+
afterPropertyName() {
|
|
85544
|
+
if (token.type === "eof") {
|
|
85545
|
+
throw invalidEOF();
|
|
85546
|
+
}
|
|
85547
|
+
parseState = "beforePropertyValue";
|
|
85548
|
+
},
|
|
85549
|
+
beforePropertyValue() {
|
|
85550
|
+
if (token.type === "eof") {
|
|
85551
|
+
throw invalidEOF();
|
|
85552
|
+
}
|
|
85553
|
+
push();
|
|
85554
|
+
},
|
|
85555
|
+
beforeArrayValue() {
|
|
85556
|
+
if (token.type === "eof") {
|
|
85557
|
+
throw invalidEOF();
|
|
85558
|
+
}
|
|
85559
|
+
if (token.type === "punctuator" && token.value === "]") {
|
|
85560
|
+
pop();
|
|
85561
|
+
return;
|
|
85562
|
+
}
|
|
85563
|
+
push();
|
|
85564
|
+
},
|
|
85565
|
+
afterPropertyValue() {
|
|
85566
|
+
if (token.type === "eof") {
|
|
85567
|
+
throw invalidEOF();
|
|
85568
|
+
}
|
|
85569
|
+
switch (token.value) {
|
|
85570
|
+
case ",":
|
|
85571
|
+
parseState = "beforePropertyName";
|
|
85572
|
+
return;
|
|
85573
|
+
case "}":
|
|
85574
|
+
pop();
|
|
85575
|
+
}
|
|
85576
|
+
},
|
|
85577
|
+
afterArrayValue() {
|
|
85578
|
+
if (token.type === "eof") {
|
|
85579
|
+
throw invalidEOF();
|
|
85580
|
+
}
|
|
85581
|
+
switch (token.value) {
|
|
85582
|
+
case ",":
|
|
85583
|
+
parseState = "beforeArrayValue";
|
|
85584
|
+
return;
|
|
85585
|
+
case "]":
|
|
85586
|
+
pop();
|
|
85587
|
+
}
|
|
85588
|
+
},
|
|
85589
|
+
end() {}
|
|
85590
|
+
};
|
|
85591
|
+
function push() {
|
|
85592
|
+
let value3;
|
|
85593
|
+
switch (token.type) {
|
|
85594
|
+
case "punctuator":
|
|
85595
|
+
switch (token.value) {
|
|
85596
|
+
case "{":
|
|
85597
|
+
value3 = {};
|
|
85598
|
+
break;
|
|
85599
|
+
case "[":
|
|
85600
|
+
value3 = [];
|
|
85601
|
+
break;
|
|
85602
|
+
}
|
|
85603
|
+
break;
|
|
85604
|
+
case "null":
|
|
85605
|
+
case "boolean":
|
|
85606
|
+
case "numeric":
|
|
85607
|
+
case "string":
|
|
85608
|
+
value3 = token.value;
|
|
85609
|
+
break;
|
|
85610
|
+
}
|
|
85611
|
+
if (root === undefined) {
|
|
85612
|
+
root = value3;
|
|
85613
|
+
} else {
|
|
85614
|
+
const parent = stack[stack.length - 1];
|
|
85615
|
+
if (Array.isArray(parent)) {
|
|
85616
|
+
parent.push(value3);
|
|
85617
|
+
} else {
|
|
85618
|
+
Object.defineProperty(parent, key, {
|
|
85619
|
+
value: value3,
|
|
85620
|
+
writable: true,
|
|
85621
|
+
enumerable: true,
|
|
85622
|
+
configurable: true
|
|
85623
|
+
});
|
|
85624
|
+
}
|
|
85625
|
+
}
|
|
85626
|
+
if (value3 !== null && typeof value3 === "object") {
|
|
85627
|
+
stack.push(value3);
|
|
85628
|
+
if (Array.isArray(value3)) {
|
|
85629
|
+
parseState = "beforeArrayValue";
|
|
85630
|
+
} else {
|
|
85631
|
+
parseState = "beforePropertyName";
|
|
85632
|
+
}
|
|
85633
|
+
} else {
|
|
85634
|
+
const current = stack[stack.length - 1];
|
|
85635
|
+
if (current == null) {
|
|
85636
|
+
parseState = "end";
|
|
85637
|
+
} else if (Array.isArray(current)) {
|
|
85638
|
+
parseState = "afterArrayValue";
|
|
85639
|
+
} else {
|
|
85640
|
+
parseState = "afterPropertyValue";
|
|
85641
|
+
}
|
|
85642
|
+
}
|
|
85643
|
+
}
|
|
85644
|
+
function pop() {
|
|
85645
|
+
stack.pop();
|
|
85646
|
+
const current = stack[stack.length - 1];
|
|
85647
|
+
if (current == null) {
|
|
85648
|
+
parseState = "end";
|
|
85649
|
+
} else if (Array.isArray(current)) {
|
|
85650
|
+
parseState = "afterArrayValue";
|
|
85651
|
+
} else {
|
|
85652
|
+
parseState = "afterPropertyValue";
|
|
85653
|
+
}
|
|
85654
|
+
}
|
|
85655
|
+
function invalidChar(c2) {
|
|
85656
|
+
if (c2 === undefined) {
|
|
85657
|
+
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
|
|
85658
|
+
}
|
|
85659
|
+
return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
|
|
85660
|
+
}
|
|
85661
|
+
function invalidEOF() {
|
|
85662
|
+
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
|
|
85663
|
+
}
|
|
85664
|
+
function invalidIdentifier() {
|
|
85665
|
+
column -= 5;
|
|
85666
|
+
return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
|
|
85667
|
+
}
|
|
85668
|
+
function separatorChar(c2) {
|
|
85669
|
+
console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
|
|
85670
|
+
}
|
|
85671
|
+
function formatChar(c2) {
|
|
85672
|
+
const replacements2 = {
|
|
85673
|
+
"'": "\\'",
|
|
85674
|
+
'"': "\\\"",
|
|
85675
|
+
"\\": "\\\\",
|
|
85676
|
+
"\b": "\\b",
|
|
85677
|
+
"\f": "\\f",
|
|
85678
|
+
"\n": "\\n",
|
|
85679
|
+
"\r": "\\r",
|
|
85680
|
+
"\t": "\\t",
|
|
85681
|
+
"\v": "\\v",
|
|
85682
|
+
"\x00": "\\0",
|
|
85683
|
+
"\u2028": "\\u2028",
|
|
85684
|
+
"\u2029": "\\u2029"
|
|
85685
|
+
};
|
|
85686
|
+
if (replacements2[c2]) {
|
|
85687
|
+
return replacements2[c2];
|
|
85688
|
+
}
|
|
85689
|
+
if (c2 < " ") {
|
|
85690
|
+
const hexString = c2.charCodeAt(0).toString(16);
|
|
85691
|
+
return "\\x" + ("00" + hexString).substring(hexString.length);
|
|
85692
|
+
}
|
|
85693
|
+
return c2;
|
|
85694
|
+
}
|
|
85695
|
+
function syntaxError(message2) {
|
|
85696
|
+
const err = new SyntaxError(message2);
|
|
85697
|
+
err.lineNumber = line;
|
|
85698
|
+
err.columnNumber = column;
|
|
85699
|
+
return err;
|
|
85700
|
+
}
|
|
85701
|
+
});
|
|
85702
|
+
|
|
85703
|
+
// node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/stringify.js
|
|
85704
|
+
var require_stringify2 = __commonJS(function(exports, module) {
|
|
85705
|
+
var util = require_util();
|
|
85706
|
+
module.exports = function stringify(value3, replacer, space) {
|
|
85707
|
+
const stack = [];
|
|
85708
|
+
let indent = "";
|
|
85709
|
+
let propertyList;
|
|
85710
|
+
let replacerFunc;
|
|
85711
|
+
let gap = "";
|
|
85712
|
+
let quote;
|
|
85713
|
+
if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
|
|
85714
|
+
space = replacer.space;
|
|
85715
|
+
quote = replacer.quote;
|
|
85716
|
+
replacer = replacer.replacer;
|
|
85717
|
+
}
|
|
85718
|
+
if (typeof replacer === "function") {
|
|
85719
|
+
replacerFunc = replacer;
|
|
85720
|
+
} else if (Array.isArray(replacer)) {
|
|
85721
|
+
propertyList = [];
|
|
85722
|
+
for (const v of replacer) {
|
|
85723
|
+
let item;
|
|
85724
|
+
if (typeof v === "string") {
|
|
85725
|
+
item = v;
|
|
85726
|
+
} else if (typeof v === "number" || v instanceof String || v instanceof Number) {
|
|
85727
|
+
item = String(v);
|
|
85728
|
+
}
|
|
85729
|
+
if (item !== undefined && propertyList.indexOf(item) < 0) {
|
|
85730
|
+
propertyList.push(item);
|
|
85731
|
+
}
|
|
85732
|
+
}
|
|
85733
|
+
}
|
|
85734
|
+
if (space instanceof Number) {
|
|
85735
|
+
space = Number(space);
|
|
85736
|
+
} else if (space instanceof String) {
|
|
85737
|
+
space = String(space);
|
|
85738
|
+
}
|
|
85739
|
+
if (typeof space === "number") {
|
|
85740
|
+
if (space > 0) {
|
|
85741
|
+
space = Math.min(10, Math.floor(space));
|
|
85742
|
+
gap = " ".substr(0, space);
|
|
85743
|
+
}
|
|
85744
|
+
} else if (typeof space === "string") {
|
|
85745
|
+
gap = space.substr(0, 10);
|
|
85746
|
+
}
|
|
85747
|
+
return serializeProperty("", { "": value3 });
|
|
85748
|
+
function serializeProperty(key, holder) {
|
|
85749
|
+
let value4 = holder[key];
|
|
85750
|
+
if (value4 != null) {
|
|
85751
|
+
if (typeof value4.toJSON5 === "function") {
|
|
85752
|
+
value4 = value4.toJSON5(key);
|
|
85753
|
+
} else if (typeof value4.toJSON === "function") {
|
|
85754
|
+
value4 = value4.toJSON(key);
|
|
85755
|
+
}
|
|
85756
|
+
}
|
|
85757
|
+
if (replacerFunc) {
|
|
85758
|
+
value4 = replacerFunc.call(holder, key, value4);
|
|
85759
|
+
}
|
|
85760
|
+
if (value4 instanceof Number) {
|
|
85761
|
+
value4 = Number(value4);
|
|
85762
|
+
} else if (value4 instanceof String) {
|
|
85763
|
+
value4 = String(value4);
|
|
85764
|
+
} else if (value4 instanceof Boolean) {
|
|
85765
|
+
value4 = value4.valueOf();
|
|
85766
|
+
}
|
|
85767
|
+
switch (value4) {
|
|
85768
|
+
case null:
|
|
85769
|
+
return "null";
|
|
85770
|
+
case true:
|
|
85771
|
+
return "true";
|
|
85772
|
+
case false:
|
|
85773
|
+
return "false";
|
|
85774
|
+
}
|
|
85775
|
+
if (typeof value4 === "string") {
|
|
85776
|
+
return quoteString(value4, false);
|
|
85777
|
+
}
|
|
85778
|
+
if (typeof value4 === "number") {
|
|
85779
|
+
return String(value4);
|
|
85780
|
+
}
|
|
85781
|
+
if (typeof value4 === "object") {
|
|
85782
|
+
return Array.isArray(value4) ? serializeArray(value4) : serializeObject2(value4);
|
|
85783
|
+
}
|
|
85784
|
+
return;
|
|
85785
|
+
}
|
|
85786
|
+
function quoteString(value4) {
|
|
85787
|
+
const quotes = {
|
|
85788
|
+
"'": 0.1,
|
|
85789
|
+
'"': 0.2
|
|
85790
|
+
};
|
|
85791
|
+
const replacements2 = {
|
|
85792
|
+
"'": "\\'",
|
|
85793
|
+
'"': "\\\"",
|
|
85794
|
+
"\\": "\\\\",
|
|
85795
|
+
"\b": "\\b",
|
|
85796
|
+
"\f": "\\f",
|
|
85797
|
+
"\n": "\\n",
|
|
85798
|
+
"\r": "\\r",
|
|
85799
|
+
"\t": "\\t",
|
|
85800
|
+
"\v": "\\v",
|
|
85801
|
+
"\x00": "\\0",
|
|
85802
|
+
"\u2028": "\\u2028",
|
|
85803
|
+
"\u2029": "\\u2029"
|
|
85804
|
+
};
|
|
85805
|
+
let product = "";
|
|
85806
|
+
for (let i = 0;i < value4.length; i++) {
|
|
85807
|
+
const c = value4[i];
|
|
85808
|
+
switch (c) {
|
|
85809
|
+
case "'":
|
|
85810
|
+
case '"':
|
|
85811
|
+
quotes[c]++;
|
|
85812
|
+
product += c;
|
|
85813
|
+
continue;
|
|
85814
|
+
case "\x00":
|
|
85815
|
+
if (util.isDigit(value4[i + 1])) {
|
|
85816
|
+
product += "\\x00";
|
|
85817
|
+
continue;
|
|
85818
|
+
}
|
|
85819
|
+
}
|
|
85820
|
+
if (replacements2[c]) {
|
|
85821
|
+
product += replacements2[c];
|
|
85822
|
+
continue;
|
|
85823
|
+
}
|
|
85824
|
+
if (c < " ") {
|
|
85825
|
+
let hexString = c.charCodeAt(0).toString(16);
|
|
85826
|
+
product += "\\x" + ("00" + hexString).substring(hexString.length);
|
|
85827
|
+
continue;
|
|
85828
|
+
}
|
|
85829
|
+
product += c;
|
|
85830
|
+
}
|
|
85831
|
+
const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
|
|
85832
|
+
product = product.replace(new RegExp(quoteChar, "g"), replacements2[quoteChar]);
|
|
85833
|
+
return quoteChar + product + quoteChar;
|
|
85834
|
+
}
|
|
85835
|
+
function serializeObject2(value4) {
|
|
85836
|
+
if (stack.indexOf(value4) >= 0) {
|
|
85837
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
85838
|
+
}
|
|
85839
|
+
stack.push(value4);
|
|
85840
|
+
let stepback = indent;
|
|
85841
|
+
indent = indent + gap;
|
|
85842
|
+
let keys = propertyList || Object.keys(value4);
|
|
85843
|
+
let partial2 = [];
|
|
85844
|
+
for (const key of keys) {
|
|
85845
|
+
const propertyString = serializeProperty(key, value4);
|
|
85846
|
+
if (propertyString !== undefined) {
|
|
85847
|
+
let member = serializeKey(key) + ":";
|
|
85848
|
+
if (gap !== "") {
|
|
85849
|
+
member += " ";
|
|
85850
|
+
}
|
|
85851
|
+
member += propertyString;
|
|
85852
|
+
partial2.push(member);
|
|
85853
|
+
}
|
|
85854
|
+
}
|
|
85855
|
+
let final;
|
|
85856
|
+
if (partial2.length === 0) {
|
|
85857
|
+
final = "{}";
|
|
85858
|
+
} else {
|
|
85859
|
+
let properties;
|
|
85860
|
+
if (gap === "") {
|
|
85861
|
+
properties = partial2.join(",");
|
|
85862
|
+
final = "{" + properties + "}";
|
|
85863
|
+
} else {
|
|
85864
|
+
let separator = `,
|
|
85865
|
+
` + indent;
|
|
85866
|
+
properties = partial2.join(separator);
|
|
85867
|
+
final = `{
|
|
85868
|
+
` + indent + properties + `,
|
|
85869
|
+
` + stepback + "}";
|
|
85870
|
+
}
|
|
85871
|
+
}
|
|
85872
|
+
stack.pop();
|
|
85873
|
+
indent = stepback;
|
|
85874
|
+
return final;
|
|
85875
|
+
}
|
|
85876
|
+
function serializeKey(key) {
|
|
85877
|
+
if (key.length === 0) {
|
|
85878
|
+
return quoteString(key, true);
|
|
85879
|
+
}
|
|
85880
|
+
const firstChar = String.fromCodePoint(key.codePointAt(0));
|
|
85881
|
+
if (!util.isIdStartChar(firstChar)) {
|
|
85882
|
+
return quoteString(key, true);
|
|
85883
|
+
}
|
|
85884
|
+
for (let i = firstChar.length;i < key.length; i++) {
|
|
85885
|
+
if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
|
|
85886
|
+
return quoteString(key, true);
|
|
85887
|
+
}
|
|
85888
|
+
}
|
|
85889
|
+
return key;
|
|
85890
|
+
}
|
|
85891
|
+
function serializeArray(value4) {
|
|
85892
|
+
if (stack.indexOf(value4) >= 0) {
|
|
85893
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
85894
|
+
}
|
|
85895
|
+
stack.push(value4);
|
|
85896
|
+
let stepback = indent;
|
|
85897
|
+
indent = indent + gap;
|
|
85898
|
+
let partial2 = [];
|
|
85899
|
+
for (let i = 0;i < value4.length; i++) {
|
|
85900
|
+
const propertyString = serializeProperty(String(i), value4);
|
|
85901
|
+
partial2.push(propertyString !== undefined ? propertyString : "null");
|
|
85902
|
+
}
|
|
85903
|
+
let final;
|
|
85904
|
+
if (partial2.length === 0) {
|
|
85905
|
+
final = "[]";
|
|
85906
|
+
} else {
|
|
85907
|
+
if (gap === "") {
|
|
85908
|
+
let properties = partial2.join(",");
|
|
85909
|
+
final = "[" + properties + "]";
|
|
85910
|
+
} else {
|
|
85911
|
+
let separator = `,
|
|
85912
|
+
` + indent;
|
|
85913
|
+
let properties = partial2.join(separator);
|
|
85914
|
+
final = `[
|
|
85915
|
+
` + indent + properties + `,
|
|
85916
|
+
` + stepback + "]";
|
|
85917
|
+
}
|
|
85918
|
+
}
|
|
85919
|
+
stack.pop();
|
|
85920
|
+
indent = stepback;
|
|
85921
|
+
return final;
|
|
85922
|
+
}
|
|
85923
|
+
};
|
|
85924
|
+
});
|
|
85925
|
+
|
|
85926
|
+
// node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/index.js
|
|
85927
|
+
var require_lib4 = __commonJS(function(exports, module) {
|
|
85928
|
+
var parse6 = require_parse();
|
|
85929
|
+
var stringify = require_stringify2();
|
|
85930
|
+
var JSON5 = {
|
|
85931
|
+
parse: parse6,
|
|
85932
|
+
stringify
|
|
85933
|
+
};
|
|
85934
|
+
module.exports = JSON5;
|
|
85935
|
+
});
|
|
85936
|
+
|
|
85937
|
+
// node_modules/.pnpm/strip-bom@3.0.0/node_modules/strip-bom/index.js
|
|
85938
|
+
var require_strip_bom = __commonJS(function(exports, module) {
|
|
85939
|
+
module.exports = (x) => {
|
|
85940
|
+
if (typeof x !== "string") {
|
|
85941
|
+
throw new TypeError("Expected a string, got " + typeof x);
|
|
85942
|
+
}
|
|
85943
|
+
if (x.charCodeAt(0) === 65279) {
|
|
85944
|
+
return x.slice(1);
|
|
85945
|
+
}
|
|
85946
|
+
return x;
|
|
85947
|
+
};
|
|
85948
|
+
});
|
|
85949
|
+
|
|
85950
|
+
// node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/tsconfig-loader.js
|
|
85951
|
+
var require_tsconfig_loader = __commonJS(function(exports) {
|
|
85952
|
+
var __assign = exports && exports.__assign || function() {
|
|
85953
|
+
__assign = Object.assign || function(t) {
|
|
85954
|
+
for (var s, i = 1, n = arguments.length;i < n; i++) {
|
|
85955
|
+
s = arguments[i];
|
|
85956
|
+
for (var p in s)
|
|
85957
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
85958
|
+
t[p] = s[p];
|
|
85959
|
+
}
|
|
85960
|
+
return t;
|
|
85961
|
+
};
|
|
85962
|
+
return __assign.apply(this, arguments);
|
|
85963
|
+
};
|
|
85964
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
85965
|
+
exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = undefined;
|
|
85966
|
+
var path5 = __require("path");
|
|
85967
|
+
var fs = __require("fs");
|
|
85968
|
+
var JSON5 = require_lib4();
|
|
85969
|
+
var StripBom = require_strip_bom();
|
|
85970
|
+
function tsConfigLoader(_a3) {
|
|
85971
|
+
var { getEnv, cwd, loadSync: _b } = _a3, loadSync = _b === undefined ? loadSyncDefault : _b;
|
|
85972
|
+
var TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT");
|
|
85973
|
+
var TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL");
|
|
85974
|
+
var loadResult = loadSync(cwd, TS_NODE_PROJECT, TS_NODE_BASEURL);
|
|
85975
|
+
return loadResult;
|
|
85976
|
+
}
|
|
85977
|
+
exports.tsConfigLoader = tsConfigLoader;
|
|
85978
|
+
function loadSyncDefault(cwd, filename, baseUrl) {
|
|
85979
|
+
var configPath2 = resolveConfigPath(cwd, filename);
|
|
85980
|
+
if (!configPath2) {
|
|
85981
|
+
return {
|
|
85982
|
+
tsConfigPath: undefined,
|
|
85983
|
+
baseUrl: undefined,
|
|
85984
|
+
paths: undefined
|
|
85985
|
+
};
|
|
85986
|
+
}
|
|
85987
|
+
var config2 = loadTsconfig(configPath2);
|
|
85988
|
+
return {
|
|
85989
|
+
tsConfigPath: configPath2,
|
|
85990
|
+
baseUrl: baseUrl || config2 && config2.compilerOptions && config2.compilerOptions.baseUrl,
|
|
85991
|
+
paths: config2 && config2.compilerOptions && config2.compilerOptions.paths
|
|
85992
|
+
};
|
|
85993
|
+
}
|
|
85994
|
+
function resolveConfigPath(cwd, filename) {
|
|
85995
|
+
if (filename) {
|
|
85996
|
+
var absolutePath = fs.lstatSync(filename).isDirectory() ? path5.resolve(filename, "./tsconfig.json") : path5.resolve(cwd, filename);
|
|
85997
|
+
return absolutePath;
|
|
85998
|
+
}
|
|
85999
|
+
if (fs.statSync(cwd).isFile()) {
|
|
86000
|
+
return path5.resolve(cwd);
|
|
86001
|
+
}
|
|
86002
|
+
var configAbsolutePath = walkForTsConfig(cwd);
|
|
86003
|
+
return configAbsolutePath ? path5.resolve(configAbsolutePath) : undefined;
|
|
86004
|
+
}
|
|
86005
|
+
function walkForTsConfig(directory, readdirSync2) {
|
|
86006
|
+
if (readdirSync2 === undefined) {
|
|
86007
|
+
readdirSync2 = fs.readdirSync;
|
|
86008
|
+
}
|
|
86009
|
+
var files = readdirSync2(directory);
|
|
86010
|
+
var filesToCheck = ["tsconfig.json", "jsconfig.json"];
|
|
86011
|
+
for (var _i = 0, filesToCheck_1 = filesToCheck;_i < filesToCheck_1.length; _i++) {
|
|
86012
|
+
var fileToCheck = filesToCheck_1[_i];
|
|
86013
|
+
if (files.indexOf(fileToCheck) !== -1) {
|
|
86014
|
+
return path5.join(directory, fileToCheck);
|
|
86015
|
+
}
|
|
86016
|
+
}
|
|
86017
|
+
var parentDirectory = path5.dirname(directory);
|
|
86018
|
+
if (directory === parentDirectory) {
|
|
86019
|
+
return;
|
|
86020
|
+
}
|
|
86021
|
+
return walkForTsConfig(parentDirectory, readdirSync2);
|
|
86022
|
+
}
|
|
86023
|
+
exports.walkForTsConfig = walkForTsConfig;
|
|
86024
|
+
function loadTsconfig(configFilePath, existsSync9, readFileSync3) {
|
|
86025
|
+
if (existsSync9 === undefined) {
|
|
86026
|
+
existsSync9 = fs.existsSync;
|
|
86027
|
+
}
|
|
86028
|
+
if (readFileSync3 === undefined) {
|
|
86029
|
+
readFileSync3 = function(filename) {
|
|
86030
|
+
return fs.readFileSync(filename, "utf8");
|
|
86031
|
+
};
|
|
86032
|
+
}
|
|
86033
|
+
if (!existsSync9(configFilePath)) {
|
|
86034
|
+
return;
|
|
86035
|
+
}
|
|
86036
|
+
var configString = readFileSync3(configFilePath);
|
|
86037
|
+
var cleanedJson = StripBom(configString);
|
|
86038
|
+
var config2;
|
|
86039
|
+
try {
|
|
86040
|
+
config2 = JSON5.parse(cleanedJson);
|
|
86041
|
+
} catch (e) {
|
|
86042
|
+
throw new Error("".concat(configFilePath, " is malformed ").concat(e.message));
|
|
86043
|
+
}
|
|
86044
|
+
var extendedConfig = config2.extends;
|
|
86045
|
+
if (extendedConfig) {
|
|
86046
|
+
var base2 = undefined;
|
|
86047
|
+
if (Array.isArray(extendedConfig)) {
|
|
86048
|
+
base2 = extendedConfig.reduce(function(currBase, extendedConfigElement) {
|
|
86049
|
+
return mergeTsconfigs(currBase, loadTsconfigFromExtends(configFilePath, extendedConfigElement, existsSync9, readFileSync3));
|
|
86050
|
+
}, {});
|
|
86051
|
+
} else {
|
|
86052
|
+
base2 = loadTsconfigFromExtends(configFilePath, extendedConfig, existsSync9, readFileSync3);
|
|
86053
|
+
}
|
|
86054
|
+
return mergeTsconfigs(base2, config2);
|
|
86055
|
+
}
|
|
86056
|
+
return config2;
|
|
86057
|
+
}
|
|
86058
|
+
exports.loadTsconfig = loadTsconfig;
|
|
86059
|
+
function loadTsconfigFromExtends(configFilePath, extendedConfigValue, existsSync9, readFileSync3) {
|
|
86060
|
+
var _a3;
|
|
86061
|
+
if (typeof extendedConfigValue === "string" && extendedConfigValue.indexOf(".json") === -1) {
|
|
86062
|
+
extendedConfigValue += ".json";
|
|
86063
|
+
}
|
|
86064
|
+
var currentDir = path5.dirname(configFilePath);
|
|
86065
|
+
var extendedConfigPath = path5.join(currentDir, extendedConfigValue);
|
|
86066
|
+
if (extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync9(extendedConfigPath)) {
|
|
86067
|
+
extendedConfigPath = path5.join(currentDir, "node_modules", extendedConfigValue);
|
|
86068
|
+
}
|
|
86069
|
+
var config2 = loadTsconfig(extendedConfigPath, existsSync9, readFileSync3) || {};
|
|
86070
|
+
if ((_a3 = config2.compilerOptions) === null || _a3 === undefined ? undefined : _a3.baseUrl) {
|
|
86071
|
+
var extendsDir = path5.dirname(extendedConfigValue);
|
|
86072
|
+
config2.compilerOptions.baseUrl = path5.join(extendsDir, config2.compilerOptions.baseUrl);
|
|
86073
|
+
}
|
|
86074
|
+
return config2;
|
|
86075
|
+
}
|
|
86076
|
+
function mergeTsconfigs(base2, config2) {
|
|
86077
|
+
base2 = base2 || {};
|
|
86078
|
+
config2 = config2 || {};
|
|
86079
|
+
return __assign(__assign(__assign({}, base2), config2), { compilerOptions: __assign(__assign({}, base2.compilerOptions), config2.compilerOptions) });
|
|
86080
|
+
}
|
|
86081
|
+
});
|
|
86082
|
+
|
|
86083
|
+
// node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/config-loader.js
|
|
86084
|
+
var require_config_loader = __commonJS(function(exports) {
|
|
86085
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
86086
|
+
exports.configLoader = exports.loadConfig = undefined;
|
|
86087
|
+
var TsConfigLoader2 = require_tsconfig_loader();
|
|
86088
|
+
var path5 = __require("path");
|
|
86089
|
+
function loadConfig(cwd) {
|
|
86090
|
+
if (cwd === undefined) {
|
|
86091
|
+
cwd = process.cwd();
|
|
86092
|
+
}
|
|
86093
|
+
return configLoader({ cwd });
|
|
86094
|
+
}
|
|
86095
|
+
exports.loadConfig = loadConfig;
|
|
86096
|
+
function configLoader(_a3) {
|
|
86097
|
+
var { cwd, explicitParams, tsConfigLoader: _b } = _a3, tsConfigLoader = _b === undefined ? TsConfigLoader2.tsConfigLoader : _b;
|
|
86098
|
+
if (explicitParams) {
|
|
86099
|
+
var absoluteBaseUrl = path5.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path5.join(cwd, explicitParams.baseUrl);
|
|
86100
|
+
return {
|
|
86101
|
+
resultType: "success",
|
|
86102
|
+
configFileAbsolutePath: "",
|
|
86103
|
+
baseUrl: explicitParams.baseUrl,
|
|
86104
|
+
absoluteBaseUrl,
|
|
86105
|
+
paths: explicitParams.paths,
|
|
86106
|
+
mainFields: explicitParams.mainFields,
|
|
86107
|
+
addMatchAll: explicitParams.addMatchAll
|
|
86108
|
+
};
|
|
86109
|
+
}
|
|
86110
|
+
var loadResult = tsConfigLoader({
|
|
86111
|
+
cwd,
|
|
86112
|
+
getEnv: function(key) {
|
|
86113
|
+
return process.env[key];
|
|
86114
|
+
}
|
|
86115
|
+
});
|
|
86116
|
+
if (!loadResult.tsConfigPath) {
|
|
86117
|
+
return {
|
|
86118
|
+
resultType: "failed",
|
|
86119
|
+
message: "Couldn't find tsconfig.json"
|
|
86120
|
+
};
|
|
86121
|
+
}
|
|
86122
|
+
return {
|
|
86123
|
+
resultType: "success",
|
|
86124
|
+
configFileAbsolutePath: loadResult.tsConfigPath,
|
|
86125
|
+
baseUrl: loadResult.baseUrl,
|
|
86126
|
+
absoluteBaseUrl: path5.resolve(path5.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
|
|
86127
|
+
paths: loadResult.paths || {},
|
|
86128
|
+
addMatchAll: loadResult.baseUrl !== undefined
|
|
86129
|
+
};
|
|
86130
|
+
}
|
|
86131
|
+
exports.configLoader = configLoader;
|
|
86132
|
+
});
|
|
86133
|
+
|
|
86134
|
+
// node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js
|
|
86135
|
+
var require_minimist = __commonJS(function(exports, module) {
|
|
86136
|
+
function hasKey(obj, keys) {
|
|
86137
|
+
var o = obj;
|
|
86138
|
+
keys.slice(0, -1).forEach(function(key2) {
|
|
86139
|
+
o = o[key2] || {};
|
|
86140
|
+
});
|
|
86141
|
+
var key = keys[keys.length - 1];
|
|
86142
|
+
return key in o;
|
|
86143
|
+
}
|
|
86144
|
+
function isNumber(x) {
|
|
86145
|
+
if (typeof x === "number") {
|
|
86146
|
+
return true;
|
|
86147
|
+
}
|
|
86148
|
+
if (/^0x[0-9a-f]+$/i.test(x)) {
|
|
86149
|
+
return true;
|
|
86150
|
+
}
|
|
86151
|
+
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
|
86152
|
+
}
|
|
86153
|
+
function isConstructorOrProto(obj, key) {
|
|
86154
|
+
return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
|
|
86155
|
+
}
|
|
86156
|
+
module.exports = function(args, opts) {
|
|
86157
|
+
if (!opts) {
|
|
86158
|
+
opts = {};
|
|
86159
|
+
}
|
|
86160
|
+
var flags = {
|
|
86161
|
+
bools: {},
|
|
86162
|
+
strings: {},
|
|
86163
|
+
unknownFn: null
|
|
86164
|
+
};
|
|
86165
|
+
if (typeof opts.unknown === "function") {
|
|
86166
|
+
flags.unknownFn = opts.unknown;
|
|
86167
|
+
}
|
|
86168
|
+
if (typeof opts.boolean === "boolean" && opts.boolean) {
|
|
86169
|
+
flags.allBools = true;
|
|
86170
|
+
} else {
|
|
86171
|
+
[].concat(opts.boolean).filter(Boolean).forEach(function(key2) {
|
|
86172
|
+
flags.bools[key2] = true;
|
|
86173
|
+
});
|
|
86174
|
+
}
|
|
86175
|
+
var aliases = {};
|
|
86176
|
+
function aliasIsBoolean(key2) {
|
|
86177
|
+
return aliases[key2].some(function(x) {
|
|
86178
|
+
return flags.bools[x];
|
|
86179
|
+
});
|
|
86180
|
+
}
|
|
86181
|
+
Object.keys(opts.alias || {}).forEach(function(key2) {
|
|
86182
|
+
aliases[key2] = [].concat(opts.alias[key2]);
|
|
86183
|
+
aliases[key2].forEach(function(x) {
|
|
86184
|
+
aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
|
|
86185
|
+
return x !== y;
|
|
86186
|
+
}));
|
|
86187
|
+
});
|
|
86188
|
+
});
|
|
86189
|
+
[].concat(opts.string).filter(Boolean).forEach(function(key2) {
|
|
86190
|
+
flags.strings[key2] = true;
|
|
86191
|
+
if (aliases[key2]) {
|
|
86192
|
+
[].concat(aliases[key2]).forEach(function(k) {
|
|
86193
|
+
flags.strings[k] = true;
|
|
86194
|
+
});
|
|
86195
|
+
}
|
|
86196
|
+
});
|
|
86197
|
+
var defaults = opts.default || {};
|
|
86198
|
+
var argv = { _: [] };
|
|
86199
|
+
function argDefined(key2, arg2) {
|
|
86200
|
+
return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
|
|
86201
|
+
}
|
|
86202
|
+
function setKey(obj, keys, value4) {
|
|
86203
|
+
var o = obj;
|
|
86204
|
+
for (var i2 = 0;i2 < keys.length - 1; i2++) {
|
|
86205
|
+
var key2 = keys[i2];
|
|
86206
|
+
if (isConstructorOrProto(o, key2)) {
|
|
86207
|
+
return;
|
|
86208
|
+
}
|
|
86209
|
+
if (o[key2] === undefined) {
|
|
86210
|
+
o[key2] = {};
|
|
86211
|
+
}
|
|
86212
|
+
if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) {
|
|
86213
|
+
o[key2] = {};
|
|
86214
|
+
}
|
|
86215
|
+
if (o[key2] === Array.prototype) {
|
|
86216
|
+
o[key2] = [];
|
|
86217
|
+
}
|
|
86218
|
+
o = o[key2];
|
|
86219
|
+
}
|
|
86220
|
+
var lastKey = keys[keys.length - 1];
|
|
86221
|
+
if (isConstructorOrProto(o, lastKey)) {
|
|
86222
|
+
return;
|
|
86223
|
+
}
|
|
86224
|
+
if (o === Object.prototype || o === Number.prototype || o === String.prototype) {
|
|
86225
|
+
o = {};
|
|
86226
|
+
}
|
|
86227
|
+
if (o === Array.prototype) {
|
|
86228
|
+
o = [];
|
|
86229
|
+
}
|
|
86230
|
+
if (o[lastKey] === undefined || flags.bools[lastKey] || typeof o[lastKey] === "boolean") {
|
|
86231
|
+
o[lastKey] = value4;
|
|
86232
|
+
} else if (Array.isArray(o[lastKey])) {
|
|
86233
|
+
o[lastKey].push(value4);
|
|
86234
|
+
} else {
|
|
86235
|
+
o[lastKey] = [o[lastKey], value4];
|
|
86236
|
+
}
|
|
86237
|
+
}
|
|
86238
|
+
function setArg(key2, val, arg2) {
|
|
86239
|
+
if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
|
|
86240
|
+
if (flags.unknownFn(arg2) === false) {
|
|
86241
|
+
return;
|
|
86242
|
+
}
|
|
86243
|
+
}
|
|
86244
|
+
var value4 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
|
|
86245
|
+
setKey(argv, key2.split("."), value4);
|
|
86246
|
+
(aliases[key2] || []).forEach(function(x) {
|
|
86247
|
+
setKey(argv, x.split("."), value4);
|
|
86248
|
+
});
|
|
86249
|
+
}
|
|
86250
|
+
Object.keys(flags.bools).forEach(function(key2) {
|
|
86251
|
+
setArg(key2, defaults[key2] === undefined ? false : defaults[key2]);
|
|
86252
|
+
});
|
|
86253
|
+
var notFlags = [];
|
|
86254
|
+
if (args.indexOf("--") !== -1) {
|
|
86255
|
+
notFlags = args.slice(args.indexOf("--") + 1);
|
|
86256
|
+
args = args.slice(0, args.indexOf("--"));
|
|
86257
|
+
}
|
|
86258
|
+
for (var i = 0;i < args.length; i++) {
|
|
86259
|
+
var arg = args[i];
|
|
86260
|
+
var key;
|
|
86261
|
+
var next;
|
|
86262
|
+
if (/^--.+=/.test(arg)) {
|
|
86263
|
+
var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
|
86264
|
+
key = m[1];
|
|
86265
|
+
var value3 = m[2];
|
|
86266
|
+
if (flags.bools[key]) {
|
|
86267
|
+
value3 = value3 !== "false";
|
|
86268
|
+
}
|
|
86269
|
+
setArg(key, value3, arg);
|
|
86270
|
+
} else if (/^--no-.+/.test(arg)) {
|
|
86271
|
+
key = arg.match(/^--no-(.+)/)[1];
|
|
86272
|
+
setArg(key, false, arg);
|
|
86273
|
+
} else if (/^--.+/.test(arg)) {
|
|
86274
|
+
key = arg.match(/^--(.+)/)[1];
|
|
86275
|
+
next = args[i + 1];
|
|
86276
|
+
if (next !== undefined && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
|
86277
|
+
setArg(key, next, arg);
|
|
86278
|
+
i += 1;
|
|
86279
|
+
} else if (/^(true|false)$/.test(next)) {
|
|
86280
|
+
setArg(key, next === "true", arg);
|
|
86281
|
+
i += 1;
|
|
86282
|
+
} else {
|
|
86283
|
+
setArg(key, flags.strings[key] ? "" : true, arg);
|
|
86284
|
+
}
|
|
86285
|
+
} else if (/^-[^-]+/.test(arg)) {
|
|
86286
|
+
var letters = arg.slice(1, -1).split("");
|
|
86287
|
+
var broken = false;
|
|
86288
|
+
for (var j = 0;j < letters.length; j++) {
|
|
86289
|
+
next = arg.slice(j + 2);
|
|
86290
|
+
if (next === "-") {
|
|
86291
|
+
setArg(letters[j], next, arg);
|
|
86292
|
+
continue;
|
|
86293
|
+
}
|
|
86294
|
+
if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
|
|
86295
|
+
setArg(letters[j], next.slice(1), arg);
|
|
86296
|
+
broken = true;
|
|
86297
|
+
break;
|
|
86298
|
+
}
|
|
86299
|
+
if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
|
86300
|
+
setArg(letters[j], next, arg);
|
|
86301
|
+
broken = true;
|
|
86302
|
+
break;
|
|
86303
|
+
}
|
|
86304
|
+
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
|
86305
|
+
setArg(letters[j], arg.slice(j + 2), arg);
|
|
86306
|
+
broken = true;
|
|
86307
|
+
break;
|
|
86308
|
+
} else {
|
|
86309
|
+
setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
|
|
86310
|
+
}
|
|
86311
|
+
}
|
|
86312
|
+
key = arg.slice(-1)[0];
|
|
86313
|
+
if (!broken && key !== "-") {
|
|
86314
|
+
if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
|
86315
|
+
setArg(key, args[i + 1], arg);
|
|
86316
|
+
i += 1;
|
|
86317
|
+
} else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
|
|
86318
|
+
setArg(key, args[i + 1] === "true", arg);
|
|
86319
|
+
i += 1;
|
|
86320
|
+
} else {
|
|
86321
|
+
setArg(key, flags.strings[key] ? "" : true, arg);
|
|
86322
|
+
}
|
|
86323
|
+
}
|
|
86324
|
+
} else {
|
|
86325
|
+
if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
|
|
86326
|
+
argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));
|
|
86327
|
+
}
|
|
86328
|
+
if (opts.stopEarly) {
|
|
86329
|
+
argv._.push.apply(argv._, args.slice(i + 1));
|
|
86330
|
+
break;
|
|
86331
|
+
}
|
|
86332
|
+
}
|
|
86333
|
+
}
|
|
86334
|
+
Object.keys(defaults).forEach(function(k) {
|
|
86335
|
+
if (!hasKey(argv, k.split("."))) {
|
|
86336
|
+
setKey(argv, k.split("."), defaults[k]);
|
|
86337
|
+
(aliases[k] || []).forEach(function(x) {
|
|
86338
|
+
setKey(argv, x.split("."), defaults[k]);
|
|
86339
|
+
});
|
|
86340
|
+
}
|
|
86341
|
+
});
|
|
86342
|
+
if (opts["--"]) {
|
|
86343
|
+
argv["--"] = notFlags.slice();
|
|
86344
|
+
} else {
|
|
86345
|
+
notFlags.forEach(function(k) {
|
|
86346
|
+
argv._.push(k);
|
|
86347
|
+
});
|
|
86348
|
+
}
|
|
86349
|
+
return argv;
|
|
86350
|
+
};
|
|
86351
|
+
});
|
|
86352
|
+
|
|
86353
|
+
// node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/register.js
|
|
86354
|
+
var require_register = __commonJS(function(exports) {
|
|
86355
|
+
var __spreadArray = exports && exports.__spreadArray || function(to, from2, pack2) {
|
|
86356
|
+
if (pack2 || arguments.length === 2)
|
|
86357
|
+
for (var i = 0, l = from2.length, ar;i < l; i++) {
|
|
86358
|
+
if (ar || !(i in from2)) {
|
|
86359
|
+
if (!ar)
|
|
86360
|
+
ar = Array.prototype.slice.call(from2, 0, i);
|
|
86361
|
+
ar[i] = from2[i];
|
|
86362
|
+
}
|
|
86363
|
+
}
|
|
86364
|
+
return to.concat(ar || Array.prototype.slice.call(from2));
|
|
86365
|
+
};
|
|
86366
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
86367
|
+
exports.register = undefined;
|
|
86368
|
+
var match_path_sync_1 = require_match_path_sync();
|
|
86369
|
+
var config_loader_1 = require_config_loader();
|
|
86370
|
+
var noOp = function() {
|
|
86371
|
+
return;
|
|
86372
|
+
};
|
|
86373
|
+
function getCoreModules(builtinModules) {
|
|
86374
|
+
builtinModules = builtinModules || [
|
|
86375
|
+
"assert",
|
|
86376
|
+
"buffer",
|
|
86377
|
+
"child_process",
|
|
86378
|
+
"cluster",
|
|
86379
|
+
"crypto",
|
|
86380
|
+
"dgram",
|
|
86381
|
+
"dns",
|
|
86382
|
+
"domain",
|
|
86383
|
+
"events",
|
|
86384
|
+
"fs",
|
|
86385
|
+
"http",
|
|
86386
|
+
"https",
|
|
86387
|
+
"net",
|
|
86388
|
+
"os",
|
|
86389
|
+
"path",
|
|
86390
|
+
"punycode",
|
|
86391
|
+
"querystring",
|
|
86392
|
+
"readline",
|
|
86393
|
+
"stream",
|
|
86394
|
+
"string_decoder",
|
|
86395
|
+
"tls",
|
|
86396
|
+
"tty",
|
|
86397
|
+
"url",
|
|
86398
|
+
"util",
|
|
86399
|
+
"v8",
|
|
86400
|
+
"vm",
|
|
86401
|
+
"zlib"
|
|
86402
|
+
];
|
|
86403
|
+
var coreModules = {};
|
|
86404
|
+
for (var _i = 0, builtinModules_1 = builtinModules;_i < builtinModules_1.length; _i++) {
|
|
86405
|
+
var module_1 = builtinModules_1[_i];
|
|
86406
|
+
coreModules[module_1] = true;
|
|
86407
|
+
}
|
|
86408
|
+
return coreModules;
|
|
86409
|
+
}
|
|
86410
|
+
function register(params) {
|
|
86411
|
+
var cwd;
|
|
86412
|
+
var explicitParams;
|
|
86413
|
+
if (params) {
|
|
86414
|
+
cwd = params.cwd;
|
|
86415
|
+
if (params.baseUrl || params.paths) {
|
|
86416
|
+
explicitParams = params;
|
|
86417
|
+
}
|
|
86418
|
+
} else {
|
|
86419
|
+
var minimist = require_minimist();
|
|
86420
|
+
var argv = minimist(process.argv.slice(2), {
|
|
86421
|
+
string: ["project"],
|
|
86422
|
+
alias: {
|
|
86423
|
+
project: ["P"]
|
|
86424
|
+
}
|
|
86425
|
+
});
|
|
86426
|
+
cwd = argv.project;
|
|
86427
|
+
}
|
|
86428
|
+
var configLoaderResult = (0, config_loader_1.configLoader)({
|
|
86429
|
+
cwd: cwd !== null && cwd !== undefined ? cwd : process.cwd(),
|
|
86430
|
+
explicitParams
|
|
86431
|
+
});
|
|
86432
|
+
if (configLoaderResult.resultType === "failed") {
|
|
86433
|
+
console.warn("".concat(configLoaderResult.message, ". tsconfig-paths will be skipped"));
|
|
86434
|
+
return noOp;
|
|
86435
|
+
}
|
|
86436
|
+
var matchPath = (0, match_path_sync_1.createMatchPath)(configLoaderResult.absoluteBaseUrl, configLoaderResult.paths, configLoaderResult.mainFields, configLoaderResult.addMatchAll);
|
|
86437
|
+
var Module = __require("module");
|
|
86438
|
+
var originalResolveFilename = Module._resolveFilename;
|
|
86439
|
+
var coreModules = getCoreModules(Module.builtinModules);
|
|
86440
|
+
Module._resolveFilename = function(request, _parent) {
|
|
86441
|
+
var isCoreModule = coreModules.hasOwnProperty(request);
|
|
86442
|
+
if (!isCoreModule) {
|
|
86443
|
+
var found = matchPath(request);
|
|
86444
|
+
if (found) {
|
|
86445
|
+
var modifiedArguments = __spreadArray([found], [].slice.call(arguments, 1), true);
|
|
86446
|
+
return originalResolveFilename.apply(this, modifiedArguments);
|
|
86447
|
+
}
|
|
86448
|
+
}
|
|
86449
|
+
return originalResolveFilename.apply(this, arguments);
|
|
86450
|
+
};
|
|
86451
|
+
return function() {
|
|
86452
|
+
Module._resolveFilename = originalResolveFilename;
|
|
86453
|
+
};
|
|
86454
|
+
}
|
|
86455
|
+
exports.register = register;
|
|
86456
|
+
});
|
|
86457
|
+
|
|
86458
|
+
// node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/index.js
|
|
86459
|
+
var require_lib5 = __commonJS(function(exports) {
|
|
86460
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
86461
|
+
exports.loadConfig = exports.register = exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = exports.matchFromAbsolutePaths = exports.createMatchPath = undefined;
|
|
86462
|
+
var match_path_sync_1 = require_match_path_sync();
|
|
86463
|
+
Object.defineProperty(exports, "createMatchPath", { enumerable: true, get: function() {
|
|
86464
|
+
return match_path_sync_1.createMatchPath;
|
|
86465
|
+
} });
|
|
86466
|
+
Object.defineProperty(exports, "matchFromAbsolutePaths", { enumerable: true, get: function() {
|
|
86467
|
+
return match_path_sync_1.matchFromAbsolutePaths;
|
|
86468
|
+
} });
|
|
86469
|
+
var match_path_async_1 = require_match_path_async();
|
|
86470
|
+
Object.defineProperty(exports, "createMatchPathAsync", { enumerable: true, get: function() {
|
|
86471
|
+
return match_path_async_1.createMatchPathAsync;
|
|
86472
|
+
} });
|
|
86473
|
+
Object.defineProperty(exports, "matchFromAbsolutePathsAsync", { enumerable: true, get: function() {
|
|
86474
|
+
return match_path_async_1.matchFromAbsolutePathsAsync;
|
|
86475
|
+
} });
|
|
86476
|
+
var register_1 = require_register();
|
|
86477
|
+
Object.defineProperty(exports, "register", { enumerable: true, get: function() {
|
|
86478
|
+
return register_1.register;
|
|
86479
|
+
} });
|
|
86480
|
+
var config_loader_1 = require_config_loader();
|
|
86481
|
+
Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function() {
|
|
86482
|
+
return config_loader_1.loadConfig;
|
|
86483
|
+
} });
|
|
86484
|
+
});
|
|
86485
|
+
|
|
84466
86486
|
// src/ui/project.ts
|
|
84467
86487
|
import { access as access2, lstat, readFile as readFile17, realpath as realpath2 } from "node:fs/promises";
|
|
84468
86488
|
import path5 from "node:path";
|
|
@@ -84478,6 +86498,87 @@ async function readManifest(target2) {
|
|
|
84478
86498
|
});
|
|
84479
86499
|
}
|
|
84480
86500
|
}
|
|
86501
|
+
function pathPatternMatch(pattern2, candidate2) {
|
|
86502
|
+
const wildcard = pattern2.indexOf("*");
|
|
86503
|
+
if (wildcard === -1)
|
|
86504
|
+
return pattern2 === candidate2 ? "" : undefined;
|
|
86505
|
+
const prefix = pattern2.slice(0, wildcard);
|
|
86506
|
+
const suffix = pattern2.slice(wildcard + 1);
|
|
86507
|
+
if (!candidate2.startsWith(prefix) || !candidate2.endsWith(suffix))
|
|
86508
|
+
return;
|
|
86509
|
+
return candidate2.slice(prefix.length, candidate2.length - suffix.length);
|
|
86510
|
+
}
|
|
86511
|
+
function resolvePackageImport(project2, candidate2) {
|
|
86512
|
+
const imports = project2.packageJson.imports;
|
|
86513
|
+
if (!imports || typeof imports !== "object" || Array.isArray(imports))
|
|
86514
|
+
return;
|
|
86515
|
+
const matches3 = Object.entries(imports).flatMap(([pattern2, target2]) => {
|
|
86516
|
+
const wildcard = pathPatternMatch(pattern2, candidate2);
|
|
86517
|
+
if (wildcard === undefined || typeof target2 !== "string" || !target2.startsWith("./"))
|
|
86518
|
+
return [];
|
|
86519
|
+
const wildcardIndex = pattern2.indexOf("*");
|
|
86520
|
+
return [
|
|
86521
|
+
{
|
|
86522
|
+
exact: wildcardIndex === -1,
|
|
86523
|
+
prefixLength: wildcardIndex === -1 ? pattern2.length : wildcardIndex,
|
|
86524
|
+
suffixLength: wildcardIndex === -1 ? 0 : pattern2.length - wildcardIndex - 1,
|
|
86525
|
+
target: target2.replaceAll("*", wildcard)
|
|
86526
|
+
}
|
|
86527
|
+
];
|
|
86528
|
+
}).sort((left, right) => Number(right.exact) - Number(left.exact) || right.prefixLength - left.prefixLength || right.suffixLength - left.suffixLength);
|
|
86529
|
+
return matches3[0] ? path5.resolve(project2.root, matches3[0].target) : undefined;
|
|
86530
|
+
}
|
|
86531
|
+
async function resolveAlias(project2, candidate2) {
|
|
86532
|
+
const config2 = import_tsconfig_paths.loadConfig(project2.root);
|
|
86533
|
+
if (config2.resultType === "failed")
|
|
86534
|
+
return;
|
|
86535
|
+
const matches3 = [];
|
|
86536
|
+
for (const [pattern2, replacements2] of Object.entries(config2.paths)) {
|
|
86537
|
+
const wildcard = pathPatternMatch(pattern2, candidate2);
|
|
86538
|
+
if (wildcard === undefined)
|
|
86539
|
+
continue;
|
|
86540
|
+
const replacement = replacements2?.[0];
|
|
86541
|
+
if (!replacement)
|
|
86542
|
+
continue;
|
|
86543
|
+
const wildcardIndex = pattern2.indexOf("*");
|
|
86544
|
+
matches3.push({
|
|
86545
|
+
exact: wildcardIndex === -1,
|
|
86546
|
+
prefixLength: wildcardIndex === -1 ? pattern2.length : wildcardIndex,
|
|
86547
|
+
suffixLength: wildcardIndex === -1 ? 0 : pattern2.length - wildcardIndex - 1,
|
|
86548
|
+
resolved: path5.resolve(config2.absoluteBaseUrl, replacement.replaceAll("*", wildcard))
|
|
86549
|
+
});
|
|
86550
|
+
}
|
|
86551
|
+
matches3.sort((left, right) => Number(right.exact) - Number(left.exact) || right.prefixLength - left.prefixLength || right.suffixLength - left.suffixLength);
|
|
86552
|
+
const best = matches3[0];
|
|
86553
|
+
if (!best)
|
|
86554
|
+
return;
|
|
86555
|
+
const ambiguous = matches3.some((match) => match.exact === best.exact && match.prefixLength === best.prefixLength && match.suffixLength === best.suffixLength && match.resolved !== best.resolved);
|
|
86556
|
+
if (ambiguous) {
|
|
86557
|
+
throw new UiError("UI_PROJECT_UNSUPPORTED", "The components alias resolves to conflicting project paths.", "Keep one authoritative compilerOptions.paths mapping for the components alias.");
|
|
86558
|
+
}
|
|
86559
|
+
return best.resolved;
|
|
86560
|
+
}
|
|
86561
|
+
async function resolveUiRegistryTarget(project2, declaredTarget) {
|
|
86562
|
+
if (!declaredTarget.startsWith("components/"))
|
|
86563
|
+
return declaredTarget;
|
|
86564
|
+
const components = await readFile17(project2.componentsPath, "utf8").then((value3) => JSON.parse(value3)).catch(() => {
|
|
86565
|
+
return;
|
|
86566
|
+
});
|
|
86567
|
+
const componentsAlias = components?.aliases?.components;
|
|
86568
|
+
if (typeof componentsAlias !== "string" || componentsAlias.length === 0)
|
|
86569
|
+
return declaredTarget;
|
|
86570
|
+
const suffix = declaredTarget.slice("components/".length);
|
|
86571
|
+
const directAlias = /^(?:\.?\.?\/|src\/|app\/|frontend\/|components\/)/u.test(componentsAlias);
|
|
86572
|
+
const resolved = resolvePackageImport(project2, componentsAlias) ?? await resolveAlias(project2, componentsAlias) ?? (directAlias ? path5.resolve(project2.root, componentsAlias) : undefined);
|
|
86573
|
+
if (!resolved) {
|
|
86574
|
+
throw new UiError("UI_PROJECT_UNSUPPORTED", "components.json alias cannot be resolved through tsconfig.json or jsconfig.json.", "Define a matching compilerOptions.paths entry for " + componentsAlias + ".");
|
|
86575
|
+
}
|
|
86576
|
+
const relative = path5.relative(project2.root, path5.join(resolved, suffix));
|
|
86577
|
+
if (relative === ".." || relative.startsWith(".." + path5.sep) || path5.isAbsolute(relative)) {
|
|
86578
|
+
throw new UiError("UI_PROJECT_UNSUPPORTED", "components.json alias escapes the project.");
|
|
86579
|
+
}
|
|
86580
|
+
return relative.split(path5.sep).join("/");
|
|
86581
|
+
}
|
|
84481
86582
|
function hasReactTailwind(manifest) {
|
|
84482
86583
|
const dependencies = {
|
|
84483
86584
|
...manifest.dependencies,
|
|
@@ -84617,9 +86718,10 @@ function projectRelative(project2, target2) {
|
|
|
84617
86718
|
}
|
|
84618
86719
|
return relative.split(path5.sep).join("/");
|
|
84619
86720
|
}
|
|
84620
|
-
var MANAGERS;
|
|
86721
|
+
var import_tsconfig_paths, MANAGERS;
|
|
84621
86722
|
var init_project3 = __esm(() => {
|
|
84622
86723
|
init_model7();
|
|
86724
|
+
import_tsconfig_paths = __toESM(require_lib5(), 1);
|
|
84623
86725
|
MANAGERS = [
|
|
84624
86726
|
["pnpm-lock.yaml", "pnpm"],
|
|
84625
86727
|
["bun.lock", "bun"],
|
|
@@ -85277,7 +87379,9 @@ async function addUi(addresses, options, dependencies = {}) {
|
|
|
85277
87379
|
return addReleasedTheme(themes[0], itemDocuments[0], project2, options);
|
|
85278
87380
|
}
|
|
85279
87381
|
await rejectLocalChanges(project2, lock, items, options.overwrite === true);
|
|
85280
|
-
const
|
|
87382
|
+
const declaredTargets = items.flatMap((item) => item.files.flatMap((file2) => file2.target ? [file2.target] : []));
|
|
87383
|
+
const resolvedTargets = new Map(await Promise.all(declaredTargets.map(async (target2) => [target2, await resolveUiRegistryTarget(project2, target2)])));
|
|
87384
|
+
const targets = (await Promise.all([...resolvedTargets.values()].map((target2) => assertSafePlannedTarget(project2, target2)))).filter((target2, index3, all) => all.indexOf(target2) === index3);
|
|
85281
87385
|
const invocation3 = shadcnInvocation(project2.manager, release.compatibility.shadcn, [
|
|
85282
87386
|
"add",
|
|
85283
87387
|
...items.map((item) => registryItemUrl(release, item.name)),
|
|
@@ -85336,7 +87440,7 @@ async function addUi(addresses, options, dependencies = {}) {
|
|
|
85336
87440
|
sources: itemDocuments.map((item) => ({
|
|
85337
87441
|
address: item.meta.canonicalAddress,
|
|
85338
87442
|
dependencies: item.dependencies ?? [],
|
|
85339
|
-
files: item.files.map((file2) => file2.target).filter(Boolean)
|
|
87443
|
+
files: item.files.map((file2) => file2.target ? resolvedTargets.get(file2.target) : undefined).filter(Boolean)
|
|
85340
87444
|
})),
|
|
85341
87445
|
command: [invocation3.file, ...invocation3.args],
|
|
85342
87446
|
output: result.stdout,
|
|
@@ -85353,7 +87457,7 @@ async function addUi(addresses, options, dependencies = {}) {
|
|
|
85353
87457
|
for (const file2 of item.files) {
|
|
85354
87458
|
if (!file2.target)
|
|
85355
87459
|
continue;
|
|
85356
|
-
const target2 = await safeTarget(project2, file2.target);
|
|
87460
|
+
const target2 = await safeTarget(project2, resolvedTargets.get(file2.target));
|
|
85357
87461
|
files[projectRelative(project2, target2)] = digest5(await readFile18(target2));
|
|
85358
87462
|
}
|
|
85359
87463
|
lock.items[item.meta.canonicalAddress] = {
|