@lingui/conf 4.8.0-next.0 → 4.8.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 CHANGED
@@ -242,11 +242,7 @@ const getSymbolSource = (defaults, config) => {
242
242
  }
243
243
  return defaults;
244
244
  }
245
- const override = config[name];
246
- if (!override) {
247
- return defaults;
248
- }
249
- return [override[0], override[1] || name];
245
+ return config[name] || defaults;
250
246
  };
251
247
  function normalizeRuntimeConfigModule(config) {
252
248
  const [i18nImportModule, i18nImportName] = getSymbolSource(
@@ -257,19 +253,13 @@ function normalizeRuntimeConfigModule(config) {
257
253
  ["@lingui/react", "Trans"],
258
254
  config.runtimeConfigModule
259
255
  );
260
- const [useLinguiImportModule, useLinguiImportName] = getSymbolSource(
261
- ["@lingui/react", "useLingui"],
262
- config.runtimeConfigModule
263
- );
264
256
  return {
265
257
  ...config,
266
258
  runtimeConfigModule: {
267
259
  i18nImportModule,
268
260
  i18nImportName,
269
261
  TransImportModule,
270
- TransImportName,
271
- useLinguiImportModule,
272
- useLinguiImportName
262
+ TransImportName
273
263
  }
274
264
  };
275
265
  }
package/dist/index.d.cts CHANGED
@@ -91,7 +91,7 @@ type LocaleObject = {
91
91
  default?: string;
92
92
  };
93
93
  type FallbackLocales = LocaleObject;
94
- type ModuleSource = readonly [module: string, specifier?: string];
94
+ type ModuleSource = [string, string?];
95
95
  type CatalogService = {
96
96
  name: string;
97
97
  apiKey: string;
@@ -179,7 +179,9 @@ type LinguiConfig = {
179
179
  orderBy?: OrderBy;
180
180
  pseudoLocale?: string;
181
181
  rootDir?: string;
182
- runtimeConfigModule?: ModuleSource | Partial<Record<"useLingui" | "Trans" | "i18n", ModuleSource>>;
182
+ runtimeConfigModule?: ModuleSource | {
183
+ [symbolName: string]: ModuleSource;
184
+ };
183
185
  sourceLocale?: string;
184
186
  service?: CatalogService;
185
187
  experimental?: {
@@ -193,8 +195,6 @@ type LinguiConfigNormalized = Omit<LinguiConfig, "runtimeConfigModule"> & {
193
195
  i18nImportName: string;
194
196
  TransImportModule: string;
195
197
  TransImportName: string;
196
- useLinguiImportModule: string;
197
- useLinguiImportName: string;
198
198
  };
199
199
  };
200
200
 
package/dist/index.d.mts CHANGED
@@ -91,7 +91,7 @@ type LocaleObject = {
91
91
  default?: string;
92
92
  };
93
93
  type FallbackLocales = LocaleObject;
94
- type ModuleSource = readonly [module: string, specifier?: string];
94
+ type ModuleSource = [string, string?];
95
95
  type CatalogService = {
96
96
  name: string;
97
97
  apiKey: string;
@@ -179,7 +179,9 @@ type LinguiConfig = {
179
179
  orderBy?: OrderBy;
180
180
  pseudoLocale?: string;
181
181
  rootDir?: string;
182
- runtimeConfigModule?: ModuleSource | Partial<Record<"useLingui" | "Trans" | "i18n", ModuleSource>>;
182
+ runtimeConfigModule?: ModuleSource | {
183
+ [symbolName: string]: ModuleSource;
184
+ };
183
185
  sourceLocale?: string;
184
186
  service?: CatalogService;
185
187
  experimental?: {
@@ -193,8 +195,6 @@ type LinguiConfigNormalized = Omit<LinguiConfig, "runtimeConfigModule"> & {
193
195
  i18nImportName: string;
194
196
  TransImportModule: string;
195
197
  TransImportName: string;
196
- useLinguiImportModule: string;
197
- useLinguiImportName: string;
198
198
  };
199
199
  };
200
200
 
package/dist/index.d.ts CHANGED
@@ -91,7 +91,7 @@ type LocaleObject = {
91
91
  default?: string;
92
92
  };
93
93
  type FallbackLocales = LocaleObject;
94
- type ModuleSource = readonly [module: string, specifier?: string];
94
+ type ModuleSource = [string, string?];
95
95
  type CatalogService = {
96
96
  name: string;
97
97
  apiKey: string;
@@ -179,7 +179,9 @@ type LinguiConfig = {
179
179
  orderBy?: OrderBy;
180
180
  pseudoLocale?: string;
181
181
  rootDir?: string;
182
- runtimeConfigModule?: ModuleSource | Partial<Record<"useLingui" | "Trans" | "i18n", ModuleSource>>;
182
+ runtimeConfigModule?: ModuleSource | {
183
+ [symbolName: string]: ModuleSource;
184
+ };
183
185
  sourceLocale?: string;
184
186
  service?: CatalogService;
185
187
  experimental?: {
@@ -193,8 +195,6 @@ type LinguiConfigNormalized = Omit<LinguiConfig, "runtimeConfigModule"> & {
193
195
  i18nImportName: string;
194
196
  TransImportModule: string;
195
197
  TransImportName: string;
196
- useLinguiImportModule: string;
197
- useLinguiImportName: string;
198
198
  };
199
199
  };
200
200
 
package/dist/index.mjs CHANGED
@@ -234,11 +234,7 @@ const getSymbolSource = (defaults, config) => {
234
234
  }
235
235
  return defaults;
236
236
  }
237
- const override = config[name];
238
- if (!override) {
239
- return defaults;
240
- }
241
- return [override[0], override[1] || name];
237
+ return config[name] || defaults;
242
238
  };
243
239
  function normalizeRuntimeConfigModule(config) {
244
240
  const [i18nImportModule, i18nImportName] = getSymbolSource(
@@ -249,19 +245,13 @@ function normalizeRuntimeConfigModule(config) {
249
245
  ["@lingui/react", "Trans"],
250
246
  config.runtimeConfigModule
251
247
  );
252
- const [useLinguiImportModule, useLinguiImportName] = getSymbolSource(
253
- ["@lingui/react", "useLingui"],
254
- config.runtimeConfigModule
255
- );
256
248
  return {
257
249
  ...config,
258
250
  runtimeConfigModule: {
259
251
  i18nImportModule,
260
252
  i18nImportName,
261
253
  TransImportModule,
262
- TransImportName,
263
- useLinguiImportModule,
264
- useLinguiImportName
254
+ TransImportName
265
255
  }
266
256
  };
267
257
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingui/conf",
3
- "version": "4.8.0-next.0",
3
+ "version": "4.8.0",
4
4
  "sideEffects": false,
5
5
  "description": "Get lingui configuration from package.json",
6
6
  "keywords": [
@@ -38,9 +38,9 @@
38
38
  "/dist"
39
39
  ],
40
40
  "devDependencies": {
41
- "@lingui/jest-mocks": "^3.0.3",
41
+ "@lingui/jest-mocks": "*",
42
42
  "tsd": "^0.26.1",
43
43
  "unbuild": "^2.0.0"
44
44
  },
45
- "gitHead": "d085ac65d66ce6c2f866b703b6346e53ff0bf6b3"
45
+ "gitHead": "1b3a1209b06e9a6b6820ce54064da87052c21fa5"
46
46
  }