@eclipse-glsp/cli 2.8.0-next.12 → 2.8.0-next.16
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/README.md +0 -19
- package/dist/cli.js +416 -471
- package/dist/cli.js.map +3 -3
- package/package.json +7 -6
package/dist/cli.js
CHANGED
|
@@ -1205,8 +1205,8 @@ var require_command = __commonJS({
|
|
|
1205
1205
|
"../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/command.js"(exports2) {
|
|
1206
1206
|
var EventEmitter = require("node:events").EventEmitter;
|
|
1207
1207
|
var childProcess4 = require("node:child_process");
|
|
1208
|
-
var
|
|
1209
|
-
var
|
|
1208
|
+
var path29 = require("node:path");
|
|
1209
|
+
var fs21 = require("node:fs");
|
|
1210
1210
|
var process11 = require("node:process");
|
|
1211
1211
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
1212
1212
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -2200,7 +2200,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2200
2200
|
* @param {string} subcommandName
|
|
2201
2201
|
*/
|
|
2202
2202
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
2203
|
-
if (
|
|
2203
|
+
if (fs21.existsSync(executableFile)) return;
|
|
2204
2204
|
const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
2205
2205
|
const executableMissing = `'${executableFile}' does not exist
|
|
2206
2206
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
@@ -2218,11 +2218,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2218
2218
|
let launchWithNode = false;
|
|
2219
2219
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
2220
2220
|
function findFile(baseDir, baseName) {
|
|
2221
|
-
const localBin =
|
|
2222
|
-
if (
|
|
2223
|
-
if (sourceExt.includes(
|
|
2221
|
+
const localBin = path29.resolve(baseDir, baseName);
|
|
2222
|
+
if (fs21.existsSync(localBin)) return localBin;
|
|
2223
|
+
if (sourceExt.includes(path29.extname(baseName))) return void 0;
|
|
2224
2224
|
const foundExt = sourceExt.find(
|
|
2225
|
-
(ext2) =>
|
|
2225
|
+
(ext2) => fs21.existsSync(`${localBin}${ext2}`)
|
|
2226
2226
|
);
|
|
2227
2227
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
2228
2228
|
return void 0;
|
|
@@ -2234,21 +2234,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2234
2234
|
if (this._scriptPath) {
|
|
2235
2235
|
let resolvedScriptPath;
|
|
2236
2236
|
try {
|
|
2237
|
-
resolvedScriptPath =
|
|
2237
|
+
resolvedScriptPath = fs21.realpathSync(this._scriptPath);
|
|
2238
2238
|
} catch {
|
|
2239
2239
|
resolvedScriptPath = this._scriptPath;
|
|
2240
2240
|
}
|
|
2241
|
-
executableDir =
|
|
2242
|
-
|
|
2241
|
+
executableDir = path29.resolve(
|
|
2242
|
+
path29.dirname(resolvedScriptPath),
|
|
2243
2243
|
executableDir
|
|
2244
2244
|
);
|
|
2245
2245
|
}
|
|
2246
2246
|
if (executableDir) {
|
|
2247
2247
|
let localFile = findFile(executableDir, executableFile);
|
|
2248
2248
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
2249
|
-
const legacyName =
|
|
2249
|
+
const legacyName = path29.basename(
|
|
2250
2250
|
this._scriptPath,
|
|
2251
|
-
|
|
2251
|
+
path29.extname(this._scriptPath)
|
|
2252
2252
|
);
|
|
2253
2253
|
if (legacyName !== this._name) {
|
|
2254
2254
|
localFile = findFile(
|
|
@@ -2259,7 +2259,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2259
2259
|
}
|
|
2260
2260
|
executableFile = localFile || executableFile;
|
|
2261
2261
|
}
|
|
2262
|
-
launchWithNode = sourceExt.includes(
|
|
2262
|
+
launchWithNode = sourceExt.includes(path29.extname(executableFile));
|
|
2263
2263
|
let proc;
|
|
2264
2264
|
if (process11.platform !== "win32") {
|
|
2265
2265
|
if (launchWithNode) {
|
|
@@ -3174,7 +3174,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3174
3174
|
* @return {Command}
|
|
3175
3175
|
*/
|
|
3176
3176
|
nameFromFilename(filename) {
|
|
3177
|
-
this._name =
|
|
3177
|
+
this._name = path29.basename(filename, path29.extname(filename));
|
|
3178
3178
|
return this;
|
|
3179
3179
|
}
|
|
3180
3180
|
/**
|
|
@@ -3188,9 +3188,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3188
3188
|
* @param {string} [path]
|
|
3189
3189
|
* @return {(string|null|Command)}
|
|
3190
3190
|
*/
|
|
3191
|
-
executableDir(
|
|
3192
|
-
if (
|
|
3193
|
-
this._executableDir =
|
|
3191
|
+
executableDir(path30) {
|
|
3192
|
+
if (path30 === void 0) return this._executableDir;
|
|
3193
|
+
this._executableDir = path30;
|
|
3194
3194
|
return this;
|
|
3195
3195
|
}
|
|
3196
3196
|
/**
|
|
@@ -3762,7 +3762,7 @@ var require_path = __commonJS({
|
|
|
3762
3762
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
3763
3763
|
exports2.convertPosixPathToPattern = exports2.convertWindowsPathToPattern = exports2.convertPathToPattern = exports2.escapePosixPath = exports2.escapeWindowsPath = exports2.escape = exports2.removeLeadingDotSegment = exports2.makeAbsolute = exports2.unixify = void 0;
|
|
3764
3764
|
var os5 = require("os");
|
|
3765
|
-
var
|
|
3765
|
+
var path29 = require("path");
|
|
3766
3766
|
var IS_WINDOWS_PLATFORM = os5.platform() === "win32";
|
|
3767
3767
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
3768
3768
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
|
@@ -3774,7 +3774,7 @@ var require_path = __commonJS({
|
|
|
3774
3774
|
}
|
|
3775
3775
|
exports2.unixify = unixify;
|
|
3776
3776
|
function makeAbsolute(cwd, filepath) {
|
|
3777
|
-
return
|
|
3777
|
+
return path29.resolve(cwd, filepath);
|
|
3778
3778
|
}
|
|
3779
3779
|
exports2.makeAbsolute = makeAbsolute;
|
|
3780
3780
|
function removeLeadingDotSegment(entry) {
|
|
@@ -5071,7 +5071,7 @@ var require_braces = __commonJS({
|
|
|
5071
5071
|
var require_constants2 = __commonJS({
|
|
5072
5072
|
"../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js"(exports2, module2) {
|
|
5073
5073
|
"use strict";
|
|
5074
|
-
var
|
|
5074
|
+
var path29 = require("path");
|
|
5075
5075
|
var WIN_SLASH = "\\\\/";
|
|
5076
5076
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
5077
5077
|
var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
@@ -5245,7 +5245,7 @@ var require_constants2 = __commonJS({
|
|
|
5245
5245
|
/* | */
|
|
5246
5246
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
5247
5247
|
/* \uFEFF */
|
|
5248
|
-
SEP:
|
|
5248
|
+
SEP: path29.sep,
|
|
5249
5249
|
/**
|
|
5250
5250
|
* Create EXTGLOB_CHARS
|
|
5251
5251
|
*/
|
|
@@ -5272,7 +5272,7 @@ var require_constants2 = __commonJS({
|
|
|
5272
5272
|
var require_utils2 = __commonJS({
|
|
5273
5273
|
"../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js"(exports2) {
|
|
5274
5274
|
"use strict";
|
|
5275
|
-
var
|
|
5275
|
+
var path29 = require("path");
|
|
5276
5276
|
var win32 = process.platform === "win32";
|
|
5277
5277
|
var {
|
|
5278
5278
|
REGEX_BACKSLASH,
|
|
@@ -5301,7 +5301,7 @@ var require_utils2 = __commonJS({
|
|
|
5301
5301
|
if (options && typeof options.windows === "boolean") {
|
|
5302
5302
|
return options.windows;
|
|
5303
5303
|
}
|
|
5304
|
-
return win32 === true ||
|
|
5304
|
+
return win32 === true || path29.sep === "\\";
|
|
5305
5305
|
};
|
|
5306
5306
|
exports2.escapeLast = (input, char, lastIdx) => {
|
|
5307
5307
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
@@ -6665,7 +6665,7 @@ var require_parse2 = __commonJS({
|
|
|
6665
6665
|
var require_picomatch = __commonJS({
|
|
6666
6666
|
"../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
|
|
6667
6667
|
"use strict";
|
|
6668
|
-
var
|
|
6668
|
+
var path29 = require("path");
|
|
6669
6669
|
var scan = require_scan();
|
|
6670
6670
|
var parse3 = require_parse2();
|
|
6671
6671
|
var utils = require_utils2();
|
|
@@ -6750,7 +6750,7 @@ var require_picomatch = __commonJS({
|
|
|
6750
6750
|
};
|
|
6751
6751
|
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
6752
6752
|
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
6753
|
-
return regex.test(
|
|
6753
|
+
return regex.test(path29.basename(input));
|
|
6754
6754
|
};
|
|
6755
6755
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
6756
6756
|
picomatch.parse = (pattern, options) => {
|
|
@@ -6977,7 +6977,7 @@ var require_pattern = __commonJS({
|
|
|
6977
6977
|
"use strict";
|
|
6978
6978
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
6979
6979
|
exports2.isAbsolute = exports2.partitionAbsoluteAndRelative = exports2.removeDuplicateSlashes = exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;
|
|
6980
|
-
var
|
|
6980
|
+
var path29 = require("path");
|
|
6981
6981
|
var globParent = require_glob_parent();
|
|
6982
6982
|
var micromatch = require_micromatch();
|
|
6983
6983
|
var GLOBSTAR2 = "**";
|
|
@@ -7072,7 +7072,7 @@ var require_pattern = __commonJS({
|
|
|
7072
7072
|
}
|
|
7073
7073
|
exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
7074
7074
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
7075
|
-
const basename4 =
|
|
7075
|
+
const basename4 = path29.basename(pattern);
|
|
7076
7076
|
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename4);
|
|
7077
7077
|
}
|
|
7078
7078
|
exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
@@ -7118,19 +7118,19 @@ var require_pattern = __commonJS({
|
|
|
7118
7118
|
exports2.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
7119
7119
|
function partitionAbsoluteAndRelative(patterns) {
|
|
7120
7120
|
const absolute = [];
|
|
7121
|
-
const
|
|
7121
|
+
const relative4 = [];
|
|
7122
7122
|
for (const pattern of patterns) {
|
|
7123
7123
|
if (isAbsolute(pattern)) {
|
|
7124
7124
|
absolute.push(pattern);
|
|
7125
7125
|
} else {
|
|
7126
|
-
|
|
7126
|
+
relative4.push(pattern);
|
|
7127
7127
|
}
|
|
7128
7128
|
}
|
|
7129
|
-
return [absolute,
|
|
7129
|
+
return [absolute, relative4];
|
|
7130
7130
|
}
|
|
7131
7131
|
exports2.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
7132
7132
|
function isAbsolute(pattern) {
|
|
7133
|
-
return
|
|
7133
|
+
return path29.isAbsolute(pattern);
|
|
7134
7134
|
}
|
|
7135
7135
|
exports2.isAbsolute = isAbsolute;
|
|
7136
7136
|
}
|
|
@@ -7305,10 +7305,10 @@ var require_utils3 = __commonJS({
|
|
|
7305
7305
|
exports2.array = array;
|
|
7306
7306
|
var errno = require_errno();
|
|
7307
7307
|
exports2.errno = errno;
|
|
7308
|
-
var
|
|
7309
|
-
exports2.fs =
|
|
7310
|
-
var
|
|
7311
|
-
exports2.path =
|
|
7308
|
+
var fs21 = require_fs();
|
|
7309
|
+
exports2.fs = fs21;
|
|
7310
|
+
var path29 = require_path();
|
|
7311
|
+
exports2.path = path29;
|
|
7312
7312
|
var pattern = require_pattern();
|
|
7313
7313
|
exports2.pattern = pattern;
|
|
7314
7314
|
var stream = require_stream();
|
|
@@ -7420,8 +7420,8 @@ var require_async = __commonJS({
|
|
|
7420
7420
|
"use strict";
|
|
7421
7421
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7422
7422
|
exports2.read = void 0;
|
|
7423
|
-
function read(
|
|
7424
|
-
settings.fs.lstat(
|
|
7423
|
+
function read(path29, settings, callback) {
|
|
7424
|
+
settings.fs.lstat(path29, (lstatError, lstat) => {
|
|
7425
7425
|
if (lstatError !== null) {
|
|
7426
7426
|
callFailureCallback(callback, lstatError);
|
|
7427
7427
|
return;
|
|
@@ -7430,7 +7430,7 @@ var require_async = __commonJS({
|
|
|
7430
7430
|
callSuccessCallback(callback, lstat);
|
|
7431
7431
|
return;
|
|
7432
7432
|
}
|
|
7433
|
-
settings.fs.stat(
|
|
7433
|
+
settings.fs.stat(path29, (statError, stat) => {
|
|
7434
7434
|
if (statError !== null) {
|
|
7435
7435
|
if (settings.throwErrorOnBrokenSymbolicLink) {
|
|
7436
7436
|
callFailureCallback(callback, statError);
|
|
@@ -7462,13 +7462,13 @@ var require_sync = __commonJS({
|
|
|
7462
7462
|
"use strict";
|
|
7463
7463
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7464
7464
|
exports2.read = void 0;
|
|
7465
|
-
function read(
|
|
7466
|
-
const lstat = settings.fs.lstatSync(
|
|
7465
|
+
function read(path29, settings) {
|
|
7466
|
+
const lstat = settings.fs.lstatSync(path29);
|
|
7467
7467
|
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
|
7468
7468
|
return lstat;
|
|
7469
7469
|
}
|
|
7470
7470
|
try {
|
|
7471
|
-
const stat = settings.fs.statSync(
|
|
7471
|
+
const stat = settings.fs.statSync(path29);
|
|
7472
7472
|
if (settings.markSymbolicLink) {
|
|
7473
7473
|
stat.isSymbolicLink = () => true;
|
|
7474
7474
|
}
|
|
@@ -7490,12 +7490,12 @@ var require_fs2 = __commonJS({
|
|
|
7490
7490
|
"use strict";
|
|
7491
7491
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7492
7492
|
exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
|
7493
|
-
var
|
|
7493
|
+
var fs21 = require("fs");
|
|
7494
7494
|
exports2.FILE_SYSTEM_ADAPTER = {
|
|
7495
|
-
lstat:
|
|
7496
|
-
stat:
|
|
7497
|
-
lstatSync:
|
|
7498
|
-
statSync:
|
|
7495
|
+
lstat: fs21.lstat,
|
|
7496
|
+
stat: fs21.stat,
|
|
7497
|
+
lstatSync: fs21.lstatSync,
|
|
7498
|
+
statSync: fs21.statSync
|
|
7499
7499
|
};
|
|
7500
7500
|
function createFileSystemAdapter(fsMethods) {
|
|
7501
7501
|
if (fsMethods === void 0) {
|
|
@@ -7512,12 +7512,12 @@ var require_settings = __commonJS({
|
|
|
7512
7512
|
"../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
|
|
7513
7513
|
"use strict";
|
|
7514
7514
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7515
|
-
var
|
|
7515
|
+
var fs21 = require_fs2();
|
|
7516
7516
|
var Settings = class {
|
|
7517
7517
|
constructor(_options = {}) {
|
|
7518
7518
|
this._options = _options;
|
|
7519
7519
|
this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
|
|
7520
|
-
this.fs =
|
|
7520
|
+
this.fs = fs21.createFileSystemAdapter(this._options.fs);
|
|
7521
7521
|
this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
|
|
7522
7522
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
7523
7523
|
}
|
|
@@ -7539,17 +7539,17 @@ var require_out = __commonJS({
|
|
|
7539
7539
|
var sync = require_sync();
|
|
7540
7540
|
var settings_1 = require_settings();
|
|
7541
7541
|
exports2.Settings = settings_1.default;
|
|
7542
|
-
function stat(
|
|
7542
|
+
function stat(path29, optionsOrSettingsOrCallback, callback) {
|
|
7543
7543
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
7544
|
-
async.read(
|
|
7544
|
+
async.read(path29, getSettings(), optionsOrSettingsOrCallback);
|
|
7545
7545
|
return;
|
|
7546
7546
|
}
|
|
7547
|
-
async.read(
|
|
7547
|
+
async.read(path29, getSettings(optionsOrSettingsOrCallback), callback);
|
|
7548
7548
|
}
|
|
7549
7549
|
exports2.stat = stat;
|
|
7550
|
-
function statSync4(
|
|
7550
|
+
function statSync4(path29, optionsOrSettings) {
|
|
7551
7551
|
const settings = getSettings(optionsOrSettings);
|
|
7552
|
-
return sync.read(
|
|
7552
|
+
return sync.read(path29, settings);
|
|
7553
7553
|
}
|
|
7554
7554
|
exports2.statSync = statSync4;
|
|
7555
7555
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -7672,8 +7672,8 @@ var require_utils4 = __commonJS({
|
|
|
7672
7672
|
"use strict";
|
|
7673
7673
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7674
7674
|
exports2.fs = void 0;
|
|
7675
|
-
var
|
|
7676
|
-
exports2.fs =
|
|
7675
|
+
var fs21 = require_fs3();
|
|
7676
|
+
exports2.fs = fs21;
|
|
7677
7677
|
}
|
|
7678
7678
|
});
|
|
7679
7679
|
|
|
@@ -7765,16 +7765,16 @@ var require_async2 = __commonJS({
|
|
|
7765
7765
|
return;
|
|
7766
7766
|
}
|
|
7767
7767
|
const tasks = names.map((name) => {
|
|
7768
|
-
const
|
|
7768
|
+
const path29 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
|
7769
7769
|
return (done) => {
|
|
7770
|
-
fsStat.stat(
|
|
7770
|
+
fsStat.stat(path29, settings.fsStatSettings, (error, stats) => {
|
|
7771
7771
|
if (error !== null) {
|
|
7772
7772
|
done(error);
|
|
7773
7773
|
return;
|
|
7774
7774
|
}
|
|
7775
7775
|
const entry = {
|
|
7776
7776
|
name,
|
|
7777
|
-
path:
|
|
7777
|
+
path: path29,
|
|
7778
7778
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
7779
7779
|
};
|
|
7780
7780
|
if (settings.stats) {
|
|
@@ -7868,14 +7868,14 @@ var require_fs4 = __commonJS({
|
|
|
7868
7868
|
"use strict";
|
|
7869
7869
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7870
7870
|
exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
|
7871
|
-
var
|
|
7871
|
+
var fs21 = require("fs");
|
|
7872
7872
|
exports2.FILE_SYSTEM_ADAPTER = {
|
|
7873
|
-
lstat:
|
|
7874
|
-
stat:
|
|
7875
|
-
lstatSync:
|
|
7876
|
-
statSync:
|
|
7877
|
-
readdir:
|
|
7878
|
-
readdirSync:
|
|
7873
|
+
lstat: fs21.lstat,
|
|
7874
|
+
stat: fs21.stat,
|
|
7875
|
+
lstatSync: fs21.lstatSync,
|
|
7876
|
+
statSync: fs21.statSync,
|
|
7877
|
+
readdir: fs21.readdir,
|
|
7878
|
+
readdirSync: fs21.readdirSync
|
|
7879
7879
|
};
|
|
7880
7880
|
function createFileSystemAdapter(fsMethods) {
|
|
7881
7881
|
if (fsMethods === void 0) {
|
|
@@ -7892,15 +7892,15 @@ var require_settings2 = __commonJS({
|
|
|
7892
7892
|
"../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
|
|
7893
7893
|
"use strict";
|
|
7894
7894
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7895
|
-
var
|
|
7895
|
+
var path29 = require("path");
|
|
7896
7896
|
var fsStat = require_out();
|
|
7897
|
-
var
|
|
7897
|
+
var fs21 = require_fs4();
|
|
7898
7898
|
var Settings = class {
|
|
7899
7899
|
constructor(_options = {}) {
|
|
7900
7900
|
this._options = _options;
|
|
7901
7901
|
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
|
7902
|
-
this.fs =
|
|
7903
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
|
7902
|
+
this.fs = fs21.createFileSystemAdapter(this._options.fs);
|
|
7903
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path29.sep);
|
|
7904
7904
|
this.stats = this._getValue(this._options.stats, false);
|
|
7905
7905
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
7906
7906
|
this.fsStatSettings = new fsStat.Settings({
|
|
@@ -7927,17 +7927,17 @@ var require_out2 = __commonJS({
|
|
|
7927
7927
|
var sync = require_sync2();
|
|
7928
7928
|
var settings_1 = require_settings2();
|
|
7929
7929
|
exports2.Settings = settings_1.default;
|
|
7930
|
-
function scandir(
|
|
7930
|
+
function scandir(path29, optionsOrSettingsOrCallback, callback) {
|
|
7931
7931
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
7932
|
-
async.read(
|
|
7932
|
+
async.read(path29, getSettings(), optionsOrSettingsOrCallback);
|
|
7933
7933
|
return;
|
|
7934
7934
|
}
|
|
7935
|
-
async.read(
|
|
7935
|
+
async.read(path29, getSettings(optionsOrSettingsOrCallback), callback);
|
|
7936
7936
|
}
|
|
7937
7937
|
exports2.scandir = scandir;
|
|
7938
|
-
function scandirSync(
|
|
7938
|
+
function scandirSync(path29, optionsOrSettings) {
|
|
7939
7939
|
const settings = getSettings(optionsOrSettings);
|
|
7940
|
-
return sync.read(
|
|
7940
|
+
return sync.read(path29, settings);
|
|
7941
7941
|
}
|
|
7942
7942
|
exports2.scandirSync = scandirSync;
|
|
7943
7943
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -8216,41 +8216,41 @@ var require_queue = __commonJS({
|
|
|
8216
8216
|
queue.drained = drained;
|
|
8217
8217
|
return queue;
|
|
8218
8218
|
function push(value) {
|
|
8219
|
-
var p = new Promise(function(
|
|
8219
|
+
var p = new Promise(function(resolve26, reject) {
|
|
8220
8220
|
pushCb(value, function(err, result) {
|
|
8221
8221
|
if (err) {
|
|
8222
8222
|
reject(err);
|
|
8223
8223
|
return;
|
|
8224
8224
|
}
|
|
8225
|
-
|
|
8225
|
+
resolve26(result);
|
|
8226
8226
|
});
|
|
8227
8227
|
});
|
|
8228
8228
|
p.catch(noop2);
|
|
8229
8229
|
return p;
|
|
8230
8230
|
}
|
|
8231
8231
|
function unshift(value) {
|
|
8232
|
-
var p = new Promise(function(
|
|
8232
|
+
var p = new Promise(function(resolve26, reject) {
|
|
8233
8233
|
unshiftCb(value, function(err, result) {
|
|
8234
8234
|
if (err) {
|
|
8235
8235
|
reject(err);
|
|
8236
8236
|
return;
|
|
8237
8237
|
}
|
|
8238
|
-
|
|
8238
|
+
resolve26(result);
|
|
8239
8239
|
});
|
|
8240
8240
|
});
|
|
8241
8241
|
p.catch(noop2);
|
|
8242
8242
|
return p;
|
|
8243
8243
|
}
|
|
8244
8244
|
function drained() {
|
|
8245
|
-
var p = new Promise(function(
|
|
8245
|
+
var p = new Promise(function(resolve26) {
|
|
8246
8246
|
process.nextTick(function() {
|
|
8247
8247
|
if (queue.idle()) {
|
|
8248
|
-
|
|
8248
|
+
resolve26();
|
|
8249
8249
|
} else {
|
|
8250
8250
|
var previousDrain = queue.drain;
|
|
8251
8251
|
queue.drain = function() {
|
|
8252
8252
|
if (typeof previousDrain === "function") previousDrain();
|
|
8253
|
-
|
|
8253
|
+
resolve26();
|
|
8254
8254
|
queue.drain = previousDrain;
|
|
8255
8255
|
};
|
|
8256
8256
|
}
|
|
@@ -8584,7 +8584,7 @@ var require_settings3 = __commonJS({
|
|
|
8584
8584
|
"../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
|
|
8585
8585
|
"use strict";
|
|
8586
8586
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8587
|
-
var
|
|
8587
|
+
var path29 = require("path");
|
|
8588
8588
|
var fsScandir = require_out2();
|
|
8589
8589
|
var Settings = class {
|
|
8590
8590
|
constructor(_options = {}) {
|
|
@@ -8594,7 +8594,7 @@ var require_settings3 = __commonJS({
|
|
|
8594
8594
|
this.deepFilter = this._getValue(this._options.deepFilter, null);
|
|
8595
8595
|
this.entryFilter = this._getValue(this._options.entryFilter, null);
|
|
8596
8596
|
this.errorFilter = this._getValue(this._options.errorFilter, null);
|
|
8597
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
|
8597
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path29.sep);
|
|
8598
8598
|
this.fsScandirSettings = new fsScandir.Settings({
|
|
8599
8599
|
followSymbolicLinks: this._options.followSymbolicLinks,
|
|
8600
8600
|
fs: this._options.fs,
|
|
@@ -8656,7 +8656,7 @@ var require_reader2 = __commonJS({
|
|
|
8656
8656
|
"../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js"(exports2) {
|
|
8657
8657
|
"use strict";
|
|
8658
8658
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8659
|
-
var
|
|
8659
|
+
var path29 = require("path");
|
|
8660
8660
|
var fsStat = require_out();
|
|
8661
8661
|
var utils = require_utils3();
|
|
8662
8662
|
var Reader = class {
|
|
@@ -8669,7 +8669,7 @@ var require_reader2 = __commonJS({
|
|
|
8669
8669
|
});
|
|
8670
8670
|
}
|
|
8671
8671
|
_getFullEntryPath(filepath) {
|
|
8672
|
-
return
|
|
8672
|
+
return path29.resolve(this._settings.cwd, filepath);
|
|
8673
8673
|
}
|
|
8674
8674
|
_makeEntry(stats, pattern) {
|
|
8675
8675
|
const entry = {
|
|
@@ -8736,9 +8736,9 @@ var require_stream3 = __commonJS({
|
|
|
8736
8736
|
});
|
|
8737
8737
|
}
|
|
8738
8738
|
_getStat(filepath) {
|
|
8739
|
-
return new Promise((
|
|
8739
|
+
return new Promise((resolve26, reject) => {
|
|
8740
8740
|
this._stat(filepath, this._fsStatSettings, (error, stats) => {
|
|
8741
|
-
return error === null ?
|
|
8741
|
+
return error === null ? resolve26(stats) : reject(error);
|
|
8742
8742
|
});
|
|
8743
8743
|
});
|
|
8744
8744
|
}
|
|
@@ -8762,10 +8762,10 @@ var require_async5 = __commonJS({
|
|
|
8762
8762
|
this._readerStream = new stream_1.default(this._settings);
|
|
8763
8763
|
}
|
|
8764
8764
|
dynamic(root, options) {
|
|
8765
|
-
return new Promise((
|
|
8765
|
+
return new Promise((resolve26, reject) => {
|
|
8766
8766
|
this._walkAsync(root, options, (error, entries) => {
|
|
8767
8767
|
if (error === null) {
|
|
8768
|
-
|
|
8768
|
+
resolve26(entries);
|
|
8769
8769
|
} else {
|
|
8770
8770
|
reject(error);
|
|
8771
8771
|
}
|
|
@@ -8775,10 +8775,10 @@ var require_async5 = __commonJS({
|
|
|
8775
8775
|
async static(patterns, options) {
|
|
8776
8776
|
const entries = [];
|
|
8777
8777
|
const stream = this._readerStream.static(patterns, options);
|
|
8778
|
-
return new Promise((
|
|
8778
|
+
return new Promise((resolve26, reject) => {
|
|
8779
8779
|
stream.once("error", reject);
|
|
8780
8780
|
stream.on("data", (entry) => entries.push(entry));
|
|
8781
|
-
stream.once("end", () =>
|
|
8781
|
+
stream.once("end", () => resolve26(entries));
|
|
8782
8782
|
});
|
|
8783
8783
|
}
|
|
8784
8784
|
};
|
|
@@ -9085,7 +9085,7 @@ var require_provider = __commonJS({
|
|
|
9085
9085
|
"../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js"(exports2) {
|
|
9086
9086
|
"use strict";
|
|
9087
9087
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9088
|
-
var
|
|
9088
|
+
var path29 = require("path");
|
|
9089
9089
|
var deep_1 = require_deep();
|
|
9090
9090
|
var entry_1 = require_entry();
|
|
9091
9091
|
var error_1 = require_error2();
|
|
@@ -9099,7 +9099,7 @@ var require_provider = __commonJS({
|
|
|
9099
9099
|
this.entryTransformer = new entry_2.default(this._settings);
|
|
9100
9100
|
}
|
|
9101
9101
|
_getRootDirectory(task) {
|
|
9102
|
-
return
|
|
9102
|
+
return path29.resolve(this._settings.cwd, task.base);
|
|
9103
9103
|
}
|
|
9104
9104
|
_getReaderOptions(task) {
|
|
9105
9105
|
const basePath = task.base === "." ? "" : task.base;
|
|
@@ -9280,16 +9280,16 @@ var require_settings4 = __commonJS({
|
|
|
9280
9280
|
"use strict";
|
|
9281
9281
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9282
9282
|
exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
9283
|
-
var
|
|
9283
|
+
var fs21 = require("fs");
|
|
9284
9284
|
var os5 = require("os");
|
|
9285
9285
|
var CPU_COUNT = Math.max(os5.cpus().length, 1);
|
|
9286
9286
|
exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
9287
|
-
lstat:
|
|
9288
|
-
lstatSync:
|
|
9289
|
-
stat:
|
|
9290
|
-
statSync:
|
|
9291
|
-
readdir:
|
|
9292
|
-
readdirSync:
|
|
9287
|
+
lstat: fs21.lstat,
|
|
9288
|
+
lstatSync: fs21.lstatSync,
|
|
9289
|
+
stat: fs21.stat,
|
|
9290
|
+
statSync: fs21.statSync,
|
|
9291
|
+
readdir: fs21.readdir,
|
|
9292
|
+
readdirSync: fs21.readdirSync
|
|
9293
9293
|
};
|
|
9294
9294
|
var Settings = class {
|
|
9295
9295
|
constructor(_options = {}) {
|
|
@@ -9754,7 +9754,7 @@ var require_ignore = __commonJS({
|
|
|
9754
9754
|
// path matching.
|
|
9755
9755
|
// - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
|
|
9756
9756
|
// @returns {TestResult} true if a file is ignored
|
|
9757
|
-
test(
|
|
9757
|
+
test(path29, checkUnignored, mode) {
|
|
9758
9758
|
let ignored = false;
|
|
9759
9759
|
let unignored = false;
|
|
9760
9760
|
let matchedRule;
|
|
@@ -9763,7 +9763,7 @@ var require_ignore = __commonJS({
|
|
|
9763
9763
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
9764
9764
|
return;
|
|
9765
9765
|
}
|
|
9766
|
-
const matched = rule[mode].test(
|
|
9766
|
+
const matched = rule[mode].test(path29);
|
|
9767
9767
|
if (!matched) {
|
|
9768
9768
|
return;
|
|
9769
9769
|
}
|
|
@@ -9784,17 +9784,17 @@ var require_ignore = __commonJS({
|
|
|
9784
9784
|
var throwError = (message, Ctor) => {
|
|
9785
9785
|
throw new Ctor(message);
|
|
9786
9786
|
};
|
|
9787
|
-
var checkPath = (
|
|
9788
|
-
if (!isString(
|
|
9787
|
+
var checkPath = (path29, originalPath, doThrow) => {
|
|
9788
|
+
if (!isString(path29)) {
|
|
9789
9789
|
return doThrow(
|
|
9790
9790
|
`path must be a string, but got \`${originalPath}\``,
|
|
9791
9791
|
TypeError
|
|
9792
9792
|
);
|
|
9793
9793
|
}
|
|
9794
|
-
if (!
|
|
9794
|
+
if (!path29) {
|
|
9795
9795
|
return doThrow(`path must not be empty`, TypeError);
|
|
9796
9796
|
}
|
|
9797
|
-
if (checkPath.isNotRelative(
|
|
9797
|
+
if (checkPath.isNotRelative(path29)) {
|
|
9798
9798
|
const r = "`path.relative()`d";
|
|
9799
9799
|
return doThrow(
|
|
9800
9800
|
`path should be a ${r} string, but got "${originalPath}"`,
|
|
@@ -9803,7 +9803,7 @@ var require_ignore = __commonJS({
|
|
|
9803
9803
|
}
|
|
9804
9804
|
return true;
|
|
9805
9805
|
};
|
|
9806
|
-
var isNotRelative = (
|
|
9806
|
+
var isNotRelative = (path29) => REGEX_TEST_INVALID_PATH.test(path29);
|
|
9807
9807
|
checkPath.isNotRelative = isNotRelative;
|
|
9808
9808
|
checkPath.convert = (p) => p;
|
|
9809
9809
|
var Ignore = class {
|
|
@@ -9833,19 +9833,19 @@ var require_ignore = __commonJS({
|
|
|
9833
9833
|
}
|
|
9834
9834
|
// @returns {TestResult}
|
|
9835
9835
|
_test(originalPath, cache, checkUnignored, slices) {
|
|
9836
|
-
const
|
|
9836
|
+
const path29 = originalPath && checkPath.convert(originalPath);
|
|
9837
9837
|
checkPath(
|
|
9838
|
-
|
|
9838
|
+
path29,
|
|
9839
9839
|
originalPath,
|
|
9840
9840
|
this._strictPathCheck ? throwError : RETURN_FALSE
|
|
9841
9841
|
);
|
|
9842
|
-
return this._t(
|
|
9842
|
+
return this._t(path29, cache, checkUnignored, slices);
|
|
9843
9843
|
}
|
|
9844
|
-
checkIgnore(
|
|
9845
|
-
if (!REGEX_TEST_TRAILING_SLASH.test(
|
|
9846
|
-
return this.test(
|
|
9844
|
+
checkIgnore(path29) {
|
|
9845
|
+
if (!REGEX_TEST_TRAILING_SLASH.test(path29)) {
|
|
9846
|
+
return this.test(path29);
|
|
9847
9847
|
}
|
|
9848
|
-
const slices =
|
|
9848
|
+
const slices = path29.split(SLASH).filter(Boolean);
|
|
9849
9849
|
slices.pop();
|
|
9850
9850
|
if (slices.length) {
|
|
9851
9851
|
const parent = this._t(
|
|
@@ -9858,18 +9858,18 @@ var require_ignore = __commonJS({
|
|
|
9858
9858
|
return parent;
|
|
9859
9859
|
}
|
|
9860
9860
|
}
|
|
9861
|
-
return this._rules.test(
|
|
9861
|
+
return this._rules.test(path29, false, MODE_CHECK_IGNORE);
|
|
9862
9862
|
}
|
|
9863
|
-
_t(
|
|
9864
|
-
if (
|
|
9865
|
-
return cache[
|
|
9863
|
+
_t(path29, cache, checkUnignored, slices) {
|
|
9864
|
+
if (path29 in cache) {
|
|
9865
|
+
return cache[path29];
|
|
9866
9866
|
}
|
|
9867
9867
|
if (!slices) {
|
|
9868
|
-
slices =
|
|
9868
|
+
slices = path29.split(SLASH).filter(Boolean);
|
|
9869
9869
|
}
|
|
9870
9870
|
slices.pop();
|
|
9871
9871
|
if (!slices.length) {
|
|
9872
|
-
return cache[
|
|
9872
|
+
return cache[path29] = this._rules.test(path29, checkUnignored, MODE_IGNORE);
|
|
9873
9873
|
}
|
|
9874
9874
|
const parent = this._t(
|
|
9875
9875
|
slices.join(SLASH) + SLASH,
|
|
@@ -9877,29 +9877,29 @@ var require_ignore = __commonJS({
|
|
|
9877
9877
|
checkUnignored,
|
|
9878
9878
|
slices
|
|
9879
9879
|
);
|
|
9880
|
-
return cache[
|
|
9880
|
+
return cache[path29] = parent.ignored ? parent : this._rules.test(path29, checkUnignored, MODE_IGNORE);
|
|
9881
9881
|
}
|
|
9882
|
-
ignores(
|
|
9883
|
-
return this._test(
|
|
9882
|
+
ignores(path29) {
|
|
9883
|
+
return this._test(path29, this._ignoreCache, false).ignored;
|
|
9884
9884
|
}
|
|
9885
9885
|
createFilter() {
|
|
9886
|
-
return (
|
|
9886
|
+
return (path29) => !this.ignores(path29);
|
|
9887
9887
|
}
|
|
9888
9888
|
filter(paths) {
|
|
9889
9889
|
return makeArray(paths).filter(this.createFilter());
|
|
9890
9890
|
}
|
|
9891
9891
|
// @returns {TestResult}
|
|
9892
|
-
test(
|
|
9893
|
-
return this._test(
|
|
9892
|
+
test(path29) {
|
|
9893
|
+
return this._test(path29, this._testCache, true);
|
|
9894
9894
|
}
|
|
9895
9895
|
};
|
|
9896
9896
|
var factory = (options) => new Ignore(options);
|
|
9897
|
-
var isPathValid = (
|
|
9897
|
+
var isPathValid = (path29) => checkPath(path29 && checkPath.convert(path29), path29, RETURN_FALSE);
|
|
9898
9898
|
var setupWindows = () => {
|
|
9899
9899
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
9900
9900
|
checkPath.convert = makePosix;
|
|
9901
9901
|
const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
9902
|
-
checkPath.isNotRelative = (
|
|
9902
|
+
checkPath.isNotRelative = (path29) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path29) || isNotRelative(path29);
|
|
9903
9903
|
};
|
|
9904
9904
|
if (
|
|
9905
9905
|
// Detect `process` so that it can run in browsers.
|
|
@@ -9929,12 +9929,12 @@ var init_is_path_inside = __esm({
|
|
|
9929
9929
|
});
|
|
9930
9930
|
|
|
9931
9931
|
// ../../node_modules/.pnpm/slash@5.1.0/node_modules/slash/index.js
|
|
9932
|
-
function slash(
|
|
9933
|
-
const isExtendedLengthPath =
|
|
9932
|
+
function slash(path29) {
|
|
9933
|
+
const isExtendedLengthPath = path29.startsWith("\\\\?\\");
|
|
9934
9934
|
if (isExtendedLengthPath) {
|
|
9935
|
-
return
|
|
9935
|
+
return path29;
|
|
9936
9936
|
}
|
|
9937
|
-
return
|
|
9937
|
+
return path29.replace(/\\/g, "/");
|
|
9938
9938
|
}
|
|
9939
9939
|
var init_slash = __esm({
|
|
9940
9940
|
"../../node_modules/.pnpm/slash@5.1.0/node_modules/slash/index.js"() {
|
|
@@ -10813,25 +10813,25 @@ var init_globby = __esm({
|
|
|
10813
10813
|
return bindFsMethod(import_node_fs3.default.promises, "stat");
|
|
10814
10814
|
};
|
|
10815
10815
|
getStatSyncMethod2 = (fsImplementation) => bindFsMethod(fsImplementation, "statSync") ?? bindFsMethod(import_node_fs3.default, "statSync");
|
|
10816
|
-
isDirectory = async (
|
|
10816
|
+
isDirectory = async (path29, fsImplementation) => {
|
|
10817
10817
|
try {
|
|
10818
|
-
const stats = await getStatMethod(fsImplementation)(
|
|
10818
|
+
const stats = await getStatMethod(fsImplementation)(path29);
|
|
10819
10819
|
return stats.isDirectory();
|
|
10820
10820
|
} catch {
|
|
10821
10821
|
return false;
|
|
10822
10822
|
}
|
|
10823
10823
|
};
|
|
10824
|
-
isDirectorySync = (
|
|
10824
|
+
isDirectorySync = (path29, fsImplementation) => {
|
|
10825
10825
|
try {
|
|
10826
|
-
const stats = getStatSyncMethod2(fsImplementation)(
|
|
10826
|
+
const stats = getStatSyncMethod2(fsImplementation)(path29);
|
|
10827
10827
|
return stats.isDirectory();
|
|
10828
10828
|
} catch {
|
|
10829
10829
|
return false;
|
|
10830
10830
|
}
|
|
10831
10831
|
};
|
|
10832
10832
|
normalizePathForDirectoryGlob = (filePath, cwd) => {
|
|
10833
|
-
const
|
|
10834
|
-
return import_node_path4.default.isAbsolute(
|
|
10833
|
+
const path29 = isNegativePattern(filePath) ? filePath.slice(1) : filePath;
|
|
10834
|
+
return import_node_path4.default.isAbsolute(path29) ? path29 : import_node_path4.default.join(cwd, path29);
|
|
10835
10835
|
};
|
|
10836
10836
|
shouldExpandGlobstarDirectory = (pattern) => {
|
|
10837
10837
|
const match2 = pattern?.match(/\*\*\/([^/]+)$/);
|
|
@@ -10916,9 +10916,9 @@ var init_globby = __esm({
|
|
|
10916
10916
|
}
|
|
10917
10917
|
return patterns;
|
|
10918
10918
|
};
|
|
10919
|
-
isPathIgnored = (matcher, globalMatcher,
|
|
10920
|
-
const globalResult = globalMatcher ? globalMatcher(
|
|
10921
|
-
const result = matcher ? matcher(
|
|
10919
|
+
isPathIgnored = (matcher, globalMatcher, path29) => {
|
|
10920
|
+
const globalResult = globalMatcher ? globalMatcher(path29) : void 0;
|
|
10921
|
+
const result = matcher ? matcher(path29) : void 0;
|
|
10922
10922
|
if (result?.unignored) {
|
|
10923
10923
|
return false;
|
|
10924
10924
|
}
|
|
@@ -13328,17 +13328,17 @@ var require_visit = __commonJS({
|
|
|
13328
13328
|
visit.BREAK = BREAK;
|
|
13329
13329
|
visit.SKIP = SKIP;
|
|
13330
13330
|
visit.REMOVE = REMOVE;
|
|
13331
|
-
function visit_(key, node, visitor,
|
|
13332
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
13331
|
+
function visit_(key, node, visitor, path29) {
|
|
13332
|
+
const ctrl = callVisitor(key, node, visitor, path29);
|
|
13333
13333
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
13334
|
-
replaceNode(key,
|
|
13335
|
-
return visit_(key, ctrl, visitor,
|
|
13334
|
+
replaceNode(key, path29, ctrl);
|
|
13335
|
+
return visit_(key, ctrl, visitor, path29);
|
|
13336
13336
|
}
|
|
13337
13337
|
if (typeof ctrl !== "symbol") {
|
|
13338
13338
|
if (identity.isCollection(node)) {
|
|
13339
|
-
|
|
13339
|
+
path29 = Object.freeze(path29.concat(node));
|
|
13340
13340
|
for (let i = 0; i < node.items.length; ++i) {
|
|
13341
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
13341
|
+
const ci = visit_(i, node.items[i], visitor, path29);
|
|
13342
13342
|
if (typeof ci === "number")
|
|
13343
13343
|
i = ci - 1;
|
|
13344
13344
|
else if (ci === BREAK)
|
|
@@ -13349,13 +13349,13 @@ var require_visit = __commonJS({
|
|
|
13349
13349
|
}
|
|
13350
13350
|
}
|
|
13351
13351
|
} else if (identity.isPair(node)) {
|
|
13352
|
-
|
|
13353
|
-
const ck = visit_("key", node.key, visitor,
|
|
13352
|
+
path29 = Object.freeze(path29.concat(node));
|
|
13353
|
+
const ck = visit_("key", node.key, visitor, path29);
|
|
13354
13354
|
if (ck === BREAK)
|
|
13355
13355
|
return BREAK;
|
|
13356
13356
|
else if (ck === REMOVE)
|
|
13357
13357
|
node.key = null;
|
|
13358
|
-
const cv = visit_("value", node.value, visitor,
|
|
13358
|
+
const cv = visit_("value", node.value, visitor, path29);
|
|
13359
13359
|
if (cv === BREAK)
|
|
13360
13360
|
return BREAK;
|
|
13361
13361
|
else if (cv === REMOVE)
|
|
@@ -13376,17 +13376,17 @@ var require_visit = __commonJS({
|
|
|
13376
13376
|
visitAsync.BREAK = BREAK;
|
|
13377
13377
|
visitAsync.SKIP = SKIP;
|
|
13378
13378
|
visitAsync.REMOVE = REMOVE;
|
|
13379
|
-
async function visitAsync_(key, node, visitor,
|
|
13380
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
13379
|
+
async function visitAsync_(key, node, visitor, path29) {
|
|
13380
|
+
const ctrl = await callVisitor(key, node, visitor, path29);
|
|
13381
13381
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
13382
|
-
replaceNode(key,
|
|
13383
|
-
return visitAsync_(key, ctrl, visitor,
|
|
13382
|
+
replaceNode(key, path29, ctrl);
|
|
13383
|
+
return visitAsync_(key, ctrl, visitor, path29);
|
|
13384
13384
|
}
|
|
13385
13385
|
if (typeof ctrl !== "symbol") {
|
|
13386
13386
|
if (identity.isCollection(node)) {
|
|
13387
|
-
|
|
13387
|
+
path29 = Object.freeze(path29.concat(node));
|
|
13388
13388
|
for (let i = 0; i < node.items.length; ++i) {
|
|
13389
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
13389
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path29);
|
|
13390
13390
|
if (typeof ci === "number")
|
|
13391
13391
|
i = ci - 1;
|
|
13392
13392
|
else if (ci === BREAK)
|
|
@@ -13397,13 +13397,13 @@ var require_visit = __commonJS({
|
|
|
13397
13397
|
}
|
|
13398
13398
|
}
|
|
13399
13399
|
} else if (identity.isPair(node)) {
|
|
13400
|
-
|
|
13401
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
13400
|
+
path29 = Object.freeze(path29.concat(node));
|
|
13401
|
+
const ck = await visitAsync_("key", node.key, visitor, path29);
|
|
13402
13402
|
if (ck === BREAK)
|
|
13403
13403
|
return BREAK;
|
|
13404
13404
|
else if (ck === REMOVE)
|
|
13405
13405
|
node.key = null;
|
|
13406
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
13406
|
+
const cv = await visitAsync_("value", node.value, visitor, path29);
|
|
13407
13407
|
if (cv === BREAK)
|
|
13408
13408
|
return BREAK;
|
|
13409
13409
|
else if (cv === REMOVE)
|
|
@@ -13430,23 +13430,23 @@ var require_visit = __commonJS({
|
|
|
13430
13430
|
}
|
|
13431
13431
|
return visitor;
|
|
13432
13432
|
}
|
|
13433
|
-
function callVisitor(key, node, visitor,
|
|
13433
|
+
function callVisitor(key, node, visitor, path29) {
|
|
13434
13434
|
if (typeof visitor === "function")
|
|
13435
|
-
return visitor(key, node,
|
|
13435
|
+
return visitor(key, node, path29);
|
|
13436
13436
|
if (identity.isMap(node))
|
|
13437
|
-
return visitor.Map?.(key, node,
|
|
13437
|
+
return visitor.Map?.(key, node, path29);
|
|
13438
13438
|
if (identity.isSeq(node))
|
|
13439
|
-
return visitor.Seq?.(key, node,
|
|
13439
|
+
return visitor.Seq?.(key, node, path29);
|
|
13440
13440
|
if (identity.isPair(node))
|
|
13441
|
-
return visitor.Pair?.(key, node,
|
|
13441
|
+
return visitor.Pair?.(key, node, path29);
|
|
13442
13442
|
if (identity.isScalar(node))
|
|
13443
|
-
return visitor.Scalar?.(key, node,
|
|
13443
|
+
return visitor.Scalar?.(key, node, path29);
|
|
13444
13444
|
if (identity.isAlias(node))
|
|
13445
|
-
return visitor.Alias?.(key, node,
|
|
13445
|
+
return visitor.Alias?.(key, node, path29);
|
|
13446
13446
|
return void 0;
|
|
13447
13447
|
}
|
|
13448
|
-
function replaceNode(key,
|
|
13449
|
-
const parent =
|
|
13448
|
+
function replaceNode(key, path29, node) {
|
|
13449
|
+
const parent = path29[path29.length - 1];
|
|
13450
13450
|
if (identity.isCollection(parent)) {
|
|
13451
13451
|
parent.items[key] = node;
|
|
13452
13452
|
} else if (identity.isPair(parent)) {
|
|
@@ -14056,10 +14056,10 @@ var require_Collection = __commonJS({
|
|
|
14056
14056
|
var createNode = require_createNode();
|
|
14057
14057
|
var identity = require_identity();
|
|
14058
14058
|
var Node = require_Node();
|
|
14059
|
-
function collectionFromPath(schema,
|
|
14059
|
+
function collectionFromPath(schema, path29, value) {
|
|
14060
14060
|
let v = value;
|
|
14061
|
-
for (let i =
|
|
14062
|
-
const k =
|
|
14061
|
+
for (let i = path29.length - 1; i >= 0; --i) {
|
|
14062
|
+
const k = path29[i];
|
|
14063
14063
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
14064
14064
|
const a = [];
|
|
14065
14065
|
a[k] = v;
|
|
@@ -14078,7 +14078,7 @@ var require_Collection = __commonJS({
|
|
|
14078
14078
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
14079
14079
|
});
|
|
14080
14080
|
}
|
|
14081
|
-
var isEmptyPath = (
|
|
14081
|
+
var isEmptyPath = (path29) => path29 == null || typeof path29 === "object" && !!path29[Symbol.iterator]().next().done;
|
|
14082
14082
|
var Collection = class extends Node.NodeBase {
|
|
14083
14083
|
constructor(type, schema) {
|
|
14084
14084
|
super(type);
|
|
@@ -14108,11 +14108,11 @@ var require_Collection = __commonJS({
|
|
|
14108
14108
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
14109
14109
|
* that already exists in the map.
|
|
14110
14110
|
*/
|
|
14111
|
-
addIn(
|
|
14112
|
-
if (isEmptyPath(
|
|
14111
|
+
addIn(path29, value) {
|
|
14112
|
+
if (isEmptyPath(path29))
|
|
14113
14113
|
this.add(value);
|
|
14114
14114
|
else {
|
|
14115
|
-
const [key, ...rest] =
|
|
14115
|
+
const [key, ...rest] = path29;
|
|
14116
14116
|
const node = this.get(key, true);
|
|
14117
14117
|
if (identity.isCollection(node))
|
|
14118
14118
|
node.addIn(rest, value);
|
|
@@ -14126,8 +14126,8 @@ var require_Collection = __commonJS({
|
|
|
14126
14126
|
* Removes a value from the collection.
|
|
14127
14127
|
* @returns `true` if the item was found and removed.
|
|
14128
14128
|
*/
|
|
14129
|
-
deleteIn(
|
|
14130
|
-
const [key, ...rest] =
|
|
14129
|
+
deleteIn(path29) {
|
|
14130
|
+
const [key, ...rest] = path29;
|
|
14131
14131
|
if (rest.length === 0)
|
|
14132
14132
|
return this.delete(key);
|
|
14133
14133
|
const node = this.get(key, true);
|
|
@@ -14141,8 +14141,8 @@ var require_Collection = __commonJS({
|
|
|
14141
14141
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
14142
14142
|
* `true` (collections are always returned intact).
|
|
14143
14143
|
*/
|
|
14144
|
-
getIn(
|
|
14145
|
-
const [key, ...rest] =
|
|
14144
|
+
getIn(path29, keepScalar) {
|
|
14145
|
+
const [key, ...rest] = path29;
|
|
14146
14146
|
const node = this.get(key, true);
|
|
14147
14147
|
if (rest.length === 0)
|
|
14148
14148
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
@@ -14160,8 +14160,8 @@ var require_Collection = __commonJS({
|
|
|
14160
14160
|
/**
|
|
14161
14161
|
* Checks if the collection includes a value with the key `key`.
|
|
14162
14162
|
*/
|
|
14163
|
-
hasIn(
|
|
14164
|
-
const [key, ...rest] =
|
|
14163
|
+
hasIn(path29) {
|
|
14164
|
+
const [key, ...rest] = path29;
|
|
14165
14165
|
if (rest.length === 0)
|
|
14166
14166
|
return this.has(key);
|
|
14167
14167
|
const node = this.get(key, true);
|
|
@@ -14171,8 +14171,8 @@ var require_Collection = __commonJS({
|
|
|
14171
14171
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
14172
14172
|
* boolean to add/remove the item from the set.
|
|
14173
14173
|
*/
|
|
14174
|
-
setIn(
|
|
14175
|
-
const [key, ...rest] =
|
|
14174
|
+
setIn(path29, value) {
|
|
14175
|
+
const [key, ...rest] = path29;
|
|
14176
14176
|
if (rest.length === 0) {
|
|
14177
14177
|
this.set(key, value);
|
|
14178
14178
|
} else {
|
|
@@ -16687,9 +16687,9 @@ var require_Document = __commonJS({
|
|
|
16687
16687
|
this.contents.add(value);
|
|
16688
16688
|
}
|
|
16689
16689
|
/** Adds a value to the document. */
|
|
16690
|
-
addIn(
|
|
16690
|
+
addIn(path29, value) {
|
|
16691
16691
|
if (assertCollection(this.contents))
|
|
16692
|
-
this.contents.addIn(
|
|
16692
|
+
this.contents.addIn(path29, value);
|
|
16693
16693
|
}
|
|
16694
16694
|
/**
|
|
16695
16695
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -16764,14 +16764,14 @@ var require_Document = __commonJS({
|
|
|
16764
16764
|
* Removes a value from the document.
|
|
16765
16765
|
* @returns `true` if the item was found and removed.
|
|
16766
16766
|
*/
|
|
16767
|
-
deleteIn(
|
|
16768
|
-
if (Collection.isEmptyPath(
|
|
16767
|
+
deleteIn(path29) {
|
|
16768
|
+
if (Collection.isEmptyPath(path29)) {
|
|
16769
16769
|
if (this.contents == null)
|
|
16770
16770
|
return false;
|
|
16771
16771
|
this.contents = null;
|
|
16772
16772
|
return true;
|
|
16773
16773
|
}
|
|
16774
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
16774
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path29) : false;
|
|
16775
16775
|
}
|
|
16776
16776
|
/**
|
|
16777
16777
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -16786,10 +16786,10 @@ var require_Document = __commonJS({
|
|
|
16786
16786
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
16787
16787
|
* `true` (collections are always returned intact).
|
|
16788
16788
|
*/
|
|
16789
|
-
getIn(
|
|
16790
|
-
if (Collection.isEmptyPath(
|
|
16789
|
+
getIn(path29, keepScalar) {
|
|
16790
|
+
if (Collection.isEmptyPath(path29))
|
|
16791
16791
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
16792
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
16792
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path29, keepScalar) : void 0;
|
|
16793
16793
|
}
|
|
16794
16794
|
/**
|
|
16795
16795
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -16800,10 +16800,10 @@ var require_Document = __commonJS({
|
|
|
16800
16800
|
/**
|
|
16801
16801
|
* Checks if the document includes a value at `path`.
|
|
16802
16802
|
*/
|
|
16803
|
-
hasIn(
|
|
16804
|
-
if (Collection.isEmptyPath(
|
|
16803
|
+
hasIn(path29) {
|
|
16804
|
+
if (Collection.isEmptyPath(path29))
|
|
16805
16805
|
return this.contents !== void 0;
|
|
16806
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
16806
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path29) : false;
|
|
16807
16807
|
}
|
|
16808
16808
|
/**
|
|
16809
16809
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -16820,13 +16820,13 @@ var require_Document = __commonJS({
|
|
|
16820
16820
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
16821
16821
|
* boolean to add/remove the item from the set.
|
|
16822
16822
|
*/
|
|
16823
|
-
setIn(
|
|
16824
|
-
if (Collection.isEmptyPath(
|
|
16823
|
+
setIn(path29, value) {
|
|
16824
|
+
if (Collection.isEmptyPath(path29)) {
|
|
16825
16825
|
this.contents = value;
|
|
16826
16826
|
} else if (this.contents == null) {
|
|
16827
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
16827
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path29), value);
|
|
16828
16828
|
} else if (assertCollection(this.contents)) {
|
|
16829
|
-
this.contents.setIn(
|
|
16829
|
+
this.contents.setIn(path29, value);
|
|
16830
16830
|
}
|
|
16831
16831
|
}
|
|
16832
16832
|
/**
|
|
@@ -18786,9 +18786,9 @@ var require_cst_visit = __commonJS({
|
|
|
18786
18786
|
visit.BREAK = BREAK;
|
|
18787
18787
|
visit.SKIP = SKIP;
|
|
18788
18788
|
visit.REMOVE = REMOVE;
|
|
18789
|
-
visit.itemAtPath = (cst,
|
|
18789
|
+
visit.itemAtPath = (cst, path29) => {
|
|
18790
18790
|
let item = cst;
|
|
18791
|
-
for (const [field, index] of
|
|
18791
|
+
for (const [field, index] of path29) {
|
|
18792
18792
|
const tok = item?.[field];
|
|
18793
18793
|
if (tok && "items" in tok) {
|
|
18794
18794
|
item = tok.items[index];
|
|
@@ -18797,23 +18797,23 @@ var require_cst_visit = __commonJS({
|
|
|
18797
18797
|
}
|
|
18798
18798
|
return item;
|
|
18799
18799
|
};
|
|
18800
|
-
visit.parentCollection = (cst,
|
|
18801
|
-
const parent = visit.itemAtPath(cst,
|
|
18802
|
-
const field =
|
|
18800
|
+
visit.parentCollection = (cst, path29) => {
|
|
18801
|
+
const parent = visit.itemAtPath(cst, path29.slice(0, -1));
|
|
18802
|
+
const field = path29[path29.length - 1][0];
|
|
18803
18803
|
const coll = parent?.[field];
|
|
18804
18804
|
if (coll && "items" in coll)
|
|
18805
18805
|
return coll;
|
|
18806
18806
|
throw new Error("Parent collection not found");
|
|
18807
18807
|
};
|
|
18808
|
-
function _visit(
|
|
18809
|
-
let ctrl = visitor(item,
|
|
18808
|
+
function _visit(path29, item, visitor) {
|
|
18809
|
+
let ctrl = visitor(item, path29);
|
|
18810
18810
|
if (typeof ctrl === "symbol")
|
|
18811
18811
|
return ctrl;
|
|
18812
18812
|
for (const field of ["key", "value"]) {
|
|
18813
18813
|
const token = item[field];
|
|
18814
18814
|
if (token && "items" in token) {
|
|
18815
18815
|
for (let i = 0; i < token.items.length; ++i) {
|
|
18816
|
-
const ci = _visit(Object.freeze(
|
|
18816
|
+
const ci = _visit(Object.freeze(path29.concat([[field, i]])), token.items[i], visitor);
|
|
18817
18817
|
if (typeof ci === "number")
|
|
18818
18818
|
i = ci - 1;
|
|
18819
18819
|
else if (ci === BREAK)
|
|
@@ -18824,10 +18824,10 @@ var require_cst_visit = __commonJS({
|
|
|
18824
18824
|
}
|
|
18825
18825
|
}
|
|
18826
18826
|
if (typeof ctrl === "function" && field === "key")
|
|
18827
|
-
ctrl = ctrl(item,
|
|
18827
|
+
ctrl = ctrl(item, path29);
|
|
18828
18828
|
}
|
|
18829
18829
|
}
|
|
18830
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
18830
|
+
return typeof ctrl === "function" ? ctrl(item, path29) : ctrl;
|
|
18831
18831
|
}
|
|
18832
18832
|
exports2.visit = visit;
|
|
18833
18833
|
}
|
|
@@ -20129,14 +20129,14 @@ var require_parser = __commonJS({
|
|
|
20129
20129
|
case "scalar":
|
|
20130
20130
|
case "single-quoted-scalar":
|
|
20131
20131
|
case "double-quoted-scalar": {
|
|
20132
|
-
const
|
|
20132
|
+
const fs21 = this.flowScalar(this.type);
|
|
20133
20133
|
if (atNextItem || it.value) {
|
|
20134
|
-
map.items.push({ start, key:
|
|
20134
|
+
map.items.push({ start, key: fs21, sep: [] });
|
|
20135
20135
|
this.onKeyLine = true;
|
|
20136
20136
|
} else if (it.sep) {
|
|
20137
|
-
this.stack.push(
|
|
20137
|
+
this.stack.push(fs21);
|
|
20138
20138
|
} else {
|
|
20139
|
-
Object.assign(it, { key:
|
|
20139
|
+
Object.assign(it, { key: fs21, sep: [] });
|
|
20140
20140
|
this.onKeyLine = true;
|
|
20141
20141
|
}
|
|
20142
20142
|
return;
|
|
@@ -20264,13 +20264,13 @@ var require_parser = __commonJS({
|
|
|
20264
20264
|
case "scalar":
|
|
20265
20265
|
case "single-quoted-scalar":
|
|
20266
20266
|
case "double-quoted-scalar": {
|
|
20267
|
-
const
|
|
20267
|
+
const fs21 = this.flowScalar(this.type);
|
|
20268
20268
|
if (!it || it.value)
|
|
20269
|
-
fc.items.push({ start: [], key:
|
|
20269
|
+
fc.items.push({ start: [], key: fs21, sep: [] });
|
|
20270
20270
|
else if (it.sep)
|
|
20271
|
-
this.stack.push(
|
|
20271
|
+
this.stack.push(fs21);
|
|
20272
20272
|
else
|
|
20273
|
-
Object.assign(it, { key:
|
|
20273
|
+
Object.assign(it, { key: fs21, sep: [] });
|
|
20274
20274
|
return;
|
|
20275
20275
|
}
|
|
20276
20276
|
case "flow-map-end":
|
|
@@ -20783,15 +20783,15 @@ var init_wsl_utils = __esm({
|
|
|
20783
20783
|
const { stdout } = await executePowerShell(command, { powerShellPath: psPath });
|
|
20784
20784
|
return stdout.trim();
|
|
20785
20785
|
};
|
|
20786
|
-
convertWslPathToWindows = async (
|
|
20787
|
-
if (/^[a-z]+:\/\//i.test(
|
|
20788
|
-
return
|
|
20786
|
+
convertWslPathToWindows = async (path29) => {
|
|
20787
|
+
if (/^[a-z]+:\/\//i.test(path29)) {
|
|
20788
|
+
return path29;
|
|
20789
20789
|
}
|
|
20790
20790
|
try {
|
|
20791
|
-
const { stdout } = await execFile2("wslpath", ["-aw",
|
|
20791
|
+
const { stdout } = await execFile2("wslpath", ["-aw", path29], { encoding: "utf8" });
|
|
20792
20792
|
return stdout.trim();
|
|
20793
20793
|
} catch {
|
|
20794
|
-
return
|
|
20794
|
+
return path29;
|
|
20795
20795
|
}
|
|
20796
20796
|
};
|
|
20797
20797
|
}
|
|
@@ -21183,19 +21183,19 @@ var init_open = __esm({
|
|
|
21183
21183
|
}
|
|
21184
21184
|
const subprocess = import_node_child_process8.default.spawn(command, cliArguments, childProcessOptions);
|
|
21185
21185
|
if (options.wait) {
|
|
21186
|
-
return new Promise((
|
|
21186
|
+
return new Promise((resolve26, reject) => {
|
|
21187
21187
|
subprocess.once("error", reject);
|
|
21188
21188
|
subprocess.once("close", (exitCode) => {
|
|
21189
21189
|
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
21190
21190
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
21191
21191
|
return;
|
|
21192
21192
|
}
|
|
21193
|
-
|
|
21193
|
+
resolve26(subprocess);
|
|
21194
21194
|
});
|
|
21195
21195
|
});
|
|
21196
21196
|
}
|
|
21197
21197
|
if (isFallbackAttempt) {
|
|
21198
|
-
return new Promise((
|
|
21198
|
+
return new Promise((resolve26, reject) => {
|
|
21199
21199
|
subprocess.once("error", reject);
|
|
21200
21200
|
subprocess.once("spawn", () => {
|
|
21201
21201
|
subprocess.once("close", (exitCode) => {
|
|
@@ -21205,17 +21205,17 @@ var init_open = __esm({
|
|
|
21205
21205
|
return;
|
|
21206
21206
|
}
|
|
21207
21207
|
subprocess.unref();
|
|
21208
|
-
|
|
21208
|
+
resolve26(subprocess);
|
|
21209
21209
|
});
|
|
21210
21210
|
});
|
|
21211
21211
|
});
|
|
21212
21212
|
}
|
|
21213
21213
|
subprocess.unref();
|
|
21214
|
-
return new Promise((
|
|
21214
|
+
return new Promise((resolve26, reject) => {
|
|
21215
21215
|
subprocess.once("error", reject);
|
|
21216
21216
|
subprocess.once("spawn", () => {
|
|
21217
21217
|
subprocess.off("error", reject);
|
|
21218
|
-
|
|
21218
|
+
resolve26(subprocess);
|
|
21219
21219
|
});
|
|
21220
21220
|
});
|
|
21221
21221
|
};
|
|
@@ -23119,20 +23119,6 @@ var path8 = __toESM(require("path"));
|
|
|
23119
23119
|
var fs4 = __toESM(require("fs"));
|
|
23120
23120
|
var os2 = __toESM(require("os"));
|
|
23121
23121
|
var path5 = __toESM(require("path"));
|
|
23122
|
-
function moveFile(src, dest) {
|
|
23123
|
-
const source = path5.resolve(src);
|
|
23124
|
-
const destination = path5.resolve(dest);
|
|
23125
|
-
try {
|
|
23126
|
-
let finalDest = destination;
|
|
23127
|
-
if (fs4.existsSync(destination) && fs4.statSync(destination).isDirectory()) {
|
|
23128
|
-
const fileName = path5.basename(source);
|
|
23129
|
-
finalDest = path5.join(destination, fileName);
|
|
23130
|
-
}
|
|
23131
|
-
fs4.renameSync(source, finalDest);
|
|
23132
|
-
} catch (error) {
|
|
23133
|
-
throw new Error(`Failed to move ${source} to ${destination}`);
|
|
23134
|
-
}
|
|
23135
|
-
}
|
|
23136
23122
|
function readFile(filePath, options = {}) {
|
|
23137
23123
|
const file = path5.resolve(filePath);
|
|
23138
23124
|
if (!fs4.existsSync(file)) {
|
|
@@ -23265,7 +23251,7 @@ var child = __toESM(require("child_process"));
|
|
|
23265
23251
|
var path6 = __toESM(require("path"));
|
|
23266
23252
|
|
|
23267
23253
|
// package.json
|
|
23268
|
-
var version = "2.8.0-next.
|
|
23254
|
+
var version = "2.8.0-next.16";
|
|
23269
23255
|
|
|
23270
23256
|
// src/util/logger.ts
|
|
23271
23257
|
var levels = {
|
|
@@ -23361,7 +23347,7 @@ function execAsync(cmd, options = {}) {
|
|
|
23361
23347
|
if (verbose) {
|
|
23362
23348
|
console.log(`+ ${cmd}`);
|
|
23363
23349
|
}
|
|
23364
|
-
return new Promise((
|
|
23350
|
+
return new Promise((resolve26, reject) => {
|
|
23365
23351
|
const [command, ...args] = cmd.split(" ");
|
|
23366
23352
|
const childProcess4 = child.spawn(command, args, {
|
|
23367
23353
|
shell: true,
|
|
@@ -23395,7 +23381,7 @@ ${stderr}`.trim();
|
|
|
23395
23381
|
return;
|
|
23396
23382
|
}
|
|
23397
23383
|
}
|
|
23398
|
-
|
|
23384
|
+
resolve26(stdout.trim());
|
|
23399
23385
|
});
|
|
23400
23386
|
childProcess4.on("error", (error) => {
|
|
23401
23387
|
const errorMsg = `Command failed: ${cmd}
|
|
@@ -23418,7 +23404,7 @@ function execForeground(cmd, options = {}) {
|
|
|
23418
23404
|
if (verbose) {
|
|
23419
23405
|
console.log(`+ ${cmd}`);
|
|
23420
23406
|
}
|
|
23421
|
-
return new Promise((
|
|
23407
|
+
return new Promise((resolve26, reject) => {
|
|
23422
23408
|
const [command, ...args] = cmd.split(" ");
|
|
23423
23409
|
const childProcess4 = child.spawn(command, args, {
|
|
23424
23410
|
shell: true,
|
|
@@ -23430,7 +23416,7 @@ function execForeground(cmd, options = {}) {
|
|
|
23430
23416
|
reject(new Error(`Command "${cmd}" exited with code ${code ?? 1}`));
|
|
23431
23417
|
return;
|
|
23432
23418
|
}
|
|
23433
|
-
|
|
23419
|
+
resolve26();
|
|
23434
23420
|
});
|
|
23435
23421
|
childProcess4.on("error", (error) => {
|
|
23436
23422
|
reject(new Error(`Command "${cmd}" failed: ${error.message}`));
|
|
@@ -23442,51 +23428,51 @@ function execForeground(cmd, options = {}) {
|
|
|
23442
23428
|
function escapeDoubleQuotesAndBackslashes(str) {
|
|
23443
23429
|
return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
23444
23430
|
}
|
|
23445
|
-
function isGitRepository(
|
|
23446
|
-
const isGitRepo = exec("git rev-parse --is-inside-work-tree", { silent: true, cwd:
|
|
23431
|
+
function isGitRepository(path29) {
|
|
23432
|
+
const isGitRepo = exec("git rev-parse --is-inside-work-tree", { silent: true, cwd: path29 }).toLocaleLowerCase() === "true";
|
|
23447
23433
|
return isGitRepo;
|
|
23448
23434
|
}
|
|
23449
|
-
function getGitRoot(
|
|
23450
|
-
const fileString = exec("git rev-parse --show-toplevel", { cwd:
|
|
23435
|
+
function getGitRoot(path29) {
|
|
23436
|
+
const fileString = exec("git rev-parse --show-toplevel", { cwd: path29 });
|
|
23451
23437
|
return (0, import_path.resolve)(fileString);
|
|
23452
23438
|
}
|
|
23453
|
-
function hasChanges(
|
|
23454
|
-
return getUncommittedChanges(
|
|
23439
|
+
function hasChanges(path29) {
|
|
23440
|
+
return getUncommittedChanges(path29).length > 0;
|
|
23455
23441
|
}
|
|
23456
|
-
function getUncommittedChanges(
|
|
23457
|
-
return exec("git status --porcelain", { cwd:
|
|
23442
|
+
function getUncommittedChanges(path29) {
|
|
23443
|
+
return exec("git status --porcelain", { cwd: path29 }).split("\n").filter((value) => value.trim().length !== 0).map(
|
|
23458
23444
|
(fileInfo) => (
|
|
23459
23445
|
// Extract relative file path from the info string and convert to absolute path
|
|
23460
|
-
(0, import_path.resolve)(
|
|
23446
|
+
(0, import_path.resolve)(path29 ?? process.cwd(), fileInfo.trim().split(" ").pop() ?? "")
|
|
23461
23447
|
)
|
|
23462
23448
|
);
|
|
23463
23449
|
}
|
|
23464
|
-
function commitChanges(message,
|
|
23465
|
-
exec("git add .", { cwd:
|
|
23466
|
-
exec(`git commit -m "${escapeDoubleQuotesAndBackslashes(message)}"`, { cwd:
|
|
23450
|
+
function commitChanges(message, path29) {
|
|
23451
|
+
exec("git add .", { cwd: path29 });
|
|
23452
|
+
exec(`git commit -m "${escapeDoubleQuotesAndBackslashes(message)}"`, { cwd: path29 });
|
|
23467
23453
|
}
|
|
23468
|
-
function getChangesOfLastCommit(
|
|
23469
|
-
return exec("git diff --name-only HEAD^", { cwd:
|
|
23454
|
+
function getChangesOfLastCommit(path29) {
|
|
23455
|
+
return exec("git diff --name-only HEAD^", { cwd: path29 }).split("\n").map((file) => (0, import_path.resolve)(path29 ?? process.cwd(), file));
|
|
23470
23456
|
}
|
|
23471
|
-
function getChangesComparedToDefaultBranch(
|
|
23472
|
-
const baseRef = getDefaultBranchRef(
|
|
23473
|
-
const committedChanges = baseRef ? exec(`git diff --name-only ${baseRef}...HEAD`, { cwd:
|
|
23474
|
-
return [.../* @__PURE__ */ new Set([...committedChanges, ...getUncommittedChanges(
|
|
23457
|
+
function getChangesComparedToDefaultBranch(path29) {
|
|
23458
|
+
const baseRef = getDefaultBranchRef(path29);
|
|
23459
|
+
const committedChanges = baseRef ? exec(`git diff --name-only ${baseRef}...HEAD`, { cwd: path29, silent: true }).split("\n").filter((value) => value.trim().length !== 0).map((file) => (0, import_path.resolve)(path29 ?? process.cwd(), file.trim())) : [];
|
|
23460
|
+
return [.../* @__PURE__ */ new Set([...committedChanges, ...getUncommittedChanges(path29)])];
|
|
23475
23461
|
}
|
|
23476
|
-
function getDefaultBranchRef(
|
|
23462
|
+
function getDefaultBranchRef(path29) {
|
|
23477
23463
|
try {
|
|
23478
|
-
const ref = exec("git symbolic-ref --short refs/remotes/origin/HEAD", { cwd:
|
|
23464
|
+
const ref = exec("git symbolic-ref --short refs/remotes/origin/HEAD", { cwd: path29, silent: true, fatal: false });
|
|
23479
23465
|
if (ref) {
|
|
23480
23466
|
return ref;
|
|
23481
23467
|
}
|
|
23482
23468
|
} catch {
|
|
23483
23469
|
}
|
|
23484
23470
|
const candidates = ["origin/main", "origin/master", "main", "master"];
|
|
23485
|
-
return candidates.find((ref) => refExists(ref,
|
|
23471
|
+
return candidates.find((ref) => refExists(ref, path29));
|
|
23486
23472
|
}
|
|
23487
|
-
function refExists(ref,
|
|
23473
|
+
function refExists(ref, path29) {
|
|
23488
23474
|
try {
|
|
23489
|
-
exec(`git rev-parse --verify --quiet ${ref}`, { cwd:
|
|
23475
|
+
exec(`git rev-parse --verify --quiet ${ref}`, { cwd: path29, silent: true, fatal: false });
|
|
23490
23476
|
return true;
|
|
23491
23477
|
} catch {
|
|
23492
23478
|
return false;
|
|
@@ -23501,14 +23487,14 @@ function getLastModificationDate(filePath, repoRoot, excludeMessage) {
|
|
|
23501
23487
|
return void 0;
|
|
23502
23488
|
}
|
|
23503
23489
|
}
|
|
23504
|
-
function getRemoteUrl(
|
|
23505
|
-
return exec("git config --get remote.origin.url", { cwd:
|
|
23490
|
+
function getRemoteUrl(path29) {
|
|
23491
|
+
return exec("git config --get remote.origin.url", { cwd: path29 });
|
|
23506
23492
|
}
|
|
23507
|
-
function createBranch(branch,
|
|
23508
|
-
exec(`git checkout -B ${branch}`, { cwd:
|
|
23493
|
+
function createBranch(branch, path29) {
|
|
23494
|
+
exec(`git checkout -B ${branch}`, { cwd: path29 });
|
|
23509
23495
|
}
|
|
23510
|
-
function getDefaultBranch(
|
|
23511
|
-
const output = exec("git remote show origin", { cwd:
|
|
23496
|
+
function getDefaultBranch(path29) {
|
|
23497
|
+
const output = exec("git remote show origin", { cwd: path29 });
|
|
23512
23498
|
const match2 = output.match(/HEAD branch: (.+)/);
|
|
23513
23499
|
return match2 ? match2[1].trim() : "master";
|
|
23514
23500
|
}
|
|
@@ -23702,14 +23688,14 @@ function getWorkspacePackages(rootPath, includeRoot = false) {
|
|
|
23702
23688
|
var fs6 = __toESM(require("fs"));
|
|
23703
23689
|
var import_path2 = require("path");
|
|
23704
23690
|
function validateDirectory(rootDir) {
|
|
23705
|
-
const
|
|
23706
|
-
if (!fs6.existsSync(
|
|
23707
|
-
throw new InvalidArgumentError(`Not a valid file path!: ${
|
|
23691
|
+
const path29 = (0, import_path2.resolve)(rootDir);
|
|
23692
|
+
if (!fs6.existsSync(path29)) {
|
|
23693
|
+
throw new InvalidArgumentError(`Not a valid file path!: ${path29}`);
|
|
23708
23694
|
}
|
|
23709
|
-
if (!fs6.statSync(
|
|
23710
|
-
throw new InvalidArgumentError(`Not a directory!: ${
|
|
23695
|
+
if (!fs6.statSync(path29).isDirectory()) {
|
|
23696
|
+
throw new InvalidArgumentError(`Not a directory!: ${path29}`);
|
|
23711
23697
|
}
|
|
23712
|
-
return
|
|
23698
|
+
return path29;
|
|
23713
23699
|
}
|
|
23714
23700
|
function validateGitDirectory(repository) {
|
|
23715
23701
|
const repoPath = validateDirectory(repository);
|
|
@@ -23765,12 +23751,12 @@ async function getFiles(rootDir, options) {
|
|
|
23765
23751
|
});
|
|
23766
23752
|
return resolveFiles(result2);
|
|
23767
23753
|
}
|
|
23768
|
-
|
|
23769
|
-
|
|
23754
|
+
const changedFiles = options.type === "changes" ? getChangesComparedToDefaultBranch(rootDir) : getChangesOfLastCommit(rootDir);
|
|
23755
|
+
let relativeFiles = changedFiles.map((file) => path8.relative(rootDir, file)).filter(filter(includePattern));
|
|
23770
23756
|
excludePattern.forEach((pattern) => {
|
|
23771
|
-
|
|
23757
|
+
relativeFiles = relativeFiles.filter(filter(`!${pattern}`));
|
|
23772
23758
|
});
|
|
23773
|
-
const result =
|
|
23759
|
+
const result = relativeFiles.filter((file) => fs7.existsSync(path8.resolve(rootDir, file)));
|
|
23774
23760
|
return resolveFiles(result);
|
|
23775
23761
|
}
|
|
23776
23762
|
function validate(rootDir, files, options) {
|
|
@@ -23897,67 +23883,14 @@ function isDateValidationResult(object) {
|
|
|
23897
23883
|
return "currentStartYear" in object && "expectedEndYear" in object;
|
|
23898
23884
|
}
|
|
23899
23885
|
|
|
23900
|
-
// src/commands/coverage-report.ts
|
|
23901
|
-
var fs8 = __toESM(require("fs"));
|
|
23902
|
-
var path9 = __toESM(require("path"));
|
|
23903
|
-
var CoverageReportCommand = baseCommand().name("coverageReport").description("Generate a test coverage report for a glsp component").option("-p, --projectRoot <projectRoot>", "The root directory of the GLSP component", validateDirectory, process.cwd()).option("-c, --coverageScript <script>", "Script command of the package root for creating coverage reports", "test:coverage").action(generateCoverageReport);
|
|
23904
|
-
async function generateCoverageReport(options) {
|
|
23905
|
-
cd(options.projectRoot);
|
|
23906
|
-
const packages = validateAndRetrievePackages(options);
|
|
23907
|
-
const jsonReports = await collectPackageReportFiles(packages, options);
|
|
23908
|
-
combineReports(jsonReports, options);
|
|
23909
|
-
LOGGER.info("Coverage reported generation successful");
|
|
23910
|
-
LOGGER.info(`HTML report available at: ${options.projectRoot}/coverage/index.html`);
|
|
23911
|
-
}
|
|
23912
|
-
function validateAndRetrievePackages(options) {
|
|
23913
|
-
exec("pnpm exec nyc -h", { silent: true, errorMsg: "Nyc is not installed!" });
|
|
23914
|
-
const workspacePackages = getWorkspacePackages(options.projectRoot, true);
|
|
23915
|
-
const rootPackage = workspacePackages.pop();
|
|
23916
|
-
if (!rootPackage.hasScript(options.coverageScript)) {
|
|
23917
|
-
CoverageReportCommand.error(
|
|
23918
|
-
`Invalid coverage script! The root package.json does not have a script with name '${options.coverageScript}'!`
|
|
23919
|
-
);
|
|
23920
|
-
}
|
|
23921
|
-
return workspacePackages;
|
|
23922
|
-
}
|
|
23923
|
-
async function collectPackageReportFiles(packages, options) {
|
|
23924
|
-
LOGGER.info("Create individual package coverage reports");
|
|
23925
|
-
await execAsync(`pnpm run ${options.coverageScript}`, { silent: false });
|
|
23926
|
-
const reports = packages.flatMap((pkg) => findFiles(pkg.location, "**/coverage-final.json"));
|
|
23927
|
-
LOGGER.info(`Collected ${reports.length} coverage reports from ${packages.length} packages`);
|
|
23928
|
-
return reports;
|
|
23929
|
-
}
|
|
23930
|
-
async function combineReports(reportFiles, options) {
|
|
23931
|
-
LOGGER.info("Create combined coverage report");
|
|
23932
|
-
const reportsDir = path9.join(options.projectRoot, ".nyc_output");
|
|
23933
|
-
if (fs8.existsSync(reportsDir)) {
|
|
23934
|
-
fs8.rmSync(reportsDir, { force: true, recursive: true });
|
|
23935
|
-
}
|
|
23936
|
-
fs8.mkdirSync(reportsDir);
|
|
23937
|
-
for (let i = 0; i < reportFiles.length; i++) {
|
|
23938
|
-
fs8.copyFileSync(reportFiles[i], path9.resolve(".nyc_output", `coverage-final-${i}.json`));
|
|
23939
|
-
}
|
|
23940
|
-
cd(options.projectRoot);
|
|
23941
|
-
const configFiles = [".nycrc", ".nycrc.json", ".nyc-config.js"];
|
|
23942
|
-
const tempFiles = [];
|
|
23943
|
-
configFiles.forEach((config) => {
|
|
23944
|
-
if (fs8.existsSync(path9.join(options.projectRoot, config))) {
|
|
23945
|
-
moveFile(config, "_" + config);
|
|
23946
|
-
tempFiles.push("_" + config);
|
|
23947
|
-
}
|
|
23948
|
-
});
|
|
23949
|
-
await execAsync("pnpm exec nyc report --reporter html", { silent: false });
|
|
23950
|
-
tempFiles.forEach((config) => moveFile(config, config.substring(1)));
|
|
23951
|
-
}
|
|
23952
|
-
|
|
23953
23886
|
// src/commands/generate-index.ts
|
|
23954
|
-
var
|
|
23887
|
+
var fs8 = __toESM(require("fs"));
|
|
23955
23888
|
var os3 = __toESM(require("os"));
|
|
23956
|
-
var
|
|
23889
|
+
var path9 = __toESM(require("path"));
|
|
23957
23890
|
var GenerateIndex = baseCommand().name("generateIndex").description("Generate index files in a given source directory.").argument("<rootDir...>", "The source directory for index generation.").option("-s, --singleIndex", "Generate a single index file in the source directory instead of indices in each sub-directory", false).option("-f, --forceOverwrite", "Overwrite existing index files and remove them if there are no entries", false).option("-m, --match [match patterns...]", "File patterns to consider during indexing", ["**/*.ts", "**/*.tsx"]).option("-i, --ignore [ignore patterns...]", "File patterns to ignore during indexing", ["**/*.spec.ts", "**/*.spec.tsx", "**/*.d.ts"]).addOption(createOption("--style <importStyle>", "Import Style").choices(["commonjs", "esm"]).default("commonjs")).option("--ignoreFile <ignoreFile>", "The file that is used to specify patterns that should be ignored during indexing", ".indexignore").option("-v, --verbose", "Generate verbose output during generation", false).action(generateIndices);
|
|
23958
23891
|
async function generateIndices(rootDirs, options) {
|
|
23959
23892
|
configureLogger(options.verbose);
|
|
23960
|
-
const dirs = rootDirs.map((rootDir) => validateDirectory(
|
|
23893
|
+
const dirs = rootDirs.map((rootDir) => validateDirectory(path9.resolve(rootDir)));
|
|
23961
23894
|
dirs.forEach((dir) => generateIndex(dir, options));
|
|
23962
23895
|
}
|
|
23963
23896
|
function generateIndex(rootDir, options) {
|
|
@@ -24010,29 +23943,29 @@ function isChildFile(parent, child2) {
|
|
|
24010
23943
|
return isFile(child2) && isChild(parent, child2) && getLevel(child2) === getLevel(parent);
|
|
24011
23944
|
}
|
|
24012
23945
|
function writeIndex(directory, exports2, options) {
|
|
24013
|
-
const indexFile =
|
|
23946
|
+
const indexFile = path9.join(process.cwd(), directory, "index.ts");
|
|
24014
23947
|
if (exports2.length === 0) {
|
|
24015
|
-
if (options.forceOverwrite &&
|
|
23948
|
+
if (options.forceOverwrite && fs8.existsSync(indexFile)) {
|
|
24016
23949
|
LOGGER.info("Remove index file", indexFile);
|
|
24017
|
-
|
|
23950
|
+
fs8.rmSync(indexFile);
|
|
24018
23951
|
}
|
|
24019
23952
|
return;
|
|
24020
23953
|
}
|
|
24021
|
-
const exists =
|
|
23954
|
+
const exists = fs8.existsSync(indexFile);
|
|
24022
23955
|
if (exists && !options.forceOverwrite) {
|
|
24023
23956
|
LOGGER.info("Do not overwrite existing index file. Use '-f' to force an overwrite.", indexFile);
|
|
24024
23957
|
return;
|
|
24025
23958
|
}
|
|
24026
|
-
const headerContent = exists ? extractReusableContent(
|
|
23959
|
+
const headerContent = exists ? extractReusableContent(fs8.readFileSync(indexFile, { encoding: "utf-8" })) : "";
|
|
24027
23960
|
const exportContent = exports2.map((exported) => createExport(directory, exported, options)).sort();
|
|
24028
23961
|
const content = headerContent + exportContent.join(os3.EOL) + os3.EOL;
|
|
24029
23962
|
LOGGER.info((exists ? "Overwrite" : "Write") + " index file", indexFile);
|
|
24030
23963
|
LOGGER.debug(" " + content.split(os3.EOL).join(os3.EOL + " "));
|
|
24031
|
-
|
|
23964
|
+
fs8.writeFileSync(indexFile, content, { flag: "w" });
|
|
24032
23965
|
}
|
|
24033
23966
|
function createExport(directory, relativePath, options) {
|
|
24034
23967
|
const parentPrefix = directory.length;
|
|
24035
|
-
const suffix = isFile(relativePath) ?
|
|
23968
|
+
const suffix = isFile(relativePath) ? path9.extname(relativePath).length : 1;
|
|
24036
23969
|
const relativeName = relativePath.substring(parentPrefix, relativePath.length - suffix);
|
|
24037
23970
|
const exportName = options.style === "esm" && isFile(relativePath) ? relativeName + ".js" : relativeName;
|
|
24038
23971
|
const exportLine = `export * from './${exportName}';`;
|
|
@@ -24043,10 +23976,10 @@ function extractReusableContent(fileContent) {
|
|
|
24043
23976
|
}
|
|
24044
23977
|
|
|
24045
23978
|
// src/commands/releng/prepare.ts
|
|
24046
|
-
var
|
|
23979
|
+
var path12 = __toESM(require("path"));
|
|
24047
23980
|
|
|
24048
23981
|
// src/commands/releng/common.ts
|
|
24049
|
-
var
|
|
23982
|
+
var path10 = __toESM(require("path"));
|
|
24050
23983
|
var semver = __toESM(require_semver2());
|
|
24051
23984
|
var VersionType;
|
|
24052
23985
|
((VersionType2) => {
|
|
@@ -24107,13 +24040,13 @@ function getLocalVersion(repoDir, repo) {
|
|
|
24107
24040
|
if (repo === "glsp-server") {
|
|
24108
24041
|
return getVersionFromPom(repoDir);
|
|
24109
24042
|
} else if (repo === "glsp-eclipse-integration") {
|
|
24110
|
-
return getVersionFromPom(
|
|
24043
|
+
return getVersionFromPom(path10.resolve(repoDir, "server"));
|
|
24111
24044
|
} else {
|
|
24112
24045
|
return getVersionFromPackage(repoDir);
|
|
24113
24046
|
}
|
|
24114
24047
|
}
|
|
24115
24048
|
function getVersionFromPom(repoDir) {
|
|
24116
|
-
const pom = readFile(
|
|
24049
|
+
const pom = readFile(path10.resolve(repoDir, "pom.xml"));
|
|
24117
24050
|
const match2 = pom.match(/<version>(.*?)<\/version>/);
|
|
24118
24051
|
if (!match2) {
|
|
24119
24052
|
throw new Error(`Could not find version in pom.xml of ${repoDir}`);
|
|
@@ -24121,7 +24054,7 @@ function getVersionFromPom(repoDir) {
|
|
|
24121
24054
|
return match2[1];
|
|
24122
24055
|
}
|
|
24123
24056
|
function getVersionFromPackage(repoDir) {
|
|
24124
|
-
const rootPkg = readPackage(
|
|
24057
|
+
const rootPkg = readPackage(path10.resolve(repoDir, "package.json"));
|
|
24125
24058
|
const existingVersion = rootPkg.content.version;
|
|
24126
24059
|
if (!existingVersion) {
|
|
24127
24060
|
throw new Error(`No version found in package.json of ${repoDir}`);
|
|
@@ -24187,7 +24120,7 @@ function getChangeLogChanges(options) {
|
|
|
24187
24120
|
}
|
|
24188
24121
|
|
|
24189
24122
|
// src/commands/releng/version.ts
|
|
24190
|
-
var
|
|
24123
|
+
var path11 = __toESM(require("path"));
|
|
24191
24124
|
var semver2 = __toESM(require_semver2());
|
|
24192
24125
|
var VersionCommand = baseCommand().name("version").description("Set the version of all packages in a GLSP repository").addArgument(new Argument("<versionType>", "The version type").choices(VersionType.choices)).argument("[customVersion]", 'Custom version number. Will be ignored if the release type is not "custom"').option("-v, --verbose", "Enable verbose (debug) log output", false).option("-r, --repoDir <repoDir>", "Path to the component repository", validateGitDirectory, process.cwd()).action((versionType, customVersion, cmdOptions) => {
|
|
24193
24126
|
configureEnv(cmdOptions);
|
|
@@ -24292,7 +24225,7 @@ function createTheiaCompatTable(rows) {
|
|
|
24292
24225
|
async function setVersionJavaServer(options) {
|
|
24293
24226
|
LOGGER.info(`Set pom/Manifest versions to ${options.mvnVersion} ...`);
|
|
24294
24227
|
LOGGER.debug("Preprocessing eclipse-plugins poms");
|
|
24295
|
-
const pluginPoms = exec("grep -ril --include pom.xml \\${package-type}").split("\n").map((f) =>
|
|
24228
|
+
const pluginPoms = exec("grep -ril --include pom.xml \\${package-type}").split("\n").map((f) => path11.resolve(f));
|
|
24296
24229
|
console.log(pluginPoms);
|
|
24297
24230
|
pluginPoms.forEach((pom) => replaceInFile(pom, /\${package-type}/, "eclipse-plugin"));
|
|
24298
24231
|
LOGGER.debug("Preprocessing complete");
|
|
@@ -24312,19 +24245,19 @@ async function setVersionEclipseIntegration(options) {
|
|
|
24312
24245
|
}
|
|
24313
24246
|
function setVersionEclipseClient(options) {
|
|
24314
24247
|
LOGGER.debug("Set client package.json versions ...");
|
|
24315
|
-
const clientPath =
|
|
24248
|
+
const clientPath = path11.join(options.repoDir, "client");
|
|
24316
24249
|
cd(clientPath);
|
|
24317
24250
|
setVersionNpm({
|
|
24318
24251
|
...options,
|
|
24319
24252
|
repoDir: clientPath,
|
|
24320
24253
|
version: options.version,
|
|
24321
|
-
workspacePackages: getWorkspacePackages(
|
|
24254
|
+
workspacePackages: getWorkspacePackages(path11.join(options.repoDir, "client"), true)
|
|
24322
24255
|
});
|
|
24323
24256
|
cd(options.repoDir);
|
|
24324
24257
|
}
|
|
24325
24258
|
async function setVersionEclipseServer(options) {
|
|
24326
24259
|
LOGGER.debug("Set server pom.xml versions ...");
|
|
24327
|
-
cd(
|
|
24260
|
+
cd(path11.join(options.repoDir, "server"));
|
|
24328
24261
|
await execAsync(`mvn tycho-versions:set-version -DnewVersion=${options.mvnVersion} -B`, {
|
|
24329
24262
|
silent: false,
|
|
24330
24263
|
errorMsg: "Tycho set-versions failed"
|
|
@@ -24339,13 +24272,13 @@ function updateEclipseServerMetadata(options) {
|
|
|
24339
24272
|
p2Location = `nightly/${semver2.major(options.version)}.${semver2.minor(options.version)}/`;
|
|
24340
24273
|
}
|
|
24341
24274
|
const p2LocationUrl = `https://download.eclipse.org/glsp/server/p2/${p2Location}`;
|
|
24342
|
-
const targetDir =
|
|
24275
|
+
const targetDir = path11.join(options.repoDir, "server/releng/org.eclipse.glsp.ide.releng.target");
|
|
24343
24276
|
const targetFiles = findFiles(targetDir, "*.target");
|
|
24344
24277
|
const tpdFiles = findFiles(targetDir, "*.tpd");
|
|
24345
24278
|
targetFiles.forEach((target) => {
|
|
24346
24279
|
LOGGER.debug(`Update ${target} file`);
|
|
24347
24280
|
replaceInFile(
|
|
24348
|
-
|
|
24281
|
+
path11.resolve(targetDir, `${target}`),
|
|
24349
24282
|
/<repository location="https:\/\/download\.eclipse\.org\/glsp\/server\/p2\/.*?"/,
|
|
24350
24283
|
`<repository location="${p2LocationUrl}"`
|
|
24351
24284
|
);
|
|
@@ -24353,12 +24286,12 @@ function updateEclipseServerMetadata(options) {
|
|
|
24353
24286
|
tpdFiles.forEach((tpd) => {
|
|
24354
24287
|
LOGGER.debug(`Update ${tpd} file`);
|
|
24355
24288
|
replaceInFile(
|
|
24356
|
-
|
|
24289
|
+
path11.resolve(targetDir, `${tpd}`),
|
|
24357
24290
|
/location "https:\/\/download\.eclipse\.org\/glsp\/server\/p2\/.*?"/g,
|
|
24358
24291
|
`location "${p2LocationUrl}"`
|
|
24359
24292
|
);
|
|
24360
24293
|
});
|
|
24361
|
-
const categoryXmlPath =
|
|
24294
|
+
const categoryXmlPath = path11.join(options.repoDir, "server/releng/org.eclipse.glsp.ide.repository/category.xml");
|
|
24362
24295
|
LOGGER.debug(`Update ${categoryXmlPath} file`);
|
|
24363
24296
|
replaceInFile(
|
|
24364
24297
|
categoryXmlPath,
|
|
@@ -24466,7 +24399,7 @@ async function buildJavaServer(options) {
|
|
|
24466
24399
|
LOGGER.debug("Build succeeded");
|
|
24467
24400
|
}
|
|
24468
24401
|
async function buildEclipseIntegration(options) {
|
|
24469
|
-
const clientDir =
|
|
24402
|
+
const clientDir = path12.resolve(options.repoDir, "client");
|
|
24470
24403
|
LOGGER.info("[Client] Install & Build with pnpm");
|
|
24471
24404
|
await execAsync("pnpm install", { silent: false, cwd: clientDir, errorMsg: "Client install failed" });
|
|
24472
24405
|
await execAsync("pnpm run --if-present build", { silent: false, cwd: clientDir, errorMsg: "Client build failed" });
|
|
@@ -24474,7 +24407,7 @@ async function buildEclipseIntegration(options) {
|
|
|
24474
24407
|
LOGGER.info("Build Server(P2)");
|
|
24475
24408
|
await execAsync("mvn clean install -B", {
|
|
24476
24409
|
silent: false,
|
|
24477
|
-
cwd:
|
|
24410
|
+
cwd: path12.resolve(options.repoDir, "server"),
|
|
24478
24411
|
errorMsg: "Server build failed"
|
|
24479
24412
|
});
|
|
24480
24413
|
LOGGER.debug("Build successful");
|
|
@@ -24541,9 +24474,13 @@ Note: This pull request was created automatically. After merging, the automated
|
|
|
24541
24474
|
}
|
|
24542
24475
|
|
|
24543
24476
|
// src/commands/releng/publish.ts
|
|
24544
|
-
var
|
|
24545
|
-
var
|
|
24546
|
-
var PublishCommand = baseCommand().name("publish").description("Publish all workspace packages of a GLSP repository via `pnpm publish`").addArgument(new Argument("<distTag>", "The npm dist-tag to publish under").choices(["next", "latest"])).option("-v, --verbose", "Enable verbose (debug) log output", false).option("-r, --repoDir <repoDir>", "Path to the component repository", validateGitDirectory, process.cwd()).option("--dry-run", "Derive versions and run `pnpm publish` in dry-run mode without applying changes", false).option("--registry <url>", "Publish to a custom npm registry (e.g. a local verdaccio for testing)").
|
|
24477
|
+
var fs9 = __toESM(require("fs"));
|
|
24478
|
+
var path13 = __toESM(require("path"));
|
|
24479
|
+
var PublishCommand = baseCommand().name("publish").description("Publish all workspace packages of a GLSP repository via `pnpm publish`").addArgument(new Argument("<distTag>", "The npm dist-tag to publish under").choices(["next", "latest"])).option("-v, --verbose", "Enable verbose (debug) log output", false).option("-r, --repoDir <repoDir>", "Path to the component repository", validateGitDirectory, process.cwd()).option("--dry-run", "Derive versions and run `pnpm publish` in dry-run mode without applying changes", false).option("--registry <url>", "Publish to a custom npm registry (e.g. a local verdaccio for testing)").option(
|
|
24480
|
+
"--interactive",
|
|
24481
|
+
"Bump versions but do not publish; print the `pnpm publish` command to run manually in an interactive shell (e.g. for npm 2FA/OTP prompts)",
|
|
24482
|
+
false
|
|
24483
|
+
).action((distTag, cmdOptions) => {
|
|
24547
24484
|
configureEnv(cmdOptions);
|
|
24548
24485
|
return publish(distTag, cmdOptions);
|
|
24549
24486
|
});
|
|
@@ -24593,24 +24530,32 @@ async function publishLatest(options) {
|
|
|
24593
24530
|
await pnpmPublish("latest", options);
|
|
24594
24531
|
}
|
|
24595
24532
|
async function pnpmPublish(distTag, options) {
|
|
24596
|
-
let cmd = `pnpm publish -r --tag ${distTag} --no-git-checks
|
|
24533
|
+
let cmd = `pnpm publish -r --tag ${distTag} --no-git-checks`;
|
|
24597
24534
|
if (options.dryRun) {
|
|
24598
24535
|
cmd += " --dry-run";
|
|
24599
24536
|
}
|
|
24600
24537
|
if (options.registry) {
|
|
24601
24538
|
cmd += ` --registry ${options.registry}`;
|
|
24602
24539
|
}
|
|
24540
|
+
if (options.interactive) {
|
|
24541
|
+
LOGGER.info("Versions bumped. Run the following command in an interactive shell to publish:");
|
|
24542
|
+
LOGGER.info(`
|
|
24543
|
+
${cmd}
|
|
24544
|
+
`);
|
|
24545
|
+
return;
|
|
24546
|
+
}
|
|
24547
|
+
cmd += " --report-summary";
|
|
24603
24548
|
await execAsync(cmd, { cwd: options.repoDir, silent: false, errorMsg: "pnpm publish failed" });
|
|
24604
24549
|
reportPublishSummary(options);
|
|
24605
24550
|
}
|
|
24606
24551
|
function reportPublishSummary(options) {
|
|
24607
|
-
const summaryPath =
|
|
24608
|
-
if (!
|
|
24552
|
+
const summaryPath = path13.resolve(options.repoDir, "pnpm-publish-summary.json");
|
|
24553
|
+
if (!fs9.existsSync(summaryPath)) {
|
|
24609
24554
|
LOGGER.warn("No pnpm publish summary found.");
|
|
24610
24555
|
return;
|
|
24611
24556
|
}
|
|
24612
24557
|
try {
|
|
24613
|
-
const summary = JSON.parse(
|
|
24558
|
+
const summary = JSON.parse(fs9.readFileSync(summaryPath, "utf8"));
|
|
24614
24559
|
const published = summary.publishedPackages ?? [];
|
|
24615
24560
|
if (published.length === 0) {
|
|
24616
24561
|
LOGGER.warn("No packages were published.");
|
|
@@ -24619,7 +24564,7 @@ function reportPublishSummary(options) {
|
|
|
24619
24564
|
published.forEach((pkg) => LOGGER.info(` - ${pkg.name}@${pkg.version}`));
|
|
24620
24565
|
}
|
|
24621
24566
|
} finally {
|
|
24622
|
-
|
|
24567
|
+
fs9.rmSync(summaryPath, { force: true });
|
|
24623
24568
|
}
|
|
24624
24569
|
}
|
|
24625
24570
|
|
|
@@ -24627,11 +24572,11 @@ function reportPublishSummary(options) {
|
|
|
24627
24572
|
var RelengCommand = baseCommand().name("releng").description("Commands for GLSP release engineering (Linux only, intended for CI/Maintainer use).").addCommand(VersionCommand).addCommand(PrepareReleaseCommand).addCommand(PublishCommand);
|
|
24628
24573
|
|
|
24629
24574
|
// src/commands/repo/build.ts
|
|
24630
|
-
var
|
|
24575
|
+
var path15 = __toESM(require("path"));
|
|
24631
24576
|
|
|
24632
24577
|
// src/commands/repo/common/utils.ts
|
|
24633
|
-
var
|
|
24634
|
-
var
|
|
24578
|
+
var fs10 = __toESM(require("fs"));
|
|
24579
|
+
var path14 = __toESM(require("path"));
|
|
24635
24580
|
var readline = __toESM(require("readline"));
|
|
24636
24581
|
var GLSP_GITHUB_ORG = "eclipse-glsp";
|
|
24637
24582
|
var THEIA_URL = "http://localhost:3000";
|
|
@@ -24641,7 +24586,7 @@ function configureRepoEnv(options) {
|
|
|
24641
24586
|
configureEnv(options);
|
|
24642
24587
|
}
|
|
24643
24588
|
function validateReposExist(repos, dir) {
|
|
24644
|
-
const missing = repos.filter((repo) => !
|
|
24589
|
+
const missing = repos.filter((repo) => !fs10.existsSync(path14.resolve(dir, repo)));
|
|
24645
24590
|
if (missing.length > 0) {
|
|
24646
24591
|
throw new Error(`The following repositories are not cloned in '${dir}': ${missing.join(", ")}. Run 'glsp repo clone' first.`);
|
|
24647
24592
|
}
|
|
@@ -24651,34 +24596,34 @@ function formatError(error) {
|
|
|
24651
24596
|
}
|
|
24652
24597
|
function resolveWorkspaceDir(cliDir) {
|
|
24653
24598
|
if (cliDir) {
|
|
24654
|
-
return
|
|
24599
|
+
return path14.resolve(cliDir);
|
|
24655
24600
|
}
|
|
24656
|
-
let current =
|
|
24657
|
-
const root =
|
|
24601
|
+
let current = path14.resolve(process.cwd());
|
|
24602
|
+
const root = path14.parse(current).root;
|
|
24658
24603
|
while (current !== root) {
|
|
24659
24604
|
if (discoverRepos(current).length > 0) {
|
|
24660
24605
|
return current;
|
|
24661
24606
|
}
|
|
24662
|
-
if (GLSPRepo.is(
|
|
24663
|
-
return
|
|
24607
|
+
if (GLSPRepo.is(path14.basename(current))) {
|
|
24608
|
+
return path14.dirname(current);
|
|
24664
24609
|
}
|
|
24665
|
-
current =
|
|
24610
|
+
current = path14.dirname(current);
|
|
24666
24611
|
}
|
|
24667
24612
|
return process.cwd();
|
|
24668
24613
|
}
|
|
24669
24614
|
function resolveRepoDir(repo, cliDir) {
|
|
24670
24615
|
const workspaceDir = resolveWorkspaceDir(cliDir);
|
|
24671
|
-
const repoDir =
|
|
24672
|
-
if (!
|
|
24616
|
+
const repoDir = path14.resolve(workspaceDir, repo);
|
|
24617
|
+
if (!fs10.existsSync(repoDir) && path14.basename(workspaceDir) === repo) {
|
|
24673
24618
|
return workspaceDir;
|
|
24674
24619
|
}
|
|
24675
24620
|
return repoDir;
|
|
24676
24621
|
}
|
|
24677
24622
|
function discoverRepos(dir) {
|
|
24678
|
-
if (!
|
|
24623
|
+
if (!fs10.existsSync(dir)) {
|
|
24679
24624
|
return [];
|
|
24680
24625
|
}
|
|
24681
|
-
return
|
|
24626
|
+
return fs10.readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && GLSPRepo.is(entry.name)).map((entry) => entry.name).sort((a, b) => GLSPRepo.choices.indexOf(a) - GLSPRepo.choices.indexOf(b));
|
|
24682
24627
|
}
|
|
24683
24628
|
function resolveTargetRepos(options) {
|
|
24684
24629
|
const dir = resolveWorkspaceDir(options.dir);
|
|
@@ -24727,9 +24672,9 @@ function isLeafRepo(repo) {
|
|
|
24727
24672
|
function prompt(question) {
|
|
24728
24673
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
24729
24674
|
return new Promise(
|
|
24730
|
-
(
|
|
24675
|
+
(resolve26) => rl.question(question, (answer) => {
|
|
24731
24676
|
rl.close();
|
|
24732
|
-
|
|
24677
|
+
resolve26(answer);
|
|
24733
24678
|
})
|
|
24734
24679
|
);
|
|
24735
24680
|
}
|
|
@@ -24738,7 +24683,7 @@ function discoverNewestFile(pattern, dir, errorMsg) {
|
|
|
24738
24683
|
if (files.length === 0) {
|
|
24739
24684
|
throw new Error(errorMsg);
|
|
24740
24685
|
}
|
|
24741
|
-
return files.reduce((newest, file) =>
|
|
24686
|
+
return files.reduce((newest, file) => fs10.statSync(file).mtimeMs > fs10.statSync(newest).mtimeMs ? file : newest);
|
|
24742
24687
|
}
|
|
24743
24688
|
|
|
24744
24689
|
// src/commands/repo/build.ts
|
|
@@ -24757,7 +24702,7 @@ async function installAndBuildNpm(repoDir, execOpts, install) {
|
|
|
24757
24702
|
await buildNpm2(repoDir, execOpts);
|
|
24758
24703
|
}
|
|
24759
24704
|
async function buildSingleRepo(repo, options) {
|
|
24760
|
-
const repoDir =
|
|
24705
|
+
const repoDir = path15.resolve(options.dir, repo);
|
|
24761
24706
|
const npmOpts = { cwd: repoDir, verbose: options.verbose, silent: false, env: { FORCE_COLOR: "1" } };
|
|
24762
24707
|
const mvnOpts = { cwd: repoDir, verbose: options.verbose, silent: false };
|
|
24763
24708
|
const install = options.install ?? true;
|
|
@@ -24779,10 +24724,10 @@ async function buildSingleRepo(repo, options) {
|
|
|
24779
24724
|
}
|
|
24780
24725
|
case "glsp-eclipse-integration": {
|
|
24781
24726
|
LOGGER.debug("Build client");
|
|
24782
|
-
await installAndBuildNpm(
|
|
24727
|
+
await installAndBuildNpm(path15.join(repoDir, "client"), npmOpts, install);
|
|
24783
24728
|
if (java) {
|
|
24784
24729
|
LOGGER.debug("Maven build for server");
|
|
24785
|
-
await execAsync("mvn clean verify -Dstyle.color=always -B", { ...mvnOpts, cwd:
|
|
24730
|
+
await execAsync("mvn clean verify -Dstyle.color=always -B", { ...mvnOpts, cwd: path15.join(repoDir, "server") });
|
|
24786
24731
|
}
|
|
24787
24732
|
break;
|
|
24788
24733
|
}
|
|
@@ -24860,8 +24805,8 @@ var BuildCommand = baseCommand().name("build").description("Build repositories (
|
|
|
24860
24805
|
});
|
|
24861
24806
|
|
|
24862
24807
|
// src/commands/repo/clone.ts
|
|
24863
|
-
var
|
|
24864
|
-
var
|
|
24808
|
+
var fs11 = __toESM(require("fs"));
|
|
24809
|
+
var path16 = __toESM(require("path"));
|
|
24865
24810
|
|
|
24866
24811
|
// src/commands/repo/common/fork-utils.ts
|
|
24867
24812
|
function forkExists(user, repo) {
|
|
@@ -24938,8 +24883,8 @@ async function confirm(message) {
|
|
|
24938
24883
|
|
|
24939
24884
|
// src/commands/repo/clone.ts
|
|
24940
24885
|
async function cloneSingleRepo(repo, options) {
|
|
24941
|
-
const targetDir =
|
|
24942
|
-
if (
|
|
24886
|
+
const targetDir = path16.resolve(options.dir, repo);
|
|
24887
|
+
if (fs11.existsSync(targetDir)) {
|
|
24943
24888
|
if (!options.override) {
|
|
24944
24889
|
LOGGER.warn(`Skipping ${repo}: target directory already exists (use --override to replace): ${targetDir}`);
|
|
24945
24890
|
return false;
|
|
@@ -24948,16 +24893,16 @@ async function cloneSingleRepo(repo, options) {
|
|
|
24948
24893
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
24949
24894
|
const renamed = `${targetDir}_${timestamp}`;
|
|
24950
24895
|
LOGGER.info(`Renaming existing directory ${targetDir} \u2192 ${renamed}`);
|
|
24951
|
-
|
|
24896
|
+
fs11.renameSync(targetDir, renamed);
|
|
24952
24897
|
} else if (options.override === "remove") {
|
|
24953
24898
|
LOGGER.info(`Removing existing directory ${targetDir}`);
|
|
24954
|
-
|
|
24899
|
+
fs11.rmSync(targetDir, { recursive: true, force: true });
|
|
24955
24900
|
}
|
|
24956
24901
|
}
|
|
24957
24902
|
if (options.fork) {
|
|
24958
24903
|
await ensureFork(options.fork, repo);
|
|
24959
24904
|
}
|
|
24960
|
-
|
|
24905
|
+
fs11.mkdirSync(path16.dirname(targetDir), { recursive: true });
|
|
24961
24906
|
const org = options.fork ?? GLSP_GITHUB_ORG;
|
|
24962
24907
|
LOGGER.info(`Cloning ${org}/${repo} into ${targetDir}`);
|
|
24963
24908
|
if (options.protocol === "gh") {
|
|
@@ -25088,8 +25033,8 @@ Preset (${PRESET_NAMES.join("/")}): `);
|
|
|
25088
25033
|
}
|
|
25089
25034
|
|
|
25090
25035
|
// src/commands/repo/fork.ts
|
|
25091
|
-
var
|
|
25092
|
-
var
|
|
25036
|
+
var fs12 = __toESM(require("fs"));
|
|
25037
|
+
var path17 = __toESM(require("path"));
|
|
25093
25038
|
async function configureForkRemote(repo, repoDir, user, protocol) {
|
|
25094
25039
|
const remotes = getRemotes(repoDir);
|
|
25095
25040
|
const action = analyzeForkRemotes(remotes, user, repo);
|
|
@@ -25126,8 +25071,8 @@ var ForkCommand = baseCommand().name("fork").description("Add fork remotes to al
|
|
|
25126
25071
|
const protocol = cli.protocol ?? resolveDefaultProtocol();
|
|
25127
25072
|
let failures = 0;
|
|
25128
25073
|
for (const repo of repos) {
|
|
25129
|
-
const repoDir =
|
|
25130
|
-
if (!
|
|
25074
|
+
const repoDir = path17.resolve(dir, repo);
|
|
25075
|
+
if (!fs12.existsSync(repoDir)) {
|
|
25131
25076
|
LOGGER.warn(`${repo}: not cloned at ${repoDir}, skipping`);
|
|
25132
25077
|
continue;
|
|
25133
25078
|
}
|
|
@@ -25144,9 +25089,9 @@ var ForkCommand = baseCommand().name("fork").description("Add fork remotes to al
|
|
|
25144
25089
|
});
|
|
25145
25090
|
|
|
25146
25091
|
// src/commands/repo/link.ts
|
|
25147
|
-
var
|
|
25092
|
+
var fs13 = __toESM(require("fs"));
|
|
25148
25093
|
var import_module = require("module");
|
|
25149
|
-
var
|
|
25094
|
+
var path18 = __toESM(require("path"));
|
|
25150
25095
|
var YAML = __toESM(require_dist());
|
|
25151
25096
|
var SINGLETON_DEPS = ["sprotty", "sprotty-protocol", "vscode-jsonrpc", "inversify"];
|
|
25152
25097
|
var PNPM_EXEC_OPTS = { silent: false, env: { FORCE_COLOR: "1" } };
|
|
@@ -25165,7 +25110,7 @@ var WORKSPACE_SUBDIR = {
|
|
|
25165
25110
|
};
|
|
25166
25111
|
function resolveLinkWorkspaceDir(repoDir, repo) {
|
|
25167
25112
|
const subdir = WORKSPACE_SUBDIR[repo];
|
|
25168
|
-
return subdir ?
|
|
25113
|
+
return subdir ? path18.join(repoDir, subdir) : repoDir;
|
|
25169
25114
|
}
|
|
25170
25115
|
function filterLinkableRepos(repos) {
|
|
25171
25116
|
return repos.filter((r) => LINKABLE_REPOS.includes(r));
|
|
@@ -25184,31 +25129,31 @@ function collectProvidedPackages(repoDir) {
|
|
|
25184
25129
|
return provided;
|
|
25185
25130
|
}
|
|
25186
25131
|
function packageRootOf(entryPath, name) {
|
|
25187
|
-
let dir =
|
|
25132
|
+
let dir = path18.dirname(entryPath);
|
|
25188
25133
|
let fallback;
|
|
25189
|
-
while (dir !==
|
|
25190
|
-
const manifest =
|
|
25191
|
-
if (
|
|
25134
|
+
while (dir !== path18.dirname(dir)) {
|
|
25135
|
+
const manifest = path18.join(dir, "package.json");
|
|
25136
|
+
if (fs13.existsSync(manifest)) {
|
|
25192
25137
|
fallback ??= dir;
|
|
25193
25138
|
try {
|
|
25194
|
-
if (JSON.parse(
|
|
25139
|
+
if (JSON.parse(fs13.readFileSync(manifest, "utf8")).name === name) {
|
|
25195
25140
|
return dir;
|
|
25196
25141
|
}
|
|
25197
25142
|
} catch {
|
|
25198
25143
|
}
|
|
25199
25144
|
}
|
|
25200
|
-
if (
|
|
25145
|
+
if (path18.basename(dir) === "node_modules") {
|
|
25201
25146
|
break;
|
|
25202
25147
|
}
|
|
25203
|
-
dir =
|
|
25148
|
+
dir = path18.dirname(dir);
|
|
25204
25149
|
}
|
|
25205
25150
|
return fallback;
|
|
25206
25151
|
}
|
|
25207
25152
|
function resolveSingletonDir(fromDirs, dep) {
|
|
25208
25153
|
for (const from of fromDirs) {
|
|
25209
25154
|
try {
|
|
25210
|
-
const requireFrom = (0, import_module.createRequire)(
|
|
25211
|
-
const root = packageRootOf(
|
|
25155
|
+
const requireFrom = (0, import_module.createRequire)(path18.join(from, "package.json"));
|
|
25156
|
+
const root = packageRootOf(fs13.realpathSync(requireFrom.resolve(dep)), dep);
|
|
25212
25157
|
if (root) {
|
|
25213
25158
|
return root;
|
|
25214
25159
|
}
|
|
@@ -25225,7 +25170,7 @@ function collectSingletonLinks(clientDir) {
|
|
|
25225
25170
|
if (dir) {
|
|
25226
25171
|
links[dep] = dir;
|
|
25227
25172
|
} else {
|
|
25228
|
-
LOGGER.debug(`Singleton ${dep} not found in ${
|
|
25173
|
+
LOGGER.debug(`Singleton ${dep} not found in ${path18.basename(clientDir)}, skipping`);
|
|
25229
25174
|
}
|
|
25230
25175
|
}
|
|
25231
25176
|
return links;
|
|
@@ -25244,19 +25189,19 @@ function applyLinkOverrides(repoDir, links) {
|
|
|
25244
25189
|
if (Object.keys(links).length === 0) {
|
|
25245
25190
|
return;
|
|
25246
25191
|
}
|
|
25247
|
-
const yamlPath =
|
|
25248
|
-
const source =
|
|
25192
|
+
const yamlPath = path18.resolve(repoDir, WORKSPACE_YAML);
|
|
25193
|
+
const source = fs13.existsSync(yamlPath) ? readFile(yamlPath) : "";
|
|
25249
25194
|
const doc = source ? YAML.parseDocument(source) : new YAML.Document({});
|
|
25250
25195
|
for (const [name, target] of Object.entries(links)) {
|
|
25251
|
-
const
|
|
25252
|
-
doc.setIn(["overrides", name], `link:${
|
|
25253
|
-
LOGGER.debug(`Link ${name} -> link:${
|
|
25196
|
+
const relative4 = path18.relative(repoDir, target) || ".";
|
|
25197
|
+
doc.setIn(["overrides", name], `link:${relative4}`);
|
|
25198
|
+
LOGGER.debug(`Link ${name} -> link:${relative4}`);
|
|
25254
25199
|
}
|
|
25255
25200
|
writeFile(yamlPath, doc.toString({ indent: detectIndent(source) }));
|
|
25256
25201
|
}
|
|
25257
25202
|
function removeLinkOverrides(repoDir) {
|
|
25258
|
-
const yamlPath =
|
|
25259
|
-
if (!
|
|
25203
|
+
const yamlPath = path18.resolve(repoDir, WORKSPACE_YAML);
|
|
25204
|
+
if (!fs13.existsSync(yamlPath)) {
|
|
25260
25205
|
return false;
|
|
25261
25206
|
}
|
|
25262
25207
|
const source = readFile(yamlPath);
|
|
@@ -25298,7 +25243,7 @@ async function runLink(repos, options) {
|
|
|
25298
25243
|
if (i > 0) {
|
|
25299
25244
|
LOGGER.newLine();
|
|
25300
25245
|
}
|
|
25301
|
-
const repoDir =
|
|
25246
|
+
const repoDir = path18.resolve(options.dir, repo);
|
|
25302
25247
|
const workspaceDir = resolveLinkWorkspaceDir(repoDir, repo);
|
|
25303
25248
|
LOGGER.info(`Linking ${repo}...`);
|
|
25304
25249
|
const links = { ...providedPackages };
|
|
@@ -25353,7 +25298,7 @@ async function runUnlink(repos, options) {
|
|
|
25353
25298
|
if (i > 0) {
|
|
25354
25299
|
LOGGER.newLine();
|
|
25355
25300
|
}
|
|
25356
|
-
const repoDir =
|
|
25301
|
+
const repoDir = path18.resolve(options.dir, repo);
|
|
25357
25302
|
const workspaceDir = resolveLinkWorkspaceDir(repoDir, repo);
|
|
25358
25303
|
LOGGER.info(`Unlinking ${repo}...`);
|
|
25359
25304
|
const removed = removeLinkOverrides(workspaceDir);
|
|
@@ -25398,7 +25343,7 @@ var UnlinkCommand = baseCommand().name("unlink").description("Remove the pnpm li
|
|
|
25398
25343
|
});
|
|
25399
25344
|
|
|
25400
25345
|
// src/commands/repo/log.ts
|
|
25401
|
-
var
|
|
25346
|
+
var path19 = __toESM(require("path"));
|
|
25402
25347
|
function logSingleRepo(repoDir) {
|
|
25403
25348
|
exec("git --no-pager log -1", { cwd: repoDir, silent: false });
|
|
25404
25349
|
}
|
|
@@ -25407,7 +25352,7 @@ function createScopedLogCommand(repo) {
|
|
|
25407
25352
|
const cli = thisCmd.opts();
|
|
25408
25353
|
configureRepoEnv(cli);
|
|
25409
25354
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
25410
|
-
const repoDir =
|
|
25355
|
+
const repoDir = path19.resolve(dir, repo);
|
|
25411
25356
|
logSingleRepo(repoDir);
|
|
25412
25357
|
});
|
|
25413
25358
|
}
|
|
@@ -25421,20 +25366,20 @@ var LogCommand = baseCommand().name("log").description("Print the last commit fo
|
|
|
25421
25366
|
if (i > 0) {
|
|
25422
25367
|
LOGGER.newLine();
|
|
25423
25368
|
}
|
|
25424
|
-
const repoDir =
|
|
25369
|
+
const repoDir = path19.resolve(dir, repo);
|
|
25425
25370
|
LOGGER.label(repo);
|
|
25426
25371
|
logSingleRepo(repoDir);
|
|
25427
25372
|
}
|
|
25428
25373
|
});
|
|
25429
25374
|
|
|
25430
25375
|
// src/commands/repo/pwd.ts
|
|
25431
|
-
var
|
|
25376
|
+
var path20 = __toESM(require("path"));
|
|
25432
25377
|
function createScopedPwdCommand(repo) {
|
|
25433
25378
|
return baseCommand().name("pwd").description(`Print the resolved path for ${repo}`).option("-d, --dir <path>", "Target directory where repos are cloned").option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
25434
25379
|
const cli = thisCmd.opts();
|
|
25435
25380
|
configureRepoEnv(cli);
|
|
25436
25381
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
25437
|
-
const repoPath =
|
|
25382
|
+
const repoPath = path20.resolve(dir, repo);
|
|
25438
25383
|
process.stdout.write(repoPath + "\n");
|
|
25439
25384
|
});
|
|
25440
25385
|
}
|
|
@@ -25448,7 +25393,7 @@ var PwdCommand = baseCommand().name("pwd").description("Print resolved paths for
|
|
|
25448
25393
|
}
|
|
25449
25394
|
if (cli.raw) {
|
|
25450
25395
|
for (const repo of repos) {
|
|
25451
|
-
const repoPath =
|
|
25396
|
+
const repoPath = path20.resolve(dir, repo);
|
|
25452
25397
|
process.stdout.write(`${repo} ${repoPath}
|
|
25453
25398
|
`);
|
|
25454
25399
|
}
|
|
@@ -25456,7 +25401,7 @@ var PwdCommand = baseCommand().name("pwd").description("Print resolved paths for
|
|
|
25456
25401
|
}
|
|
25457
25402
|
const maxLen = Math.max(...repos.map((r) => r.length));
|
|
25458
25403
|
for (const repo of repos) {
|
|
25459
|
-
const repoPath =
|
|
25404
|
+
const repoPath = path20.resolve(dir, repo);
|
|
25460
25405
|
const padded = repo.padEnd(maxLen + 2);
|
|
25461
25406
|
LOGGER.info(`${padded}${repoPath}`);
|
|
25462
25407
|
}
|
|
@@ -25475,13 +25420,13 @@ var TheiaOpenCommand = baseCommand().name("open").description("Open the Theia ap
|
|
|
25475
25420
|
});
|
|
25476
25421
|
|
|
25477
25422
|
// src/commands/repo/run.ts
|
|
25478
|
-
var
|
|
25423
|
+
var path22 = __toESM(require("path"));
|
|
25479
25424
|
function createScopedRunCommand(repo) {
|
|
25480
25425
|
return baseCommand().name("run").allowUnknownOption(true).allowExcessArguments(true).description(`Run an arbitrary package.json script in ${repo}`).argument("<script>", "The script to run").option("-d, --dir <path>", "Target directory where repos are cloned").option("-v, --verbose", "Verbose output", false).action(async (script, _cmdOptions, thisCmd) => {
|
|
25481
25426
|
const cli = thisCmd.opts();
|
|
25482
25427
|
configureRepoEnv(cli);
|
|
25483
25428
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
25484
|
-
const repoDir =
|
|
25429
|
+
const repoDir = path22.resolve(dir, repo);
|
|
25485
25430
|
const passthrough = thisCmd.args.slice(1).join(" ");
|
|
25486
25431
|
const cmd = `pnpm run ${passthrough ? `${script} ${passthrough}` : script}`;
|
|
25487
25432
|
await execForeground(cmd, { cwd: repoDir, verbose: cli.verbose });
|
|
@@ -25489,13 +25434,13 @@ function createScopedRunCommand(repo) {
|
|
|
25489
25434
|
}
|
|
25490
25435
|
|
|
25491
25436
|
// src/commands/repo/server-node.ts
|
|
25492
|
-
var
|
|
25493
|
-
var
|
|
25437
|
+
var fs19 = __toESM(require("fs"));
|
|
25438
|
+
var path23 = __toESM(require("path"));
|
|
25494
25439
|
var BROWSER_BUNDLE_PATH = "examples/workflow-server-bundled-web/wf-glsp-server-webworker.js";
|
|
25495
25440
|
var NODE_BUNDLE_PATH = "examples/workflow-server-bundled/wf-glsp-server-node.js";
|
|
25496
25441
|
function resolveBundlePath(repoDir, relativePath, label) {
|
|
25497
|
-
const bundlePath =
|
|
25498
|
-
if (!
|
|
25442
|
+
const bundlePath = path23.resolve(repoDir, relativePath);
|
|
25443
|
+
if (!fs19.existsSync(bundlePath)) {
|
|
25499
25444
|
throw new Error(`${label} not found at ${bundlePath}. Run 'glsp repo server-node build' first.`);
|
|
25500
25445
|
}
|
|
25501
25446
|
return bundlePath;
|
|
@@ -25516,11 +25461,11 @@ var NodeBundleCommand = baseCommand().name("node-bundle").description("Print the
|
|
|
25516
25461
|
});
|
|
25517
25462
|
|
|
25518
25463
|
// src/commands/repo/start.ts
|
|
25519
|
-
var
|
|
25464
|
+
var path24 = __toESM(require("path"));
|
|
25520
25465
|
var JAR_TARGET_DIR = "examples/org.eclipse.glsp.example.workflow/target";
|
|
25521
25466
|
var JAR_PATTERN = "*-glsp.jar";
|
|
25522
25467
|
function discoverJar(repoDir) {
|
|
25523
|
-
const targetDir =
|
|
25468
|
+
const targetDir = path24.resolve(repoDir, JAR_TARGET_DIR);
|
|
25524
25469
|
return discoverNewestFile(JAR_PATTERN, targetDir, `No *-glsp.jar found in ${targetDir}. Run \`glsp repo server build\` first.`);
|
|
25525
25470
|
}
|
|
25526
25471
|
function collectPassthroughArgs(cmd) {
|
|
@@ -25539,7 +25484,7 @@ var TheiaStartCommand = baseCommand().name("start").allowUnknownOption(true).all
|
|
|
25539
25484
|
const cli = thisCmd.opts();
|
|
25540
25485
|
configureRepoEnv(cli);
|
|
25541
25486
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
25542
|
-
const repoDir =
|
|
25487
|
+
const repoDir = path24.resolve(dir, "glsp-theia-integration");
|
|
25543
25488
|
const target = cli.electron ? "electron" : "browser";
|
|
25544
25489
|
const script = cli.debug ? "start:debug" : "start";
|
|
25545
25490
|
const passthrough = collectPassthroughArgs(thisCmd);
|
|
@@ -25552,7 +25497,7 @@ var ClientStartCommand = baseCommand().name("start").allowUnknownOption(true).al
|
|
|
25552
25497
|
const cli = thisCmd.opts();
|
|
25553
25498
|
configureRepoEnv(cli);
|
|
25554
25499
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
25555
|
-
const repoDir =
|
|
25500
|
+
const repoDir = path24.resolve(dir, "glsp-client");
|
|
25556
25501
|
const script = cli.browser ? "start:browser" : "start";
|
|
25557
25502
|
const passthrough = collectPassthroughArgs(thisCmd);
|
|
25558
25503
|
const resolved = resolveCommand(`${script}${passthrough}`, repoDir, cli.dryRun);
|
|
@@ -25564,7 +25509,7 @@ var ServerStartCommand = baseCommand().name("start").allowUnknownOption(true).al
|
|
|
25564
25509
|
const cli = thisCmd.opts();
|
|
25565
25510
|
configureRepoEnv(cli);
|
|
25566
25511
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
25567
|
-
const repoDir =
|
|
25512
|
+
const repoDir = path24.resolve(dir, "glsp-server");
|
|
25568
25513
|
const jarPath = discoverJar(repoDir);
|
|
25569
25514
|
if (!cli.dryRun) {
|
|
25570
25515
|
LOGGER.info(`Found JAR: ${jarPath}`);
|
|
@@ -25584,7 +25529,7 @@ var ServerNodeStartCommand = baseCommand().name("start").allowUnknownOption(true
|
|
|
25584
25529
|
const cli = thisCmd.opts();
|
|
25585
25530
|
configureRepoEnv(cli);
|
|
25586
25531
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
25587
|
-
const repoDir =
|
|
25532
|
+
const repoDir = path24.resolve(dir, "glsp-server-node");
|
|
25588
25533
|
const script = cli.socket ? "start" : "start:websocket";
|
|
25589
25534
|
const portArg = cli.port ? ` --port ${cli.port}` : "";
|
|
25590
25535
|
const passthrough = collectPassthroughArgs(thisCmd);
|
|
@@ -25595,9 +25540,9 @@ var ServerNodeStartCommand = baseCommand().name("start").allowUnknownOption(true
|
|
|
25595
25540
|
});
|
|
25596
25541
|
|
|
25597
25542
|
// src/commands/repo/switch.ts
|
|
25598
|
-
var
|
|
25543
|
+
var path25 = __toESM(require("path"));
|
|
25599
25544
|
function validateReposClean(repos, dir) {
|
|
25600
|
-
const dirty = repos.filter((repo) => hasChanges(
|
|
25545
|
+
const dirty = repos.filter((repo) => hasChanges(path25.resolve(dir, repo)));
|
|
25601
25546
|
if (dirty.length > 0) {
|
|
25602
25547
|
throw new Error(
|
|
25603
25548
|
`The following repositories have uncommitted changes: ${dirty.join(", ")}. Commit or stash your changes first, or use --force.`
|
|
@@ -25605,7 +25550,7 @@ function validateReposClean(repos, dir) {
|
|
|
25605
25550
|
}
|
|
25606
25551
|
}
|
|
25607
25552
|
function switchSingleRepo(repo, options) {
|
|
25608
|
-
const repoDir =
|
|
25553
|
+
const repoDir = path25.resolve(options.dir, repo);
|
|
25609
25554
|
if (options.pr) {
|
|
25610
25555
|
LOGGER.info(`Checking out PR #${options.pr} in ${repo}`);
|
|
25611
25556
|
exec(`gh pr checkout ${options.pr} -R ${GLSP_GITHUB_ORG}/${repo}`, { cwd: repoDir });
|
|
@@ -25659,14 +25604,14 @@ function createScopedSwitchCommand(repo) {
|
|
|
25659
25604
|
}
|
|
25660
25605
|
|
|
25661
25606
|
// src/commands/repo/vscode.ts
|
|
25662
|
-
var
|
|
25607
|
+
var path26 = __toESM(require("path"));
|
|
25663
25608
|
var VSIX_ID = "eclipse-glsp.workflow-vscode-example";
|
|
25664
25609
|
var WEB_VSIX_ID = "eclipse-glsp.workflow-vscode-example-web";
|
|
25665
25610
|
var VscodePackageCommand = baseCommand().name("package").description("Package the workflow VS Code extension as a VSIX").option("-d, --dir <path>", "Target directory where repos are cloned").option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
25666
25611
|
const cli = thisCmd.opts();
|
|
25667
25612
|
configureRepoEnv(cli);
|
|
25668
25613
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
25669
|
-
const repoDir =
|
|
25614
|
+
const repoDir = path26.resolve(dir, "glsp-vscode-integration");
|
|
25670
25615
|
await execAsync("pnpm run workflow package", {
|
|
25671
25616
|
cwd: repoDir,
|
|
25672
25617
|
silent: false,
|
|
@@ -25677,7 +25622,7 @@ var VscodeWebPackageCommand = baseCommand().name("web-package").description("Pac
|
|
|
25677
25622
|
const cli = thisCmd.opts();
|
|
25678
25623
|
configureRepoEnv(cli);
|
|
25679
25624
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
25680
|
-
const repoDir =
|
|
25625
|
+
const repoDir = path26.resolve(dir, "glsp-vscode-integration");
|
|
25681
25626
|
await execAsync("pnpm run workflow:web package", {
|
|
25682
25627
|
cwd: repoDir,
|
|
25683
25628
|
silent: false,
|
|
@@ -25688,7 +25633,7 @@ var VsixPathCommand = baseCommand().name("vsix-path").description("Print the pat
|
|
|
25688
25633
|
const cli = thisCmd.opts();
|
|
25689
25634
|
configureRepoEnv(cli);
|
|
25690
25635
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
25691
|
-
const repoDir =
|
|
25636
|
+
const repoDir = path26.resolve(dir, "glsp-vscode-integration");
|
|
25692
25637
|
const vsixPath = discoverVsix(repoDir);
|
|
25693
25638
|
process.stdout.write(vsixPath);
|
|
25694
25639
|
});
|
|
@@ -25696,7 +25641,7 @@ var WebVsixPathCommand = baseCommand().name("web-vsix-path").description("Print
|
|
|
25696
25641
|
const cli = thisCmd.opts();
|
|
25697
25642
|
configureRepoEnv(cli);
|
|
25698
25643
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
25699
|
-
const repoDir =
|
|
25644
|
+
const repoDir = path26.resolve(dir, "glsp-vscode-integration");
|
|
25700
25645
|
const vsixPath = discoverWebVsix(repoDir);
|
|
25701
25646
|
process.stdout.write(vsixPath);
|
|
25702
25647
|
});
|
|
@@ -25707,11 +25652,11 @@ var WebVsixIdCommand = baseCommand().name("web-vsix-id").description("Print the
|
|
|
25707
25652
|
process.stdout.write(WEB_VSIX_ID);
|
|
25708
25653
|
});
|
|
25709
25654
|
function discoverVsix(repoDir) {
|
|
25710
|
-
const vsixDir =
|
|
25655
|
+
const vsixDir = path26.resolve(repoDir, VSIX_TARGET_DIR);
|
|
25711
25656
|
return discoverNewestFile("*.vsix", vsixDir, `No .vsix file found in ${vsixDir}. Run 'glsp repo vscode package' first.`);
|
|
25712
25657
|
}
|
|
25713
25658
|
function discoverWebVsix(repoDir) {
|
|
25714
|
-
const vsixDir =
|
|
25659
|
+
const vsixDir = path26.resolve(repoDir, WEB_VSIX_TARGET_DIR);
|
|
25715
25660
|
return discoverNewestFile("*.vsix", vsixDir, `No .vsix file found in ${vsixDir}. Run 'glsp repo vscode web-package' first.`);
|
|
25716
25661
|
}
|
|
25717
25662
|
|
|
@@ -25775,14 +25720,14 @@ function createSubrepoCommand(repo) {
|
|
|
25775
25720
|
}
|
|
25776
25721
|
|
|
25777
25722
|
// src/commands/repo/workspace.ts
|
|
25778
|
-
var
|
|
25779
|
-
var
|
|
25723
|
+
var fs20 = __toESM(require("fs"));
|
|
25724
|
+
var path27 = __toESM(require("path"));
|
|
25780
25725
|
var WORKSPACE_FILE_NAME = "glsp.code-workspace";
|
|
25781
25726
|
function generateWorkspaceContent(repos, dir, options) {
|
|
25782
|
-
const outputDir = options.outputPath ?
|
|
25727
|
+
const outputDir = options.outputPath ? path27.dirname(path27.resolve(options.outputPath)) : dir;
|
|
25783
25728
|
const folders = repos.map((repo) => {
|
|
25784
|
-
const repoDir =
|
|
25785
|
-
const relativePath =
|
|
25729
|
+
const repoDir = path27.resolve(dir, repo);
|
|
25730
|
+
const relativePath = path27.relative(outputDir, repoDir);
|
|
25786
25731
|
return { name: repo, path: relativePath };
|
|
25787
25732
|
});
|
|
25788
25733
|
const hasJavaRepos = repos.some((r) => !GLSPRepo.isNpmRepo(r));
|
|
@@ -25847,24 +25792,24 @@ function generateWorkspaceContent(repos, dir, options) {
|
|
|
25847
25792
|
}
|
|
25848
25793
|
function generateWorkspaceFile(repos, dir, options) {
|
|
25849
25794
|
const workspace = generateWorkspaceContent(repos, dir, options);
|
|
25850
|
-
const outputFile = options.outputPath ?
|
|
25851
|
-
|
|
25852
|
-
|
|
25795
|
+
const outputFile = options.outputPath ? path27.resolve(options.outputPath) : path27.join(dir, WORKSPACE_FILE_NAME);
|
|
25796
|
+
fs20.mkdirSync(path27.dirname(outputFile), { recursive: true });
|
|
25797
|
+
fs20.writeFileSync(outputFile, JSON.stringify(workspace, void 0, 4) + "\n", "utf-8");
|
|
25853
25798
|
LOGGER.info(`Workspace file written to ${outputFile}`);
|
|
25854
25799
|
return outputFile;
|
|
25855
25800
|
}
|
|
25856
25801
|
function discoverWorkspaceFile(dir) {
|
|
25857
|
-
if (!
|
|
25802
|
+
if (!fs20.existsSync(dir)) {
|
|
25858
25803
|
return void 0;
|
|
25859
25804
|
}
|
|
25860
|
-
const files =
|
|
25805
|
+
const files = fs20.readdirSync(dir).filter((f) => f.endsWith(".code-workspace"));
|
|
25861
25806
|
if (files.length === 1) {
|
|
25862
|
-
return
|
|
25807
|
+
return path27.join(dir, files[0]);
|
|
25863
25808
|
}
|
|
25864
25809
|
if (files.length > 1) {
|
|
25865
25810
|
const defaultFile = files.find((f) => f === WORKSPACE_FILE_NAME);
|
|
25866
25811
|
if (defaultFile) {
|
|
25867
|
-
return
|
|
25812
|
+
return path27.join(dir, defaultFile);
|
|
25868
25813
|
}
|
|
25869
25814
|
}
|
|
25870
25815
|
return void 0;
|
|
@@ -25914,19 +25859,19 @@ for (const repo of GLSPRepo.choices) {
|
|
|
25914
25859
|
}
|
|
25915
25860
|
|
|
25916
25861
|
// src/commands/update-next.ts
|
|
25917
|
-
var
|
|
25862
|
+
var path28 = __toESM(require("path"));
|
|
25918
25863
|
var YAML2 = __toESM(require_dist());
|
|
25919
25864
|
var UpdateNextCommand = baseCommand().name("updateNext").alias("u").description("Updates all `next` dependencies in GLSP project to the latest version").argument("[rootDir]", "The repository root", validateGitDirectory, process.cwd()).option("-v, --verbose", "Enable verbose (debug) log output", false).action(updateNext);
|
|
25920
25865
|
async function updateNext(rootDir, options) {
|
|
25921
25866
|
configureLogger(options.verbose);
|
|
25922
|
-
const rootPkgPath =
|
|
25867
|
+
const rootPkgPath = path28.join(rootDir, "package.json");
|
|
25923
25868
|
if (getUncommittedChanges(rootDir).includes(rootPkgPath)) {
|
|
25924
25869
|
LOGGER.warn("Uncommitted changes in root `package.json`. Please commit or stash them before running this command.");
|
|
25925
25870
|
return;
|
|
25926
25871
|
}
|
|
25927
25872
|
configureExec({ silent: false, fatal: true });
|
|
25928
25873
|
LOGGER.info("Updating next dependencies ...");
|
|
25929
|
-
rootDir =
|
|
25874
|
+
rootDir = path28.resolve(rootDir);
|
|
25930
25875
|
const packages = getWorkspacePackages(rootDir, true);
|
|
25931
25876
|
LOGGER.debug(`Scanning ${packages.length} packages for 'next' dependencies`, packages);
|
|
25932
25877
|
const versions = resolveNextVersions(getNextDependencies(packages));
|
|
@@ -25936,7 +25881,7 @@ async function updateNext(rootDir, options) {
|
|
|
25936
25881
|
}
|
|
25937
25882
|
LOGGER.info("Upgrade and rebuild packages ...");
|
|
25938
25883
|
LOGGER.debug("Pinning next dependencies via pnpm-workspace.yaml overrides", versions);
|
|
25939
|
-
const workspaceYamlPath =
|
|
25884
|
+
const workspaceYamlPath = path28.join(rootDir, "pnpm-workspace.yaml");
|
|
25940
25885
|
const originalYaml = readFile(workspaceYamlPath);
|
|
25941
25886
|
const workspace = YAML2.parse(originalYaml) ?? {};
|
|
25942
25887
|
workspace.overrides = { ...workspace.overrides, ...versions };
|
|
@@ -25974,7 +25919,7 @@ function resolveNextVersions(dependencies) {
|
|
|
25974
25919
|
}
|
|
25975
25920
|
|
|
25976
25921
|
// src/cli.ts
|
|
25977
|
-
var app = baseCommand().version(COMMAND_VERSION).name("glsp").addCommand(
|
|
25922
|
+
var app = baseCommand().version(COMMAND_VERSION).name("glsp").addCommand(CheckHeaderCommand).addCommand(UpdateNextCommand).addCommand(GenerateIndex).addCommand(RelengCommand).addCommand(RepoCommand);
|
|
25978
25923
|
initGlobby().then(() => app.parseAsync(process.argv)).catch((err) => {
|
|
25979
25924
|
LOGGER.error(err);
|
|
25980
25925
|
process.exit(1);
|