@devkong/cli-nx 0.0.3 → 0.0.4
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/package.json
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# compiled output
|
|
4
|
+
dist
|
|
5
|
+
bin
|
|
6
|
+
tmp
|
|
7
|
+
/out-tsc
|
|
8
|
+
**/target
|
|
9
|
+
|
|
10
|
+
# dependencies
|
|
11
|
+
node_modules
|
|
12
|
+
.nx
|
|
13
|
+
.poetry
|
|
14
|
+
.venv
|
|
15
|
+
|
|
16
|
+
# IDEs and editors
|
|
17
|
+
.project
|
|
18
|
+
.classpath
|
|
19
|
+
.c9/
|
|
20
|
+
*.launch
|
|
21
|
+
.settings/
|
|
22
|
+
*.sublime-workspace
|
|
23
|
+
|
|
24
|
+
# misc
|
|
25
|
+
/.sass-cache
|
|
26
|
+
/connect.lock
|
|
27
|
+
/coverage
|
|
28
|
+
/libpeerconnection.log
|
|
29
|
+
npm-debug.log
|
|
30
|
+
yarn-error.log
|
|
31
|
+
testem.log
|
|
32
|
+
/typings
|
|
33
|
+
.kotlin
|
|
34
|
+
**/pylint.txt
|
|
35
|
+
.pytest_cache
|
|
36
|
+
__pycache__
|
|
37
|
+
|
|
38
|
+
# System Files
|
|
39
|
+
.DS_Store
|
|
40
|
+
Thumbs.db
|
|
41
|
+
|
|
42
|
+
# Gradle
|
|
43
|
+
.gradle
|
|
44
|
+
build
|
|
45
|
+
|
|
46
|
+
# Maven
|
|
47
|
+
**/.mvn/repository
|
|
48
|
+
|
|
49
|
+
# Idea
|
|
50
|
+
**/.idea/aws.xml
|
|
51
|
+
**/.idea/dataSources
|
|
52
|
+
**/.idea/dataSources.local.xml
|
|
53
|
+
**/.idea/dataSources.xml
|
|
54
|
+
**/.idea/httpRequests
|
|
55
|
+
**/.idea/jarRepositories.xml
|
|
56
|
+
**/.idea/jsLibraryMappings.xml
|
|
57
|
+
**/.idea/kotlinScripting.xml
|
|
58
|
+
**/.idea/modules
|
|
59
|
+
**/.idea/modules.xml
|
|
60
|
+
**/.idea/protoeditor.xml
|
|
61
|
+
**/.idea/protoeditor.xml
|
|
62
|
+
**/.idea/shelf
|
|
63
|
+
**/.idea/tasks.xml
|
|
64
|
+
**/.idea/workspace.xml
|
|
65
|
+
|
|
66
|
+
# tests
|
|
67
|
+
**/.coverage
|
|
68
|
+
**/coverage.xml
|
|
69
|
+
**/reports/**/unittests
|
|
@@ -1,63 +1,98 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Kong Extension
|
|
2
2
|
|
|
3
|
-
Welcome to the
|
|
3
|
+
Welcome to the Kong extension development workspace!
|
|
4
4
|
|
|
5
5
|
### Prerequisites
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
7
|
+
Before you start, make sure you have the following installed:
|
|
8
|
+
|
|
9
|
+
- [Node.js](https://nodejs.org/en/download), version >= 20.0
|
|
10
|
+
- [Python](https://www.python.org/downloads/), version >= 3.9
|
|
11
|
+
- [Docker](https://docs.docker.com/engine/install/)
|
|
12
|
+
|
|
13
|
+
To verify the installation and check the versions, run the following commands:
|
|
12
14
|
|
|
13
15
|
```shell script
|
|
14
|
-
|
|
16
|
+
node --version
|
|
17
|
+
python --version
|
|
18
|
+
docker info
|
|
15
19
|
```
|
|
16
20
|
|
|
17
|
-
###
|
|
21
|
+
### Getting Started
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
1. Add your username to the `ownership` field in the `kong.json` file (e.g., "kong-dev", "kong-qa")
|
|
24
|
+
2. Make sure you're in the terminal and inside the extension folder you generated
|
|
25
|
+
3. Run the following commands in your terminal:
|
|
20
26
|
|
|
21
|
-
```
|
|
22
|
-
kong
|
|
27
|
+
```shell script
|
|
28
|
+
# configure the base Kong URL (e.g., https://kong.dev.app-dts.net)
|
|
29
|
+
kong configure
|
|
30
|
+
|
|
31
|
+
# install Python dependencies from requirements.txt
|
|
32
|
+
kong install --verbose
|
|
23
33
|
```
|
|
24
34
|
|
|
25
|
-
|
|
35
|
+
That's it! Now, modify your code, tag it by publishing a new version, and assign aliases for use in the workflow.
|
|
26
36
|
|
|
27
|
-
|
|
37
|
+
### Publish a New Version
|
|
38
|
+
|
|
39
|
+
To automatically tag your code with an incremented version number (e.g., 1, 2, 3), run:
|
|
28
40
|
|
|
29
41
|
```shell script
|
|
30
|
-
|
|
42
|
+
kong publish-version --verbose
|
|
31
43
|
```
|
|
32
44
|
|
|
33
|
-
|
|
45
|
+
This command will build your extension and tag it with the next available version.
|
|
46
|
+
|
|
47
|
+
### List Available Versions
|
|
34
48
|
|
|
35
|
-
|
|
49
|
+
To see all available versions of your extension, run:
|
|
36
50
|
|
|
37
51
|
```shell script
|
|
38
|
-
kong
|
|
52
|
+
kong list-versions
|
|
39
53
|
```
|
|
40
54
|
|
|
41
|
-
This will build the extension and tags it with the next available version. If it’s the first version, it will be tagged as version 1.
|
|
42
|
-
|
|
43
55
|
### Assign an Alias to a Version
|
|
44
56
|
|
|
45
|
-
You can assign an alias(
|
|
57
|
+
You can assign an alias (e.g., stable, beta) to a specific version. This alias will appear in the UI as a separate step in the workflow. For example, to assign the alias stable to version 1, use:
|
|
46
58
|
|
|
47
59
|
```shell script
|
|
48
|
-
kong set-alias stable 1
|
|
60
|
+
kong set-alias stable 1 --verbose
|
|
49
61
|
```
|
|
50
62
|
|
|
51
|
-
|
|
63
|
+
### Running and Debugging Tests
|
|
52
64
|
|
|
53
|
-
|
|
65
|
+
To run the tests, execute the following command:
|
|
54
66
|
|
|
55
|
-
|
|
67
|
+
```shell script
|
|
68
|
+
pytest ./src
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This will run the tests located in the `src` directory.
|
|
72
|
+
The debugging process depends on the IDE you're using. For example, in [VSCode](https://code.visualstudio.com/), follow these steps:
|
|
73
|
+
|
|
74
|
+
1. Open the Run and Debug panel from the left sidebar
|
|
75
|
+
2. In the top combobox (dropdown), select "test" to configure the test environment
|
|
76
|
+
3. Click the green play button to start debugging the tests
|
|
77
|
+
|
|
78
|
+
This will allow you to set breakpoints and step through your tests.
|
|
79
|
+
|
|
80
|
+
### Update Python Dependencies
|
|
81
|
+
|
|
82
|
+
If you modify requirements.txt or requirements-dev.txt, run the following to apply the changes:
|
|
56
83
|
|
|
57
84
|
```shell script
|
|
58
|
-
kong
|
|
85
|
+
kong install --verbose
|
|
59
86
|
```
|
|
60
87
|
|
|
61
88
|
### Using a Custom Profile
|
|
62
89
|
|
|
63
|
-
|
|
90
|
+
If you're developing an extension that will be used in different regions (or need to work with a specific profile), you can create a new profile using `kong configure`. Then, include the `--profile <name>` parameter when running the publish-version and set-alias commands to use the desired profile.
|
|
91
|
+
|
|
92
|
+
### Update CLI
|
|
93
|
+
|
|
94
|
+
To install the latest version of the CLI, run:
|
|
95
|
+
|
|
96
|
+
```shell script
|
|
97
|
+
npm i -g @devkong/cli@latest
|
|
98
|
+
```
|