@aidc-toolkit/app-extension 1.0.22-beta → 1.0.24-beta

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.
Files changed (128) hide show
  1. package/dist/index.cjs +3414 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +1747 -0
  4. package/dist/index.d.ts +1747 -26
  5. package/dist/index.js +3379 -9
  6. package/dist/index.js.map +1 -1
  7. package/package.json +7 -10
  8. package/src/app-extension.ts +3 -10
  9. package/src/app-utility-proxy.ts +5 -4
  10. package/src/descriptor.ts +12 -8
  11. package/src/generator/descriptor.ts +1 -1
  12. package/src/generator/generator.ts +4 -4
  13. package/src/generator/index.ts +2 -2
  14. package/src/generator/{locale-strings-generator.ts → locale-resources-generator.ts} +66 -62
  15. package/src/gs1/character-set-proxy.ts +5 -5
  16. package/src/gs1/check-proxy.ts +3 -3
  17. package/src/gs1/identifier-proxy.ts +9 -8
  18. package/src/gs1/index.ts +3 -3
  19. package/src/index.ts +9 -9
  20. package/src/lib-proxy.ts +3 -3
  21. package/src/locale/en/{locale-strings.ts → locale-resources.ts} +1 -1
  22. package/src/locale/fr/{locale-strings.ts → locale-resources.ts} +1 -1
  23. package/src/locale/i18n.ts +7 -9
  24. package/src/locale/i18next.d.ts +6 -6
  25. package/{dist/types.d.ts → src/type.ts} +10 -38
  26. package/src/utility/character-set-descriptor.ts +1 -1
  27. package/src/utility/character-set-proxy.ts +9 -8
  28. package/src/utility/index.ts +3 -3
  29. package/src/utility/reg-exp-proxy.ts +5 -4
  30. package/src/utility/string-descriptor.ts +1 -1
  31. package/src/utility/string-proxy.ts +2 -2
  32. package/src/utility/transformer-descriptor.ts +1 -1
  33. package/src/utility/transformer-proxy.ts +5 -4
  34. package/tsup.config.ts +3 -0
  35. package/dist/app-extension.d.ts +0 -169
  36. package/dist/app-extension.d.ts.map +0 -1
  37. package/dist/app-extension.js +0 -148
  38. package/dist/app-extension.js.map +0 -1
  39. package/dist/app-utility-proxy.d.ts +0 -66
  40. package/dist/app-utility-proxy.d.ts.map +0 -1
  41. package/dist/app-utility-proxy.js +0 -233
  42. package/dist/app-utility-proxy.js.map +0 -1
  43. package/dist/descriptor.d.ts +0 -172
  44. package/dist/descriptor.d.ts.map +0 -1
  45. package/dist/descriptor.js +0 -174
  46. package/dist/descriptor.js.map +0 -1
  47. package/dist/generator/descriptor.d.ts +0 -107
  48. package/dist/generator/descriptor.d.ts.map +0 -1
  49. package/dist/generator/descriptor.js +0 -2
  50. package/dist/generator/descriptor.js.map +0 -1
  51. package/dist/generator/generator.d.ts +0 -120
  52. package/dist/generator/generator.d.ts.map +0 -1
  53. package/dist/generator/generator.js +0 -213
  54. package/dist/generator/generator.js.map +0 -1
  55. package/dist/generator/index.d.ts +0 -3
  56. package/dist/generator/index.d.ts.map +0 -1
  57. package/dist/generator/index.js +0 -2
  58. package/dist/generator/index.js.map +0 -1
  59. package/dist/gs1/character-set-proxy.d.ts +0 -10
  60. package/dist/gs1/character-set-proxy.d.ts.map +0 -1
  61. package/dist/gs1/character-set-proxy.js +0 -47
  62. package/dist/gs1/character-set-proxy.js.map +0 -1
  63. package/dist/gs1/check-proxy.d.ts +0 -11
  64. package/dist/gs1/check-proxy.d.ts.map +0 -1
  65. package/dist/gs1/check-proxy.js +0 -120
  66. package/dist/gs1/check-proxy.js.map +0 -1
  67. package/dist/gs1/identifier-proxy.d.ts +0 -136
  68. package/dist/gs1/identifier-proxy.d.ts.map +0 -1
  69. package/dist/gs1/identifier-proxy.js +0 -782
  70. package/dist/gs1/identifier-proxy.js.map +0 -1
  71. package/dist/gs1/index.d.ts +0 -4
  72. package/dist/gs1/index.d.ts.map +0 -1
  73. package/dist/gs1/index.js +0 -4
  74. package/dist/gs1/index.js.map +0 -1
  75. package/dist/index.d.ts.map +0 -1
  76. package/dist/lib-proxy.d.ts +0 -135
  77. package/dist/lib-proxy.d.ts.map +0 -1
  78. package/dist/lib-proxy.js +0 -235
  79. package/dist/lib-proxy.js.map +0 -1
  80. package/dist/locale/en/locale-strings.d.ts +0 -616
  81. package/dist/locale/en/locale-strings.d.ts.map +0 -1
  82. package/dist/locale/en/locale-strings.js +0 -616
  83. package/dist/locale/en/locale-strings.js.map +0 -1
  84. package/dist/locale/fr/locale-strings.d.ts +0 -616
  85. package/dist/locale/fr/locale-strings.d.ts.map +0 -1
  86. package/dist/locale/fr/locale-strings.js +0 -616
  87. package/dist/locale/fr/locale-strings.js.map +0 -1
  88. package/dist/locale/i18n.d.ts +0 -27
  89. package/dist/locale/i18n.d.ts.map +0 -1
  90. package/dist/locale/i18n.js +0 -39
  91. package/dist/locale/i18n.js.map +0 -1
  92. package/dist/types.d.ts.map +0 -1
  93. package/dist/types.js +0 -13
  94. package/dist/types.js.map +0 -1
  95. package/dist/utility/character-set-descriptor.d.ts +0 -6
  96. package/dist/utility/character-set-descriptor.d.ts.map +0 -1
  97. package/dist/utility/character-set-descriptor.js +0 -28
  98. package/dist/utility/character-set-descriptor.js.map +0 -1
  99. package/dist/utility/character-set-proxy.d.ts +0 -26
  100. package/dist/utility/character-set-proxy.d.ts.map +0 -1
  101. package/dist/utility/character-set-proxy.js +0 -167
  102. package/dist/utility/character-set-proxy.js.map +0 -1
  103. package/dist/utility/index.d.ts +0 -4
  104. package/dist/utility/index.d.ts.map +0 -1
  105. package/dist/utility/index.js +0 -4
  106. package/dist/utility/index.js.map +0 -1
  107. package/dist/utility/reg-exp-proxy.d.ts +0 -7
  108. package/dist/utility/reg-exp-proxy.d.ts.map +0 -1
  109. package/dist/utility/reg-exp-proxy.js +0 -61
  110. package/dist/utility/reg-exp-proxy.js.map +0 -1
  111. package/dist/utility/string-descriptor.d.ts +0 -4
  112. package/dist/utility/string-descriptor.d.ts.map +0 -1
  113. package/dist/utility/string-descriptor.js +0 -12
  114. package/dist/utility/string-descriptor.js.map +0 -1
  115. package/dist/utility/string-proxy.d.ts +0 -8
  116. package/dist/utility/string-proxy.d.ts.map +0 -1
  117. package/dist/utility/string-proxy.js +0 -12
  118. package/dist/utility/string-proxy.js.map +0 -1
  119. package/dist/utility/transformer-descriptor.d.ts +0 -6
  120. package/dist/utility/transformer-descriptor.d.ts.map +0 -1
  121. package/dist/utility/transformer-descriptor.js +0 -24
  122. package/dist/utility/transformer-descriptor.js.map +0 -1
  123. package/dist/utility/transformer-proxy.d.ts +0 -8
  124. package/dist/utility/transformer-proxy.d.ts.map +0 -1
  125. package/dist/utility/transformer-proxy.js +0 -74
  126. package/dist/utility/transformer-proxy.js.map +0 -1
  127. package/src/generator/logger.ts +0 -45
  128. package/src/types.ts +0 -144
package/src/descriptor.ts CHANGED
@@ -1,11 +1,15 @@
1
- import type { AppExtension } from "./app-extension.js";
2
- import { LibProxy } from "./lib-proxy.js";
3
- import type { ErrorExtends, TypedFunction } from "./types.js";
1
+ import type { TypedFunction } from "@aidc-toolkit/core";
2
+ import type { AppExtension } from "./app-extension";
3
+ import { LibProxy } from "./lib-proxy";
4
+ import type { ErrorExtends } from "./type";
4
5
 
5
6
  /**
6
7
  * Core descriptor.
7
8
  */
8
9
  interface Descriptor {
10
+ /**
11
+ * Name.
12
+ */
9
13
  readonly name: string;
10
14
  }
11
15
 
@@ -167,12 +171,12 @@ type ProxyClassType<ThrowError extends boolean, TError extends ErrorExtends<Thro
167
171
  let pendingParameterDescriptors: ParameterDescriptor[] = [];
168
172
 
169
173
  /**
170
- * Class method descriptors, keyed on declaration class name and method name.
174
+ * Class method descriptors map, keyed on declaration class name and method name.
171
175
  */
172
176
  const classMethodsDescriptorsMap = new Map<string, MethodDescriptor[]>();
173
177
 
174
178
  /**
175
- * Class descriptors, keyed on declaration class name.
179
+ * Class descriptors map, keyed on declaration class name.
176
180
  */
177
181
  const classDescriptorsMap = new Map<string, ClassDescriptor>();
178
182
 
@@ -309,11 +313,11 @@ export function ProxyClass<ThrowError extends boolean, TError extends ErrorExten
309
313
  }
310
314
 
311
315
  /**
312
- * Get class descriptors.
316
+ * Get class descriptors map.
313
317
  *
314
318
  * @returns
315
- * Class descriptors.
319
+ * Class descriptors map.
316
320
  */
317
- export function getClassDescriptors(): ReadonlyMap<string, ClassDescriptor> {
321
+ export function getClassDescriptorsMap(): ReadonlyMap<string, ClassDescriptor> {
318
322
  return classDescriptorsMap;
319
323
  }
@@ -1,4 +1,4 @@
1
- import type { BaseParameterDescriptor, ClassDescriptor, MethodDescriptor } from "../descriptor.js";
1
+ import type { BaseParameterDescriptor, ClassDescriptor, MethodDescriptor } from "../descriptor";
2
2
 
3
3
  /**
4
4
  * Localization.
@@ -1,14 +1,14 @@
1
1
  import { I18nEnvironments } from "@aidc-toolkit/core";
2
2
  import type { ParseKeys } from "i18next";
3
- import { expandParameterDescriptor, getClassDescriptors } from "../descriptor.js";
4
- import { appExtensionResources, i18nAppExtensionInit, i18nextAppExtension } from "../locale/i18n.js";
3
+ import { expandParameterDescriptor, getClassDescriptorsMap } from "../descriptor";
4
+ import { appExtensionResources, i18nAppExtensionInit, i18nextAppExtension } from "../locale/i18n";
5
5
  import type {
6
6
  FunctionLocalization,
7
7
  Localization,
8
8
  ParameterLocalization,
9
9
  ProxyFunctionDescriptor,
10
10
  ProxyObjectDescriptor
11
- } from "./descriptor.js";
11
+ } from "./descriptor";
12
12
 
13
13
  /**
14
14
  * Abstract generator.
@@ -187,7 +187,7 @@ export abstract class Generator {
187
187
  this.initialize();
188
188
 
189
189
  try {
190
- for (const classDescriptor of getClassDescriptors().values()) {
190
+ for (const classDescriptor of getClassDescriptorsMap().values()) {
191
191
  const namespace = classDescriptor.namespace;
192
192
  const namespacePrefix = namespace === undefined ? "" : `${namespace}.`;
193
193
  const className = classDescriptor.name;
@@ -1,2 +1,2 @@
1
- export type * from "./descriptor.js";
2
- export * from "./generator.js";
1
+ export type * from "./descriptor";
2
+ export * from "./generator";
@@ -1,10 +1,9 @@
1
- import type { LocaleStrings } from "@aidc-toolkit/core";
1
+ import { getLogger, type LocaleResources } from "@aidc-toolkit/core";
2
2
  import * as fs from "node:fs";
3
3
  import * as path from "node:path";
4
- import { expandParameterDescriptor, type ParameterDescriptor } from "../descriptor.js";
5
- import type { ProxyFunctionDescriptor } from "./descriptor.js";
6
- import { Generator } from "./generator.js";
7
- import { logger } from "./logger.js";
4
+ import { expandParameterDescriptor, type ParameterDescriptor } from "../descriptor";
5
+ import type { ProxyFunctionDescriptor } from "./descriptor";
6
+ import { Generator } from "./generator";
8
7
 
9
8
  /**
10
9
  * Parameters sequencer entry.
@@ -32,45 +31,50 @@ interface ParametersSequencerEntry {
32
31
  type ParametersSequencer = Record<string, ParametersSequencerEntry>;
33
32
 
34
33
  /**
35
- * Format of locale strings module.
34
+ * Format of locale resources module.
36
35
  */
37
- interface LocaleStringsModule {
36
+ interface LocaleResourcesModule {
38
37
  /**
39
- * Locale strings.
38
+ * Locale resources.
40
39
  */
41
- localeStrings: LocaleStrings;
40
+ LocaleResources: LocaleResources;
42
41
  }
43
42
 
44
43
  /**
45
- * Locale strings generator.
44
+ * Locale resources generator.
46
45
  */
47
- class LocaleStringsGenerator extends Generator {
46
+ class LocaleResourcesGenerator extends Generator {
48
47
  /**
49
- * Locale strings import path.
48
+ * Locale resources import path.
50
49
  */
51
50
  private static readonly IMPORT_PATH = "../app-extension/src/locale";
52
51
 
52
+ /**
53
+ * Logger.
54
+ */
55
+ private readonly _logger = getLogger();
56
+
53
57
  /**
54
58
  * Parameters sequencer.
55
59
  */
56
60
  private readonly _parametersSequencer: ParametersSequencer = {};
57
61
 
58
62
  /**
59
- * Parameters locale strings.
63
+ * Parameters locale resources.
60
64
  */
61
- private readonly _parametersLocaleStrings: LocaleStrings = {};
65
+ private readonly _parametersLocaleResources: LocaleResources = {};
62
66
 
63
67
  /**
64
- * Functions locale strings.
68
+ * Functions locale resources.
65
69
  */
66
- private readonly _functionsLocaleStrings: LocaleStrings = {};
70
+ private readonly _functionsLocaleResources: LocaleResources = {};
67
71
 
68
72
  /**
69
- * Locale strings.
73
+ * Locale resources.
70
74
  */
71
- private readonly _localeStrings: LocaleStrings = {
72
- Parameters: this._parametersLocaleStrings,
73
- Functions: this._functionsLocaleStrings
75
+ private readonly _LocaleResources: LocaleResources = {
76
+ Parameters: this._parametersLocaleResources,
77
+ Functions: this._functionsLocaleResources
74
78
  };
75
79
 
76
80
  /**
@@ -167,35 +171,35 @@ class LocaleStringsGenerator extends Generator {
167
171
  this.saveParameterSequence(parameterDescriptor, true);
168
172
  }
169
173
 
170
- let functionsLocaleStrings = this._functionsLocaleStrings;
174
+ let functionsLocaleResources = this._functionsLocaleResources;
171
175
 
172
176
  if (namespace !== undefined) {
173
- if (!(namespace in functionsLocaleStrings)) {
174
- const namespaceFunctionsLocaleStrings: LocaleStrings = {};
177
+ if (!(namespace in functionsLocaleResources)) {
178
+ const namespaceFunctionsLocaleResources: LocaleResources = {};
175
179
 
176
180
  // Add namespace and navigate to it.
177
- functionsLocaleStrings[namespace] = namespaceFunctionsLocaleStrings;
178
- functionsLocaleStrings = namespaceFunctionsLocaleStrings;
181
+ functionsLocaleResources[namespace] = namespaceFunctionsLocaleResources;
182
+ functionsLocaleResources = namespaceFunctionsLocaleResources;
179
183
  } else {
180
184
  // Navigate to namespace.
181
185
  // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Entry is never a string.
182
- functionsLocaleStrings = functionsLocaleStrings[namespace] as LocaleStrings;
186
+ functionsLocaleResources = functionsLocaleResources[namespace] as LocaleResources;
183
187
  }
184
188
  }
185
189
 
186
- if (functionName in functionsLocaleStrings) {
190
+ if (functionName in functionsLocaleResources) {
187
191
  throw new Error(`Duplicate function "${functionName}"`);
188
192
  }
189
193
 
190
194
  // Add function.
191
- functionsLocaleStrings[functionName] = {
195
+ functionsLocaleResources[functionName] = {
192
196
  name: functionName,
193
197
  description: "*** LOCALIZATION REQUIRED ***"
194
198
  };
195
199
  }
196
200
 
197
201
  /**
198
- * Merge source locale strings into existing destination locale strings.
202
+ * Merge source locale resources into existing destination locale resources.
199
203
  *
200
204
  * @param logChanges
201
205
  * If true, changes are logged. Limits output when processing multiple sources.
@@ -203,67 +207,67 @@ class LocaleStringsGenerator extends Generator {
203
207
  * @param parentKey
204
208
  * Parent key for logging purposes.
205
209
  *
206
- * @param sourceLocaleStrings
207
- * Source locale strings.
210
+ * @param sourceLocaleResources
211
+ * Source locale resources.
208
212
  *
209
- * @param destinationLocaleStrings
210
- * Destination locale strings.
213
+ * @param destinationLocaleResources
214
+ * Destination locale resources.
211
215
  *
212
216
  * @param addMissing
213
- * Add missing if true; applies to locale strings that are not regional.
217
+ * Add missing if true; applies to locale resources that are not regional.
214
218
  *
215
219
  * @returns
216
- * Merged locale strings.
220
+ * Merged locale resources.
217
221
  */
218
- private static merge(logChanges: boolean, parentKey: string, sourceLocaleStrings: LocaleStrings, destinationLocaleStrings: LocaleStrings, addMissing: boolean): LocaleStrings {
222
+ private merge(logChanges: boolean, parentKey: string, sourceLocaleResources: LocaleResources, destinationLocaleResources: LocaleResources, addMissing: boolean): LocaleResources {
219
223
  // Some entries at the top are not part of the generator output.
220
224
  const deleteMissing = parentKey.length !== 0;
221
225
 
222
- const newDestinationLocaleStrings: LocaleStrings = {};
226
+ const newDestinationLocaleResources: LocaleResources = {};
223
227
 
224
228
  // Copy over or delete any destination keys that are not in source.
225
- for (const [key, destinationValue] of Object.entries(destinationLocaleStrings)) {
226
- if (!(key in sourceLocaleStrings)) {
229
+ for (const [key, destinationValue] of Object.entries(destinationLocaleResources)) {
230
+ if (!(key in sourceLocaleResources)) {
227
231
  if (!deleteMissing) {
228
- newDestinationLocaleStrings[key] = destinationValue;
232
+ newDestinationLocaleResources[key] = destinationValue;
229
233
  } else if (logChanges) {
230
- logger.info(`Deleting ${parentKey}${key}...`);
234
+ this._logger.info(`Deleting ${parentKey}${key}...`);
231
235
  }
232
236
  }
233
237
  }
234
238
 
235
- for (const [key, sourceValue] of Object.entries(sourceLocaleStrings)) {
236
- if (!(key in destinationLocaleStrings)) {
239
+ for (const [key, sourceValue] of Object.entries(sourceLocaleResources)) {
240
+ if (!(key in destinationLocaleResources)) {
237
241
  if (addMissing) {
238
242
  if (logChanges) {
239
- logger.info(`Adding ${parentKey}${key}...`);
243
+ this._logger.info(`Adding ${parentKey}${key}...`);
240
244
  }
241
245
 
242
- newDestinationLocaleStrings[key] = sourceValue;
246
+ newDestinationLocaleResources[key] = sourceValue;
243
247
  }
244
248
  } else {
245
- const destinationValue = destinationLocaleStrings[key];
249
+ const destinationValue = destinationLocaleResources[key];
246
250
 
247
251
  if (typeof sourceValue === "object" && typeof destinationValue === "object") {
248
- newDestinationLocaleStrings[key] = LocaleStringsGenerator.merge(logChanges, `${parentKey}${key}.`, sourceValue, destinationValue, addMissing);
252
+ newDestinationLocaleResources[key] = this.merge(logChanges, `${parentKey}${key}.`, sourceValue, destinationValue, addMissing);
249
253
  } else if (typeof sourceValue === "string" && typeof destinationValue === "string") {
250
- newDestinationLocaleStrings[key] = destinationValue;
254
+ newDestinationLocaleResources[key] = destinationValue;
251
255
  } else {
252
256
  throw new Error(`Mismatched types at ${parentKey}${key}`);
253
257
  }
254
258
  }
255
259
  }
256
260
 
257
- return newDestinationLocaleStrings;
261
+ return newDestinationLocaleResources;
258
262
  }
259
263
 
260
264
  /**
261
- * Build parameters locale strings by going through parameters sequencer.
265
+ * Build parameters locale resources by going through parameters sequencer.
262
266
  *
263
267
  * @param parametersSequencer
264
268
  * Parameters sequencer.
265
269
  */
266
- private buildParametersLocaleStrings(parametersSequencer: ParametersSequencer): void {
270
+ private buildParametersLocaleResources(parametersSequencer: ParametersSequencer): void {
267
271
  const entries = Object.entries(parametersSequencer);
268
272
 
269
273
  // Sort the entries as defined by the descriptors.
@@ -295,14 +299,14 @@ class LocaleStringsGenerator extends Generator {
295
299
 
296
300
  for (const [parameterName, parametersSequencerEntry] of entries) {
297
301
  if (parametersSequencerEntry.isUsed) {
298
- this._parametersLocaleStrings[parameterName] = {
302
+ this._parametersLocaleResources[parameterName] = {
299
303
  name: parameterName,
300
304
  description: "*** LOCALIZATION REQUIRED ***"
301
305
  };
302
306
  }
303
307
 
304
308
  if (parametersSequencerEntry.parametersSequencerOrNull !== null) {
305
- this.buildParametersLocaleStrings(parametersSequencerEntry.parametersSequencerOrNull);
309
+ this.buildParametersLocaleResources(parametersSequencerEntry.parametersSequencerOrNull);
306
310
  }
307
311
  }
308
312
  }
@@ -322,10 +326,10 @@ class LocaleStringsGenerator extends Generator {
322
326
  * @returns
323
327
  * Output string.
324
328
  */
325
- private static buildOutput(prefix: string, value: LocaleStrings | string, indentLevel: number): string {
329
+ private static buildOutput(prefix: string, value: LocaleResources | string, indentLevel: number): string {
326
330
  return `${" ".repeat(indentLevel)}${prefix} ${typeof value === "object" ?
327
331
  `{\n${
328
- Object.entries(value).map(entry => LocaleStringsGenerator.buildOutput(`${entry[0]}:`, entry[1], indentLevel + 1)).join(",\n")
332
+ Object.entries(value).map(entry => LocaleResourcesGenerator.buildOutput(`${entry[0]}:`, entry[1], indentLevel + 1)).join(",\n")
329
333
  }\n${" ".repeat(indentLevel)}}` :
330
334
  // JSON.stringify() will apply quotes as appropriate.
331
335
  JSON.stringify(value)
@@ -337,22 +341,22 @@ class LocaleStringsGenerator extends Generator {
337
341
  */
338
342
  protected async finalize(success: boolean): Promise<void> {
339
343
  if (success) {
340
- this.buildParametersLocaleStrings(this._parametersSequencer);
344
+ this.buildParametersLocaleResources(this._parametersSequencer);
341
345
 
342
- await Promise.all(fs.readdirSync(LocaleStringsGenerator.IMPORT_PATH, {
346
+ await Promise.all(fs.readdirSync(LocaleResourcesGenerator.IMPORT_PATH, {
343
347
  withFileTypes: true
344
348
  }).filter(entry => entry.isDirectory()).map(async (entry) => {
345
- const localeStringsSource = path.resolve(LocaleStringsGenerator.IMPORT_PATH, entry.name, "locale-strings.ts");
349
+ const LocaleResourcesSource = path.resolve(LocaleResourcesGenerator.IMPORT_PATH, entry.name, "locale-resources.ts");
346
350
 
347
- await import(localeStringsSource).then((module) => {
351
+ await import(LocaleResourcesSource).then((module) => {
348
352
  // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Module format is known.
349
- const localeStrings = LocaleStringsGenerator.merge(entry.name === "en", "", this._localeStrings, (module as LocaleStringsModule).localeStrings, !entry.name.includes("-"));
353
+ const LocaleResources = this.merge(entry.name === "en", "", this._LocaleResources, (module as LocaleResourcesModule).LocaleResources, !entry.name.includes("-"));
350
354
 
351
- fs.writeFileSync(localeStringsSource, `${LocaleStringsGenerator.buildOutput("export const localeStrings =", localeStrings, 0)};\n`);
355
+ fs.writeFileSync(LocaleResourcesSource, `${LocaleResourcesGenerator.buildOutput("export default", LocaleResources, 0)};\n`);
352
356
  });
353
357
  }));
354
358
  }
355
359
  }
356
360
  }
357
361
 
358
- await new LocaleStringsGenerator().generate();
362
+ await new LocaleResourcesGenerator().generate();
@@ -1,12 +1,12 @@
1
1
  import { AI39_CREATOR, AI82_CREATOR } from "@aidc-toolkit/gs1";
2
- import type { AppExtension } from "../app-extension.js";
3
- import { expandParameterDescriptor, ProxyClass } from "../descriptor.js";
4
- import type { ErrorExtends } from "../types.js";
2
+ import type { AppExtension } from "../app-extension";
3
+ import { expandParameterDescriptor, ProxyClass } from "../descriptor";
4
+ import type { ErrorExtends } from "../type";
5
5
  import {
6
6
  exclusionAllNumericParameterDescriptor,
7
7
  exclusionNoneParameterDescriptor
8
- } from "../utility/character-set-descriptor.js";
9
- import { CharacterSetProxy } from "../utility/character-set-proxy.js";
8
+ } from "../utility/character-set-descriptor";
9
+ import { CharacterSetProxy } from "../utility";
10
10
 
11
11
  @ProxyClass({
12
12
  namespace: "GS1",
@@ -6,9 +6,9 @@ import {
6
6
  isValidPriceOrWeightCheckDigit,
7
7
  priceOrWeightCheckDigit
8
8
  } from "@aidc-toolkit/gs1";
9
- import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Types } from "../descriptor.js";
10
- import { LibProxy } from "../lib-proxy.js";
11
- import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "../types.js";
9
+ import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Types } from "../descriptor";
10
+ import { LibProxy } from "../lib-proxy";
11
+ import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "../type";
12
12
 
13
13
  const checkSParameterDescriptor: ParameterDescriptor = {
14
14
  name: "checkS",
@@ -1,3 +1,4 @@
1
+ import { isNullish, type Nullishable } from "@aidc-toolkit/core";
1
2
  import {
2
3
  CPID_VALIDATOR,
3
4
  GCN_VALIDATOR,
@@ -34,7 +35,7 @@ import {
34
35
  SSCC_VALIDATOR
35
36
  } from "@aidc-toolkit/gs1";
36
37
  import { Sequence } from "@aidc-toolkit/utility";
37
- import type { AppExtension } from "../app-extension.js";
38
+ import type { AppExtension } from "../app-extension";
38
39
  import {
39
40
  expandParameterDescriptor,
40
41
  type ParameterDescriptor,
@@ -42,17 +43,17 @@ import {
42
43
  ProxyMethod,
43
44
  ProxyParameter,
44
45
  Types
45
- } from "../descriptor.js";
46
- import { LibProxy } from "../lib-proxy.js";
47
- import { i18nextAppExtension } from "../locale/i18n.js";
48
- import { type ErrorExtends, isNullish, type Matrix, type MatrixResultError, type Nullishable } from "../types.js";
49
- import { exclusionAllNumericParameterDescriptor } from "../utility/character-set-descriptor.js";
50
- import { StringProxy } from "../utility/string-proxy.js";
46
+ } from "../descriptor";
47
+ import { LibProxy } from "../lib-proxy";
48
+ import { i18nextAppExtension } from "../locale/i18n";
49
+ import type { ErrorExtends, Matrix, MatrixResultError } from "../type";
50
+ import { exclusionAllNumericParameterDescriptor } from "../utility/character-set-descriptor";
51
+ import { StringProxy } from "../utility/string-proxy";
51
52
  import {
52
53
  countParameterDescriptor,
53
54
  startValueParameterDescriptor,
54
55
  valueParameterDescriptor
55
- } from "../utility/transformer-descriptor.js";
56
+ } from "../utility/transformer-descriptor";
56
57
 
57
58
  const identifierParameterDescriptor: ParameterDescriptor = {
58
59
  name: "identifier",
package/src/gs1/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./character-set-proxy.js";
2
- export * from "./check-proxy.js";
3
- export * from "./identifier-proxy.js";
1
+ export * from "./character-set-proxy";
2
+ export * from "./check-proxy";
3
+ export * from "./identifier-proxy";
package/src/index.ts CHANGED
@@ -14,12 +14,12 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- export * from "./locale/i18n.js";
18
- export * from "./types.js";
19
- export * from "./app-extension.js";
20
- export * from "./lib-proxy.js";
21
- export * from "./descriptor.js";
22
- export * from "./app-utility-proxy.js";
23
- export * from "./utility/index.js";
24
- export * as GS1 from "./gs1/index.js";
25
- export * from "./generator/index.js";
17
+ export * from "./locale/i18n";
18
+ export type * from "./type";
19
+ export * from "./app-extension";
20
+ export * from "./lib-proxy";
21
+ export * from "./descriptor";
22
+ export * from "./app-utility-proxy";
23
+ export * from "./utility/index";
24
+ export * as GS1 from "./gs1/index";
25
+ export * from "./generator/index";
package/src/lib-proxy.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { mapIterable } from "@aidc-toolkit/utility";
2
- import type { AppExtension } from "./app-extension.js";
3
- import { i18nextAppExtension } from "./locale/i18n.js";
4
- import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "./types.js";
2
+ import type { AppExtension } from "./app-extension";
3
+ import { i18nextAppExtension } from "./locale/i18n";
4
+ import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "./type";
5
5
 
6
6
  /**
7
7
  * Library proxy.
@@ -1,4 +1,4 @@
1
- export const localeStrings = {
1
+ export default {
2
2
  AppExtension: {
3
3
  sequenceCountMustBeLessThanOrEqualTo: "Sequence count {{sequenceCount, number}} must be less than or equal to {{maximumSequenceCount, number}}"
4
4
  },
@@ -1,4 +1,4 @@
1
- export const localeStrings = {
1
+ export default {
2
2
  AppExtension: {
3
3
  sequenceCountMustBeLessThanOrEqualTo: "Le nombre de séquences {{sequenceCount, number}} doit être inférieur ou égal à {{maximumSequenceCount, number}}"
4
4
  },
@@ -1,28 +1,26 @@
1
- import { i18nAssertValidResources, i18nCoreInit, type I18nEnvironment } from "@aidc-toolkit/core";
1
+ import { i18nCoreInit, type I18nEnvironment } from "@aidc-toolkit/core";
2
2
  import { gs1Resources, i18nGS1Init } from "@aidc-toolkit/gs1";
3
3
  import { i18nUtilityInit, utilityResources } from "@aidc-toolkit/utility";
4
4
  import i18next, { type i18n, type Resource } from "i18next";
5
- import { localeStrings as enLocaleStrings } from "./en/locale-strings.js";
6
- import { localeStrings as frLocaleStrings } from "./fr/locale-strings.js";
5
+ import enLocaleResources from "./en/locale-resources";
6
+ import frLocaleResources from "./fr/locale-resources";
7
7
 
8
8
  export const appExtensionNS = "aidct_app_extension";
9
9
 
10
10
  /**
11
- * Locale strings type is extracted from the English locale strings object.
11
+ * Locale resources type is extracted from the English locale resources object.
12
12
  */
13
- export type AppExtensionLocaleStrings = typeof enLocaleStrings;
14
-
15
- i18nAssertValidResources(enLocaleStrings, "fr", frLocaleStrings);
13
+ export type AppExtensionLocaleResources = typeof enLocaleResources;
16
14
 
17
15
  /**
18
16
  * App extension resources.
19
17
  */
20
18
  export const appExtensionResources: Resource = {
21
19
  en: {
22
- aidct_app_extension: enLocaleStrings
20
+ aidct_app_extension: enLocaleResources
23
21
  },
24
22
  fr: {
25
- aidct_app_extension: frLocaleStrings
23
+ aidct_app_extension: frLocaleResources
26
24
  }
27
25
  };
28
26
 
@@ -1,6 +1,6 @@
1
- import type { GS1LocaleStrings } from "@aidc-toolkit/gs1";
2
- import type { UtilityLocaleStrings } from "@aidc-toolkit/utility";
3
- import type { AppExtensionLocaleStrings } from "./i18n.js";
1
+ import type { GS1LocaleResources } from "@aidc-toolkit/gs1";
2
+ import type { UtilityLocaleResources } from "@aidc-toolkit/utility";
3
+ import type { AppExtensionLocaleResources } from "./i18n";
4
4
 
5
5
  /**
6
6
  * Internationalization module.
@@ -12,9 +12,9 @@ declare module "i18next" {
12
12
  interface CustomTypeOptions {
13
13
  defaultNS: "aidct_app_extension";
14
14
  resources: {
15
- aidct_utility: UtilityLocaleStrings;
16
- aidct_gs1: GS1LocaleStrings;
17
- aidct_app_extension: AppExtensionLocaleStrings;
15
+ aidct_utility: UtilityLocaleResources;
16
+ aidct_gs1: GS1LocaleResources;
17
+ aidct_app_extension: AppExtensionLocaleResources;
18
18
  };
19
19
  }
20
20
  }