@lingui/cli 4.11.4 → 4.13.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.
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getTranslationsForCatalog = void 0;
4
4
  const getFallbackListForLocale_1 = require("./getFallbackListForLocale");
5
5
  async function getTranslationsForCatalog(catalog, locale, options) {
6
- const catalogs = await catalog.readAll();
7
- const template = (await catalog.readTemplate()) || {};
6
+ const [catalogs, template] = await Promise.all([
7
+ catalog.readAll(),
8
+ catalog.readTemplate(),
9
+ ]);
8
10
  const sourceLocaleCatalog = catalogs[options.sourceLocale] || {};
9
11
  const input = Object.assign(Object.assign(Object.assign({}, template), sourceLocaleCatalog), catalogs[locale]);
10
12
  return Object.keys(input).reduce((acc, key) => {
@@ -121,7 +121,10 @@ const extractor = {
121
121
  async extract(filename, code, onMessageExtracted, ctx) {
122
122
  const parserOptions = ctx.linguiConfig.extractorParserOptions;
123
123
  // https://babeljs.io/docs/en/babel-parser#latest-ecmascript-features
124
- const parserPlugins = [];
124
+ const parserPlugins = [
125
+ "importAttributes",
126
+ "explicitResourceManagement", // stage3,
127
+ ];
125
128
  if ([/\.ts$/, /\.mts$/, /\.cts$/, /\.tsx$/].some((r) => filename.match(r))) {
126
129
  parserPlugins.push("typescript");
127
130
  if (parserOptions.tsExperimentalDecorators) {
@@ -36,8 +36,8 @@ async function command(config, options) {
36
36
  console.log();
37
37
  });
38
38
  if (!options.watch) {
39
- console.log(`(use "${chalk_1.default.yellow((0, help_1.helpRun)("extract"))}" to update catalogs with new messages)`);
40
- console.log(`(use "${chalk_1.default.yellow((0, help_1.helpRun)("compile"))}" to compile catalogs for production)`);
39
+ console.log(`(Use "${chalk_1.default.yellow((0, help_1.helpRun)("extract"))}" to update catalogs with new messages.)`);
40
+ console.log(`(Use "${chalk_1.default.yellow((0, help_1.helpRun)("compile"))}" to compile catalogs for production. Alternatively, use bundler plugins: https://lingui.dev/ref/cli#compiling-catalogs-in-ci)`);
41
41
  }
42
42
  // If service key is present in configuration, synchronize with cloud translation platform
43
43
  if (typeof config.service === "object" &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingui/cli",
3
- "version": "4.11.4",
3
+ "version": "4.13.0",
4
4
  "description": "CLI for working wit message catalogs",
5
5
  "keywords": [
6
6
  "cli",
@@ -50,14 +50,14 @@
50
50
  "dependencies": {
51
51
  "@babel/core": "^7.21.0",
52
52
  "@babel/generator": "^7.21.1",
53
- "@babel/parser": "^7.21.2",
53
+ "@babel/parser": "^7.22.0",
54
54
  "@babel/runtime": "^7.21.0",
55
55
  "@babel/types": "^7.21.2",
56
- "@lingui/babel-plugin-extract-messages": "4.11.4",
57
- "@lingui/conf": "4.11.4",
58
- "@lingui/core": "4.11.4",
59
- "@lingui/format-po": "4.11.4",
60
- "@lingui/message-utils": "4.11.4",
56
+ "@lingui/babel-plugin-extract-messages": "4.13.0",
57
+ "@lingui/conf": "4.13.0",
58
+ "@lingui/core": "4.13.0",
59
+ "@lingui/format-po": "4.13.0",
60
+ "@lingui/message-utils": "4.13.0",
61
61
  "babel-plugin-macros": "^3.0.1",
62
62
  "chalk": "^4.1.0",
63
63
  "chokidar": "3.5.1",
@@ -80,7 +80,7 @@
80
80
  },
81
81
  "devDependencies": {
82
82
  "@lingui/jest-mocks": "*",
83
- "@lingui/macro": "4.11.4",
83
+ "@lingui/macro": "4.13.0",
84
84
  "@types/convert-source-map": "^2.0.0",
85
85
  "@types/glob": "^8.1.0",
86
86
  "@types/micromatch": "^4.0.1",
@@ -88,5 +88,5 @@
88
88
  "mock-fs": "^5.2.0",
89
89
  "mockdate": "^3.0.5"
90
90
  },
91
- "gitHead": "43d4e671360e8e5f1b820e4e061c1926d95c120b"
91
+ "gitHead": "263faa5b8cbe07ea1bbe4f5902794f29b773984d"
92
92
  }