@lingui/cli 5.0.0-next.1 → 5.0.0-next.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.
|
@@ -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
|
|
7
|
-
|
|
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) => {
|
|
@@ -27,6 +27,6 @@ export declare const babelRe: RegExp;
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export declare function extractFromFileWithBabel(filename: string, code: string, onMessageExtracted: (msg: ExtractedMessage) => void, ctx: ExtractorCtx, parserOpts: ParserOptions, skipMacroPlugin?: boolean): Promise<void>;
|
|
30
|
-
export declare function getBabelParserOptions(filename: string, parserOptions: LinguiConfig["extractorParserOptions"]): (import("@babel/parser").ParserPluginWithOptions | ("decimal" | "placeholders" | "asyncDoExpressions" | "asyncGenerators" | "bigInt" | "classPrivateMethods" | "classPrivateProperties" | "classProperties" | "classStaticBlock" | "decorators-legacy" | "decoratorAutoAccessors" | "destructuringPrivate" | "doExpressions" | "dynamicImport" | "explicitResourceManagement" | "exportDefaultFrom" | "exportNamespaceFrom" | "flow" | "flowComments" | "functionBind" | "functionSent" | "importMeta" | "jsx" | "logicalAssignment" | "importAssertions" | "importReflection" | "moduleBlocks" | "moduleStringNames" | "nullishCoalescingOperator" | "numericSeparator" | "objectRestSpread" | "optionalCatchBinding" | "optionalChaining" | "partialApplication" | "privateIn" | "regexpUnicodeSets" | "throwExpressions" | "topLevelAwait" | "v8intrinsic" | "decorators" | "estree" | "moduleAttributes" | "pipelineOperator" | "recordAndTuple" | "typescript"))[];
|
|
30
|
+
export declare function getBabelParserOptions(filename: string, parserOptions: LinguiConfig["extractorParserOptions"]): (import("@babel/parser").ParserPluginWithOptions | ("decimal" | "placeholders" | "asyncDoExpressions" | "asyncGenerators" | "bigInt" | "classPrivateMethods" | "classPrivateProperties" | "classProperties" | "classStaticBlock" | "decorators-legacy" | "deferredImportEvaluation" | "decoratorAutoAccessors" | "destructuringPrivate" | "doExpressions" | "dynamicImport" | "explicitResourceManagement" | "exportDefaultFrom" | "exportNamespaceFrom" | "flow" | "flowComments" | "functionBind" | "functionSent" | "importMeta" | "jsx" | "logicalAssignment" | "importAssertions" | "importAttributes" | "importReflection" | "moduleBlocks" | "moduleStringNames" | "nullishCoalescingOperator" | "numericSeparator" | "objectRestSpread" | "optionalCatchBinding" | "optionalChaining" | "partialApplication" | "privateIn" | "regexpUnicodeSets" | "sourcePhaseImports" | "throwExpressions" | "topLevelAwait" | "v8intrinsic" | "decorators" | "estree" | "moduleAttributes" | "optionalChainingAssign" | "pipelineOperator" | "recordAndTuple" | "typescript"))[];
|
|
31
31
|
declare const extractor: ExtractorType;
|
|
32
32
|
export default extractor;
|
|
@@ -115,7 +115,10 @@ async function extractFromFileWithBabel(filename, code, onMessageExtracted, ctx,
|
|
|
115
115
|
exports.extractFromFileWithBabel = extractFromFileWithBabel;
|
|
116
116
|
function getBabelParserOptions(filename, parserOptions) {
|
|
117
117
|
// https://babeljs.io/docs/en/babel-parser#latest-ecmascript-features
|
|
118
|
-
const parserPlugins = [
|
|
118
|
+
const parserPlugins = [
|
|
119
|
+
"importAttributes",
|
|
120
|
+
"explicitResourceManagement", // stage3,
|
|
121
|
+
];
|
|
119
122
|
if ([/\.ts$/, /\.mts$/, /\.cts$/, /\.tsx$/].some((r) => filename.match(r))) {
|
|
120
123
|
parserPlugins.push("typescript");
|
|
121
124
|
if (parserOptions.tsExperimentalDecorators) {
|
package/dist/lingui-extract.js
CHANGED
|
@@ -36,8 +36,8 @@ async function command(config, options) {
|
|
|
36
36
|
console.log();
|
|
37
37
|
});
|
|
38
38
|
if (!options.watch) {
|
|
39
|
-
console.log(`(
|
|
40
|
-
console.log(`(
|
|
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": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.3",
|
|
4
4
|
"description": "CLI for working wit message catalogs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"build": "rimraf ./dist && tsc -p tsconfig.build.json"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
43
|
+
"node": ">=20.0.0"
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
46
|
"LICENSE",
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/core": "^7.21.0",
|
|
52
52
|
"@babel/generator": "^7.21.1",
|
|
53
|
-
"@babel/parser": "^7.
|
|
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": "^5.0.0-next.
|
|
57
|
-
"@lingui/babel-plugin-lingui-macro": "^5.0.0-next.
|
|
58
|
-
"@lingui/conf": "^5.0.0-next.
|
|
59
|
-
"@lingui/core": "^5.0.0-next.
|
|
60
|
-
"@lingui/format-po": "^5.0.0-next.
|
|
61
|
-
"@lingui/message-utils": "^5.0.0-next.
|
|
56
|
+
"@lingui/babel-plugin-extract-messages": "^5.0.0-next.3",
|
|
57
|
+
"@lingui/babel-plugin-lingui-macro": "^5.0.0-next.3",
|
|
58
|
+
"@lingui/conf": "^5.0.0-next.3",
|
|
59
|
+
"@lingui/core": "^5.0.0-next.3",
|
|
60
|
+
"@lingui/format-po": "^5.0.0-next.3",
|
|
61
|
+
"@lingui/message-utils": "^5.0.0-next.3",
|
|
62
62
|
"babel-plugin-macros": "^3.0.1",
|
|
63
63
|
"chalk": "^4.1.0",
|
|
64
64
|
"chokidar": "3.5.1",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"mock-fs": "^5.2.0",
|
|
88
88
|
"mockdate": "^3.0.5"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "c027f0e45978eae89665872861cfcafa89f24078"
|
|
91
91
|
}
|