@lingui/conf 5.0.0-next.3 → 5.0.0-next.5

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/README.md CHANGED
@@ -14,16 +14,7 @@ Package finds nearest package.json starting from current directory, reads `lingu
14
14
 
15
15
  ## Usage
16
16
 
17
- ```js
18
- const getConfig = require("@lingui/conf")
19
-
20
- const config = getConfig()
21
- // When package.json is located in '/app/package.json'
22
- // config.rootDir === '/app'
23
- // config.localeDir === '/app/locale'
24
- ```
25
-
26
- See the [reference][reference] documentation of `lingui-cli` for all options.
17
+ See the [reference][reference] documentation.
27
18
 
28
19
  ## License
29
20
 
package/dist/index.cjs CHANGED
@@ -348,19 +348,8 @@ const exampleConfig = {
348
348
  }
349
349
  }
350
350
  };
351
- const extractBabelOptionsDeprecations = {
352
- extractBabelOptions: () => ` Option ${chalk__default.bold("extractBabelOptions")} was removed.
353
-
354
- Please remove it from your config file.
355
-
356
- You can find more information here: https://lingui.dev/releases/migration-4
357
- `
358
- };
359
351
  const configValidation = {
360
352
  exampleConfig,
361
- deprecatedConfig: {
362
- ...extractBabelOptionsDeprecations
363
- },
364
353
  comment: "Documentation: https://lingui.dev/ref/conf"
365
354
  };
366
355
  function validateLocales(config) {
@@ -377,6 +366,10 @@ function validateLocales(config) {
377
366
  }
378
367
  const pipe = (...functions) => (args) => functions.reduce((arg, fn) => fn(arg), args);
379
368
 
369
+ function defineConfig(config) {
370
+ return config;
371
+ }
372
+
380
373
  function configExists(path2) {
381
374
  return path2 && fs__default.existsSync(path2);
382
375
  }
@@ -439,5 +432,6 @@ function getConfig({
439
432
  );
440
433
  }
441
434
 
435
+ exports.defineConfig = defineConfig;
442
436
  exports.getConfig = getConfig;
443
437
  exports.makeConfig = makeConfig;
package/dist/index.d.cts CHANGED
@@ -171,7 +171,7 @@ type LinguiConfig = {
171
171
  };
172
172
  compilerBabelOptions?: any;
173
173
  fallbackLocales?: FallbackLocales | false;
174
- extractors?: (string | ExtractorType)[];
174
+ extractors?: ExtractorType[];
175
175
  prevFormat?: CatalogFormat;
176
176
  localeDir?: string;
177
177
  format?: CatalogFormat | CatalogFormatter;
@@ -202,10 +202,15 @@ declare function makeConfig(userConfig: Partial<LinguiConfig>, opts?: {
202
202
  skipValidation?: boolean;
203
203
  }): LinguiConfigNormalized;
204
204
 
205
+ /**
206
+ * Type helper for lingui.config.ts, returns {@link LinguiConfig} object
207
+ */
208
+ declare function defineConfig(config: LinguiConfig): LinguiConfig;
209
+
205
210
  declare function getConfig({ cwd, configPath, skipValidation, }?: {
206
211
  cwd?: string;
207
212
  configPath?: string;
208
213
  skipValidation?: boolean;
209
214
  }): LinguiConfigNormalized;
210
215
 
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 };
216
+ 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, defineConfig, getConfig, makeConfig };
package/dist/index.d.mts CHANGED
@@ -171,7 +171,7 @@ type LinguiConfig = {
171
171
  };
172
172
  compilerBabelOptions?: any;
173
173
  fallbackLocales?: FallbackLocales | false;
174
- extractors?: (string | ExtractorType)[];
174
+ extractors?: ExtractorType[];
175
175
  prevFormat?: CatalogFormat;
176
176
  localeDir?: string;
177
177
  format?: CatalogFormat | CatalogFormatter;
@@ -202,10 +202,15 @@ declare function makeConfig(userConfig: Partial<LinguiConfig>, opts?: {
202
202
  skipValidation?: boolean;
203
203
  }): LinguiConfigNormalized;
204
204
 
205
+ /**
206
+ * Type helper for lingui.config.ts, returns {@link LinguiConfig} object
207
+ */
208
+ declare function defineConfig(config: LinguiConfig): LinguiConfig;
209
+
205
210
  declare function getConfig({ cwd, configPath, skipValidation, }?: {
206
211
  cwd?: string;
207
212
  configPath?: string;
208
213
  skipValidation?: boolean;
209
214
  }): LinguiConfigNormalized;
210
215
 
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 };
216
+ 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, defineConfig, getConfig, makeConfig };
package/dist/index.d.ts CHANGED
@@ -171,7 +171,7 @@ type LinguiConfig = {
171
171
  };
172
172
  compilerBabelOptions?: any;
173
173
  fallbackLocales?: FallbackLocales | false;
174
- extractors?: (string | ExtractorType)[];
174
+ extractors?: ExtractorType[];
175
175
  prevFormat?: CatalogFormat;
176
176
  localeDir?: string;
177
177
  format?: CatalogFormat | CatalogFormatter;
@@ -202,10 +202,15 @@ declare function makeConfig(userConfig: Partial<LinguiConfig>, opts?: {
202
202
  skipValidation?: boolean;
203
203
  }): LinguiConfigNormalized;
204
204
 
205
+ /**
206
+ * Type helper for lingui.config.ts, returns {@link LinguiConfig} object
207
+ */
208
+ declare function defineConfig(config: LinguiConfig): LinguiConfig;
209
+
205
210
  declare function getConfig({ cwd, configPath, skipValidation, }?: {
206
211
  cwd?: string;
207
212
  configPath?: string;
208
213
  skipValidation?: boolean;
209
214
  }): LinguiConfigNormalized;
210
215
 
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 };
216
+ 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, defineConfig, getConfig, makeConfig };
package/dist/index.mjs CHANGED
@@ -340,19 +340,8 @@ const exampleConfig = {
340
340
  }
341
341
  }
342
342
  };
343
- const extractBabelOptionsDeprecations = {
344
- extractBabelOptions: () => ` Option ${chalk.bold("extractBabelOptions")} was removed.
345
-
346
- Please remove it from your config file.
347
-
348
- You can find more information here: https://lingui.dev/releases/migration-4
349
- `
350
- };
351
343
  const configValidation = {
352
344
  exampleConfig,
353
- deprecatedConfig: {
354
- ...extractBabelOptionsDeprecations
355
- },
356
345
  comment: "Documentation: https://lingui.dev/ref/conf"
357
346
  };
358
347
  function validateLocales(config) {
@@ -369,6 +358,10 @@ function validateLocales(config) {
369
358
  }
370
359
  const pipe = (...functions) => (args) => functions.reduce((arg, fn) => fn(arg), args);
371
360
 
361
+ function defineConfig(config) {
362
+ return config;
363
+ }
364
+
372
365
  function configExists(path2) {
373
366
  return path2 && fs.existsSync(path2);
374
367
  }
@@ -431,4 +424,4 @@ function getConfig({
431
424
  );
432
425
  }
433
426
 
434
- export { getConfig, makeConfig };
427
+ export { defineConfig, getConfig, makeConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingui/conf",
3
- "version": "5.0.0-next.3",
3
+ "version": "5.0.0-next.5",
4
4
  "sideEffects": false,
5
5
  "description": "Get lingui configuration from package.json",
6
6
  "keywords": [
@@ -42,5 +42,5 @@
42
42
  "tsd": "^0.26.1",
43
43
  "unbuild": "^2.0.0"
44
44
  },
45
- "gitHead": "c027f0e45978eae89665872861cfcafa89f24078"
45
+ "gitHead": "3e342f7cca8772e54fc76fa90261bf52c6976b95"
46
46
  }