@vocab/cli 0.0.0-tags-support-2023185232 → 0.0.0-tsdown-20250922064402

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 ADDED
@@ -0,0 +1,21 @@
1
+ ### MIT License
2
+
3
+ Copyright (c) 2020 SEEK
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ export { };
package/dist/index.js ADDED
@@ -0,0 +1,97 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+
23
+ //#endregion
24
+ let __vocab_phrase = require("@vocab/phrase");
25
+ __vocab_phrase = __toESM(__vocab_phrase);
26
+ let __vocab_core = require("@vocab/core");
27
+ __vocab_core = __toESM(__vocab_core);
28
+ let yargs = require("yargs");
29
+ yargs = __toESM(yargs);
30
+ let env_ci = require("env-ci");
31
+ env_ci = __toESM(env_ci);
32
+
33
+ //#region src/index.ts
34
+ const { branch } = (0, env_ci.default)();
35
+ const branchDefinition = {
36
+ type: "string",
37
+ describe: "The Phrase branch to target",
38
+ default: branch || "local-development"
39
+ };
40
+ const ignorePathDefinition = {
41
+ type: "string",
42
+ array: true,
43
+ describe: "Array of glob paths to ignore when searching for keys to push",
44
+ default: []
45
+ };
46
+ let config = null;
47
+ (0, yargs.default)(process.argv.slice(2)).scriptName("vocab").option("config", {
48
+ type: "string",
49
+ describe: "Path to config file"
50
+ }).middleware(async ({ config: configPath }) => {
51
+ config = await (0, __vocab_core.resolveConfig)(configPath);
52
+ console.log("Loaded config from", configPath || process.cwd());
53
+ }).command({
54
+ command: "push",
55
+ builder: (yargs$1) => yargs$1.options({
56
+ branch: branchDefinition,
57
+ "delete-unused-keys": {
58
+ type: "boolean",
59
+ describe: "Whether or not to delete unused keys after pushing",
60
+ default: false
61
+ },
62
+ ignore: ignorePathDefinition
63
+ }),
64
+ handler: async (options) => {
65
+ await (0, __vocab_phrase.push)(options, config);
66
+ }
67
+ }).command({
68
+ command: "pull",
69
+ builder: (yargs$1) => yargs$1.options({
70
+ branch: branchDefinition,
71
+ "error-on-no-global-key-translation": {
72
+ type: "boolean",
73
+ describe: "Throw an error when there is no translation for a global key",
74
+ default: false
75
+ }
76
+ }),
77
+ handler: async (options) => {
78
+ await (0, __vocab_phrase.pull)(options, config);
79
+ }
80
+ }).command({
81
+ command: "compile",
82
+ builder: (yargs$1) => yargs$1.options({ watch: {
83
+ type: "boolean",
84
+ default: false
85
+ } }),
86
+ handler: async ({ watch }) => {
87
+ await (0, __vocab_core.compile)({ watch }, config);
88
+ }
89
+ }).command({
90
+ command: "validate",
91
+ handler: async () => {
92
+ if (!await (0, __vocab_core.validate)(config)) throw new Error("Project invalid");
93
+ }
94
+ }).help().wrap(72).argv;
95
+
96
+ //#endregion
97
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","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\n// eslint-disable-next-line @typescript-eslint/no-unused-expressions\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).argv;\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;mBAGvB,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,sCAAoB,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,iCAAW,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,iCAAW,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,kCAAc,EAAE,OAAO,EAAE,OAAQ;;CAEpC,CAAC,CACD,QAAQ;CACP,SAAS;CACT,SAAS,YAAY;AAGnB,MAAI,CAFU,iCAAe,OAAQ,CAGnC,OAAM,IAAI,MAAM,kBAAkB;;CAGvC,CAAC,CACD,MAAM,CACN,KAAK,GAAG,CAAC"}
package/package.json CHANGED
@@ -1,8 +1,17 @@
1
1
  {
2
2
  "name": "@vocab/cli",
3
- "version": "0.0.0-tags-support-2023185232",
4
- "main": "dist/vocab-cli.cjs.js",
5
- "module": "dist/vocab-cli.esm.js",
3
+ "version": "0.0.0-tsdown-20250922064402",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/seek-oss/vocab.git",
7
+ "directory": "packages/cli"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": "./dist/index.js",
13
+ "./package.json": "./package.json"
14
+ },
6
15
  "bin": {
7
16
  "vocab": "bin.js"
8
17
  },
@@ -13,19 +22,14 @@
13
22
  "author": "SEEK",
14
23
  "license": "MIT",
15
24
  "dependencies": {
16
- "@types/env-ci": "^3.1.0",
17
- "@vocab/core": "^0.0.0-tags-support-2023185232",
18
- "@vocab/phrase": "^0.0.0-tags-support-2023185232",
19
- "env-ci": "^5.0.2",
25
+ "env-ci": "^7.3.0",
20
26
  "fast-glob": "^3.2.4",
21
- "form-data": "^3.0.0",
22
- "node-fetch": "^2.6.1",
23
- "prettier": "^2.1.2",
24
- "yargs": "^16.1.0"
27
+ "yargs": "^17.7.2",
28
+ "@vocab/core": "^0.0.0-tsdown-20250922064402",
29
+ "@vocab/phrase": "^0.0.0-tsdown-20250922064402"
25
30
  },
26
31
  "devDependencies": {
27
- "@types/node-fetch": "^2.5.7",
28
- "@types/prettier": "^2.1.5",
29
- "@types/yargs": "^15.0.9"
32
+ "@types/env-ci": "^3.1.0",
33
+ "@types/yargs": "^17.0.32"
30
34
  }
31
- }
35
+ }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from "./declarations/src/index";
@@ -1,77 +0,0 @@
1
- 'use strict';
2
-
3
- var phrase = require('@vocab/phrase');
4
- var core = require('@vocab/core');
5
- var yargs = require('yargs');
6
- var envCi = require('env-ci');
7
-
8
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
9
-
10
- var yargs__default = /*#__PURE__*/_interopDefault(yargs);
11
- var envCi__default = /*#__PURE__*/_interopDefault(envCi);
12
-
13
- /* eslint-disable no-console */
14
- const {
15
- branch
16
- } = envCi__default['default']();
17
- const branchDefinition = {
18
- type: 'string',
19
- describe: 'The Phrase branch to target',
20
- default: branch || 'local-development'
21
- };
22
- let config = null; // eslint-disable-next-line @typescript-eslint/no-unused-expressions
23
-
24
- yargs__default['default'](process.argv.slice(2)).scriptName('vocab').option('config', {
25
- type: 'string',
26
- describe: 'Path to config file'
27
- }).middleware(async ({
28
- config: configPath
29
- }) => {
30
- config = await core.resolveConfig(configPath);
31
- console.log('Loaded config from', configPath || process.cwd());
32
- }).command({
33
- command: 'push',
34
- builder: () => yargs__default['default'].options({
35
- branch: branchDefinition,
36
- 'delete-unused-keys': {
37
- type: 'boolean',
38
- describe: 'Whether or not to delete unused keys after pushing',
39
- default: false
40
- }
41
- }),
42
- handler: async options => {
43
- await phrase.push(options, config);
44
- }
45
- }).command({
46
- command: 'pull',
47
- builder: () => yargs__default['default'].options({
48
- branch: branchDefinition
49
- }),
50
- handler: async options => {
51
- await phrase.pull(options, config);
52
- }
53
- }).command({
54
- command: 'compile',
55
- builder: () => yargs__default['default'].options({
56
- watch: {
57
- type: 'boolean',
58
- default: false
59
- }
60
- }),
61
- handler: async ({
62
- watch
63
- }) => {
64
- await core.compile({
65
- watch
66
- }, config);
67
- }
68
- }).command({
69
- command: 'validate',
70
- handler: async () => {
71
- const valid = await core.validate(config);
72
-
73
- if (!valid) {
74
- throw new Error('Project invalid');
75
- }
76
- }
77
- }).help().wrap(72).argv;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- if (process.env.NODE_ENV === "production") {
4
- module.exports = require("./vocab-cli.cjs.prod.js");
5
- } else {
6
- module.exports = require("./vocab-cli.cjs.dev.js");
7
- }
@@ -1,77 +0,0 @@
1
- 'use strict';
2
-
3
- var phrase = require('@vocab/phrase');
4
- var core = require('@vocab/core');
5
- var yargs = require('yargs');
6
- var envCi = require('env-ci');
7
-
8
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
9
-
10
- var yargs__default = /*#__PURE__*/_interopDefault(yargs);
11
- var envCi__default = /*#__PURE__*/_interopDefault(envCi);
12
-
13
- /* eslint-disable no-console */
14
- const {
15
- branch
16
- } = envCi__default['default']();
17
- const branchDefinition = {
18
- type: 'string',
19
- describe: 'The Phrase branch to target',
20
- default: branch || 'local-development'
21
- };
22
- let config = null; // eslint-disable-next-line @typescript-eslint/no-unused-expressions
23
-
24
- yargs__default['default'](process.argv.slice(2)).scriptName('vocab').option('config', {
25
- type: 'string',
26
- describe: 'Path to config file'
27
- }).middleware(async ({
28
- config: configPath
29
- }) => {
30
- config = await core.resolveConfig(configPath);
31
- console.log('Loaded config from', configPath || process.cwd());
32
- }).command({
33
- command: 'push',
34
- builder: () => yargs__default['default'].options({
35
- branch: branchDefinition,
36
- 'delete-unused-keys': {
37
- type: 'boolean',
38
- describe: 'Whether or not to delete unused keys after pushing',
39
- default: false
40
- }
41
- }),
42
- handler: async options => {
43
- await phrase.push(options, config);
44
- }
45
- }).command({
46
- command: 'pull',
47
- builder: () => yargs__default['default'].options({
48
- branch: branchDefinition
49
- }),
50
- handler: async options => {
51
- await phrase.pull(options, config);
52
- }
53
- }).command({
54
- command: 'compile',
55
- builder: () => yargs__default['default'].options({
56
- watch: {
57
- type: 'boolean',
58
- default: false
59
- }
60
- }),
61
- handler: async ({
62
- watch
63
- }) => {
64
- await core.compile({
65
- watch
66
- }, config);
67
- }
68
- }).command({
69
- command: 'validate',
70
- handler: async () => {
71
- const valid = await core.validate(config);
72
-
73
- if (!valid) {
74
- throw new Error('Project invalid');
75
- }
76
- }
77
- }).help().wrap(72).argv;
@@ -1,70 +0,0 @@
1
- import { push, pull } from '@vocab/phrase';
2
- import { resolveConfig, compile, validate } from '@vocab/core';
3
- import yargs from 'yargs';
4
- import envCi from 'env-ci';
5
-
6
- /* eslint-disable no-console */
7
- const {
8
- branch
9
- } = envCi();
10
- const branchDefinition = {
11
- type: 'string',
12
- describe: 'The Phrase branch to target',
13
- default: branch || 'local-development'
14
- };
15
- let config = null; // eslint-disable-next-line @typescript-eslint/no-unused-expressions
16
-
17
- yargs(process.argv.slice(2)).scriptName('vocab').option('config', {
18
- type: 'string',
19
- describe: 'Path to config file'
20
- }).middleware(async ({
21
- config: configPath
22
- }) => {
23
- config = await resolveConfig(configPath);
24
- console.log('Loaded config from', configPath || process.cwd());
25
- }).command({
26
- command: 'push',
27
- builder: () => yargs.options({
28
- branch: branchDefinition,
29
- 'delete-unused-keys': {
30
- type: 'boolean',
31
- describe: 'Whether or not to delete unused keys after pushing',
32
- default: false
33
- }
34
- }),
35
- handler: async options => {
36
- await push(options, config);
37
- }
38
- }).command({
39
- command: 'pull',
40
- builder: () => yargs.options({
41
- branch: branchDefinition
42
- }),
43
- handler: async options => {
44
- await pull(options, config);
45
- }
46
- }).command({
47
- command: 'compile',
48
- builder: () => yargs.options({
49
- watch: {
50
- type: 'boolean',
51
- default: false
52
- }
53
- }),
54
- handler: async ({
55
- watch
56
- }) => {
57
- await compile({
58
- watch
59
- }, config);
60
- }
61
- }).command({
62
- command: 'validate',
63
- handler: async () => {
64
- const valid = await validate(config);
65
-
66
- if (!valid) {
67
- throw new Error('Project invalid');
68
- }
69
- }
70
- }).help().wrap(72).argv;