@vocab/cli 2.1.8 → 2.1.9
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/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -25,8 +25,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
}) : target, mod));
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
|
-
let
|
|
29
|
-
let
|
|
28
|
+
let _vocab_phrase = require("@vocab/phrase");
|
|
29
|
+
let _vocab_core = require("@vocab/core");
|
|
30
30
|
let yargs = require("yargs");
|
|
31
31
|
yargs = __toESM(yargs);
|
|
32
32
|
let env_ci = require("env-ci");
|
|
@@ -50,7 +50,7 @@ let config = null;
|
|
|
50
50
|
type: "string",
|
|
51
51
|
describe: "Path to config file"
|
|
52
52
|
}).middleware(async ({ config: configPath }) => {
|
|
53
|
-
config = await (0,
|
|
53
|
+
config = await (0, _vocab_core.resolveConfig)(configPath);
|
|
54
54
|
console.log("Loaded config from", configPath || process.cwd());
|
|
55
55
|
}).command({
|
|
56
56
|
command: "push",
|
|
@@ -64,7 +64,7 @@ let config = null;
|
|
|
64
64
|
ignore: ignorePathDefinition
|
|
65
65
|
}),
|
|
66
66
|
handler: async (options) => {
|
|
67
|
-
await (0,
|
|
67
|
+
await (0, _vocab_phrase.push)(options, config);
|
|
68
68
|
}
|
|
69
69
|
}).command({
|
|
70
70
|
command: "pull",
|
|
@@ -77,7 +77,7 @@ let config = null;
|
|
|
77
77
|
}
|
|
78
78
|
}),
|
|
79
79
|
handler: async (options) => {
|
|
80
|
-
await (0,
|
|
80
|
+
await (0, _vocab_phrase.pull)(options, config);
|
|
81
81
|
}
|
|
82
82
|
}).command({
|
|
83
83
|
command: "compile",
|
|
@@ -86,12 +86,12 @@ let config = null;
|
|
|
86
86
|
default: false
|
|
87
87
|
} }),
|
|
88
88
|
handler: async ({ watch }) => {
|
|
89
|
-
await (0,
|
|
89
|
+
await (0, _vocab_core.compile)({ watch }, config);
|
|
90
90
|
}
|
|
91
91
|
}).command({
|
|
92
92
|
command: "validate",
|
|
93
93
|
handler: async () => {
|
|
94
|
-
if (!await (0,
|
|
94
|
+
if (!await (0, _vocab_core.validate)(config)) throw new Error("Project invalid");
|
|
95
95
|
}
|
|
96
96
|
}).help().wrap(72).parse();
|
|
97
97
|
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["config: UserConfig | null","yargs"],"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { pull, push } from '@vocab/phrase';\nimport { type UserConfig, resolveConfig, compile, validate } from '@vocab/core';\nimport yargsCli from 'yargs';\n\nimport envCi from 'env-ci';\n\nconst { branch } = envCi();\n\nconst branchDefinition = {\n type: 'string',\n describe: 'The Phrase branch to target',\n default: branch || 'local-development',\n} as const;\n\nconst ignorePathDefinition = {\n type: 'string',\n array: true,\n describe: 'Array of glob paths to ignore when searching for keys to push',\n default: [] as string[],\n} as const;\n\nlet config: UserConfig | null = null;\n\nyargsCli(process.argv.slice(2))\n .scriptName('vocab')\n .option('config', {\n type: 'string',\n describe: 'Path to config file',\n })\n .middleware(async ({ config: configPath }) => {\n config = await resolveConfig(configPath);\n console.log('Loaded config from', configPath || process.cwd());\n })\n .command({\n command: 'push',\n builder: (yargs) =>\n yargs.options({\n branch: branchDefinition,\n 'delete-unused-keys': {\n type: 'boolean',\n describe: 'Whether or not to delete unused keys after pushing',\n default: false,\n },\n ignore: ignorePathDefinition,\n }),\n handler: async (options) => {\n await push(options, config!);\n },\n })\n .command({\n command: 'pull',\n builder: (yargs) =>\n yargs.options({\n branch: branchDefinition,\n 'error-on-no-global-key-translation': {\n type: 'boolean',\n describe:\n 'Throw an error when there is no translation for a global key',\n default: false,\n },\n }),\n handler: async (options) => {\n await pull(options, config!);\n },\n })\n .command({\n command: 'compile',\n builder: (yargs) =>\n yargs.options({\n watch: { type: 'boolean', default: false },\n }),\n handler: async ({ watch }) => {\n await compile({ watch }, config!);\n },\n })\n .command({\n command: 'validate',\n handler: async () => {\n const valid = await validate(config!);\n\n if (!valid) {\n throw new Error('Project invalid');\n }\n },\n })\n .help()\n .wrap(72)\n .parse();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,EAAE,gCAAkB;AAE1B,MAAM,mBAAmB;CACvB,MAAM;CACN,UAAU;CACV,SAAS,UAAU;CACpB;AAED,MAAM,uBAAuB;CAC3B,MAAM;CACN,OAAO;CACP,UAAU;CACV,SAAS,EAAE;CACZ;AAED,IAAIA,SAA4B;mBAEvB,QAAQ,KAAK,MAAM,EAAE,CAAC,CAC5B,WAAW,QAAQ,CACnB,OAAO,UAAU;CAChB,MAAM;CACN,UAAU;CACX,CAAC,CACD,WAAW,OAAO,EAAE,QAAQ,iBAAiB;AAC5C,UAAS,
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["config: UserConfig | null","yargs"],"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { pull, push } from '@vocab/phrase';\nimport { type UserConfig, resolveConfig, compile, validate } from '@vocab/core';\nimport yargsCli from 'yargs';\n\nimport envCi from 'env-ci';\n\nconst { branch } = envCi();\n\nconst branchDefinition = {\n type: 'string',\n describe: 'The Phrase branch to target',\n default: branch || 'local-development',\n} as const;\n\nconst ignorePathDefinition = {\n type: 'string',\n array: true,\n describe: 'Array of glob paths to ignore when searching for keys to push',\n default: [] as string[],\n} as const;\n\nlet config: UserConfig | null = null;\n\nyargsCli(process.argv.slice(2))\n .scriptName('vocab')\n .option('config', {\n type: 'string',\n describe: 'Path to config file',\n })\n .middleware(async ({ config: configPath }) => {\n config = await resolveConfig(configPath);\n console.log('Loaded config from', configPath || process.cwd());\n })\n .command({\n command: 'push',\n builder: (yargs) =>\n yargs.options({\n branch: branchDefinition,\n 'delete-unused-keys': {\n type: 'boolean',\n describe: 'Whether or not to delete unused keys after pushing',\n default: false,\n },\n ignore: ignorePathDefinition,\n }),\n handler: async (options) => {\n await push(options, config!);\n },\n })\n .command({\n command: 'pull',\n builder: (yargs) =>\n yargs.options({\n branch: branchDefinition,\n 'error-on-no-global-key-translation': {\n type: 'boolean',\n describe:\n 'Throw an error when there is no translation for a global key',\n default: false,\n },\n }),\n handler: async (options) => {\n await pull(options, config!);\n },\n })\n .command({\n command: 'compile',\n builder: (yargs) =>\n yargs.options({\n watch: { type: 'boolean', default: false },\n }),\n handler: async ({ watch }) => {\n await compile({ watch }, config!);\n },\n })\n .command({\n command: 'validate',\n handler: async () => {\n const valid = await validate(config!);\n\n if (!valid) {\n throw new Error('Project invalid');\n }\n },\n })\n .help()\n .wrap(72)\n .parse();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,EAAE,gCAAkB;AAE1B,MAAM,mBAAmB;CACvB,MAAM;CACN,UAAU;CACV,SAAS,UAAU;CACpB;AAED,MAAM,uBAAuB;CAC3B,MAAM;CACN,OAAO;CACP,UAAU;CACV,SAAS,EAAE;CACZ;AAED,IAAIA,SAA4B;mBAEvB,QAAQ,KAAK,MAAM,EAAE,CAAC,CAC5B,WAAW,QAAQ,CACnB,OAAO,UAAU;CAChB,MAAM;CACN,UAAU;CACX,CAAC,CACD,WAAW,OAAO,EAAE,QAAQ,iBAAiB;AAC5C,UAAS,qCAAoB,WAAW;AACxC,SAAQ,IAAI,sBAAsB,cAAc,QAAQ,KAAK,CAAC;EAC9D,CACD,QAAQ;CACP,SAAS;CACT,UAAU,YACRC,QAAM,QAAQ;EACZ,QAAQ;EACR,sBAAsB;GACpB,MAAM;GACN,UAAU;GACV,SAAS;GACV;EACD,QAAQ;EACT,CAAC;CACJ,SAAS,OAAO,YAAY;AAC1B,gCAAW,SAAS,OAAQ;;CAE/B,CAAC,CACD,QAAQ;CACP,SAAS;CACT,UAAU,YACRA,QAAM,QAAQ;EACZ,QAAQ;EACR,sCAAsC;GACpC,MAAM;GACN,UACE;GACF,SAAS;GACV;EACF,CAAC;CACJ,SAAS,OAAO,YAAY;AAC1B,gCAAW,SAAS,OAAQ;;CAE/B,CAAC,CACD,QAAQ;CACP,SAAS;CACT,UAAU,YACRA,QAAM,QAAQ,EACZ,OAAO;EAAE,MAAM;EAAW,SAAS;EAAO,EAC3C,CAAC;CACJ,SAAS,OAAO,EAAE,YAAY;AAC5B,iCAAc,EAAE,OAAO,EAAE,OAAQ;;CAEpC,CAAC,CACD,QAAQ;CACP,SAAS;CACT,SAAS,YAAY;AAGnB,MAAI,CAFU,gCAAe,OAAQ,CAGnC,OAAM,IAAI,MAAM,kBAAkB;;CAGvC,CAAC,CACD,MAAM,CACN,KAAK,GAAG,CACR,OAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vocab/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/seek-oss/vocab.git",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"env-ci": "^7.3.0",
|
|
26
26
|
"yargs": "^17.7.2",
|
|
27
|
-
"@vocab/core": "^1.7.
|
|
28
|
-
"@vocab/phrase": "^2.1.
|
|
27
|
+
"@vocab/core": "^1.7.5",
|
|
28
|
+
"@vocab/phrase": "^2.1.9"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/env-ci": "^3.1.0",
|