@eclipse-glsp/cli 2.8.0-next.0 → 2.8.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -3
- package/dist/cli.js +537 -306
- package/dist/cli.js.map +3 -3
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -1194,8 +1194,8 @@ var require_command = __commonJS({
|
|
|
1194
1194
|
"../../node_modules/commander/lib/command.js"(exports2) {
|
|
1195
1195
|
var EventEmitter = require("node:events").EventEmitter;
|
|
1196
1196
|
var childProcess2 = require("node:child_process");
|
|
1197
|
-
var
|
|
1198
|
-
var
|
|
1197
|
+
var path27 = require("node:path");
|
|
1198
|
+
var fs23 = require("node:fs");
|
|
1199
1199
|
var process10 = require("node:process");
|
|
1200
1200
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
1201
1201
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -2190,7 +2190,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2190
2190
|
* @param {string} subcommandName
|
|
2191
2191
|
*/
|
|
2192
2192
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
2193
|
-
if (
|
|
2193
|
+
if (fs23.existsSync(executableFile)) return;
|
|
2194
2194
|
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";
|
|
2195
2195
|
const executableMissing = `'${executableFile}' does not exist
|
|
2196
2196
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
@@ -2208,11 +2208,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2208
2208
|
let launchWithNode = false;
|
|
2209
2209
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
2210
2210
|
function findFile(baseDir, baseName) {
|
|
2211
|
-
const localBin =
|
|
2212
|
-
if (
|
|
2213
|
-
if (sourceExt.includes(
|
|
2211
|
+
const localBin = path27.resolve(baseDir, baseName);
|
|
2212
|
+
if (fs23.existsSync(localBin)) return localBin;
|
|
2213
|
+
if (sourceExt.includes(path27.extname(baseName))) return void 0;
|
|
2214
2214
|
const foundExt = sourceExt.find(
|
|
2215
|
-
(ext) =>
|
|
2215
|
+
(ext) => fs23.existsSync(`${localBin}${ext}`)
|
|
2216
2216
|
);
|
|
2217
2217
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
2218
2218
|
return void 0;
|
|
@@ -2224,21 +2224,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2224
2224
|
if (this._scriptPath) {
|
|
2225
2225
|
let resolvedScriptPath;
|
|
2226
2226
|
try {
|
|
2227
|
-
resolvedScriptPath =
|
|
2227
|
+
resolvedScriptPath = fs23.realpathSync(this._scriptPath);
|
|
2228
2228
|
} catch {
|
|
2229
2229
|
resolvedScriptPath = this._scriptPath;
|
|
2230
2230
|
}
|
|
2231
|
-
executableDir =
|
|
2232
|
-
|
|
2231
|
+
executableDir = path27.resolve(
|
|
2232
|
+
path27.dirname(resolvedScriptPath),
|
|
2233
2233
|
executableDir
|
|
2234
2234
|
);
|
|
2235
2235
|
}
|
|
2236
2236
|
if (executableDir) {
|
|
2237
2237
|
let localFile = findFile(executableDir, executableFile);
|
|
2238
2238
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
2239
|
-
const legacyName =
|
|
2239
|
+
const legacyName = path27.basename(
|
|
2240
2240
|
this._scriptPath,
|
|
2241
|
-
|
|
2241
|
+
path27.extname(this._scriptPath)
|
|
2242
2242
|
);
|
|
2243
2243
|
if (legacyName !== this._name) {
|
|
2244
2244
|
localFile = findFile(
|
|
@@ -2249,7 +2249,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2249
2249
|
}
|
|
2250
2250
|
executableFile = localFile || executableFile;
|
|
2251
2251
|
}
|
|
2252
|
-
launchWithNode = sourceExt.includes(
|
|
2252
|
+
launchWithNode = sourceExt.includes(path27.extname(executableFile));
|
|
2253
2253
|
let proc;
|
|
2254
2254
|
if (process10.platform !== "win32") {
|
|
2255
2255
|
if (launchWithNode) {
|
|
@@ -3165,7 +3165,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3165
3165
|
* @return {Command}
|
|
3166
3166
|
*/
|
|
3167
3167
|
nameFromFilename(filename) {
|
|
3168
|
-
this._name =
|
|
3168
|
+
this._name = path27.basename(filename, path27.extname(filename));
|
|
3169
3169
|
return this;
|
|
3170
3170
|
}
|
|
3171
3171
|
/**
|
|
@@ -3179,9 +3179,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3179
3179
|
* @param {string} [path]
|
|
3180
3180
|
* @return {(string|null|Command)}
|
|
3181
3181
|
*/
|
|
3182
|
-
executableDir(
|
|
3183
|
-
if (
|
|
3184
|
-
this._executableDir =
|
|
3182
|
+
executableDir(path28) {
|
|
3183
|
+
if (path28 === void 0) return this._executableDir;
|
|
3184
|
+
this._executableDir = path28;
|
|
3185
3185
|
return this;
|
|
3186
3186
|
}
|
|
3187
3187
|
/**
|
|
@@ -3684,7 +3684,7 @@ var require_minimatch = __commonJS({
|
|
|
3684
3684
|
"../../node_modules/minimatch/minimatch.js"(exports2, module2) {
|
|
3685
3685
|
module2.exports = minimatch2;
|
|
3686
3686
|
minimatch2.Minimatch = Minimatch;
|
|
3687
|
-
var
|
|
3687
|
+
var path27 = (function() {
|
|
3688
3688
|
try {
|
|
3689
3689
|
return require("path");
|
|
3690
3690
|
} catch (e) {
|
|
@@ -3692,7 +3692,7 @@ var require_minimatch = __commonJS({
|
|
|
3692
3692
|
})() || {
|
|
3693
3693
|
sep: "/"
|
|
3694
3694
|
};
|
|
3695
|
-
minimatch2.sep =
|
|
3695
|
+
minimatch2.sep = path27.sep;
|
|
3696
3696
|
var GLOBSTAR = minimatch2.GLOBSTAR = Minimatch.GLOBSTAR = {};
|
|
3697
3697
|
var expand = require_brace_expansion();
|
|
3698
3698
|
var plTypes = {
|
|
@@ -3781,8 +3781,8 @@ var require_minimatch = __commonJS({
|
|
|
3781
3781
|
assertValidPattern(pattern);
|
|
3782
3782
|
if (!options) options = {};
|
|
3783
3783
|
pattern = pattern.trim();
|
|
3784
|
-
if (!options.allowWindowsEscape &&
|
|
3785
|
-
pattern = pattern.split(
|
|
3784
|
+
if (!options.allowWindowsEscape && path27.sep !== "/") {
|
|
3785
|
+
pattern = pattern.split(path27.sep).join("/");
|
|
3786
3786
|
}
|
|
3787
3787
|
this.options = options;
|
|
3788
3788
|
this.set = [];
|
|
@@ -4151,8 +4151,8 @@ var require_minimatch = __commonJS({
|
|
|
4151
4151
|
if (this.empty) return f === "";
|
|
4152
4152
|
if (f === "/" && partial) return true;
|
|
4153
4153
|
var options = this.options;
|
|
4154
|
-
if (
|
|
4155
|
-
f = f.split(
|
|
4154
|
+
if (path27.sep !== "/") {
|
|
4155
|
+
f = f.split(path27.sep).join("/");
|
|
4156
4156
|
}
|
|
4157
4157
|
f = f.split(slashSplit);
|
|
4158
4158
|
this.debug(this.pattern, "split", f);
|
|
@@ -4506,7 +4506,7 @@ var require_path = __commonJS({
|
|
|
4506
4506
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
4507
4507
|
exports2.convertPosixPathToPattern = exports2.convertWindowsPathToPattern = exports2.convertPathToPattern = exports2.escapePosixPath = exports2.escapeWindowsPath = exports2.escape = exports2.removeLeadingDotSegment = exports2.makeAbsolute = exports2.unixify = void 0;
|
|
4508
4508
|
var os4 = require("os");
|
|
4509
|
-
var
|
|
4509
|
+
var path27 = require("path");
|
|
4510
4510
|
var IS_WINDOWS_PLATFORM = os4.platform() === "win32";
|
|
4511
4511
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
4512
4512
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
|
@@ -4518,7 +4518,7 @@ var require_path = __commonJS({
|
|
|
4518
4518
|
}
|
|
4519
4519
|
exports2.unixify = unixify;
|
|
4520
4520
|
function makeAbsolute(cwd, filepath) {
|
|
4521
|
-
return
|
|
4521
|
+
return path27.resolve(cwd, filepath);
|
|
4522
4522
|
}
|
|
4523
4523
|
exports2.makeAbsolute = makeAbsolute;
|
|
4524
4524
|
function removeLeadingDotSegment(entry) {
|
|
@@ -5815,7 +5815,7 @@ var require_braces = __commonJS({
|
|
|
5815
5815
|
var require_constants2 = __commonJS({
|
|
5816
5816
|
"../../node_modules/picomatch/lib/constants.js"(exports2, module2) {
|
|
5817
5817
|
"use strict";
|
|
5818
|
-
var
|
|
5818
|
+
var path27 = require("path");
|
|
5819
5819
|
var WIN_SLASH = "\\\\/";
|
|
5820
5820
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
5821
5821
|
var DOT_LITERAL = "\\.";
|
|
@@ -5985,7 +5985,7 @@ var require_constants2 = __commonJS({
|
|
|
5985
5985
|
/* | */
|
|
5986
5986
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
5987
5987
|
/* \uFEFF */
|
|
5988
|
-
SEP:
|
|
5988
|
+
SEP: path27.sep,
|
|
5989
5989
|
/**
|
|
5990
5990
|
* Create EXTGLOB_CHARS
|
|
5991
5991
|
*/
|
|
@@ -6012,7 +6012,7 @@ var require_constants2 = __commonJS({
|
|
|
6012
6012
|
var require_utils2 = __commonJS({
|
|
6013
6013
|
"../../node_modules/picomatch/lib/utils.js"(exports2) {
|
|
6014
6014
|
"use strict";
|
|
6015
|
-
var
|
|
6015
|
+
var path27 = require("path");
|
|
6016
6016
|
var win32 = process.platform === "win32";
|
|
6017
6017
|
var {
|
|
6018
6018
|
REGEX_BACKSLASH,
|
|
@@ -6041,7 +6041,7 @@ var require_utils2 = __commonJS({
|
|
|
6041
6041
|
if (options && typeof options.windows === "boolean") {
|
|
6042
6042
|
return options.windows;
|
|
6043
6043
|
}
|
|
6044
|
-
return win32 === true ||
|
|
6044
|
+
return win32 === true || path27.sep === "\\";
|
|
6045
6045
|
};
|
|
6046
6046
|
exports2.escapeLast = (input, char, lastIdx) => {
|
|
6047
6047
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
@@ -7176,7 +7176,7 @@ var require_parse2 = __commonJS({
|
|
|
7176
7176
|
var require_picomatch = __commonJS({
|
|
7177
7177
|
"../../node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
|
|
7178
7178
|
"use strict";
|
|
7179
|
-
var
|
|
7179
|
+
var path27 = require("path");
|
|
7180
7180
|
var scan = require_scan();
|
|
7181
7181
|
var parse2 = require_parse2();
|
|
7182
7182
|
var utils = require_utils2();
|
|
@@ -7261,7 +7261,7 @@ var require_picomatch = __commonJS({
|
|
|
7261
7261
|
};
|
|
7262
7262
|
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
7263
7263
|
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
7264
|
-
return regex.test(
|
|
7264
|
+
return regex.test(path27.basename(input));
|
|
7265
7265
|
};
|
|
7266
7266
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
7267
7267
|
picomatch.parse = (pattern, options) => {
|
|
@@ -7488,7 +7488,7 @@ var require_pattern = __commonJS({
|
|
|
7488
7488
|
"use strict";
|
|
7489
7489
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7490
7490
|
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;
|
|
7491
|
-
var
|
|
7491
|
+
var path27 = require("path");
|
|
7492
7492
|
var globParent = require_glob_parent();
|
|
7493
7493
|
var micromatch = require_micromatch();
|
|
7494
7494
|
var GLOBSTAR = "**";
|
|
@@ -7583,7 +7583,7 @@ var require_pattern = __commonJS({
|
|
|
7583
7583
|
}
|
|
7584
7584
|
exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
7585
7585
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
7586
|
-
const basename4 =
|
|
7586
|
+
const basename4 = path27.basename(pattern);
|
|
7587
7587
|
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename4);
|
|
7588
7588
|
}
|
|
7589
7589
|
exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
@@ -7641,7 +7641,7 @@ var require_pattern = __commonJS({
|
|
|
7641
7641
|
}
|
|
7642
7642
|
exports2.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
7643
7643
|
function isAbsolute(pattern) {
|
|
7644
|
-
return
|
|
7644
|
+
return path27.isAbsolute(pattern);
|
|
7645
7645
|
}
|
|
7646
7646
|
exports2.isAbsolute = isAbsolute;
|
|
7647
7647
|
}
|
|
@@ -7816,10 +7816,10 @@ var require_utils3 = __commonJS({
|
|
|
7816
7816
|
exports2.array = array;
|
|
7817
7817
|
var errno = require_errno();
|
|
7818
7818
|
exports2.errno = errno;
|
|
7819
|
-
var
|
|
7820
|
-
exports2.fs =
|
|
7821
|
-
var
|
|
7822
|
-
exports2.path =
|
|
7819
|
+
var fs23 = require_fs();
|
|
7820
|
+
exports2.fs = fs23;
|
|
7821
|
+
var path27 = require_path();
|
|
7822
|
+
exports2.path = path27;
|
|
7823
7823
|
var pattern = require_pattern();
|
|
7824
7824
|
exports2.pattern = pattern;
|
|
7825
7825
|
var stream = require_stream();
|
|
@@ -7931,8 +7931,8 @@ var require_async = __commonJS({
|
|
|
7931
7931
|
"use strict";
|
|
7932
7932
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7933
7933
|
exports2.read = void 0;
|
|
7934
|
-
function read(
|
|
7935
|
-
settings.fs.lstat(
|
|
7934
|
+
function read(path27, settings, callback) {
|
|
7935
|
+
settings.fs.lstat(path27, (lstatError, lstat) => {
|
|
7936
7936
|
if (lstatError !== null) {
|
|
7937
7937
|
callFailureCallback(callback, lstatError);
|
|
7938
7938
|
return;
|
|
@@ -7941,7 +7941,7 @@ var require_async = __commonJS({
|
|
|
7941
7941
|
callSuccessCallback(callback, lstat);
|
|
7942
7942
|
return;
|
|
7943
7943
|
}
|
|
7944
|
-
settings.fs.stat(
|
|
7944
|
+
settings.fs.stat(path27, (statError, stat) => {
|
|
7945
7945
|
if (statError !== null) {
|
|
7946
7946
|
if (settings.throwErrorOnBrokenSymbolicLink) {
|
|
7947
7947
|
callFailureCallback(callback, statError);
|
|
@@ -7973,13 +7973,13 @@ var require_sync = __commonJS({
|
|
|
7973
7973
|
"use strict";
|
|
7974
7974
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7975
7975
|
exports2.read = void 0;
|
|
7976
|
-
function read(
|
|
7977
|
-
const lstat = settings.fs.lstatSync(
|
|
7976
|
+
function read(path27, settings) {
|
|
7977
|
+
const lstat = settings.fs.lstatSync(path27);
|
|
7978
7978
|
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
|
7979
7979
|
return lstat;
|
|
7980
7980
|
}
|
|
7981
7981
|
try {
|
|
7982
|
-
const stat = settings.fs.statSync(
|
|
7982
|
+
const stat = settings.fs.statSync(path27);
|
|
7983
7983
|
if (settings.markSymbolicLink) {
|
|
7984
7984
|
stat.isSymbolicLink = () => true;
|
|
7985
7985
|
}
|
|
@@ -8001,12 +8001,12 @@ var require_fs2 = __commonJS({
|
|
|
8001
8001
|
"use strict";
|
|
8002
8002
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8003
8003
|
exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
|
8004
|
-
var
|
|
8004
|
+
var fs23 = require("fs");
|
|
8005
8005
|
exports2.FILE_SYSTEM_ADAPTER = {
|
|
8006
|
-
lstat:
|
|
8007
|
-
stat:
|
|
8008
|
-
lstatSync:
|
|
8009
|
-
statSync:
|
|
8006
|
+
lstat: fs23.lstat,
|
|
8007
|
+
stat: fs23.stat,
|
|
8008
|
+
lstatSync: fs23.lstatSync,
|
|
8009
|
+
statSync: fs23.statSync
|
|
8010
8010
|
};
|
|
8011
8011
|
function createFileSystemAdapter(fsMethods) {
|
|
8012
8012
|
if (fsMethods === void 0) {
|
|
@@ -8023,12 +8023,12 @@ var require_settings = __commonJS({
|
|
|
8023
8023
|
"../../node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
|
|
8024
8024
|
"use strict";
|
|
8025
8025
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8026
|
-
var
|
|
8026
|
+
var fs23 = require_fs2();
|
|
8027
8027
|
var Settings = class {
|
|
8028
8028
|
constructor(_options = {}) {
|
|
8029
8029
|
this._options = _options;
|
|
8030
8030
|
this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
|
|
8031
|
-
this.fs =
|
|
8031
|
+
this.fs = fs23.createFileSystemAdapter(this._options.fs);
|
|
8032
8032
|
this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
|
|
8033
8033
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
8034
8034
|
}
|
|
@@ -8050,17 +8050,17 @@ var require_out = __commonJS({
|
|
|
8050
8050
|
var sync = require_sync();
|
|
8051
8051
|
var settings_1 = require_settings();
|
|
8052
8052
|
exports2.Settings = settings_1.default;
|
|
8053
|
-
function stat(
|
|
8053
|
+
function stat(path27, optionsOrSettingsOrCallback, callback) {
|
|
8054
8054
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
8055
|
-
async.read(
|
|
8055
|
+
async.read(path27, getSettings(), optionsOrSettingsOrCallback);
|
|
8056
8056
|
return;
|
|
8057
8057
|
}
|
|
8058
|
-
async.read(
|
|
8058
|
+
async.read(path27, getSettings(optionsOrSettingsOrCallback), callback);
|
|
8059
8059
|
}
|
|
8060
8060
|
exports2.stat = stat;
|
|
8061
|
-
function statSync5(
|
|
8061
|
+
function statSync5(path27, optionsOrSettings) {
|
|
8062
8062
|
const settings = getSettings(optionsOrSettings);
|
|
8063
|
-
return sync.read(
|
|
8063
|
+
return sync.read(path27, settings);
|
|
8064
8064
|
}
|
|
8065
8065
|
exports2.statSync = statSync5;
|
|
8066
8066
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -8183,8 +8183,8 @@ var require_utils4 = __commonJS({
|
|
|
8183
8183
|
"use strict";
|
|
8184
8184
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8185
8185
|
exports2.fs = void 0;
|
|
8186
|
-
var
|
|
8187
|
-
exports2.fs =
|
|
8186
|
+
var fs23 = require_fs3();
|
|
8187
|
+
exports2.fs = fs23;
|
|
8188
8188
|
}
|
|
8189
8189
|
});
|
|
8190
8190
|
|
|
@@ -8276,16 +8276,16 @@ var require_async2 = __commonJS({
|
|
|
8276
8276
|
return;
|
|
8277
8277
|
}
|
|
8278
8278
|
const tasks = names.map((name) => {
|
|
8279
|
-
const
|
|
8279
|
+
const path27 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
|
8280
8280
|
return (done) => {
|
|
8281
|
-
fsStat.stat(
|
|
8281
|
+
fsStat.stat(path27, settings.fsStatSettings, (error, stats) => {
|
|
8282
8282
|
if (error !== null) {
|
|
8283
8283
|
done(error);
|
|
8284
8284
|
return;
|
|
8285
8285
|
}
|
|
8286
8286
|
const entry = {
|
|
8287
8287
|
name,
|
|
8288
|
-
path:
|
|
8288
|
+
path: path27,
|
|
8289
8289
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
8290
8290
|
};
|
|
8291
8291
|
if (settings.stats) {
|
|
@@ -8379,14 +8379,14 @@ var require_fs4 = __commonJS({
|
|
|
8379
8379
|
"use strict";
|
|
8380
8380
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8381
8381
|
exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
|
8382
|
-
var
|
|
8382
|
+
var fs23 = require("fs");
|
|
8383
8383
|
exports2.FILE_SYSTEM_ADAPTER = {
|
|
8384
|
-
lstat:
|
|
8385
|
-
stat:
|
|
8386
|
-
lstatSync:
|
|
8387
|
-
statSync:
|
|
8388
|
-
readdir:
|
|
8389
|
-
readdirSync:
|
|
8384
|
+
lstat: fs23.lstat,
|
|
8385
|
+
stat: fs23.stat,
|
|
8386
|
+
lstatSync: fs23.lstatSync,
|
|
8387
|
+
statSync: fs23.statSync,
|
|
8388
|
+
readdir: fs23.readdir,
|
|
8389
|
+
readdirSync: fs23.readdirSync
|
|
8390
8390
|
};
|
|
8391
8391
|
function createFileSystemAdapter(fsMethods) {
|
|
8392
8392
|
if (fsMethods === void 0) {
|
|
@@ -8403,15 +8403,15 @@ var require_settings2 = __commonJS({
|
|
|
8403
8403
|
"../../node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
|
|
8404
8404
|
"use strict";
|
|
8405
8405
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8406
|
-
var
|
|
8406
|
+
var path27 = require("path");
|
|
8407
8407
|
var fsStat = require_out();
|
|
8408
|
-
var
|
|
8408
|
+
var fs23 = require_fs4();
|
|
8409
8409
|
var Settings = class {
|
|
8410
8410
|
constructor(_options = {}) {
|
|
8411
8411
|
this._options = _options;
|
|
8412
8412
|
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
|
8413
|
-
this.fs =
|
|
8414
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
|
8413
|
+
this.fs = fs23.createFileSystemAdapter(this._options.fs);
|
|
8414
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path27.sep);
|
|
8415
8415
|
this.stats = this._getValue(this._options.stats, false);
|
|
8416
8416
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
8417
8417
|
this.fsStatSettings = new fsStat.Settings({
|
|
@@ -8438,17 +8438,17 @@ var require_out2 = __commonJS({
|
|
|
8438
8438
|
var sync = require_sync2();
|
|
8439
8439
|
var settings_1 = require_settings2();
|
|
8440
8440
|
exports2.Settings = settings_1.default;
|
|
8441
|
-
function scandir(
|
|
8441
|
+
function scandir(path27, optionsOrSettingsOrCallback, callback) {
|
|
8442
8442
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
8443
|
-
async.read(
|
|
8443
|
+
async.read(path27, getSettings(), optionsOrSettingsOrCallback);
|
|
8444
8444
|
return;
|
|
8445
8445
|
}
|
|
8446
|
-
async.read(
|
|
8446
|
+
async.read(path27, getSettings(optionsOrSettingsOrCallback), callback);
|
|
8447
8447
|
}
|
|
8448
8448
|
exports2.scandir = scandir;
|
|
8449
|
-
function scandirSync(
|
|
8449
|
+
function scandirSync(path27, optionsOrSettings) {
|
|
8450
8450
|
const settings = getSettings(optionsOrSettings);
|
|
8451
|
-
return sync.read(
|
|
8451
|
+
return sync.read(path27, settings);
|
|
8452
8452
|
}
|
|
8453
8453
|
exports2.scandirSync = scandirSync;
|
|
8454
8454
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -8704,26 +8704,26 @@ var require_queue = __commonJS({
|
|
|
8704
8704
|
queue.drained = drained;
|
|
8705
8705
|
return queue;
|
|
8706
8706
|
function push(value) {
|
|
8707
|
-
var p = new Promise(function(
|
|
8707
|
+
var p = new Promise(function(resolve27, reject) {
|
|
8708
8708
|
pushCb(value, function(err, result) {
|
|
8709
8709
|
if (err) {
|
|
8710
8710
|
reject(err);
|
|
8711
8711
|
return;
|
|
8712
8712
|
}
|
|
8713
|
-
|
|
8713
|
+
resolve27(result);
|
|
8714
8714
|
});
|
|
8715
8715
|
});
|
|
8716
8716
|
p.catch(noop2);
|
|
8717
8717
|
return p;
|
|
8718
8718
|
}
|
|
8719
8719
|
function unshift(value) {
|
|
8720
|
-
var p = new Promise(function(
|
|
8720
|
+
var p = new Promise(function(resolve27, reject) {
|
|
8721
8721
|
unshiftCb(value, function(err, result) {
|
|
8722
8722
|
if (err) {
|
|
8723
8723
|
reject(err);
|
|
8724
8724
|
return;
|
|
8725
8725
|
}
|
|
8726
|
-
|
|
8726
|
+
resolve27(result);
|
|
8727
8727
|
});
|
|
8728
8728
|
});
|
|
8729
8729
|
p.catch(noop2);
|
|
@@ -8731,15 +8731,15 @@ var require_queue = __commonJS({
|
|
|
8731
8731
|
}
|
|
8732
8732
|
function drained() {
|
|
8733
8733
|
if (queue.idle()) {
|
|
8734
|
-
return new Promise(function(
|
|
8735
|
-
|
|
8734
|
+
return new Promise(function(resolve27) {
|
|
8735
|
+
resolve27();
|
|
8736
8736
|
});
|
|
8737
8737
|
}
|
|
8738
8738
|
var previousDrain = queue.drain;
|
|
8739
|
-
var p = new Promise(function(
|
|
8739
|
+
var p = new Promise(function(resolve27) {
|
|
8740
8740
|
queue.drain = function() {
|
|
8741
8741
|
previousDrain();
|
|
8742
|
-
|
|
8742
|
+
resolve27();
|
|
8743
8743
|
};
|
|
8744
8744
|
});
|
|
8745
8745
|
return p;
|
|
@@ -9070,7 +9070,7 @@ var require_settings3 = __commonJS({
|
|
|
9070
9070
|
"../../node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
|
|
9071
9071
|
"use strict";
|
|
9072
9072
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9073
|
-
var
|
|
9073
|
+
var path27 = require("path");
|
|
9074
9074
|
var fsScandir = require_out2();
|
|
9075
9075
|
var Settings = class {
|
|
9076
9076
|
constructor(_options = {}) {
|
|
@@ -9080,7 +9080,7 @@ var require_settings3 = __commonJS({
|
|
|
9080
9080
|
this.deepFilter = this._getValue(this._options.deepFilter, null);
|
|
9081
9081
|
this.entryFilter = this._getValue(this._options.entryFilter, null);
|
|
9082
9082
|
this.errorFilter = this._getValue(this._options.errorFilter, null);
|
|
9083
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
|
9083
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path27.sep);
|
|
9084
9084
|
this.fsScandirSettings = new fsScandir.Settings({
|
|
9085
9085
|
followSymbolicLinks: this._options.followSymbolicLinks,
|
|
9086
9086
|
fs: this._options.fs,
|
|
@@ -9142,7 +9142,7 @@ var require_reader2 = __commonJS({
|
|
|
9142
9142
|
"../../node_modules/fast-glob/out/readers/reader.js"(exports2) {
|
|
9143
9143
|
"use strict";
|
|
9144
9144
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9145
|
-
var
|
|
9145
|
+
var path27 = require("path");
|
|
9146
9146
|
var fsStat = require_out();
|
|
9147
9147
|
var utils = require_utils3();
|
|
9148
9148
|
var Reader = class {
|
|
@@ -9155,7 +9155,7 @@ var require_reader2 = __commonJS({
|
|
|
9155
9155
|
});
|
|
9156
9156
|
}
|
|
9157
9157
|
_getFullEntryPath(filepath) {
|
|
9158
|
-
return
|
|
9158
|
+
return path27.resolve(this._settings.cwd, filepath);
|
|
9159
9159
|
}
|
|
9160
9160
|
_makeEntry(stats, pattern) {
|
|
9161
9161
|
const entry = {
|
|
@@ -9222,9 +9222,9 @@ var require_stream3 = __commonJS({
|
|
|
9222
9222
|
});
|
|
9223
9223
|
}
|
|
9224
9224
|
_getStat(filepath) {
|
|
9225
|
-
return new Promise((
|
|
9225
|
+
return new Promise((resolve27, reject) => {
|
|
9226
9226
|
this._stat(filepath, this._fsStatSettings, (error, stats) => {
|
|
9227
|
-
return error === null ?
|
|
9227
|
+
return error === null ? resolve27(stats) : reject(error);
|
|
9228
9228
|
});
|
|
9229
9229
|
});
|
|
9230
9230
|
}
|
|
@@ -9248,10 +9248,10 @@ var require_async5 = __commonJS({
|
|
|
9248
9248
|
this._readerStream = new stream_1.default(this._settings);
|
|
9249
9249
|
}
|
|
9250
9250
|
dynamic(root, options) {
|
|
9251
|
-
return new Promise((
|
|
9251
|
+
return new Promise((resolve27, reject) => {
|
|
9252
9252
|
this._walkAsync(root, options, (error, entries) => {
|
|
9253
9253
|
if (error === null) {
|
|
9254
|
-
|
|
9254
|
+
resolve27(entries);
|
|
9255
9255
|
} else {
|
|
9256
9256
|
reject(error);
|
|
9257
9257
|
}
|
|
@@ -9261,10 +9261,10 @@ var require_async5 = __commonJS({
|
|
|
9261
9261
|
async static(patterns, options) {
|
|
9262
9262
|
const entries = [];
|
|
9263
9263
|
const stream = this._readerStream.static(patterns, options);
|
|
9264
|
-
return new Promise((
|
|
9264
|
+
return new Promise((resolve27, reject) => {
|
|
9265
9265
|
stream.once("error", reject);
|
|
9266
9266
|
stream.on("data", (entry) => entries.push(entry));
|
|
9267
|
-
stream.once("end", () =>
|
|
9267
|
+
stream.once("end", () => resolve27(entries));
|
|
9268
9268
|
});
|
|
9269
9269
|
}
|
|
9270
9270
|
};
|
|
@@ -9571,7 +9571,7 @@ var require_provider = __commonJS({
|
|
|
9571
9571
|
"../../node_modules/fast-glob/out/providers/provider.js"(exports2) {
|
|
9572
9572
|
"use strict";
|
|
9573
9573
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9574
|
-
var
|
|
9574
|
+
var path27 = require("path");
|
|
9575
9575
|
var deep_1 = require_deep();
|
|
9576
9576
|
var entry_1 = require_entry();
|
|
9577
9577
|
var error_1 = require_error2();
|
|
@@ -9585,7 +9585,7 @@ var require_provider = __commonJS({
|
|
|
9585
9585
|
this.entryTransformer = new entry_2.default(this._settings);
|
|
9586
9586
|
}
|
|
9587
9587
|
_getRootDirectory(task) {
|
|
9588
|
-
return
|
|
9588
|
+
return path27.resolve(this._settings.cwd, task.base);
|
|
9589
9589
|
}
|
|
9590
9590
|
_getReaderOptions(task) {
|
|
9591
9591
|
const basePath = task.base === "." ? "" : task.base;
|
|
@@ -9766,16 +9766,16 @@ var require_settings4 = __commonJS({
|
|
|
9766
9766
|
"use strict";
|
|
9767
9767
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9768
9768
|
exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
9769
|
-
var
|
|
9769
|
+
var fs23 = require("fs");
|
|
9770
9770
|
var os4 = require("os");
|
|
9771
9771
|
var CPU_COUNT = Math.max(os4.cpus().length, 1);
|
|
9772
9772
|
exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
9773
|
-
lstat:
|
|
9774
|
-
lstatSync:
|
|
9775
|
-
stat:
|
|
9776
|
-
statSync:
|
|
9777
|
-
readdir:
|
|
9778
|
-
readdirSync:
|
|
9773
|
+
lstat: fs23.lstat,
|
|
9774
|
+
lstatSync: fs23.lstatSync,
|
|
9775
|
+
stat: fs23.stat,
|
|
9776
|
+
statSync: fs23.statSync,
|
|
9777
|
+
readdir: fs23.readdir,
|
|
9778
|
+
readdirSync: fs23.readdirSync
|
|
9779
9779
|
};
|
|
9780
9780
|
var Settings = class {
|
|
9781
9781
|
constructor(_options = {}) {
|
|
@@ -10282,7 +10282,7 @@ var require_ignore = __commonJS({
|
|
|
10282
10282
|
// path matching.
|
|
10283
10283
|
// - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
|
|
10284
10284
|
// @returns {TestResult} true if a file is ignored
|
|
10285
|
-
test(
|
|
10285
|
+
test(path27, checkUnignored, mode) {
|
|
10286
10286
|
let ignored = false;
|
|
10287
10287
|
let unignored = false;
|
|
10288
10288
|
let matchedRule;
|
|
@@ -10291,7 +10291,7 @@ var require_ignore = __commonJS({
|
|
|
10291
10291
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
10292
10292
|
return;
|
|
10293
10293
|
}
|
|
10294
|
-
const matched = rule[mode].test(
|
|
10294
|
+
const matched = rule[mode].test(path27);
|
|
10295
10295
|
if (!matched) {
|
|
10296
10296
|
return;
|
|
10297
10297
|
}
|
|
@@ -10312,17 +10312,17 @@ var require_ignore = __commonJS({
|
|
|
10312
10312
|
var throwError = (message, Ctor) => {
|
|
10313
10313
|
throw new Ctor(message);
|
|
10314
10314
|
};
|
|
10315
|
-
var checkPath = (
|
|
10316
|
-
if (!isString(
|
|
10315
|
+
var checkPath = (path27, originalPath, doThrow) => {
|
|
10316
|
+
if (!isString(path27)) {
|
|
10317
10317
|
return doThrow(
|
|
10318
10318
|
`path must be a string, but got \`${originalPath}\``,
|
|
10319
10319
|
TypeError
|
|
10320
10320
|
);
|
|
10321
10321
|
}
|
|
10322
|
-
if (!
|
|
10322
|
+
if (!path27) {
|
|
10323
10323
|
return doThrow(`path must not be empty`, TypeError);
|
|
10324
10324
|
}
|
|
10325
|
-
if (checkPath.isNotRelative(
|
|
10325
|
+
if (checkPath.isNotRelative(path27)) {
|
|
10326
10326
|
const r = "`path.relative()`d";
|
|
10327
10327
|
return doThrow(
|
|
10328
10328
|
`path should be a ${r} string, but got "${originalPath}"`,
|
|
@@ -10331,7 +10331,7 @@ var require_ignore = __commonJS({
|
|
|
10331
10331
|
}
|
|
10332
10332
|
return true;
|
|
10333
10333
|
};
|
|
10334
|
-
var isNotRelative = (
|
|
10334
|
+
var isNotRelative = (path27) => REGEX_TEST_INVALID_PATH.test(path27);
|
|
10335
10335
|
checkPath.isNotRelative = isNotRelative;
|
|
10336
10336
|
checkPath.convert = (p) => p;
|
|
10337
10337
|
var Ignore = class {
|
|
@@ -10361,19 +10361,19 @@ var require_ignore = __commonJS({
|
|
|
10361
10361
|
}
|
|
10362
10362
|
// @returns {TestResult}
|
|
10363
10363
|
_test(originalPath, cache, checkUnignored, slices) {
|
|
10364
|
-
const
|
|
10364
|
+
const path27 = originalPath && checkPath.convert(originalPath);
|
|
10365
10365
|
checkPath(
|
|
10366
|
-
|
|
10366
|
+
path27,
|
|
10367
10367
|
originalPath,
|
|
10368
10368
|
this._strictPathCheck ? throwError : RETURN_FALSE
|
|
10369
10369
|
);
|
|
10370
|
-
return this._t(
|
|
10370
|
+
return this._t(path27, cache, checkUnignored, slices);
|
|
10371
10371
|
}
|
|
10372
|
-
checkIgnore(
|
|
10373
|
-
if (!REGEX_TEST_TRAILING_SLASH.test(
|
|
10374
|
-
return this.test(
|
|
10372
|
+
checkIgnore(path27) {
|
|
10373
|
+
if (!REGEX_TEST_TRAILING_SLASH.test(path27)) {
|
|
10374
|
+
return this.test(path27);
|
|
10375
10375
|
}
|
|
10376
|
-
const slices =
|
|
10376
|
+
const slices = path27.split(SLASH).filter(Boolean);
|
|
10377
10377
|
slices.pop();
|
|
10378
10378
|
if (slices.length) {
|
|
10379
10379
|
const parent = this._t(
|
|
@@ -10386,18 +10386,18 @@ var require_ignore = __commonJS({
|
|
|
10386
10386
|
return parent;
|
|
10387
10387
|
}
|
|
10388
10388
|
}
|
|
10389
|
-
return this._rules.test(
|
|
10389
|
+
return this._rules.test(path27, false, MODE_CHECK_IGNORE);
|
|
10390
10390
|
}
|
|
10391
|
-
_t(
|
|
10392
|
-
if (
|
|
10393
|
-
return cache[
|
|
10391
|
+
_t(path27, cache, checkUnignored, slices) {
|
|
10392
|
+
if (path27 in cache) {
|
|
10393
|
+
return cache[path27];
|
|
10394
10394
|
}
|
|
10395
10395
|
if (!slices) {
|
|
10396
|
-
slices =
|
|
10396
|
+
slices = path27.split(SLASH).filter(Boolean);
|
|
10397
10397
|
}
|
|
10398
10398
|
slices.pop();
|
|
10399
10399
|
if (!slices.length) {
|
|
10400
|
-
return cache[
|
|
10400
|
+
return cache[path27] = this._rules.test(path27, checkUnignored, MODE_IGNORE);
|
|
10401
10401
|
}
|
|
10402
10402
|
const parent = this._t(
|
|
10403
10403
|
slices.join(SLASH) + SLASH,
|
|
@@ -10405,29 +10405,29 @@ var require_ignore = __commonJS({
|
|
|
10405
10405
|
checkUnignored,
|
|
10406
10406
|
slices
|
|
10407
10407
|
);
|
|
10408
|
-
return cache[
|
|
10408
|
+
return cache[path27] = parent.ignored ? parent : this._rules.test(path27, checkUnignored, MODE_IGNORE);
|
|
10409
10409
|
}
|
|
10410
|
-
ignores(
|
|
10411
|
-
return this._test(
|
|
10410
|
+
ignores(path27) {
|
|
10411
|
+
return this._test(path27, this._ignoreCache, false).ignored;
|
|
10412
10412
|
}
|
|
10413
10413
|
createFilter() {
|
|
10414
|
-
return (
|
|
10414
|
+
return (path27) => !this.ignores(path27);
|
|
10415
10415
|
}
|
|
10416
10416
|
filter(paths) {
|
|
10417
10417
|
return makeArray(paths).filter(this.createFilter());
|
|
10418
10418
|
}
|
|
10419
10419
|
// @returns {TestResult}
|
|
10420
|
-
test(
|
|
10421
|
-
return this._test(
|
|
10420
|
+
test(path27) {
|
|
10421
|
+
return this._test(path27, this._testCache, true);
|
|
10422
10422
|
}
|
|
10423
10423
|
};
|
|
10424
10424
|
var factory = (options) => new Ignore(options);
|
|
10425
|
-
var isPathValid = (
|
|
10425
|
+
var isPathValid = (path27) => checkPath(path27 && checkPath.convert(path27), path27, RETURN_FALSE);
|
|
10426
10426
|
var setupWindows = () => {
|
|
10427
10427
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
10428
10428
|
checkPath.convert = makePosix;
|
|
10429
10429
|
const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
10430
|
-
checkPath.isNotRelative = (
|
|
10430
|
+
checkPath.isNotRelative = (path27) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path27) || isNotRelative(path27);
|
|
10431
10431
|
};
|
|
10432
10432
|
if (
|
|
10433
10433
|
// Detect `process` so that it can run in browsers.
|
|
@@ -10443,12 +10443,12 @@ var require_ignore = __commonJS({
|
|
|
10443
10443
|
});
|
|
10444
10444
|
|
|
10445
10445
|
// ../../node_modules/globby/node_modules/slash/index.js
|
|
10446
|
-
function slash(
|
|
10447
|
-
const isExtendedLengthPath =
|
|
10446
|
+
function slash(path27) {
|
|
10447
|
+
const isExtendedLengthPath = path27.startsWith("\\\\?\\");
|
|
10448
10448
|
if (isExtendedLengthPath) {
|
|
10449
|
-
return
|
|
10449
|
+
return path27;
|
|
10450
10450
|
}
|
|
10451
|
-
return
|
|
10451
|
+
return path27.replace(/\\/g, "/");
|
|
10452
10452
|
}
|
|
10453
10453
|
var init_slash = __esm({
|
|
10454
10454
|
"../../node_modules/globby/node_modules/slash/index.js"() {
|
|
@@ -10588,8 +10588,8 @@ var init_globby = __esm({
|
|
|
10588
10588
|
}
|
|
10589
10589
|
};
|
|
10590
10590
|
normalizePathForDirectoryGlob = (filePath, cwd) => {
|
|
10591
|
-
const
|
|
10592
|
-
return import_node_path2.default.isAbsolute(
|
|
10591
|
+
const path27 = isNegativePattern(filePath) ? filePath.slice(1) : filePath;
|
|
10592
|
+
return import_node_path2.default.isAbsolute(path27) ? path27 : import_node_path2.default.join(cwd, path27);
|
|
10593
10593
|
};
|
|
10594
10594
|
getDirectoryGlob = ({ directoryPath, files, extensions }) => {
|
|
10595
10595
|
const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
|
|
@@ -13191,14 +13191,14 @@ var init_open = __esm({
|
|
|
13191
13191
|
}
|
|
13192
13192
|
const subprocess = import_node_child_process6.default.spawn(command, cliArguments, childProcessOptions);
|
|
13193
13193
|
if (options.wait) {
|
|
13194
|
-
return new Promise((
|
|
13194
|
+
return new Promise((resolve27, reject) => {
|
|
13195
13195
|
subprocess.once("error", reject);
|
|
13196
13196
|
subprocess.once("close", (exitCode) => {
|
|
13197
13197
|
if (!options.allowNonzeroExitCode && exitCode > 0) {
|
|
13198
13198
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
13199
13199
|
return;
|
|
13200
13200
|
}
|
|
13201
|
-
|
|
13201
|
+
resolve27(subprocess);
|
|
13202
13202
|
});
|
|
13203
13203
|
});
|
|
13204
13204
|
}
|
|
@@ -13443,7 +13443,7 @@ var child = __toESM(require("child_process"));
|
|
|
13443
13443
|
var path3 = __toESM(require("path"));
|
|
13444
13444
|
|
|
13445
13445
|
// package.json
|
|
13446
|
-
var version = "2.
|
|
13446
|
+
var version = "2.8.0-next";
|
|
13447
13447
|
|
|
13448
13448
|
// src/util/logger.ts
|
|
13449
13449
|
var levels = {
|
|
@@ -13539,7 +13539,7 @@ function execAsync(cmd, options = {}) {
|
|
|
13539
13539
|
if (verbose) {
|
|
13540
13540
|
console.log(`+ ${cmd}`);
|
|
13541
13541
|
}
|
|
13542
|
-
return new Promise((
|
|
13542
|
+
return new Promise((resolve27, reject) => {
|
|
13543
13543
|
const [command, ...args] = cmd.split(" ");
|
|
13544
13544
|
const childProcess2 = child.spawn(command, args, {
|
|
13545
13545
|
shell: true,
|
|
@@ -13573,7 +13573,7 @@ ${stderr}`.trim();
|
|
|
13573
13573
|
return;
|
|
13574
13574
|
}
|
|
13575
13575
|
}
|
|
13576
|
-
|
|
13576
|
+
resolve27(stdout.trim());
|
|
13577
13577
|
});
|
|
13578
13578
|
childProcess2.on("error", (error) => {
|
|
13579
13579
|
const errorMsg = `Command failed: ${cmd}
|
|
@@ -13596,7 +13596,7 @@ function execForeground(cmd, options = {}) {
|
|
|
13596
13596
|
if (verbose) {
|
|
13597
13597
|
console.log(`+ ${cmd}`);
|
|
13598
13598
|
}
|
|
13599
|
-
return new Promise((
|
|
13599
|
+
return new Promise((resolve27, reject) => {
|
|
13600
13600
|
const [command, ...args] = cmd.split(" ");
|
|
13601
13601
|
const childProcess2 = child.spawn(command, args, {
|
|
13602
13602
|
shell: true,
|
|
@@ -13608,7 +13608,7 @@ function execForeground(cmd, options = {}) {
|
|
|
13608
13608
|
reject(new Error(`Command "${cmd}" exited with code ${code ?? 1}`));
|
|
13609
13609
|
return;
|
|
13610
13610
|
}
|
|
13611
|
-
|
|
13611
|
+
resolve27();
|
|
13612
13612
|
});
|
|
13613
13613
|
childProcess2.on("error", (error) => {
|
|
13614
13614
|
reject(new Error(`Command "${cmd}" failed: ${error.message}`));
|
|
@@ -13620,31 +13620,55 @@ function execForeground(cmd, options = {}) {
|
|
|
13620
13620
|
function escapeDoubleQuotesAndBackslashes(str) {
|
|
13621
13621
|
return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
13622
13622
|
}
|
|
13623
|
-
function isGitRepository(
|
|
13624
|
-
const isGitRepo = exec("git rev-parse --is-inside-work-tree", { silent: true, cwd:
|
|
13623
|
+
function isGitRepository(path27) {
|
|
13624
|
+
const isGitRepo = exec("git rev-parse --is-inside-work-tree", { silent: true, cwd: path27 }).toLocaleLowerCase() === "true";
|
|
13625
13625
|
return isGitRepo;
|
|
13626
13626
|
}
|
|
13627
|
-
function getGitRoot(
|
|
13628
|
-
const fileString = exec("git rev-parse --show-toplevel", { cwd:
|
|
13627
|
+
function getGitRoot(path27) {
|
|
13628
|
+
const fileString = exec("git rev-parse --show-toplevel", { cwd: path27 });
|
|
13629
13629
|
return (0, import_path.resolve)(fileString);
|
|
13630
13630
|
}
|
|
13631
|
-
function hasChanges(
|
|
13632
|
-
return getUncommittedChanges(
|
|
13631
|
+
function hasChanges(path27) {
|
|
13632
|
+
return getUncommittedChanges(path27).length > 0;
|
|
13633
13633
|
}
|
|
13634
|
-
function getUncommittedChanges(
|
|
13635
|
-
return exec("git status --porcelain", { cwd:
|
|
13634
|
+
function getUncommittedChanges(path27) {
|
|
13635
|
+
return exec("git status --porcelain", { cwd: path27 }).split("\n").filter((value) => value.trim().length !== 0).map(
|
|
13636
13636
|
(fileInfo) => (
|
|
13637
13637
|
// Extract relative file path from the info string and convert to absolute path
|
|
13638
|
-
(0, import_path.resolve)(
|
|
13638
|
+
(0, import_path.resolve)(path27 ?? process.cwd(), fileInfo.trim().split(" ").pop() ?? "")
|
|
13639
13639
|
)
|
|
13640
13640
|
);
|
|
13641
13641
|
}
|
|
13642
|
-
function commitChanges(message,
|
|
13643
|
-
exec("git add .", { cwd:
|
|
13644
|
-
exec(`git commit -m "${escapeDoubleQuotesAndBackslashes(message)}"`, { cwd:
|
|
13642
|
+
function commitChanges(message, path27) {
|
|
13643
|
+
exec("git add .", { cwd: path27 });
|
|
13644
|
+
exec(`git commit -m "${escapeDoubleQuotesAndBackslashes(message)}"`, { cwd: path27 });
|
|
13645
13645
|
}
|
|
13646
|
-
function getChangesOfLastCommit(
|
|
13647
|
-
return exec("git diff --name-only HEAD^", { cwd:
|
|
13646
|
+
function getChangesOfLastCommit(path27) {
|
|
13647
|
+
return exec("git diff --name-only HEAD^", { cwd: path27 }).split("\n").map((file) => (0, import_path.resolve)(path27 ?? process.cwd(), file));
|
|
13648
|
+
}
|
|
13649
|
+
function getChangesComparedToDefaultBranch(path27) {
|
|
13650
|
+
const baseRef = getDefaultBranchRef(path27);
|
|
13651
|
+
const committedChanges = baseRef ? exec(`git diff --name-only ${baseRef}...HEAD`, { cwd: path27, silent: true }).split("\n").filter((value) => value.trim().length !== 0).map((file) => (0, import_path.resolve)(path27 ?? process.cwd(), file.trim())) : [];
|
|
13652
|
+
return [.../* @__PURE__ */ new Set([...committedChanges, ...getUncommittedChanges(path27)])];
|
|
13653
|
+
}
|
|
13654
|
+
function getDefaultBranchRef(path27) {
|
|
13655
|
+
try {
|
|
13656
|
+
const ref = exec("git symbolic-ref --short refs/remotes/origin/HEAD", { cwd: path27, silent: true, fatal: false });
|
|
13657
|
+
if (ref) {
|
|
13658
|
+
return ref;
|
|
13659
|
+
}
|
|
13660
|
+
} catch {
|
|
13661
|
+
}
|
|
13662
|
+
const candidates = ["origin/main", "origin/master", "main", "master"];
|
|
13663
|
+
return candidates.find((ref) => refExists(ref, path27));
|
|
13664
|
+
}
|
|
13665
|
+
function refExists(ref, path27) {
|
|
13666
|
+
try {
|
|
13667
|
+
exec(`git rev-parse --verify --quiet ${ref}`, { cwd: path27, silent: true, fatal: false });
|
|
13668
|
+
return true;
|
|
13669
|
+
} catch {
|
|
13670
|
+
return false;
|
|
13671
|
+
}
|
|
13648
13672
|
}
|
|
13649
13673
|
function getLastModificationDate(filePath, repoRoot, excludeMessage) {
|
|
13650
13674
|
const additionalArgs = excludeMessage ? `--grep="${excludeMessage}" --invert-grep` : "";
|
|
@@ -13655,14 +13679,14 @@ function getLastModificationDate(filePath, repoRoot, excludeMessage) {
|
|
|
13655
13679
|
return void 0;
|
|
13656
13680
|
}
|
|
13657
13681
|
}
|
|
13658
|
-
function getRemoteUrl(
|
|
13659
|
-
return exec("git config --get remote.origin.url", { cwd:
|
|
13682
|
+
function getRemoteUrl(path27) {
|
|
13683
|
+
return exec("git config --get remote.origin.url", { cwd: path27 });
|
|
13660
13684
|
}
|
|
13661
|
-
function createBranch(branch,
|
|
13662
|
-
exec(`git checkout -B ${branch}`, { cwd:
|
|
13685
|
+
function createBranch(branch, path27) {
|
|
13686
|
+
exec(`git checkout -B ${branch}`, { cwd: path27 });
|
|
13663
13687
|
}
|
|
13664
|
-
function getDefaultBranch(
|
|
13665
|
-
const output = exec("git remote show origin", { cwd:
|
|
13688
|
+
function getDefaultBranch(path27) {
|
|
13689
|
+
const output = exec("git remote show origin", { cwd: path27 });
|
|
13666
13690
|
const match = output.match(/HEAD branch: (.+)/);
|
|
13667
13691
|
return match ? match[1].trim() : "master";
|
|
13668
13692
|
}
|
|
@@ -13841,6 +13865,42 @@ function readPackage(packagePath) {
|
|
|
13841
13865
|
const packageData = readJson(packagePath);
|
|
13842
13866
|
return new PackageHelper(packagePath, packageData.name);
|
|
13843
13867
|
}
|
|
13868
|
+
function detectPackageManager(rootPath) {
|
|
13869
|
+
if (fs5.existsSync(path4.resolve(rootPath, "pnpm-workspace.yaml")) || fs5.existsSync(path4.resolve(rootPath, "pnpm-lock.yaml"))) {
|
|
13870
|
+
return "pnpm";
|
|
13871
|
+
}
|
|
13872
|
+
if (fs5.existsSync(path4.resolve(rootPath, "yarn.lock"))) {
|
|
13873
|
+
return "yarn";
|
|
13874
|
+
}
|
|
13875
|
+
throw new Error(
|
|
13876
|
+
`Could not detect the package manager of '${rootPath}'. Expected a pnpm-workspace.yaml/pnpm-lock.yaml (pnpm) or a yarn.lock (yarn) in the repository root.`
|
|
13877
|
+
);
|
|
13878
|
+
}
|
|
13879
|
+
function installCommand(pm) {
|
|
13880
|
+
return pm === "pnpm" ? "pnpm install" : "yarn install";
|
|
13881
|
+
}
|
|
13882
|
+
function runScriptCommand(pm, script) {
|
|
13883
|
+
return pm === "pnpm" ? `pnpm run ${script}` : `yarn ${script}`;
|
|
13884
|
+
}
|
|
13885
|
+
function execBinCommand(pm, bin) {
|
|
13886
|
+
return pm === "pnpm" ? `pnpm exec ${bin}` : `yarn ${bin}`;
|
|
13887
|
+
}
|
|
13888
|
+
function runScriptInDirCommand(pm, dir, script) {
|
|
13889
|
+
return pm === "pnpm" ? `pnpm -C ${dir} ${script}` : `yarn --cwd ${dir} ${script}`;
|
|
13890
|
+
}
|
|
13891
|
+
function getPnpmWorkspacePackages(rootPath, includeRoot = false) {
|
|
13892
|
+
const result = exec("pnpm -r list --json --depth -1", { cwd: rootPath, silent: true });
|
|
13893
|
+
const projects = JSON.parse(result);
|
|
13894
|
+
const rootPackagePath = path4.resolve(rootPath, "package.json");
|
|
13895
|
+
const packages = projects.filter((project) => path4.resolve(project.path, "package.json") !== rootPackagePath).map((project) => new PackageHelper(path4.resolve(project.path, "package.json"), project.name));
|
|
13896
|
+
if (includeRoot) {
|
|
13897
|
+
packages.push(new PackageHelper(rootPackagePath, "root"));
|
|
13898
|
+
}
|
|
13899
|
+
return packages;
|
|
13900
|
+
}
|
|
13901
|
+
function getWorkspacePackages(rootPath, includeRoot = false) {
|
|
13902
|
+
return detectPackageManager(rootPath) === "pnpm" ? getPnpmWorkspacePackages(rootPath, includeRoot) : getYarnWorkspacePackages(rootPath, includeRoot);
|
|
13903
|
+
}
|
|
13844
13904
|
function getYarnWorkspaceInfo(rootPath) {
|
|
13845
13905
|
try {
|
|
13846
13906
|
const result = exec("yarn workspaces info", { cwd: rootPath, silent: true });
|
|
@@ -13870,14 +13930,14 @@ function getYarnWorkspacePackages(rootPath, includeRoot = false) {
|
|
|
13870
13930
|
var fs6 = __toESM(require("fs"));
|
|
13871
13931
|
var import_path2 = require("path");
|
|
13872
13932
|
function validateDirectory(rootDir) {
|
|
13873
|
-
const
|
|
13874
|
-
if (!fs6.existsSync(
|
|
13875
|
-
throw new InvalidArgumentError(`Not a valid file path!: ${
|
|
13933
|
+
const path27 = (0, import_path2.resolve)(rootDir);
|
|
13934
|
+
if (!fs6.existsSync(path27)) {
|
|
13935
|
+
throw new InvalidArgumentError(`Not a valid file path!: ${path27}`);
|
|
13876
13936
|
}
|
|
13877
|
-
if (!fs6.statSync(
|
|
13878
|
-
throw new InvalidArgumentError(`Not a directory!: ${
|
|
13937
|
+
if (!fs6.statSync(path27).isDirectory()) {
|
|
13938
|
+
throw new InvalidArgumentError(`Not a directory!: ${path27}`);
|
|
13879
13939
|
}
|
|
13880
|
-
return
|
|
13940
|
+
return path27;
|
|
13881
13941
|
}
|
|
13882
13942
|
function validateGitDirectory(repository) {
|
|
13883
13943
|
const repoPath = validateDirectory(repository);
|
|
@@ -13896,7 +13956,7 @@ var AUTO_FIX_MESSAGE = "Fix copyright header violations";
|
|
|
13896
13956
|
var CheckHeaderCommand = baseCommand().name("checkHeaders").description("Validates the copyright year range (end year) of license header files").argument("<rootDir>", "The starting directory for the check", validateGitDirectory).addOption(
|
|
13897
13957
|
new Option(
|
|
13898
13958
|
"-t, --type <type>",
|
|
13899
|
-
"The scope of the check. In addition to a full recursive check, is also possible to only consider
|
|
13959
|
+
"The scope of the check. In addition to a full recursive check, it is also possible to only consider the files changed compared to the default branch (`changes`, incl. uncommitted changes - i.e. the files that would show up in a pull request) or the files changed with the last commit (`lastCommit`)"
|
|
13900
13960
|
).choices(checkTypes).default("full")
|
|
13901
13961
|
).option("-f, --fileExtensions <extensions...>", "File extensions that should be checked", ["ts", "tsx"]).addOption(
|
|
13902
13962
|
new Option(
|
|
@@ -13933,7 +13993,7 @@ async function getFiles(rootDir, options) {
|
|
|
13933
13993
|
});
|
|
13934
13994
|
return resolveFiles(result2);
|
|
13935
13995
|
}
|
|
13936
|
-
let changedFiles = options.type === "changes" ?
|
|
13996
|
+
let changedFiles = options.type === "changes" ? getChangesComparedToDefaultBranch(rootDir) : getChangesOfLastCommit(rootDir);
|
|
13937
13997
|
changedFiles = changedFiles.filter(minimatch.filter(includePattern));
|
|
13938
13998
|
excludePattern.forEach((pattern) => {
|
|
13939
13999
|
changedFiles = changedFiles.filter(minimatch.filter(`!${pattern}`));
|
|
@@ -14078,8 +14138,9 @@ async function generateCoverageReport(options) {
|
|
|
14078
14138
|
LOGGER.info(`HTML report available at: ${options.projectRoot}/coverage/index.html`);
|
|
14079
14139
|
}
|
|
14080
14140
|
function validateAndRetrievePackages(options) {
|
|
14081
|
-
|
|
14082
|
-
|
|
14141
|
+
const pm = detectPackageManager(options.projectRoot);
|
|
14142
|
+
exec(execBinCommand(pm, "nyc -h"), { silent: true, errorMsg: "Nyc is not installed!" });
|
|
14143
|
+
const workspacePackages = getWorkspacePackages(options.projectRoot, true);
|
|
14083
14144
|
const rootPackage = workspacePackages.pop();
|
|
14084
14145
|
if (!rootPackage.hasScript(options.coverageScript)) {
|
|
14085
14146
|
CoverageReportCommand.error(
|
|
@@ -14090,7 +14151,7 @@ function validateAndRetrievePackages(options) {
|
|
|
14090
14151
|
}
|
|
14091
14152
|
async function collectPackageReportFiles(packages, options) {
|
|
14092
14153
|
LOGGER.info("Create individual package coverage reports");
|
|
14093
|
-
await execAsync(
|
|
14154
|
+
await execAsync(runScriptCommand(detectPackageManager(options.projectRoot), options.coverageScript), { silent: false });
|
|
14094
14155
|
const reports = packages.flatMap((pkg) => findFiles(pkg.location, "**/coverage-final.json"));
|
|
14095
14156
|
LOGGER.info(`Collected ${reports.length} coverage reports from ${packages.length} packages`);
|
|
14096
14157
|
return reports;
|
|
@@ -14114,7 +14175,7 @@ async function combineReports(reportFiles, options) {
|
|
|
14114
14175
|
tempFiles.push("_" + config);
|
|
14115
14176
|
}
|
|
14116
14177
|
});
|
|
14117
|
-
await execAsync("
|
|
14178
|
+
await execAsync(execBinCommand(detectPackageManager(options.projectRoot), "nyc report --reporter html"), { silent: false });
|
|
14118
14179
|
tempFiles.forEach((config) => moveFile(config, config.substring(1)));
|
|
14119
14180
|
}
|
|
14120
14181
|
|
|
@@ -14306,6 +14367,22 @@ function toNewVersion(version2, versionType) {
|
|
|
14306
14367
|
function isNextVersion(version2) {
|
|
14307
14368
|
return version2.endsWith("-next") || version2.endsWith(".SNAPSHOT");
|
|
14308
14369
|
}
|
|
14370
|
+
function deriveCanaryVersion(repoDir) {
|
|
14371
|
+
const base = getVersionFromPackage(repoDir);
|
|
14372
|
+
let lastTag;
|
|
14373
|
+
try {
|
|
14374
|
+
lastTag = exec("git describe --tags --abbrev=0", { cwd: repoDir, silent: true }).trim();
|
|
14375
|
+
} catch (error) {
|
|
14376
|
+
throw new Error(
|
|
14377
|
+
`Could not determine the last git tag in '${repoDir}'. Deriving a canary version requires at least one tag and the full git history (fetch-depth: 0 in CI).`
|
|
14378
|
+
);
|
|
14379
|
+
}
|
|
14380
|
+
const commitCount = Number.parseInt(exec(`git rev-list --count ${lastTag}..HEAD`, { cwd: repoDir, silent: true }).trim(), 10);
|
|
14381
|
+
if (Number.isNaN(commitCount)) {
|
|
14382
|
+
throw new Error(`Could not determine the number of commits since tag '${lastTag}' in '${repoDir}'.`);
|
|
14383
|
+
}
|
|
14384
|
+
return { base, lastTag, commitCount, version: `${base}.${commitCount}` };
|
|
14385
|
+
}
|
|
14309
14386
|
function getLastReleaseTag(repoDir) {
|
|
14310
14387
|
const tags = exec("git tag --list --sort=-v:refname", { cwd: repoDir }).split("\n");
|
|
14311
14388
|
const lastTag = tags.find((tag) => {
|
|
@@ -14339,6 +14416,7 @@ function getChangeLogChanges(options) {
|
|
|
14339
14416
|
}
|
|
14340
14417
|
|
|
14341
14418
|
// src/commands/releng/version.ts
|
|
14419
|
+
var fs10 = __toESM(require("fs"));
|
|
14342
14420
|
var path9 = __toESM(require("path"));
|
|
14343
14421
|
var semver2 = __toESM(require_semver2());
|
|
14344
14422
|
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) => {
|
|
@@ -14351,7 +14429,7 @@ var VersionCommand = baseCommand().name("version").description("Set the version
|
|
|
14351
14429
|
const options = { ...cmdOptions, repo, version: version2, versionType };
|
|
14352
14430
|
let workspacePackages;
|
|
14353
14431
|
if (GLSPRepo.isNpmRepo(repo)) {
|
|
14354
|
-
workspacePackages =
|
|
14432
|
+
workspacePackages = getWorkspacePackages(cmdOptions.repoDir, true);
|
|
14355
14433
|
}
|
|
14356
14434
|
return setVersion({ ...options, workspacePackages });
|
|
14357
14435
|
});
|
|
@@ -14375,9 +14453,14 @@ function setVersionNpm(options) {
|
|
|
14375
14453
|
updateGLSPDependencies(pkg, options.version, workspacePackageNames);
|
|
14376
14454
|
pkg.write();
|
|
14377
14455
|
});
|
|
14378
|
-
const
|
|
14379
|
-
|
|
14380
|
-
|
|
14456
|
+
const lernaJsonPath = path9.resolve(options.repoDir, "lerna.json");
|
|
14457
|
+
if (fs10.existsSync(lernaJsonPath)) {
|
|
14458
|
+
const lernaJson = readJson(lernaJsonPath);
|
|
14459
|
+
lernaJson.version = options.version;
|
|
14460
|
+
writeJson(lernaJsonPath, lernaJson);
|
|
14461
|
+
} else {
|
|
14462
|
+
LOGGER.debug("No lerna.json found, skipping update");
|
|
14463
|
+
}
|
|
14381
14464
|
if (options.repo === "glsp-theia-integration") {
|
|
14382
14465
|
checkAndUpdateTheiaReadmes(options);
|
|
14383
14466
|
}
|
|
@@ -14389,7 +14472,9 @@ function updateGLSPDependencies(pkg, version2, workspacePackageNames) {
|
|
|
14389
14472
|
["dependencies", "devDependencies"].forEach((depType) => {
|
|
14390
14473
|
if (pkg.content[depType]) {
|
|
14391
14474
|
Object.keys(pkg.content[depType] || {}).filter((dep) => workspacePackageNames.has(dep) || dep.startsWith("@eclipse-glsp")).forEach((dep) => {
|
|
14392
|
-
if (
|
|
14475
|
+
if (pkg.content[depType][dep].startsWith("workspace:")) {
|
|
14476
|
+
LOGGER.debug(` - Keep ${depType} ${dep} at '${pkg.content[depType][dep]}'`);
|
|
14477
|
+
} else if (workspacePackageNames.has(dep) || !isNextVersion(version2)) {
|
|
14393
14478
|
LOGGER.debug(` - Bump ${depType} ${dep} to version ${version2}`);
|
|
14394
14479
|
pkg.content[depType][dep] = `${version2}`;
|
|
14395
14480
|
} else {
|
|
@@ -14471,7 +14556,7 @@ function setVersionEclipseClient(options) {
|
|
|
14471
14556
|
...options,
|
|
14472
14557
|
repoDir: clientPath,
|
|
14473
14558
|
version: options.version,
|
|
14474
|
-
workspacePackages:
|
|
14559
|
+
workspacePackages: getWorkspacePackages(path9.join(options.repoDir, "client"), true)
|
|
14475
14560
|
});
|
|
14476
14561
|
cd(options.repoDir);
|
|
14477
14562
|
}
|
|
@@ -14539,7 +14624,7 @@ async function prepareRelease(options) {
|
|
|
14539
14624
|
}
|
|
14540
14625
|
cd(options.repoDir);
|
|
14541
14626
|
if (GLSPRepo.isNpmRepo(options.repo)) {
|
|
14542
|
-
options.workspacePackages =
|
|
14627
|
+
options.workspacePackages = getWorkspacePackages(options.repoDir, true);
|
|
14543
14628
|
}
|
|
14544
14629
|
if (options.check) {
|
|
14545
14630
|
checkPreconditions(options);
|
|
@@ -14596,9 +14681,13 @@ async function build(options) {
|
|
|
14596
14681
|
}
|
|
14597
14682
|
}
|
|
14598
14683
|
async function buildNpm(options) {
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
|
|
14684
|
+
const pm = detectPackageManager(options.repoDir);
|
|
14685
|
+
LOGGER.info(`Install & Build with ${pm}`);
|
|
14686
|
+
await execAsync(installCommand(pm), { silent: false, cwd: options.repoDir, errorMsg: `${pm} install failed` });
|
|
14687
|
+
if (pm === "pnpm") {
|
|
14688
|
+
await execAsync(runScriptCommand(pm, "--if-present build"), { silent: false, cwd: options.repoDir, errorMsg: "Build failed" });
|
|
14689
|
+
}
|
|
14690
|
+
LOGGER.debug("Build succeeded");
|
|
14602
14691
|
}
|
|
14603
14692
|
async function buildJavaServer(options) {
|
|
14604
14693
|
LOGGER.info("Build M2 & P2");
|
|
@@ -14689,15 +14778,113 @@ Note: This pull request was created automatically. After merging, the automated
|
|
|
14689
14778
|
}
|
|
14690
14779
|
}
|
|
14691
14780
|
|
|
14781
|
+
// src/commands/releng/publish.ts
|
|
14782
|
+
var fs11 = __toESM(require("fs"));
|
|
14783
|
+
var path11 = __toESM(require("path"));
|
|
14784
|
+
var PublishCommand = baseCommand().name("publish").description("Publish all workspace packages of a GLSP repository (pnpm: `pnpm publish`, yarn/lerna: `lerna 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)").action((distTag, cmdOptions) => {
|
|
14785
|
+
configureEnv(cmdOptions);
|
|
14786
|
+
return publish(distTag, cmdOptions);
|
|
14787
|
+
});
|
|
14788
|
+
async function publish(distTag, options) {
|
|
14789
|
+
const packageManager = detectPackageManager(options.repoDir);
|
|
14790
|
+
LOGGER.info(`Publish workspace packages of '${options.repoDir}' with dist-tag '${distTag}' (package manager: ${packageManager})`);
|
|
14791
|
+
if (packageManager !== "pnpm") {
|
|
14792
|
+
return publishWithLerna(distTag, packageManager, options);
|
|
14793
|
+
}
|
|
14794
|
+
if (distTag === "next") {
|
|
14795
|
+
return publishNext(options);
|
|
14796
|
+
}
|
|
14797
|
+
return publishLatest(options);
|
|
14798
|
+
}
|
|
14799
|
+
async function publishWithLerna(distTag, packageManager, options) {
|
|
14800
|
+
if (options.dryRun) {
|
|
14801
|
+
throw new Error("'--dry-run' is only supported for pnpm-based repositories ('lerna publish' has no dry-run mode).");
|
|
14802
|
+
}
|
|
14803
|
+
const lernaArgs = distTag === "next" ? "publish preminor --exact --canary --preid next --dist-tag next --no-git-tag-version --no-push --ignore-scripts --yes" : "publish from-package --no-git-reset -y";
|
|
14804
|
+
let cmd = `${execBinCommand(packageManager, "lerna")} ${lernaArgs}`;
|
|
14805
|
+
if (options.registry) {
|
|
14806
|
+
cmd += ` --registry ${options.registry}`;
|
|
14807
|
+
}
|
|
14808
|
+
await execAsync(cmd, { cwd: options.repoDir, silent: false, errorMsg: "lerna publish failed" });
|
|
14809
|
+
}
|
|
14810
|
+
async function publishNext(options) {
|
|
14811
|
+
const canary = deriveCanaryVersion(options.repoDir);
|
|
14812
|
+
if (!isNextVersion(canary.base)) {
|
|
14813
|
+
throw new Error(`The root package version '${canary.base}' is not a next version. Cannot publish a 'next' canary release.`);
|
|
14814
|
+
}
|
|
14815
|
+
LOGGER.info(`Applying canary version ${canary.version} (base: ${canary.base}, ${canary.commitCount} commits since ${canary.lastTag})`);
|
|
14816
|
+
const packages = getWorkspacePackages(options.repoDir);
|
|
14817
|
+
packages.forEach((pkg) => {
|
|
14818
|
+
if (options.dryRun) {
|
|
14819
|
+
LOGGER.info(`[dry-run] Would set version of ${pkg.name} to ${canary.version}`);
|
|
14820
|
+
return;
|
|
14821
|
+
}
|
|
14822
|
+
LOGGER.debug(`Set version of ${pkg.name} to ${canary.version}`);
|
|
14823
|
+
pkg.content.version = canary.version;
|
|
14824
|
+
pkg.write();
|
|
14825
|
+
});
|
|
14826
|
+
await pnpmPublish("next", options);
|
|
14827
|
+
}
|
|
14828
|
+
async function publishLatest(options) {
|
|
14829
|
+
const version2 = getVersionFromPackage(options.repoDir);
|
|
14830
|
+
if (isNextVersion(version2)) {
|
|
14831
|
+
throw new Error(`The root package version '${version2}' is a next version. Refusing to publish under the 'latest' dist-tag.`);
|
|
14832
|
+
}
|
|
14833
|
+
const publicPackages = getWorkspacePackages(options.repoDir).filter((pkg) => !pkg.content.private);
|
|
14834
|
+
const unpublished = publicPackages.filter((pkg) => {
|
|
14835
|
+
if (npmVersionExists(pkg.name, pkg.content.version)) {
|
|
14836
|
+
LOGGER.info(`Skipping ${pkg.name}@${pkg.content.version} - already published`);
|
|
14837
|
+
return false;
|
|
14838
|
+
}
|
|
14839
|
+
return true;
|
|
14840
|
+
});
|
|
14841
|
+
if (unpublished.length === 0) {
|
|
14842
|
+
LOGGER.warn("All package versions are already published. Nothing to publish.");
|
|
14843
|
+
return;
|
|
14844
|
+
}
|
|
14845
|
+
LOGGER.info(`Publishing ${unpublished.length} of ${publicPackages.length} public packages`);
|
|
14846
|
+
await pnpmPublish("latest", options);
|
|
14847
|
+
}
|
|
14848
|
+
async function pnpmPublish(distTag, options) {
|
|
14849
|
+
let cmd = `pnpm publish -r --tag ${distTag} --no-git-checks --report-summary`;
|
|
14850
|
+
if (options.dryRun) {
|
|
14851
|
+
cmd += " --dry-run";
|
|
14852
|
+
}
|
|
14853
|
+
if (options.registry) {
|
|
14854
|
+
cmd += ` --registry ${options.registry}`;
|
|
14855
|
+
}
|
|
14856
|
+
await execAsync(cmd, { cwd: options.repoDir, silent: false, errorMsg: "pnpm publish failed" });
|
|
14857
|
+
reportPublishSummary(options);
|
|
14858
|
+
}
|
|
14859
|
+
function reportPublishSummary(options) {
|
|
14860
|
+
const summaryPath = path11.resolve(options.repoDir, "pnpm-publish-summary.json");
|
|
14861
|
+
if (!fs11.existsSync(summaryPath)) {
|
|
14862
|
+
LOGGER.warn("No pnpm publish summary found.");
|
|
14863
|
+
return;
|
|
14864
|
+
}
|
|
14865
|
+
try {
|
|
14866
|
+
const summary = JSON.parse(fs11.readFileSync(summaryPath, "utf8"));
|
|
14867
|
+
const published = summary.publishedPackages ?? [];
|
|
14868
|
+
if (published.length === 0) {
|
|
14869
|
+
LOGGER.warn("No packages were published.");
|
|
14870
|
+
} else {
|
|
14871
|
+
LOGGER.info(`Published ${published.length} packages:`);
|
|
14872
|
+
published.forEach((pkg) => LOGGER.info(` - ${pkg.name}@${pkg.version}`));
|
|
14873
|
+
}
|
|
14874
|
+
} finally {
|
|
14875
|
+
fs11.rmSync(summaryPath, { force: true });
|
|
14876
|
+
}
|
|
14877
|
+
}
|
|
14878
|
+
|
|
14692
14879
|
// src/commands/releng/releng.ts
|
|
14693
|
-
var RelengCommand = baseCommand().name("releng").description("Commands for GLSP release engineering (Linux only, intended for CI/Maintainer use).").addCommand(VersionCommand).addCommand(PrepareReleaseCommand);
|
|
14880
|
+
var RelengCommand = baseCommand().name("releng").description("Commands for GLSP release engineering (Linux only, intended for CI/Maintainer use).").addCommand(VersionCommand).addCommand(PrepareReleaseCommand).addCommand(PublishCommand);
|
|
14694
14881
|
|
|
14695
14882
|
// src/commands/repo/build.ts
|
|
14696
|
-
var
|
|
14883
|
+
var path13 = __toESM(require("path"));
|
|
14697
14884
|
|
|
14698
14885
|
// src/commands/repo/common/utils.ts
|
|
14699
|
-
var
|
|
14700
|
-
var
|
|
14886
|
+
var fs12 = __toESM(require("fs"));
|
|
14887
|
+
var path12 = __toESM(require("path"));
|
|
14701
14888
|
var readline = __toESM(require("readline"));
|
|
14702
14889
|
var GLSP_GITHUB_ORG = "eclipse-glsp";
|
|
14703
14890
|
var THEIA_URL = "http://localhost:3000";
|
|
@@ -14707,7 +14894,7 @@ function configureRepoEnv(options) {
|
|
|
14707
14894
|
configureEnv(options);
|
|
14708
14895
|
}
|
|
14709
14896
|
function validateReposExist(repos, dir) {
|
|
14710
|
-
const missing = repos.filter((repo) => !
|
|
14897
|
+
const missing = repos.filter((repo) => !fs12.existsSync(path12.resolve(dir, repo)));
|
|
14711
14898
|
if (missing.length > 0) {
|
|
14712
14899
|
throw new Error(`The following repositories are not cloned in '${dir}': ${missing.join(", ")}. Run 'glsp repo clone' first.`);
|
|
14713
14900
|
}
|
|
@@ -14717,26 +14904,34 @@ function formatError(error) {
|
|
|
14717
14904
|
}
|
|
14718
14905
|
function resolveWorkspaceDir(cliDir) {
|
|
14719
14906
|
if (cliDir) {
|
|
14720
|
-
return
|
|
14907
|
+
return path12.resolve(cliDir);
|
|
14721
14908
|
}
|
|
14722
|
-
let current =
|
|
14723
|
-
const root =
|
|
14909
|
+
let current = path12.resolve(process.cwd());
|
|
14910
|
+
const root = path12.parse(current).root;
|
|
14724
14911
|
while (current !== root) {
|
|
14725
14912
|
if (discoverRepos(current).length > 0) {
|
|
14726
14913
|
return current;
|
|
14727
14914
|
}
|
|
14728
|
-
if (GLSPRepo.is(
|
|
14729
|
-
return
|
|
14915
|
+
if (GLSPRepo.is(path12.basename(current))) {
|
|
14916
|
+
return path12.dirname(current);
|
|
14730
14917
|
}
|
|
14731
|
-
current =
|
|
14918
|
+
current = path12.dirname(current);
|
|
14732
14919
|
}
|
|
14733
14920
|
return process.cwd();
|
|
14734
14921
|
}
|
|
14922
|
+
function resolveRepoDir(repo, cliDir) {
|
|
14923
|
+
const workspaceDir = resolveWorkspaceDir(cliDir);
|
|
14924
|
+
const repoDir = path12.resolve(workspaceDir, repo);
|
|
14925
|
+
if (!fs12.existsSync(repoDir) && path12.basename(workspaceDir) === repo) {
|
|
14926
|
+
return workspaceDir;
|
|
14927
|
+
}
|
|
14928
|
+
return repoDir;
|
|
14929
|
+
}
|
|
14735
14930
|
function discoverRepos(dir) {
|
|
14736
|
-
if (!
|
|
14931
|
+
if (!fs12.existsSync(dir)) {
|
|
14737
14932
|
return [];
|
|
14738
14933
|
}
|
|
14739
|
-
return
|
|
14934
|
+
return fs12.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));
|
|
14740
14935
|
}
|
|
14741
14936
|
function resolveTargetRepos(options) {
|
|
14742
14937
|
const dir = resolveWorkspaceDir(options.dir);
|
|
@@ -14785,9 +14980,9 @@ function isLeafRepo(repo) {
|
|
|
14785
14980
|
function prompt(question) {
|
|
14786
14981
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
14787
14982
|
return new Promise(
|
|
14788
|
-
(
|
|
14983
|
+
(resolve27) => rl.question(question, (answer) => {
|
|
14789
14984
|
rl.close();
|
|
14790
|
-
|
|
14985
|
+
resolve27(answer);
|
|
14791
14986
|
})
|
|
14792
14987
|
);
|
|
14793
14988
|
}
|
|
@@ -14796,22 +14991,30 @@ function discoverNewestFile(pattern, dir, errorMsg) {
|
|
|
14796
14991
|
if (files.length === 0) {
|
|
14797
14992
|
throw new Error(errorMsg);
|
|
14798
14993
|
}
|
|
14799
|
-
return files.reduce((newest, file) =>
|
|
14994
|
+
return files.reduce((newest, file) => fs12.statSync(file).mtimeMs > fs12.statSync(newest).mtimeMs ? file : newest);
|
|
14800
14995
|
}
|
|
14801
14996
|
|
|
14802
14997
|
// src/commands/repo/build.ts
|
|
14998
|
+
async function installAndBuildNpm(repoDir, execOpts) {
|
|
14999
|
+
const pm = detectPackageManager(repoDir);
|
|
15000
|
+
LOGGER.debug(`${pm} install`);
|
|
15001
|
+
await execAsync(installCommand(pm), { ...execOpts, cwd: repoDir });
|
|
15002
|
+
if (pm === "pnpm") {
|
|
15003
|
+
LOGGER.debug("pnpm build");
|
|
15004
|
+
await execAsync(runScriptCommand(pm, "--if-present build"), { ...execOpts, cwd: repoDir });
|
|
15005
|
+
}
|
|
15006
|
+
}
|
|
14803
15007
|
async function buildSingleRepo(repo, options) {
|
|
14804
|
-
const repoDir =
|
|
14805
|
-
const
|
|
15008
|
+
const repoDir = path13.resolve(options.dir, repo);
|
|
15009
|
+
const npmOpts = { cwd: repoDir, verbose: options.verbose, silent: false, env: { FORCE_COLOR: "1" } };
|
|
14806
15010
|
const mvnOpts = { cwd: repoDir, verbose: options.verbose, silent: false };
|
|
14807
15011
|
LOGGER.label(`Building ${repo}...`);
|
|
14808
15012
|
switch (repo) {
|
|
14809
15013
|
case "glsp-theia-integration": {
|
|
14810
|
-
|
|
14811
|
-
await execAsync("yarn", yarnOpts);
|
|
15014
|
+
await installAndBuildNpm(repoDir, npmOpts);
|
|
14812
15015
|
const target = options.electron ? "electron" : "browser";
|
|
14813
|
-
LOGGER.debug("
|
|
14814
|
-
await execAsync(
|
|
15016
|
+
LOGGER.debug("Build for target: " + target);
|
|
15017
|
+
await execAsync(runScriptCommand(detectPackageManager(repoDir), `${target} build`), npmOpts);
|
|
14815
15018
|
break;
|
|
14816
15019
|
}
|
|
14817
15020
|
case "glsp-server": {
|
|
@@ -14819,15 +15022,14 @@ async function buildSingleRepo(repo, options) {
|
|
|
14819
15022
|
break;
|
|
14820
15023
|
}
|
|
14821
15024
|
case "glsp-eclipse-integration": {
|
|
14822
|
-
LOGGER.debug("
|
|
14823
|
-
await
|
|
15025
|
+
LOGGER.debug("Build client");
|
|
15026
|
+
await installAndBuildNpm(path13.join(repoDir, "client"), npmOpts);
|
|
14824
15027
|
LOGGER.debug("Maven build for server");
|
|
14825
|
-
await execAsync("mvn clean verify -Dstyle.color=always -B", { ...mvnOpts, cwd:
|
|
15028
|
+
await execAsync("mvn clean verify -Dstyle.color=always -B", { ...mvnOpts, cwd: path13.join(repoDir, "server") });
|
|
14826
15029
|
break;
|
|
14827
15030
|
}
|
|
14828
15031
|
default: {
|
|
14829
|
-
|
|
14830
|
-
await execAsync("yarn", yarnOpts);
|
|
15032
|
+
await installAndBuildNpm(repoDir, npmOpts);
|
|
14831
15033
|
break;
|
|
14832
15034
|
}
|
|
14833
15035
|
}
|
|
@@ -14900,8 +15102,8 @@ var BuildCommand = baseCommand().name("build").description("Build repositories (
|
|
|
14900
15102
|
});
|
|
14901
15103
|
|
|
14902
15104
|
// src/commands/repo/clone.ts
|
|
14903
|
-
var
|
|
14904
|
-
var
|
|
15105
|
+
var fs13 = __toESM(require("fs"));
|
|
15106
|
+
var path14 = __toESM(require("path"));
|
|
14905
15107
|
|
|
14906
15108
|
// src/commands/repo/common/fork-utils.ts
|
|
14907
15109
|
function forkExists(user, repo) {
|
|
@@ -14978,8 +15180,8 @@ async function confirm(message) {
|
|
|
14978
15180
|
|
|
14979
15181
|
// src/commands/repo/clone.ts
|
|
14980
15182
|
async function cloneSingleRepo(repo, options) {
|
|
14981
|
-
const targetDir =
|
|
14982
|
-
if (
|
|
15183
|
+
const targetDir = path14.resolve(options.dir, repo);
|
|
15184
|
+
if (fs13.existsSync(targetDir)) {
|
|
14983
15185
|
if (!options.override) {
|
|
14984
15186
|
LOGGER.warn(`Skipping ${repo}: target directory already exists (use --override to replace): ${targetDir}`);
|
|
14985
15187
|
return false;
|
|
@@ -14988,16 +15190,16 @@ async function cloneSingleRepo(repo, options) {
|
|
|
14988
15190
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
14989
15191
|
const renamed = `${targetDir}_${timestamp}`;
|
|
14990
15192
|
LOGGER.info(`Renaming existing directory ${targetDir} \u2192 ${renamed}`);
|
|
14991
|
-
|
|
15193
|
+
fs13.renameSync(targetDir, renamed);
|
|
14992
15194
|
} else if (options.override === "remove") {
|
|
14993
15195
|
LOGGER.info(`Removing existing directory ${targetDir}`);
|
|
14994
|
-
|
|
15196
|
+
fs13.rmSync(targetDir, { recursive: true, force: true });
|
|
14995
15197
|
}
|
|
14996
15198
|
}
|
|
14997
15199
|
if (options.fork) {
|
|
14998
15200
|
await ensureFork(options.fork, repo);
|
|
14999
15201
|
}
|
|
15000
|
-
|
|
15202
|
+
fs13.mkdirSync(path14.dirname(targetDir), { recursive: true });
|
|
15001
15203
|
const org = options.fork ?? GLSP_GITHUB_ORG;
|
|
15002
15204
|
LOGGER.info(`Cloning ${org}/${repo} into ${targetDir}`);
|
|
15003
15205
|
if (options.protocol === "gh") {
|
|
@@ -15128,8 +15330,8 @@ Preset (${PRESET_NAMES.join("/")}): `);
|
|
|
15128
15330
|
}
|
|
15129
15331
|
|
|
15130
15332
|
// src/commands/repo/fork.ts
|
|
15131
|
-
var
|
|
15132
|
-
var
|
|
15333
|
+
var fs14 = __toESM(require("fs"));
|
|
15334
|
+
var path15 = __toESM(require("path"));
|
|
15133
15335
|
async function configureForkRemote(repo, repoDir, user, protocol) {
|
|
15134
15336
|
const remotes = getRemotes(repoDir);
|
|
15135
15337
|
const action = analyzeForkRemotes(remotes, user, repo);
|
|
@@ -15166,8 +15368,8 @@ var ForkCommand = baseCommand().name("fork").description("Add fork remotes to al
|
|
|
15166
15368
|
const protocol = cli.protocol ?? resolveDefaultProtocol();
|
|
15167
15369
|
let failures = 0;
|
|
15168
15370
|
for (const repo of repos) {
|
|
15169
|
-
const repoDir =
|
|
15170
|
-
if (!
|
|
15371
|
+
const repoDir = path15.resolve(dir, repo);
|
|
15372
|
+
if (!fs14.existsSync(repoDir)) {
|
|
15171
15373
|
LOGGER.warn(`${repo}: not cloned at ${repoDir}, skipping`);
|
|
15172
15374
|
continue;
|
|
15173
15375
|
}
|
|
@@ -15184,8 +15386,8 @@ var ForkCommand = baseCommand().name("fork").description("Add fork remotes to al
|
|
|
15184
15386
|
});
|
|
15185
15387
|
|
|
15186
15388
|
// src/commands/repo/link.ts
|
|
15187
|
-
var
|
|
15188
|
-
var
|
|
15389
|
+
var fs15 = __toESM(require("fs"));
|
|
15390
|
+
var path16 = __toESM(require("path"));
|
|
15189
15391
|
var SINGLETON_DEPS = ["sprotty", "sprotty-protocol", "vscode-jsonrpc", "inversify"];
|
|
15190
15392
|
var YARN_EXEC_OPTS = { silent: false, env: { FORCE_COLOR: "1" } };
|
|
15191
15393
|
var LINKABLE_REPOS = [
|
|
@@ -15204,13 +15406,13 @@ function getGLSPWorkspacePackages(repoDir) {
|
|
|
15204
15406
|
}
|
|
15205
15407
|
function getRegisteredPackages(linkDir) {
|
|
15206
15408
|
const packages = [];
|
|
15207
|
-
if (!
|
|
15409
|
+
if (!fs15.existsSync(linkDir)) {
|
|
15208
15410
|
return packages;
|
|
15209
15411
|
}
|
|
15210
|
-
for (const entry of
|
|
15211
|
-
const entryPath =
|
|
15212
|
-
if (entry.startsWith("@") &&
|
|
15213
|
-
for (const sub of
|
|
15412
|
+
for (const entry of fs15.readdirSync(linkDir)) {
|
|
15413
|
+
const entryPath = path16.join(linkDir, entry);
|
|
15414
|
+
if (entry.startsWith("@") && fs15.statSync(entryPath).isDirectory()) {
|
|
15415
|
+
for (const sub of fs15.readdirSync(entryPath)) {
|
|
15214
15416
|
packages.push(`${entry}/${sub}`);
|
|
15215
15417
|
}
|
|
15216
15418
|
}
|
|
@@ -15229,7 +15431,7 @@ function registerPackages(repoDir, linkDir) {
|
|
|
15229
15431
|
}
|
|
15230
15432
|
function registerSingletons(clientDir, linkDir) {
|
|
15231
15433
|
for (const dep of SINGLETON_DEPS) {
|
|
15232
|
-
const depDir =
|
|
15434
|
+
const depDir = path16.join(clientDir, "node_modules", dep);
|
|
15233
15435
|
LOGGER.debug(`Registering singleton ${dep}`);
|
|
15234
15436
|
exec(`yarn link --link-folder ${linkDir}`, { cwd: depDir, ...YARN_EXEC_OPTS });
|
|
15235
15437
|
}
|
|
@@ -15238,11 +15440,11 @@ function consumePackages(repoDir, linkDir, registeredPackages) {
|
|
|
15238
15440
|
if (registeredPackages.length === 0) {
|
|
15239
15441
|
return;
|
|
15240
15442
|
}
|
|
15241
|
-
LOGGER.debug(`Linking ${registeredPackages.join(", ")} into ${
|
|
15443
|
+
LOGGER.debug(`Linking ${registeredPackages.join(", ")} into ${path16.basename(repoDir)}`);
|
|
15242
15444
|
exec(`yarn link --link-folder ${linkDir} ${registeredPackages.join(" ")}`, { cwd: repoDir, ...YARN_EXEC_OPTS });
|
|
15243
15445
|
}
|
|
15244
15446
|
function consumeSingletons(repoDir, linkDir) {
|
|
15245
|
-
LOGGER.debug(`Linking singletons into ${
|
|
15447
|
+
LOGGER.debug(`Linking singletons into ${path16.basename(repoDir)}`);
|
|
15246
15448
|
exec(`yarn link --link-folder ${linkDir} ${SINGLETON_DEPS.join(" ")}`, { cwd: repoDir, ...YARN_EXEC_OPTS });
|
|
15247
15449
|
}
|
|
15248
15450
|
async function runLink(repos, options) {
|
|
@@ -15255,7 +15457,7 @@ async function runLink(repos, options) {
|
|
|
15255
15457
|
LOGGER.warn("glsp-client is not in the configured repos. Linking without glsp-client may not produce useful results.");
|
|
15256
15458
|
}
|
|
15257
15459
|
validateReposExist(linkable, options.dir);
|
|
15258
|
-
const linkDir =
|
|
15460
|
+
const linkDir = path16.resolve(options.dir, ".yarn-link");
|
|
15259
15461
|
const ordered = getBuildOrder(linkable);
|
|
15260
15462
|
const registeredPackages = [];
|
|
15261
15463
|
let failures = 0;
|
|
@@ -15266,7 +15468,7 @@ async function runLink(repos, options) {
|
|
|
15266
15468
|
if (i > 0) {
|
|
15267
15469
|
LOGGER.newLine();
|
|
15268
15470
|
}
|
|
15269
|
-
const repoDir =
|
|
15471
|
+
const repoDir = path16.resolve(options.dir, repo);
|
|
15270
15472
|
LOGGER.info(`Linking ${repo}...`);
|
|
15271
15473
|
const packagesFromPriorRepos = [...registeredPackages];
|
|
15272
15474
|
if (!isLeafRepo(repo)) {
|
|
@@ -15303,7 +15505,7 @@ async function runUnlink(repos, options) {
|
|
|
15303
15505
|
return;
|
|
15304
15506
|
}
|
|
15305
15507
|
validateReposExist(linkable, options.dir);
|
|
15306
|
-
const linkDir =
|
|
15508
|
+
const linkDir = path16.resolve(options.dir, ".yarn-link");
|
|
15307
15509
|
const ordered = getBuildOrder(linkable);
|
|
15308
15510
|
const reversed = [...ordered].reverse();
|
|
15309
15511
|
let failures = 0;
|
|
@@ -15314,7 +15516,7 @@ async function runUnlink(repos, options) {
|
|
|
15314
15516
|
if (i > 0) {
|
|
15315
15517
|
LOGGER.newLine();
|
|
15316
15518
|
}
|
|
15317
|
-
const repoDir =
|
|
15519
|
+
const repoDir = path16.resolve(options.dir, repo);
|
|
15318
15520
|
LOGGER.info(`Unlinking ${repo}...`);
|
|
15319
15521
|
if (repo !== "glsp-client" && linkable.includes("glsp-client")) {
|
|
15320
15522
|
exec(`yarn unlink --link-folder ${linkDir} ${SINGLETON_DEPS.join(" ")}`, { cwd: repoDir, ...YARN_EXEC_OPTS });
|
|
@@ -15325,8 +15527,8 @@ async function runUnlink(repos, options) {
|
|
|
15325
15527
|
}
|
|
15326
15528
|
if (repo === "glsp-client") {
|
|
15327
15529
|
for (const dep of SINGLETON_DEPS) {
|
|
15328
|
-
const depDir =
|
|
15329
|
-
if (
|
|
15530
|
+
const depDir = path16.join(repoDir, "node_modules", dep);
|
|
15531
|
+
if (fs15.existsSync(depDir)) {
|
|
15330
15532
|
exec(`yarn unlink --link-folder ${linkDir}`, { cwd: depDir, ...YARN_EXEC_OPTS });
|
|
15331
15533
|
}
|
|
15332
15534
|
}
|
|
@@ -15374,7 +15576,7 @@ var UnlinkCommand = baseCommand().name("unlink").description("Remove yarn links
|
|
|
15374
15576
|
});
|
|
15375
15577
|
|
|
15376
15578
|
// src/commands/repo/log.ts
|
|
15377
|
-
var
|
|
15579
|
+
var path17 = __toESM(require("path"));
|
|
15378
15580
|
function logSingleRepo(repoDir) {
|
|
15379
15581
|
exec("git --no-pager log -1", { cwd: repoDir, silent: false });
|
|
15380
15582
|
}
|
|
@@ -15383,7 +15585,7 @@ function createScopedLogCommand(repo) {
|
|
|
15383
15585
|
const cli = thisCmd.opts();
|
|
15384
15586
|
configureRepoEnv(cli);
|
|
15385
15587
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15386
|
-
const repoDir =
|
|
15588
|
+
const repoDir = path17.resolve(dir, repo);
|
|
15387
15589
|
logSingleRepo(repoDir);
|
|
15388
15590
|
});
|
|
15389
15591
|
}
|
|
@@ -15397,20 +15599,20 @@ var LogCommand = baseCommand().name("log").description("Print the last commit fo
|
|
|
15397
15599
|
if (i > 0) {
|
|
15398
15600
|
LOGGER.newLine();
|
|
15399
15601
|
}
|
|
15400
|
-
const repoDir =
|
|
15602
|
+
const repoDir = path17.resolve(dir, repo);
|
|
15401
15603
|
LOGGER.label(repo);
|
|
15402
15604
|
logSingleRepo(repoDir);
|
|
15403
15605
|
}
|
|
15404
15606
|
});
|
|
15405
15607
|
|
|
15406
15608
|
// src/commands/repo/pwd.ts
|
|
15407
|
-
var
|
|
15609
|
+
var path18 = __toESM(require("path"));
|
|
15408
15610
|
function createScopedPwdCommand(repo) {
|
|
15409
15611
|
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) => {
|
|
15410
15612
|
const cli = thisCmd.opts();
|
|
15411
15613
|
configureRepoEnv(cli);
|
|
15412
15614
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15413
|
-
const repoPath =
|
|
15615
|
+
const repoPath = path18.resolve(dir, repo);
|
|
15414
15616
|
process.stdout.write(repoPath + "\n");
|
|
15415
15617
|
});
|
|
15416
15618
|
}
|
|
@@ -15424,7 +15626,7 @@ var PwdCommand = baseCommand().name("pwd").description("Print resolved paths for
|
|
|
15424
15626
|
}
|
|
15425
15627
|
if (cli.raw) {
|
|
15426
15628
|
for (const repo of repos) {
|
|
15427
|
-
const repoPath =
|
|
15629
|
+
const repoPath = path18.resolve(dir, repo);
|
|
15428
15630
|
process.stdout.write(`${repo} ${repoPath}
|
|
15429
15631
|
`);
|
|
15430
15632
|
}
|
|
@@ -15432,7 +15634,7 @@ var PwdCommand = baseCommand().name("pwd").description("Print resolved paths for
|
|
|
15432
15634
|
}
|
|
15433
15635
|
const maxLen = Math.max(...repos.map((r) => r.length));
|
|
15434
15636
|
for (const repo of repos) {
|
|
15435
|
-
const repoPath =
|
|
15637
|
+
const repoPath = path18.resolve(dir, repo);
|
|
15436
15638
|
const padded = repo.padEnd(maxLen + 2);
|
|
15437
15639
|
LOGGER.info(`${padded}${repoPath}`);
|
|
15438
15640
|
}
|
|
@@ -15451,27 +15653,28 @@ var TheiaOpenCommand = baseCommand().name("open").description("Open the Theia ap
|
|
|
15451
15653
|
});
|
|
15452
15654
|
|
|
15453
15655
|
// src/commands/repo/run.ts
|
|
15454
|
-
var
|
|
15656
|
+
var path20 = __toESM(require("path"));
|
|
15455
15657
|
function createScopedRunCommand(repo) {
|
|
15456
|
-
return baseCommand().name("run").allowUnknownOption(true).allowExcessArguments(true).description(`Run an arbitrary
|
|
15658
|
+
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) => {
|
|
15457
15659
|
const cli = thisCmd.opts();
|
|
15458
15660
|
configureRepoEnv(cli);
|
|
15459
15661
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15460
|
-
const repoDir =
|
|
15662
|
+
const repoDir = path20.resolve(dir, repo);
|
|
15461
15663
|
const passthrough = thisCmd.args.slice(1).join(" ");
|
|
15462
|
-
const
|
|
15664
|
+
const pm = detectPackageManager(repoDir);
|
|
15665
|
+
const cmd = runScriptCommand(pm, passthrough ? `${script} ${passthrough}` : script);
|
|
15463
15666
|
await execForeground(cmd, { cwd: repoDir, verbose: cli.verbose });
|
|
15464
15667
|
});
|
|
15465
15668
|
}
|
|
15466
15669
|
|
|
15467
15670
|
// src/commands/repo/server-node.ts
|
|
15468
|
-
var
|
|
15469
|
-
var
|
|
15671
|
+
var fs21 = __toESM(require("fs"));
|
|
15672
|
+
var path21 = __toESM(require("path"));
|
|
15470
15673
|
var BROWSER_BUNDLE_PATH = "examples/workflow-server-bundled-web/wf-glsp-server-webworker.js";
|
|
15471
15674
|
var NODE_BUNDLE_PATH = "examples/workflow-server-bundled/wf-glsp-server-node.js";
|
|
15472
15675
|
function resolveBundlePath(repoDir, relativePath, label) {
|
|
15473
|
-
const bundlePath =
|
|
15474
|
-
if (!
|
|
15676
|
+
const bundlePath = path21.resolve(repoDir, relativePath);
|
|
15677
|
+
if (!fs21.existsSync(bundlePath)) {
|
|
15475
15678
|
throw new Error(`${label} not found at ${bundlePath}. Run 'glsp repo server-node build' first.`);
|
|
15476
15679
|
}
|
|
15477
15680
|
return bundlePath;
|
|
@@ -15479,34 +15682,38 @@ function resolveBundlePath(repoDir, relativePath, label) {
|
|
|
15479
15682
|
var BrowserBundleCommand = baseCommand().name("browser-bundle").description("Print the absolute path to the browser (Web Worker) server bundle").option("-d, --dir <path>", "Target directory where repos are cloned").option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
15480
15683
|
const cli = thisCmd.opts();
|
|
15481
15684
|
configureRepoEnv(cli);
|
|
15482
|
-
const
|
|
15483
|
-
const repoDir = path20.resolve(dir, "glsp-server-node");
|
|
15685
|
+
const repoDir = resolveRepoDir("glsp-server-node", cli.dir);
|
|
15484
15686
|
const bundlePath = resolveBundlePath(repoDir, BROWSER_BUNDLE_PATH, "Browser bundle");
|
|
15485
15687
|
process.stdout.write(bundlePath);
|
|
15486
15688
|
});
|
|
15487
15689
|
var NodeBundleCommand = baseCommand().name("node-bundle").description("Print the absolute path to the Node.js server bundle").option("-d, --dir <path>", "Target directory where repos are cloned").option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
15488
15690
|
const cli = thisCmd.opts();
|
|
15489
15691
|
configureRepoEnv(cli);
|
|
15490
|
-
const
|
|
15491
|
-
const repoDir = path20.resolve(dir, "glsp-server-node");
|
|
15692
|
+
const repoDir = resolveRepoDir("glsp-server-node", cli.dir);
|
|
15492
15693
|
const bundlePath = resolveBundlePath(repoDir, NODE_BUNDLE_PATH, "Node server bundle");
|
|
15493
15694
|
process.stdout.write(bundlePath);
|
|
15494
15695
|
});
|
|
15495
15696
|
|
|
15496
15697
|
// src/commands/repo/start.ts
|
|
15497
|
-
var
|
|
15698
|
+
var path22 = __toESM(require("path"));
|
|
15498
15699
|
var JAR_TARGET_DIR = "examples/org.eclipse.glsp.example.workflow/target";
|
|
15499
15700
|
var JAR_PATTERN = "*-glsp.jar";
|
|
15500
15701
|
function discoverJar(repoDir) {
|
|
15501
|
-
const targetDir =
|
|
15702
|
+
const targetDir = path22.resolve(repoDir, JAR_TARGET_DIR);
|
|
15502
15703
|
return discoverNewestFile(JAR_PATTERN, targetDir, `No *-glsp.jar found in ${targetDir}. Run \`glsp repo server build\` first.`);
|
|
15503
15704
|
}
|
|
15504
15705
|
function collectPassthroughArgs(cmd) {
|
|
15505
15706
|
const raw = cmd.args;
|
|
15506
15707
|
return raw.length > 0 ? ` ${raw.join(" ")}` : "";
|
|
15507
15708
|
}
|
|
15508
|
-
function resolveCommand(
|
|
15509
|
-
|
|
15709
|
+
function resolveCommand(script, repoDir, dryRun) {
|
|
15710
|
+
let pm;
|
|
15711
|
+
try {
|
|
15712
|
+
pm = detectPackageManager(repoDir);
|
|
15713
|
+
} catch (error) {
|
|
15714
|
+
pm = "pnpm";
|
|
15715
|
+
}
|
|
15716
|
+
const resolved = runScriptInDirCommand(pm, repoDir, script);
|
|
15510
15717
|
if (dryRun) {
|
|
15511
15718
|
process.stdout.write(resolved + "\n");
|
|
15512
15719
|
return void 0;
|
|
@@ -15517,11 +15724,11 @@ var TheiaStartCommand = baseCommand().name("start").allowUnknownOption(true).all
|
|
|
15517
15724
|
const cli = thisCmd.opts();
|
|
15518
15725
|
configureRepoEnv(cli);
|
|
15519
15726
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15520
|
-
const repoDir =
|
|
15727
|
+
const repoDir = path22.resolve(dir, "glsp-theia-integration");
|
|
15521
15728
|
const target = cli.electron ? "electron" : "browser";
|
|
15522
15729
|
const script = cli.debug ? "start:debug" : "start";
|
|
15523
15730
|
const passthrough = collectPassthroughArgs(thisCmd);
|
|
15524
|
-
const resolved = resolveCommand(
|
|
15731
|
+
const resolved = resolveCommand(`${target} ${script}${passthrough}`, repoDir, cli.dryRun);
|
|
15525
15732
|
if (resolved) {
|
|
15526
15733
|
await execForeground(resolved, { verbose: cli.verbose });
|
|
15527
15734
|
}
|
|
@@ -15530,10 +15737,10 @@ var ClientStartCommand = baseCommand().name("start").allowUnknownOption(true).al
|
|
|
15530
15737
|
const cli = thisCmd.opts();
|
|
15531
15738
|
configureRepoEnv(cli);
|
|
15532
15739
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15533
|
-
const repoDir =
|
|
15740
|
+
const repoDir = path22.resolve(dir, "glsp-client");
|
|
15534
15741
|
const script = cli.browser ? "start:browser" : "start";
|
|
15535
15742
|
const passthrough = collectPassthroughArgs(thisCmd);
|
|
15536
|
-
const resolved = resolveCommand(
|
|
15743
|
+
const resolved = resolveCommand(`${script}${passthrough}`, repoDir, cli.dryRun);
|
|
15537
15744
|
if (resolved) {
|
|
15538
15745
|
await execForeground(resolved, { verbose: cli.verbose });
|
|
15539
15746
|
}
|
|
@@ -15542,7 +15749,7 @@ var ServerStartCommand = baseCommand().name("start").allowUnknownOption(true).al
|
|
|
15542
15749
|
const cli = thisCmd.opts();
|
|
15543
15750
|
configureRepoEnv(cli);
|
|
15544
15751
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15545
|
-
const repoDir =
|
|
15752
|
+
const repoDir = path22.resolve(dir, "glsp-server");
|
|
15546
15753
|
const jarPath = discoverJar(repoDir);
|
|
15547
15754
|
if (!cli.dryRun) {
|
|
15548
15755
|
LOGGER.info(`Found JAR: ${jarPath}`);
|
|
@@ -15562,20 +15769,20 @@ var ServerNodeStartCommand = baseCommand().name("start").allowUnknownOption(true
|
|
|
15562
15769
|
const cli = thisCmd.opts();
|
|
15563
15770
|
configureRepoEnv(cli);
|
|
15564
15771
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15565
|
-
const repoDir =
|
|
15566
|
-
const
|
|
15772
|
+
const repoDir = path22.resolve(dir, "glsp-server-node");
|
|
15773
|
+
const script = cli.socket ? "start" : "start:websocket";
|
|
15567
15774
|
const portArg = cli.port ? ` --port ${cli.port}` : "";
|
|
15568
15775
|
const passthrough = collectPassthroughArgs(thisCmd);
|
|
15569
|
-
const resolved = resolveCommand(`${
|
|
15776
|
+
const resolved = resolveCommand(`${script}${portArg}${passthrough}`, repoDir, cli.dryRun);
|
|
15570
15777
|
if (resolved) {
|
|
15571
15778
|
await execForeground(resolved, { verbose: cli.verbose });
|
|
15572
15779
|
}
|
|
15573
15780
|
});
|
|
15574
15781
|
|
|
15575
15782
|
// src/commands/repo/switch.ts
|
|
15576
|
-
var
|
|
15783
|
+
var path23 = __toESM(require("path"));
|
|
15577
15784
|
function validateReposClean(repos, dir) {
|
|
15578
|
-
const dirty = repos.filter((repo) => hasChanges(
|
|
15785
|
+
const dirty = repos.filter((repo) => hasChanges(path23.resolve(dir, repo)));
|
|
15579
15786
|
if (dirty.length > 0) {
|
|
15580
15787
|
throw new Error(
|
|
15581
15788
|
`The following repositories have uncommitted changes: ${dirty.join(", ")}. Commit or stash your changes first, or use --force.`
|
|
@@ -15583,7 +15790,7 @@ function validateReposClean(repos, dir) {
|
|
|
15583
15790
|
}
|
|
15584
15791
|
}
|
|
15585
15792
|
function switchSingleRepo(repo, options) {
|
|
15586
|
-
const repoDir =
|
|
15793
|
+
const repoDir = path23.resolve(options.dir, repo);
|
|
15587
15794
|
if (options.pr) {
|
|
15588
15795
|
LOGGER.info(`Checking out PR #${options.pr} in ${repo}`);
|
|
15589
15796
|
exec(`gh pr checkout ${options.pr} -R ${GLSP_GITHUB_ORG}/${repo}`, { cwd: repoDir });
|
|
@@ -15637,28 +15844,36 @@ function createScopedSwitchCommand(repo) {
|
|
|
15637
15844
|
}
|
|
15638
15845
|
|
|
15639
15846
|
// src/commands/repo/vscode.ts
|
|
15640
|
-
var
|
|
15847
|
+
var path24 = __toESM(require("path"));
|
|
15641
15848
|
var VSIX_ID = "eclipse-glsp.workflow-vscode-example";
|
|
15642
15849
|
var WEB_VSIX_ID = "eclipse-glsp.workflow-vscode-example-web";
|
|
15643
15850
|
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) => {
|
|
15644
15851
|
const cli = thisCmd.opts();
|
|
15645
15852
|
configureRepoEnv(cli);
|
|
15646
15853
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15647
|
-
const repoDir =
|
|
15648
|
-
await execAsync("
|
|
15854
|
+
const repoDir = path24.resolve(dir, "glsp-vscode-integration");
|
|
15855
|
+
await execAsync(runScriptCommand(detectPackageManager(repoDir), "workflow package"), {
|
|
15856
|
+
cwd: repoDir,
|
|
15857
|
+
silent: false,
|
|
15858
|
+
env: { FORCE_COLOR: "1" }
|
|
15859
|
+
});
|
|
15649
15860
|
});
|
|
15650
15861
|
var VscodeWebPackageCommand = baseCommand().name("web-package").description("Package the workflow VS Code web extension as a VSIX").option("-d, --dir <path>", "Target directory where repos are cloned").option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
15651
15862
|
const cli = thisCmd.opts();
|
|
15652
15863
|
configureRepoEnv(cli);
|
|
15653
15864
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15654
|
-
const repoDir =
|
|
15655
|
-
await execAsync("
|
|
15865
|
+
const repoDir = path24.resolve(dir, "glsp-vscode-integration");
|
|
15866
|
+
await execAsync(runScriptCommand(detectPackageManager(repoDir), "workflow:web package"), {
|
|
15867
|
+
cwd: repoDir,
|
|
15868
|
+
silent: false,
|
|
15869
|
+
env: { FORCE_COLOR: "1" }
|
|
15870
|
+
});
|
|
15656
15871
|
});
|
|
15657
15872
|
var VsixPathCommand = baseCommand().name("vsix-path").description("Print the path to the workflow VSIX file").option("-d, --dir <path>", "Target directory where repos are cloned").option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
15658
15873
|
const cli = thisCmd.opts();
|
|
15659
15874
|
configureRepoEnv(cli);
|
|
15660
15875
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15661
|
-
const repoDir =
|
|
15876
|
+
const repoDir = path24.resolve(dir, "glsp-vscode-integration");
|
|
15662
15877
|
const vsixPath = discoverVsix(repoDir);
|
|
15663
15878
|
process.stdout.write(vsixPath);
|
|
15664
15879
|
});
|
|
@@ -15666,7 +15881,7 @@ var WebVsixPathCommand = baseCommand().name("web-vsix-path").description("Print
|
|
|
15666
15881
|
const cli = thisCmd.opts();
|
|
15667
15882
|
configureRepoEnv(cli);
|
|
15668
15883
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15669
|
-
const repoDir =
|
|
15884
|
+
const repoDir = path24.resolve(dir, "glsp-vscode-integration");
|
|
15670
15885
|
const vsixPath = discoverWebVsix(repoDir);
|
|
15671
15886
|
process.stdout.write(vsixPath);
|
|
15672
15887
|
});
|
|
@@ -15677,11 +15892,11 @@ var WebVsixIdCommand = baseCommand().name("web-vsix-id").description("Print the
|
|
|
15677
15892
|
process.stdout.write(WEB_VSIX_ID);
|
|
15678
15893
|
});
|
|
15679
15894
|
function discoverVsix(repoDir) {
|
|
15680
|
-
const vsixDir =
|
|
15895
|
+
const vsixDir = path24.resolve(repoDir, VSIX_TARGET_DIR);
|
|
15681
15896
|
return discoverNewestFile("*.vsix", vsixDir, `No .vsix file found in ${vsixDir}. Run 'glsp repo vscode package' first.`);
|
|
15682
15897
|
}
|
|
15683
15898
|
function discoverWebVsix(repoDir) {
|
|
15684
|
-
const vsixDir =
|
|
15899
|
+
const vsixDir = path24.resolve(repoDir, WEB_VSIX_TARGET_DIR);
|
|
15685
15900
|
return discoverNewestFile("*.vsix", vsixDir, `No .vsix file found in ${vsixDir}. Run 'glsp repo vscode web-package' first.`);
|
|
15686
15901
|
}
|
|
15687
15902
|
|
|
@@ -15745,14 +15960,14 @@ function createSubrepoCommand(repo) {
|
|
|
15745
15960
|
}
|
|
15746
15961
|
|
|
15747
15962
|
// src/commands/repo/workspace.ts
|
|
15748
|
-
var
|
|
15749
|
-
var
|
|
15963
|
+
var fs22 = __toESM(require("fs"));
|
|
15964
|
+
var path25 = __toESM(require("path"));
|
|
15750
15965
|
var WORKSPACE_FILE_NAME = "glsp.code-workspace";
|
|
15751
15966
|
function generateWorkspaceContent(repos, dir, options) {
|
|
15752
|
-
const outputDir = options.outputPath ?
|
|
15967
|
+
const outputDir = options.outputPath ? path25.dirname(path25.resolve(options.outputPath)) : dir;
|
|
15753
15968
|
const folders = repos.map((repo) => {
|
|
15754
|
-
const repoDir =
|
|
15755
|
-
const relativePath =
|
|
15969
|
+
const repoDir = path25.resolve(dir, repo);
|
|
15970
|
+
const relativePath = path25.relative(outputDir, repoDir);
|
|
15756
15971
|
return { name: repo, path: relativePath };
|
|
15757
15972
|
});
|
|
15758
15973
|
const hasJavaRepos = repos.some((r) => !GLSPRepo.isNpmRepo(r));
|
|
@@ -15817,24 +16032,24 @@ function generateWorkspaceContent(repos, dir, options) {
|
|
|
15817
16032
|
}
|
|
15818
16033
|
function generateWorkspaceFile(repos, dir, options) {
|
|
15819
16034
|
const workspace = generateWorkspaceContent(repos, dir, options);
|
|
15820
|
-
const outputFile = options.outputPath ?
|
|
15821
|
-
|
|
15822
|
-
|
|
16035
|
+
const outputFile = options.outputPath ? path25.resolve(options.outputPath) : path25.join(dir, WORKSPACE_FILE_NAME);
|
|
16036
|
+
fs22.mkdirSync(path25.dirname(outputFile), { recursive: true });
|
|
16037
|
+
fs22.writeFileSync(outputFile, JSON.stringify(workspace, void 0, 4) + "\n", "utf-8");
|
|
15823
16038
|
LOGGER.info(`Workspace file written to ${outputFile}`);
|
|
15824
16039
|
return outputFile;
|
|
15825
16040
|
}
|
|
15826
16041
|
function discoverWorkspaceFile(dir) {
|
|
15827
|
-
if (!
|
|
16042
|
+
if (!fs22.existsSync(dir)) {
|
|
15828
16043
|
return void 0;
|
|
15829
16044
|
}
|
|
15830
|
-
const files =
|
|
16045
|
+
const files = fs22.readdirSync(dir).filter((f) => f.endsWith(".code-workspace"));
|
|
15831
16046
|
if (files.length === 1) {
|
|
15832
|
-
return
|
|
16047
|
+
return path25.join(dir, files[0]);
|
|
15833
16048
|
}
|
|
15834
16049
|
if (files.length > 1) {
|
|
15835
16050
|
const defaultFile = files.find((f) => f === WORKSPACE_FILE_NAME);
|
|
15836
16051
|
if (defaultFile) {
|
|
15837
|
-
return
|
|
16052
|
+
return path25.join(dir, defaultFile);
|
|
15838
16053
|
}
|
|
15839
16054
|
}
|
|
15840
16055
|
return void 0;
|
|
@@ -15884,19 +16099,32 @@ for (const repo of GLSPRepo.choices) {
|
|
|
15884
16099
|
}
|
|
15885
16100
|
|
|
15886
16101
|
// src/commands/update-next.ts
|
|
15887
|
-
var
|
|
16102
|
+
var path26 = __toESM(require("path"));
|
|
15888
16103
|
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);
|
|
15889
16104
|
async function updateNext(rootDir, options) {
|
|
15890
16105
|
configureLogger(options.verbose);
|
|
15891
|
-
const rootPkgPath =
|
|
16106
|
+
const rootPkgPath = path26.join(rootDir, "package.json");
|
|
15892
16107
|
if (getUncommittedChanges(rootDir).includes(rootPkgPath)) {
|
|
15893
16108
|
LOGGER.warn("Uncommitted changes in root `package.json`. Please commit or stash them before running this command.");
|
|
15894
16109
|
return;
|
|
15895
16110
|
}
|
|
15896
16111
|
configureExec({ silent: false, fatal: true });
|
|
15897
16112
|
LOGGER.info("Updating next dependencies ...");
|
|
15898
|
-
rootDir =
|
|
15899
|
-
const
|
|
16113
|
+
rootDir = path26.resolve(rootDir);
|
|
16114
|
+
const pm = detectPackageManager(rootDir);
|
|
16115
|
+
const packages = getWorkspacePackages(rootDir, true);
|
|
16116
|
+
if (pm === "pnpm") {
|
|
16117
|
+
LOGGER.debug(`Scanning ${packages.length} packages for 'next' dependencies`, packages);
|
|
16118
|
+
const nextDeps = getNextDependencies(packages);
|
|
16119
|
+
if (nextDeps.length === 0) {
|
|
16120
|
+
LOGGER.info("No next dependencies found");
|
|
16121
|
+
return;
|
|
16122
|
+
}
|
|
16123
|
+
LOGGER.info("Upgrade and rebuild packages ...");
|
|
16124
|
+
await execAsync(`pnpm update -r ${nextDeps.join(" ")}`, { silent: false, cwd: rootDir });
|
|
16125
|
+
LOGGER.info("Upgrade successfully completed");
|
|
16126
|
+
return;
|
|
16127
|
+
}
|
|
15900
16128
|
LOGGER.debug(`Scanning ${packages.length} packages to derive resolutions`, packages);
|
|
15901
16129
|
const resolutions = await getResolutions(packages);
|
|
15902
16130
|
if (Object.keys(resolutions).length === 0) {
|
|
@@ -15916,19 +16144,22 @@ async function updateNext(rootDir, options) {
|
|
|
15916
16144
|
await execAsync("yarn", { silent: false, cwd: rootDir });
|
|
15917
16145
|
LOGGER.info("Upgrade successfully completed");
|
|
15918
16146
|
}
|
|
15919
|
-
|
|
15920
|
-
|
|
16147
|
+
function getNextDependencies(packages) {
|
|
16148
|
+
const dependencies = [];
|
|
15921
16149
|
for (const pkg of packages) {
|
|
15922
16150
|
const allDeps = {
|
|
15923
16151
|
...pkg.content.dependencies || {},
|
|
15924
16152
|
...pkg.content.devDependencies || {},
|
|
15925
16153
|
...pkg.content.peerDependencies || {}
|
|
15926
16154
|
};
|
|
15927
|
-
|
|
15928
|
-
dependencies.push(...nextDeps);
|
|
16155
|
+
dependencies.push(...Object.keys(allDeps).filter((dep) => allDeps[dep] === "next"));
|
|
15929
16156
|
}
|
|
15930
|
-
|
|
15931
|
-
LOGGER.debug(`Found ${
|
|
16157
|
+
const nextDeps = [...new Set(dependencies)];
|
|
16158
|
+
LOGGER.debug(`Found ${nextDeps.length} 'next' dependencies`, nextDeps);
|
|
16159
|
+
return nextDeps;
|
|
16160
|
+
}
|
|
16161
|
+
async function getResolutions(packages) {
|
|
16162
|
+
const dependencies = getNextDependencies(packages);
|
|
15932
16163
|
LOGGER.info("Retrieve next versions ... ");
|
|
15933
16164
|
const resolutions = {};
|
|
15934
16165
|
dependencies.forEach((dep) => {
|