@vocab/cli 0.0.0-compiled-translation-import-order-20230328231631

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.
package/bin.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ require('.');
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./declarations/src/index";
@@ -0,0 +1,77 @@
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;
23
+
24
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
25
+ yargs__default["default"](process.argv.slice(2)).scriptName('vocab').option('config', {
26
+ type: 'string',
27
+ describe: 'Path to config file'
28
+ }).middleware(async ({
29
+ config: configPath
30
+ }) => {
31
+ config = await core.resolveConfig(configPath);
32
+ console.log('Loaded config from', configPath || process.cwd());
33
+ }).command({
34
+ command: 'push',
35
+ builder: () => yargs__default["default"].options({
36
+ branch: branchDefinition,
37
+ 'delete-unused-keys': {
38
+ type: 'boolean',
39
+ describe: 'Whether or not to delete unused keys after pushing',
40
+ default: false
41
+ }
42
+ }),
43
+ handler: async options => {
44
+ await phrase.push(options, config);
45
+ }
46
+ }).command({
47
+ command: 'pull',
48
+ builder: () => yargs__default["default"].options({
49
+ branch: branchDefinition
50
+ }),
51
+ handler: async options => {
52
+ await phrase.pull(options, config);
53
+ }
54
+ }).command({
55
+ command: 'compile',
56
+ builder: () => yargs__default["default"].options({
57
+ watch: {
58
+ type: 'boolean',
59
+ default: false
60
+ }
61
+ }),
62
+ handler: async ({
63
+ watch
64
+ }) => {
65
+ await core.compile({
66
+ watch
67
+ }, config);
68
+ }
69
+ }).command({
70
+ command: 'validate',
71
+ handler: async () => {
72
+ const valid = await core.validate(config);
73
+ if (!valid) {
74
+ throw new Error('Project invalid');
75
+ }
76
+ }
77
+ }).help().wrap(72).argv;
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,77 @@
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;
23
+
24
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
25
+ yargs__default["default"](process.argv.slice(2)).scriptName('vocab').option('config', {
26
+ type: 'string',
27
+ describe: 'Path to config file'
28
+ }).middleware(async ({
29
+ config: configPath
30
+ }) => {
31
+ config = await core.resolveConfig(configPath);
32
+ console.log('Loaded config from', configPath || process.cwd());
33
+ }).command({
34
+ command: 'push',
35
+ builder: () => yargs__default["default"].options({
36
+ branch: branchDefinition,
37
+ 'delete-unused-keys': {
38
+ type: 'boolean',
39
+ describe: 'Whether or not to delete unused keys after pushing',
40
+ default: false
41
+ }
42
+ }),
43
+ handler: async options => {
44
+ await phrase.push(options, config);
45
+ }
46
+ }).command({
47
+ command: 'pull',
48
+ builder: () => yargs__default["default"].options({
49
+ branch: branchDefinition
50
+ }),
51
+ handler: async options => {
52
+ await phrase.pull(options, config);
53
+ }
54
+ }).command({
55
+ command: 'compile',
56
+ builder: () => yargs__default["default"].options({
57
+ watch: {
58
+ type: 'boolean',
59
+ default: false
60
+ }
61
+ }),
62
+ handler: async ({
63
+ watch
64
+ }) => {
65
+ await core.compile({
66
+ watch
67
+ }, config);
68
+ }
69
+ }).command({
70
+ command: 'validate',
71
+ handler: async () => {
72
+ const valid = await core.validate(config);
73
+ if (!valid) {
74
+ throw new Error('Project invalid');
75
+ }
76
+ }
77
+ }).help().wrap(72).argv;
@@ -0,0 +1,70 @@
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;
16
+
17
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
18
+ yargs(process.argv.slice(2)).scriptName('vocab').option('config', {
19
+ type: 'string',
20
+ describe: 'Path to config file'
21
+ }).middleware(async ({
22
+ config: configPath
23
+ }) => {
24
+ config = await resolveConfig(configPath);
25
+ console.log('Loaded config from', configPath || process.cwd());
26
+ }).command({
27
+ command: 'push',
28
+ builder: () => yargs.options({
29
+ branch: branchDefinition,
30
+ 'delete-unused-keys': {
31
+ type: 'boolean',
32
+ describe: 'Whether or not to delete unused keys after pushing',
33
+ default: false
34
+ }
35
+ }),
36
+ handler: async options => {
37
+ await push(options, config);
38
+ }
39
+ }).command({
40
+ command: 'pull',
41
+ builder: () => yargs.options({
42
+ branch: branchDefinition
43
+ }),
44
+ handler: async options => {
45
+ await pull(options, config);
46
+ }
47
+ }).command({
48
+ command: 'compile',
49
+ builder: () => yargs.options({
50
+ watch: {
51
+ type: 'boolean',
52
+ default: false
53
+ }
54
+ }),
55
+ handler: async ({
56
+ watch
57
+ }) => {
58
+ await compile({
59
+ watch
60
+ }, config);
61
+ }
62
+ }).command({
63
+ command: 'validate',
64
+ handler: async () => {
65
+ const valid = await validate(config);
66
+ if (!valid) {
67
+ throw new Error('Project invalid');
68
+ }
69
+ }
70
+ }).help().wrap(72).argv;
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@vocab/cli",
3
+ "version": "0.0.0-compiled-translation-import-order-20230328231631",
4
+ "main": "dist/vocab-cli.cjs.js",
5
+ "module": "dist/vocab-cli.esm.js",
6
+ "bin": {
7
+ "vocab": "bin.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "bin.js"
12
+ ],
13
+ "author": "SEEK",
14
+ "license": "MIT",
15
+ "dependencies": {
16
+ "@types/env-ci": "^3.1.0",
17
+ "@vocab/core": "0.0.0-compiled-translation-import-order-20230328231631",
18
+ "@vocab/phrase": "0.0.0-compiled-translation-import-order-20230328231631",
19
+ "env-ci": "^5.0.2",
20
+ "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"
25
+ },
26
+ "devDependencies": {
27
+ "@types/node-fetch": "^2.5.7",
28
+ "@types/prettier": "^2.1.5",
29
+ "@types/yargs": "^15.0.9",
30
+ "@vocab/types": "^1.1.2"
31
+ }
32
+ }