@aws/nx-plugin 1.0.0-rc.1 → 1.0.0-rc.3
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/LICENSE-THIRD-PARTY +583 -489
- package/generators.json +10 -5
- package/package.json +8 -8
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +17 -17
- package/src/preset/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/agent/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/py/api/schema.d.ts +1 -1
- package/src/py/api/schema.json +2 -2
- package/src/py/fast-api/generator.js +48 -36
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/schema.d.ts +1 -1
- package/src/py/fast-api/schema.json +2 -2
- package/src/py/lambda-function/generator.js +19 -16
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.ts +3 -0
- package/src/py/lambda-function/schema.json +8 -0
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +2 -0
- package/src/smithy/project/files/build.Dockerfile.template +1 -0
- package/src/smithy/ts/api/generator.js +71 -54
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/smithy/ts/api/schema.d.ts +1 -1
- package/src/smithy/ts/api/schema.json +1 -1
- package/src/trpc/backend/generator.js +56 -38
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +1 -1
- package/src/trpc/backend/schema.json +2 -2
- package/src/ts/api/generator.js +3 -1
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.ts +1 -1
- package/src/ts/api/schema.json +1 -1
- package/src/ts/lambda-function/generator.js +26 -21
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/schema.d.ts +3 -0
- package/src/ts/lambda-function/schema.json +8 -0
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/rdb/generator.js +73 -55
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/schema.d.ts +1 -1
- package/src/ts/rdb/schema.json +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +36 -34
- package/src/ts/react-website/app/generator.js +81 -75
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.ts +3 -0
- package/src/ts/website/app/schema.d.ts +2 -0
- package/src/ts/website/app/schema.json +8 -0
- package/src/utils/versions.d.ts +52 -52
- package/src/utils/versions.js +51 -51
- package/src/utils/versions.js.map +1 -1
package/generators.json
CHANGED
|
@@ -100,7 +100,8 @@
|
|
|
100
100
|
"factory": "./src/py/mcp-server/generator",
|
|
101
101
|
"schema": "./src/py/mcp-server/schema.json",
|
|
102
102
|
"description": "Generate a Python Model Context Protocol (MCP) server for providing context to Large Language Models",
|
|
103
|
-
"metric": "g24"
|
|
103
|
+
"metric": "g24",
|
|
104
|
+
"guidePages": ["py-mcp-server"]
|
|
104
105
|
},
|
|
105
106
|
"py#project": {
|
|
106
107
|
"factory": "./src/py/project/generator",
|
|
@@ -113,7 +114,8 @@
|
|
|
113
114
|
"factory": "./src/py/agent/generator",
|
|
114
115
|
"schema": "./src/py/agent/schema.json",
|
|
115
116
|
"description": "Add an AI Agent to a Python project",
|
|
116
|
-
"metric": "g25"
|
|
117
|
+
"metric": "g25",
|
|
118
|
+
"guidePages": ["py-agent"]
|
|
117
119
|
},
|
|
118
120
|
"py#agent#mcp-connection": {
|
|
119
121
|
"factory": "./src/py/agent/mcp-connection/generator",
|
|
@@ -182,7 +184,8 @@
|
|
|
182
184
|
"factory": "./src/ts/mcp-server/generator",
|
|
183
185
|
"schema": "./src/ts/mcp-server/schema.json",
|
|
184
186
|
"description": "Generate a TypeScript Model Context Protocol (MCP) server for providing context to Large Language Models",
|
|
185
|
-
"metric": "g18"
|
|
187
|
+
"metric": "g18",
|
|
188
|
+
"guidePages": ["ts-mcp-server"]
|
|
186
189
|
},
|
|
187
190
|
"ts#nx-generator": {
|
|
188
191
|
"factory": "./src/ts/nx-generator/generator",
|
|
@@ -252,7 +255,8 @@
|
|
|
252
255
|
"factory": "./src/ts/agent/generator",
|
|
253
256
|
"schema": "./src/ts/agent/schema.json",
|
|
254
257
|
"description": "Add an AI Agent to a TypeScript project",
|
|
255
|
-
"metric": "g30"
|
|
258
|
+
"metric": "g30",
|
|
259
|
+
"guidePages": ["ts-agent"]
|
|
256
260
|
},
|
|
257
261
|
"ts#agent#mcp-connection": {
|
|
258
262
|
"factory": "./src/ts/agent/mcp-connection/generator",
|
|
@@ -315,7 +319,8 @@
|
|
|
315
319
|
"factory": "./src/ts/rdb/generator",
|
|
316
320
|
"schema": "./src/ts/rdb/schema.json",
|
|
317
321
|
"description": "Create a relational database project",
|
|
318
|
-
"metric": "g38"
|
|
322
|
+
"metric": "g38",
|
|
323
|
+
"guidePages": ["ts-rdb"]
|
|
319
324
|
},
|
|
320
325
|
"ts#rdb#smithy-connection": {
|
|
321
326
|
"factory": "./src/ts/rdb/smithy-connection/generator",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws/nx-plugin",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/awslabs/nx-plugin-for-aws.git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"generators": "./generators.json",
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"nx": "22.7.
|
|
22
|
+
"nx": "22.7.5",
|
|
23
23
|
"prettier": "3.8.3"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"@hey-api/openapi-ts": "0.64.13",
|
|
29
29
|
"@iarna/toml": "2.2.5",
|
|
30
30
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
31
|
-
"@nx/devkit": "22.7.
|
|
32
|
-
"@nx/eslint": "22.7.
|
|
33
|
-
"@nx/js": "22.7.
|
|
34
|
-
"@nx/react": "22.7.
|
|
35
|
-
"@nx/vite": "22.7.
|
|
31
|
+
"@nx/devkit": "22.7.5",
|
|
32
|
+
"@nx/eslint": "22.7.5",
|
|
33
|
+
"@nx/js": "22.7.5",
|
|
34
|
+
"@nx/react": "22.7.5",
|
|
35
|
+
"@nx/vite": "22.7.5",
|
|
36
36
|
"@types/estree": "1.0.9",
|
|
37
37
|
"@types/js-yaml": "4.0.9",
|
|
38
38
|
"@types/mdast": "4.0.4",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@phenomnomnominal/tsquery": "6.2.0",
|
|
41
41
|
"enquirer": "2.4.1",
|
|
42
42
|
"fast-glob": "3.3.3",
|
|
43
|
-
"js-yaml": "4.
|
|
43
|
+
"js-yaml": "4.2.0",
|
|
44
44
|
"lodash.camelcase": "4.3.0",
|
|
45
45
|
"lodash.clonedeepwith": "4.5.0",
|
|
46
46
|
"lodash.deburr": "4.1.0",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`infra generator > should add required dependencies to package.json > dependencies 1`] = `
|
|
4
4
|
{
|
|
5
|
-
"aws-cdk": "2.
|
|
5
|
+
"aws-cdk": "2.1125.0",
|
|
6
6
|
"aws-cdk-lib": "2.257.0",
|
|
7
7
|
"constructs": "10.6.0",
|
|
8
8
|
"esbuild": "0.28.0",
|
|
@@ -13,10 +13,10 @@ exports[`infra generator > should add required dependencies to package.json > de
|
|
|
13
13
|
exports[`infra generator > should add required dependencies to package.json > dev-dependencies 1`] = `
|
|
14
14
|
{
|
|
15
15
|
"@eslint/js": "^9.8.0",
|
|
16
|
-
"@nx/eslint": "22.7.
|
|
17
|
-
"@nx/eslint-plugin": "22.7.
|
|
18
|
-
"@nx/js": "22.7.
|
|
19
|
-
"@nx/vitest": "22.7.
|
|
16
|
+
"@nx/eslint": "22.7.5",
|
|
17
|
+
"@nx/eslint-plugin": "22.7.5",
|
|
18
|
+
"@nx/js": "22.7.5",
|
|
19
|
+
"@nx/vitest": "22.7.5",
|
|
20
20
|
"@swc-node/register": "~1.11.1",
|
|
21
21
|
"@swc/core": "~1.15.5",
|
|
22
22
|
"@swc/helpers": "~0.5.18",
|
|
@@ -24,11 +24,11 @@ exports[`infra generator > should add required dependencies to package.json > de
|
|
|
24
24
|
"@vitest/coverage-v8": "4.1.7",
|
|
25
25
|
"eslint": "^9.8.0",
|
|
26
26
|
"eslint-config-prettier": "^10.0.0",
|
|
27
|
-
"eslint-plugin-prettier": "5.5.
|
|
27
|
+
"eslint-plugin-prettier": "5.5.6",
|
|
28
28
|
"jsdom": "^27.1.0",
|
|
29
29
|
"jsonc-eslint-parser": "3.1.0",
|
|
30
30
|
"prettier": "3.8.3",
|
|
31
|
-
"tsx": "4.22.
|
|
31
|
+
"tsx": "4.22.4",
|
|
32
32
|
"typescript": "~5.9.2",
|
|
33
33
|
"typescript-eslint": "^8.40.0",
|
|
34
34
|
"vite": "8.0.14",
|
|
@@ -39,7 +39,7 @@ exports[`infra generator > should add required dependencies to package.json > de
|
|
|
39
39
|
exports[`infra generator > should add required dependencies to package.json > package-json 1`] = `
|
|
40
40
|
{
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"aws-cdk": "2.
|
|
42
|
+
"aws-cdk": "2.1125.0",
|
|
43
43
|
"aws-cdk-lib": "2.257.0",
|
|
44
44
|
"constructs": "10.6.0",
|
|
45
45
|
"esbuild": "0.28.0",
|
|
@@ -47,10 +47,10 @@ exports[`infra generator > should add required dependencies to package.json > pa
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@eslint/js": "^9.8.0",
|
|
50
|
-
"@nx/eslint": "22.7.
|
|
51
|
-
"@nx/eslint-plugin": "22.7.
|
|
52
|
-
"@nx/js": "22.7.
|
|
53
|
-
"@nx/vitest": "22.7.
|
|
50
|
+
"@nx/eslint": "22.7.5",
|
|
51
|
+
"@nx/eslint-plugin": "22.7.5",
|
|
52
|
+
"@nx/js": "22.7.5",
|
|
53
|
+
"@nx/vitest": "22.7.5",
|
|
54
54
|
"@swc-node/register": "~1.11.1",
|
|
55
55
|
"@swc/core": "~1.15.5",
|
|
56
56
|
"@swc/helpers": "~0.5.18",
|
|
@@ -58,11 +58,11 @@ exports[`infra generator > should add required dependencies to package.json > pa
|
|
|
58
58
|
"@vitest/coverage-v8": "4.1.7",
|
|
59
59
|
"eslint": "^9.8.0",
|
|
60
60
|
"eslint-config-prettier": "^10.0.0",
|
|
61
|
-
"eslint-plugin-prettier": "5.5.
|
|
61
|
+
"eslint-plugin-prettier": "5.5.6",
|
|
62
62
|
"jsdom": "^27.1.0",
|
|
63
63
|
"jsonc-eslint-parser": "3.1.0",
|
|
64
64
|
"prettier": "3.8.3",
|
|
65
|
-
"tsx": "4.22.
|
|
65
|
+
"tsx": "4.22.4",
|
|
66
66
|
"typescript": "~5.9.2",
|
|
67
67
|
"typescript-eslint": "^8.40.0",
|
|
68
68
|
"vite": "8.0.14",
|
|
@@ -84,7 +84,7 @@ exports[`infra generator > should configure Checkov target correctly > checkov-t
|
|
|
84
84
|
"{workspaceRoot}/dist/{projectRoot}/cdk.out",
|
|
85
85
|
],
|
|
86
86
|
"options": {
|
|
87
|
-
"command": "uvx --from checkov==3.2.
|
|
87
|
+
"command": "uvx --from checkov==3.2.532 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
88
88
|
},
|
|
89
89
|
"outputs": [
|
|
90
90
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -177,7 +177,7 @@ exports[`infra generator > should configure project.json with correct targets >
|
|
|
177
177
|
"{workspaceRoot}/dist/{projectRoot}/cdk.out",
|
|
178
178
|
],
|
|
179
179
|
"options": {
|
|
180
|
-
"command": "uvx --from checkov==3.2.
|
|
180
|
+
"command": "uvx --from checkov==3.2.532 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
181
181
|
},
|
|
182
182
|
"outputs": [
|
|
183
183
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -739,7 +739,7 @@ exports[`infra generator > should handle custom project names correctly > custom
|
|
|
739
739
|
"{workspaceRoot}/dist/{projectRoot}/cdk.out",
|
|
740
740
|
],
|
|
741
741
|
"options": {
|
|
742
|
-
"command": "uvx --from checkov==3.2.
|
|
742
|
+
"command": "uvx --from checkov==3.2.532 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
743
743
|
},
|
|
744
744
|
"outputs": [
|
|
745
745
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -199,14 +199,14 @@ exports[`preset generator > should run successfully > package.json 1`] = `
|
|
|
199
199
|
"name": "@proj/source",
|
|
200
200
|
"dependencies": {},
|
|
201
201
|
"devDependencies": {
|
|
202
|
-
"@nx/js": "22.7.
|
|
203
|
-
"@nx/workspace": "22.7.
|
|
202
|
+
"@nx/js": "22.7.5",
|
|
203
|
+
"@nx/workspace": "22.7.5",
|
|
204
204
|
"@swc-node/register": "~1.11.1",
|
|
205
205
|
"@swc/core": "~1.15.5",
|
|
206
206
|
"@swc/helpers": "~0.5.18",
|
|
207
207
|
"prettier": "~3.6.2",
|
|
208
208
|
"typescript": "6.0.3",
|
|
209
|
-
"typescript-eslint": "8.
|
|
209
|
+
"typescript-eslint": "8.60.1"
|
|
210
210
|
},
|
|
211
211
|
"type": "module",
|
|
212
212
|
"scripts": {
|
|
@@ -747,13 +747,13 @@ version = "0.1.0"
|
|
|
747
747
|
dependencies = [
|
|
748
748
|
"proj.agent_connection",
|
|
749
749
|
"aws-lambda-powertools==3.29.0",
|
|
750
|
-
"aws-opentelemetry-distro==0.17.
|
|
751
|
-
"bedrock-agentcore==1.
|
|
752
|
-
"boto3==1.43.
|
|
750
|
+
"aws-opentelemetry-distro==0.17.1",
|
|
751
|
+
"bedrock-agentcore==1.13.0",
|
|
752
|
+
"boto3==1.43.20",
|
|
753
753
|
"fastapi==0.136.3",
|
|
754
|
-
"mcp==1.27.
|
|
755
|
-
"strands-agents==1.
|
|
756
|
-
"strands-agents-tools==0.
|
|
754
|
+
"mcp==1.27.2",
|
|
755
|
+
"strands-agents==1.42.0",
|
|
756
|
+
"strands-agents-tools==0.7.0",
|
|
757
757
|
"uvicorn==0.48.0"
|
|
758
758
|
]
|
|
759
759
|
|
package/src/py/api/schema.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { IacOption } from '../../utils/iac';
|
|
|
7
7
|
export interface PyApiGeneratorSchema {
|
|
8
8
|
readonly name: string;
|
|
9
9
|
readonly framework?: 'fastapi';
|
|
10
|
-
readonly infra: 'rest-lambda' | 'http-lambda';
|
|
10
|
+
readonly infra: 'rest-lambda' | 'http-lambda' | 'none';
|
|
11
11
|
readonly integrationPattern?: 'isolated' | 'shared';
|
|
12
12
|
readonly auth: 'iam' | 'cognito' | 'custom';
|
|
13
13
|
readonly directory?: string;
|
package/src/py/api/schema.json
CHANGED
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
},
|
|
90
90
|
"infra": {
|
|
91
91
|
"type": "string",
|
|
92
|
-
"description": "The type of infrastructure to use to deploy this API.
|
|
92
|
+
"description": "The type of infrastructure to use to deploy this API.",
|
|
93
93
|
"default": "rest-lambda",
|
|
94
|
-
"enum": ["rest-lambda", "http-lambda"],
|
|
94
|
+
"enum": ["rest-lambda", "http-lambda", "none"],
|
|
95
95
|
"x-prompt": "What infrastructure would you like to deploy your API with?",
|
|
96
96
|
"x-priority": "important"
|
|
97
97
|
}
|
|
@@ -29,10 +29,6 @@ exports.FAST_API_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
|
29
29
|
*/
|
|
30
30
|
const pyFastApiProjectGenerator = async (tree, schema) => {
|
|
31
31
|
const integrationPattern = getIntegrationPattern(schema);
|
|
32
|
-
const iac = await (0, iac_1.resolveIac)(tree, schema.iac);
|
|
33
|
-
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
34
|
-
iac,
|
|
35
|
-
});
|
|
36
32
|
const { dir, normalizedModuleName, fullyQualifiedName } = (0, generator_1.getPyProjectDetails)(tree, {
|
|
37
33
|
name: schema.name,
|
|
38
34
|
directory: schema.directory,
|
|
@@ -41,13 +37,23 @@ const pyFastApiProjectGenerator = async (tree, schema) => {
|
|
|
41
37
|
});
|
|
42
38
|
const apiNameKebabCase = (0, names_1.toKebabCase)(schema.name);
|
|
43
39
|
const apiNameClassName = (0, names_1.toClassName)(schema.name);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
let projectExists;
|
|
41
|
+
try {
|
|
42
|
+
(0, devkit_1.readProjectConfiguration)(tree, fullyQualifiedName);
|
|
43
|
+
projectExists = true;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
projectExists = false;
|
|
47
|
+
}
|
|
48
|
+
if (!projectExists) {
|
|
49
|
+
await (0, generator_1.default)(tree, {
|
|
50
|
+
name: schema.name,
|
|
51
|
+
directory: schema.directory,
|
|
52
|
+
subDirectory: schema.subDirectory,
|
|
53
|
+
moduleName: normalizedModuleName,
|
|
54
|
+
type: 'application',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
51
57
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, fullyQualifiedName);
|
|
52
58
|
const port = (0, port_1.assignPort)(tree, projectConfig, 8000);
|
|
53
59
|
const { bundleOutputDir, bundleTargetName } = (0, bundle_1.addPythonBundleTarget)(projectConfig);
|
|
@@ -99,33 +105,39 @@ const pyFastApiProjectGenerator = async (tree, schema) => {
|
|
|
99
105
|
}, {
|
|
100
106
|
overwriteStrategy: devkit_1.OverwriteStrategy.Overwrite,
|
|
101
107
|
});
|
|
102
|
-
if (schema.
|
|
103
|
-
const
|
|
104
|
-
(0,
|
|
105
|
-
|
|
108
|
+
if (schema.infra !== 'none') {
|
|
109
|
+
const iac = await (0, iac_1.resolveIac)(tree, schema.iac);
|
|
110
|
+
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
111
|
+
iac,
|
|
112
|
+
});
|
|
113
|
+
if (schema.auth === 'custom') {
|
|
114
|
+
const authorizerType = schema.infra === 'http-lambda' ? 'http' : 'rest';
|
|
115
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', '..', 'utils', 'api-constructs', 'files', 'py-authorizer', authorizerType), (0, devkit_1.joinPathFragments)(dir, normalizedModuleName), {}, {
|
|
116
|
+
overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
// Add the CDK construct to deploy the FastAPI to shared constructs
|
|
120
|
+
await (0, api_constructs_1.addApiGatewayInfra)(tree, {
|
|
121
|
+
apiProjectName: projectConfig.name,
|
|
122
|
+
apiNameClassName,
|
|
123
|
+
apiNameKebabCase,
|
|
124
|
+
constructType: schema.infra === 'http-lambda' ? 'http' : 'rest',
|
|
125
|
+
backend: {
|
|
126
|
+
type: 'fastapi',
|
|
127
|
+
moduleName: normalizedModuleName,
|
|
128
|
+
bundleOutputDir,
|
|
129
|
+
integrationPattern,
|
|
130
|
+
},
|
|
131
|
+
auth: schema.auth,
|
|
132
|
+
iac,
|
|
133
|
+
});
|
|
134
|
+
(0, open_api_metadata_1.addSharedConstructsOpenApiMetadataGenerateTarget)(tree, {
|
|
135
|
+
iac,
|
|
136
|
+
apiNameKebabCase,
|
|
137
|
+
specPath,
|
|
138
|
+
specBuildTargetName: `${projectConfig.name}:openapi`,
|
|
106
139
|
});
|
|
107
140
|
}
|
|
108
|
-
// Add the CDK construct to deploy the FastAPI to shared constructs
|
|
109
|
-
await (0, api_constructs_1.addApiGatewayInfra)(tree, {
|
|
110
|
-
apiProjectName: projectConfig.name,
|
|
111
|
-
apiNameClassName,
|
|
112
|
-
apiNameKebabCase,
|
|
113
|
-
constructType: schema.infra === 'http-lambda' ? 'http' : 'rest',
|
|
114
|
-
backend: {
|
|
115
|
-
type: 'fastapi',
|
|
116
|
-
moduleName: normalizedModuleName,
|
|
117
|
-
bundleOutputDir,
|
|
118
|
-
integrationPattern,
|
|
119
|
-
},
|
|
120
|
-
auth: schema.auth,
|
|
121
|
-
iac,
|
|
122
|
-
});
|
|
123
|
-
(0, open_api_metadata_1.addSharedConstructsOpenApiMetadataGenerateTarget)(tree, {
|
|
124
|
-
iac,
|
|
125
|
-
apiNameKebabCase,
|
|
126
|
-
specPath,
|
|
127
|
-
specBuildTargetName: `${projectConfig.name}:openapi`,
|
|
128
|
-
});
|
|
129
141
|
(0, py_1.addDependenciesToPyProjectToml)(tree, dir, [
|
|
130
142
|
'fastapi',
|
|
131
143
|
'uvicorn',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/fast-api/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAUoB;AAEpB,yDAA6D;AAC7D,0EAA+E;AAC/E,qEAA0E;AAC1E,6CAA6D;AAC7D,+CAA0D;AAC1D,+CAAoD;AACpD,uCAIwB;AACxB,iDAAsE;AACtE,8EAA+E;AAC/E,uCAA4C;AAC5C,+CAAwD;AACxD,2CAA8C;AAC9C,sDAAkE;AAClE,uCAGwB;AACxB,yCAA6C;AAC7C,oFAAgH;AAEnG,QAAA,uBAAuB,GAClC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAE/B;;GAEG;AACI,MAAM,yBAAyB,GAAG,KAAK,EAC5C,IAAU,EACV,MAAuC,EACX,EAAE;IAC9B,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/fast-api/generator.ts"],"names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AA,yBAAoB,EAAC,IAAI,EAAE,kBAAkB,EAAE,+BAAuB,CAAC,CAAC;IAExE,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,+BAAuB,CAAC,CAAC,CAAC;IAEvE,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IAEjC,OAAO,KAAK,IAAI,EAAE;QAChB,MAAM,IAAI,wBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,oBAAM,EAAE,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAC9D,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AApLW,QAAA,yBAAyB,6BAoLpC;AAEF,MAAM,qBAAqB,GAAG,CAC5B,MAAuC,EAChB,EAAE,CAAC,MAAM,CAAC,kBAAkB,IAAI,UAAU,CAAC;AAEpE,kBAAe,iCAAyB,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { IacOption } from '../../utils/iac';
|
|
|
7
7
|
|
|
8
8
|
export interface PyFastApiProjectGeneratorSchema {
|
|
9
9
|
readonly name: string;
|
|
10
|
-
readonly infra: 'rest-lambda' | 'http-lambda';
|
|
10
|
+
readonly infra: 'rest-lambda' | 'http-lambda' | 'none';
|
|
11
11
|
readonly integrationPattern?: 'isolated' | 'shared';
|
|
12
12
|
readonly auth: 'iam' | 'cognito' | 'custom';
|
|
13
13
|
readonly directory?: string;
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
},
|
|
72
72
|
"infra": {
|
|
73
73
|
"type": "string",
|
|
74
|
-
"description": "The type of infrastructure to use to deploy this API.
|
|
74
|
+
"description": "The type of infrastructure to use to deploy this API.",
|
|
75
75
|
"default": "rest-lambda",
|
|
76
|
-
"enum": ["rest-lambda", "http-lambda"],
|
|
76
|
+
"enum": ["rest-lambda", "http-lambda", "none"],
|
|
77
77
|
"x-prompt": "What infrastructure would you like to deploy your API with?",
|
|
78
78
|
"x-priority": "important"
|
|
79
79
|
}
|
|
@@ -61,25 +61,28 @@ const pyLambdaFunctionGenerator = async (tree, schema) => {
|
|
|
61
61
|
const lambdaFunctionClassName = (0, names_1.toClassName)(schema.name);
|
|
62
62
|
const lambdaFunctionKebabCase = (0, names_1.toKebabCase)(schema.name);
|
|
63
63
|
const functionPath = (0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, schema.functionPath ?? '', `${normalizedFunctionName}.py`);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
const infra = schema.infra ?? 'lambda';
|
|
65
|
+
const handlerAlreadyExists = tree.exists(functionPath);
|
|
66
|
+
if (handlerAlreadyExists && infra === 'none') {
|
|
67
|
+
throw new Error(`This project already has a lambda function with the name ${normalizedFunctionName}. Please remove the lambda function before running this generator or use a different name.`);
|
|
67
68
|
}
|
|
68
|
-
const iac = await (0, iac_1.resolveIac)(tree, schema.iac);
|
|
69
|
-
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
70
|
-
iac,
|
|
71
|
-
});
|
|
72
69
|
// Check if the project has a bundle target and if not add it
|
|
73
70
|
const { bundleOutputDir } = (0, bundle_1.addPythonBundleTarget)(projectConfig);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
if (infra !== 'none') {
|
|
72
|
+
const iac = await (0, iac_1.resolveIac)(tree, schema.iac);
|
|
73
|
+
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
74
|
+
iac,
|
|
75
|
+
});
|
|
76
|
+
await (0, function_constructs_1.addLambdaFunctionInfra)(tree, {
|
|
77
|
+
functionProjectName: projectConfig.name,
|
|
78
|
+
nameClassName: constructFunctionClassName,
|
|
79
|
+
nameKebabCase: constructFunctionKebabCase,
|
|
80
|
+
handler: normalizedFunctionPath,
|
|
81
|
+
bundlePathFromRoot: bundleOutputDir,
|
|
82
|
+
runtime: 'python',
|
|
83
|
+
iac,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
83
86
|
const enhancedOptions = {
|
|
84
87
|
...schema,
|
|
85
88
|
dir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/lambda-function/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAQoB;AAEpB,yDAA6D;AAC7D,qEAA0E;AAC1E,6CAK2B;AAC3B,+CAA0D;AAC1D,qDAAoD;AACpD,+CAAoD;AACpD,uCAKwB;AACxB,iDAAsE;AACtE,sDAAkE;AAClE,uCAAgE;AAChE,6FAA6F;AAC7F,6CAA0D;AAC1D,yCAA6C;AAEhC,QAAA,8BAA8B,GACzC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAiB/B,MAAM,wBAAwB,GAAG,CAC/B,IAAU,EACV,MAAmE,EAC5C,EAAE;IACzB,MAAM,KAAK,GAAG,IAAA,mBAAW,EAAC,IAAA,uBAAW,EAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,MAAM,sBAAsB,GAAG,IAAA,mBAAW,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,0BAA0B,GAAG,GAAG,KAAK,IAAI,sBAAsB,EAAE,CAAC;IACxE,MAAM,sBAAsB,GAAG,GAAG,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAA,qBAAa,EAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,sBAAsB,iBAAiB,CAAC;IAErK,OAAO;QACL,0BAA0B;QAC1B,sBAAsB;QACtB,sBAAsB;KACvB,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACI,MAAM,yBAAyB,GAAG,KAAK,EAC5C,IAAU,EACV,MAAuC,EACX,EAAE;IAC9B,MAAM,aAAa,GAAG,IAAA,wCAAmC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,MAAM,uBAAuB,GAAG,IAAA,mBAAW,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEzD,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,aAAa,CAAC,UAAU,EACxB,MAAM,CAAC,YAAY,IAAI,EAAE,EACzB,GAAG,sBAAsB,KAAK,CAC/B,CAAC;IAEF,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/lambda-function/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAQoB;AAEpB,yDAA6D;AAC7D,qEAA0E;AAC1E,6CAK2B;AAC3B,+CAA0D;AAC1D,qDAAoD;AACpD,+CAAoD;AACpD,uCAKwB;AACxB,iDAAsE;AACtE,sDAAkE;AAClE,uCAAgE;AAChE,6FAA6F;AAC7F,6CAA0D;AAC1D,yCAA6C;AAEhC,QAAA,8BAA8B,GACzC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAiB/B,MAAM,wBAAwB,GAAG,CAC/B,IAAU,EACV,MAAmE,EAC5C,EAAE;IACzB,MAAM,KAAK,GAAG,IAAA,mBAAW,EAAC,IAAA,uBAAW,EAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,MAAM,sBAAsB,GAAG,IAAA,mBAAW,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,0BAA0B,GAAG,GAAG,KAAK,IAAI,sBAAsB,EAAE,CAAC;IACxE,MAAM,sBAAsB,GAAG,GAAG,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAA,qBAAa,EAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,sBAAsB,iBAAiB,CAAC;IAErK,OAAO;QACL,0BAA0B;QAC1B,sBAAsB;QACtB,sBAAsB;KACvB,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACI,MAAM,yBAAyB,GAAG,KA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IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAnIW,QAAA,yBAAyB,6BAmIpC;AACF,kBAAe,iCAAyB,CAAC"}
|
|
@@ -47,10 +47,13 @@ type EventSource =
|
|
|
47
47
|
| 'VpcLatticeModel'
|
|
48
48
|
| 'VpcLatticeV2Model';
|
|
49
49
|
|
|
50
|
+
export type LambdaInfraOption = 'lambda' | 'none';
|
|
51
|
+
|
|
50
52
|
export interface PyLambdaFunctionGeneratorSchema {
|
|
51
53
|
readonly project: string;
|
|
52
54
|
readonly name: string;
|
|
53
55
|
readonly functionPath?: string;
|
|
54
56
|
readonly event?: EventSource;
|
|
57
|
+
readonly infra?: LambdaInfraOption;
|
|
55
58
|
readonly iac: IacOption;
|
|
56
59
|
}
|
|
@@ -75,6 +75,14 @@
|
|
|
75
75
|
"default": "Any",
|
|
76
76
|
"x-prompt": "Enter the event source model to use for the lambda function"
|
|
77
77
|
},
|
|
78
|
+
"infra": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "The type of infrastructure to deploy your Lambda function with.",
|
|
81
|
+
"enum": ["lambda", "none"],
|
|
82
|
+
"default": "lambda",
|
|
83
|
+
"x-priority": "important",
|
|
84
|
+
"x-prompt": "What infrastructure would you like to deploy your Lambda function with?"
|
|
85
|
+
},
|
|
78
86
|
"iac": {
|
|
79
87
|
"type": "string",
|
|
80
88
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
@@ -647,10 +647,10 @@ name = "proj.test_project"
|
|
|
647
647
|
version = "0.1.0"
|
|
648
648
|
dependencies = [
|
|
649
649
|
"aws-lambda-powertools==3.29.0",
|
|
650
|
-
"mcp==1.27.
|
|
650
|
+
"mcp==1.27.2",
|
|
651
651
|
"uvicorn==0.48.0",
|
|
652
|
-
"boto3==1.43.
|
|
653
|
-
"aws-opentelemetry-distro==0.17.
|
|
652
|
+
"boto3==1.43.20",
|
|
653
|
+
"aws-opentelemetry-distro==0.17.1"
|
|
654
654
|
]
|
|
655
655
|
|
|
656
656
|
[dependency-groups]
|
|
@@ -137,6 +137,7 @@ service CustomService {
|
|
|
137
137
|
|
|
138
138
|
exports[`smithyProjectGenerator > should generate smithy project with default options > build.Dockerfile 1`] = `
|
|
139
139
|
"FROM public.ecr.aws/docker/library/node:24 AS builder
|
|
140
|
+
ENV CI=true
|
|
140
141
|
|
|
141
142
|
# Output directory
|
|
142
143
|
RUN mkdir /out
|
|
@@ -378,6 +379,7 @@ exports[`smithyProjectGenerator > should generate smithy project with subdirecto
|
|
|
378
379
|
|
|
379
380
|
exports[`smithyProjectGenerator > should generate valid Docker build configuration > dockerfile 1`] = `
|
|
380
381
|
"FROM public.ecr.aws/docker/library/node:24 AS builder
|
|
382
|
+
ENV CI=true
|
|
381
383
|
|
|
382
384
|
# Output directory
|
|
383
385
|
RUN mkdir /out
|