@lingui/conf 6.0.0-next.0 → 6.0.0-next.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/dist/index.d.mts +13 -4
- package/dist/index.mjs +18 -4
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -156,6 +156,19 @@ type LinguiConfig = {
|
|
|
156
156
|
compileNamespace?: "es" | "ts" | "cjs" | string;
|
|
157
157
|
/**
|
|
158
158
|
* Specify additional options used to parse source files when extracting messages.
|
|
159
|
+
*
|
|
160
|
+
* @deprecated please pass options directly to the extractor implementation
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```ts
|
|
164
|
+
* import { createBabelExtractor } from '@lingui/cli/api/extractors/babel'
|
|
165
|
+
*
|
|
166
|
+
* export default {
|
|
167
|
+
* [...]
|
|
168
|
+
* extractors: [createBabelExtractor({parserOptions: { tsExperimentalDecorators: true }})],
|
|
169
|
+
* }
|
|
170
|
+
* ```
|
|
171
|
+
* https://lingui.dev/guides/custom-extractor
|
|
159
172
|
*/
|
|
160
173
|
extractorParserOptions?: {
|
|
161
174
|
/**
|
|
@@ -350,10 +363,6 @@ declare const defaultConfig: {
|
|
|
350
363
|
minimal: boolean;
|
|
351
364
|
};
|
|
352
365
|
};
|
|
353
|
-
extractorParserOptions: {
|
|
354
|
-
flow: false;
|
|
355
|
-
tsExperimentalDecorators: false;
|
|
356
|
-
};
|
|
357
366
|
fallbackLocales: FallbackLocales;
|
|
358
367
|
locales: never[];
|
|
359
368
|
orderBy: "message";
|
package/dist/index.mjs
CHANGED
|
@@ -277,6 +277,7 @@ function makeConfig(userConfig, opts = {}) {
|
|
|
277
277
|
validateFormat(config);
|
|
278
278
|
validate(config, configValidation);
|
|
279
279
|
validateLocales(config);
|
|
280
|
+
deprecateParserOptions(config);
|
|
280
281
|
}
|
|
281
282
|
config = setCldrParentLocales(config);
|
|
282
283
|
config = normalizeRuntimeConfigModule(config);
|
|
@@ -305,10 +306,6 @@ const defaultConfig = {
|
|
|
305
306
|
minimal: true
|
|
306
307
|
}
|
|
307
308
|
},
|
|
308
|
-
extractorParserOptions: {
|
|
309
|
-
flow: false,
|
|
310
|
-
tsExperimentalDecorators: false
|
|
311
|
-
},
|
|
312
309
|
fallbackLocales: {},
|
|
313
310
|
locales: [],
|
|
314
311
|
orderBy: "message",
|
|
@@ -359,6 +356,23 @@ const configValidation = {
|
|
|
359
356
|
exampleConfig,
|
|
360
357
|
comment: "Documentation: https://lingui.dev/ref/conf"
|
|
361
358
|
};
|
|
359
|
+
function deprecateParserOptions(config) {
|
|
360
|
+
if (config.extractorParserOptions) {
|
|
361
|
+
console.error(
|
|
362
|
+
`\`extractorParserOptions\` config option is deprecated.
|
|
363
|
+
|
|
364
|
+
Please pass options directly to the extractor implementation:
|
|
365
|
+
|
|
366
|
+
import { createBabelExtractor } from '@lingui/cli/api/extractors/babel'
|
|
367
|
+
|
|
368
|
+
export default {
|
|
369
|
+
[...]
|
|
370
|
+
extractors: [createBabelExtractor({parserOptions: { tsExperimentalDecorators: true }})],
|
|
371
|
+
}
|
|
372
|
+
`.trim()
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
362
376
|
function validateFormat(config) {
|
|
363
377
|
if (typeof config.format === "string") {
|
|
364
378
|
throw new Error(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/conf",
|
|
3
|
-
"version": "6.0.0-next.
|
|
3
|
+
"version": "6.0.0-next.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "Get lingui configuration from package.json",
|
|
6
6
|
"keywords": [
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"unbuild": {
|
|
51
51
|
"declaration": "node16"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "783af0c0371c7795e1fc43316f49dd253e161221"
|
|
54
54
|
}
|