Skip to content

Commit 32f101a

Browse files
committed
fix: preserve ignored keys in target files
## Changed - Ignored keys are now preserved in target files instead of being removed - Ignored keys deleted from source are still kept in target if they existed - Updated docs to reflect correct ignored keys behavior ## New - Integration tests for ignored keys across all 6 file formats - Bumped version to 1.1.1 - Updated all dependencies to latest semver-compatible versions - Lara SDK updated from 1.8.0 to 1.8.4
1 parent 33e3762 commit 32f101a

11 files changed

Lines changed: 1428 additions & 796 deletions

docs/config/files.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ files:
5353

5454
- **Type**: Array of strings (key patterns)
5555
- **Required**: No (defaults to empty array)
56-
- **Description**: Identifies keys that should be completely excluded from target files
56+
- **Description**: Identifies keys that should be left untouched in target files (not translated, not added, not removed)
5757
- **Format**: Uses glob patterns for matching keys (e.g., `internal/**`, `**/debug`)
5858

5959
## Locked vs Ignored Keys
@@ -104,11 +104,11 @@ Target file (`es.json`):
104104

105105
### Ignored Keys
106106

107-
Keys marked as ignored are **excluded** from target files entirely. Use this for:
107+
Keys marked as ignored are **left untouched** in target files. They are not translated, not added, and not removed. Use this for:
108108

109-
- Development-only messages
110-
- Internal debugging information
111-
- Keys not relevant to other locales
109+
- Development-only messages that may have been manually added to targets
110+
- Keys managed by other tools or processes
111+
- Keys not relevant to the translation workflow
112112

113113
**Example:**
114114

@@ -131,18 +131,30 @@ ignoredKeys:
131131
- "**/debug"
132132
```
133133

134-
Target file (`es.json`):
134+
Target file (`es.json`) - if `debug` was never added:
135+
136+
```json
137+
{
138+
"app": {
139+
"title": "Mi Aplicacion",
140+
"version": "1.0.0"
141+
}
142+
}
143+
```
144+
145+
Target file (`es.json`) - if `debug` already existed:
135146

136147
```json
137148
{
138149
"app": {
139-
"title": "Mi Aplicación",
150+
"title": "Mi Aplicacion",
151+
"debug": "Modo depuracion activado",
140152
"version": "1.0.0"
141153
}
142154
}
143155
```
144156

145-
Note: The `debug` key is completely omitted from the target file.
157+
Note: The `debug` key is never translated or modified by Lara. If it already exists in the target, it is preserved as-is. If it does not exist, it is not added.
146158

147159
## Path Patterns
148160

package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@translated/lara-cli",
33
"type": "module",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"description": "CLI tool for automated i18n file translation using Lara Translate",
66
"repository": {
77
"type": "git",
@@ -34,26 +34,26 @@
3434
"!build/__tests__"
3535
],
3636
"dependencies": {
37-
"@babel/parser": "^7.28.6",
38-
"@babel/traverse": "^7.28.6",
39-
"@babel/types": "^7.28.6",
37+
"@babel/parser": "^7.29.2",
38+
"@babel/traverse": "^7.29.0",
39+
"@babel/types": "^7.29.0",
4040
"@inquirer/core": "^10.3.2",
4141
"@inquirer/prompts": "^7.10.1",
42-
"@translated/lara": "^1.8.0",
43-
"commander": "^14.0.2",
44-
"dotenv": "^17.2.3",
45-
"fast-xml-parser": "^5.3.3",
42+
"@translated/lara": "^1.8.4",
43+
"commander": "^14.0.3",
44+
"dotenv": "^17.3.1",
45+
"fast-xml-parser": "^5.5.9",
4646
"flat": "^6.0.1",
4747
"gettext-parser": "^8.0.0",
4848
"glob": "^11.1.0",
4949
"ora": "^8.2.0",
50-
"picomatch": "^4.0.3",
50+
"picomatch": "^4.0.4",
5151
"remark": "^15.0.1",
5252
"remark-gfm": "^4.0.1",
53-
"string-width": "^8.1.0",
54-
"unist-util-visit": "^5.0.0",
55-
"yaml": "^2.8.2",
56-
"zod": "^4.3.5"
53+
"string-width": "^8.2.0",
54+
"unist-util-visit": "^5.1.0",
55+
"yaml": "^2.8.3",
56+
"zod": "^4.3.6"
5757
},
5858
"imports": {
5959
"#utils/*": "./build/utils/*",
@@ -73,18 +73,18 @@
7373
"test:coverage": "vitest run --coverage"
7474
},
7575
"devDependencies": {
76-
"@eslint/js": "^9.39.2",
76+
"@eslint/js": "^9.39.4",
7777
"@types/gettext-parser": "^8.0.0",
7878
"@types/mdast": "^4.0.4",
79-
"@types/node": "^24.10.8",
79+
"@types/node": "^24.12.0",
8080
"@types/picomatch": "^4.0.2",
81-
"@vitest/coverage-v8": "^4.0.17",
82-
"eslint": "^9.39.2",
81+
"@vitest/coverage-v8": "^4.1.2",
82+
"eslint": "^9.39.4",
8383
"eslint-config-prettier": "^10.1.8",
8484
"globals": "^16.5.0",
85-
"prettier": "^3.7.4",
85+
"prettier": "^3.8.1",
8686
"typescript": "^5.9.3",
87-
"typescript-eslint": "^8.53.0",
88-
"vitest": "^4.0.17"
87+
"typescript-eslint": "^8.57.2",
88+
"vitest": "^4.1.2"
8989
}
9090
}

0 commit comments

Comments
 (0)