@eclipse-glsp/cli 2.8.0-next.3 → 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/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 path26 = require("node:path");
1198
- var fs21 = require("node:fs");
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 (fs21.existsSync(executableFile)) return;
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 = path26.resolve(baseDir, baseName);
2212
- if (fs21.existsSync(localBin)) return localBin;
2213
- if (sourceExt.includes(path26.extname(baseName))) return void 0;
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) => fs21.existsSync(`${localBin}${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 = fs21.realpathSync(this._scriptPath);
2227
+ resolvedScriptPath = fs23.realpathSync(this._scriptPath);
2228
2228
  } catch {
2229
2229
  resolvedScriptPath = this._scriptPath;
2230
2230
  }
2231
- executableDir = path26.resolve(
2232
- path26.dirname(resolvedScriptPath),
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 = path26.basename(
2239
+ const legacyName = path27.basename(
2240
2240
  this._scriptPath,
2241
- path26.extname(this._scriptPath)
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(path26.extname(executableFile));
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 = path26.basename(filename, path26.extname(filename));
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(path27) {
3183
- if (path27 === void 0) return this._executableDir;
3184
- this._executableDir = path27;
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 path26 = (function() {
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 = path26.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 && path26.sep !== "/") {
3785
- pattern = pattern.split(path26.sep).join("/");
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 (path26.sep !== "/") {
4155
- f = f.split(path26.sep).join("/");
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 path26 = require("path");
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 path26.resolve(cwd, filepath);
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 path26 = require("path");
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: path26.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 path26 = require("path");
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 || path26.sep === "\\";
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 path26 = require("path");
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(path26.basename(input));
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 path26 = require("path");
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 = path26.basename(pattern);
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 path26.isAbsolute(pattern);
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 fs21 = require_fs();
7820
- exports2.fs = fs21;
7821
- var path26 = require_path();
7822
- exports2.path = path26;
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(path26, settings, callback) {
7935
- settings.fs.lstat(path26, (lstatError, 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(path26, (statError, 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(path26, settings) {
7977
- const lstat = settings.fs.lstatSync(path26);
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(path26);
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 fs21 = require("fs");
8004
+ var fs23 = require("fs");
8005
8005
  exports2.FILE_SYSTEM_ADAPTER = {
8006
- lstat: fs21.lstat,
8007
- stat: fs21.stat,
8008
- lstatSync: fs21.lstatSync,
8009
- statSync: fs21.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 fs21 = require_fs2();
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 = fs21.createFileSystemAdapter(this._options.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(path26, optionsOrSettingsOrCallback, callback) {
8053
+ function stat(path27, optionsOrSettingsOrCallback, callback) {
8054
8054
  if (typeof optionsOrSettingsOrCallback === "function") {
8055
- async.read(path26, getSettings(), optionsOrSettingsOrCallback);
8055
+ async.read(path27, getSettings(), optionsOrSettingsOrCallback);
8056
8056
  return;
8057
8057
  }
8058
- async.read(path26, getSettings(optionsOrSettingsOrCallback), callback);
8058
+ async.read(path27, getSettings(optionsOrSettingsOrCallback), callback);
8059
8059
  }
8060
8060
  exports2.stat = stat;
8061
- function statSync5(path26, optionsOrSettings) {
8061
+ function statSync5(path27, optionsOrSettings) {
8062
8062
  const settings = getSettings(optionsOrSettings);
8063
- return sync.read(path26, settings);
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 fs21 = require_fs3();
8187
- exports2.fs = fs21;
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 path26 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
8279
+ const path27 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
8280
8280
  return (done) => {
8281
- fsStat.stat(path26, settings.fsStatSettings, (error, stats) => {
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: path26,
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 fs21 = require("fs");
8382
+ var fs23 = require("fs");
8383
8383
  exports2.FILE_SYSTEM_ADAPTER = {
8384
- lstat: fs21.lstat,
8385
- stat: fs21.stat,
8386
- lstatSync: fs21.lstatSync,
8387
- statSync: fs21.statSync,
8388
- readdir: fs21.readdir,
8389
- readdirSync: fs21.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 path26 = require("path");
8406
+ var path27 = require("path");
8407
8407
  var fsStat = require_out();
8408
- var fs21 = require_fs4();
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 = fs21.createFileSystemAdapter(this._options.fs);
8414
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path26.sep);
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(path26, optionsOrSettingsOrCallback, callback) {
8441
+ function scandir(path27, optionsOrSettingsOrCallback, callback) {
8442
8442
  if (typeof optionsOrSettingsOrCallback === "function") {
8443
- async.read(path26, getSettings(), optionsOrSettingsOrCallback);
8443
+ async.read(path27, getSettings(), optionsOrSettingsOrCallback);
8444
8444
  return;
8445
8445
  }
8446
- async.read(path26, getSettings(optionsOrSettingsOrCallback), callback);
8446
+ async.read(path27, getSettings(optionsOrSettingsOrCallback), callback);
8447
8447
  }
8448
8448
  exports2.scandir = scandir;
8449
- function scandirSync(path26, optionsOrSettings) {
8449
+ function scandirSync(path27, optionsOrSettings) {
8450
8450
  const settings = getSettings(optionsOrSettings);
8451
- return sync.read(path26, settings);
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(resolve26, reject) {
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
- resolve26(result);
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(resolve26, reject) {
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
- resolve26(result);
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(resolve26) {
8735
- resolve26();
8734
+ return new Promise(function(resolve27) {
8735
+ resolve27();
8736
8736
  });
8737
8737
  }
8738
8738
  var previousDrain = queue.drain;
8739
- var p = new Promise(function(resolve26) {
8739
+ var p = new Promise(function(resolve27) {
8740
8740
  queue.drain = function() {
8741
8741
  previousDrain();
8742
- resolve26();
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 path26 = require("path");
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, path26.sep);
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 path26 = require("path");
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 path26.resolve(this._settings.cwd, filepath);
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((resolve26, reject) => {
9225
+ return new Promise((resolve27, reject) => {
9226
9226
  this._stat(filepath, this._fsStatSettings, (error, stats) => {
9227
- return error === null ? resolve26(stats) : reject(error);
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((resolve26, reject) => {
9251
+ return new Promise((resolve27, reject) => {
9252
9252
  this._walkAsync(root, options, (error, entries) => {
9253
9253
  if (error === null) {
9254
- resolve26(entries);
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((resolve26, reject) => {
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", () => resolve26(entries));
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 path26 = require("path");
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 path26.resolve(this._settings.cwd, task.base);
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 fs21 = require("fs");
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: fs21.lstat,
9774
- lstatSync: fs21.lstatSync,
9775
- stat: fs21.stat,
9776
- statSync: fs21.statSync,
9777
- readdir: fs21.readdir,
9778
- readdirSync: fs21.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(path26, checkUnignored, mode) {
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(path26);
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 = (path26, originalPath, doThrow) => {
10316
- if (!isString(path26)) {
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 (!path26) {
10322
+ if (!path27) {
10323
10323
  return doThrow(`path must not be empty`, TypeError);
10324
10324
  }
10325
- if (checkPath.isNotRelative(path26)) {
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 = (path26) => REGEX_TEST_INVALID_PATH.test(path26);
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 path26 = originalPath && checkPath.convert(originalPath);
10364
+ const path27 = originalPath && checkPath.convert(originalPath);
10365
10365
  checkPath(
10366
- path26,
10366
+ path27,
10367
10367
  originalPath,
10368
10368
  this._strictPathCheck ? throwError : RETURN_FALSE
10369
10369
  );
10370
- return this._t(path26, cache, checkUnignored, slices);
10370
+ return this._t(path27, cache, checkUnignored, slices);
10371
10371
  }
10372
- checkIgnore(path26) {
10373
- if (!REGEX_TEST_TRAILING_SLASH.test(path26)) {
10374
- return this.test(path26);
10372
+ checkIgnore(path27) {
10373
+ if (!REGEX_TEST_TRAILING_SLASH.test(path27)) {
10374
+ return this.test(path27);
10375
10375
  }
10376
- const slices = path26.split(SLASH).filter(Boolean);
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(path26, false, MODE_CHECK_IGNORE);
10389
+ return this._rules.test(path27, false, MODE_CHECK_IGNORE);
10390
10390
  }
10391
- _t(path26, cache, checkUnignored, slices) {
10392
- if (path26 in cache) {
10393
- return cache[path26];
10391
+ _t(path27, cache, checkUnignored, slices) {
10392
+ if (path27 in cache) {
10393
+ return cache[path27];
10394
10394
  }
10395
10395
  if (!slices) {
10396
- slices = path26.split(SLASH).filter(Boolean);
10396
+ slices = path27.split(SLASH).filter(Boolean);
10397
10397
  }
10398
10398
  slices.pop();
10399
10399
  if (!slices.length) {
10400
- return cache[path26] = this._rules.test(path26, checkUnignored, MODE_IGNORE);
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[path26] = parent.ignored ? parent : this._rules.test(path26, checkUnignored, MODE_IGNORE);
10408
+ return cache[path27] = parent.ignored ? parent : this._rules.test(path27, checkUnignored, MODE_IGNORE);
10409
10409
  }
10410
- ignores(path26) {
10411
- return this._test(path26, this._ignoreCache, false).ignored;
10410
+ ignores(path27) {
10411
+ return this._test(path27, this._ignoreCache, false).ignored;
10412
10412
  }
10413
10413
  createFilter() {
10414
- return (path26) => !this.ignores(path26);
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(path26) {
10421
- return this._test(path26, this._testCache, true);
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 = (path26) => checkPath(path26 && checkPath.convert(path26), path26, RETURN_FALSE);
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 = (path26) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path26) || isNotRelative(path26);
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(path26) {
10447
- const isExtendedLengthPath = path26.startsWith("\\\\?\\");
10446
+ function slash(path27) {
10447
+ const isExtendedLengthPath = path27.startsWith("\\\\?\\");
10448
10448
  if (isExtendedLengthPath) {
10449
- return path26;
10449
+ return path27;
10450
10450
  }
10451
- return path26.replace(/\\/g, "/");
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 path26 = isNegativePattern(filePath) ? filePath.slice(1) : filePath;
10592
- return import_node_path2.default.isAbsolute(path26) ? path26 : import_node_path2.default.join(cwd, path26);
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((resolve26, reject) => {
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
- resolve26(subprocess);
13201
+ resolve27(subprocess);
13202
13202
  });
13203
13203
  });
13204
13204
  }
@@ -13539,7 +13539,7 @@ function execAsync(cmd, options = {}) {
13539
13539
  if (verbose) {
13540
13540
  console.log(`+ ${cmd}`);
13541
13541
  }
13542
- return new Promise((resolve26, reject) => {
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
- resolve26(stdout.trim());
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((resolve26, reject) => {
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
- resolve26();
13611
+ resolve27();
13612
13612
  });
13613
13613
  childProcess2.on("error", (error) => {
13614
13614
  reject(new Error(`Command "${cmd}" failed: ${error.message}`));
@@ -13620,51 +13620,51 @@ function execForeground(cmd, options = {}) {
13620
13620
  function escapeDoubleQuotesAndBackslashes(str) {
13621
13621
  return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
13622
13622
  }
13623
- function isGitRepository(path26) {
13624
- const isGitRepo = exec("git rev-parse --is-inside-work-tree", { silent: true, cwd: path26 }).toLocaleLowerCase() === "true";
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(path26) {
13628
- const fileString = exec("git rev-parse --show-toplevel", { cwd: path26 });
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(path26) {
13632
- return getUncommittedChanges(path26).length > 0;
13631
+ function hasChanges(path27) {
13632
+ return getUncommittedChanges(path27).length > 0;
13633
13633
  }
13634
- function getUncommittedChanges(path26) {
13635
- return exec("git status --porcelain", { cwd: path26 }).split("\n").filter((value) => value.trim().length !== 0).map(
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)(path26 ?? process.cwd(), fileInfo.trim().split(" ").pop() ?? "")
13638
+ (0, import_path.resolve)(path27 ?? process.cwd(), fileInfo.trim().split(" ").pop() ?? "")
13639
13639
  )
13640
13640
  );
13641
13641
  }
13642
- function commitChanges(message, path26) {
13643
- exec("git add .", { cwd: path26 });
13644
- exec(`git commit -m "${escapeDoubleQuotesAndBackslashes(message)}"`, { cwd: path26 });
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(path26) {
13647
- return exec("git diff --name-only HEAD^", { cwd: path26 }).split("\n").map((file) => (0, import_path.resolve)(path26 ?? process.cwd(), file));
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
13648
  }
13649
- function getChangesComparedToDefaultBranch(path26) {
13650
- const baseRef = getDefaultBranchRef(path26);
13651
- const committedChanges = baseRef ? exec(`git diff --name-only ${baseRef}...HEAD`, { cwd: path26, silent: true }).split("\n").filter((value) => value.trim().length !== 0).map((file) => (0, import_path.resolve)(path26 ?? process.cwd(), file.trim())) : [];
13652
- return [.../* @__PURE__ */ new Set([...committedChanges, ...getUncommittedChanges(path26)])];
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
13653
  }
13654
- function getDefaultBranchRef(path26) {
13654
+ function getDefaultBranchRef(path27) {
13655
13655
  try {
13656
- const ref = exec("git symbolic-ref --short refs/remotes/origin/HEAD", { cwd: path26, silent: true, fatal: false });
13656
+ const ref = exec("git symbolic-ref --short refs/remotes/origin/HEAD", { cwd: path27, silent: true, fatal: false });
13657
13657
  if (ref) {
13658
13658
  return ref;
13659
13659
  }
13660
13660
  } catch {
13661
13661
  }
13662
13662
  const candidates = ["origin/main", "origin/master", "main", "master"];
13663
- return candidates.find((ref) => refExists(ref, path26));
13663
+ return candidates.find((ref) => refExists(ref, path27));
13664
13664
  }
13665
- function refExists(ref, path26) {
13665
+ function refExists(ref, path27) {
13666
13666
  try {
13667
- exec(`git rev-parse --verify --quiet ${ref}`, { cwd: path26, silent: true, fatal: false });
13667
+ exec(`git rev-parse --verify --quiet ${ref}`, { cwd: path27, silent: true, fatal: false });
13668
13668
  return true;
13669
13669
  } catch {
13670
13670
  return false;
@@ -13679,14 +13679,14 @@ function getLastModificationDate(filePath, repoRoot, excludeMessage) {
13679
13679
  return void 0;
13680
13680
  }
13681
13681
  }
13682
- function getRemoteUrl(path26) {
13683
- return exec("git config --get remote.origin.url", { cwd: path26 });
13682
+ function getRemoteUrl(path27) {
13683
+ return exec("git config --get remote.origin.url", { cwd: path27 });
13684
13684
  }
13685
- function createBranch(branch, path26) {
13686
- exec(`git checkout -B ${branch}`, { cwd: path26 });
13685
+ function createBranch(branch, path27) {
13686
+ exec(`git checkout -B ${branch}`, { cwd: path27 });
13687
13687
  }
13688
- function getDefaultBranch(path26) {
13689
- const output = exec("git remote show origin", { cwd: path26 });
13688
+ function getDefaultBranch(path27) {
13689
+ const output = exec("git remote show origin", { cwd: path27 });
13690
13690
  const match = output.match(/HEAD branch: (.+)/);
13691
13691
  return match ? match[1].trim() : "master";
13692
13692
  }
@@ -13865,6 +13865,42 @@ function readPackage(packagePath) {
13865
13865
  const packageData = readJson(packagePath);
13866
13866
  return new PackageHelper(packagePath, packageData.name);
13867
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
+ }
13868
13904
  function getYarnWorkspaceInfo(rootPath) {
13869
13905
  try {
13870
13906
  const result = exec("yarn workspaces info", { cwd: rootPath, silent: true });
@@ -13894,14 +13930,14 @@ function getYarnWorkspacePackages(rootPath, includeRoot = false) {
13894
13930
  var fs6 = __toESM(require("fs"));
13895
13931
  var import_path2 = require("path");
13896
13932
  function validateDirectory(rootDir) {
13897
- const path26 = (0, import_path2.resolve)(rootDir);
13898
- if (!fs6.existsSync(path26)) {
13899
- throw new InvalidArgumentError(`Not a valid file path!: ${path26}`);
13933
+ const path27 = (0, import_path2.resolve)(rootDir);
13934
+ if (!fs6.existsSync(path27)) {
13935
+ throw new InvalidArgumentError(`Not a valid file path!: ${path27}`);
13900
13936
  }
13901
- if (!fs6.statSync(path26).isDirectory()) {
13902
- throw new InvalidArgumentError(`Not a directory!: ${path26}`);
13937
+ if (!fs6.statSync(path27).isDirectory()) {
13938
+ throw new InvalidArgumentError(`Not a directory!: ${path27}`);
13903
13939
  }
13904
- return path26;
13940
+ return path27;
13905
13941
  }
13906
13942
  function validateGitDirectory(repository) {
13907
13943
  const repoPath = validateDirectory(repository);
@@ -14102,8 +14138,9 @@ async function generateCoverageReport(options) {
14102
14138
  LOGGER.info(`HTML report available at: ${options.projectRoot}/coverage/index.html`);
14103
14139
  }
14104
14140
  function validateAndRetrievePackages(options) {
14105
- exec("yarn nyc -h", { silent: true, errorMsg: "Nyc is not installed!" });
14106
- const workspacePackages = getYarnWorkspacePackages(options.projectRoot, true);
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);
14107
14144
  const rootPackage = workspacePackages.pop();
14108
14145
  if (!rootPackage.hasScript(options.coverageScript)) {
14109
14146
  CoverageReportCommand.error(
@@ -14114,7 +14151,7 @@ function validateAndRetrievePackages(options) {
14114
14151
  }
14115
14152
  async function collectPackageReportFiles(packages, options) {
14116
14153
  LOGGER.info("Create individual package coverage reports");
14117
- await execAsync(`yarn ${options.coverageScript}`, { silent: false });
14154
+ await execAsync(runScriptCommand(detectPackageManager(options.projectRoot), options.coverageScript), { silent: false });
14118
14155
  const reports = packages.flatMap((pkg) => findFiles(pkg.location, "**/coverage-final.json"));
14119
14156
  LOGGER.info(`Collected ${reports.length} coverage reports from ${packages.length} packages`);
14120
14157
  return reports;
@@ -14138,7 +14175,7 @@ async function combineReports(reportFiles, options) {
14138
14175
  tempFiles.push("_" + config);
14139
14176
  }
14140
14177
  });
14141
- await execAsync("yarn nyc report --reporter html", { silent: false });
14178
+ await execAsync(execBinCommand(detectPackageManager(options.projectRoot), "nyc report --reporter html"), { silent: false });
14142
14179
  tempFiles.forEach((config) => moveFile(config, config.substring(1)));
14143
14180
  }
14144
14181
 
@@ -14330,6 +14367,22 @@ function toNewVersion(version2, versionType) {
14330
14367
  function isNextVersion(version2) {
14331
14368
  return version2.endsWith("-next") || version2.endsWith(".SNAPSHOT");
14332
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
+ }
14333
14386
  function getLastReleaseTag(repoDir) {
14334
14387
  const tags = exec("git tag --list --sort=-v:refname", { cwd: repoDir }).split("\n");
14335
14388
  const lastTag = tags.find((tag) => {
@@ -14363,6 +14416,7 @@ function getChangeLogChanges(options) {
14363
14416
  }
14364
14417
 
14365
14418
  // src/commands/releng/version.ts
14419
+ var fs10 = __toESM(require("fs"));
14366
14420
  var path9 = __toESM(require("path"));
14367
14421
  var semver2 = __toESM(require_semver2());
14368
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) => {
@@ -14375,7 +14429,7 @@ var VersionCommand = baseCommand().name("version").description("Set the version
14375
14429
  const options = { ...cmdOptions, repo, version: version2, versionType };
14376
14430
  let workspacePackages;
14377
14431
  if (GLSPRepo.isNpmRepo(repo)) {
14378
- workspacePackages = GLSPRepo.isNpmRepo(repo) ? getYarnWorkspacePackages(path9.join(cmdOptions.repoDir, ""), true) : void 0;
14432
+ workspacePackages = getWorkspacePackages(cmdOptions.repoDir, true);
14379
14433
  }
14380
14434
  return setVersion({ ...options, workspacePackages });
14381
14435
  });
@@ -14399,9 +14453,14 @@ function setVersionNpm(options) {
14399
14453
  updateGLSPDependencies(pkg, options.version, workspacePackageNames);
14400
14454
  pkg.write();
14401
14455
  });
14402
- const lernaJson = readJson("lerna.json");
14403
- lernaJson.version = options.version;
14404
- writeJson("lerna.json", lernaJson);
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
+ }
14405
14464
  if (options.repo === "glsp-theia-integration") {
14406
14465
  checkAndUpdateTheiaReadmes(options);
14407
14466
  }
@@ -14413,7 +14472,9 @@ function updateGLSPDependencies(pkg, version2, workspacePackageNames) {
14413
14472
  ["dependencies", "devDependencies"].forEach((depType) => {
14414
14473
  if (pkg.content[depType]) {
14415
14474
  Object.keys(pkg.content[depType] || {}).filter((dep) => workspacePackageNames.has(dep) || dep.startsWith("@eclipse-glsp")).forEach((dep) => {
14416
- if (workspacePackageNames.has(dep) || !isNextVersion(version2)) {
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)) {
14417
14478
  LOGGER.debug(` - Bump ${depType} ${dep} to version ${version2}`);
14418
14479
  pkg.content[depType][dep] = `${version2}`;
14419
14480
  } else {
@@ -14495,7 +14556,7 @@ function setVersionEclipseClient(options) {
14495
14556
  ...options,
14496
14557
  repoDir: clientPath,
14497
14558
  version: options.version,
14498
- workspacePackages: getYarnWorkspacePackages(path9.join(options.repoDir, "client"), true)
14559
+ workspacePackages: getWorkspacePackages(path9.join(options.repoDir, "client"), true)
14499
14560
  });
14500
14561
  cd(options.repoDir);
14501
14562
  }
@@ -14563,7 +14624,7 @@ async function prepareRelease(options) {
14563
14624
  }
14564
14625
  cd(options.repoDir);
14565
14626
  if (GLSPRepo.isNpmRepo(options.repo)) {
14566
- options.workspacePackages = getYarnWorkspacePackages(options.repoDir, true);
14627
+ options.workspacePackages = getWorkspacePackages(options.repoDir, true);
14567
14628
  }
14568
14629
  if (options.check) {
14569
14630
  checkPreconditions(options);
@@ -14620,9 +14681,13 @@ async function build(options) {
14620
14681
  }
14621
14682
  }
14622
14683
  async function buildNpm(options) {
14623
- LOGGER.info("Install & Build with yarn");
14624
- await execAsync("yarn", { silent: false, cwd: options.repoDir, errorMsg: "Yarn build failed" });
14625
- LOGGER.debug("Yarn build succeeded");
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");
14626
14691
  }
14627
14692
  async function buildJavaServer(options) {
14628
14693
  LOGGER.info("Build M2 & P2");
@@ -14713,15 +14778,113 @@ Note: This pull request was created automatically. After merging, the automated
14713
14778
  }
14714
14779
  }
14715
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
+
14716
14879
  // src/commands/releng/releng.ts
14717
- 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);
14718
14881
 
14719
14882
  // src/commands/repo/build.ts
14720
- var path12 = __toESM(require("path"));
14883
+ var path13 = __toESM(require("path"));
14721
14884
 
14722
14885
  // src/commands/repo/common/utils.ts
14723
- var fs10 = __toESM(require("fs"));
14724
- var path11 = __toESM(require("path"));
14886
+ var fs12 = __toESM(require("fs"));
14887
+ var path12 = __toESM(require("path"));
14725
14888
  var readline = __toESM(require("readline"));
14726
14889
  var GLSP_GITHUB_ORG = "eclipse-glsp";
14727
14890
  var THEIA_URL = "http://localhost:3000";
@@ -14731,7 +14894,7 @@ function configureRepoEnv(options) {
14731
14894
  configureEnv(options);
14732
14895
  }
14733
14896
  function validateReposExist(repos, dir) {
14734
- const missing = repos.filter((repo) => !fs10.existsSync(path11.resolve(dir, repo)));
14897
+ const missing = repos.filter((repo) => !fs12.existsSync(path12.resolve(dir, repo)));
14735
14898
  if (missing.length > 0) {
14736
14899
  throw new Error(`The following repositories are not cloned in '${dir}': ${missing.join(", ")}. Run 'glsp repo clone' first.`);
14737
14900
  }
@@ -14741,34 +14904,34 @@ function formatError(error) {
14741
14904
  }
14742
14905
  function resolveWorkspaceDir(cliDir) {
14743
14906
  if (cliDir) {
14744
- return path11.resolve(cliDir);
14907
+ return path12.resolve(cliDir);
14745
14908
  }
14746
- let current = path11.resolve(process.cwd());
14747
- const root = path11.parse(current).root;
14909
+ let current = path12.resolve(process.cwd());
14910
+ const root = path12.parse(current).root;
14748
14911
  while (current !== root) {
14749
14912
  if (discoverRepos(current).length > 0) {
14750
14913
  return current;
14751
14914
  }
14752
- if (GLSPRepo.is(path11.basename(current))) {
14753
- return path11.dirname(current);
14915
+ if (GLSPRepo.is(path12.basename(current))) {
14916
+ return path12.dirname(current);
14754
14917
  }
14755
- current = path11.dirname(current);
14918
+ current = path12.dirname(current);
14756
14919
  }
14757
14920
  return process.cwd();
14758
14921
  }
14759
14922
  function resolveRepoDir(repo, cliDir) {
14760
14923
  const workspaceDir = resolveWorkspaceDir(cliDir);
14761
- const repoDir = path11.resolve(workspaceDir, repo);
14762
- if (!fs10.existsSync(repoDir) && path11.basename(workspaceDir) === repo) {
14924
+ const repoDir = path12.resolve(workspaceDir, repo);
14925
+ if (!fs12.existsSync(repoDir) && path12.basename(workspaceDir) === repo) {
14763
14926
  return workspaceDir;
14764
14927
  }
14765
14928
  return repoDir;
14766
14929
  }
14767
14930
  function discoverRepos(dir) {
14768
- if (!fs10.existsSync(dir)) {
14931
+ if (!fs12.existsSync(dir)) {
14769
14932
  return [];
14770
14933
  }
14771
- return fs10.readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && GLSPRepo.is(entry.name)).map((entry) => entry.name).sort((a, b) => GLSPRepo.choices.indexOf(a) - GLSPRepo.choices.indexOf(b));
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));
14772
14935
  }
14773
14936
  function resolveTargetRepos(options) {
14774
14937
  const dir = resolveWorkspaceDir(options.dir);
@@ -14817,9 +14980,9 @@ function isLeafRepo(repo) {
14817
14980
  function prompt(question) {
14818
14981
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
14819
14982
  return new Promise(
14820
- (resolve26) => rl.question(question, (answer) => {
14983
+ (resolve27) => rl.question(question, (answer) => {
14821
14984
  rl.close();
14822
- resolve26(answer);
14985
+ resolve27(answer);
14823
14986
  })
14824
14987
  );
14825
14988
  }
@@ -14828,22 +14991,30 @@ function discoverNewestFile(pattern, dir, errorMsg) {
14828
14991
  if (files.length === 0) {
14829
14992
  throw new Error(errorMsg);
14830
14993
  }
14831
- return files.reduce((newest, file) => fs10.statSync(file).mtimeMs > fs10.statSync(newest).mtimeMs ? file : newest);
14994
+ return files.reduce((newest, file) => fs12.statSync(file).mtimeMs > fs12.statSync(newest).mtimeMs ? file : newest);
14832
14995
  }
14833
14996
 
14834
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
+ }
14835
15007
  async function buildSingleRepo(repo, options) {
14836
- const repoDir = path12.resolve(options.dir, repo);
14837
- const yarnOpts = { cwd: repoDir, verbose: options.verbose, silent: false, env: { FORCE_COLOR: "1" } };
15008
+ const repoDir = path13.resolve(options.dir, repo);
15009
+ const npmOpts = { cwd: repoDir, verbose: options.verbose, silent: false, env: { FORCE_COLOR: "1" } };
14838
15010
  const mvnOpts = { cwd: repoDir, verbose: options.verbose, silent: false };
14839
15011
  LOGGER.label(`Building ${repo}...`);
14840
15012
  switch (repo) {
14841
15013
  case "glsp-theia-integration": {
14842
- LOGGER.debug("Yarn install");
14843
- await execAsync("yarn", yarnOpts);
15014
+ await installAndBuildNpm(repoDir, npmOpts);
14844
15015
  const target = options.electron ? "electron" : "browser";
14845
- LOGGER.debug("Yarn build for target: " + target);
14846
- await execAsync(`yarn ${target} build`, yarnOpts);
15016
+ LOGGER.debug("Build for target: " + target);
15017
+ await execAsync(runScriptCommand(detectPackageManager(repoDir), `${target} build`), npmOpts);
14847
15018
  break;
14848
15019
  }
14849
15020
  case "glsp-server": {
@@ -14851,15 +15022,14 @@ async function buildSingleRepo(repo, options) {
14851
15022
  break;
14852
15023
  }
14853
15024
  case "glsp-eclipse-integration": {
14854
- LOGGER.debug("Yarn build for client");
14855
- await execAsync("yarn", { ...yarnOpts, cwd: path12.join(repoDir, "client") });
15025
+ LOGGER.debug("Build client");
15026
+ await installAndBuildNpm(path13.join(repoDir, "client"), npmOpts);
14856
15027
  LOGGER.debug("Maven build for server");
14857
- await execAsync("mvn clean verify -Dstyle.color=always -B", { ...mvnOpts, cwd: path12.join(repoDir, "server") });
15028
+ await execAsync("mvn clean verify -Dstyle.color=always -B", { ...mvnOpts, cwd: path13.join(repoDir, "server") });
14858
15029
  break;
14859
15030
  }
14860
15031
  default: {
14861
- LOGGER.debug("Yarn build");
14862
- await execAsync("yarn", yarnOpts);
15032
+ await installAndBuildNpm(repoDir, npmOpts);
14863
15033
  break;
14864
15034
  }
14865
15035
  }
@@ -14932,8 +15102,8 @@ var BuildCommand = baseCommand().name("build").description("Build repositories (
14932
15102
  });
14933
15103
 
14934
15104
  // src/commands/repo/clone.ts
14935
- var fs11 = __toESM(require("fs"));
14936
- var path13 = __toESM(require("path"));
15105
+ var fs13 = __toESM(require("fs"));
15106
+ var path14 = __toESM(require("path"));
14937
15107
 
14938
15108
  // src/commands/repo/common/fork-utils.ts
14939
15109
  function forkExists(user, repo) {
@@ -15010,8 +15180,8 @@ async function confirm(message) {
15010
15180
 
15011
15181
  // src/commands/repo/clone.ts
15012
15182
  async function cloneSingleRepo(repo, options) {
15013
- const targetDir = path13.resolve(options.dir, repo);
15014
- if (fs11.existsSync(targetDir)) {
15183
+ const targetDir = path14.resolve(options.dir, repo);
15184
+ if (fs13.existsSync(targetDir)) {
15015
15185
  if (!options.override) {
15016
15186
  LOGGER.warn(`Skipping ${repo}: target directory already exists (use --override to replace): ${targetDir}`);
15017
15187
  return false;
@@ -15020,16 +15190,16 @@ async function cloneSingleRepo(repo, options) {
15020
15190
  const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
15021
15191
  const renamed = `${targetDir}_${timestamp}`;
15022
15192
  LOGGER.info(`Renaming existing directory ${targetDir} \u2192 ${renamed}`);
15023
- fs11.renameSync(targetDir, renamed);
15193
+ fs13.renameSync(targetDir, renamed);
15024
15194
  } else if (options.override === "remove") {
15025
15195
  LOGGER.info(`Removing existing directory ${targetDir}`);
15026
- fs11.rmSync(targetDir, { recursive: true, force: true });
15196
+ fs13.rmSync(targetDir, { recursive: true, force: true });
15027
15197
  }
15028
15198
  }
15029
15199
  if (options.fork) {
15030
15200
  await ensureFork(options.fork, repo);
15031
15201
  }
15032
- fs11.mkdirSync(path13.dirname(targetDir), { recursive: true });
15202
+ fs13.mkdirSync(path14.dirname(targetDir), { recursive: true });
15033
15203
  const org = options.fork ?? GLSP_GITHUB_ORG;
15034
15204
  LOGGER.info(`Cloning ${org}/${repo} into ${targetDir}`);
15035
15205
  if (options.protocol === "gh") {
@@ -15160,8 +15330,8 @@ Preset (${PRESET_NAMES.join("/")}): `);
15160
15330
  }
15161
15331
 
15162
15332
  // src/commands/repo/fork.ts
15163
- var fs12 = __toESM(require("fs"));
15164
- var path14 = __toESM(require("path"));
15333
+ var fs14 = __toESM(require("fs"));
15334
+ var path15 = __toESM(require("path"));
15165
15335
  async function configureForkRemote(repo, repoDir, user, protocol) {
15166
15336
  const remotes = getRemotes(repoDir);
15167
15337
  const action = analyzeForkRemotes(remotes, user, repo);
@@ -15198,8 +15368,8 @@ var ForkCommand = baseCommand().name("fork").description("Add fork remotes to al
15198
15368
  const protocol = cli.protocol ?? resolveDefaultProtocol();
15199
15369
  let failures = 0;
15200
15370
  for (const repo of repos) {
15201
- const repoDir = path14.resolve(dir, repo);
15202
- if (!fs12.existsSync(repoDir)) {
15371
+ const repoDir = path15.resolve(dir, repo);
15372
+ if (!fs14.existsSync(repoDir)) {
15203
15373
  LOGGER.warn(`${repo}: not cloned at ${repoDir}, skipping`);
15204
15374
  continue;
15205
15375
  }
@@ -15216,8 +15386,8 @@ var ForkCommand = baseCommand().name("fork").description("Add fork remotes to al
15216
15386
  });
15217
15387
 
15218
15388
  // src/commands/repo/link.ts
15219
- var fs13 = __toESM(require("fs"));
15220
- var path15 = __toESM(require("path"));
15389
+ var fs15 = __toESM(require("fs"));
15390
+ var path16 = __toESM(require("path"));
15221
15391
  var SINGLETON_DEPS = ["sprotty", "sprotty-protocol", "vscode-jsonrpc", "inversify"];
15222
15392
  var YARN_EXEC_OPTS = { silent: false, env: { FORCE_COLOR: "1" } };
15223
15393
  var LINKABLE_REPOS = [
@@ -15236,13 +15406,13 @@ function getGLSPWorkspacePackages(repoDir) {
15236
15406
  }
15237
15407
  function getRegisteredPackages(linkDir) {
15238
15408
  const packages = [];
15239
- if (!fs13.existsSync(linkDir)) {
15409
+ if (!fs15.existsSync(linkDir)) {
15240
15410
  return packages;
15241
15411
  }
15242
- for (const entry of fs13.readdirSync(linkDir)) {
15243
- const entryPath = path15.join(linkDir, entry);
15244
- if (entry.startsWith("@") && fs13.statSync(entryPath).isDirectory()) {
15245
- for (const sub of fs13.readdirSync(entryPath)) {
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)) {
15246
15416
  packages.push(`${entry}/${sub}`);
15247
15417
  }
15248
15418
  }
@@ -15261,7 +15431,7 @@ function registerPackages(repoDir, linkDir) {
15261
15431
  }
15262
15432
  function registerSingletons(clientDir, linkDir) {
15263
15433
  for (const dep of SINGLETON_DEPS) {
15264
- const depDir = path15.join(clientDir, "node_modules", dep);
15434
+ const depDir = path16.join(clientDir, "node_modules", dep);
15265
15435
  LOGGER.debug(`Registering singleton ${dep}`);
15266
15436
  exec(`yarn link --link-folder ${linkDir}`, { cwd: depDir, ...YARN_EXEC_OPTS });
15267
15437
  }
@@ -15270,11 +15440,11 @@ function consumePackages(repoDir, linkDir, registeredPackages) {
15270
15440
  if (registeredPackages.length === 0) {
15271
15441
  return;
15272
15442
  }
15273
- LOGGER.debug(`Linking ${registeredPackages.join(", ")} into ${path15.basename(repoDir)}`);
15443
+ LOGGER.debug(`Linking ${registeredPackages.join(", ")} into ${path16.basename(repoDir)}`);
15274
15444
  exec(`yarn link --link-folder ${linkDir} ${registeredPackages.join(" ")}`, { cwd: repoDir, ...YARN_EXEC_OPTS });
15275
15445
  }
15276
15446
  function consumeSingletons(repoDir, linkDir) {
15277
- LOGGER.debug(`Linking singletons into ${path15.basename(repoDir)}`);
15447
+ LOGGER.debug(`Linking singletons into ${path16.basename(repoDir)}`);
15278
15448
  exec(`yarn link --link-folder ${linkDir} ${SINGLETON_DEPS.join(" ")}`, { cwd: repoDir, ...YARN_EXEC_OPTS });
15279
15449
  }
15280
15450
  async function runLink(repos, options) {
@@ -15287,7 +15457,7 @@ async function runLink(repos, options) {
15287
15457
  LOGGER.warn("glsp-client is not in the configured repos. Linking without glsp-client may not produce useful results.");
15288
15458
  }
15289
15459
  validateReposExist(linkable, options.dir);
15290
- const linkDir = path15.resolve(options.dir, ".yarn-link");
15460
+ const linkDir = path16.resolve(options.dir, ".yarn-link");
15291
15461
  const ordered = getBuildOrder(linkable);
15292
15462
  const registeredPackages = [];
15293
15463
  let failures = 0;
@@ -15298,7 +15468,7 @@ async function runLink(repos, options) {
15298
15468
  if (i > 0) {
15299
15469
  LOGGER.newLine();
15300
15470
  }
15301
- const repoDir = path15.resolve(options.dir, repo);
15471
+ const repoDir = path16.resolve(options.dir, repo);
15302
15472
  LOGGER.info(`Linking ${repo}...`);
15303
15473
  const packagesFromPriorRepos = [...registeredPackages];
15304
15474
  if (!isLeafRepo(repo)) {
@@ -15335,7 +15505,7 @@ async function runUnlink(repos, options) {
15335
15505
  return;
15336
15506
  }
15337
15507
  validateReposExist(linkable, options.dir);
15338
- const linkDir = path15.resolve(options.dir, ".yarn-link");
15508
+ const linkDir = path16.resolve(options.dir, ".yarn-link");
15339
15509
  const ordered = getBuildOrder(linkable);
15340
15510
  const reversed = [...ordered].reverse();
15341
15511
  let failures = 0;
@@ -15346,7 +15516,7 @@ async function runUnlink(repos, options) {
15346
15516
  if (i > 0) {
15347
15517
  LOGGER.newLine();
15348
15518
  }
15349
- const repoDir = path15.resolve(options.dir, repo);
15519
+ const repoDir = path16.resolve(options.dir, repo);
15350
15520
  LOGGER.info(`Unlinking ${repo}...`);
15351
15521
  if (repo !== "glsp-client" && linkable.includes("glsp-client")) {
15352
15522
  exec(`yarn unlink --link-folder ${linkDir} ${SINGLETON_DEPS.join(" ")}`, { cwd: repoDir, ...YARN_EXEC_OPTS });
@@ -15357,8 +15527,8 @@ async function runUnlink(repos, options) {
15357
15527
  }
15358
15528
  if (repo === "glsp-client") {
15359
15529
  for (const dep of SINGLETON_DEPS) {
15360
- const depDir = path15.join(repoDir, "node_modules", dep);
15361
- if (fs13.existsSync(depDir)) {
15530
+ const depDir = path16.join(repoDir, "node_modules", dep);
15531
+ if (fs15.existsSync(depDir)) {
15362
15532
  exec(`yarn unlink --link-folder ${linkDir}`, { cwd: depDir, ...YARN_EXEC_OPTS });
15363
15533
  }
15364
15534
  }
@@ -15406,7 +15576,7 @@ var UnlinkCommand = baseCommand().name("unlink").description("Remove yarn links
15406
15576
  });
15407
15577
 
15408
15578
  // src/commands/repo/log.ts
15409
- var path16 = __toESM(require("path"));
15579
+ var path17 = __toESM(require("path"));
15410
15580
  function logSingleRepo(repoDir) {
15411
15581
  exec("git --no-pager log -1", { cwd: repoDir, silent: false });
15412
15582
  }
@@ -15415,7 +15585,7 @@ function createScopedLogCommand(repo) {
15415
15585
  const cli = thisCmd.opts();
15416
15586
  configureRepoEnv(cli);
15417
15587
  const dir = resolveWorkspaceDir(cli.dir);
15418
- const repoDir = path16.resolve(dir, repo);
15588
+ const repoDir = path17.resolve(dir, repo);
15419
15589
  logSingleRepo(repoDir);
15420
15590
  });
15421
15591
  }
@@ -15429,20 +15599,20 @@ var LogCommand = baseCommand().name("log").description("Print the last commit fo
15429
15599
  if (i > 0) {
15430
15600
  LOGGER.newLine();
15431
15601
  }
15432
- const repoDir = path16.resolve(dir, repo);
15602
+ const repoDir = path17.resolve(dir, repo);
15433
15603
  LOGGER.label(repo);
15434
15604
  logSingleRepo(repoDir);
15435
15605
  }
15436
15606
  });
15437
15607
 
15438
15608
  // src/commands/repo/pwd.ts
15439
- var path17 = __toESM(require("path"));
15609
+ var path18 = __toESM(require("path"));
15440
15610
  function createScopedPwdCommand(repo) {
15441
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) => {
15442
15612
  const cli = thisCmd.opts();
15443
15613
  configureRepoEnv(cli);
15444
15614
  const dir = resolveWorkspaceDir(cli.dir);
15445
- const repoPath = path17.resolve(dir, repo);
15615
+ const repoPath = path18.resolve(dir, repo);
15446
15616
  process.stdout.write(repoPath + "\n");
15447
15617
  });
15448
15618
  }
@@ -15456,7 +15626,7 @@ var PwdCommand = baseCommand().name("pwd").description("Print resolved paths for
15456
15626
  }
15457
15627
  if (cli.raw) {
15458
15628
  for (const repo of repos) {
15459
- const repoPath = path17.resolve(dir, repo);
15629
+ const repoPath = path18.resolve(dir, repo);
15460
15630
  process.stdout.write(`${repo} ${repoPath}
15461
15631
  `);
15462
15632
  }
@@ -15464,7 +15634,7 @@ var PwdCommand = baseCommand().name("pwd").description("Print resolved paths for
15464
15634
  }
15465
15635
  const maxLen = Math.max(...repos.map((r) => r.length));
15466
15636
  for (const repo of repos) {
15467
- const repoPath = path17.resolve(dir, repo);
15637
+ const repoPath = path18.resolve(dir, repo);
15468
15638
  const padded = repo.padEnd(maxLen + 2);
15469
15639
  LOGGER.info(`${padded}${repoPath}`);
15470
15640
  }
@@ -15483,27 +15653,28 @@ var TheiaOpenCommand = baseCommand().name("open").description("Open the Theia ap
15483
15653
  });
15484
15654
 
15485
15655
  // src/commands/repo/run.ts
15486
- var path19 = __toESM(require("path"));
15656
+ var path20 = __toESM(require("path"));
15487
15657
  function createScopedRunCommand(repo) {
15488
- return baseCommand().name("run").allowUnknownOption(true).allowExcessArguments(true).description(`Run an arbitrary yarn script in ${repo}`).argument("<script>", "The yarn script to run").option("-d, --dir <path>", "Target directory where repos are cloned").option("-v, --verbose", "Verbose output", false).action(async (script, _cmdOptions, thisCmd) => {
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) => {
15489
15659
  const cli = thisCmd.opts();
15490
15660
  configureRepoEnv(cli);
15491
15661
  const dir = resolveWorkspaceDir(cli.dir);
15492
- const repoDir = path19.resolve(dir, repo);
15662
+ const repoDir = path20.resolve(dir, repo);
15493
15663
  const passthrough = thisCmd.args.slice(1).join(" ");
15494
- const cmd = passthrough ? `yarn ${script} ${passthrough}` : `yarn ${script}`;
15664
+ const pm = detectPackageManager(repoDir);
15665
+ const cmd = runScriptCommand(pm, passthrough ? `${script} ${passthrough}` : script);
15495
15666
  await execForeground(cmd, { cwd: repoDir, verbose: cli.verbose });
15496
15667
  });
15497
15668
  }
15498
15669
 
15499
15670
  // src/commands/repo/server-node.ts
15500
- var fs19 = __toESM(require("fs"));
15501
- var path20 = __toESM(require("path"));
15671
+ var fs21 = __toESM(require("fs"));
15672
+ var path21 = __toESM(require("path"));
15502
15673
  var BROWSER_BUNDLE_PATH = "examples/workflow-server-bundled-web/wf-glsp-server-webworker.js";
15503
15674
  var NODE_BUNDLE_PATH = "examples/workflow-server-bundled/wf-glsp-server-node.js";
15504
15675
  function resolveBundlePath(repoDir, relativePath, label) {
15505
- const bundlePath = path20.resolve(repoDir, relativePath);
15506
- if (!fs19.existsSync(bundlePath)) {
15676
+ const bundlePath = path21.resolve(repoDir, relativePath);
15677
+ if (!fs21.existsSync(bundlePath)) {
15507
15678
  throw new Error(`${label} not found at ${bundlePath}. Run 'glsp repo server-node build' first.`);
15508
15679
  }
15509
15680
  return bundlePath;
@@ -15524,19 +15695,25 @@ var NodeBundleCommand = baseCommand().name("node-bundle").description("Print the
15524
15695
  });
15525
15696
 
15526
15697
  // src/commands/repo/start.ts
15527
- var path21 = __toESM(require("path"));
15698
+ var path22 = __toESM(require("path"));
15528
15699
  var JAR_TARGET_DIR = "examples/org.eclipse.glsp.example.workflow/target";
15529
15700
  var JAR_PATTERN = "*-glsp.jar";
15530
15701
  function discoverJar(repoDir) {
15531
- const targetDir = path21.resolve(repoDir, JAR_TARGET_DIR);
15702
+ const targetDir = path22.resolve(repoDir, JAR_TARGET_DIR);
15532
15703
  return discoverNewestFile(JAR_PATTERN, targetDir, `No *-glsp.jar found in ${targetDir}. Run \`glsp repo server build\` first.`);
15533
15704
  }
15534
15705
  function collectPassthroughArgs(cmd) {
15535
15706
  const raw = cmd.args;
15536
15707
  return raw.length > 0 ? ` ${raw.join(" ")}` : "";
15537
15708
  }
15538
- function resolveCommand(cmd, cwd, dryRun) {
15539
- const resolved = `${cmd.startsWith("yarn") ? `yarn --cwd ${cwd} ${cmd.slice("yarn ".length)}` : cmd}`;
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);
15540
15717
  if (dryRun) {
15541
15718
  process.stdout.write(resolved + "\n");
15542
15719
  return void 0;
@@ -15547,11 +15724,11 @@ var TheiaStartCommand = baseCommand().name("start").allowUnknownOption(true).all
15547
15724
  const cli = thisCmd.opts();
15548
15725
  configureRepoEnv(cli);
15549
15726
  const dir = resolveWorkspaceDir(cli.dir);
15550
- const repoDir = path21.resolve(dir, "glsp-theia-integration");
15727
+ const repoDir = path22.resolve(dir, "glsp-theia-integration");
15551
15728
  const target = cli.electron ? "electron" : "browser";
15552
15729
  const script = cli.debug ? "start:debug" : "start";
15553
15730
  const passthrough = collectPassthroughArgs(thisCmd);
15554
- const resolved = resolveCommand(`yarn ${target} ${script}${passthrough}`, repoDir, cli.dryRun);
15731
+ const resolved = resolveCommand(`${target} ${script}${passthrough}`, repoDir, cli.dryRun);
15555
15732
  if (resolved) {
15556
15733
  await execForeground(resolved, { verbose: cli.verbose });
15557
15734
  }
@@ -15560,10 +15737,10 @@ var ClientStartCommand = baseCommand().name("start").allowUnknownOption(true).al
15560
15737
  const cli = thisCmd.opts();
15561
15738
  configureRepoEnv(cli);
15562
15739
  const dir = resolveWorkspaceDir(cli.dir);
15563
- const repoDir = path21.resolve(dir, "glsp-client");
15740
+ const repoDir = path22.resolve(dir, "glsp-client");
15564
15741
  const script = cli.browser ? "start:browser" : "start";
15565
15742
  const passthrough = collectPassthroughArgs(thisCmd);
15566
- const resolved = resolveCommand(`yarn ${script}${passthrough}`, repoDir, cli.dryRun);
15743
+ const resolved = resolveCommand(`${script}${passthrough}`, repoDir, cli.dryRun);
15567
15744
  if (resolved) {
15568
15745
  await execForeground(resolved, { verbose: cli.verbose });
15569
15746
  }
@@ -15572,7 +15749,7 @@ var ServerStartCommand = baseCommand().name("start").allowUnknownOption(true).al
15572
15749
  const cli = thisCmd.opts();
15573
15750
  configureRepoEnv(cli);
15574
15751
  const dir = resolveWorkspaceDir(cli.dir);
15575
- const repoDir = path21.resolve(dir, "glsp-server");
15752
+ const repoDir = path22.resolve(dir, "glsp-server");
15576
15753
  const jarPath = discoverJar(repoDir);
15577
15754
  if (!cli.dryRun) {
15578
15755
  LOGGER.info(`Found JAR: ${jarPath}`);
@@ -15592,20 +15769,20 @@ var ServerNodeStartCommand = baseCommand().name("start").allowUnknownOption(true
15592
15769
  const cli = thisCmd.opts();
15593
15770
  configureRepoEnv(cli);
15594
15771
  const dir = resolveWorkspaceDir(cli.dir);
15595
- const repoDir = path21.resolve(dir, "glsp-server-node");
15596
- const yarnCmd = cli.socket ? "yarn start" : "yarn start:websocket";
15772
+ const repoDir = path22.resolve(dir, "glsp-server-node");
15773
+ const script = cli.socket ? "start" : "start:websocket";
15597
15774
  const portArg = cli.port ? ` --port ${cli.port}` : "";
15598
15775
  const passthrough = collectPassthroughArgs(thisCmd);
15599
- const resolved = resolveCommand(`${yarnCmd}${portArg}${passthrough}`, repoDir, cli.dryRun);
15776
+ const resolved = resolveCommand(`${script}${portArg}${passthrough}`, repoDir, cli.dryRun);
15600
15777
  if (resolved) {
15601
15778
  await execForeground(resolved, { verbose: cli.verbose });
15602
15779
  }
15603
15780
  });
15604
15781
 
15605
15782
  // src/commands/repo/switch.ts
15606
- var path22 = __toESM(require("path"));
15783
+ var path23 = __toESM(require("path"));
15607
15784
  function validateReposClean(repos, dir) {
15608
- const dirty = repos.filter((repo) => hasChanges(path22.resolve(dir, repo)));
15785
+ const dirty = repos.filter((repo) => hasChanges(path23.resolve(dir, repo)));
15609
15786
  if (dirty.length > 0) {
15610
15787
  throw new Error(
15611
15788
  `The following repositories have uncommitted changes: ${dirty.join(", ")}. Commit or stash your changes first, or use --force.`
@@ -15613,7 +15790,7 @@ function validateReposClean(repos, dir) {
15613
15790
  }
15614
15791
  }
15615
15792
  function switchSingleRepo(repo, options) {
15616
- const repoDir = path22.resolve(options.dir, repo);
15793
+ const repoDir = path23.resolve(options.dir, repo);
15617
15794
  if (options.pr) {
15618
15795
  LOGGER.info(`Checking out PR #${options.pr} in ${repo}`);
15619
15796
  exec(`gh pr checkout ${options.pr} -R ${GLSP_GITHUB_ORG}/${repo}`, { cwd: repoDir });
@@ -15667,28 +15844,36 @@ function createScopedSwitchCommand(repo) {
15667
15844
  }
15668
15845
 
15669
15846
  // src/commands/repo/vscode.ts
15670
- var path23 = __toESM(require("path"));
15847
+ var path24 = __toESM(require("path"));
15671
15848
  var VSIX_ID = "eclipse-glsp.workflow-vscode-example";
15672
15849
  var WEB_VSIX_ID = "eclipse-glsp.workflow-vscode-example-web";
15673
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) => {
15674
15851
  const cli = thisCmd.opts();
15675
15852
  configureRepoEnv(cli);
15676
15853
  const dir = resolveWorkspaceDir(cli.dir);
15677
- const repoDir = path23.resolve(dir, "glsp-vscode-integration");
15678
- await execAsync("yarn workflow package", { cwd: repoDir, silent: false, env: { FORCE_COLOR: "1" } });
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
+ });
15679
15860
  });
15680
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) => {
15681
15862
  const cli = thisCmd.opts();
15682
15863
  configureRepoEnv(cli);
15683
15864
  const dir = resolveWorkspaceDir(cli.dir);
15684
- const repoDir = path23.resolve(dir, "glsp-vscode-integration");
15685
- await execAsync("yarn workflow:web package", { cwd: repoDir, silent: false, env: { FORCE_COLOR: "1" } });
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
+ });
15686
15871
  });
15687
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) => {
15688
15873
  const cli = thisCmd.opts();
15689
15874
  configureRepoEnv(cli);
15690
15875
  const dir = resolveWorkspaceDir(cli.dir);
15691
- const repoDir = path23.resolve(dir, "glsp-vscode-integration");
15876
+ const repoDir = path24.resolve(dir, "glsp-vscode-integration");
15692
15877
  const vsixPath = discoverVsix(repoDir);
15693
15878
  process.stdout.write(vsixPath);
15694
15879
  });
@@ -15696,7 +15881,7 @@ var WebVsixPathCommand = baseCommand().name("web-vsix-path").description("Print
15696
15881
  const cli = thisCmd.opts();
15697
15882
  configureRepoEnv(cli);
15698
15883
  const dir = resolveWorkspaceDir(cli.dir);
15699
- const repoDir = path23.resolve(dir, "glsp-vscode-integration");
15884
+ const repoDir = path24.resolve(dir, "glsp-vscode-integration");
15700
15885
  const vsixPath = discoverWebVsix(repoDir);
15701
15886
  process.stdout.write(vsixPath);
15702
15887
  });
@@ -15707,11 +15892,11 @@ var WebVsixIdCommand = baseCommand().name("web-vsix-id").description("Print the
15707
15892
  process.stdout.write(WEB_VSIX_ID);
15708
15893
  });
15709
15894
  function discoverVsix(repoDir) {
15710
- const vsixDir = path23.resolve(repoDir, VSIX_TARGET_DIR);
15895
+ const vsixDir = path24.resolve(repoDir, VSIX_TARGET_DIR);
15711
15896
  return discoverNewestFile("*.vsix", vsixDir, `No .vsix file found in ${vsixDir}. Run 'glsp repo vscode package' first.`);
15712
15897
  }
15713
15898
  function discoverWebVsix(repoDir) {
15714
- const vsixDir = path23.resolve(repoDir, WEB_VSIX_TARGET_DIR);
15899
+ const vsixDir = path24.resolve(repoDir, WEB_VSIX_TARGET_DIR);
15715
15900
  return discoverNewestFile("*.vsix", vsixDir, `No .vsix file found in ${vsixDir}. Run 'glsp repo vscode web-package' first.`);
15716
15901
  }
15717
15902
 
@@ -15775,14 +15960,14 @@ function createSubrepoCommand(repo) {
15775
15960
  }
15776
15961
 
15777
15962
  // src/commands/repo/workspace.ts
15778
- var fs20 = __toESM(require("fs"));
15779
- var path24 = __toESM(require("path"));
15963
+ var fs22 = __toESM(require("fs"));
15964
+ var path25 = __toESM(require("path"));
15780
15965
  var WORKSPACE_FILE_NAME = "glsp.code-workspace";
15781
15966
  function generateWorkspaceContent(repos, dir, options) {
15782
- const outputDir = options.outputPath ? path24.dirname(path24.resolve(options.outputPath)) : dir;
15967
+ const outputDir = options.outputPath ? path25.dirname(path25.resolve(options.outputPath)) : dir;
15783
15968
  const folders = repos.map((repo) => {
15784
- const repoDir = path24.resolve(dir, repo);
15785
- const relativePath = path24.relative(outputDir, repoDir);
15969
+ const repoDir = path25.resolve(dir, repo);
15970
+ const relativePath = path25.relative(outputDir, repoDir);
15786
15971
  return { name: repo, path: relativePath };
15787
15972
  });
15788
15973
  const hasJavaRepos = repos.some((r) => !GLSPRepo.isNpmRepo(r));
@@ -15847,24 +16032,24 @@ function generateWorkspaceContent(repos, dir, options) {
15847
16032
  }
15848
16033
  function generateWorkspaceFile(repos, dir, options) {
15849
16034
  const workspace = generateWorkspaceContent(repos, dir, options);
15850
- const outputFile = options.outputPath ? path24.resolve(options.outputPath) : path24.join(dir, WORKSPACE_FILE_NAME);
15851
- fs20.mkdirSync(path24.dirname(outputFile), { recursive: true });
15852
- fs20.writeFileSync(outputFile, JSON.stringify(workspace, void 0, 4) + "\n", "utf-8");
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");
15853
16038
  LOGGER.info(`Workspace file written to ${outputFile}`);
15854
16039
  return outputFile;
15855
16040
  }
15856
16041
  function discoverWorkspaceFile(dir) {
15857
- if (!fs20.existsSync(dir)) {
16042
+ if (!fs22.existsSync(dir)) {
15858
16043
  return void 0;
15859
16044
  }
15860
- const files = fs20.readdirSync(dir).filter((f) => f.endsWith(".code-workspace"));
16045
+ const files = fs22.readdirSync(dir).filter((f) => f.endsWith(".code-workspace"));
15861
16046
  if (files.length === 1) {
15862
- return path24.join(dir, files[0]);
16047
+ return path25.join(dir, files[0]);
15863
16048
  }
15864
16049
  if (files.length > 1) {
15865
16050
  const defaultFile = files.find((f) => f === WORKSPACE_FILE_NAME);
15866
16051
  if (defaultFile) {
15867
- return path24.join(dir, defaultFile);
16052
+ return path25.join(dir, defaultFile);
15868
16053
  }
15869
16054
  }
15870
16055
  return void 0;
@@ -15914,19 +16099,32 @@ for (const repo of GLSPRepo.choices) {
15914
16099
  }
15915
16100
 
15916
16101
  // src/commands/update-next.ts
15917
- var path25 = __toESM(require("path"));
16102
+ var path26 = __toESM(require("path"));
15918
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);
15919
16104
  async function updateNext(rootDir, options) {
15920
16105
  configureLogger(options.verbose);
15921
- const rootPkgPath = path25.join(rootDir, "package.json");
16106
+ const rootPkgPath = path26.join(rootDir, "package.json");
15922
16107
  if (getUncommittedChanges(rootDir).includes(rootPkgPath)) {
15923
16108
  LOGGER.warn("Uncommitted changes in root `package.json`. Please commit or stash them before running this command.");
15924
16109
  return;
15925
16110
  }
15926
16111
  configureExec({ silent: false, fatal: true });
15927
16112
  LOGGER.info("Updating next dependencies ...");
15928
- rootDir = path25.resolve(rootDir);
15929
- const packages = getYarnWorkspacePackages(rootDir, true);
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
+ }
15930
16128
  LOGGER.debug(`Scanning ${packages.length} packages to derive resolutions`, packages);
15931
16129
  const resolutions = await getResolutions(packages);
15932
16130
  if (Object.keys(resolutions).length === 0) {
@@ -15946,19 +16144,22 @@ async function updateNext(rootDir, options) {
15946
16144
  await execAsync("yarn", { silent: false, cwd: rootDir });
15947
16145
  LOGGER.info("Upgrade successfully completed");
15948
16146
  }
15949
- async function getResolutions(packages) {
15950
- let dependencies = [];
16147
+ function getNextDependencies(packages) {
16148
+ const dependencies = [];
15951
16149
  for (const pkg of packages) {
15952
16150
  const allDeps = {
15953
16151
  ...pkg.content.dependencies || {},
15954
16152
  ...pkg.content.devDependencies || {},
15955
16153
  ...pkg.content.peerDependencies || {}
15956
16154
  };
15957
- const nextDeps = Object.keys(allDeps).filter((dep) => allDeps[dep] === "next");
15958
- dependencies.push(...nextDeps);
16155
+ dependencies.push(...Object.keys(allDeps).filter((dep) => allDeps[dep] === "next"));
15959
16156
  }
15960
- dependencies = [...new Set(dependencies)];
15961
- LOGGER.debug(`Found ${dependencies.length} 'next' dependencies`, dependencies);
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);
15962
16163
  LOGGER.info("Retrieve next versions ... ");
15963
16164
  const resolutions = {};
15964
16165
  dependencies.forEach((dep) => {