@formatjs/cli 6.13.1 → 6.13.3

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.
Files changed (2) hide show
  1. package/bin/formatjs +283 -128
  2. package/package.json +2 -2
package/bin/formatjs CHANGED
@@ -32,9 +32,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
32
  mod
33
33
  ));
34
34
 
35
- // node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/error.js
35
+ // node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/error.js
36
36
  var require_error = __commonJS({
37
- "node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/error.js"(exports) {
37
+ "node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/error.js"(exports) {
38
38
  var CommanderError2 = class extends Error {
39
39
  /**
40
40
  * Constructs the CommanderError class
@@ -67,9 +67,9 @@ var require_error = __commonJS({
67
67
  }
68
68
  });
69
69
 
70
- // node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/argument.js
70
+ // node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/argument.js
71
71
  var require_argument = __commonJS({
72
- "node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/argument.js"(exports) {
72
+ "node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/argument.js"(exports) {
73
73
  var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
74
74
  var Argument2 = class {
75
75
  /**
@@ -195,9 +195,9 @@ var require_argument = __commonJS({
195
195
  }
196
196
  });
197
197
 
198
- // node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/help.js
198
+ // node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/help.js
199
199
  var require_help = __commonJS({
200
- "node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/help.js"(exports) {
200
+ "node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/help.js"(exports) {
201
201
  var { humanReadableArgName } = require_argument();
202
202
  var Help2 = class {
203
203
  constructor() {
@@ -805,9 +805,9 @@ ${itemIndentStr}`);
805
805
  }
806
806
  });
807
807
 
808
- // node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/option.js
808
+ // node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/option.js
809
809
  var require_option = __commonJS({
810
- "node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/option.js"(exports) {
810
+ "node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/option.js"(exports) {
811
811
  var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
812
812
  var Option2 = class {
813
813
  /**
@@ -1121,9 +1121,9 @@ var require_option = __commonJS({
1121
1121
  }
1122
1122
  });
1123
1123
 
1124
- // node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/suggestSimilar.js
1124
+ // node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js
1125
1125
  var require_suggestSimilar = __commonJS({
1126
- "node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/suggestSimilar.js"(exports) {
1126
+ "node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js"(exports) {
1127
1127
  var maxDistance = 3;
1128
1128
  function editDistance(a, b) {
1129
1129
  if (Math.abs(a.length - b.length) > maxDistance)
@@ -1203,9 +1203,9 @@ var require_suggestSimilar = __commonJS({
1203
1203
  }
1204
1204
  });
1205
1205
 
1206
- // node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/command.js
1206
+ // node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/command.js
1207
1207
  var require_command = __commonJS({
1208
- "node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/lib/command.js"(exports) {
1208
+ "node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/lib/command.js"(exports) {
1209
1209
  var EventEmitter = require("node:events").EventEmitter;
1210
1210
  var childProcess = require("node:child_process");
1211
1211
  var path2 = require("node:path");
@@ -3497,9 +3497,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
3497
3497
  }
3498
3498
  });
3499
3499
 
3500
- // node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/index.js
3500
+ // node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/index.js
3501
3501
  var require_commander = __commonJS({
3502
- "node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/index.js"(exports) {
3502
+ "node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/index.js"(exports) {
3503
3503
  var { Argument: Argument2 } = require_argument();
3504
3504
  var { Command: Command2 } = require_command();
3505
3505
  var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError2 } = require_error();
@@ -4654,7 +4654,7 @@ var require_parse = __commonJS({
4654
4654
  CHAR_NO_BREAK_SPACE,
4655
4655
  CHAR_ZERO_WIDTH_NOBREAK_SPACE
4656
4656
  } = require_constants();
4657
- var parse4 = (input, options = {}) => {
4657
+ var parse5 = (input, options = {}) => {
4658
4658
  if (typeof input !== "string") {
4659
4659
  throw new TypeError("Expected a string");
4660
4660
  }
@@ -4858,7 +4858,7 @@ var require_parse = __commonJS({
4858
4858
  push({ type: "eos" });
4859
4859
  return ast;
4860
4860
  };
4861
- module2.exports = parse4;
4861
+ module2.exports = parse5;
4862
4862
  }
4863
4863
  });
4864
4864
 
@@ -4869,7 +4869,7 @@ var require_braces = __commonJS({
4869
4869
  var stringify4 = require_stringify();
4870
4870
  var compile8 = require_compile();
4871
4871
  var expand = require_expand();
4872
- var parse4 = require_parse();
4872
+ var parse5 = require_parse();
4873
4873
  var braces = (input, options = {}) => {
4874
4874
  let output = [];
4875
4875
  if (Array.isArray(input)) {
@@ -4889,7 +4889,7 @@ var require_braces = __commonJS({
4889
4889
  }
4890
4890
  return output;
4891
4891
  };
4892
- braces.parse = (input, options = {}) => parse4(input, options);
4892
+ braces.parse = (input, options = {}) => parse5(input, options);
4893
4893
  braces.stringify = (input, options = {}) => {
4894
4894
  if (typeof input === "string") {
4895
4895
  return stringify4(braces.parse(input, options), options);
@@ -5547,7 +5547,7 @@ var require_parse2 = __commonJS({
5547
5547
  var syntaxError = (type, char) => {
5548
5548
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
5549
5549
  };
5550
- var parse4 = (input, options) => {
5550
+ var parse5 = (input, options) => {
5551
5551
  if (typeof input !== "string") {
5552
5552
  throw new TypeError("Expected a string");
5553
5553
  }
@@ -5697,7 +5697,7 @@ var require_parse2 = __commonJS({
5697
5697
  output = token.close = `)$))${extglobStar}`;
5698
5698
  }
5699
5699
  if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
5700
- const expression = parse4(rest, { ...options, fastpaths: false }).output;
5700
+ const expression = parse5(rest, { ...options, fastpaths: false }).output;
5701
5701
  output = token.close = `)${expression})${extglobStar})`;
5702
5702
  }
5703
5703
  if (token.prev.type === "bos") {
@@ -6226,7 +6226,7 @@ var require_parse2 = __commonJS({
6226
6226
  }
6227
6227
  return state;
6228
6228
  };
6229
- parse4.fastpaths = (input, options) => {
6229
+ parse5.fastpaths = (input, options) => {
6230
6230
  const opts = { ...options };
6231
6231
  const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
6232
6232
  const len = input.length;
@@ -6295,7 +6295,7 @@ var require_parse2 = __commonJS({
6295
6295
  }
6296
6296
  return source;
6297
6297
  };
6298
- module2.exports = parse4;
6298
+ module2.exports = parse5;
6299
6299
  }
6300
6300
  });
6301
6301
 
@@ -6305,7 +6305,7 @@ var require_picomatch = __commonJS({
6305
6305
  "use strict";
6306
6306
  var path2 = require("path");
6307
6307
  var scan = require_scan();
6308
- var parse4 = require_parse2();
6308
+ var parse5 = require_parse2();
6309
6309
  var utils = require_utils2();
6310
6310
  var constants = require_constants2();
6311
6311
  var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
@@ -6395,7 +6395,7 @@ var require_picomatch = __commonJS({
6395
6395
  picomatch.parse = (pattern, options) => {
6396
6396
  if (Array.isArray(pattern))
6397
6397
  return pattern.map((p2) => picomatch.parse(p2, options));
6398
- return parse4(pattern, { ...options, fastpaths: false });
6398
+ return parse5(pattern, { ...options, fastpaths: false });
6399
6399
  };
6400
6400
  picomatch.scan = (input, options) => scan(input, options);
6401
6401
  picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
@@ -6421,10 +6421,10 @@ var require_picomatch = __commonJS({
6421
6421
  }
6422
6422
  let parsed = { negated: false, fastpaths: true };
6423
6423
  if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
6424
- parsed.output = parse4.fastpaths(input, options);
6424
+ parsed.output = parse5.fastpaths(input, options);
6425
6425
  }
6426
6426
  if (!parsed.output) {
6427
- parsed = parse4(input, options);
6427
+ parsed = parse5(input, options);
6428
6428
  }
6429
6429
  return picomatch.compileRe(parsed, options, returnOutput, returnState);
6430
6430
  };
@@ -12719,8 +12719,8 @@ var require_graceful_fs = __commonJS({
12719
12719
  fs2.createReadStream = createReadStream;
12720
12720
  fs2.createWriteStream = createWriteStream;
12721
12721
  var fs$readFile = fs2.readFile;
12722
- fs2.readFile = readFile2;
12723
- function readFile2(path2, options, cb) {
12722
+ fs2.readFile = readFile3;
12723
+ function readFile3(path2, options, cb) {
12724
12724
  if (typeof options === "function")
12725
12725
  cb = options, options = null;
12726
12726
  return go$readFile(path2, options, cb);
@@ -13004,9 +13004,9 @@ var require_graceful_fs = __commonJS({
13004
13004
  }
13005
13005
  });
13006
13006
 
13007
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/fs/index.js
13007
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/fs/index.js
13008
13008
  var require_fs5 = __commonJS({
13009
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/fs/index.js"(exports) {
13009
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/fs/index.js"(exports) {
13010
13010
  "use strict";
13011
13011
  var u = require_universalify().fromCallback;
13012
13012
  var fs = require_graceful_fs();
@@ -13124,9 +13124,9 @@ var require_fs5 = __commonJS({
13124
13124
  }
13125
13125
  });
13126
13126
 
13127
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/mkdirs/utils.js
13127
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/utils.js
13128
13128
  var require_utils5 = __commonJS({
13129
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module2) {
13129
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module2) {
13130
13130
  "use strict";
13131
13131
  var path2 = require("path");
13132
13132
  module2.exports.checkPath = function checkPath(pth) {
@@ -13142,9 +13142,9 @@ var require_utils5 = __commonJS({
13142
13142
  }
13143
13143
  });
13144
13144
 
13145
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/mkdirs/make-dir.js
13145
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/make-dir.js
13146
13146
  var require_make_dir = __commonJS({
13147
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module2) {
13147
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module2) {
13148
13148
  "use strict";
13149
13149
  var fs = require_fs5();
13150
13150
  var { checkPath } = require_utils5();
@@ -13171,9 +13171,9 @@ var require_make_dir = __commonJS({
13171
13171
  }
13172
13172
  });
13173
13173
 
13174
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/mkdirs/index.js
13174
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/index.js
13175
13175
  var require_mkdirs = __commonJS({
13176
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module2) {
13176
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module2) {
13177
13177
  "use strict";
13178
13178
  var u = require_universalify().fromPromise;
13179
13179
  var { makeDir: _makeDir, makeDirSync } = require_make_dir();
@@ -13190,9 +13190,9 @@ var require_mkdirs = __commonJS({
13190
13190
  }
13191
13191
  });
13192
13192
 
13193
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/path-exists/index.js
13193
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/path-exists/index.js
13194
13194
  var require_path_exists = __commonJS({
13195
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
13195
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
13196
13196
  "use strict";
13197
13197
  var u = require_universalify().fromPromise;
13198
13198
  var fs = require_fs5();
@@ -13206,9 +13206,9 @@ var require_path_exists = __commonJS({
13206
13206
  }
13207
13207
  });
13208
13208
 
13209
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/util/utimes.js
13209
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/util/utimes.js
13210
13210
  var require_utimes = __commonJS({
13211
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/util/utimes.js"(exports, module2) {
13211
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/util/utimes.js"(exports, module2) {
13212
13212
  "use strict";
13213
13213
  var fs = require_fs5();
13214
13214
  var u = require_universalify().fromPromise;
@@ -13240,9 +13240,9 @@ var require_utimes = __commonJS({
13240
13240
  }
13241
13241
  });
13242
13242
 
13243
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/util/stat.js
13243
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/util/stat.js
13244
13244
  var require_stat = __commonJS({
13245
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/util/stat.js"(exports, module2) {
13245
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/util/stat.js"(exports, module2) {
13246
13246
  "use strict";
13247
13247
  var fs = require_fs5();
13248
13248
  var path2 = require("path");
@@ -13378,9 +13378,9 @@ var require_stat = __commonJS({
13378
13378
  }
13379
13379
  });
13380
13380
 
13381
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/util/async.js
13381
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/util/async.js
13382
13382
  var require_async7 = __commonJS({
13383
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/util/async.js"(exports, module2) {
13383
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/util/async.js"(exports, module2) {
13384
13384
  "use strict";
13385
13385
  async function asyncIteratorConcurrentProcess(iterator, fn) {
13386
13386
  const promises = [];
@@ -13407,9 +13407,9 @@ var require_async7 = __commonJS({
13407
13407
  }
13408
13408
  });
13409
13409
 
13410
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/copy/copy.js
13410
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/copy.js
13411
13411
  var require_copy = __commonJS({
13412
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
13412
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
13413
13413
  "use strict";
13414
13414
  var fs = require_fs5();
13415
13415
  var path2 = require("path");
@@ -13542,9 +13542,9 @@ var require_copy = __commonJS({
13542
13542
  }
13543
13543
  });
13544
13544
 
13545
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/copy/copy-sync.js
13545
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/copy-sync.js
13546
13546
  var require_copy_sync = __commonJS({
13547
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) {
13547
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) {
13548
13548
  "use strict";
13549
13549
  var fs = require_graceful_fs();
13550
13550
  var path2 = require("path");
@@ -13693,9 +13693,9 @@ var require_copy_sync = __commonJS({
13693
13693
  }
13694
13694
  });
13695
13695
 
13696
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/copy/index.js
13696
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/index.js
13697
13697
  var require_copy2 = __commonJS({
13698
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/copy/index.js"(exports, module2) {
13698
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/index.js"(exports, module2) {
13699
13699
  "use strict";
13700
13700
  var u = require_universalify().fromPromise;
13701
13701
  module2.exports = {
@@ -13705,9 +13705,9 @@ var require_copy2 = __commonJS({
13705
13705
  }
13706
13706
  });
13707
13707
 
13708
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/remove/index.js
13708
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/remove/index.js
13709
13709
  var require_remove = __commonJS({
13710
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/remove/index.js"(exports, module2) {
13710
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/remove/index.js"(exports, module2) {
13711
13711
  "use strict";
13712
13712
  var fs = require_graceful_fs();
13713
13713
  var u = require_universalify().fromCallback;
@@ -13724,9 +13724,9 @@ var require_remove = __commonJS({
13724
13724
  }
13725
13725
  });
13726
13726
 
13727
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/empty/index.js
13727
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/empty/index.js
13728
13728
  var require_empty = __commonJS({
13729
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/empty/index.js"(exports, module2) {
13729
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/empty/index.js"(exports, module2) {
13730
13730
  "use strict";
13731
13731
  var u = require_universalify().fromPromise;
13732
13732
  var fs = require_fs5();
@@ -13763,9 +13763,9 @@ var require_empty = __commonJS({
13763
13763
  }
13764
13764
  });
13765
13765
 
13766
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/file.js
13766
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/file.js
13767
13767
  var require_file = __commonJS({
13768
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/file.js"(exports, module2) {
13768
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/file.js"(exports, module2) {
13769
13769
  "use strict";
13770
13770
  var u = require_universalify().fromPromise;
13771
13771
  var path2 = require("path");
@@ -13826,9 +13826,9 @@ var require_file = __commonJS({
13826
13826
  }
13827
13827
  });
13828
13828
 
13829
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/link.js
13829
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/link.js
13830
13830
  var require_link = __commonJS({
13831
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/link.js"(exports, module2) {
13831
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/link.js"(exports, module2) {
13832
13832
  "use strict";
13833
13833
  var u = require_universalify().fromPromise;
13834
13834
  var path2 = require("path");
@@ -13886,9 +13886,9 @@ var require_link = __commonJS({
13886
13886
  }
13887
13887
  });
13888
13888
 
13889
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink-paths.js
13889
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink-paths.js
13890
13890
  var require_symlink_paths = __commonJS({
13891
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) {
13891
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) {
13892
13892
  "use strict";
13893
13893
  var path2 = require("path");
13894
13894
  var fs = require_fs5();
@@ -13961,9 +13961,9 @@ var require_symlink_paths = __commonJS({
13961
13961
  }
13962
13962
  });
13963
13963
 
13964
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink-type.js
13964
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink-type.js
13965
13965
  var require_symlink_type = __commonJS({
13966
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module2) {
13966
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module2) {
13967
13967
  "use strict";
13968
13968
  var fs = require_fs5();
13969
13969
  var u = require_universalify().fromPromise;
@@ -13996,9 +13996,9 @@ var require_symlink_type = __commonJS({
13996
13996
  }
13997
13997
  });
13998
13998
 
13999
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink.js
13999
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink.js
14000
14000
  var require_symlink = __commonJS({
14001
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module2) {
14001
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module2) {
14002
14002
  "use strict";
14003
14003
  var u = require_universalify().fromPromise;
14004
14004
  var path2 = require("path");
@@ -14015,10 +14015,19 @@ var require_symlink = __commonJS({
14015
14015
  } catch {
14016
14016
  }
14017
14017
  if (stats && stats.isSymbolicLink()) {
14018
- const [srcStat, dstStat] = await Promise.all([
14019
- fs.stat(srcpath),
14020
- fs.stat(dstpath)
14021
- ]);
14018
+ let srcStat;
14019
+ if (path2.isAbsolute(srcpath)) {
14020
+ srcStat = await fs.stat(srcpath);
14021
+ } else {
14022
+ const dstdir = path2.dirname(dstpath);
14023
+ const relativeToDst = path2.join(dstdir, srcpath);
14024
+ try {
14025
+ srcStat = await fs.stat(relativeToDst);
14026
+ } catch {
14027
+ srcStat = await fs.stat(srcpath);
14028
+ }
14029
+ }
14030
+ const dstStat = await fs.stat(dstpath);
14022
14031
  if (areIdentical(srcStat, dstStat))
14023
14032
  return;
14024
14033
  }
@@ -14038,7 +14047,18 @@ var require_symlink = __commonJS({
14038
14047
  } catch {
14039
14048
  }
14040
14049
  if (stats && stats.isSymbolicLink()) {
14041
- const srcStat = fs.statSync(srcpath);
14050
+ let srcStat;
14051
+ if (path2.isAbsolute(srcpath)) {
14052
+ srcStat = fs.statSync(srcpath);
14053
+ } else {
14054
+ const dstdir = path2.dirname(dstpath);
14055
+ const relativeToDst = path2.join(dstdir, srcpath);
14056
+ try {
14057
+ srcStat = fs.statSync(relativeToDst);
14058
+ } catch {
14059
+ srcStat = fs.statSync(srcpath);
14060
+ }
14061
+ }
14042
14062
  const dstStat = fs.statSync(dstpath);
14043
14063
  if (areIdentical(srcStat, dstStat))
14044
14064
  return;
@@ -14060,9 +14080,9 @@ var require_symlink = __commonJS({
14060
14080
  }
14061
14081
  });
14062
14082
 
14063
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/index.js
14083
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/index.js
14064
14084
  var require_ensure = __commonJS({
14065
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/index.js"(exports, module2) {
14085
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/index.js"(exports, module2) {
14066
14086
  "use strict";
14067
14087
  var { createFile: createFile2, createFileSync: createFileSync2 } = require_file();
14068
14088
  var { createLink: createLink2, createLinkSync: createLinkSync2 } = require_link();
@@ -14136,7 +14156,7 @@ var require_jsonfile = __commonJS({
14136
14156
  }
14137
14157
  return obj;
14138
14158
  }
14139
- var readFile2 = universalify.fromPromise(_readFile);
14159
+ var readFile3 = universalify.fromPromise(_readFile);
14140
14160
  function readFileSync2(file, options = {}) {
14141
14161
  if (typeof options === "string") {
14142
14162
  options = { encoding: options };
@@ -14168,7 +14188,7 @@ var require_jsonfile = __commonJS({
14168
14188
  return fs.writeFileSync(file, str, options);
14169
14189
  }
14170
14190
  module2.exports = {
14171
- readFile: readFile2,
14191
+ readFile: readFile3,
14172
14192
  readFileSync: readFileSync2,
14173
14193
  writeFile,
14174
14194
  writeFileSync
@@ -14176,9 +14196,9 @@ var require_jsonfile = __commonJS({
14176
14196
  }
14177
14197
  });
14178
14198
 
14179
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/json/jsonfile.js
14199
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/json/jsonfile.js
14180
14200
  var require_jsonfile2 = __commonJS({
14181
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module2) {
14201
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module2) {
14182
14202
  "use strict";
14183
14203
  var jsonFile = require_jsonfile();
14184
14204
  module2.exports = {
@@ -14191,9 +14211,9 @@ var require_jsonfile2 = __commonJS({
14191
14211
  }
14192
14212
  });
14193
14213
 
14194
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/output-file/index.js
14214
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/output-file/index.js
14195
14215
  var require_output_file = __commonJS({
14196
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/output-file/index.js"(exports, module2) {
14216
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/output-file/index.js"(exports, module2) {
14197
14217
  "use strict";
14198
14218
  var u = require_universalify().fromPromise;
14199
14219
  var fs = require_fs5();
@@ -14221,9 +14241,9 @@ var require_output_file = __commonJS({
14221
14241
  }
14222
14242
  });
14223
14243
 
14224
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/json/output-json.js
14244
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/json/output-json.js
14225
14245
  var require_output_json = __commonJS({
14226
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/json/output-json.js"(exports, module2) {
14246
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/json/output-json.js"(exports, module2) {
14227
14247
  "use strict";
14228
14248
  var { stringify: stringify4 } = require_utils6();
14229
14249
  var { outputFile: outputFile2 } = require_output_file();
@@ -14235,9 +14255,9 @@ var require_output_json = __commonJS({
14235
14255
  }
14236
14256
  });
14237
14257
 
14238
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/json/output-json-sync.js
14258
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/json/output-json-sync.js
14239
14259
  var require_output_json_sync = __commonJS({
14240
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module2) {
14260
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module2) {
14241
14261
  "use strict";
14242
14262
  var { stringify: stringify4 } = require_utils6();
14243
14263
  var { outputFileSync: outputFileSync2 } = require_output_file();
@@ -14249,9 +14269,9 @@ var require_output_json_sync = __commonJS({
14249
14269
  }
14250
14270
  });
14251
14271
 
14252
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/json/index.js
14272
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/json/index.js
14253
14273
  var require_json = __commonJS({
14254
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/json/index.js"(exports, module2) {
14274
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/json/index.js"(exports, module2) {
14255
14275
  "use strict";
14256
14276
  var u = require_universalify().fromPromise;
14257
14277
  var jsonFile = require_jsonfile2();
@@ -14267,9 +14287,9 @@ var require_json = __commonJS({
14267
14287
  }
14268
14288
  });
14269
14289
 
14270
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/move/move.js
14290
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/move/move.js
14271
14291
  var require_move = __commonJS({
14272
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/move/move.js"(exports, module2) {
14292
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/move/move.js"(exports, module2) {
14273
14293
  "use strict";
14274
14294
  var fs = require_fs5();
14275
14295
  var path2 = require("path");
@@ -14319,9 +14339,9 @@ var require_move = __commonJS({
14319
14339
  }
14320
14340
  });
14321
14341
 
14322
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/move/move-sync.js
14342
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/move/move-sync.js
14323
14343
  var require_move_sync = __commonJS({
14324
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/move/move-sync.js"(exports, module2) {
14344
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/move/move-sync.js"(exports, module2) {
14325
14345
  "use strict";
14326
14346
  var fs = require_graceful_fs();
14327
14347
  var path2 = require("path");
@@ -14376,9 +14396,9 @@ var require_move_sync = __commonJS({
14376
14396
  }
14377
14397
  });
14378
14398
 
14379
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/move/index.js
14399
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/move/index.js
14380
14400
  var require_move2 = __commonJS({
14381
- "node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/move/index.js"(exports, module2) {
14401
+ "node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/move/index.js"(exports, module2) {
14382
14402
  "use strict";
14383
14403
  var u = require_universalify().fromPromise;
14384
14404
  module2.exports = {
@@ -24911,7 +24931,7 @@ ${lanes.join("\n")}
24911
24931
  writeOutputIsTTY() {
24912
24932
  return process.stdout.isTTY;
24913
24933
  },
24914
- readFile: readFile2,
24934
+ readFile: readFile3,
24915
24935
  writeFile: writeFile2,
24916
24936
  watchFile: watchFile2,
24917
24937
  watchDirectory,
@@ -25117,7 +25137,7 @@ ${lanes.join("\n")}
25117
25137
  callback
25118
25138
  );
25119
25139
  }
25120
- function readFile2(fileName, _encoding) {
25140
+ function readFile3(fileName, _encoding) {
25121
25141
  let buffer;
25122
25142
  try {
25123
25143
  buffer = _fs.readFileSync(fileName);
@@ -61763,7 +61783,7 @@ ${lanes.join("\n")}
61763
61783
  const possibleOption = getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName);
61764
61784
  return possibleOption ? createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) : createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption);
61765
61785
  }
61766
- function parseCommandLineWorker(diagnostics, commandLine, readFile2) {
61786
+ function parseCommandLineWorker(diagnostics, commandLine, readFile3) {
61767
61787
  const options = {};
61768
61788
  let watchOptions;
61769
61789
  const fileNames = [];
@@ -61811,7 +61831,7 @@ ${lanes.join("\n")}
61811
61831
  }
61812
61832
  }
61813
61833
  function parseResponseFile(fileName) {
61814
- const text = tryReadFile(fileName, readFile2 || ((fileName2) => sys2.readFile(fileName2)));
61834
+ const text = tryReadFile(fileName, readFile3 || ((fileName2) => sys2.readFile(fileName2)));
61815
61835
  if (!isString(text)) {
61816
61836
  errors.push(text);
61817
61837
  return;
@@ -61919,8 +61939,8 @@ ${lanes.join("\n")}
61919
61939
  unknownDidYouMeanDiagnostic: Diagnostics.Unknown_compiler_option_0_Did_you_mean_1,
61920
61940
  optionTypeMismatchDiagnostic: Diagnostics.Compiler_option_0_expects_an_argument
61921
61941
  };
61922
- function parseCommandLine(commandLine, readFile2) {
61923
- return parseCommandLineWorker(compilerOptionsDidYouMeanDiagnostics, commandLine, readFile2);
61942
+ function parseCommandLine(commandLine, readFile3) {
61943
+ return parseCommandLineWorker(compilerOptionsDidYouMeanDiagnostics, commandLine, readFile3);
61924
61944
  }
61925
61945
  function getOptionFromName(optionName, allowShort) {
61926
61946
  return getOptionDeclarationFromName(getOptionsNameMap, optionName, allowShort);
@@ -62002,8 +62022,8 @@ ${lanes.join("\n")}
62002
62022
  watchOptionsToExtend
62003
62023
  );
62004
62024
  }
62005
- function readConfigFile(fileName, readFile2) {
62006
- const textOrDiagnostic = tryReadFile(fileName, readFile2);
62025
+ function readConfigFile(fileName, readFile3) {
62026
+ const textOrDiagnostic = tryReadFile(fileName, readFile3);
62007
62027
  return isString(textOrDiagnostic) ? parseConfigFileTextToJson(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic };
62008
62028
  }
62009
62029
  function parseConfigFileTextToJson(fileName, jsonText) {
@@ -62018,14 +62038,14 @@ ${lanes.join("\n")}
62018
62038
  error: jsonSourceFile.parseDiagnostics.length ? jsonSourceFile.parseDiagnostics[0] : void 0
62019
62039
  };
62020
62040
  }
62021
- function readJsonConfigFile(fileName, readFile2) {
62022
- const textOrDiagnostic = tryReadFile(fileName, readFile2);
62041
+ function readJsonConfigFile(fileName, readFile3) {
62042
+ const textOrDiagnostic = tryReadFile(fileName, readFile3);
62023
62043
  return isString(textOrDiagnostic) ? parseJsonText(fileName, textOrDiagnostic) : { fileName, parseDiagnostics: [textOrDiagnostic] };
62024
62044
  }
62025
- function tryReadFile(fileName, readFile2) {
62045
+ function tryReadFile(fileName, readFile3) {
62026
62046
  let text;
62027
62047
  try {
62028
- text = readFile2(fileName);
62048
+ text = readFile3(fileName);
62029
62049
  } catch (e) {
62030
62050
  return createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message);
62031
62051
  }
@@ -152213,12 +152233,12 @@ ${lanes.join("\n")}
152213
152233
  function createCompilerHost(options, setParentNodes) {
152214
152234
  return createCompilerHostWorker(options, setParentNodes);
152215
152235
  }
152216
- function createGetSourceFile(readFile2, setParentNodes) {
152236
+ function createGetSourceFile(readFile3, setParentNodes) {
152217
152237
  return (fileName, languageVersionOrOptions, onError) => {
152218
152238
  let text;
152219
152239
  try {
152220
152240
  mark("beforeIORead");
152221
- text = readFile2(fileName);
152241
+ text = readFile3(fileName);
152222
152242
  mark("afterIORead");
152223
152243
  measure("I/O Read", "beforeIORead", "afterIORead");
152224
152244
  } catch (e) {
@@ -153145,7 +153165,7 @@ ${lanes.join("\n")}
153145
153165
  getRedirectFromOutput,
153146
153166
  forEachResolvedProjectReference: forEachResolvedProjectReference2
153147
153167
  });
153148
- const readFile2 = host.readFile.bind(host);
153168
+ const readFile3 = host.readFile.bind(host);
153149
153169
  (_e = tracing) == null ? void 0 : _e.push(tracing.Phase.Program, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram });
153150
153170
  const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
153151
153171
  (_f = tracing) == null ? void 0 : _f.pop();
@@ -153372,7 +153392,7 @@ ${lanes.join("\n")}
153372
153392
  shouldTransformImportCall,
153373
153393
  emitBuildInfo,
153374
153394
  fileExists,
153375
- readFile: readFile2,
153395
+ readFile: readFile3,
153376
153396
  directoryExists,
153377
153397
  getSymlinkCache,
153378
153398
  realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
@@ -190732,7 +190752,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
190732
190752
  var fixId37 = "fixMissingTypeAnnotationOnExports";
190733
190753
  var addAnnotationFix = "add-annotation";
190734
190754
  var addInlineTypeAssertion = "add-type-assertion";
190735
- var extractExpression = "extract-expression";
190755
+ var extractExpression2 = "extract-expression";
190736
190756
  var errorCodes48 = [
190737
190757
  Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,
190738
190758
  Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,
@@ -190784,7 +190804,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
190784
190804
  addCodeAction(addInlineTypeAssertion, fixes, context, 0, (f) => f.addInlineAssertion(context.span));
190785
190805
  addCodeAction(addInlineTypeAssertion, fixes, context, 1, (f) => f.addInlineAssertion(context.span));
190786
190806
  addCodeAction(addInlineTypeAssertion, fixes, context, 2, (f) => f.addInlineAssertion(context.span));
190787
- addCodeAction(extractExpression, fixes, context, 0, (f) => f.extractAsVariable(context.span));
190807
+ addCodeAction(extractExpression2, fixes, context, 0, (f) => f.extractAsVariable(context.span));
190788
190808
  return fixes;
190789
190809
  },
190790
190810
  getAllCodeActions: (context) => {
@@ -204673,7 +204693,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
204673
204693
  return ts_textChanges_exports.ChangeTracker.with(
204674
204694
  { host, formatContext, preferences },
204675
204695
  (changeTracker) => {
204676
- const parsed = contents.map((c) => parse4(sourceFile, c));
204696
+ const parsed = contents.map((c) => parse5(sourceFile, c));
204677
204697
  const flattenedLocations = focusLocations && flatten2(focusLocations);
204678
204698
  for (const nodes of parsed) {
204679
204699
  placeNodeGroup(
@@ -204686,7 +204706,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
204686
204706
  }
204687
204707
  );
204688
204708
  }
204689
- function parse4(sourceFile, content) {
204709
+ function parse5(sourceFile, content) {
204690
204710
  const nodeKinds = [
204691
204711
  {
204692
204712
  parse: () => createSourceFile(
@@ -229485,10 +229505,137 @@ var init_vue_extractor = __esm({
229485
229505
  }
229486
229506
  });
229487
229507
 
229508
+ // packages/cli-lib/src/svelte_extractor.ts
229509
+ var svelte_extractor_exports = {};
229510
+ __export(svelte_extractor_exports, {
229511
+ parseFile: () => parseFile2
229512
+ });
229513
+ function walkFragment(fragment, source, parseScriptFn) {
229514
+ if (!fragment || !fragment.nodes) {
229515
+ return;
229516
+ }
229517
+ for (const node of fragment.nodes) {
229518
+ walkNode(node, source, parseScriptFn);
229519
+ }
229520
+ }
229521
+ function extractExpression(expression, source, parseScriptFn) {
229522
+ if (!expression || expression.start == null || expression.end == null) {
229523
+ return;
229524
+ }
229525
+ const content = source.slice(expression.start, expression.end);
229526
+ try {
229527
+ parseScriptFn(`(${content})`);
229528
+ } catch (e) {
229529
+ console.warn(
229530
+ `Failed to parse "${content}". Ignore this if content has no extractable message`,
229531
+ e
229532
+ );
229533
+ }
229534
+ }
229535
+ function walkNode(node, source, parseScriptFn) {
229536
+ switch (node.type) {
229537
+ case "ExpressionTag":
229538
+ extractExpression(node.expression, source, parseScriptFn);
229539
+ break;
229540
+ case "ConstTag":
229541
+ if (node.declaration) {
229542
+ const content = source.slice(
229543
+ node.declaration.start,
229544
+ node.declaration.end
229545
+ );
229546
+ try {
229547
+ parseScriptFn(content);
229548
+ } catch (e) {
229549
+ console.warn(
229550
+ `Failed to parse const declaration. Ignore this if content has no extractable message`,
229551
+ e
229552
+ );
229553
+ }
229554
+ }
229555
+ break;
229556
+ case "IfBlock":
229557
+ extractExpression(node.test, source, parseScriptFn);
229558
+ walkFragment(node.consequent, source, parseScriptFn);
229559
+ walkFragment(node.alternate, source, parseScriptFn);
229560
+ break;
229561
+ case "EachBlock":
229562
+ extractExpression(node.expression, source, parseScriptFn);
229563
+ if (node.key) {
229564
+ extractExpression(node.key, source, parseScriptFn);
229565
+ }
229566
+ walkFragment(node.body, source, parseScriptFn);
229567
+ walkFragment(node.fallback, source, parseScriptFn);
229568
+ break;
229569
+ case "AwaitBlock":
229570
+ extractExpression(node.expression, source, parseScriptFn);
229571
+ walkFragment(node.pending, source, parseScriptFn);
229572
+ walkFragment(node.then, source, parseScriptFn);
229573
+ walkFragment(node.catch, source, parseScriptFn);
229574
+ break;
229575
+ case "KeyBlock":
229576
+ extractExpression(node.expression, source, parseScriptFn);
229577
+ walkFragment(node.fragment, source, parseScriptFn);
229578
+ break;
229579
+ case "SnippetBlock":
229580
+ walkFragment(node.body, source, parseScriptFn);
229581
+ break;
229582
+ case "RegularElement":
229583
+ case "Component":
229584
+ case "SvelteComponent":
229585
+ case "SvelteElement":
229586
+ case "SvelteHead":
229587
+ case "SvelteBody":
229588
+ case "SvelteWindow":
229589
+ case "SvelteDocument":
229590
+ case "SlotElement":
229591
+ case "SvelteSelf":
229592
+ case "SvelteFragment":
229593
+ if (node.attributes) {
229594
+ for (const attr of node.attributes) {
229595
+ if (attr.type === "Attribute") {
229596
+ if (Array.isArray(attr.value)) {
229597
+ for (const v of attr.value) {
229598
+ if (v.type === "ExpressionTag") {
229599
+ extractExpression(v.expression, source, parseScriptFn);
229600
+ }
229601
+ }
229602
+ } else if (typeof attr.value === "object" && attr.value !== null && attr.value.type === "ExpressionTag") {
229603
+ extractExpression(attr.value.expression, source, parseScriptFn);
229604
+ }
229605
+ } else if (attr.type === "SpreadAttribute") {
229606
+ extractExpression(attr.expression, source, parseScriptFn);
229607
+ } else if (attr.expression) {
229608
+ extractExpression(attr.expression, source, parseScriptFn);
229609
+ }
229610
+ }
229611
+ }
229612
+ walkFragment(node.fragment, source, parseScriptFn);
229613
+ break;
229614
+ }
229615
+ }
229616
+ function parseFile2(source, filename, parseScriptFn) {
229617
+ const ast = (0, import_compiler.parse)(source, { modern: true, filename });
229618
+ walkFragment(ast.fragment, source, parseScriptFn);
229619
+ if (ast.instance) {
229620
+ const program2 = ast.instance.content;
229621
+ parseScriptFn(source.slice(program2.start, program2.end));
229622
+ }
229623
+ if (ast.module) {
229624
+ const program2 = ast.module.content;
229625
+ parseScriptFn(source.slice(program2.start, program2.end));
229626
+ }
229627
+ }
229628
+ var import_compiler;
229629
+ var init_svelte_extractor = __esm({
229630
+ "packages/cli-lib/src/svelte_extractor.ts"() {
229631
+ import_compiler = require("svelte/compiler");
229632
+ }
229633
+ });
229634
+
229488
229635
  // packages/cli-lib/src/hbs_extractor.ts
229489
229636
  var hbs_extractor_exports = {};
229490
229637
  __export(hbs_extractor_exports, {
229491
- parseFile: () => parseFile2
229638
+ parseFile: () => parseFile3
229492
229639
  });
229493
229640
  function extractText(node, fileName, options) {
229494
229641
  var _a;
@@ -229518,7 +229665,7 @@ function extractText(node, fileName, options) {
229518
229665
  ]);
229519
229666
  }
229520
229667
  }
229521
- function parseFile2(source, fileName, options) {
229668
+ function parseFile3(source, fileName, options) {
229522
229669
  const ast = (0, import_syntax.preprocess)(source);
229523
229670
  (0, import_syntax.traverse)(ast, {
229524
229671
  MustacheStatement(node) {
@@ -229539,15 +229686,15 @@ var init_hbs_extractor = __esm({
229539
229686
  // packages/cli-lib/src/gts_extractor.ts
229540
229687
  var gts_extractor_exports = {};
229541
229688
  __export(gts_extractor_exports, {
229542
- parseFile: () => parseFile3
229689
+ parseFile: () => parseFile4
229543
229690
  });
229544
- function parseFile3(source, fileName, options) {
229691
+ function parseFile4(source, fileName, options) {
229545
229692
  const scriptParseFn = parseScript(options, fileName);
229546
229693
  const transformedSource = p.process(source, { filename: fileName });
229547
229694
  scriptParseFn(transformedSource.code);
229548
229695
  const parseResult = p.parse(source, { filename: fileName });
229549
229696
  for (let parsed of parseResult) {
229550
- parseFile2(parsed.contents, fileName, options);
229697
+ parseFile3(parsed.contents, fileName, options);
229551
229698
  }
229552
229699
  }
229553
229700
  var import_content_tag, p;
@@ -229560,7 +229707,7 @@ var init_gts_extractor = __esm({
229560
229707
  }
229561
229708
  });
229562
229709
 
229563
- // node_modules/.aspect_rules_js/commander@14.0.2/node_modules/commander/esm.mjs
229710
+ // node_modules/.aspect_rules_js/commander@14.0.3/node_modules/commander/esm.mjs
229564
229711
  var import_index = __toESM(require_commander(), 1);
229565
229712
  var {
229566
229713
  program,
@@ -229584,7 +229731,7 @@ var import_loud_rejection = __toESM(require_loud_rejection());
229584
229731
  // packages/cli-lib/src/compile.ts
229585
229732
  init_icu_messageformat_parser();
229586
229733
 
229587
- // node_modules/.aspect_rules_js/fs-extra@11.3.3/node_modules/fs-extra/lib/esm.mjs
229734
+ // node_modules/.aspect_rules_js/fs-extra@11.3.4/node_modules/fs-extra/lib/esm.mjs
229588
229735
  var import_copy = __toESM(require_copy2(), 1);
229589
229736
  var import_empty = __toESM(require_empty(), 1);
229590
229737
  var import_ensure = __toESM(require_ensure(), 1);
@@ -229651,6 +229798,7 @@ var esm_default = {
229651
229798
  };
229652
229799
 
229653
229800
  // packages/cli-lib/src/compile.ts
229801
+ var import_promises = require("fs/promises");
229654
229802
  var stringifyNs = __toESM(require_json_stable_stringify());
229655
229803
  init_console_utils();
229656
229804
 
@@ -229938,13 +230086,16 @@ function generateENXB(msg) {
229938
230086
  var stringify = stringifyNs.default || stringifyNs;
229939
230087
  async function compile7(inputFiles, opts = {}) {
229940
230088
  debug("Compiling files:", inputFiles);
229941
- const { ast, format: format9, pseudoLocale, skipErrors, ignoreTag } = opts;
230089
+ const { ast, format: format9, pseudoLocale, skipErrors, ignoreTag, signal } = opts;
230090
+ signal == null ? void 0 : signal.throwIfAborted();
229942
230091
  const formatter = await resolveBuiltinFormatter(format9);
229943
230092
  const messages = {};
229944
230093
  const messageAsts = {};
229945
230094
  const idsWithFileName = {};
229946
230095
  const compiledFiles = await Promise.all(
229947
- inputFiles.map((f) => readJSON(f).then(formatter.compile))
230096
+ inputFiles.map(
230097
+ (f) => (0, import_promises.readFile)(f, { encoding: "utf8", signal }).then((content) => JSON.parse(content)).then(formatter.compile)
230098
+ )
229948
230099
  );
229949
230100
  debug("Compiled files:", compiledFiles);
229950
230101
  for (let i = 0; i < inputFiles.length; i++) {
@@ -230029,7 +230180,7 @@ init_ts_transformer();
230029
230180
  init_console_utils();
230030
230181
  var stringifyNs3 = __toESM(require_json_stable_stringify());
230031
230182
  init_parse_script();
230032
- var import_promises = require("fs/promises");
230183
+ var import_promises2 = require("fs/promises");
230033
230184
  var stringify3 = stringifyNs3.default || stringifyNs3;
230034
230185
  function calculateLineColFromOffset(text, start) {
230035
230186
  if (!start) {
@@ -230088,16 +230239,20 @@ async function processFile(source, fn, { idInterpolationPattern, ...opts }) {
230088
230239
  const scriptParseFn = parseScript(opts, fn);
230089
230240
  if (fn.endsWith(".vue")) {
230090
230241
  debug("Processing %s using vue extractor", fn);
230091
- const { parseFile: parseFile4 } = await Promise.resolve().then(() => (init_vue_extractor(), vue_extractor_exports));
230092
- parseFile4(source, fn, scriptParseFn);
230242
+ const { parseFile: parseFile5 } = await Promise.resolve().then(() => (init_vue_extractor(), vue_extractor_exports));
230243
+ parseFile5(source, fn, scriptParseFn);
230244
+ } else if (fn.endsWith(".svelte")) {
230245
+ debug("Processing %s using svelte extractor", fn);
230246
+ const { parseFile: parseFile5 } = await Promise.resolve().then(() => (init_svelte_extractor(), svelte_extractor_exports));
230247
+ parseFile5(source, fn, scriptParseFn);
230093
230248
  } else if (fn.endsWith(".hbs")) {
230094
230249
  debug("Processing %s using hbs extractor", fn);
230095
- const { parseFile: parseFile4 } = await Promise.resolve().then(() => (init_hbs_extractor(), hbs_extractor_exports));
230096
- parseFile4(source, fn, opts);
230250
+ const { parseFile: parseFile5 } = await Promise.resolve().then(() => (init_hbs_extractor(), hbs_extractor_exports));
230251
+ parseFile5(source, fn, opts);
230097
230252
  } else if (fn.endsWith(".gts") || fn.endsWith(".gjs")) {
230098
230253
  debug("Processing %s as gts/gjs file", fn);
230099
- const { parseFile: parseFile4 } = await Promise.resolve().then(() => (init_gts_extractor(), gts_extractor_exports));
230100
- parseFile4(source, fn, opts);
230254
+ const { parseFile: parseFile5 } = await Promise.resolve().then(() => (init_gts_extractor(), gts_extractor_exports));
230255
+ parseFile5(source, fn, opts);
230101
230256
  } else {
230102
230257
  debug("Processing %s using typescript extractor", fn);
230103
230258
  scriptParseFn(source);
@@ -230110,7 +230265,7 @@ async function processFile(source, fn, { idInterpolationPattern, ...opts }) {
230110
230265
  return { messages, meta };
230111
230266
  }
230112
230267
  async function extract(files, extractOpts) {
230113
- const { throws, readFromStdin, ...opts } = extractOpts;
230268
+ const { throws, readFromStdin, signal, ...opts } = extractOpts;
230114
230269
  const shouldThrow = throws === true;
230115
230270
  const optsWithThrows = {
230116
230271
  ...opts,
@@ -230131,7 +230286,7 @@ async function extract(files, extractOpts) {
230131
230286
  const settledResults = await Promise.allSettled(
230132
230287
  files.map(async (fn) => {
230133
230288
  debug("Extracting file:", fn);
230134
- const source = await (0, import_promises.readFile)(fn, "utf8");
230289
+ const source = await (0, import_promises2.readFile)(fn, { encoding: "utf8", signal });
230135
230290
  return processFile(source, fn, optsWithThrows);
230136
230291
  })
230137
230292
  );
@@ -230147,7 +230302,7 @@ async function extract(files, extractOpts) {
230147
230302
  rawResults = await Promise.all(
230148
230303
  files.map(async (fn) => {
230149
230304
  debug("Extracting file:", fn);
230150
- const source = await (0, import_promises.readFile)(fn, "utf8");
230305
+ const source = await (0, import_promises2.readFile)(fn, { encoding: "utf8", signal });
230151
230306
  return processFile(source, fn, optsWithThrows);
230152
230307
  })
230153
230308
  );
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@formatjs/cli",
3
3
  "description": "A CLI for formatjs.",
4
- "version": "6.13.1",
4
+ "version": "6.13.3",
5
5
  "license": "MIT",
6
6
  "author": "Linjie Ding <linjie@airtable.com>",
7
7
  "engines": {
8
8
  "node": ">= 20.12.0"
9
9
  },
10
10
  "devDependencies": {
11
- "@formatjs/cli-lib": "8.3.1"
11
+ "@formatjs/cli-lib": "8.4.0"
12
12
  },
13
13
  "peerDependencies": {
14
14
  "@glimmer/syntax": "^0.84.3 || ^0.95.0",