@lingui/conf 4.4.2 → 4.5.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.
- package/dist/index.cjs +14 -8
- package/dist/index.d.cts +211 -0
- package/dist/index.d.mts +211 -0
- package/dist/index.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -6,6 +6,12 @@ const path = require('path');
|
|
|
6
6
|
const fs = require('fs');
|
|
7
7
|
const cosmiconfig = require('cosmiconfig');
|
|
8
8
|
|
|
9
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
10
|
+
|
|
11
|
+
const chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
12
|
+
const path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
13
|
+
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
14
|
+
|
|
9
15
|
function replaceRootDir(config, rootDir) {
|
|
10
16
|
return function replaceDeep(value, rootDir2) {
|
|
11
17
|
const replace = (s) => s.replace("<rootDir>", rootDir2);
|
|
@@ -226,7 +232,7 @@ function getCldrParentLocale(sourceLocale) {
|
|
|
226
232
|
}[sourceLocale];
|
|
227
233
|
}
|
|
228
234
|
|
|
229
|
-
const pathJoinPosix = (...values) =>
|
|
235
|
+
const pathJoinPosix = (...values) => path__default.join(...values).split(path__default.sep).join("/");
|
|
230
236
|
|
|
231
237
|
const getSymbolSource = (defaults, config) => {
|
|
232
238
|
const name = defaults[1];
|
|
@@ -339,7 +345,7 @@ const exampleConfig = {
|
|
|
339
345
|
}
|
|
340
346
|
};
|
|
341
347
|
const extractBabelOptionsDeprecations = {
|
|
342
|
-
extractBabelOptions: () => ` Option ${
|
|
348
|
+
extractBabelOptions: () => ` Option ${chalk__default.bold("extractBabelOptions")} was removed.
|
|
343
349
|
|
|
344
350
|
Please remove it from your config file.
|
|
345
351
|
|
|
@@ -357,9 +363,9 @@ function validateLocales(config) {
|
|
|
357
363
|
if (!Array.isArray(config.locales) || !config.locales.length) {
|
|
358
364
|
console.error("No locales defined!\n");
|
|
359
365
|
console.error(
|
|
360
|
-
`Add ${
|
|
366
|
+
`Add ${chalk__default.yellow(
|
|
361
367
|
"'locales'"
|
|
362
|
-
)} to your configuration. See ${
|
|
368
|
+
)} to your configuration. See ${chalk__default.underline(
|
|
363
369
|
"https://lingui.dev/ref/conf#locales"
|
|
364
370
|
)}`
|
|
365
371
|
);
|
|
@@ -368,7 +374,7 @@ function validateLocales(config) {
|
|
|
368
374
|
const pipe = (...functions) => (args) => functions.reduce((arg, fn) => fn(arg), args);
|
|
369
375
|
|
|
370
376
|
function configExists(path2) {
|
|
371
|
-
return path2 &&
|
|
377
|
+
return path2 && fs__default.existsSync(path2);
|
|
372
378
|
}
|
|
373
379
|
function JitiLoader() {
|
|
374
380
|
return (filepath, content) => {
|
|
@@ -411,9 +417,9 @@ function getConfig({
|
|
|
411
417
|
if (!result) {
|
|
412
418
|
console.error("Lingui was unable to find a config!\n");
|
|
413
419
|
console.error(
|
|
414
|
-
`Create ${
|
|
420
|
+
`Create ${chalk__default.bold(
|
|
415
421
|
"'lingui.config.js'"
|
|
416
|
-
)} file with LinguiJS configuration in root of your project (next to package.json). See ${
|
|
422
|
+
)} file with LinguiJS configuration in root of your project (next to package.json). See ${chalk__default.underline(
|
|
417
423
|
"https://lingui.dev/ref/conf"
|
|
418
424
|
)}`
|
|
419
425
|
);
|
|
@@ -422,7 +428,7 @@ function getConfig({
|
|
|
422
428
|
const userConfig = result ? result.config : {};
|
|
423
429
|
return makeConfig(
|
|
424
430
|
{
|
|
425
|
-
rootDir: result ?
|
|
431
|
+
rootDir: result ? path__default.dirname(result.filepath) : defaultRootDir,
|
|
426
432
|
...userConfig
|
|
427
433
|
},
|
|
428
434
|
{ skipValidation }
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated please pass formatter directly to `format`
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```js
|
|
6
|
+
* // lingui.config.{js,ts}
|
|
7
|
+
* import {formatter} from "@lingui/format-po"
|
|
8
|
+
*
|
|
9
|
+
* export default {
|
|
10
|
+
* [...]
|
|
11
|
+
* format: formatter({lineNumbers: false}),
|
|
12
|
+
* }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
type CatalogFormat = "lingui" | "minimal" | "po" | "csv" | "po-gettext";
|
|
16
|
+
type ExtractorCtx = {
|
|
17
|
+
/**
|
|
18
|
+
* Raw Sourcemaps object to mapping from.
|
|
19
|
+
* Check the https://github.com/mozilla/source-map#new-sourcemapconsumerrawsourcemap
|
|
20
|
+
*/
|
|
21
|
+
sourceMaps?: any;
|
|
22
|
+
linguiConfig: LinguiConfigNormalized;
|
|
23
|
+
};
|
|
24
|
+
type CatalogExtra = Record<string, unknown>;
|
|
25
|
+
type MessageOrigin = [filename: string, line?: number];
|
|
26
|
+
type ExtractedMessageType<Extra = CatalogExtra> = {
|
|
27
|
+
message?: string;
|
|
28
|
+
origin?: MessageOrigin[];
|
|
29
|
+
comments?: string[];
|
|
30
|
+
obsolete?: boolean;
|
|
31
|
+
context?: string;
|
|
32
|
+
/**
|
|
33
|
+
* the generic field where
|
|
34
|
+
* formatters can store additional data
|
|
35
|
+
*/
|
|
36
|
+
extra?: Extra;
|
|
37
|
+
};
|
|
38
|
+
type MessageType<Extra = CatalogExtra> = ExtractedMessageType<Extra> & {
|
|
39
|
+
translation: string;
|
|
40
|
+
};
|
|
41
|
+
type ExtractedCatalogType<Extra = CatalogExtra> = {
|
|
42
|
+
[msgId: string]: ExtractedMessageType<Extra>;
|
|
43
|
+
};
|
|
44
|
+
type CatalogType<Extra = CatalogExtra> = {
|
|
45
|
+
[msgId: string]: MessageType<Extra>;
|
|
46
|
+
};
|
|
47
|
+
type ExtractorType = {
|
|
48
|
+
match(filename: string): boolean;
|
|
49
|
+
extract(filename: string, code: string, onMessageExtracted: (msg: ExtractedMessage) => void, ctx?: ExtractorCtx): Promise<void> | void;
|
|
50
|
+
};
|
|
51
|
+
type CatalogFormatter = {
|
|
52
|
+
catalogExtension: string;
|
|
53
|
+
/**
|
|
54
|
+
* Set extension used when extract to template
|
|
55
|
+
* Omit if the extension is the same as catalogExtension
|
|
56
|
+
*/
|
|
57
|
+
templateExtension?: string;
|
|
58
|
+
parse(content: string, ctx: {
|
|
59
|
+
locale: string | null;
|
|
60
|
+
sourceLocale: string;
|
|
61
|
+
filename: string;
|
|
62
|
+
}): Promise<CatalogType> | CatalogType;
|
|
63
|
+
serialize(catalog: CatalogType, ctx: {
|
|
64
|
+
locale: string | null;
|
|
65
|
+
sourceLocale: string;
|
|
66
|
+
filename: string;
|
|
67
|
+
existing: string | null;
|
|
68
|
+
}): Promise<string> | string;
|
|
69
|
+
};
|
|
70
|
+
type ExtractedMessage = {
|
|
71
|
+
id: string;
|
|
72
|
+
message?: string;
|
|
73
|
+
context?: string;
|
|
74
|
+
origin?: [filename: string, line: number, column?: number];
|
|
75
|
+
comment?: string;
|
|
76
|
+
};
|
|
77
|
+
type CatalogFormatOptions = {
|
|
78
|
+
origins?: boolean;
|
|
79
|
+
lineNumbers?: boolean;
|
|
80
|
+
disableSelectWarning?: boolean;
|
|
81
|
+
};
|
|
82
|
+
type OrderBy = "messageId" | "message" | "origin";
|
|
83
|
+
type CatalogConfig = {
|
|
84
|
+
name?: string;
|
|
85
|
+
path: string;
|
|
86
|
+
include: string[];
|
|
87
|
+
exclude?: string[];
|
|
88
|
+
};
|
|
89
|
+
type LocaleObject = {
|
|
90
|
+
[locale: string]: string[] | string;
|
|
91
|
+
default?: string;
|
|
92
|
+
};
|
|
93
|
+
type FallbackLocales = LocaleObject;
|
|
94
|
+
type ModuleSource = [string, string?];
|
|
95
|
+
type CatalogService = {
|
|
96
|
+
name: string;
|
|
97
|
+
apiKey: string;
|
|
98
|
+
};
|
|
99
|
+
type ExperimentalExtractorOptions = {
|
|
100
|
+
/**
|
|
101
|
+
* Entries to start extracting from.
|
|
102
|
+
* Each separate resolved entry would create a separate catalog.
|
|
103
|
+
*
|
|
104
|
+
* Example for MPA application like Next.js
|
|
105
|
+
* ```
|
|
106
|
+
* <rootDir>/pages/**\/*.ts
|
|
107
|
+
* <rootDir>/pages/**\/*.page.ts
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* With this config you would have a separate
|
|
111
|
+
* catalog for every page file in your app.
|
|
112
|
+
*/
|
|
113
|
+
entries: string[];
|
|
114
|
+
/**
|
|
115
|
+
* Explicitly include some dependency for extraction.
|
|
116
|
+
* For example, you can include all monorepo's packages as
|
|
117
|
+
* ["@mycompany/"]
|
|
118
|
+
*/
|
|
119
|
+
includeDeps?: string[];
|
|
120
|
+
/**
|
|
121
|
+
* By default all dependencies from package.json would be ecxluded from analyzing.
|
|
122
|
+
* If something was not properly discovered you can add it here.
|
|
123
|
+
*
|
|
124
|
+
* Note: it automatically matches also sub imports
|
|
125
|
+
*
|
|
126
|
+
* "next" would match "next" and "next/head"
|
|
127
|
+
*/
|
|
128
|
+
excludeDeps?: string[];
|
|
129
|
+
/**
|
|
130
|
+
* svg, jpg and other files which might be imported in application should be exluded from analysis.
|
|
131
|
+
* By default extractor provides a comprehensive list of extensions. If you feel like somthing is missing in this list please fill an issue on GitHub
|
|
132
|
+
*
|
|
133
|
+
* NOTE: changing this param will override default list of extensions.
|
|
134
|
+
*/
|
|
135
|
+
excludeExtensions?: string[];
|
|
136
|
+
/**
|
|
137
|
+
* output path for extracted catalogs.
|
|
138
|
+
*
|
|
139
|
+
* Supported placeholders for entry: /pages/about/index.page.ts
|
|
140
|
+
* - {entryName} = index.page
|
|
141
|
+
* - {locale} = en
|
|
142
|
+
* - {entryDir} = pages/about/
|
|
143
|
+
*
|
|
144
|
+
* Examples:
|
|
145
|
+
*
|
|
146
|
+
* ```
|
|
147
|
+
* <rootDir>/locales/{entryName}.{locale} -> /locales/index.page/en.po
|
|
148
|
+
* <rootDir>/{entryDir}/locales/{locale} -> /pages/about/locales/en.po
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
output: string;
|
|
152
|
+
resolveEsbuildOptions?: (options: any) => any;
|
|
153
|
+
};
|
|
154
|
+
type LinguiConfig = {
|
|
155
|
+
catalogs?: CatalogConfig[];
|
|
156
|
+
compileNamespace?: "es" | "ts" | "cjs" | string;
|
|
157
|
+
extractorParserOptions?: {
|
|
158
|
+
/**
|
|
159
|
+
* default false
|
|
160
|
+
*
|
|
161
|
+
* By default, standard decorators (Stage3) are applied for TS files
|
|
162
|
+
* Enable this if you want to use TypesScript's experimental decorators.
|
|
163
|
+
*/
|
|
164
|
+
tsExperimentalDecorators?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Enable if you use flow. This will apply Flow syntax to js files
|
|
167
|
+
*/
|
|
168
|
+
flow?: boolean;
|
|
169
|
+
};
|
|
170
|
+
compilerBabelOptions?: any;
|
|
171
|
+
fallbackLocales?: FallbackLocales | false;
|
|
172
|
+
extractors?: (string | ExtractorType)[];
|
|
173
|
+
prevFormat?: CatalogFormat;
|
|
174
|
+
localeDir?: string;
|
|
175
|
+
format?: CatalogFormat | CatalogFormatter;
|
|
176
|
+
formatOptions?: CatalogFormatOptions;
|
|
177
|
+
locales: string[];
|
|
178
|
+
catalogsMergePath?: string;
|
|
179
|
+
orderBy?: OrderBy;
|
|
180
|
+
pseudoLocale?: string;
|
|
181
|
+
rootDir?: string;
|
|
182
|
+
runtimeConfigModule?: ModuleSource | {
|
|
183
|
+
[symbolName: string]: ModuleSource;
|
|
184
|
+
};
|
|
185
|
+
sourceLocale?: string;
|
|
186
|
+
service?: CatalogService;
|
|
187
|
+
experimental?: {
|
|
188
|
+
extractor?: ExperimentalExtractorOptions;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
type LinguiConfigNormalized = Omit<LinguiConfig, "runtimeConfigModule"> & {
|
|
192
|
+
fallbackLocales?: FallbackLocales;
|
|
193
|
+
runtimeConfigModule: {
|
|
194
|
+
i18nImportModule: string;
|
|
195
|
+
i18nImportName: string;
|
|
196
|
+
TransImportModule: string;
|
|
197
|
+
TransImportName: string;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
declare function makeConfig(userConfig: Partial<LinguiConfig>, opts?: {
|
|
202
|
+
skipValidation?: boolean;
|
|
203
|
+
}): LinguiConfigNormalized;
|
|
204
|
+
|
|
205
|
+
declare function getConfig({ cwd, configPath, skipValidation, }?: {
|
|
206
|
+
cwd?: string;
|
|
207
|
+
configPath?: string;
|
|
208
|
+
skipValidation?: boolean;
|
|
209
|
+
}): LinguiConfigNormalized;
|
|
210
|
+
|
|
211
|
+
export { type CatalogConfig, type CatalogFormat, type CatalogFormatOptions, type CatalogFormatter, type CatalogType, type ExperimentalExtractorOptions, type ExtractedCatalogType, type ExtractedMessage, type ExtractedMessageType, type ExtractorCtx, type ExtractorType, type FallbackLocales, type LinguiConfig, type LinguiConfigNormalized, type MessageOrigin, type MessageType, type OrderBy, getConfig, makeConfig };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated please pass formatter directly to `format`
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```js
|
|
6
|
+
* // lingui.config.{js,ts}
|
|
7
|
+
* import {formatter} from "@lingui/format-po"
|
|
8
|
+
*
|
|
9
|
+
* export default {
|
|
10
|
+
* [...]
|
|
11
|
+
* format: formatter({lineNumbers: false}),
|
|
12
|
+
* }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
type CatalogFormat = "lingui" | "minimal" | "po" | "csv" | "po-gettext";
|
|
16
|
+
type ExtractorCtx = {
|
|
17
|
+
/**
|
|
18
|
+
* Raw Sourcemaps object to mapping from.
|
|
19
|
+
* Check the https://github.com/mozilla/source-map#new-sourcemapconsumerrawsourcemap
|
|
20
|
+
*/
|
|
21
|
+
sourceMaps?: any;
|
|
22
|
+
linguiConfig: LinguiConfigNormalized;
|
|
23
|
+
};
|
|
24
|
+
type CatalogExtra = Record<string, unknown>;
|
|
25
|
+
type MessageOrigin = [filename: string, line?: number];
|
|
26
|
+
type ExtractedMessageType<Extra = CatalogExtra> = {
|
|
27
|
+
message?: string;
|
|
28
|
+
origin?: MessageOrigin[];
|
|
29
|
+
comments?: string[];
|
|
30
|
+
obsolete?: boolean;
|
|
31
|
+
context?: string;
|
|
32
|
+
/**
|
|
33
|
+
* the generic field where
|
|
34
|
+
* formatters can store additional data
|
|
35
|
+
*/
|
|
36
|
+
extra?: Extra;
|
|
37
|
+
};
|
|
38
|
+
type MessageType<Extra = CatalogExtra> = ExtractedMessageType<Extra> & {
|
|
39
|
+
translation: string;
|
|
40
|
+
};
|
|
41
|
+
type ExtractedCatalogType<Extra = CatalogExtra> = {
|
|
42
|
+
[msgId: string]: ExtractedMessageType<Extra>;
|
|
43
|
+
};
|
|
44
|
+
type CatalogType<Extra = CatalogExtra> = {
|
|
45
|
+
[msgId: string]: MessageType<Extra>;
|
|
46
|
+
};
|
|
47
|
+
type ExtractorType = {
|
|
48
|
+
match(filename: string): boolean;
|
|
49
|
+
extract(filename: string, code: string, onMessageExtracted: (msg: ExtractedMessage) => void, ctx?: ExtractorCtx): Promise<void> | void;
|
|
50
|
+
};
|
|
51
|
+
type CatalogFormatter = {
|
|
52
|
+
catalogExtension: string;
|
|
53
|
+
/**
|
|
54
|
+
* Set extension used when extract to template
|
|
55
|
+
* Omit if the extension is the same as catalogExtension
|
|
56
|
+
*/
|
|
57
|
+
templateExtension?: string;
|
|
58
|
+
parse(content: string, ctx: {
|
|
59
|
+
locale: string | null;
|
|
60
|
+
sourceLocale: string;
|
|
61
|
+
filename: string;
|
|
62
|
+
}): Promise<CatalogType> | CatalogType;
|
|
63
|
+
serialize(catalog: CatalogType, ctx: {
|
|
64
|
+
locale: string | null;
|
|
65
|
+
sourceLocale: string;
|
|
66
|
+
filename: string;
|
|
67
|
+
existing: string | null;
|
|
68
|
+
}): Promise<string> | string;
|
|
69
|
+
};
|
|
70
|
+
type ExtractedMessage = {
|
|
71
|
+
id: string;
|
|
72
|
+
message?: string;
|
|
73
|
+
context?: string;
|
|
74
|
+
origin?: [filename: string, line: number, column?: number];
|
|
75
|
+
comment?: string;
|
|
76
|
+
};
|
|
77
|
+
type CatalogFormatOptions = {
|
|
78
|
+
origins?: boolean;
|
|
79
|
+
lineNumbers?: boolean;
|
|
80
|
+
disableSelectWarning?: boolean;
|
|
81
|
+
};
|
|
82
|
+
type OrderBy = "messageId" | "message" | "origin";
|
|
83
|
+
type CatalogConfig = {
|
|
84
|
+
name?: string;
|
|
85
|
+
path: string;
|
|
86
|
+
include: string[];
|
|
87
|
+
exclude?: string[];
|
|
88
|
+
};
|
|
89
|
+
type LocaleObject = {
|
|
90
|
+
[locale: string]: string[] | string;
|
|
91
|
+
default?: string;
|
|
92
|
+
};
|
|
93
|
+
type FallbackLocales = LocaleObject;
|
|
94
|
+
type ModuleSource = [string, string?];
|
|
95
|
+
type CatalogService = {
|
|
96
|
+
name: string;
|
|
97
|
+
apiKey: string;
|
|
98
|
+
};
|
|
99
|
+
type ExperimentalExtractorOptions = {
|
|
100
|
+
/**
|
|
101
|
+
* Entries to start extracting from.
|
|
102
|
+
* Each separate resolved entry would create a separate catalog.
|
|
103
|
+
*
|
|
104
|
+
* Example for MPA application like Next.js
|
|
105
|
+
* ```
|
|
106
|
+
* <rootDir>/pages/**\/*.ts
|
|
107
|
+
* <rootDir>/pages/**\/*.page.ts
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* With this config you would have a separate
|
|
111
|
+
* catalog for every page file in your app.
|
|
112
|
+
*/
|
|
113
|
+
entries: string[];
|
|
114
|
+
/**
|
|
115
|
+
* Explicitly include some dependency for extraction.
|
|
116
|
+
* For example, you can include all monorepo's packages as
|
|
117
|
+
* ["@mycompany/"]
|
|
118
|
+
*/
|
|
119
|
+
includeDeps?: string[];
|
|
120
|
+
/**
|
|
121
|
+
* By default all dependencies from package.json would be ecxluded from analyzing.
|
|
122
|
+
* If something was not properly discovered you can add it here.
|
|
123
|
+
*
|
|
124
|
+
* Note: it automatically matches also sub imports
|
|
125
|
+
*
|
|
126
|
+
* "next" would match "next" and "next/head"
|
|
127
|
+
*/
|
|
128
|
+
excludeDeps?: string[];
|
|
129
|
+
/**
|
|
130
|
+
* svg, jpg and other files which might be imported in application should be exluded from analysis.
|
|
131
|
+
* By default extractor provides a comprehensive list of extensions. If you feel like somthing is missing in this list please fill an issue on GitHub
|
|
132
|
+
*
|
|
133
|
+
* NOTE: changing this param will override default list of extensions.
|
|
134
|
+
*/
|
|
135
|
+
excludeExtensions?: string[];
|
|
136
|
+
/**
|
|
137
|
+
* output path for extracted catalogs.
|
|
138
|
+
*
|
|
139
|
+
* Supported placeholders for entry: /pages/about/index.page.ts
|
|
140
|
+
* - {entryName} = index.page
|
|
141
|
+
* - {locale} = en
|
|
142
|
+
* - {entryDir} = pages/about/
|
|
143
|
+
*
|
|
144
|
+
* Examples:
|
|
145
|
+
*
|
|
146
|
+
* ```
|
|
147
|
+
* <rootDir>/locales/{entryName}.{locale} -> /locales/index.page/en.po
|
|
148
|
+
* <rootDir>/{entryDir}/locales/{locale} -> /pages/about/locales/en.po
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
output: string;
|
|
152
|
+
resolveEsbuildOptions?: (options: any) => any;
|
|
153
|
+
};
|
|
154
|
+
type LinguiConfig = {
|
|
155
|
+
catalogs?: CatalogConfig[];
|
|
156
|
+
compileNamespace?: "es" | "ts" | "cjs" | string;
|
|
157
|
+
extractorParserOptions?: {
|
|
158
|
+
/**
|
|
159
|
+
* default false
|
|
160
|
+
*
|
|
161
|
+
* By default, standard decorators (Stage3) are applied for TS files
|
|
162
|
+
* Enable this if you want to use TypesScript's experimental decorators.
|
|
163
|
+
*/
|
|
164
|
+
tsExperimentalDecorators?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Enable if you use flow. This will apply Flow syntax to js files
|
|
167
|
+
*/
|
|
168
|
+
flow?: boolean;
|
|
169
|
+
};
|
|
170
|
+
compilerBabelOptions?: any;
|
|
171
|
+
fallbackLocales?: FallbackLocales | false;
|
|
172
|
+
extractors?: (string | ExtractorType)[];
|
|
173
|
+
prevFormat?: CatalogFormat;
|
|
174
|
+
localeDir?: string;
|
|
175
|
+
format?: CatalogFormat | CatalogFormatter;
|
|
176
|
+
formatOptions?: CatalogFormatOptions;
|
|
177
|
+
locales: string[];
|
|
178
|
+
catalogsMergePath?: string;
|
|
179
|
+
orderBy?: OrderBy;
|
|
180
|
+
pseudoLocale?: string;
|
|
181
|
+
rootDir?: string;
|
|
182
|
+
runtimeConfigModule?: ModuleSource | {
|
|
183
|
+
[symbolName: string]: ModuleSource;
|
|
184
|
+
};
|
|
185
|
+
sourceLocale?: string;
|
|
186
|
+
service?: CatalogService;
|
|
187
|
+
experimental?: {
|
|
188
|
+
extractor?: ExperimentalExtractorOptions;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
type LinguiConfigNormalized = Omit<LinguiConfig, "runtimeConfigModule"> & {
|
|
192
|
+
fallbackLocales?: FallbackLocales;
|
|
193
|
+
runtimeConfigModule: {
|
|
194
|
+
i18nImportModule: string;
|
|
195
|
+
i18nImportName: string;
|
|
196
|
+
TransImportModule: string;
|
|
197
|
+
TransImportName: string;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
declare function makeConfig(userConfig: Partial<LinguiConfig>, opts?: {
|
|
202
|
+
skipValidation?: boolean;
|
|
203
|
+
}): LinguiConfigNormalized;
|
|
204
|
+
|
|
205
|
+
declare function getConfig({ cwd, configPath, skipValidation, }?: {
|
|
206
|
+
cwd?: string;
|
|
207
|
+
configPath?: string;
|
|
208
|
+
skipValidation?: boolean;
|
|
209
|
+
}): LinguiConfigNormalized;
|
|
210
|
+
|
|
211
|
+
export { type CatalogConfig, type CatalogFormat, type CatalogFormatOptions, type CatalogFormatter, type CatalogType, type ExperimentalExtractorOptions, type ExtractedCatalogType, type ExtractedMessage, type ExtractedMessageType, type ExtractorCtx, type ExtractorType, type FallbackLocales, type LinguiConfig, type LinguiConfigNormalized, type MessageOrigin, type MessageType, type OrderBy, getConfig, makeConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -208,4 +208,4 @@ declare function getConfig({ cwd, configPath, skipValidation, }?: {
|
|
|
208
208
|
skipValidation?: boolean;
|
|
209
209
|
}): LinguiConfigNormalized;
|
|
210
210
|
|
|
211
|
-
export { CatalogConfig, CatalogFormat, CatalogFormatOptions, CatalogFormatter, CatalogType, ExperimentalExtractorOptions, ExtractedCatalogType, ExtractedMessage, ExtractedMessageType, ExtractorCtx, ExtractorType, FallbackLocales, LinguiConfig, LinguiConfigNormalized, MessageOrigin, MessageType, OrderBy, getConfig, makeConfig };
|
|
211
|
+
export { type CatalogConfig, type CatalogFormat, type CatalogFormatOptions, type CatalogFormatter, type CatalogType, type ExperimentalExtractorOptions, type ExtractedCatalogType, type ExtractedMessage, type ExtractedMessageType, type ExtractorCtx, type ExtractorType, type FallbackLocales, type LinguiConfig, type LinguiConfigNormalized, type MessageOrigin, type MessageType, type OrderBy, getConfig, makeConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/conf",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "Get lingui configuration from package.json",
|
|
6
6
|
"keywords": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@lingui/jest-mocks": "*",
|
|
42
42
|
"tsd": "^0.26.1",
|
|
43
|
-
"unbuild": "^
|
|
43
|
+
"unbuild": "^2.0.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "62c92d1f8c60b3890bdda870f307fa780d423080"
|
|
46
46
|
}
|