@twin.org/merge-locales 0.0.1-next.6 → 0.0.1-next.8

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.
@@ -85,13 +85,14 @@ async function mergeLocales(workingDirectory, config) {
85
85
  }
86
86
  cliCore.CLIDisplay.break();
87
87
  const localeDictionaries = {};
88
- if (core.Is.stringValue(packageJson.name)) {
89
- await mergePackageLocales(path.join(workingDirectory, "locales"), packageJson.name, locales, localeDictionaries);
90
- }
91
88
  for (const packageName of packageNames) {
92
89
  const packageLocalDirectory = path.join(npmRoot, packageName, "locales");
93
90
  await mergePackageLocales(packageLocalDirectory, packageName, locales, localeDictionaries);
94
91
  }
92
+ // Merge the main package last so that it can override any other packages.
93
+ if (core.Is.stringValue(packageJson.name)) {
94
+ await mergePackageLocales(path.join(workingDirectory, "locales"), packageJson.name, locales, localeDictionaries);
95
+ }
95
96
  cliCore.CLIDisplay.break();
96
97
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.merge-locales.progress.writingMergedLocales"));
97
98
  for (const localeDictionary in localeDictionaries) {
@@ -165,11 +166,11 @@ class CLI extends cliCore.CLIBase {
165
166
  return this.execute({
166
167
  title: "TWIN Merge Locales",
167
168
  appName: "merge-locales",
168
- version: "0.0.1-next.6",
169
+ version: "0.0.1-next.8",
169
170
  icon: "⚙️ ",
170
171
  supportsEnvFiles: false,
171
172
  overrideOutputWidth: options?.overrideOutputWidth
172
- }, localesDirectory ?? path.join(path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))), "../locales"), argv);
173
+ }, localesDirectory ?? path.join(path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))), "../locales"), argv);
173
174
  }
174
175
  /**
175
176
  * Configure any options or actions at the root program level.
@@ -82,13 +82,14 @@ async function mergeLocales(workingDirectory, config) {
82
82
  }
83
83
  CLIDisplay.break();
84
84
  const localeDictionaries = {};
85
- if (Is.stringValue(packageJson.name)) {
86
- await mergePackageLocales(path.join(workingDirectory, "locales"), packageJson.name, locales, localeDictionaries);
87
- }
88
85
  for (const packageName of packageNames) {
89
86
  const packageLocalDirectory = path.join(npmRoot, packageName, "locales");
90
87
  await mergePackageLocales(packageLocalDirectory, packageName, locales, localeDictionaries);
91
88
  }
89
+ // Merge the main package last so that it can override any other packages.
90
+ if (Is.stringValue(packageJson.name)) {
91
+ await mergePackageLocales(path.join(workingDirectory, "locales"), packageJson.name, locales, localeDictionaries);
92
+ }
92
93
  CLIDisplay.break();
93
94
  CLIDisplay.task(I18n.formatMessage("commands.merge-locales.progress.writingMergedLocales"));
94
95
  for (const localeDictionary in localeDictionaries) {
@@ -162,7 +163,7 @@ class CLI extends CLIBase {
162
163
  return this.execute({
163
164
  title: "TWIN Merge Locales",
164
165
  appName: "merge-locales",
165
- version: "0.0.1-next.6",
166
+ version: "0.0.1-next.8",
166
167
  icon: "⚙️ ",
167
168
  supportsEnvFiles: false,
168
169
  overrideOutputWidth: options?.overrideOutputWidth
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "error": {
3
3
  "commands": {
4
- "merge-locales": {
5
- "configFailed": "Configuration failed to load."
6
- },
7
4
  "common": {
8
5
  "missingEnv": "The \"{option}\" option is configured as an environment variable, but there is no environment variable with the name \"{value}\" set.",
9
6
  "optionInvalidHex": "The \"{option}\" does not appear to be hex. \"{value}\"",
@@ -12,6 +9,9 @@
12
9
  "optionInvalidBech32": "The \"{option}\" does not appear to be bech32. \"{value}\"",
13
10
  "optionMinValue": "The \"{option}\" option must be greater than or equal to {minValue}, it is {value}.",
14
11
  "optionMaxValue": "The \"{option}\" option must be less than or equal to {maxValue}, it is {value}."
12
+ },
13
+ "merge-locales": {
14
+ "configFailed": "Configuration failed to load."
15
15
  }
16
16
  },
17
17
  "validation": {
@@ -159,31 +159,6 @@
159
159
  "invalidSeed": "The seed is invalid \"{seed}\""
160
160
  }
161
161
  },
162
- "commands": {
163
- "merge-locales": {
164
- "options": {
165
- "config": {
166
- "param": "--config '<'file'>'",
167
- "description": "Path to the JSON configuration file."
168
- }
169
- },
170
- "progress": {
171
- "loadingConfigJson": "Loading Config JSON",
172
- "creatingOutputDirectory": "Creating Output Directory",
173
- "writingMergedLocales": "Writing Merged Locales",
174
- "mergingLocalesForPackage": "Merging Locales for Package"
175
- },
176
- "labels": {
177
- "configJson": "Config JSON",
178
- "workingDirectory": "Working Directory",
179
- "outputDirectory": "Output Directory",
180
- "npmRoot": "NPM Root",
181
- "sourcePackages": "Source Packages",
182
- "writingLocale": "Writing Locale",
183
- "mergingLocale": "Merging Locale"
184
- }
185
- }
186
- },
187
162
  "cli": {
188
163
  "progress": {
189
164
  "done": "Done.",
@@ -240,5 +215,30 @@
240
215
  },
241
216
  "validation": {
242
217
  "defaultFieldName": "The field"
218
+ },
219
+ "commands": {
220
+ "merge-locales": {
221
+ "options": {
222
+ "config": {
223
+ "param": "--config '<'file'>'",
224
+ "description": "Path to the JSON configuration file."
225
+ }
226
+ },
227
+ "progress": {
228
+ "loadingConfigJson": "Loading Config JSON",
229
+ "creatingOutputDirectory": "Creating Output Directory",
230
+ "writingMergedLocales": "Writing Merged Locales",
231
+ "mergingLocalesForPackage": "Merging Locales for Package"
232
+ },
233
+ "labels": {
234
+ "configJson": "Config JSON",
235
+ "workingDirectory": "Working Directory",
236
+ "outputDirectory": "Output Directory",
237
+ "npmRoot": "NPM Root",
238
+ "sourcePackages": "Source Packages",
239
+ "writingLocale": "Writing Locale",
240
+ "mergingLocale": "Merging Locale"
241
+ }
242
+ }
243
243
  }
244
244
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/ts-to-openapi - Changelog
2
2
 
3
- ## v0.0.1-next.6
3
+ ## v0.0.1-next.8
4
4
 
5
5
  - Initial Release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/merge-locales",
3
- "version": "0.0.1-next.6",
3
+ "version": "0.0.1-next.8",
4
4
  "description": "Tool to merge locale files from all dependencies",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@twin.org/cli-core": "next",
18
18
  "@twin.org/core": "next",
19
- "@twin.org/nameof": "0.0.1-next.6",
19
+ "@twin.org/nameof": "0.0.1-next.8",
20
20
  "commander": "12.1.0",
21
21
  "glob": "11.0.0"
22
22
  },