@devkong/cli-nx 0.0.67-alpha.3 → 0.0.67-alpha.30
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 +1 -1
- package/src/generators/preset/files/kotlin/.dockerignore +6 -0
- package/src/generators/preset/files/kotlin/.editorconfig +24 -0
- package/src/generators/preset/files/kotlin/.vscode/extensions.json +18 -0
- package/src/generators/preset/files/kotlin/.vscode/launch.json +16 -0
- package/src/generators/preset/files/kotlin/.vscode/settings.json +7 -0
- package/src/generators/preset/files/kotlin/.vscode/tasks.json +81 -0
- package/src/generators/preset/files/kotlin/Dockerfile +58 -0
- package/src/generators/preset/files/kotlin/README.md +172 -0
- package/src/generators/preset/files/kotlin/build.gradle.kts.template +64 -0
- package/src/generators/preset/files/kotlin/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/generators/preset/files/kotlin/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/src/generators/preset/files/kotlin/gradle.properties +25 -0
- package/src/generators/preset/files/kotlin/gradlew +245 -0
- package/src/generators/preset/files/kotlin/gradlew.bat +92 -0
- package/src/generators/preset/files/kotlin/kong.json.template +6 -0
- package/src/generators/preset/files/kotlin/project.json.template +29 -0
- package/src/generators/preset/files/kotlin/settings.gradle.kts +14 -0
- package/src/generators/preset/files/kotlin/src/main/kotlin/io/kong/extension/InputData.kt +26 -0
- package/src/generators/preset/files/kotlin/src/main/kotlin/io/kong/extension/Main.kt +83 -0
- package/src/generators/preset/files/kotlin/src/main/kotlin/io/kong/extension/OutputData.kt +15 -0
- package/src/generators/preset/files/kotlin/src/main/kotlin/io/kong/extension/RegisterFrontend.kt +28 -0
- package/src/generators/preset/files/kotlin/src/main/resources/META-INF/resources/index.html +362 -0
- package/src/generators/preset/files/kotlin/src/main/resources/application.properties.template +3 -0
- package/src/generators/preset/files/kotlin/src/main/resources/reflect-config.json.template +1 -0
- package/src/generators/preset/files/kotlin/src/test/kotlin/io/kong/extension/Test.kt +58 -0
- package/src/generators/preset/files/python/.dockerignore +5 -0
- package/src/generators/preset/files/python/.editorconfig +16 -0
- package/src/generators/preset/files/python/.gitattributes +25 -0
- package/src/generators/preset/files/python/.gitignore.template +69 -0
- package/src/generators/preset/files/python/.idea/inspectionProfiles/Project_Default.xml +7 -0
- package/src/generators/preset/files/python/.idea/inspectionProfiles/profiles_settings.xml +6 -0
- package/src/generators/preset/files/python/.idea/kong-cli-python-template.iml +10 -0
- package/src/generators/preset/files/python/.pylintrc +543 -0
- package/src/generators/preset/files/python/.vscode/extensions.json +14 -0
- package/src/generators/preset/files/python/.vscode/launch.json +19 -0
- package/src/generators/preset/files/python/.vscode/settings.json +65 -0
- package/src/generators/preset/files/python/Dockerfile +30 -0
- package/src/generators/preset/files/python/README.md +262 -0
- package/src/generators/preset/files/python/kong.json.template +6 -0
- package/src/generators/preset/files/python/project.json.template +8 -0
- package/src/generators/preset/files/python/pyproject.toml +3 -0
- package/src/generators/preset/files/python/requirements-dev.txt +10 -0
- package/src/generators/preset/files/python/requirements.txt +5 -0
- package/src/generators/preset/files/python/src/__init__.py +0 -0
- package/src/generators/preset/files/python/src/frontend.py +3 -0
- package/src/generators/preset/files/python/src/input_data.py +13 -0
- package/src/generators/preset/files/python/src/main.py +28 -0
- package/src/generators/preset/files/python/src/main_test.py +19 -0
- package/src/generators/preset/files/python/src/output_data.py +15 -0
- package/src/generators/preset/files/python-with-s3/src/frontend.py +6 -0
- package/src/generators/preset/files/python-with-s3/src/input_data.py +17 -0
- package/src/generators/preset/files/python-with-s3/src/main.py +45 -0
- package/src/generators/preset/files/python-with-s3/src/main_test.py +36 -0
- package/src/generators/preset/files/python-with-s3/src/output_data.py +8 -0
- package/src/generators/preset/files/python-with-s3/src/s3.py +27 -0
- package/src/generators/preset/files/python-with-secret/src/frontend.py +17 -0
- package/src/generators/preset/files/python-with-secret/src/input_data.py +40 -0
- package/src/generators/preset/files/python-with-secret/src/main.py +51 -0
- package/src/generators/preset/files/python-with-secret/src/main_test.py +39 -0
- package/src/generators/preset/files/python-with-secret/src/output_data.py +16 -0
- package/src/generators/preset/generator.js +10 -0
- package/src/generators/preset/generator.js.map +1 -1
- package/src/generators/preset/schema.d.ts +6 -1
- package/src/generators/preset/schema.json +32 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class OutputData(BaseModel):
|
|
7
|
+
result: int = Field(
|
|
8
|
+
examples=[3],
|
|
9
|
+
description="Result of applying the operation to a and b",
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
comment: Optional[str] = Field(
|
|
13
|
+
default=None,
|
|
14
|
+
examples=["sum result is 3"],
|
|
15
|
+
description="A string field",
|
|
16
|
+
)
|
|
@@ -6,6 +6,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const path = tslib_1.__importStar(require("path"));
|
|
7
7
|
function presetGenerator(tree, options) {
|
|
8
8
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
var _a;
|
|
9
10
|
const projectRoot = ".";
|
|
10
11
|
const projectName = "";
|
|
11
12
|
(0, devkit_1.addProjectConfiguration)(tree, projectName, {
|
|
@@ -13,7 +14,16 @@ function presetGenerator(tree, options) {
|
|
|
13
14
|
projectType: "application",
|
|
14
15
|
});
|
|
15
16
|
options.os = process.platform;
|
|
17
|
+
options.variant = (_a = options.variant) !== null && _a !== void 0 ? _a : "basic";
|
|
16
18
|
(0, devkit_1.generateFiles)(tree, path.join(__dirname, `files/${options.platform}`), "", options);
|
|
19
|
+
const pythonVariantDirs = {
|
|
20
|
+
"with-secret": "files/python-with-secret",
|
|
21
|
+
"with-s3": "files/python-with-s3",
|
|
22
|
+
};
|
|
23
|
+
const variantDir = pythonVariantDirs[options.variant];
|
|
24
|
+
if (options.platform === "python" && variantDir) {
|
|
25
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, variantDir), "", options);
|
|
26
|
+
}
|
|
17
27
|
yield (0, devkit_1.formatFiles)(tree);
|
|
18
28
|
try {
|
|
19
29
|
const gradlewPath = (0, devkit_1.joinPathFragments)(projectRoot, "gradlew");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../src/generators/preset/generator.ts"],"names":[],"mappings":";;AAUA,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../src/generators/preset/generator.ts"],"names":[],"mappings":";;AAUA,0CA+BC;;AAzCD,uCAMoB;AACpB,mDAA6B;AAG7B,SAAsB,eAAe,CAAC,IAAU,EAAE,OAA8B;;;QAC9E,MAAM,WAAW,GAAG,GAAG,CAAC;QACxB,MAAM,WAAW,GAAG,EAAE,CAAC;QACvB,IAAA,gCAAuB,EAAC,IAAI,EAAE,WAAW,EAAE;YACzC,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,aAAa;SAC3B,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC9B,OAAO,CAAC,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,OAAO,CAAC;QAC7C,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,OAAO,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;QAEpF,MAAM,iBAAiB,GAA2B;YAChD,aAAa,EAAE,0BAA0B;YACzC,SAAS,EAAE,sBAAsB;SAClC,CAAC;QACF,MAAM,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,UAAU,EAAE,CAAC;YAChD,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;QACrE,CAAC;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,IAAA,0BAAiB,EAAC,WAAW,EAAE,SAAS,CAAC,CAAC;YAC9D,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC7B,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,YAAY;YAC1D,CAAC;QACH,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE,EAAE,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;CAAA;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export interface PresetGeneratorSchema {
|
|
2
2
|
name: string;
|
|
3
|
-
|
|
3
|
+
// Extension id, forwarded by the CLI and rendered into kong.json.
|
|
4
|
+
id?: string;
|
|
5
|
+
// Set by the generator at runtime from `process.platform`.
|
|
6
|
+
os?: string;
|
|
4
7
|
platform: "python" | "kotlin";
|
|
8
|
+
// Which starter template to scaffold. Only the python preset currently ships more
|
|
9
|
+
variant?: "basic" | "with-secret" | "with-s3";
|
|
5
10
|
}
|
|
@@ -21,7 +21,37 @@
|
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"x-prompt": "What platform would you like to use?"
|
|
24
|
+
},
|
|
25
|
+
"variant": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Which starter template to scaffold",
|
|
28
|
+
"enum": [
|
|
29
|
+
"basic",
|
|
30
|
+
"with-secret",
|
|
31
|
+
"with-s3"
|
|
32
|
+
],
|
|
33
|
+
"default": "basic",
|
|
34
|
+
"x-prompt": {
|
|
35
|
+
"message": "Which template would you like to use?",
|
|
36
|
+
"type": "list",
|
|
37
|
+
"items": [
|
|
38
|
+
{
|
|
39
|
+
"value": "basic",
|
|
40
|
+
"label": "basic - a single operation"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"value": "with-secret",
|
|
44
|
+
"label": "with-secret - multiple operations with a secret example"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"value": "with-s3",
|
|
48
|
+
"label": "with-s3 - download a file from S3 using an s3 secret"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
24
52
|
}
|
|
25
53
|
},
|
|
26
|
-
"required": [
|
|
27
|
-
|
|
54
|
+
"required": [
|
|
55
|
+
"name"
|
|
56
|
+
]
|
|
57
|
+
}
|