@localess/cli 3.0.6-dev.20260512074100 → 3.0.6-dev.20260512202133
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 +14 -10
- package/SKILL.md +30 -17
- package/dist/index.mjs +5 -1
- package/dist/models/translation.zod.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -114,19 +114,20 @@ localess translations push <locale> --path <file> [options]
|
|
|
114
114
|
|
|
115
115
|
**Options:**
|
|
116
116
|
|
|
117
|
-
| Flag | Default | Description
|
|
118
|
-
|
|
119
|
-
| `-p, --path <path>` | *(required)* | Path to the JSON translations file
|
|
120
|
-
| `-f, --format <format>` | `flat` | File format: `flat` or `nested`
|
|
121
|
-
| `-t, --type <type>` | `add-missing` | Update strategy: `add-missing` or `
|
|
122
|
-
| `--dry-run` | `false` | Preview changes without applying them
|
|
117
|
+
| Flag | Default | Description |
|
|
118
|
+
|-------------------------|---------------|------------------------------------------------------------------------|
|
|
119
|
+
| `-p, --path <path>` | *(required)* | Path to the JSON translations file |
|
|
120
|
+
| `-f, --format <format>` | `flat` | File format: `flat` or `nested` |
|
|
121
|
+
| `-t, --type <type>` | `add-missing` | Update strategy: `add-missing`, `update-existing`, or `delete-missing` |
|
|
122
|
+
| `--dry-run` | `false` | Preview changes without applying them |
|
|
123
123
|
|
|
124
124
|
**Update Strategies:**
|
|
125
125
|
|
|
126
|
-
| Type | Description
|
|
127
|
-
|
|
128
|
-
| `add-missing` | Adds translations for keys that do not yet exist in Localess
|
|
129
|
-
| `update-existing` | Updates translations for keys that already exist in Localess
|
|
126
|
+
| Type | Description |
|
|
127
|
+
|-------------------|-------------------------------------------------------------------------------|
|
|
128
|
+
| `add-missing` | Adds translations for keys that do not yet exist in Localess |
|
|
129
|
+
| `update-existing` | Updates translations for keys that already exist in Localess |
|
|
130
|
+
| `delete-missing` | Deletes translations in Localess for keys that are absent from the local file |
|
|
130
131
|
|
|
131
132
|
**File Formats:**
|
|
132
133
|
|
|
@@ -155,6 +156,9 @@ localess translations push en --path ./locales/en.json
|
|
|
155
156
|
# Push with update-existing strategy
|
|
156
157
|
localess translations push en --path ./locales/en.json --type update-existing
|
|
157
158
|
|
|
159
|
+
# Delete keys in Localess absent from the local file
|
|
160
|
+
localess translations push en --path ./locales/en.json --type delete-missing
|
|
161
|
+
|
|
158
162
|
# Preview changes without applying (dry run)
|
|
159
163
|
localess translations push en --path ./locales/en.json --dry-run
|
|
160
164
|
|
package/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
`@localess/cli` is the **command-line interface** for the Localess headless CMS platform. It enables:
|
|
6
6
|
|
|
7
7
|
- Authenticating with a Localess instance
|
|
8
|
-
- Pushing and pulling translations (flat
|
|
8
|
+
- Pushing and pulling translations (flat and nested JSON formats supported for both push and pull)
|
|
9
9
|
- Generating TypeScript type definitions from the OpenAPI schema
|
|
10
10
|
|
|
11
11
|
**Status:** Early development (v3.0.1). Requires Node.js >= 20.0.0.
|
|
@@ -111,23 +111,24 @@ localess translations push <locale> --path <file> [options]
|
|
|
111
111
|
|
|
112
112
|
**Options:**
|
|
113
113
|
|
|
114
|
-
| Flag | Default
|
|
115
|
-
|
|
116
|
-
| `-p, --path <path>` | required
|
|
117
|
-
| `-f, --format <format>` | `flat`
|
|
118
|
-
| `-t, --type <type>` | `add-missing`
|
|
119
|
-
| `--dry-run` | `false`
|
|
114
|
+
| Flag | Default | Description |
|
|
115
|
+
|-------------------------|---------------|---------------------------------------------------------------------|
|
|
116
|
+
| `-p, --path <path>` | required | Path to the translations JSON file |
|
|
117
|
+
| `-f, --format <format>` | `flat` | File format: `flat` or `nested` |
|
|
118
|
+
| `-t, --type <type>` | `add-missing` | Update strategy: `add-missing`, `update-existing`, `delete-missing` |
|
|
119
|
+
| `--dry-run` | `false` | Preview changes without applying them |
|
|
120
120
|
|
|
121
121
|
**Update Strategies:**
|
|
122
122
|
|
|
123
|
-
| Strategy
|
|
124
|
-
|
|
125
|
-
| `add-missing`
|
|
126
|
-
| `update-existing`
|
|
123
|
+
| Strategy | Behaviour |
|
|
124
|
+
|-------------------|--------------------------------------------------------------------------------|
|
|
125
|
+
| `add-missing` | Only adds keys that don't yet exist in Localess |
|
|
126
|
+
| `update-existing` | Only updates keys that already exist in Localess |
|
|
127
|
+
| `delete-missing` | Deletes keys in Localess that are absent from the local file |
|
|
127
128
|
|
|
128
129
|
**File Formats:**
|
|
129
130
|
|
|
130
|
-
*Flat (default
|
|
131
|
+
*Flat (default):*
|
|
131
132
|
```json
|
|
132
133
|
{
|
|
133
134
|
"common.submit": "Submit",
|
|
@@ -136,7 +137,13 @@ localess translations push <locale> --path <file> [options]
|
|
|
136
137
|
}
|
|
137
138
|
```
|
|
138
139
|
|
|
139
|
-
|
|
140
|
+
*Nested (automatically flattened before uploading):*
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"common": { "submit": "Submit" },
|
|
144
|
+
"nav": { "home": "Home" }
|
|
145
|
+
}
|
|
146
|
+
```
|
|
140
147
|
|
|
141
148
|
**Examples:**
|
|
142
149
|
|
|
@@ -147,8 +154,14 @@ localess translations push en --path ./locales/en.json
|
|
|
147
154
|
# Update existing translations (don't add new)
|
|
148
155
|
localess translations push de --path ./locales/de.json --type update-existing
|
|
149
156
|
|
|
157
|
+
# Delete keys in Localess absent from the local file
|
|
158
|
+
localess translations push de --path ./locales/de.json --type delete-missing
|
|
159
|
+
|
|
150
160
|
# Preview changes without applying
|
|
151
161
|
localess translations push fr --path ./locales/fr.json --dry-run
|
|
162
|
+
|
|
163
|
+
# Push nested-format translations
|
|
164
|
+
localess translations push de --path ./locales/de.json --format nested
|
|
152
165
|
```
|
|
153
166
|
|
|
154
167
|
---
|
|
@@ -169,10 +182,10 @@ localess translations pull <locale> --path <file> [options]
|
|
|
169
182
|
|
|
170
183
|
**Options:**
|
|
171
184
|
|
|
172
|
-
| Flag | Default | Description
|
|
173
|
-
|
|
174
|
-
| `-p, --path <path>` | required | Output file path
|
|
175
|
-
| `-f, --format <format>` | `flat` | File format: `flat` or `nested`
|
|
185
|
+
| Flag | Default | Description |
|
|
186
|
+
|-------------------------|-----------|---------------------------------|
|
|
187
|
+
| `-p, --path <path>` | required | Output file path |
|
|
188
|
+
| `-f, --format <format>` | `flat` | File format: `flat` or `nested` |
|
|
176
189
|
|
|
177
190
|
**Examples:**
|
|
178
191
|
|
package/dist/index.mjs
CHANGED
|
@@ -359,7 +359,11 @@ var j = new e("login").description("Login to Localess CLI").option("-o, --origin
|
|
|
359
359
|
await w(t.path, JSON.stringify(e, null, 2));
|
|
360
360
|
}
|
|
361
361
|
console.log("Successfully saved translations from Localess");
|
|
362
|
-
}), R = f.record(f.string(), f.string()), z = f.enum([
|
|
362
|
+
}), R = f.record(f.string(), f.string()), z = f.enum([
|
|
363
|
+
"add-missing",
|
|
364
|
+
"update-existing",
|
|
365
|
+
"delete-missing"
|
|
366
|
+
]);
|
|
363
367
|
f.object({
|
|
364
368
|
type: z,
|
|
365
369
|
values: R
|
|
@@ -3,11 +3,13 @@ export declare const zLocaleTranslationsSchema: z.ZodRecord<z.ZodString, z.ZodSt
|
|
|
3
3
|
export declare const zTranslationUpdateTypeSchema: z.ZodEnum<{
|
|
4
4
|
"add-missing": "add-missing";
|
|
5
5
|
"update-existing": "update-existing";
|
|
6
|
+
"delete-missing": "delete-missing";
|
|
6
7
|
}>;
|
|
7
8
|
export declare const zTranslationUpdateSchema: z.ZodObject<{
|
|
8
9
|
type: z.ZodEnum<{
|
|
9
10
|
"add-missing": "add-missing";
|
|
10
11
|
"update-existing": "update-existing";
|
|
12
|
+
"delete-missing": "delete-missing";
|
|
11
13
|
}>;
|
|
12
14
|
values: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
13
15
|
}, z.core.$strip>;
|