@trayio/cdk-cli 0.3.0 → 0.5.0

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 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.3.0 linux-x64 node-v18.17.0
27
+ @trayio/cdk-cli/0.5.0 linux-x64 node-v18.17.0
28
28
  $ tray-cdk --help [COMMAND]
29
29
  USAGE
30
30
  $ tray-cdk COMMAND
@@ -139,11 +139,14 @@ Build and test connector project or an operation
139
139
 
140
140
  ```
141
141
  USAGE
142
- $ tray-cdk test [OPERATIONNAME]
142
+ $ tray-cdk test [OPERATIONNAME] [-v]
143
143
 
144
144
  ARGUMENTS
145
145
  OPERATIONNAME Operation name to run the test against
146
146
 
147
+ FLAGS
148
+ -v, --verbose Logs the input and output of an operation, requires operation name argument to be specified
149
+
147
150
  DESCRIPTION
148
151
  Build and test connector project or an operation
149
152
  ```
package/dist/test.d.ts CHANGED
@@ -4,6 +4,9 @@ export default class Test extends Command {
4
4
  static args: {
5
5
  operationName: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
6
6
  };
7
+ static flags: {
8
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ };
7
10
  run(): Promise<void>;
8
11
  }
9
12
  //# sourceMappingURL=test.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,aAAa,CAAC;AAM5C,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACxC,MAAM,CAAC,WAAW,SAAsD;IAExE,MAAM,CAAC,IAAI;;MAMT;IAEI,GAAG;CA4BT"}
1
+ {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,aAAa,CAAC;AAMnD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACxC,MAAM,CAAC,WAAW,SAAsD;IAExE,MAAM,CAAC,IAAI;;MAMT;IAEF,MAAM,CAAC,KAAK;;MAMV;IAEI,GAAG;CAgCT"}
package/dist/test.js CHANGED
@@ -19,14 +19,15 @@ const child_process_1 = require("child_process");
19
19
  class Test extends core_1.Command {
20
20
  run() {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
- const { args } = yield this.parse(Test);
23
- const operationNameKebabCase = (0, lodash_1.kebabCase)(args.operationName);
22
+ const { args, flags } = yield this.parse(Test);
23
+ const operationNameSnakeCase = (0, lodash_1.snakeCase)(args.operationName);
24
24
  try {
25
25
  this.log(chalk_1.default.bold(chalk_1.default.gray('Running npm compile...')));
26
26
  (0, child_process_1.execSync)('npm run compile', { stdio: 'inherit' });
27
- if (operationNameKebabCase) {
28
- this.log(chalk_1.default.bold(chalk_1.default.gray(`Running test for ${operationNameKebabCase}...`)));
29
- (0, child_process_1.execSync)(`npm run test ./src/${operationNameKebabCase}`, {
27
+ if (operationNameSnakeCase) {
28
+ const verboseFlag = flags.verbose ? '-- --verbose=true' : '';
29
+ this.log(chalk_1.default.bold(chalk_1.default.gray(`Running test for ${operationNameSnakeCase}...`)));
30
+ (0, child_process_1.execSync)(`npm run test ./src/${operationNameSnakeCase}/handler.test.ts ${verboseFlag}`, {
30
31
  stdio: 'inherit',
31
32
  });
32
33
  }
@@ -52,4 +53,10 @@ Test.args = {
52
53
  description: 'Operation name to run the test against',
53
54
  }),
54
55
  };
56
+ Test.flags = {
57
+ verbose: core_1.Flags.boolean({
58
+ char: 'v',
59
+ description: 'Logs the input and output of an operation, requires operation name argument to be specified',
60
+ }),
61
+ };
55
62
  exports.default = Test;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.0",
2
+ "version": "0.5.0",
3
3
  "commands": {
4
4
  "add-operation": {
5
5
  "id": "add-operation",
@@ -69,7 +69,15 @@
69
69
  "pluginAlias": "@trayio/cdk-cli",
70
70
  "pluginType": "core",
71
71
  "aliases": [],
72
- "flags": {},
72
+ "flags": {
73
+ "verbose": {
74
+ "name": "verbose",
75
+ "type": "boolean",
76
+ "char": "v",
77
+ "description": "Logs the input and output of an operation, requires operation name argument to be specified",
78
+ "allowNo": false
79
+ }
80
+ },
73
81
  "args": {
74
82
  "operationName": {
75
83
  "name": "operationName",
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@trayio/cdk-cli",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "A CLI for connector development",
5
5
  "exports": {
6
6
  "./*": "./dist/*.js"
7
7
  },
8
8
  "author": "Tray.io",
9
9
  "license": "MIT",
10
+ "engines": {
11
+ "node": ">=18.x"
12
+ },
10
13
  "publishConfig": {
11
14
  "access": "public"
12
15
  },