@chesterbrains/translify-cli 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +242 -2
- package/dist/commands/init.js +140 -0
- package/dist/commands/login.js +18 -0
- package/dist/commands/publish.js +8 -0
- package/dist/commands/pull.js +114 -0
- package/dist/commands/push.js +107 -0
- package/dist/config.js +83 -0
- package/dist/confirm.js +12 -0
- package/dist/credentials.js +53 -0
- package/dist/errors.js +12 -0
- package/dist/http.js +178 -0
- package/dist/index.js +151 -0
- package/dist/patterns.js +59 -0
- package/dist/render.js +70 -0
- package/dist/version.js +3 -0
- package/package.json +43 -4
- package/schema/translify.schema.json +55 -0
package/package.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chesterbrains/translify-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Push, pull and publish Translify translations from your repository",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"translify": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"schema"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=20"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.json",
|
|
19
|
+
"prepublishOnly": "pnpm build",
|
|
20
|
+
"dev": "tsx src/index.ts",
|
|
21
|
+
"test": "vitest run",
|
|
22
|
+
"lint": "eslint .",
|
|
23
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@inquirer/prompts": "^8.7.2",
|
|
27
|
+
"commander": "^14.0.3",
|
|
28
|
+
"fast-glob": "^3.3.3",
|
|
29
|
+
"picocolors": "^1.1.1",
|
|
30
|
+
"zod": "^4.6.5"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@eslint/js": "^10.0.0",
|
|
34
|
+
"@types/node": "^20.19.43",
|
|
35
|
+
"eslint": "^10.11.0",
|
|
36
|
+
"tsx": "^4.23.15",
|
|
37
|
+
"typescript": "^6.0.3",
|
|
38
|
+
"typescript-eslint": "^8.71.0",
|
|
39
|
+
"vitest": "^4.1.11"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"packageManager": "pnpm@10.34.6"
|
|
45
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://unpkg.com/@chesterbrains/translify-cli/schema/translify.schema.json",
|
|
4
|
+
"title": "translify.json",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["apiUrl", "files"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": { "type": "string" },
|
|
10
|
+
"apiUrl": { "type": "string", "format": "uri" },
|
|
11
|
+
"files": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"items": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["pattern", "format"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"pattern": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"pattern": "\\{locale\\}",
|
|
22
|
+
"description": "Path with {locale} and optionally {namespace}, using / separators."
|
|
23
|
+
},
|
|
24
|
+
"format": { "enum": ["json", "xliff", "arb"] },
|
|
25
|
+
"namespace": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"pattern": "^[a-z0-9-]+$",
|
|
28
|
+
"maxLength": 64,
|
|
29
|
+
"description": "Fixed namespace. Required when the pattern has no {namespace}, and always for arb."
|
|
30
|
+
},
|
|
31
|
+
"jsonStyle": { "enum": ["nested", "flat"], "description": "Only for format json. Defaults to nested." }
|
|
32
|
+
},
|
|
33
|
+
"allOf": [
|
|
34
|
+
{
|
|
35
|
+
"if": { "properties": { "format": { "const": "arb" } }, "required": ["format"] },
|
|
36
|
+
"then": { "required": ["namespace"] }
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"if": { "properties": { "pattern": { "not": { "pattern": "\\{namespace\\}" } } }, "required": ["pattern"] },
|
|
40
|
+
"then": { "required": ["namespace"] }
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"if": { "properties": { "format": { "enum": ["xliff", "arb"] } }, "required": ["format"] },
|
|
44
|
+
"then": { "not": { "required": ["jsonStyle"] } }
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"locales": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"description": "Maps a filesystem locale (en_US) to a Translify code (en-US). Unmapped locales pass through.",
|
|
52
|
+
"additionalProperties": { "type": "string", "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$" }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|