@trayio/cdk-cli 0.2.0 → 0.4.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/INTRODUCTION.md +54 -0
- package/README.md +1 -1
- package/dist/connector-template.zip +0 -0
- package/oclif.manifest.json +1 -1
- package/package.json +3 -2
package/INTRODUCTION.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Connector Development Kit (CDK) CLI.
|
|
2
|
+
|
|
3
|
+
The CDK Command Line Interface (CLI) is a tool that is aimed at simplifying connector development using the CDK, for a complete list of all commands refer to the [README](README.md)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Installing the CLI
|
|
7
|
+
|
|
8
|
+
The CLI can be installed using npm:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install -g @trayio/cdk-cli
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Once the installation is complete a `tray-cdk` command should be available.
|
|
15
|
+
|
|
16
|
+
## Creating a connector
|
|
17
|
+
|
|
18
|
+
To create a connector, the `init` command is used:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
tray-cdk init -i
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
It will only ask for the connector name as input, the `-i` flag is optional, it is to install dependencies of the connector project using npm, but the flag can be omitted to install dependencies using another building tool such as yarn after creating the project.
|
|
25
|
+
|
|
26
|
+
## Building and testing the connector
|
|
27
|
+
|
|
28
|
+
When the connector project is created, it contains a sample operation that makes a request to a fake API, so it is recommended to build and test the connector after creating the project and installing the dependencies to make sure that the project builds properly and the runtime can execute operations.
|
|
29
|
+
|
|
30
|
+
To build and test the connector using the cli, only one command is necessary:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
tray-cdk test
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This will compile the project and run all the tests, this command uses npm to run the compile and test scripts from the default `package.json`, which could be run without the cli using a different build tool, this may be preferable if the connector is a subproject in a monorepo for example.
|
|
37
|
+
|
|
38
|
+
The test command can receive an operation name as an argument to test a single operation:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
tray-cdk test my-operation
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Adding an operation
|
|
45
|
+
|
|
46
|
+
The CLI can be used to add the skeleton of an operation, it is recommended to delete the operation created by the `init` command once it is verified that it works properly, and use the CLI to add new operations, as it will generate all the necessary files with the right names based on the new operation's name.
|
|
47
|
+
|
|
48
|
+
To add an operation:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
tray-cdk add-operation
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
It will ask for the operation's name, and for the operation's implementation, which can be HTTP or Composite, more details about these types of implementations can be found in the CDK DSL package.
|
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.
|
|
27
|
+
@trayio/cdk-cli/0.4.0 linux-x64 node-v18.17.0
|
|
28
28
|
$ tray-cdk --help [COMMAND]
|
|
29
29
|
USAGE
|
|
30
30
|
$ tray-cdk COMMAND
|
|
Binary file
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trayio/cdk-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A CLI for connector development",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./*": "./dist/*.js"
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"files": [
|
|
33
33
|
"/bin",
|
|
34
34
|
"/dist",
|
|
35
|
-
"/oclif.manifest.json"
|
|
35
|
+
"/oclif.manifest.json",
|
|
36
|
+
"/INTRODUCTION.md"
|
|
36
37
|
],
|
|
37
38
|
"bin": {
|
|
38
39
|
"tray-cdk": "./bin/run"
|