@lingui/conf 3.10.4 → 3.12.1
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.
- package/index.d.ts +9 -2
- package/index.js +16 -2
- package/package.json +2 -1
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GeneratorOptions } from "@babel/core";
|
|
2
2
|
|
|
3
|
-
export declare type CatalogFormat = "lingui" | "minimal" | "po" | "csv" |
|
|
3
|
+
export declare type CatalogFormat = "lingui" | "minimal" | "po" | "csv" | "po-gettext";
|
|
4
4
|
export type CatalogFormatOptions = {
|
|
5
5
|
origins?: boolean;
|
|
6
6
|
lineNumbers?: boolean;
|
|
@@ -23,6 +23,11 @@ export type DefaultLocaleObject = {
|
|
|
23
23
|
|
|
24
24
|
export declare type FallbackLocales = LocaleObject | DefaultLocaleObject
|
|
25
25
|
|
|
26
|
+
declare type CatalogService = {
|
|
27
|
+
name: string;
|
|
28
|
+
apiKey: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
declare type ExtractorType = {
|
|
27
32
|
match(filename: string): boolean;
|
|
28
33
|
extract(filename: string, targetDir: string, options?: any): void;
|
|
@@ -46,6 +51,7 @@ export declare type LinguiConfig = {
|
|
|
46
51
|
rootDir: string;
|
|
47
52
|
runtimeConfigModule: [string, string?];
|
|
48
53
|
sourceLocale: string;
|
|
54
|
+
service: CatalogService;
|
|
49
55
|
};
|
|
50
56
|
export declare const defaultConfig: LinguiConfig;
|
|
51
57
|
export declare function getConfig({ cwd, configPath, skipValidation, }?: {
|
|
@@ -63,7 +69,7 @@ export declare const configValidation: {
|
|
|
63
69
|
};
|
|
64
70
|
compilerBabelOptions: GeneratorOptions;
|
|
65
71
|
catalogs: CatalogConfig[];
|
|
66
|
-
compileNamespace: "es"
|
|
72
|
+
compileNamespace: "es" | "ts" | "cjs" | string;
|
|
67
73
|
fallbackLocales: FallbackLocales;
|
|
68
74
|
format: CatalogFormat;
|
|
69
75
|
formatOptions: CatalogFormatOptions;
|
|
@@ -73,6 +79,7 @@ export declare const configValidation: {
|
|
|
73
79
|
rootDir: string;
|
|
74
80
|
runtimeConfigModule: [string, string?];
|
|
75
81
|
sourceLocale: string;
|
|
82
|
+
service: CatalogService;
|
|
76
83
|
};
|
|
77
84
|
deprecatedConfig: {
|
|
78
85
|
fallbackLocale: (config: LinguiConfig & DeprecatedFallbackLanguage) => string;
|
package/index.js
CHANGED
|
@@ -67,7 +67,11 @@ var defaultConfig = {
|
|
|
67
67
|
pseudoLocale: "",
|
|
68
68
|
rootDir: ".",
|
|
69
69
|
runtimeConfigModule: ["@lingui/core", "i18n"],
|
|
70
|
-
sourceLocale: ""
|
|
70
|
+
sourceLocale: "",
|
|
71
|
+
service: {
|
|
72
|
+
name: "",
|
|
73
|
+
apiKey: ""
|
|
74
|
+
}
|
|
71
75
|
};
|
|
72
76
|
exports.defaultConfig = defaultConfig;
|
|
73
77
|
|
|
@@ -111,6 +115,12 @@ function getConfig() {
|
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
var exampleConfig = _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
118
|
+
extractors: (0, _jestValidate.multipleValidOptions)([], ["babel"], [{
|
|
119
|
+
match: function match(fileName) {
|
|
120
|
+
return false;
|
|
121
|
+
},
|
|
122
|
+
extract: function extract(filename, targetDir, options) {}
|
|
123
|
+
}]),
|
|
114
124
|
runtimeConfigModule: (0, _jestValidate.multipleValidOptions)({
|
|
115
125
|
i18n: ["@lingui/core", "i18n"],
|
|
116
126
|
Trans: ["@lingui/react", "Trans"]
|
|
@@ -126,7 +136,11 @@ var exampleConfig = _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
|
126
136
|
extends: "babelconfig.js",
|
|
127
137
|
rootMode: "rootmode",
|
|
128
138
|
plugins: ["plugin"],
|
|
129
|
-
presets: ["preset"]
|
|
139
|
+
presets: ["preset"],
|
|
140
|
+
targets: (0, _jestValidate.multipleValidOptions)({}, '> 0.5%', ['> 0.5%', 'not dead'], undefined),
|
|
141
|
+
assumptions: (0, _jestValidate.multipleValidOptions)({}, undefined),
|
|
142
|
+
browserslistConfigFile: (0, _jestValidate.multipleValidOptions)(true, undefined),
|
|
143
|
+
browserslistEnv: (0, _jestValidate.multipleValidOptions)('.browserslistrc', undefined)
|
|
130
144
|
}
|
|
131
145
|
});
|
|
132
146
|
|