@vocab/cli 0.0.0-tags-support-2023174816 → 0.0.0-use-phrase-locale-name-20240924060647
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/dist/declarations/src/index.d.ts +1 -1
- package/dist/vocab-cli.cjs.d.ts +1 -0
- package/dist/vocab-cli.cjs.dev.js +15 -10
- package/dist/vocab-cli.cjs.prod.js +15 -10
- package/dist/vocab-cli.esm.js +13 -8
- package/package.json +16 -13
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.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/vocab-cli.cjs.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export * from "./declarations/src/index";
|
|
2
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidm9jYWItY2xpLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi9kZWNsYXJhdGlvbnMvc3JjL2luZGV4LmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==
|
|
@@ -2,26 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
var phrase = require('@vocab/phrase');
|
|
4
4
|
var core = require('@vocab/core');
|
|
5
|
-
var
|
|
5
|
+
var yargsCli = require('yargs');
|
|
6
6
|
var envCi = require('env-ci');
|
|
7
7
|
|
|
8
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var yargsCli__default = /*#__PURE__*/_interopDefault(yargsCli);
|
|
11
11
|
var envCi__default = /*#__PURE__*/_interopDefault(envCi);
|
|
12
12
|
|
|
13
13
|
/* eslint-disable no-console */
|
|
14
14
|
const {
|
|
15
15
|
branch
|
|
16
|
-
} = envCi__default[
|
|
16
|
+
} = envCi__default["default"]();
|
|
17
17
|
const branchDefinition = {
|
|
18
18
|
type: 'string',
|
|
19
19
|
describe: 'The Phrase branch to target',
|
|
20
20
|
default: branch || 'local-development'
|
|
21
21
|
};
|
|
22
|
-
let config = null;
|
|
22
|
+
let config = null;
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
25
|
+
yargsCli__default["default"](process.argv.slice(2)).scriptName('vocab').option('config', {
|
|
25
26
|
type: 'string',
|
|
26
27
|
describe: 'Path to config file'
|
|
27
28
|
}).middleware(async ({
|
|
@@ -31,7 +32,7 @@ yargs__default['default'](process.argv.slice(2)).scriptName('vocab').option('con
|
|
|
31
32
|
console.log('Loaded config from', configPath || process.cwd());
|
|
32
33
|
}).command({
|
|
33
34
|
command: 'push',
|
|
34
|
-
builder:
|
|
35
|
+
builder: yargs => yargs.options({
|
|
35
36
|
branch: branchDefinition,
|
|
36
37
|
'delete-unused-keys': {
|
|
37
38
|
type: 'boolean',
|
|
@@ -44,15 +45,20 @@ yargs__default['default'](process.argv.slice(2)).scriptName('vocab').option('con
|
|
|
44
45
|
}
|
|
45
46
|
}).command({
|
|
46
47
|
command: 'pull',
|
|
47
|
-
builder:
|
|
48
|
-
branch: branchDefinition
|
|
48
|
+
builder: yargs => yargs.options({
|
|
49
|
+
branch: branchDefinition,
|
|
50
|
+
'error-on-no-global-key-translation': {
|
|
51
|
+
type: 'boolean',
|
|
52
|
+
describe: 'Throw an error when there is no translation for a global key',
|
|
53
|
+
default: false
|
|
54
|
+
}
|
|
49
55
|
}),
|
|
50
56
|
handler: async options => {
|
|
51
57
|
await phrase.pull(options, config);
|
|
52
58
|
}
|
|
53
59
|
}).command({
|
|
54
60
|
command: 'compile',
|
|
55
|
-
builder:
|
|
61
|
+
builder: yargs => yargs.options({
|
|
56
62
|
watch: {
|
|
57
63
|
type: 'boolean',
|
|
58
64
|
default: false
|
|
@@ -69,7 +75,6 @@ yargs__default['default'](process.argv.slice(2)).scriptName('vocab').option('con
|
|
|
69
75
|
command: 'validate',
|
|
70
76
|
handler: async () => {
|
|
71
77
|
const valid = await core.validate(config);
|
|
72
|
-
|
|
73
78
|
if (!valid) {
|
|
74
79
|
throw new Error('Project invalid');
|
|
75
80
|
}
|
|
@@ -2,26 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
var phrase = require('@vocab/phrase');
|
|
4
4
|
var core = require('@vocab/core');
|
|
5
|
-
var
|
|
5
|
+
var yargsCli = require('yargs');
|
|
6
6
|
var envCi = require('env-ci');
|
|
7
7
|
|
|
8
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var yargsCli__default = /*#__PURE__*/_interopDefault(yargsCli);
|
|
11
11
|
var envCi__default = /*#__PURE__*/_interopDefault(envCi);
|
|
12
12
|
|
|
13
13
|
/* eslint-disable no-console */
|
|
14
14
|
const {
|
|
15
15
|
branch
|
|
16
|
-
} = envCi__default[
|
|
16
|
+
} = envCi__default["default"]();
|
|
17
17
|
const branchDefinition = {
|
|
18
18
|
type: 'string',
|
|
19
19
|
describe: 'The Phrase branch to target',
|
|
20
20
|
default: branch || 'local-development'
|
|
21
21
|
};
|
|
22
|
-
let config = null;
|
|
22
|
+
let config = null;
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
25
|
+
yargsCli__default["default"](process.argv.slice(2)).scriptName('vocab').option('config', {
|
|
25
26
|
type: 'string',
|
|
26
27
|
describe: 'Path to config file'
|
|
27
28
|
}).middleware(async ({
|
|
@@ -31,7 +32,7 @@ yargs__default['default'](process.argv.slice(2)).scriptName('vocab').option('con
|
|
|
31
32
|
console.log('Loaded config from', configPath || process.cwd());
|
|
32
33
|
}).command({
|
|
33
34
|
command: 'push',
|
|
34
|
-
builder:
|
|
35
|
+
builder: yargs => yargs.options({
|
|
35
36
|
branch: branchDefinition,
|
|
36
37
|
'delete-unused-keys': {
|
|
37
38
|
type: 'boolean',
|
|
@@ -44,15 +45,20 @@ yargs__default['default'](process.argv.slice(2)).scriptName('vocab').option('con
|
|
|
44
45
|
}
|
|
45
46
|
}).command({
|
|
46
47
|
command: 'pull',
|
|
47
|
-
builder:
|
|
48
|
-
branch: branchDefinition
|
|
48
|
+
builder: yargs => yargs.options({
|
|
49
|
+
branch: branchDefinition,
|
|
50
|
+
'error-on-no-global-key-translation': {
|
|
51
|
+
type: 'boolean',
|
|
52
|
+
describe: 'Throw an error when there is no translation for a global key',
|
|
53
|
+
default: false
|
|
54
|
+
}
|
|
49
55
|
}),
|
|
50
56
|
handler: async options => {
|
|
51
57
|
await phrase.pull(options, config);
|
|
52
58
|
}
|
|
53
59
|
}).command({
|
|
54
60
|
command: 'compile',
|
|
55
|
-
builder:
|
|
61
|
+
builder: yargs => yargs.options({
|
|
56
62
|
watch: {
|
|
57
63
|
type: 'boolean',
|
|
58
64
|
default: false
|
|
@@ -69,7 +75,6 @@ yargs__default['default'](process.argv.slice(2)).scriptName('vocab').option('con
|
|
|
69
75
|
command: 'validate',
|
|
70
76
|
handler: async () => {
|
|
71
77
|
const valid = await core.validate(config);
|
|
72
|
-
|
|
73
78
|
if (!valid) {
|
|
74
79
|
throw new Error('Project invalid');
|
|
75
80
|
}
|
package/dist/vocab-cli.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { push, pull } from '@vocab/phrase';
|
|
2
2
|
import { resolveConfig, compile, validate } from '@vocab/core';
|
|
3
|
-
import
|
|
3
|
+
import yargsCli from 'yargs';
|
|
4
4
|
import envCi from 'env-ci';
|
|
5
5
|
|
|
6
6
|
/* eslint-disable no-console */
|
|
@@ -12,9 +12,10 @@ const branchDefinition = {
|
|
|
12
12
|
describe: 'The Phrase branch to target',
|
|
13
13
|
default: branch || 'local-development'
|
|
14
14
|
};
|
|
15
|
-
let config = null;
|
|
15
|
+
let config = null;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
18
|
+
yargsCli(process.argv.slice(2)).scriptName('vocab').option('config', {
|
|
18
19
|
type: 'string',
|
|
19
20
|
describe: 'Path to config file'
|
|
20
21
|
}).middleware(async ({
|
|
@@ -24,7 +25,7 @@ yargs(process.argv.slice(2)).scriptName('vocab').option('config', {
|
|
|
24
25
|
console.log('Loaded config from', configPath || process.cwd());
|
|
25
26
|
}).command({
|
|
26
27
|
command: 'push',
|
|
27
|
-
builder:
|
|
28
|
+
builder: yargs => yargs.options({
|
|
28
29
|
branch: branchDefinition,
|
|
29
30
|
'delete-unused-keys': {
|
|
30
31
|
type: 'boolean',
|
|
@@ -37,15 +38,20 @@ yargs(process.argv.slice(2)).scriptName('vocab').option('config', {
|
|
|
37
38
|
}
|
|
38
39
|
}).command({
|
|
39
40
|
command: 'pull',
|
|
40
|
-
builder:
|
|
41
|
-
branch: branchDefinition
|
|
41
|
+
builder: yargs => yargs.options({
|
|
42
|
+
branch: branchDefinition,
|
|
43
|
+
'error-on-no-global-key-translation': {
|
|
44
|
+
type: 'boolean',
|
|
45
|
+
describe: 'Throw an error when there is no translation for a global key',
|
|
46
|
+
default: false
|
|
47
|
+
}
|
|
42
48
|
}),
|
|
43
49
|
handler: async options => {
|
|
44
50
|
await pull(options, config);
|
|
45
51
|
}
|
|
46
52
|
}).command({
|
|
47
53
|
command: 'compile',
|
|
48
|
-
builder:
|
|
54
|
+
builder: yargs => yargs.options({
|
|
49
55
|
watch: {
|
|
50
56
|
type: 'boolean',
|
|
51
57
|
default: false
|
|
@@ -62,7 +68,6 @@ yargs(process.argv.slice(2)).scriptName('vocab').option('config', {
|
|
|
62
68
|
command: 'validate',
|
|
63
69
|
handler: async () => {
|
|
64
70
|
const valid = await validate(config);
|
|
65
|
-
|
|
66
71
|
if (!valid) {
|
|
67
72
|
throw new Error('Project invalid');
|
|
68
73
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vocab/cli",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-use-phrase-locale-name-20240924060647",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/seek-oss/vocab.git",
|
|
7
|
+
"directory": "packages/cli"
|
|
8
|
+
},
|
|
4
9
|
"main": "dist/vocab-cli.cjs.js",
|
|
5
10
|
"module": "dist/vocab-cli.esm.js",
|
|
6
11
|
"bin": {
|
|
@@ -10,22 +15,20 @@
|
|
|
10
15
|
"dist",
|
|
11
16
|
"bin.js"
|
|
12
17
|
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=18"
|
|
20
|
+
},
|
|
13
21
|
"author": "SEEK",
|
|
14
22
|
"license": "MIT",
|
|
15
23
|
"dependencies": {
|
|
16
|
-
"
|
|
17
|
-
"@vocab/core": "^0.0.0-tags-support-2023174816",
|
|
18
|
-
"@vocab/phrase": "^0.0.0-tags-support-2023174816",
|
|
19
|
-
"env-ci": "^5.0.2",
|
|
24
|
+
"env-ci": "^7.3.0",
|
|
20
25
|
"fast-glob": "^3.2.4",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"yargs": "^16.1.0"
|
|
26
|
+
"yargs": "^17.7.2",
|
|
27
|
+
"@vocab/core": "^1.6.2",
|
|
28
|
+
"@vocab/phrase": "^0.0.0-use-phrase-locale-name-20240924060647"
|
|
25
29
|
},
|
|
26
30
|
"devDependencies": {
|
|
27
|
-
"@types/
|
|
28
|
-
"@types/
|
|
29
|
-
"@types/yargs": "^15.0.9"
|
|
31
|
+
"@types/env-ci": "^3.1.0",
|
|
32
|
+
"@types/yargs": "^17.0.32"
|
|
30
33
|
}
|
|
31
|
-
}
|
|
34
|
+
}
|