@formatjs/cli 6.2.15 → 6.3.0

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 +23 -5
  2. package/package.json +2 -2
package/bin/formatjs CHANGED
@@ -2754,7 +2754,7 @@ var require_loud_rejection = __commonJS({
2754
2754
  }
2755
2755
  });
2756
2756
 
2757
- // node_modules/.aspect_rules_js/tslib@2.7.0/node_modules/tslib/tslib.es6.mjs
2757
+ // node_modules/.aspect_rules_js/tslib@2.8.0/node_modules/tslib/tslib.es6.mjs
2758
2758
  var tslib_es6_exports = {};
2759
2759
  __export(tslib_es6_exports, {
2760
2760
  __addDisposableResource: () => __addDisposableResource,
@@ -2782,6 +2782,7 @@ __export(tslib_es6_exports, {
2782
2782
  __propKey: () => __propKey,
2783
2783
  __read: () => __read,
2784
2784
  __rest: () => __rest,
2785
+ __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension,
2785
2786
  __runInitializers: () => __runInitializers,
2786
2787
  __setFunctionName: () => __setFunctionName,
2787
2788
  __spread: () => __spread,
@@ -3244,9 +3245,17 @@ function __disposeResources(env) {
3244
3245
  }
3245
3246
  return next();
3246
3247
  }
3248
+ function __rewriteRelativeImportExtension(path, preserveJsx) {
3249
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
3250
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
3251
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
3252
+ });
3253
+ }
3254
+ return path;
3255
+ }
3247
3256
  var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default;
3248
3257
  var init_tslib_es6 = __esm({
3249
- "node_modules/.aspect_rules_js/tslib@2.7.0/node_modules/tslib/tslib.es6.mjs"() {
3258
+ "node_modules/.aspect_rules_js/tslib@2.8.0/node_modules/tslib/tslib.es6.mjs"() {
3250
3259
  extendStatics = function(d, b) {
3251
3260
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
3252
3261
  d2.__proto__ = b2;
@@ -3299,6 +3308,10 @@ var init_tslib_es6 = __esm({
3299
3308
  __rest,
3300
3309
  __decorate,
3301
3310
  __param,
3311
+ __esDecorate,
3312
+ __runInitializers,
3313
+ __propKey,
3314
+ __setFunctionName,
3302
3315
  __metadata,
3303
3316
  __awaiter,
3304
3317
  __generator,
@@ -3320,7 +3333,8 @@ var init_tslib_es6 = __esm({
3320
3333
  __classPrivateFieldSet,
3321
3334
  __classPrivateFieldIn,
3322
3335
  __addDisposableResource,
3323
- __disposeResources
3336
+ __disposeResources,
3337
+ __rewriteRelativeImportExtension
3324
3338
  };
3325
3339
  }
3326
3340
  });
@@ -221975,7 +221989,7 @@ var init_pseudo_locale = __esm({
221975
221989
  // packages/cli-lib/src/compile.ts
221976
221990
  async function compile7(inputFiles, opts = {}) {
221977
221991
  debug("Compiling files:", inputFiles);
221978
- const { ast, format: format8, pseudoLocale, skipErrors } = opts;
221992
+ const { ast, format: format8, pseudoLocale, skipErrors, ignoreTag } = opts;
221979
221993
  const formatter = await resolveBuiltinFormatter(format8);
221980
221994
  const messages = {};
221981
221995
  const messageAsts = {};
@@ -221997,7 +222011,7 @@ Message from ${inputFile}: ${compiled[id]}
221997
222011
  `);
221998
222012
  }
221999
222013
  try {
222000
- const msgAst = (0, import_icu_messageformat_parser3.parse)(compiled[id]);
222014
+ const msgAst = (0, import_icu_messageformat_parser3.parse)(compiled[id], { ignoreTag });
222001
222015
  messages[id] = compiled[id];
222002
222016
  switch (pseudoLocale) {
222003
222017
  case "xx-LS":
@@ -227722,6 +227736,10 @@ for more information`
227722
227736
  "--pseudo-locale <pseudoLocale>",
227723
227737
  `Whether to generate pseudo-locale files. See https://formatjs.io/docs/tooling/cli#--pseudo-locale-pseudolocale for possible values.
227724
227738
  "--ast" is required for this to work.`
227739
+ ).option(
227740
+ "--ignore-tag",
227741
+ `Whether the parser to treat HTML/XML tags as string literal instead of parsing them as tag token. When this is false we only allow
227742
+ simple tags without any attributes.`
227725
227743
  ).action(async (filePatterns, opts) => {
227726
227744
  debug("File pattern:", filePatterns);
227727
227745
  debug("Options:", opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/cli",
3
- "version": "6.2.15",
3
+ "version": "6.3.0",
4
4
  "description": "A CLI for formatjs.",
5
5
  "keywords": [
6
6
  "intl",
@@ -33,7 +33,7 @@
33
33
  "url": "https://github.com/formatjs/formatjs/issues"
34
34
  },
35
35
  "devDependencies": {
36
- "@formatjs/cli-lib": "6.4.5"
36
+ "@formatjs/cli-lib": "6.5.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@glimmer/env": "^0.1.7",