@twin.org/validate-locales 0.0.3-next.21 → 0.0.3-next.23

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
@@ -1,16 +1,16 @@
1
1
  # TWIN Validate Locales
2
2
 
3
- This tool will read the source files and validate the usage of the locales.
3
+ This application is part of the framework workspace and provides validate source files against the locales to support consistent development workflows across the ecosystem.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```shell
8
- npm install @twin.org/validate-locales
8
+ npm install -D @twin.org/validate-locales
9
9
  ```
10
10
 
11
- ## Examples
11
+ ## Usage
12
12
 
13
- Usage of the tool is shown in the examples [docs/examples.md](docs/examples.md)
13
+ Usage of the tool is shown in the examples [docs/usage.md](docs/usage.md)
14
14
 
15
15
  ## Reference
16
16
 
package/dist/es/cli.js CHANGED
@@ -20,7 +20,7 @@ export class CLI extends CLIBase {
20
20
  return this.execute({
21
21
  title: "TWIN Validate Locales",
22
22
  appName: "validate-locales",
23
- version: "0.0.3-next.21", // x-release-please-version
23
+ version: "0.0.3-next.23", // x-release-please-version
24
24
  icon: "⚙️ ",
25
25
  supportsEnvFiles: false,
26
26
  overrideOutputWidth: options?.overrideOutputWidth
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;GAEG;AACH,MAAM,OAAO,GAAI,SAAQ,OAAO;IAC/B;;;;;;;OAOG;IACI,KAAK,CAAC,GAAG,CACf,IAAc,EACd,gBAAyB,EACzB,OAA0C;QAE1C,OAAO,IAAI,CAAC,OAAO,CAClB;YACC,KAAK,EAAE,uBAAuB;YAC9B,OAAO,EAAE,kBAAkB;YAC3B,OAAO,EAAE,eAAe,EAAE,2BAA2B;YACrD,IAAI,EAAE,KAAK;YACX,gBAAgB,EAAE,KAAK;YACvB,mBAAmB,EAAE,OAAO,EAAE,mBAAmB;SACjD,EACD,gBAAgB,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,EACzF,IAAI,CACJ,CAAC;IACH,CAAC;IAED;;;OAGG;IACO,aAAa,CAAC,OAAgB;QACvC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { CLIBase } from \"@twin.org/cli-core\";\nimport type { Command } from \"commander\";\nimport { buildCommandValidateLocales } from \"./commands/validateLocales.js\";\n\n/**\n * The main entry point for the CLI.\n */\nexport class CLI extends CLIBase {\n\t/**\n\t * Run the app.\n\t * @param argv The process arguments.\n\t * @param localesDirectory The directory for the locales, default to relative to the script.\n\t * @param options Additional options.\n\t * @param options.overrideOutputWidth Override the output width.\n\t * @returns The exit code.\n\t */\n\tpublic async run(\n\t\targv: string[],\n\t\tlocalesDirectory?: string,\n\t\toptions?: { overrideOutputWidth?: number }\n\t): Promise<number> {\n\t\treturn this.execute(\n\t\t\t{\n\t\t\t\ttitle: \"TWIN Validate Locales\",\n\t\t\t\tappName: \"validate-locales\",\n\t\t\t\tversion: \"0.0.3-next.21\", // x-release-please-version\n\t\t\t\ticon: \"⚙️ \",\n\t\t\t\tsupportsEnvFiles: false,\n\t\t\t\toverrideOutputWidth: options?.overrideOutputWidth\n\t\t\t},\n\t\t\tlocalesDirectory ?? path.join(path.dirname(fileURLToPath(import.meta.url)), \"../locales\"),\n\t\t\targv\n\t\t);\n\t}\n\n\t/**\n\t * Configure any options or actions at the root program level.\n\t * @param program The root program command.\n\t */\n\tprotected configureRoot(program: Command): void {\n\t\tbuildCommandValidateLocales(program);\n\t}\n}\n"]}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;GAEG;AACH,MAAM,OAAO,GAAI,SAAQ,OAAO;IAC/B;;;;;;;OAOG;IACI,KAAK,CAAC,GAAG,CACf,IAAc,EACd,gBAAyB,EACzB,OAA0C;QAE1C,OAAO,IAAI,CAAC,OAAO,CAClB;YACC,KAAK,EAAE,uBAAuB;YAC9B,OAAO,EAAE,kBAAkB;YAC3B,OAAO,EAAE,eAAe,EAAE,2BAA2B;YACrD,IAAI,EAAE,KAAK;YACX,gBAAgB,EAAE,KAAK;YACvB,mBAAmB,EAAE,OAAO,EAAE,mBAAmB;SACjD,EACD,gBAAgB,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,EACzF,IAAI,CACJ,CAAC;IACH,CAAC;IAED;;;OAGG;IACO,aAAa,CAAC,OAAgB;QACvC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { CLIBase } from \"@twin.org/cli-core\";\nimport type { Command } from \"commander\";\nimport { buildCommandValidateLocales } from \"./commands/validateLocales.js\";\n\n/**\n * The main entry point for the CLI.\n */\nexport class CLI extends CLIBase {\n\t/**\n\t * Run the app.\n\t * @param argv The process arguments.\n\t * @param localesDirectory The directory for the locales, default to relative to the script.\n\t * @param options Additional options.\n\t * @param options.overrideOutputWidth Override the output width.\n\t * @returns The exit code.\n\t */\n\tpublic async run(\n\t\targv: string[],\n\t\tlocalesDirectory?: string,\n\t\toptions?: { overrideOutputWidth?: number }\n\t): Promise<number> {\n\t\treturn this.execute(\n\t\t\t{\n\t\t\t\ttitle: \"TWIN Validate Locales\",\n\t\t\t\tappName: \"validate-locales\",\n\t\t\t\tversion: \"0.0.3-next.23\", // x-release-please-version\n\t\t\t\ticon: \"⚙️ \",\n\t\t\t\tsupportsEnvFiles: false,\n\t\t\t\toverrideOutputWidth: options?.overrideOutputWidth\n\t\t\t},\n\t\t\tlocalesDirectory ?? path.join(path.dirname(fileURLToPath(import.meta.url)), \"../locales\"),\n\t\t\targv\n\t\t);\n\t}\n\n\t/**\n\t * Configure any options or actions at the root program level.\n\t * @param program The root program command.\n\t */\n\tprotected configureRoot(program: Command): void {\n\t\tbuildCommandValidateLocales(program);\n\t}\n}\n"]}
package/docs/changelog.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.23](https://github.com/twinfoundation/framework/compare/validate-locales-v0.0.3-next.22...validate-locales-v0.0.3-next.23) (2026-03-17)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **validate-locales:** Synchronize repo versions
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/cli-core bumped from 0.0.3-next.22 to 0.0.3-next.23
16
+ * @twin.org/core bumped from 0.0.3-next.22 to 0.0.3-next.23
17
+ * @twin.org/nameof bumped from 0.0.3-next.22 to 0.0.3-next.23
18
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.22 to 0.0.3-next.23
19
+ * devDependencies
20
+ * @twin.org/merge-locales bumped from 0.0.3-next.22 to 0.0.3-next.23
21
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.22 to 0.0.3-next.23
22
+
23
+ ## [0.0.3-next.22](https://github.com/twinfoundation/framework/compare/validate-locales-v0.0.3-next.21...validate-locales-v0.0.3-next.22) (2026-02-26)
24
+
25
+
26
+ ### Miscellaneous Chores
27
+
28
+ * **validate-locales:** Synchronize repo versions
29
+
30
+
31
+ ### Dependencies
32
+
33
+ * The following workspace dependencies were updated
34
+ * dependencies
35
+ * @twin.org/cli-core bumped from 0.0.3-next.21 to 0.0.3-next.22
36
+ * @twin.org/core bumped from 0.0.3-next.21 to 0.0.3-next.22
37
+ * @twin.org/nameof bumped from 0.0.3-next.21 to 0.0.3-next.22
38
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.21 to 0.0.3-next.22
39
+ * devDependencies
40
+ * @twin.org/merge-locales bumped from 0.0.3-next.21 to 0.0.3-next.22
41
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.21 to 0.0.3-next.22
42
+
3
43
  ## [0.0.3-next.21](https://github.com/twinfoundation/framework/compare/validate-locales-v0.0.3-next.20...validate-locales-v0.0.3-next.21) (2026-02-26)
4
44
 
5
45
 
@@ -478,4 +518,4 @@
478
518
  * devDependencies
479
519
  * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.20 to 0.0.2-next.21
480
520
 
481
- ## @twin.org/validate-locales - Changelog
521
+ ## Changelog
@@ -22,7 +22,71 @@ The main entry point for the CLI.
22
22
 
23
23
  ## Methods
24
24
 
25
- ### run()
25
+ ### execute() {#execute}
26
+
27
+ > **execute**(`options`, `localesDirectory`, `argv`): `Promise`\<`number`\>
28
+
29
+ Execute the command line processing.
30
+
31
+ #### Parameters
32
+
33
+ ##### options
34
+
35
+ `ICliOptions`
36
+
37
+ The options for the CLI.
38
+
39
+ ##### localesDirectory
40
+
41
+ `string`
42
+
43
+ The path to load the locales from.
44
+
45
+ ##### argv
46
+
47
+ `string`[]
48
+
49
+ The process arguments.
50
+
51
+ #### Returns
52
+
53
+ `Promise`\<`number`\>
54
+
55
+ The exit code.
56
+
57
+ #### Inherited from
58
+
59
+ `CLIBase.execute`
60
+
61
+ ***
62
+
63
+ ### getCommands() {#getcommands}
64
+
65
+ > `protected` **getCommands**(`program`): `Command`[]
66
+
67
+ Get the commands for the CLI, override in derived class to supply your own.
68
+
69
+ #### Parameters
70
+
71
+ ##### program
72
+
73
+ `Command`
74
+
75
+ The main program that the commands will be added to.
76
+
77
+ #### Returns
78
+
79
+ `Command`[]
80
+
81
+ The commands for the CLI.
82
+
83
+ #### Inherited from
84
+
85
+ `CLIBase.getCommands`
86
+
87
+ ***
88
+
89
+ ### run() {#run}
26
90
 
27
91
  > **run**(`argv`, `localesDirectory?`, `options?`): `Promise`\<`number`\>
28
92
 
@@ -60,7 +124,7 @@ The exit code.
60
124
 
61
125
  ***
62
126
 
63
- ### configureRoot()
127
+ ### configureRoot() {#configureroot}
64
128
 
65
129
  > `protected` **configureRoot**(`program`): `void`
66
130
 
package/docs/usage.md ADDED
@@ -0,0 +1,35 @@
1
+ # Validate Locales Usage
2
+
3
+ Use this page to confirm validation options before scanning source files.
4
+
5
+ ## Running
6
+
7
+ To install and run the CLI locally use the following commands:
8
+
9
+ ```shell
10
+ npm install @twin.org/validate-locales -g
11
+ validate-locales
12
+ ```
13
+
14
+ or run directly using NPX:
15
+
16
+ ```shell
17
+ npx "@twin.org/validate-locales"
18
+ ```
19
+
20
+ ## Help
21
+
22
+ ```shell
23
+ validate-locales --help
24
+
25
+ Usage: validate-locales [options]
26
+
27
+ Options:
28
+ --cwd <path> Current working directory to scan. (default: ".")
29
+ --source-glob <glob> Glob for source files to validate.
30
+ --locale-file <path> Locale dictionary file to validate against.
31
+ --ignore-key-pattern <pattern> Regex pattern for keys to ignore.
32
+ --report-unused Include unused locale keys in the report.
33
+ --lang <lang> The language to display the output in. (default: "en")
34
+ -h, --help display help for command
35
+ ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@twin.org/validate-locales",
3
- "version": "0.0.3-next.21",
4
- "description": "Tool to validate source files against the locales",
3
+ "version": "0.0.3-next.23",
4
+ "description": "Validate source files against the locales",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/twinfoundation/framework.git",
@@ -14,12 +14,12 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/cli-core": "0.0.3-next.21",
18
- "@twin.org/core": "0.0.3-next.21",
19
- "@twin.org/nameof": "0.0.3-next.21",
20
- "@twin.org/nameof-transformer": "0.0.3-next.21",
21
- "commander": "14.0.2",
22
- "glob": "11.0.3",
17
+ "@twin.org/cli-core": "0.0.3-next.23",
18
+ "@twin.org/core": "0.0.3-next.23",
19
+ "@twin.org/nameof": "0.0.3-next.23",
20
+ "@twin.org/nameof-transformer": "0.0.3-next.23",
21
+ "commander": "14.0.3",
22
+ "glob": "13.0.6",
23
23
  "typescript": "5.9.3"
24
24
  },
25
25
  "main": "./dist/es/index.js",
package/docs/examples.md DELETED
@@ -1,15 +0,0 @@
1
- # @twin.org/validate-locales - Examples
2
-
3
- ## Command Line Tool
4
-
5
- First install the tool with the following script.
6
-
7
- ```shell
8
- npm install @twin.org/validate-locales
9
- ```
10
-
11
- You can then run the tool from the command line e.g.
12
-
13
- ```shell
14
- validate-locales
15
- ```