@trayio/cdk-cli 0.0.9 → 0.0.10
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/README.md +18 -2
- package/dist/add-operation.d.ts +1 -1
- package/dist/add-operation.d.ts.map +1 -1
- package/dist/add-operation.js +6 -6
- package/dist/init.d.ts +4 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +25 -5
- package/dist/test.d.ts +6 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +37 -0
- package/oclif.manifest.json +21 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ $ npm install -g @trayio/cdk-cli
|
|
|
24
24
|
$ tray-cdk COMMAND
|
|
25
25
|
running command...
|
|
26
26
|
$ tray-cdk (--version|-v)
|
|
27
|
-
@trayio/cdk-cli/0.0.
|
|
27
|
+
@trayio/cdk-cli/0.0.10 linux-x64 node-v18.17.0
|
|
28
28
|
$ tray-cdk --help [COMMAND]
|
|
29
29
|
USAGE
|
|
30
30
|
$ tray-cdk COMMAND
|
|
@@ -40,6 +40,7 @@ USAGE
|
|
|
40
40
|
* [`tray-cdk autocomplete [SHELL]`](#tray-cdk-autocomplete-shell)
|
|
41
41
|
* [`tray-cdk help [COMMANDS]`](#tray-cdk-help-commands)
|
|
42
42
|
* [`tray-cdk init [CONNECTORNAME]`](#tray-cdk-init-connectorname)
|
|
43
|
+
* [`tray-cdk test`](#tray-cdk-test)
|
|
43
44
|
* [`tray-cdk version`](#tray-cdk-version)
|
|
44
45
|
|
|
45
46
|
## `tray-cdk`
|
|
@@ -120,15 +121,30 @@ Initialize a connector project
|
|
|
120
121
|
|
|
121
122
|
```
|
|
122
123
|
USAGE
|
|
123
|
-
$ tray-cdk init [CONNECTORNAME]
|
|
124
|
+
$ tray-cdk init [CONNECTORNAME] [-i]
|
|
124
125
|
|
|
125
126
|
ARGUMENTS
|
|
126
127
|
CONNECTORNAME Connector directory name to generate template files
|
|
127
128
|
|
|
129
|
+
FLAGS
|
|
130
|
+
-i, --install Runs `npm install` after successful generation
|
|
131
|
+
|
|
128
132
|
DESCRIPTION
|
|
129
133
|
Initialize a connector project
|
|
130
134
|
```
|
|
131
135
|
|
|
136
|
+
## `tray-cdk test`
|
|
137
|
+
|
|
138
|
+
Build and test connector project
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
USAGE
|
|
142
|
+
$ tray-cdk test
|
|
143
|
+
|
|
144
|
+
DESCRIPTION
|
|
145
|
+
Build and test connector project
|
|
146
|
+
```
|
|
147
|
+
|
|
132
148
|
## `tray-cdk version`
|
|
133
149
|
|
|
134
150
|
```
|
package/dist/add-operation.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export declare const titleCase: (value: string) => string;
|
|
3
3
|
export declare const pascalCase: (value: string) => string;
|
|
4
|
-
export default class
|
|
4
|
+
export default class AddOperation extends Command {
|
|
5
5
|
static description: string;
|
|
6
6
|
static args: {
|
|
7
7
|
operationName: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-operation.d.ts","sourceRoot":"","sources":["../src/add-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,aAAa,CAAC;AAc5C,eAAO,MAAM,SAAS,UAAW,MAAM,KAAG,MACQ,CAAC;AAEnD,eAAO,MAAM,UAAU,UAAW,MAAM,KAAG,MACd,CAAC;AAe9B,MAAM,CAAC,OAAO,OAAO,
|
|
1
|
+
{"version":3,"file":"add-operation.d.ts","sourceRoot":"","sources":["../src/add-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,aAAa,CAAC;AAc5C,eAAO,MAAM,SAAS,UAAW,MAAM,KAAG,MACQ,CAAC;AAEnD,eAAO,MAAM,UAAU,UAAW,MAAM,KAAG,MACd,CAAC;AAe9B,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,OAAO;IAChD,MAAM,CAAC,WAAW,SAA2C;IAE7D,MAAM,CAAC,IAAI;;;MAYT;IAEI,GAAG;CAuDT"}
|
package/dist/add-operation.js
CHANGED
|
@@ -35,10 +35,10 @@ const getConnectorName = (currentDirectory) => {
|
|
|
35
35
|
}
|
|
36
36
|
return base;
|
|
37
37
|
};
|
|
38
|
-
class
|
|
38
|
+
class AddOperation extends core_1.Command {
|
|
39
39
|
run() {
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const { args } = yield this.parse(
|
|
41
|
+
const { args } = yield this.parse(AddOperation);
|
|
42
42
|
const promptRes = yield inquirer_1.default.prompt([
|
|
43
43
|
{
|
|
44
44
|
name: 'operationName',
|
|
@@ -80,12 +80,12 @@ class ConnectorOperationAdd extends core_1.Command {
|
|
|
80
80
|
operationNameCamelCase,
|
|
81
81
|
connectorNamePascalCase,
|
|
82
82
|
})();
|
|
83
|
-
this.log(chalk_1.default.bold(chalk_1.default.green(`Success! Added operation: ${
|
|
83
|
+
this.log(chalk_1.default.bold(chalk_1.default.green(`Success! Added operation: ${operationNameKebabCase}`)));
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
AddOperation.description = 'Add an operation to connector project';
|
|
88
|
+
AddOperation.args = {
|
|
89
89
|
operationName: core_1.Args.string({
|
|
90
90
|
name: 'Operation name',
|
|
91
91
|
required: false,
|
|
@@ -98,4 +98,4 @@ ConnectorOperationAdd.args = {
|
|
|
98
98
|
options: ['http', 'composite'],
|
|
99
99
|
}),
|
|
100
100
|
};
|
|
101
|
-
exports.default =
|
|
101
|
+
exports.default = AddOperation;
|
package/dist/init.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export declare const titleCase: (value: string) => string;
|
|
3
3
|
export declare const pascalCase: (value: string) => string;
|
|
4
|
-
export default class
|
|
4
|
+
export default class Init extends Command {
|
|
5
5
|
static description: string;
|
|
6
6
|
static args: {
|
|
7
7
|
connectorName: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
|
|
8
8
|
};
|
|
9
|
+
static flags: {
|
|
10
|
+
install: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
9
12
|
run(): Promise<void>;
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=init.d.ts.map
|
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,aAAa,CAAC;AAgBnD,eAAO,MAAM,SAAS,UAAW,MAAM,KAAG,MACQ,CAAC;AAEnD,eAAO,MAAM,UAAU,UAAW,MAAM,KAAG,MACd,CAAC;AAE9B,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACxC,MAAM,CAAC,WAAW,SAAoC;IAEtD,MAAM,CAAC,IAAI;;MAMT;IAEF,MAAM,CAAC,KAAK;;MAKV;IAEI,GAAG;CA6CT"}
|
package/dist/init.js
CHANGED
|
@@ -19,15 +19,16 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
19
19
|
const NodeFsGenerator_1 = require("@trayio/tray-generator/generator/NodeFsGenerator");
|
|
20
20
|
const path_1 = require("path");
|
|
21
21
|
const lodash_1 = require("lodash");
|
|
22
|
+
const child_process_1 = require("child_process");
|
|
22
23
|
// TODO add to try-common in ts-modules
|
|
23
24
|
const titleCase = (value) => (0, lodash_1.capitalize)((0, lodash_1.startCase)(value).replace(/_|-/g, ' '));
|
|
24
25
|
exports.titleCase = titleCase;
|
|
25
26
|
const pascalCase = (value) => (0, lodash_1.upperFirst)((0, lodash_1.camelCase)(value));
|
|
26
27
|
exports.pascalCase = pascalCase;
|
|
27
|
-
class
|
|
28
|
+
class Init extends core_1.Command {
|
|
28
29
|
run() {
|
|
29
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const { args } = yield this.parse(
|
|
31
|
+
const { args, flags } = yield this.parse(Init);
|
|
31
32
|
const promptRes = yield inquirer_1.default.prompt([
|
|
32
33
|
{
|
|
33
34
|
name: 'connectorName',
|
|
@@ -51,15 +52,34 @@ class ConnectorInit extends core_1.Command {
|
|
|
51
52
|
connectorNameCamelCase,
|
|
52
53
|
})();
|
|
53
54
|
this.log(chalk_1.default.bold(chalk_1.default.green(`Success! Added ${connectorNameKebabCase}`)));
|
|
55
|
+
if (flags.install) {
|
|
56
|
+
try {
|
|
57
|
+
this.log(chalk_1.default.bold(chalk_1.default.gray('Running npm install...')));
|
|
58
|
+
(0, child_process_1.execSync)(`cd ${connectorNameKebabCase} && npm install`, {
|
|
59
|
+
stdio: 'inherit',
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (error instanceof Error) {
|
|
64
|
+
this.error(new Error(error.message));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
54
68
|
});
|
|
55
69
|
}
|
|
56
70
|
}
|
|
57
|
-
|
|
58
|
-
|
|
71
|
+
Init.description = 'Initialize a connector project';
|
|
72
|
+
Init.args = {
|
|
59
73
|
connectorName: core_1.Args.string({
|
|
60
74
|
name: 'Connector directory name',
|
|
61
75
|
required: false,
|
|
62
76
|
description: 'Connector directory name to generate template files',
|
|
63
77
|
}),
|
|
64
78
|
};
|
|
65
|
-
|
|
79
|
+
Init.flags = {
|
|
80
|
+
install: core_1.Flags.boolean({
|
|
81
|
+
char: 'i',
|
|
82
|
+
description: 'Runs `npm install` after successful generation',
|
|
83
|
+
}),
|
|
84
|
+
};
|
|
85
|
+
exports.default = Init;
|
package/dist/test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAKtC,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACxC,MAAM,CAAC,WAAW,SAAsC;IAElD,GAAG;CAeT"}
|
package/dist/test.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const core_1 = require("@oclif/core");
|
|
16
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
17
|
+
const child_process_1 = require("child_process");
|
|
18
|
+
class Test extends core_1.Command {
|
|
19
|
+
run() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
try {
|
|
22
|
+
this.log(chalk_1.default.bold(chalk_1.default.gray('Running npm compile...')));
|
|
23
|
+
(0, child_process_1.execSync)('npm run compile', { stdio: 'inherit' });
|
|
24
|
+
this.log(chalk_1.default.bold(chalk_1.default.gray('Running npm test...')));
|
|
25
|
+
(0, child_process_1.execSync)('npm run test', { stdio: 'inherit' });
|
|
26
|
+
this.log(chalk_1.default.bold(chalk_1.default.green('Success')));
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
if (error instanceof Error) {
|
|
30
|
+
this.error(new Error(error.message));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
Test.description = 'Build and test connector project';
|
|
37
|
+
exports.default = Test;
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.10",
|
|
3
3
|
"commands": {
|
|
4
4
|
"add-operation": {
|
|
5
5
|
"id": "add-operation",
|
|
@@ -44,7 +44,15 @@
|
|
|
44
44
|
"pluginAlias": "@trayio/cdk-cli",
|
|
45
45
|
"pluginType": "core",
|
|
46
46
|
"aliases": [],
|
|
47
|
-
"flags": {
|
|
47
|
+
"flags": {
|
|
48
|
+
"install": {
|
|
49
|
+
"name": "install",
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"char": "i",
|
|
52
|
+
"description": "Runs `npm install` after successful generation",
|
|
53
|
+
"allowNo": false
|
|
54
|
+
}
|
|
55
|
+
},
|
|
48
56
|
"args": {
|
|
49
57
|
"connectorName": {
|
|
50
58
|
"name": "connectorName",
|
|
@@ -52,6 +60,17 @@
|
|
|
52
60
|
"required": false
|
|
53
61
|
}
|
|
54
62
|
}
|
|
63
|
+
},
|
|
64
|
+
"test": {
|
|
65
|
+
"id": "test",
|
|
66
|
+
"description": "Build and test connector project",
|
|
67
|
+
"strict": true,
|
|
68
|
+
"pluginName": "@trayio/cdk-cli",
|
|
69
|
+
"pluginAlias": "@trayio/cdk-cli",
|
|
70
|
+
"pluginType": "core",
|
|
71
|
+
"aliases": [],
|
|
72
|
+
"flags": {},
|
|
73
|
+
"args": {}
|
|
55
74
|
}
|
|
56
75
|
}
|
|
57
76
|
}
|