@lingui/cli 4.1.1 → 4.2.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.
@@ -2,4 +2,4 @@ import { Catalog } from "../catalog";
2
2
  /**
3
3
  * Return all files catalog implicitly depends on.
4
4
  */
5
- export declare function getCatalogDependentFiles(catalog: Catalog, locale: string): string[];
5
+ export declare function getCatalogDependentFiles(catalog: Catalog, locale: string): Promise<string[]>;
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.getCatalogDependentFiles = void 0;
4
7
  const getFallbackListForLocale_1 = require("./getFallbackListForLocale");
8
+ const promises_1 = __importDefault(require("node:fs/promises"));
9
+ const fileExists = async (path) => !!(await promises_1.default.stat(path).catch(() => false));
5
10
  /**
6
11
  * Return all files catalog implicitly depends on.
7
12
  */
8
- function getCatalogDependentFiles(catalog, locale) {
13
+ async function getCatalogDependentFiles(catalog, locale) {
9
14
  const files = new Set([catalog.templateFile]);
10
15
  (0, getFallbackListForLocale_1.getFallbackListForLocale)(catalog.config.fallbackLocales, locale).forEach((locale) => {
11
16
  files.add(catalog.getFilename(locale));
@@ -13,6 +18,12 @@ function getCatalogDependentFiles(catalog, locale) {
13
18
  if (catalog.config.sourceLocale && locale !== catalog.config.sourceLocale) {
14
19
  files.add(catalog.getFilename(catalog.config.sourceLocale));
15
20
  }
16
- return Array.from(files.values());
21
+ const out = [];
22
+ for (const file of files) {
23
+ if (await fileExists(file)) {
24
+ out.push(file);
25
+ }
26
+ }
27
+ return out;
17
28
  }
18
29
  exports.getCatalogDependentFiles = getCatalogDependentFiles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingui/cli",
3
- "version": "4.1.1",
3
+ "version": "4.2.0",
4
4
  "description": "CLI for working wit message catalogs",
5
5
  "keywords": [
6
6
  "cli",
@@ -53,11 +53,11 @@
53
53
  "@babel/parser": "^7.21.2",
54
54
  "@babel/runtime": "^7.21.0",
55
55
  "@babel/types": "^7.21.2",
56
- "@lingui/babel-plugin-extract-messages": "4.1.1",
57
- "@lingui/conf": "4.1.1",
58
- "@lingui/core": "4.1.1",
59
- "@lingui/format-po": "4.1.1",
60
- "@lingui/message-utils": "4.1.1",
56
+ "@lingui/babel-plugin-extract-messages": "4.2.0",
57
+ "@lingui/conf": "4.2.0",
58
+ "@lingui/core": "4.2.0",
59
+ "@lingui/format-po": "4.2.0",
60
+ "@lingui/message-utils": "4.2.0",
61
61
  "babel-plugin-macros": "^3.0.1",
62
62
  "chalk": "^4.1.0",
63
63
  "chokidar": "3.5.1",
@@ -71,6 +71,7 @@
71
71
  "micromatch": "4.0.2",
72
72
  "normalize-path": "^3.0.0",
73
73
  "ora": "^5.1.0",
74
+ "pathe": "^1.1.0",
74
75
  "pkg-up": "^3.1.0",
75
76
  "pofile": "^1.1.4",
76
77
  "pseudolocale": "^2.0.0",
@@ -79,7 +80,7 @@
79
80
  },
80
81
  "devDependencies": {
81
82
  "@lingui/jest-mocks": "*",
82
- "@lingui/macro": "4.1.1",
83
+ "@lingui/macro": "4.2.0",
83
84
  "@types/convert-source-map": "^2.0.0",
84
85
  "@types/glob": "^8.1.0",
85
86
  "@types/micromatch": "^4.0.1",
@@ -87,5 +88,5 @@
87
88
  "mock-fs": "^5.2.0",
88
89
  "mockdate": "^3.0.5"
89
90
  },
90
- "gitHead": "dad2c065901a9574bc117a8ef7ed75465ad713d0"
91
+ "gitHead": "57aa5ce306558d0a9d29a14dd40ffa31e5d591bd"
91
92
  }