@trayio/cdk-cli 0.0.10 → 0.0.11

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.0.10 linux-x64 node-v18.17.0
27
+ @trayio/cdk-cli/0.0.11 linux-x64 node-v18.17.0
28
28
  $ tray-cdk --help [COMMAND]
29
29
  USAGE
30
30
  $ tray-cdk COMMAND
@@ -40,7 +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
+ * [`tray-cdk test [OPERATIONNAME]`](#tray-cdk-test-operationname)
44
44
  * [`tray-cdk version`](#tray-cdk-version)
45
45
 
46
46
  ## `tray-cdk`
@@ -133,16 +133,19 @@ DESCRIPTION
133
133
  Initialize a connector project
134
134
  ```
135
135
 
136
- ## `tray-cdk test`
136
+ ## `tray-cdk test [OPERATIONNAME]`
137
137
 
138
- Build and test connector project
138
+ Build and test connector project or an operation
139
139
 
140
140
  ```
141
141
  USAGE
142
- $ tray-cdk test
142
+ $ tray-cdk test [OPERATIONNAME]
143
+
144
+ ARGUMENTS
145
+ OPERATIONNAME Operation name to run the test against
143
146
 
144
147
  DESCRIPTION
145
- Build and test connector project
148
+ Build and test connector project or an operation
146
149
  ```
147
150
 
148
151
  ## `tray-cdk version`
Binary file
package/dist/test.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import { Command } from '@oclif/core';
2
2
  export default class Test extends Command {
3
3
  static description: string;
4
+ static args: {
5
+ operationName: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
6
+ };
4
7
  run(): Promise<void>;
5
8
  }
6
9
  //# 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,EAAE,MAAM,aAAa,CAAC;AAKtC,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACxC,MAAM,CAAC,WAAW,SAAsC;IAElD,GAAG;CAeT"}
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"}
package/dist/test.js CHANGED
@@ -14,15 +14,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const core_1 = require("@oclif/core");
16
16
  const chalk_1 = __importDefault(require("chalk"));
17
+ const lodash_1 = require("lodash");
17
18
  const child_process_1 = require("child_process");
18
19
  class Test extends core_1.Command {
19
20
  run() {
20
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);
21
24
  try {
22
25
  this.log(chalk_1.default.bold(chalk_1.default.gray('Running npm compile...')));
23
26
  (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' });
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}`, {
30
+ stdio: 'inherit',
31
+ });
32
+ }
33
+ else {
34
+ this.log(chalk_1.default.bold(chalk_1.default.gray('Running npm test...')));
35
+ (0, child_process_1.execSync)('npm run test', { stdio: 'inherit' });
36
+ }
26
37
  this.log(chalk_1.default.bold(chalk_1.default.green('Success')));
27
38
  }
28
39
  catch (error) {
@@ -33,5 +44,12 @@ class Test extends core_1.Command {
33
44
  });
34
45
  }
35
46
  }
36
- Test.description = 'Build and test connector project';
47
+ Test.description = 'Build and test connector project or an operation';
48
+ Test.args = {
49
+ operationName: core_1.Args.string({
50
+ name: 'Operation name',
51
+ required: false,
52
+ description: 'Operation name to run the test against',
53
+ }),
54
+ };
37
55
  exports.default = Test;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.10",
2
+ "version": "0.0.11",
3
3
  "commands": {
4
4
  "add-operation": {
5
5
  "id": "add-operation",
@@ -63,14 +63,20 @@
63
63
  },
64
64
  "test": {
65
65
  "id": "test",
66
- "description": "Build and test connector project",
66
+ "description": "Build and test connector project or an operation",
67
67
  "strict": true,
68
68
  "pluginName": "@trayio/cdk-cli",
69
69
  "pluginAlias": "@trayio/cdk-cli",
70
70
  "pluginType": "core",
71
71
  "aliases": [],
72
72
  "flags": {},
73
- "args": {}
73
+ "args": {
74
+ "operationName": {
75
+ "name": "operationName",
76
+ "description": "Operation name to run the test against",
77
+ "required": false
78
+ }
79
+ }
74
80
  }
75
81
  }
76
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trayio/cdk-cli",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "A collection of CLI commands for connector development.",
5
5
  "exports": {
6
6
  "./*": "./dist/*.js"