@aws/nx-plugin 1.0.8 → 1.0.10
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 +100 -562
- package/migrations.json +67 -24
- package/package.json +10 -10
- package/src/agentcore-gateway/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/migrations/latest/pin-strands-mcp-client-peer/metadata.json +3 -0
- package/src/migrations/latest/pin-strands-mcp-client-peer/migration.d.ts +20 -0
- package/src/migrations/latest/pin-strands-mcp-client-peer/migration.js +51 -0
- package/src/migrations/latest/pin-strands-mcp-client-peer/migration.js.map +1 -0
- package/src/migrations/latest/py-dynamodb-bind-base-model-meta/metadata.json +3 -0
- package/src/migrations/latest/{rdb-drop-lambda-rie → py-dynamodb-bind-base-model-meta}/migration.d.ts +1 -1
- package/src/migrations/latest/py-dynamodb-bind-base-model-meta/migration.js +56 -0
- package/src/migrations/latest/py-dynamodb-bind-base-model-meta/migration.js.map +1 -0
- package/src/migrations/v1.0.7/0001-pin-strands-express-peer/migration.js.map +1 -0
- package/src/migrations/v1.0.7/0002-rdb-drop-lambda-rie/migration.js.map +1 -0
- package/src/migrations/v1.0.8/0001-infra-test-loop/migration.js.map +1 -0
- package/src/migrations/v1.0.8/0002-py-dynamodb-type-base-model-meta/metadata.json +3 -0
- package/src/migrations/v1.0.8/0002-py-dynamodb-type-base-model-meta/migration.d.ts +6 -0
- package/src/migrations/v1.0.8/0002-py-dynamodb-type-base-model-meta/migration.js +54 -0
- package/src/migrations/v1.0.8/0002-py-dynamodb-type-base-model-meta/migration.js.map +1 -0
- package/src/migrations/v1.0.8/0003-cache-inputs-outputs/migration.js.map +1 -0
- package/src/open-api/py-client/files/shared/errors.py.template +3 -5
- package/src/open-api/py-client/generator.d.ts +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +5 -5
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +9 -9
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +4 -4
- package/src/py/agent/a2a-connection/generator.d.ts +1 -1
- package/src/py/agent/gateway-connection/generator.d.ts +1 -1
- package/src/py/agent/mcp-connection/generator.d.ts +1 -1
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +8 -4
- package/src/py/dynamodb/base-model-meta.d.ts +39 -0
- package/src/py/dynamodb/base-model-meta.js +54 -0
- package/src/py/dynamodb/base-model-meta.js.map +1 -0
- package/src/py/dynamodb/files/__name__/entities/base.py.template +3 -1
- package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +12 -12
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/rdb/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +8 -8
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +12 -12
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/agent/a2a-connection/generator.d.ts +2 -2
- package/src/ts/agent/gateway-connection/generator.d.ts +3 -1
- package/src/ts/agent/gateway-connection/generator.js +4 -0
- package/src/ts/agent/gateway-connection/generator.js.map +1 -1
- package/src/ts/agent/generator.d.ts +3 -1
- package/src/ts/agent/generator.js +5 -0
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/generator.d.ts +3 -1
- package/src/ts/agent/mcp-connection/generator.js +4 -0
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/astro-docs/generator.d.ts +1 -1
- package/src/ts/dcr-proxy/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +41 -39
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +2 -2
- package/src/utils/agent-connection/agent-connection.d.ts +9 -3
- package/src/utils/agent-connection/agent-connection.js +9 -2
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/git.d.ts +5 -0
- package/src/utils/git.js +29 -4
- package/src/utils/git.js.map +1 -1
- package/src/utils/shared-constructs.d.ts +5 -0
- package/src/utils/shared-constructs.js +10 -9
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/version-lockstep/hold.d.ts +29 -0
- package/src/utils/version-lockstep/hold.js +40 -0
- package/src/utils/version-lockstep/hold.js.map +1 -0
- package/src/utils/version-lockstep/lockstep.d.ts +2 -2
- package/src/utils/version-lockstep/lockstep.js.map +1 -1
- package/src/utils/versions.d.ts +81 -80
- package/src/utils/versions.js +79 -78
- package/src/utils/versions.js.map +1 -1
- package/src/migrations/latest/cache-inputs-outputs/migration.js.map +0 -1
- package/src/migrations/latest/infra-test-loop/migration.js.map +0 -1
- package/src/migrations/latest/pin-strands-express-peer/migration.js.map +0 -1
- package/src/migrations/latest/py-dynamodb-type-base-model-meta/metadata.json +0 -3
- package/src/migrations/latest/py-dynamodb-type-base-model-meta/migration.js +0 -87
- package/src/migrations/latest/py-dynamodb-type-base-model-meta/migration.js.map +0 -1
- package/src/migrations/latest/rdb-drop-lambda-rie/migration.js.map +0 -1
- /package/src/migrations/{latest/pin-strands-express-peer → v1.0.7/0001-pin-strands-express-peer}/metadata.json +0 -0
- /package/src/migrations/{latest/pin-strands-express-peer → v1.0.7/0001-pin-strands-express-peer}/migration.d.ts +0 -0
- /package/src/migrations/{latest/pin-strands-express-peer → v1.0.7/0001-pin-strands-express-peer}/migration.js +0 -0
- /package/src/migrations/{latest/rdb-drop-lambda-rie → v1.0.7/0002-rdb-drop-lambda-rie}/metadata.json +0 -0
- /package/src/migrations/{latest/cache-inputs-outputs → v1.0.7/0002-rdb-drop-lambda-rie}/migration.d.ts +0 -0
- /package/src/migrations/{latest/rdb-drop-lambda-rie → v1.0.7/0002-rdb-drop-lambda-rie}/migration.js +0 -0
- /package/src/migrations/{latest/infra-test-loop → v1.0.8/0001-infra-test-loop}/metadata.json +0 -0
- /package/src/migrations/{latest/infra-test-loop → v1.0.8/0001-infra-test-loop}/migration.d.ts +0 -0
- /package/src/migrations/{latest/infra-test-loop → v1.0.8/0001-infra-test-loop}/migration.js +0 -0
- /package/src/migrations/{latest/cache-inputs-outputs → v1.0.8/0003-cache-inputs-outputs}/metadata.json +0 -0
- /package/src/migrations/{latest/py-dynamodb-type-base-model-meta → v1.0.8/0003-cache-inputs-outputs}/migration.d.ts +0 -0
- /package/src/migrations/{latest/cache-inputs-outputs → v1.0.8/0003-cache-inputs-outputs}/migration.js +0 -0
package/src/utils/versions.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
'@aws/aws-distro-opentelemetry-node-autoinstrumentation': '0.13.0',
|
|
10
10
|
// Pinned above the version the ADOT autoinstrumentation package resolves
|
|
11
11
|
// transitively (2.8.0) to clear CVE-2026-59892 (HIGH).
|
|
12
|
-
'@opentelemetry/propagator-jaeger': '2.
|
|
12
|
+
'@opentelemetry/propagator-jaeger': '2.12.0',
|
|
13
13
|
// Overridden in the vended agent/MCP image builds to clear CVE-2026-14257
|
|
14
14
|
// (HIGH) in brace-expansion: minimatch 10 is the lowest major depending on
|
|
15
15
|
// brace-expansion 5.x, the only line Trivy's `< 5.0.8` advisory range treats
|
|
@@ -21,44 +21,45 @@
|
|
|
21
21
|
// CVE-2026-40345 fix (HIGH) and mysql2 below the GHSA-3f6p-5ww8-9rcr fix
|
|
22
22
|
// (HIGH). Neither is imported by the handler, which drives the schema engine.
|
|
23
23
|
'deepmerge-ts': '8.0.2',
|
|
24
|
-
mysql2: '3.24.
|
|
25
|
-
'@aws-sdk/client-dynamodb': '3.
|
|
26
|
-
'@aws-sdk/client-api-gateway': '3.
|
|
27
|
-
'@aws-sdk/client-iam': '3.
|
|
28
|
-
'@aws-sdk/client-bedrock-agentcore': '3.
|
|
29
|
-
'@aws-sdk/client-bedrock-runtime': '3.
|
|
30
|
-
'@aws-sdk/client-s3': '3.
|
|
31
|
-
'@aws-sdk/client-sts': '3.
|
|
32
|
-
'@aws-sdk/client-cognito-identity-provider': '3.
|
|
33
|
-
'@aws-sdk/credential-providers': '3.
|
|
34
|
-
'@aws-sdk/credential-provider-cognito-identity': '3.972.
|
|
35
|
-
'@aws-sdk/client-secrets-manager': '3.
|
|
36
|
-
'@aws-sdk/rds-signer': '3.
|
|
37
|
-
'@smithy/server-apigateway': '0.3.
|
|
38
|
-
'@smithy/server-node': '0.3.
|
|
39
|
-
'@aws-lambda-powertools/logger': '2.
|
|
40
|
-
'@aws-lambda-powertools/metrics': '2.
|
|
41
|
-
'@aws-lambda-powertools/parameters': '2.
|
|
42
|
-
'@aws-lambda-powertools/tracer': '2.
|
|
43
|
-
'@aws-lambda-powertools/parser': '2.
|
|
44
|
-
'@aws-sdk/client-appconfigdata': '3.
|
|
24
|
+
mysql2: '3.24.6',
|
|
25
|
+
'@aws-sdk/client-dynamodb': '3.1151.0',
|
|
26
|
+
'@aws-sdk/client-api-gateway': '3.1151.0',
|
|
27
|
+
'@aws-sdk/client-iam': '3.1151.0',
|
|
28
|
+
'@aws-sdk/client-bedrock-agentcore': '3.1151.0',
|
|
29
|
+
'@aws-sdk/client-bedrock-runtime': '3.1151.0',
|
|
30
|
+
'@aws-sdk/client-s3': '3.1151.0',
|
|
31
|
+
'@aws-sdk/client-sts': '3.1151.0',
|
|
32
|
+
'@aws-sdk/client-cognito-identity-provider': '3.1151.0',
|
|
33
|
+
'@aws-sdk/credential-providers': '3.1151.0',
|
|
34
|
+
'@aws-sdk/credential-provider-cognito-identity': '3.972.73',
|
|
35
|
+
'@aws-sdk/client-secrets-manager': '3.1151.0',
|
|
36
|
+
'@aws-sdk/rds-signer': '3.1151.0',
|
|
37
|
+
'@smithy/server-apigateway': '0.3.4',
|
|
38
|
+
'@smithy/server-node': '0.3.4',
|
|
39
|
+
'@aws-lambda-powertools/logger': '2.36.0',
|
|
40
|
+
'@aws-lambda-powertools/metrics': '2.36.0',
|
|
41
|
+
'@aws-lambda-powertools/parameters': '2.36.0',
|
|
42
|
+
'@aws-lambda-powertools/tracer': '2.36.0',
|
|
43
|
+
'@aws-lambda-powertools/parser': '2.36.0',
|
|
44
|
+
'@aws-sdk/client-appconfigdata': '3.1151.0',
|
|
45
45
|
'@middy/core': '7.9.2',
|
|
46
46
|
'@nxlv/python': '23.2.1',
|
|
47
47
|
'@nx-extend/terraform': '10.4.1',
|
|
48
48
|
// These must all hold the same version — see NX_PACKAGES.
|
|
49
|
-
nx: '23.
|
|
50
|
-
'@nx/devkit': '23.
|
|
51
|
-
'@nx/js': '23.
|
|
52
|
-
'@nx/react': '23.
|
|
53
|
-
'@nx/vite': '23.
|
|
54
|
-
'@nx/vitest': '23.
|
|
55
|
-
'@nx/workspace': '23.
|
|
56
|
-
'create-nx-workspace': '23.
|
|
49
|
+
nx: '23.3.0',
|
|
50
|
+
'@nx/devkit': '23.3.0',
|
|
51
|
+
'@nx/js': '23.3.0',
|
|
52
|
+
'@nx/react': '23.3.0',
|
|
53
|
+
'@nx/vite': '23.3.0',
|
|
54
|
+
'@nx/vitest': '23.3.0',
|
|
55
|
+
'@nx/workspace': '23.3.0',
|
|
56
|
+
'create-nx-workspace': '23.3.0',
|
|
57
57
|
'@swc-node/register': '1.12.1',
|
|
58
|
-
'@swc/core': '1.16.
|
|
59
|
-
'@modelcontextprotocol/sdk': '1.32.
|
|
60
|
-
'@modelcontextprotocol/
|
|
61
|
-
'@
|
|
58
|
+
'@swc/core': '1.16.18',
|
|
59
|
+
'@modelcontextprotocol/sdk': '1.32.1',
|
|
60
|
+
'@modelcontextprotocol/client': '2.3.1',
|
|
61
|
+
'@modelcontextprotocol/inspector': '2.10.1',
|
|
62
|
+
'@ag-ui/a2ui-toolkit': '0.0.5',
|
|
62
63
|
'@ag-ui/aws-strands': '0.3.0',
|
|
63
64
|
'@ag-ui/client': '0.0.59',
|
|
64
65
|
'@ag-ui/core': '0.0.59',
|
|
@@ -66,22 +67,22 @@
|
|
|
66
67
|
'agent-chat-cli': '0.3.0',
|
|
67
68
|
'@copilotkit/react-core': '1.74.0',
|
|
68
69
|
rxjs: '7.8.2',
|
|
69
|
-
'@strands-agents/sdk': '1.
|
|
70
|
-
'@tanstack/react-router': '1.170.
|
|
71
|
-
'@tanstack/router-plugin': '1.168.
|
|
72
|
-
'@tanstack/router-generator': '1.167.
|
|
70
|
+
'@strands-agents/sdk': '1.20.0',
|
|
71
|
+
'@tanstack/react-router': '1.170.44',
|
|
72
|
+
'@tanstack/router-plugin': '1.168.45',
|
|
73
|
+
'@tanstack/router-generator': '1.167.43',
|
|
73
74
|
'@tanstack/virtual-file-routes': '1.162.0',
|
|
74
75
|
'@tanstack/router-utils': '1.162.3',
|
|
75
|
-
'@cloudscape-design/board-components': '3.0.
|
|
76
|
-
'@cloudscape-design/chat-components': '1.0.
|
|
77
|
-
'@cloudscape-design/components': '3.0.
|
|
76
|
+
'@cloudscape-design/board-components': '3.0.238',
|
|
77
|
+
'@cloudscape-design/chat-components': '1.0.179',
|
|
78
|
+
'@cloudscape-design/components': '3.0.1400',
|
|
78
79
|
'@cloudscape-design/global-styles': '1.0.71',
|
|
79
|
-
'@tanstack/react-query': '5.104.
|
|
80
|
-
'@tanstack/react-query-devtools': '5.104.
|
|
80
|
+
'@tanstack/react-query': '5.104.2',
|
|
81
|
+
'@tanstack/react-query-devtools': '5.104.2',
|
|
81
82
|
'@trpc/tanstack-react-query': '11.19.0',
|
|
82
83
|
'@trpc/client': '11.19.0',
|
|
83
84
|
'@trpc/server': '11.19.0',
|
|
84
|
-
'@types/node': '26.6.
|
|
85
|
+
'@types/node': '26.6.5',
|
|
85
86
|
'@types/aws-lambda': '8.10.164',
|
|
86
87
|
'@types/cors': '2.8.19',
|
|
87
88
|
'@types/pg': '8.23.1',
|
|
@@ -94,12 +95,12 @@
|
|
|
94
95
|
'@vitest/coverage-v8': '4.1.11',
|
|
95
96
|
'@vitest/ui': '4.1.11',
|
|
96
97
|
'@astrojs/react': '6.0.6',
|
|
97
|
-
'@astrojs/starlight': '0.42.
|
|
98
|
-
astro: '7.3.
|
|
98
|
+
'@astrojs/starlight': '0.42.6',
|
|
99
|
+
astro: '7.3.8',
|
|
99
100
|
cookie: '2.0.1',
|
|
100
101
|
aws4fetch: '1.0.20',
|
|
101
|
-
'aws-cdk': '2.
|
|
102
|
-
'aws-cdk-lib': '2.
|
|
102
|
+
'aws-cdk': '2.1145.0',
|
|
103
|
+
'aws-cdk-lib': '2.273.0',
|
|
103
104
|
'aws-xray-sdk-core': '3.12.0',
|
|
104
105
|
constructs: '10.8.1',
|
|
105
106
|
cors: '2.8.6',
|
|
@@ -117,40 +118,40 @@
|
|
|
117
118
|
'@prisma/client': '7.10.0',
|
|
118
119
|
ejs: '6.0.1',
|
|
119
120
|
'@types/ejs': '3.1.5',
|
|
120
|
-
express: '5.
|
|
121
|
+
express: '5.3.0',
|
|
121
122
|
'fast-glob': '3.3.3',
|
|
122
123
|
husky: '9.1.7',
|
|
123
124
|
'fs-extra': '11.4.1',
|
|
124
125
|
'@types/fs-extra': '11.0.4',
|
|
125
126
|
mariadb: '3.5.4',
|
|
126
|
-
mise: '2026.10.
|
|
127
|
+
mise: '2026.10.9',
|
|
127
128
|
npm: '12.2.0',
|
|
128
|
-
'npm-check-updates': '23.1.
|
|
129
|
+
'npm-check-updates': '23.1.1',
|
|
129
130
|
'oidc-client-ts': '3.5.0',
|
|
130
131
|
pg: '8.23.1',
|
|
131
132
|
prisma: '7.10.0',
|
|
132
133
|
'react-oidc-context': '3.3.1',
|
|
133
134
|
react: '19.3.0',
|
|
134
135
|
'react-dom': '19.3.0',
|
|
135
|
-
rolldown: '1.2.
|
|
136
|
-
'rolldown-plugin-dts': '0.28.
|
|
136
|
+
rolldown: '1.2.13',
|
|
137
|
+
'rolldown-plugin-dts': '0.28.8',
|
|
137
138
|
shx: '0.4.0',
|
|
138
139
|
'simple-git': '4.0.2',
|
|
139
140
|
'source-map-support': '0.5.21',
|
|
140
|
-
'starlight-blog': '0.30.
|
|
141
|
+
'starlight-blog': '0.30.1',
|
|
141
142
|
tailwindcss: '4.3.3',
|
|
142
143
|
'@tailwindcss/vite': '4.3.3',
|
|
143
144
|
tsx: '4.23.15',
|
|
144
|
-
'lucide-react': '1.
|
|
145
|
-
'radix-ui': '1.
|
|
146
|
-
shadcn: '4.21.
|
|
145
|
+
'lucide-react': '1.56.0',
|
|
146
|
+
'radix-ui': '1.8.1',
|
|
147
|
+
shadcn: '4.21.4',
|
|
147
148
|
'tw-animate-css': '1.4.0',
|
|
148
|
-
vite: '8.3.
|
|
149
|
+
vite: '8.3.4',
|
|
149
150
|
typescript: '6.0.3',
|
|
150
151
|
vitest: '4.1.11',
|
|
151
152
|
// The `testEnvironment` @nx/vitest writes into every generated config.
|
|
152
153
|
jsdom: '29.1.1',
|
|
153
|
-
zod: '4.6.
|
|
154
|
+
zod: '4.6.7',
|
|
154
155
|
ws: '8.22.0'
|
|
155
156
|
};
|
|
156
157
|
/**
|
|
@@ -211,7 +212,7 @@
|
|
|
211
212
|
* Versions for Python dependencies added by generators
|
|
212
213
|
*/ export const PY_VERSIONS = {
|
|
213
214
|
'a2a-sdk': '==0.3.26',
|
|
214
|
-
'ag-ui-langgraph': '==0.0.
|
|
215
|
+
'ag-ui-langgraph': '==0.0.47',
|
|
215
216
|
'ag-ui-protocol': '==0.1.22',
|
|
216
217
|
'ag-ui-strands': '==0.4.1',
|
|
217
218
|
aiosqlite: '==0.22.1',
|
|
@@ -219,33 +220,33 @@
|
|
|
219
220
|
'aws-lambda-powertools[tracer]': '==3.35.0',
|
|
220
221
|
'aws-lambda-powertools[parser]': '==3.35.0',
|
|
221
222
|
'aws-opentelemetry-distro': '==0.21.0',
|
|
222
|
-
'bedrock-agentcore': '==1.24.
|
|
223
|
-
boto3: '==1.43.
|
|
224
|
-
checkov: '==3.3.
|
|
225
|
-
fastapi: '==0.
|
|
226
|
-
'fastapi[standard]': '==0.
|
|
223
|
+
'bedrock-agentcore': '==1.24.1',
|
|
224
|
+
boto3: '==1.43.113',
|
|
225
|
+
checkov: '==3.3.29',
|
|
226
|
+
fastapi: '==0.143.1',
|
|
227
|
+
'fastapi[standard]': '==0.143.1',
|
|
227
228
|
httpx: '==0.28.1',
|
|
228
|
-
langchain: '==1.4.
|
|
229
|
-
'langchain-aws': '==1.8.
|
|
229
|
+
langchain: '==1.4.6',
|
|
230
|
+
'langchain-aws': '==1.8.2',
|
|
230
231
|
'langchain-mcp-adapters': '==0.3.2',
|
|
231
|
-
langgraph: '==1.2.
|
|
232
|
-
'langgraph-checkpoint-aws': '==1.2.
|
|
233
|
-
'langgraph-checkpoint-sqlite': '==3.1.
|
|
232
|
+
langgraph: '==1.2.15',
|
|
233
|
+
'langgraph-checkpoint-aws': '==1.2.5',
|
|
234
|
+
'langgraph-checkpoint-sqlite': '==3.1.2',
|
|
234
235
|
mcp: '==1.28.1',
|
|
235
236
|
'pip-check-updates': '==0.29.0',
|
|
236
237
|
'pip-licenses': '==5.5.5',
|
|
237
|
-
pydantic: '==2.
|
|
238
|
-
ruff: '==0.
|
|
239
|
-
'strands-agents': '==1.
|
|
240
|
-
'strands-agents[a2a]': '==1.
|
|
238
|
+
pydantic: '==2.14.1',
|
|
239
|
+
ruff: '==0.17.0',
|
|
240
|
+
'strands-agents': '==1.60.0',
|
|
241
|
+
'strands-agents[a2a]': '==1.60.0',
|
|
241
242
|
'strands-agents-tools': '==0.8.9',
|
|
242
|
-
ty: '==0.0.
|
|
243
|
+
ty: '==0.0.87',
|
|
243
244
|
pynamodb: '==6.1.0',
|
|
244
245
|
uvicorn: '==0.54.0',
|
|
245
|
-
sqlmodel: '==0.0.
|
|
246
|
+
sqlmodel: '==0.0.48',
|
|
246
247
|
alembic: '==1.20.0',
|
|
247
248
|
aiomysql: '==0.3.2',
|
|
248
|
-
asyncpg: '==0.
|
|
249
|
+
asyncpg: '==0.32.0',
|
|
249
250
|
// Pinned explicitly: SQLAlchemy's async engine pulls greenlet transitively,
|
|
250
251
|
// and leaving it unpinned lets uv resolve to a just-released version whose
|
|
251
252
|
// platform wheels may not all be published yet (breaking aarch64 installs).
|
|
@@ -386,7 +387,7 @@
|
|
|
386
387
|
* Exact versions for Terraform providers used by generated `.tf` modules.
|
|
387
388
|
* Pinned exactly (no range operator) so generated infrastructure is reproducible.
|
|
388
389
|
*/ export const TERRAFORM_VERSIONS = {
|
|
389
|
-
aws: '6.
|
|
390
|
+
aws: '6.68.0',
|
|
390
391
|
random: '3.9.1',
|
|
391
392
|
null: '3.3.2',
|
|
392
393
|
archive: '2.8.1',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/versions.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type DeclaredPy,\n type DeclaredTs,\n type DependencyDeclaration,\n declaredNames,\n} from './declared-dependencies.js';\n\n/**\n * Versons for TypeScript dependencies added by generators\n */\nexport const TS_VERSIONS = {\n '@a2a-js/sdk': '0.3.14',\n '@aws/aws-distro-opentelemetry-node-autoinstrumentation': '0.13.0',\n // Pinned above the version the ADOT autoinstrumentation package resolves\n // transitively (2.8.0) to clear CVE-2026-59892 (HIGH).\n '@opentelemetry/propagator-jaeger': '2.11.0',\n // Overridden in the vended agent/MCP image builds to clear CVE-2026-14257\n // (HIGH) in brace-expansion: minimatch 10 is the lowest major depending on\n // brace-expansion 5.x, the only line Trivy's `< 5.0.8` advisory range treats\n // as fixed. Overriding brace-expansion directly is not viable — 5.x drops the\n // CommonJS default export that minimatch 9 calls.\n minimatch: '10.2.6',\n // Both overridden in the vended RDB migration image build, which installs the\n // prisma CLI to run migrations: its own ranges resolve deepmerge-ts below the\n // CVE-2026-40345 fix (HIGH) and mysql2 below the GHSA-3f6p-5ww8-9rcr fix\n // (HIGH). Neither is imported by the handler, which drives the schema engine.\n 'deepmerge-ts': '8.0.2',\n mysql2: '3.24.5',\n '@aws-sdk/client-dynamodb': '3.1146.0',\n '@aws-sdk/client-api-gateway': '3.1146.0',\n '@aws-sdk/client-iam': '3.1146.0',\n '@aws-sdk/client-bedrock-agentcore': '3.1146.0',\n '@aws-sdk/client-bedrock-runtime': '3.1146.0',\n '@aws-sdk/client-s3': '3.1146.0',\n '@aws-sdk/client-sts': '3.1146.0',\n '@aws-sdk/client-cognito-identity-provider': '3.1146.0',\n '@aws-sdk/credential-providers': '3.1146.0',\n '@aws-sdk/credential-provider-cognito-identity': '3.972.71',\n '@aws-sdk/client-secrets-manager': '3.1146.0',\n '@aws-sdk/rds-signer': '3.1146.0',\n '@smithy/server-apigateway': '0.3.3',\n '@smithy/server-node': '0.3.3',\n '@aws-lambda-powertools/logger': '2.35.0',\n '@aws-lambda-powertools/metrics': '2.35.0',\n '@aws-lambda-powertools/parameters': '2.35.0',\n '@aws-lambda-powertools/tracer': '2.35.0',\n '@aws-lambda-powertools/parser': '2.35.0',\n '@aws-sdk/client-appconfigdata': '3.1146.0',\n '@middy/core': '7.9.2',\n '@nxlv/python': '23.2.1',\n '@nx-extend/terraform': '10.4.1',\n // These must all hold the same version — see NX_PACKAGES.\n nx: '23.2.1',\n '@nx/devkit': '23.2.1',\n '@nx/js': '23.2.1',\n '@nx/react': '23.2.1',\n '@nx/vite': '23.2.1',\n '@nx/vitest': '23.2.1',\n '@nx/workspace': '23.2.1',\n 'create-nx-workspace': '23.2.1',\n '@swc-node/register': '1.12.1',\n '@swc/core': '1.16.13',\n '@modelcontextprotocol/sdk': '1.32.0',\n '@modelcontextprotocol/inspector': '2.9.0',\n '@ag-ui/a2ui-toolkit': '0.0.4',\n '@ag-ui/aws-strands': '0.3.0',\n '@ag-ui/client': '0.0.59',\n '@ag-ui/core': '0.0.59',\n '@ag-ui/encoder': '0.0.59',\n 'agent-chat-cli': '0.3.0',\n '@copilotkit/react-core': '1.74.0',\n rxjs: '7.8.2',\n '@strands-agents/sdk': '1.19.0',\n '@tanstack/react-router': '1.170.41',\n '@tanstack/router-plugin': '1.168.42',\n '@tanstack/router-generator': '1.167.40',\n '@tanstack/virtual-file-routes': '1.162.0',\n '@tanstack/router-utils': '1.162.3',\n '@cloudscape-design/board-components': '3.0.236',\n '@cloudscape-design/chat-components': '1.0.177',\n '@cloudscape-design/components': '3.0.1391',\n '@cloudscape-design/global-styles': '1.0.71',\n '@tanstack/react-query': '5.104.1',\n '@tanstack/react-query-devtools': '5.104.1',\n '@trpc/tanstack-react-query': '11.19.0',\n '@trpc/client': '11.19.0',\n '@trpc/server': '11.19.0',\n '@types/node': '26.6.4',\n '@types/aws-lambda': '8.10.164',\n '@types/cors': '2.8.19',\n '@types/pg': '8.23.1',\n '@types/ws': '8.18.2',\n '@types/express': '5.0.6',\n '@smithy/config-resolver': '4.7.2',\n '@smithy/node-config-provider': '4.6.2',\n '@smithy/node-http-handler': '4.12.1',\n '@smithy/types': '4.19.0',\n '@vitest/coverage-v8': '4.1.11',\n '@vitest/ui': '4.1.11',\n '@astrojs/react': '6.0.6',\n '@astrojs/starlight': '0.42.5',\n astro: '7.3.5',\n cookie: '2.0.1',\n aws4fetch: '1.0.20',\n 'aws-cdk': '2.1144.0',\n 'aws-cdk-lib': '2.272.0',\n 'aws-xray-sdk-core': '3.12.0',\n constructs: '10.8.1',\n cors: '2.8.6',\n chalk: '6.0.1',\n 'class-variance-authority': '0.7.1',\n cn: '0.4.0',\n commander: '15.0.0',\n electrodb: '3.9.3',\n esbuild: '0.28.2',\n 'event-source-polyfill': '1.0.31',\n '@types/event-source-polyfill': '1.0.5',\n '@biomejs/biome': '2.5.15',\n '@prisma/adapter-mariadb': '7.10.0',\n '@prisma/adapter-pg': '7.10.0',\n '@prisma/client': '7.10.0',\n ejs: '6.0.1',\n '@types/ejs': '3.1.5',\n express: '5.2.1',\n 'fast-glob': '3.3.3',\n husky: '9.1.7',\n 'fs-extra': '11.4.1',\n '@types/fs-extra': '11.0.4',\n mariadb: '3.5.4',\n mise: '2026.10.1',\n npm: '12.2.0',\n 'npm-check-updates': '23.1.0',\n 'oidc-client-ts': '3.5.0',\n pg: '8.23.1',\n prisma: '7.10.0',\n 'react-oidc-context': '3.3.1',\n react: '19.3.0',\n 'react-dom': '19.3.0',\n rolldown: '1.2.12',\n 'rolldown-plugin-dts': '0.28.6',\n shx: '0.4.0',\n 'simple-git': '4.0.2',\n 'source-map-support': '0.5.21',\n 'starlight-blog': '0.30.0',\n tailwindcss: '4.3.3',\n '@tailwindcss/vite': '4.3.3',\n tsx: '4.23.15',\n 'lucide-react': '1.51.0',\n 'radix-ui': '1.6.7',\n shadcn: '4.21.1',\n 'tw-animate-css': '1.4.0',\n vite: '8.3.2',\n typescript: '6.0.3',\n vitest: '4.1.11',\n // The `testEnvironment` @nx/vitest writes into every generated config.\n jsdom: '29.1.1',\n zod: '4.6.5',\n ws: '8.22.0',\n} as const;\nexport type ITsDepVersion = keyof typeof TS_VERSIONS;\n\n/**\n * Dependencies that must move as a unit, held at the lowest version proposed\n * across each group by the version update. Members must share a version line.\n *\n * The wasm formatter bindings are dependencies of this repo rather than vended\n * pins, so they are named here but versioned in the manifests.\n */\nexport const LOCKSTEP_GROUPS = [\n // A duplicate `@ag-ui/client` fails every generated website with TS2322.\n ['@ag-ui/client', '@ag-ui/core', '@ag-ui/encoder'],\n // The wasm bindings format generated files; the CLI checks them.\n ['@biomejs/wasm-nodejs', '@biomejs/biome'],\n ['@astral-sh/ruff-wasm-nodejs', 'ruff'],\n] as const satisfies readonly (readonly [string, string, ...string[]])[];\n\n/**\n * Add versions to the given dependencies, which the declaration must own.\n *\n * @param declaration the calling generator's `DEPENDENCIES`\n */\nexport const withVersions = <D extends DependencyDeclaration>(\n declaration: D,\n deps: readonly DeclaredTs<D>[],\n): Record<string, string> => {\n assertDeclared(declaration.ts, deps, 'ts');\n return Object.fromEntries(\n deps.map((dep) => [dep, TS_VERSIONS[dep as ITsDepVersion]]),\n );\n};\n\n/**\n * The `nx` and `@nx/*` packages a generated workspace pins, all of which must\n * hold the same version: a workspace nx even a patch apart hoists a second\n * nested nx, and the two deadlock `nx sync`.\n *\n * Bumping them in a user's workspace requires `packageJsonUpdates` rather than a\n * migration — see `version-upgrade-migration/nx-package-updates.ts`.\n */\nexport const NX_PACKAGES = [\n 'nx',\n '@nx/devkit',\n '@nx/js',\n '@nx/react',\n '@nx/vite',\n '@nx/vitest',\n '@nx/workspace',\n] as const satisfies readonly ITsDepVersion[];\n\n/**\n * The nx version the plugin is built against, and the single source of truth\n * for every place a workspace's nx is pinned.\n */\nexport const NX_VERSION = TS_VERSIONS.nx;\n\n/**\n * Versions for Python dependencies added by generators\n */\nexport const PY_VERSIONS = {\n 'a2a-sdk': '==0.3.26',\n 'ag-ui-langgraph': '==0.0.46',\n 'ag-ui-protocol': '==0.1.22',\n 'ag-ui-strands': '==0.4.1',\n aiosqlite: '==0.22.1',\n 'aws-lambda-powertools': '==3.35.0',\n 'aws-lambda-powertools[tracer]': '==3.35.0',\n 'aws-lambda-powertools[parser]': '==3.35.0',\n 'aws-opentelemetry-distro': '==0.21.0',\n 'bedrock-agentcore': '==1.24.0',\n boto3: '==1.43.108',\n checkov: '==3.3.22',\n fastapi: '==0.142.2',\n 'fastapi[standard]': '==0.142.2',\n httpx: '==0.28.1',\n langchain: '==1.4.3',\n 'langchain-aws': '==1.8.0',\n 'langchain-mcp-adapters': '==0.3.2',\n langgraph: '==1.2.12',\n 'langgraph-checkpoint-aws': '==1.2.4',\n 'langgraph-checkpoint-sqlite': '==3.1.1',\n mcp: '==1.28.1',\n 'pip-check-updates': '==0.29.0',\n 'pip-licenses': '==5.5.5',\n pydantic: '==2.13.5',\n ruff: '==0.16.10',\n 'strands-agents': '==1.57.2',\n 'strands-agents[a2a]': '==1.57.2',\n 'strands-agents-tools': '==0.8.9',\n ty: '==0.0.86',\n pynamodb: '==6.1.0',\n uvicorn: '==0.54.0',\n sqlmodel: '==0.0.47',\n alembic: '==1.20.0',\n aiomysql: '==0.3.2',\n asyncpg: '==0.31.0',\n // Pinned explicitly: SQLAlchemy's async engine pulls greenlet transitively,\n // and leaving it unpinned lets uv resolve to a just-released version whose\n // platform wheels may not all be published yet (breaking aarch64 installs).\n greenlet: '==3.5.6',\n} as const;\nexport type IPyDepVersion = keyof typeof PY_VERSIONS;\n\n/**\n * Add versions to the given dependencies\n */\nexport const withPyVersions = <D extends DependencyDeclaration>(\n declaration: D,\n deps: readonly DeclaredPy<D>[],\n): string[] => {\n assertDeclared(declaration.py, deps, 'py');\n return deps.map((dep) => `${dep}${PY_VERSIONS[dep as IPyDepVersion]}`);\n};\n\n/** Catches undeclared packages that reach here past the type checker. */\nconst assertDeclared = (\n declared: readonly { readonly name: string }[],\n deps: readonly unknown[],\n kind: 'ts' | 'py',\n): void => {\n const names = declaredNames(declared);\n const undeclared = deps.filter((dep) => !names.includes(dep as string));\n if (undeclared.length > 0) {\n throw new Error(\n `Undeclared ${kind} dependencies: ${undeclared.join(', ')}. Add them to the generator's declareDependencies({ ${kind}: [...] }).`,\n );\n }\n};\n\n/**\n * Versions for vendored tools\n */\nexport const VENDORED_VERSIONS = {\n 'git-secrets': '1.3.0',\n} as const;\n\n/**\n * Versions of Java dependencies added by generators, keyed by Maven coordinate.\n *\n * Every entry is resolved from Maven Central by the version update and named\n * `<group>:<artifact>:<version>` where a generator writes it.\n */\nexport const JAVA_VERSIONS = {\n 'software.amazon.smithy:smithy-model': '1.74.0',\n 'software.amazon.smithy:smithy-aws-traits': '1.74.0',\n 'software.amazon.smithy:smithy-validation-model': '1.74.0',\n 'software.amazon.smithy:smithy-openapi': '1.74.0',\n 'software.amazon.smithy.typescript:smithy-aws-typescript-codegen': '0.54.0',\n} as const;\nexport type IJavaVersion = keyof typeof JAVA_VERSIONS;\n\n/** The Maven coordinates the version update resolves, in declaration order. */\nexport const JAVA_ARTIFACTS = Object.keys(JAVA_VERSIONS) as IJavaVersion[];\n\n/** A Maven coordinate as a dependency names it: `<group>:<artifact>:<version>`. */\nexport const javaMavenDependency = (artifact: IJavaVersion): string =>\n `${artifact}:${JAVA_VERSIONS[artifact]}`;\n\n/**\n * Versions of tools resolved by mise, keyed by the tool name mise knows.\n *\n * Every entry is checked with `mise latest <tool>` by the version update. Nothing\n * is installed into the workspace: the pin travels in the `project.json` target\n * command, which is what the version sync reaches to move it forward.\n */\nexport const MISE_VERSIONS = {\n smithy: '1.74.0',\n} as const;\nexport type IMiseVersion = keyof typeof MISE_VERSIONS;\n\n/** The tools the version update resolves through mise, in declaration order. */\nexport const MISE_TOOLS = Object.keys(MISE_VERSIONS) as IMiseVersion[];\n\n/**\n * Base container images used by generated Dockerfiles. Pinned exactly so\n * generated images are reproducible, and chosen to be free of known\n * HIGH/CRITICAL vulnerabilities at time of generation.\n */\nexport const BASE_IMAGES = {\n node: 'public.ecr.aws/docker/library/node:lts-slim',\n python: 'public.ecr.aws/docker/library/python:3.14-slim',\n} as const;\n\n/**\n * Versions for container tooling used by generated image build/scan targets.\n * Pinned exactly so generated images are reproducible.\n */\nexport const CONTAINER_VERSIONS = {\n // ECR-hosted Trivy image used to scan built images during the build.\n trivy: '0.72.0',\n} as const;\n\n/**\n * Repository each pinned tool image is pulled from, keyed as\n * {@link CONTAINER_VERSIONS}. Kept beside the versions so a tool added here is\n * one entry rather than a reference built somewhere else, which is also what\n * lets the version sync find these pins wherever a target command runs them.\n */\nexport const CONTAINER_REPOSITORIES = {\n trivy: 'public.ecr.aws/aquasecurity/trivy',\n} as const satisfies Record<keyof typeof CONTAINER_VERSIONS, string>;\n\n/** The pinned reference for a tool image, as a target command runs it. */\nexport const containerImage = (tool: keyof typeof CONTAINER_VERSIONS): string =>\n `${CONTAINER_REPOSITORIES[tool]}:${CONTAINER_VERSIONS[tool]}`;\n\n/**\n * The managed Lambda runtimes generated infrastructure targets, as the single\n * source both IaC providers derive from.\n *\n * CDK and Terraform name the same runtime differently — `Runtime.NODEJS_24_X`\n * against `nodejs24.x` — so deriving both from the version here keeps a bump one\n * edit that moves them together. Resolved by the version update workflow.\n */\nexport const LAMBDA_RUNTIME_VERSIONS = {\n node: '24',\n python: '3.14',\n} as const;\nexport type ILambdaRuntime = keyof typeof LAMBDA_RUNTIME_VERSIONS;\n\n/**\n * The managed AgentCore Runtime runtimes generated infrastructure targets, for\n * agents and MCP servers packaged as code rather than as a container image.\n *\n * Tracked separately from {@link LAMBDA_RUNTIME_VERSIONS}: AgentCore publishes\n * its own, smaller set, so a Lambda bump would otherwise move these to a runtime\n * AgentCore rejects at create time. Resolved by the version update workflow from\n * the `AgentCoreRuntime` members `aws-cdk-lib` publishes, the same source the\n * Lambda runtimes come from.\n */\nexport const AGENT_CORE_RUNTIME_VERSIONS = {\n node: '22',\n python: '3.14',\n} as const;\nexport type IAgentCoreRuntime = keyof typeof AGENT_CORE_RUNTIME_VERSIONS;\n\n/**\n * The runtime as AgentCore's `runtime` field names it, e.g. `NODE_22` or\n * `PYTHON_3_14`.\n */\nexport const agentCoreRuntime = (runtime: IAgentCoreRuntime): string =>\n runtime === 'node'\n ? `NODE_${AGENT_CORE_RUNTIME_VERSIONS.node}`\n : `PYTHON_${AGENT_CORE_RUNTIME_VERSIONS.python.replace('.', '_')}`;\n\n/**\n * The interpreter uv pins for a generated Python project, as the Lambda runtime's\n * `major.minor`.\n *\n * No patch: uv reads this as a request for any patch of that minor, so it resolves\n * whichever one the platform has a build for. Naming an exact patch pins one that\n * may not exist everywhere, and Lambda patches the interpreter itself, so the minor\n * is the whole of what a project needs to agree on.\n */\nexport const pyenvPythonVersion = (): string => LAMBDA_RUNTIME_VERSIONS.python;\n\n/**\n * The `[project].requires-python` specifier for a generated Python project.\n *\n * A lower bound on the Lambda runtime's `major.minor`: the deployed interpreter\n * is that version, and Ruff derives its `target-version` from this (`py314`), so\n * lint targets the same version the function runs on.\n */\nexport const pyprojectPythonDependency = (): string =>\n `>=${LAMBDA_RUNTIME_VERSIONS.python}`;\n\n/** The runtime as Terraform's `runtime` attribute names it, e.g. `nodejs24.x`. */\nexport const terraformLambdaRuntime = (runtime: ILambdaRuntime): string =>\n runtime === 'node'\n ? `nodejs${LAMBDA_RUNTIME_VERSIONS.node}.x`\n : `python${LAMBDA_RUNTIME_VERSIONS.python}`;\n\n/**\n * The runtime as an `aws-cdk-lib` `Runtime` member, e.g. `Runtime.NODEJS_24_X`.\n * Always an explicitly versioned member, never a `_LATEST` alias.\n */\nexport const cdkLambdaRuntime = (runtime: ILambdaRuntime): string =>\n runtime === 'node'\n ? `Runtime.NODEJS_${LAMBDA_RUNTIME_VERSIONS.node}_X`\n : `Runtime.PYTHON_${LAMBDA_RUNTIME_VERSIONS.python.replace('.', '_')}`;\n\n/**\n * Substitution variables exposing the pinned runtimes to generated CDK\n * templates (e.g. `runtime: <%- nodeRuntime %>`). Paired with\n * {@link terraformLambdaRuntimeVars}, which names the same variables so a\n * template reads alike under either provider.\n */\nexport const cdkLambdaRuntimeVars = () => ({\n nodeRuntime: cdkLambdaRuntime('node'),\n pythonRuntime: cdkLambdaRuntime('python'),\n});\n\n/**\n * Substitution variables exposing the pinned runtimes to generated `.tf`\n * templates (e.g. `runtime = \"<%- nodeRuntime %>\"`).\n */\nexport const terraformLambdaRuntimeVars = () => ({\n nodeRuntime: terraformLambdaRuntime('node'),\n pythonRuntime: terraformLambdaRuntime('python'),\n});\n\n/**\n * Exact versions for Terraform providers used by generated `.tf` modules.\n * Pinned exactly (no range operator) so generated infrastructure is reproducible.\n */\nexport const TERRAFORM_VERSIONS = {\n aws: '6.67.0',\n random: '3.9.1',\n null: '3.3.2',\n archive: '2.8.1',\n external: '2.4.2',\n local: '2.9.1',\n time: '0.14.2',\n} as const;\nexport type ITerraformProviderVersion = keyof typeof TERRAFORM_VERSIONS;\n\n/**\n * Substitution variables exposing Terraform provider version constraints to\n * generated `.tf` templates (e.g. `version = \"<%- awsProviderVersion %>\"`)\n */\nexport const terraformProviderVersions = () => ({\n awsProviderVersion: TERRAFORM_VERSIONS.aws,\n randomProviderVersion: TERRAFORM_VERSIONS.random,\n nullProviderVersion: TERRAFORM_VERSIONS.null,\n archiveProviderVersion: TERRAFORM_VERSIONS.archive,\n externalProviderVersion: TERRAFORM_VERSIONS.external,\n localProviderVersion: TERRAFORM_VERSIONS.local,\n timeProviderVersion: TERRAFORM_VERSIONS.time,\n});\n"],"names":["declaredNames","TS_VERSIONS","minimatch","mysql2","nx","rxjs","astro","cookie","aws4fetch","constructs","cors","chalk","cn","commander","electrodb","esbuild","ejs","express","husky","mariadb","mise","npm","pg","prisma","react","rolldown","shx","tailwindcss","tsx","shadcn","vite","typescript","vitest","jsdom","zod","ws","LOCKSTEP_GROUPS","withVersions","declaration","deps","assertDeclared","ts","Object","fromEntries","map","dep","NX_PACKAGES","NX_VERSION","PY_VERSIONS","aiosqlite","boto3","checkov","fastapi","httpx","langchain","langgraph","mcp","pydantic","ruff","ty","pynamodb","uvicorn","sqlmodel","alembic","aiomysql","asyncpg","greenlet","withPyVersions","py","declared","kind","names","undeclared","filter","includes","length","Error","join","VENDORED_VERSIONS","JAVA_VERSIONS","JAVA_ARTIFACTS","keys","javaMavenDependency","artifact","MISE_VERSIONS","smithy","MISE_TOOLS","BASE_IMAGES","node","python","CONTAINER_VERSIONS","trivy","CONTAINER_REPOSITORIES","containerImage","tool","LAMBDA_RUNTIME_VERSIONS","AGENT_CORE_RUNTIME_VERSIONS","agentCoreRuntime","runtime","replace","pyenvPythonVersion","pyprojectPythonDependency","terraformLambdaRuntime","cdkLambdaRuntime","cdkLambdaRuntimeVars","nodeRuntime","pythonRuntime","terraformLambdaRuntimeVars","TERRAFORM_VERSIONS","aws","random","null","archive","external","local","time","terraformProviderVersions","awsProviderVersion","randomProviderVersion","nullProviderVersion","archiveProviderVersion","externalProviderVersion","localProviderVersion","timeProviderVersion"],"mappings":"AAAA;;;CAGC,GACD,SAIEA,aAAa,QACR,6BAA6B;AAEpC;;CAEC,GACD,OAAO,MAAMC,cAAc;IACzB,eAAe;IACf,0DAA0D;IAC1D,yEAAyE;IACzE,uDAAuD;IACvD,oCAAoC;IACpC,0EAA0E;IAC1E,2EAA2E;IAC3E,6EAA6E;IAC7E,8EAA8E;IAC9E,kDAAkD;IAClDC,WAAW;IACX,8EAA8E;IAC9E,8EAA8E;IAC9E,yEAAyE;IACzE,8EAA8E;IAC9E,gBAAgB;IAChBC,QAAQ;IACR,4BAA4B;IAC5B,+BAA+B;IAC/B,uBAAuB;IACvB,qCAAqC;IACrC,mCAAmC;IACnC,sBAAsB;IACtB,uBAAuB;IACvB,6CAA6C;IAC7C,iCAAiC;IACjC,iDAAiD;IACjD,mCAAmC;IACnC,uBAAuB;IACvB,6BAA6B;IAC7B,uBAAuB;IACvB,iCAAiC;IACjC,kCAAkC;IAClC,qCAAqC;IACrC,iCAAiC;IACjC,iCAAiC;IACjC,iCAAiC;IACjC,eAAe;IACf,gBAAgB;IAChB,wBAAwB;IACxB,0DAA0D;IAC1DC,IAAI;IACJ,cAAc;IACd,UAAU;IACV,aAAa;IACb,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,uBAAuB;IACvB,sBAAsB;IACtB,aAAa;IACb,6BAA6B;IAC7B,mCAAmC;IACnC,uBAAuB;IACvB,sBAAsB;IACtB,iBAAiB;IACjB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,0BAA0B;IAC1BC,MAAM;IACN,uBAAuB;IACvB,0BAA0B;IAC1B,2BAA2B;IAC3B,8BAA8B;IAC9B,iCAAiC;IACjC,0BAA0B;IAC1B,uCAAuC;IACvC,sCAAsC;IACtC,iCAAiC;IACjC,oCAAoC;IACpC,yBAAyB;IACzB,kCAAkC;IAClC,8BAA8B;IAC9B,gBAAgB;IAChB,gBAAgB;I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;QAC5CS,wBAAwBZ,mBAAmBI,OAAO;QAClDS,yBAAyBb,mBAAmBK,QAAQ;QACpDS,sBAAsBd,mBAAmBM,KAAK;QAC9CS,qBAAqBf,mBAAmBO,IAAI;IAC9C,CAAA,EAAG"}
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/versions.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type DeclaredPy,\n type DeclaredTs,\n type DependencyDeclaration,\n declaredNames,\n} from './declared-dependencies.js';\n\n/**\n * Versons for TypeScript dependencies added by generators\n */\nexport const TS_VERSIONS = {\n '@a2a-js/sdk': '0.3.14',\n '@aws/aws-distro-opentelemetry-node-autoinstrumentation': '0.13.0',\n // Pinned above the version the ADOT autoinstrumentation package resolves\n // transitively (2.8.0) to clear CVE-2026-59892 (HIGH).\n '@opentelemetry/propagator-jaeger': '2.12.0',\n // Overridden in the vended agent/MCP image builds to clear CVE-2026-14257\n // (HIGH) in brace-expansion: minimatch 10 is the lowest major depending on\n // brace-expansion 5.x, the only line Trivy's `< 5.0.8` advisory range treats\n // as fixed. Overriding brace-expansion directly is not viable — 5.x drops the\n // CommonJS default export that minimatch 9 calls.\n minimatch: '10.2.6',\n // Both overridden in the vended RDB migration image build, which installs the\n // prisma CLI to run migrations: its own ranges resolve deepmerge-ts below the\n // CVE-2026-40345 fix (HIGH) and mysql2 below the GHSA-3f6p-5ww8-9rcr fix\n // (HIGH). Neither is imported by the handler, which drives the schema engine.\n 'deepmerge-ts': '8.0.2',\n mysql2: '3.24.6',\n '@aws-sdk/client-dynamodb': '3.1151.0',\n '@aws-sdk/client-api-gateway': '3.1151.0',\n '@aws-sdk/client-iam': '3.1151.0',\n '@aws-sdk/client-bedrock-agentcore': '3.1151.0',\n '@aws-sdk/client-bedrock-runtime': '3.1151.0',\n '@aws-sdk/client-s3': '3.1151.0',\n '@aws-sdk/client-sts': '3.1151.0',\n '@aws-sdk/client-cognito-identity-provider': '3.1151.0',\n '@aws-sdk/credential-providers': '3.1151.0',\n '@aws-sdk/credential-provider-cognito-identity': '3.972.73',\n '@aws-sdk/client-secrets-manager': '3.1151.0',\n '@aws-sdk/rds-signer': '3.1151.0',\n '@smithy/server-apigateway': '0.3.4',\n '@smithy/server-node': '0.3.4',\n '@aws-lambda-powertools/logger': '2.36.0',\n '@aws-lambda-powertools/metrics': '2.36.0',\n '@aws-lambda-powertools/parameters': '2.36.0',\n '@aws-lambda-powertools/tracer': '2.36.0',\n '@aws-lambda-powertools/parser': '2.36.0',\n '@aws-sdk/client-appconfigdata': '3.1151.0',\n '@middy/core': '7.9.2',\n '@nxlv/python': '23.2.1',\n '@nx-extend/terraform': '10.4.1',\n // These must all hold the same version — see NX_PACKAGES.\n nx: '23.3.0',\n '@nx/devkit': '23.3.0',\n '@nx/js': '23.3.0',\n '@nx/react': '23.3.0',\n '@nx/vite': '23.3.0',\n '@nx/vitest': '23.3.0',\n '@nx/workspace': '23.3.0',\n 'create-nx-workspace': '23.3.0',\n '@swc-node/register': '1.12.1',\n '@swc/core': '1.16.18',\n '@modelcontextprotocol/sdk': '1.32.1',\n '@modelcontextprotocol/client': '2.3.1',\n '@modelcontextprotocol/inspector': '2.10.1',\n '@ag-ui/a2ui-toolkit': '0.0.5',\n '@ag-ui/aws-strands': '0.3.0',\n '@ag-ui/client': '0.0.59',\n '@ag-ui/core': '0.0.59',\n '@ag-ui/encoder': '0.0.59',\n 'agent-chat-cli': '0.3.0',\n '@copilotkit/react-core': '1.74.0',\n rxjs: '7.8.2',\n '@strands-agents/sdk': '1.20.0',\n '@tanstack/react-router': '1.170.44',\n '@tanstack/router-plugin': '1.168.45',\n '@tanstack/router-generator': '1.167.43',\n '@tanstack/virtual-file-routes': '1.162.0',\n '@tanstack/router-utils': '1.162.3',\n '@cloudscape-design/board-components': '3.0.238',\n '@cloudscape-design/chat-components': '1.0.179',\n '@cloudscape-design/components': '3.0.1400',\n '@cloudscape-design/global-styles': '1.0.71',\n '@tanstack/react-query': '5.104.2',\n '@tanstack/react-query-devtools': '5.104.2',\n '@trpc/tanstack-react-query': '11.19.0',\n '@trpc/client': '11.19.0',\n '@trpc/server': '11.19.0',\n '@types/node': '26.6.5',\n '@types/aws-lambda': '8.10.164',\n '@types/cors': '2.8.19',\n '@types/pg': '8.23.1',\n '@types/ws': '8.18.2',\n '@types/express': '5.0.6',\n '@smithy/config-resolver': '4.7.2',\n '@smithy/node-config-provider': '4.6.2',\n '@smithy/node-http-handler': '4.12.1',\n '@smithy/types': '4.19.0',\n '@vitest/coverage-v8': '4.1.11',\n '@vitest/ui': '4.1.11',\n '@astrojs/react': '6.0.6',\n '@astrojs/starlight': '0.42.6',\n astro: '7.3.8',\n cookie: '2.0.1',\n aws4fetch: '1.0.20',\n 'aws-cdk': '2.1145.0',\n 'aws-cdk-lib': '2.273.0',\n 'aws-xray-sdk-core': '3.12.0',\n constructs: '10.8.1',\n cors: '2.8.6',\n chalk: '6.0.1',\n 'class-variance-authority': '0.7.1',\n cn: '0.4.0',\n commander: '15.0.0',\n electrodb: '3.9.3',\n esbuild: '0.28.2',\n 'event-source-polyfill': '1.0.31',\n '@types/event-source-polyfill': '1.0.5',\n '@biomejs/biome': '2.5.15',\n '@prisma/adapter-mariadb': '7.10.0',\n '@prisma/adapter-pg': '7.10.0',\n '@prisma/client': '7.10.0',\n ejs: '6.0.1',\n '@types/ejs': '3.1.5',\n express: '5.3.0',\n 'fast-glob': '3.3.3',\n husky: '9.1.7',\n 'fs-extra': '11.4.1',\n '@types/fs-extra': '11.0.4',\n mariadb: '3.5.4',\n mise: '2026.10.9',\n npm: '12.2.0',\n 'npm-check-updates': '23.1.1',\n 'oidc-client-ts': '3.5.0',\n pg: '8.23.1',\n prisma: '7.10.0',\n 'react-oidc-context': '3.3.1',\n react: '19.3.0',\n 'react-dom': '19.3.0',\n rolldown: '1.2.13',\n 'rolldown-plugin-dts': '0.28.8',\n shx: '0.4.0',\n 'simple-git': '4.0.2',\n 'source-map-support': '0.5.21',\n 'starlight-blog': '0.30.1',\n tailwindcss: '4.3.3',\n '@tailwindcss/vite': '4.3.3',\n tsx: '4.23.15',\n 'lucide-react': '1.56.0',\n 'radix-ui': '1.8.1',\n shadcn: '4.21.4',\n 'tw-animate-css': '1.4.0',\n vite: '8.3.4',\n typescript: '6.0.3',\n vitest: '4.1.11',\n // The `testEnvironment` @nx/vitest writes into every generated config.\n jsdom: '29.1.1',\n zod: '4.6.7',\n ws: '8.22.0',\n} as const;\nexport type ITsDepVersion = keyof typeof TS_VERSIONS;\n\n/**\n * Dependencies that must move as a unit, held at the lowest version proposed\n * across each group by the version update. Members must share a version line.\n *\n * The wasm formatter bindings are dependencies of this repo rather than vended\n * pins, so they are named here but versioned in the manifests.\n */\nexport const LOCKSTEP_GROUPS = [\n // A duplicate `@ag-ui/client` fails every generated website with TS2322.\n ['@ag-ui/client', '@ag-ui/core', '@ag-ui/encoder'],\n // The wasm bindings format generated files; the CLI checks them.\n ['@biomejs/wasm-nodejs', '@biomejs/biome'],\n ['@astral-sh/ruff-wasm-nodejs', 'ruff'],\n] as const satisfies readonly (readonly [string, string, ...string[]])[];\n\n/**\n * Add versions to the given dependencies, which the declaration must own.\n *\n * @param declaration the calling generator's `DEPENDENCIES`\n */\nexport const withVersions = <D extends DependencyDeclaration>(\n declaration: D,\n deps: readonly DeclaredTs<D>[],\n): Record<string, string> => {\n assertDeclared(declaration.ts, deps, 'ts');\n return Object.fromEntries(\n deps.map((dep) => [dep, TS_VERSIONS[dep as ITsDepVersion]]),\n );\n};\n\n/**\n * The `nx` and `@nx/*` packages a generated workspace pins, all of which must\n * hold the same version: a workspace nx even a patch apart hoists a second\n * nested nx, and the two deadlock `nx sync`.\n *\n * Bumping them in a user's workspace requires `packageJsonUpdates` rather than a\n * migration — see `version-upgrade-migration/nx-package-updates.ts`.\n */\nexport const NX_PACKAGES = [\n 'nx',\n '@nx/devkit',\n '@nx/js',\n '@nx/react',\n '@nx/vite',\n '@nx/vitest',\n '@nx/workspace',\n] as const satisfies readonly ITsDepVersion[];\n\n/**\n * The nx version the plugin is built against, and the single source of truth\n * for every place a workspace's nx is pinned.\n */\nexport const NX_VERSION = TS_VERSIONS.nx;\n\n/**\n * Versions for Python dependencies added by generators\n */\nexport const PY_VERSIONS = {\n 'a2a-sdk': '==0.3.26',\n 'ag-ui-langgraph': '==0.0.47',\n 'ag-ui-protocol': '==0.1.22',\n 'ag-ui-strands': '==0.4.1',\n aiosqlite: '==0.22.1',\n 'aws-lambda-powertools': '==3.35.0',\n 'aws-lambda-powertools[tracer]': '==3.35.0',\n 'aws-lambda-powertools[parser]': '==3.35.0',\n 'aws-opentelemetry-distro': '==0.21.0',\n 'bedrock-agentcore': '==1.24.1',\n boto3: '==1.43.113',\n checkov: '==3.3.29',\n fastapi: '==0.143.1',\n 'fastapi[standard]': '==0.143.1',\n httpx: '==0.28.1',\n langchain: '==1.4.6',\n 'langchain-aws': '==1.8.2',\n 'langchain-mcp-adapters': '==0.3.2',\n langgraph: '==1.2.15',\n 'langgraph-checkpoint-aws': '==1.2.5',\n 'langgraph-checkpoint-sqlite': '==3.1.2',\n mcp: '==1.28.1',\n 'pip-check-updates': '==0.29.0',\n 'pip-licenses': '==5.5.5',\n pydantic: '==2.14.1',\n ruff: '==0.17.0',\n 'strands-agents': '==1.60.0',\n 'strands-agents[a2a]': '==1.60.0',\n 'strands-agents-tools': '==0.8.9',\n ty: '==0.0.87',\n pynamodb: '==6.1.0',\n uvicorn: '==0.54.0',\n sqlmodel: '==0.0.48',\n alembic: '==1.20.0',\n aiomysql: '==0.3.2',\n asyncpg: '==0.32.0',\n // Pinned explicitly: SQLAlchemy's async engine pulls greenlet transitively,\n // and leaving it unpinned lets uv resolve to a just-released version whose\n // platform wheels may not all be published yet (breaking aarch64 installs).\n greenlet: '==3.5.6',\n} as const;\nexport type IPyDepVersion = keyof typeof PY_VERSIONS;\n\n/**\n * Add versions to the given dependencies\n */\nexport const withPyVersions = <D extends DependencyDeclaration>(\n declaration: D,\n deps: readonly DeclaredPy<D>[],\n): string[] => {\n assertDeclared(declaration.py, deps, 'py');\n return deps.map((dep) => `${dep}${PY_VERSIONS[dep as IPyDepVersion]}`);\n};\n\n/** Catches undeclared packages that reach here past the type checker. */\nconst assertDeclared = (\n declared: readonly { readonly name: string }[],\n deps: readonly unknown[],\n kind: 'ts' | 'py',\n): void => {\n const names = declaredNames(declared);\n const undeclared = deps.filter((dep) => !names.includes(dep as string));\n if (undeclared.length > 0) {\n throw new Error(\n `Undeclared ${kind} dependencies: ${undeclared.join(', ')}. Add them to the generator's declareDependencies({ ${kind}: [...] }).`,\n );\n }\n};\n\n/**\n * Versions for vendored tools\n */\nexport const VENDORED_VERSIONS = {\n 'git-secrets': '1.3.0',\n} as const;\n\n/**\n * Versions of Java dependencies added by generators, keyed by Maven coordinate.\n *\n * Every entry is resolved from Maven Central by the version update and named\n * `<group>:<artifact>:<version>` where a generator writes it.\n */\nexport const JAVA_VERSIONS = {\n 'software.amazon.smithy:smithy-model': '1.74.0',\n 'software.amazon.smithy:smithy-aws-traits': '1.74.0',\n 'software.amazon.smithy:smithy-validation-model': '1.74.0',\n 'software.amazon.smithy:smithy-openapi': '1.74.0',\n 'software.amazon.smithy.typescript:smithy-aws-typescript-codegen': '0.54.0',\n} as const;\nexport type IJavaVersion = keyof typeof JAVA_VERSIONS;\n\n/** The Maven coordinates the version update resolves, in declaration order. */\nexport const JAVA_ARTIFACTS = Object.keys(JAVA_VERSIONS) as IJavaVersion[];\n\n/** A Maven coordinate as a dependency names it: `<group>:<artifact>:<version>`. */\nexport const javaMavenDependency = (artifact: IJavaVersion): string =>\n `${artifact}:${JAVA_VERSIONS[artifact]}`;\n\n/**\n * Versions of tools resolved by mise, keyed by the tool name mise knows.\n *\n * Every entry is checked with `mise latest <tool>` by the version update. Nothing\n * is installed into the workspace: the pin travels in the `project.json` target\n * command, which is what the version sync reaches to move it forward.\n */\nexport const MISE_VERSIONS = {\n smithy: '1.74.0',\n} as const;\nexport type IMiseVersion = keyof typeof MISE_VERSIONS;\n\n/** The tools the version update resolves through mise, in declaration order. */\nexport const MISE_TOOLS = Object.keys(MISE_VERSIONS) as IMiseVersion[];\n\n/**\n * Base container images used by generated Dockerfiles. Pinned exactly so\n * generated images are reproducible, and chosen to be free of known\n * HIGH/CRITICAL vulnerabilities at time of generation.\n */\nexport const BASE_IMAGES = {\n node: 'public.ecr.aws/docker/library/node:lts-slim',\n python: 'public.ecr.aws/docker/library/python:3.14-slim',\n} as const;\n\n/**\n * Versions for container tooling used by generated image build/scan targets.\n * Pinned exactly so generated images are reproducible.\n */\nexport const CONTAINER_VERSIONS = {\n // ECR-hosted Trivy image used to scan built images during the build.\n trivy: '0.72.0',\n} as const;\n\n/**\n * Repository each pinned tool image is pulled from, keyed as\n * {@link CONTAINER_VERSIONS}. Kept beside the versions so a tool added here is\n * one entry rather than a reference built somewhere else, which is also what\n * lets the version sync find these pins wherever a target command runs them.\n */\nexport const CONTAINER_REPOSITORIES = {\n trivy: 'public.ecr.aws/aquasecurity/trivy',\n} as const satisfies Record<keyof typeof CONTAINER_VERSIONS, string>;\n\n/** The pinned reference for a tool image, as a target command runs it. */\nexport const containerImage = (tool: keyof typeof CONTAINER_VERSIONS): string =>\n `${CONTAINER_REPOSITORIES[tool]}:${CONTAINER_VERSIONS[tool]}`;\n\n/**\n * The managed Lambda runtimes generated infrastructure targets, as the single\n * source both IaC providers derive from.\n *\n * CDK and Terraform name the same runtime differently — `Runtime.NODEJS_24_X`\n * against `nodejs24.x` — so deriving both from the version here keeps a bump one\n * edit that moves them together. Resolved by the version update workflow.\n */\nexport const LAMBDA_RUNTIME_VERSIONS = {\n node: '24',\n python: '3.14',\n} as const;\nexport type ILambdaRuntime = keyof typeof LAMBDA_RUNTIME_VERSIONS;\n\n/**\n * The managed AgentCore Runtime runtimes generated infrastructure targets, for\n * agents and MCP servers packaged as code rather than as a container image.\n *\n * Tracked separately from {@link LAMBDA_RUNTIME_VERSIONS}: AgentCore publishes\n * its own, smaller set, so a Lambda bump would otherwise move these to a runtime\n * AgentCore rejects at create time. Resolved by the version update workflow from\n * the `AgentCoreRuntime` members `aws-cdk-lib` publishes, the same source the\n * Lambda runtimes come from.\n */\nexport const AGENT_CORE_RUNTIME_VERSIONS = {\n node: '22',\n python: '3.14',\n} as const;\nexport type IAgentCoreRuntime = keyof typeof AGENT_CORE_RUNTIME_VERSIONS;\n\n/**\n * The runtime as AgentCore's `runtime` field names it, e.g. `NODE_22` or\n * `PYTHON_3_14`.\n */\nexport const agentCoreRuntime = (runtime: IAgentCoreRuntime): string =>\n runtime === 'node'\n ? `NODE_${AGENT_CORE_RUNTIME_VERSIONS.node}`\n : `PYTHON_${AGENT_CORE_RUNTIME_VERSIONS.python.replace('.', '_')}`;\n\n/**\n * The interpreter uv pins for a generated Python project, as the Lambda runtime's\n * `major.minor`.\n *\n * No patch: uv reads this as a request for any patch of that minor, so it resolves\n * whichever one the platform has a build for. Naming an exact patch pins one that\n * may not exist everywhere, and Lambda patches the interpreter itself, so the minor\n * is the whole of what a project needs to agree on.\n */\nexport const pyenvPythonVersion = (): string => LAMBDA_RUNTIME_VERSIONS.python;\n\n/**\n * The `[project].requires-python` specifier for a generated Python project.\n *\n * A lower bound on the Lambda runtime's `major.minor`: the deployed interpreter\n * is that version, and Ruff derives its `target-version` from this (`py314`), so\n * lint targets the same version the function runs on.\n */\nexport const pyprojectPythonDependency = (): string =>\n `>=${LAMBDA_RUNTIME_VERSIONS.python}`;\n\n/** The runtime as Terraform's `runtime` attribute names it, e.g. `nodejs24.x`. */\nexport const terraformLambdaRuntime = (runtime: ILambdaRuntime): string =>\n runtime === 'node'\n ? `nodejs${LAMBDA_RUNTIME_VERSIONS.node}.x`\n : `python${LAMBDA_RUNTIME_VERSIONS.python}`;\n\n/**\n * The runtime as an `aws-cdk-lib` `Runtime` member, e.g. `Runtime.NODEJS_24_X`.\n * Always an explicitly versioned member, never a `_LATEST` alias.\n */\nexport const cdkLambdaRuntime = (runtime: ILambdaRuntime): string =>\n runtime === 'node'\n ? `Runtime.NODEJS_${LAMBDA_RUNTIME_VERSIONS.node}_X`\n : `Runtime.PYTHON_${LAMBDA_RUNTIME_VERSIONS.python.replace('.', '_')}`;\n\n/**\n * Substitution variables exposing the pinned runtimes to generated CDK\n * templates (e.g. `runtime: <%- nodeRuntime %>`). Paired with\n * {@link terraformLambdaRuntimeVars}, which names the same variables so a\n * template reads alike under either provider.\n */\nexport const cdkLambdaRuntimeVars = () => ({\n nodeRuntime: cdkLambdaRuntime('node'),\n pythonRuntime: cdkLambdaRuntime('python'),\n});\n\n/**\n * Substitution variables exposing the pinned runtimes to generated `.tf`\n * templates (e.g. `runtime = \"<%- nodeRuntime %>\"`).\n */\nexport const terraformLambdaRuntimeVars = () => ({\n nodeRuntime: terraformLambdaRuntime('node'),\n pythonRuntime: terraformLambdaRuntime('python'),\n});\n\n/**\n * Exact versions for Terraform providers used by generated `.tf` modules.\n * Pinned exactly (no range operator) so generated infrastructure is reproducible.\n */\nexport const TERRAFORM_VERSIONS = {\n aws: '6.68.0',\n random: '3.9.1',\n null: '3.3.2',\n archive: '2.8.1',\n external: '2.4.2',\n local: '2.9.1',\n time: '0.14.2',\n} as const;\nexport type ITerraformProviderVersion = keyof typeof TERRAFORM_VERSIONS;\n\n/**\n * Substitution variables exposing Terraform provider version constraints to\n * generated `.tf` templates (e.g. `version = \"<%- awsProviderVersion %>\"`)\n */\nexport const terraformProviderVersions = () => ({\n awsProviderVersion: TERRAFORM_VERSIONS.aws,\n randomProviderVersion: TERRAFORM_VERSIONS.random,\n nullProviderVersion: TERRAFORM_VERSIONS.null,\n archiveProviderVersion: TERRAFORM_VERSIONS.archive,\n externalProviderVersion: TERRAFORM_VERSIONS.external,\n localProviderVersion: TERRAFORM_VERSIONS.local,\n timeProviderVersion: TERRAFORM_VERSIONS.time,\n});\n"],"names":["declaredNames","TS_VERSIONS","minimatch","mysql2","nx","rxjs","astro","cookie","aws4fetch","constructs","cors","chalk","cn","commander","electrodb","esbuild","ejs","express","husky","mariadb","mise","npm","pg","prisma","react","rolldown","shx","tailwindcss","tsx","shadcn","vite","typescript","vitest","jsdom","zod","ws","LOCKSTEP_GROUPS","withVersions","declaration","deps","assertDeclared","ts","Object","fromEntries","map","dep","NX_PACKAGES","NX_VERSION","PY_VERSIONS","aiosqlite","boto3","checkov","fastapi","httpx","langchain","langgraph","mcp","pydantic","ruff","ty","pynamodb","uvicorn","sqlmodel","alembic","aiomysql","asyncpg","greenlet","withPyVersions","py","declared","kind","names","undeclared","filter","includes","length","Error","join","VENDORED_VERSIONS","JAVA_VERSIONS","JAVA_ARTIFACTS","keys","javaMavenDependency","artifact","MISE_VERSIONS","smithy","MISE_TOOLS","BASE_IMAGES","node","python","CONTAINER_VERSIONS","trivy","CONTAINER_REPOSITORIES","containerImage","tool","LAMBDA_RUNTIME_VERSIONS","AGENT_CORE_RUNTIME_VERSIONS","agentCoreRuntime","runtime","replace","pyenvPythonVersion","pyprojectPythonDependency","terraformLambdaRuntime","cdkLambdaRuntime","cdkLambdaRuntimeVars","nodeRuntime","pythonRuntime","terraformLambdaRuntimeVars","TERRAFORM_VERSIONS","aws","random","null","archive","external","local","time","terraformProviderVersions","awsProviderVersion","randomProviderVersion","nullProviderVersion","archiveProviderVersion","externalProviderVersion","localProviderVersion","timeProviderVersion"],"mappings":"AAAA;;;CAGC,GACD,SAIEA,aAAa,QACR,6BAA6B;AAEpC;;CAEC,GACD,OAAO,MAAMC,cAAc;IACzB,eAAe;IACf,0DAA0D;IAC1D,yEAAyE;IACzE,uDAAuD;IACvD,oCAAoC;IACpC,0EAA0E;IAC1E,2EAA2E;IAC3E,6EAA6E;IAC7E,8EAA8E;IAC9E,kDAAkD;IAClDC,WAAW;IACX,8EAA8E;IAC9E,8EAA8E;IAC9E,yEAAyE;IACzE,8EAA8E;IAC9E,gBAAgB;IAChBC,QAAQ;IACR,4BAA4B;IAC5B,+BAA+B;IAC/B,uBAAuB;I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AAI,CAAC,EAAE,CAAC,GACzC,CAAC,MAAM,EAAEO,wBAAwBN,MAAM,EAAE,CAAC;AAEhD;;;CAGC,GACD,OAAO,MAAMc,mBAAmB,CAACL,UAC/BA,YAAY,SACR,CAAC,eAAe,EAAEH,wBAAwBP,IAAI,CAAC,EAAE,CAAC,GAClD,CAAC,eAAe,EAAEO,wBAAwBN,MAAM,CAACU,OAAO,CAAC,KAAK,MAAM,CAAC;AAE3E;;;;;CAKC,GACD,OAAO,MAAMK,uBAAuB,IAAO,CAAA;QACzCC,aAAaF,iBAAiB;QAC9BG,eAAeH,iBAAiB;IAClC,CAAA,EAAG;AAEH;;;CAGC,GACD,OAAO,MAAMI,6BAA6B,IAAO,CAAA;QAC/CF,aAAaH,uBAAuB;QACpCI,eAAeJ,uBAAuB;IACxC,CAAA,EAAG;AAEH;;;CAGC,GACD,OAAO,MAAMM,qBAAqB;IAChCC,KAAK;IACLC,QAAQ;IACRC,MAAM;IACNC,SAAS;IACTC,UAAU;IACVC,OAAO;IACPC,MAAM;AACR,EAAW;AAGX;;;CAGC,GACD,OAAO,MAAMC,4BAA4B,IAAO,CAAA;QAC9CC,oBAAoBT,mBAAmBC,GAAG;QAC1CS,uBAAuBV,mBAAmBE,MAAM;QAChDS,qBAAqBX,mBAAmBG,IAAI;QAC5CS,wBAAwBZ,mBAAmBI,OAAO;QAClDS,yBAAyBb,mBAAmBK,QAAQ;QACpDS,sBAAsBd,mBAAmBM,KAAK;QAC9CS,qBAAqBf,mBAAmBO,IAAI;IAC9C,CAAA,EAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/cache-inputs-outputs/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getProjects,\n type MigrationReturnObject,\n type ProjectConfiguration,\n readNxJson,\n type TargetConfiguration,\n type Tree,\n updateNxJson,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport {\n SMITHY_PROJECT_GENERATOR_INFO,\n SMITHY_TARGET_INPUTS,\n} from '../../../smithy/project/generator.js';\nimport { TERRAFORM_PROJECT_GENERATOR_INFO } from '../../../terraform/project/generator.js';\nimport {\n DEPENDENT_TASKS_OUTPUT_FILES_INPUT,\n VENDED_DEPENDENT_TASKS_OUTPUT_GLOBS,\n} from '../../../ts/lib/generator.js';\nimport { TS_RDB_GENERATOR_INFO } from '../../../ts/rdb/generator.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\n\n/**\n * Fix what four generated targets hash, so cached results follow what each\n * task actually reads:\n *\n * - `nx.json`'s `default` input no longer hashes checkov reports\n * (`dist/<project>/checkov/checkov_report.json`, CDK and Terraform) or vitest\n * coverage (`dist/<project>/test-output/vitest/coverage/`) from upstream\n * tasks. Nothing downstream reads them, and an uncached scan or coverage run\n * rewrites them, which missed every dependent task.\n * - A Smithy project's `compile` and `generate-ssdk` declare `[\"default\"]`,\n * their own sources plus the outputs of the tasks they depend on, rather\n * than relying on whatever target default applies. That hashes a consumed\n * shape library's output only in a workspace where nx.json's `default`\n * carries the `dependentTasksOutputFiles` entry, which only\n * ts/lib/generator.ts writes.\n * - A ts#rdb project's `generate` (`prisma generate`) is cached on\n * `[\"default\"]`, which covers the Prisma schema and config. The Prisma\n * version is hashed through the lockfile.\n * - A Terraform project's `output` is no longer cached: it reads remote state,\n * which no input can hash, so a hit could replay values from before an apply.\n *\n * Each edit uses the generator's own constants, so a migrated workspace is\n * byte-identical to a freshly generated one, keys in the same order. A target\n * or glob that has diverged from the generated shape is left untouched and\n * reported.\n *\n * Changing `namedInputs.default` changes every task hash, so the first build\n * after migrating misses the cache throughout. Removing a churning input can\n * also let a target that reads a file it does not declare replay a stale\n * result, so that risk is reported whenever the glob is rewritten.\n */\n\nconst CURRENT_GLOB =\n DEPENDENT_TASKS_OUTPUT_FILES_INPUT.dependentTasksOutputFiles;\n\nconst STALE_PASS_ADVISORY =\n \"nx.json's 'default' input no longer hashes checkov reports or vitest coverage from upstream tasks. A target that reads a file it does not declare as an input (for example a test reading README.md) can now replay a cached result after that file changes; add such files to the target's inputs.\";\n\nconst SMITHY_TARGETS = ['compile', 'generate-ssdk'];\nconst RDB_INPUTS = ['default'];\nconst PRE_FIX_TERRAFORM_OUTPUT_INPUTS = ['default'];\n\nconst sameInputs = (\n inputs: TargetConfiguration['inputs'],\n expected: string[],\n): boolean =>\n Array.isArray(inputs) &&\n inputs.length === expected.length &&\n inputs.every((input, index) => input === expected[index]);\n\nconst command = (target: TargetConfiguration): unknown =>\n target.options?.command;\n\n/** Rewrites a previously vended glob; returns whether it did. */\nconst migrateGlob = (tree: Tree, nextSteps: string[]): boolean => {\n const nxJson = readNxJson(tree);\n const defaultInputs = nxJson?.namedInputs?.default;\n if (!nxJson || !Array.isArray(defaultInputs)) return false;\n\n // A dependentTasksOutputFiles entry is \"vended\" if it is already current or\n // is one of the globs this plugin has shipped (and so would be rewritten to\n // the current one below). An extra entry a user added beside it - neither\n // current nor vended - is their own scoping decision and is reported only\n // when no vended-or-current entry exists; otherwise it would be reported on\n // every run with advice that could widen hashing.\n const hasVendedOrCurrentEntry = defaultInputs.some(\n (input) =>\n typeof input === 'object' &&\n input !== null &&\n 'dependentTasksOutputFiles' in input &&\n (input.dependentTasksOutputFiles === CURRENT_GLOB ||\n (input.transitive &&\n VENDED_DEPENDENT_TASKS_OUTPUT_GLOBS.includes(\n input.dependentTasksOutputFiles,\n ))),\n );\n\n let rewrote = false;\n nxJson.namedInputs.default = defaultInputs.map((input) => {\n if (typeof input !== 'object' || !('dependentTasksOutputFiles' in input)) {\n return input;\n }\n const glob = input.dependentTasksOutputFiles;\n if (glob === CURRENT_GLOB) return input;\n if (\n input.transitive &&\n VENDED_DEPENDENT_TASKS_OUTPUT_GLOBS.includes(glob)\n ) {\n rewrote = true;\n return { ...input, dependentTasksOutputFiles: CURRENT_GLOB };\n }\n if (!hasVendedOrCurrentEntry) {\n nextSteps.push(\n `nx.json: the 'default' input's dependentTasksOutputFiles '${glob}' has diverged from the generated shape - left untouched. Consider excluding checkov reports and vitest coverage ('${CURRENT_GLOB}'), which otherwise miss every dependent task whenever a scan or coverage run rewrites them.`,\n );\n }\n return input;\n });\n\n if (rewrote) updateNxJson(tree, nxJson);\n return rewrote;\n};\n\nconst diverged = (projectName: string, targetName: string, advice: string) =>\n `${projectName}:${targetName}: has diverged from the generated shape - left untouched. ${advice}`;\n\n/** Inserts `inputs` after `cache`, where the generator writes it. */\nconst migrateSmithyTarget = (\n projectName: string,\n targetName: string,\n target: TargetConfiguration,\n nextSteps: string[],\n): TargetConfiguration | undefined => {\n if (sameInputs(target.inputs, SMITHY_TARGET_INPUTS)) return undefined;\n if (target.inputs !== undefined || target.executor !== 'nx:run-commands') {\n nextSteps.push(\n diverged(\n projectName,\n targetName,\n \"Confirm its inputs cover the Smithy sources and the outputs of the tasks it depends on, as ['default'] does.\",\n ),\n );\n return undefined;\n }\n const { cache, ...rest } = target;\n return { cache, inputs: [...SMITHY_TARGET_INPUTS], ...rest };\n};\n\n/** Inserts `cache` and `inputs` after `executor`, where the generator writes them. */\nconst migrateRdbGenerate = (\n projectName: string,\n target: TargetConfiguration,\n nextSteps: string[],\n): TargetConfiguration | undefined => {\n if (target.cache === true && sameInputs(target.inputs, RDB_INPUTS)) {\n return undefined;\n }\n if (\n target.executor !== 'nx:run-commands' ||\n command(target) !== 'prisma generate' ||\n target.cache !== undefined ||\n target.inputs !== undefined\n ) {\n nextSteps.push(\n diverged(\n projectName,\n 'generate',\n \"To cache Prisma client generation, set cache: true and inputs: ['default'], which covers the Prisma schema and config.\",\n ),\n );\n return undefined;\n }\n const { executor, ...rest } = target;\n return { executor, cache: true, inputs: [...RDB_INPUTS], ...rest };\n};\n\n/** Stops caching `output` in place and drops its inputs. */\nconst migrateTerraformOutput = (\n projectName: string,\n target: TargetConfiguration,\n nextSteps: string[],\n): TargetConfiguration | undefined => {\n if (target.cache !== true) return undefined;\n if (\n !sameInputs(target.inputs, PRE_FIX_TERRAFORM_OUTPUT_INPUTS) ||\n command(target) !== 'terraform output -json'\n ) {\n nextSteps.push(\n diverged(\n projectName,\n 'output',\n 'A cached output can replay stale values after an apply; set cache: false.',\n ),\n );\n return undefined;\n }\n const { inputs: _inputs, ...rest } = target;\n return { ...rest, cache: false };\n};\n\nconst migrateProject = (\n projectName: string,\n project: ProjectConfiguration,\n nextSteps: string[],\n): boolean => {\n const generator = (project.metadata as { generator?: string } | undefined)\n ?.generator;\n const targets = project.targets ?? {};\n\n const migrations: [string, () => TargetConfiguration | undefined][] =\n generator === SMITHY_PROJECT_GENERATOR_INFO.id\n ? SMITHY_TARGETS.map((name) => [\n name,\n () =>\n migrateSmithyTarget(projectName, name, targets[name], nextSteps),\n ])\n : generator === TS_RDB_GENERATOR_INFO.id\n ? [\n [\n 'generate',\n () =>\n migrateRdbGenerate(projectName, targets.generate, nextSteps),\n ],\n ]\n : generator === TERRAFORM_PROJECT_GENERATOR_INFO.id\n ? [\n [\n 'output',\n () =>\n migrateTerraformOutput(\n projectName,\n targets.output,\n nextSteps,\n ),\n ],\n ]\n : [];\n\n let changed = false;\n for (const [name, migrate] of migrations) {\n if (!targets[name]) continue;\n const migrated = migrate();\n if (migrated) {\n targets[name] = migrated;\n changed = true;\n }\n }\n return changed;\n};\n\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [];\n\n const rewroteGlob = migrateGlob(tree, nextSteps);\n\n for (const [projectName, project] of getProjects(tree)) {\n if (migrateProject(projectName, project, nextSteps)) {\n updateProjectConfiguration(tree, projectName, project);\n }\n }\n\n if (rewroteGlob) nextSteps.push(STALE_PASS_ADVISORY);\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","readNxJson","updateNxJson","updateProjectConfiguration","SMITHY_PROJECT_GENERATOR_INFO","SMITHY_TARGET_INPUTS","TERRAFORM_PROJECT_GENERATOR_INFO","DEPENDENT_TASKS_OUTPUT_FILES_INPUT","VENDED_DEPENDENT_TASKS_OUTPUT_GLOBS","TS_RDB_GENERATOR_INFO","formatFilesInSubtree","CURRENT_GLOB","dependentTasksOutputFiles","STALE_PASS_ADVISORY","SMITHY_TARGETS","RDB_INPUTS","PRE_FIX_TERRAFORM_OUTPUT_INPUTS","sameInputs","inputs","expected","Array","isArray","length","every","input","index","command","target","options","migrateGlob","tree","nextSteps","nxJson","defaultInputs","namedInputs","default","hasVendedOrCurrentEntry","some","transitive","includes","rewrote","map","glob","push","diverged","projectName","targetName","advice","migrateSmithyTarget","undefined","executor","cache","rest","migrateRdbGenerate","migrateTerraformOutput","_inputs","migrateProject","project","generator","metadata","targets","migrations","id","name","generate","output","changed","migrate","migrated","migration","rewroteGlob"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EAGXC,UAAU,EAGVC,YAAY,EACZC,0BAA0B,QACrB,aAAa;AACpB,SACEC,6BAA6B,EAC7BC,oBAAoB,QACf,uCAAuC;AAC9C,SAASC,gCAAgC,QAAQ,0CAA0C;AAC3F,SACEC,kCAAkC,EAClCC,mCAAmC,QAC9B,+BAA+B;AACtC,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GAED,MAAMC,eACJJ,mCAAmCK,yBAAyB;AAE9D,MAAMC,sBACJ;AAEF,MAAMC,iBAAiB;IAAC;IAAW;CAAgB;AACnD,MAAMC,aAAa;IAAC;CAAU;AAC9B,MAAMC,kCAAkC;IAAC;CAAU;AAEnD,MAAMC,aAAa,CACjBC,QACAC,WAEAC,MAAMC,OAAO,CAACH,WACdA,OAAOI,MAAM,KAAKH,SAASG,MAAM,IACjCJ,OAAOK,KAAK,CAAC,CAACC,OAAOC,QAAUD,UAAUL,QAAQ,CAACM,MAAM;AAE1D,MAAMC,UAAU,CAACC,SACfA,OAAOC,OAAO,EAA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;IAEA,MAAM2B,YAAaD,QAAQE,QAAQ,EAC/BD;IACJ,MAAME,UAAUH,QAAQG,OAAO,IAAI,CAAC;IAEpC,MAAMC,aACJH,cAActD,8BAA8B0D,EAAE,GAC1ChD,eAAe2B,GAAG,CAAC,CAACsB,OAAS;YAC3BA;YACA,IACEf,oBAAoBH,aAAakB,MAAMH,OAAO,CAACG,KAAK,EAAEhC;SACzD,IACD2B,cAAcjD,sBAAsBqD,EAAE,GACpC;QACE;YACE;YACA,IACET,mBAAmBR,aAAae,QAAQI,QAAQ,EAAEjC;SACrD;KACF,GACD2B,cAAcpD,iCAAiCwD,EAAE,GAC/C;QACE;YACE;YACA,IACER,uBACET,aACAe,QAAQK,MAAM,EACdlC;SAEL;KACF,GACD,EAAE;IAEZ,IAAImC,UAAU;IACd,KAAK,MAAM,CAACH,MAAMI,QAAQ,IAAIN,WAAY;QACxC,IAAI,CAACD,OAAO,CAACG,KAAK,EAAE;QACpB,MAAMK,WAAWD;QACjB,IAAIC,UAAU;YACZR,OAAO,CAACG,KAAK,GAAGK;YAChBF,UAAU;QACZ;IACF;IACA,OAAOA;AACT;AAEA,eAAe,eAAeG,UAC5BvC,IAAU;IAEV,MAAMC,YAAsB,EAAE;IAE9B,MAAMuC,cAAczC,YAAYC,MAAMC;IAEtC,KAAK,MAAM,CAACc,aAAaY,QAAQ,IAAIzD,YAAY8B,MAAO;QACtD,IAAI0B,eAAeX,aAAaY,SAAS1B,YAAY;YACnD5B,2BAA2B2B,MAAMe,aAAaY;QAChD;IACF;IAEA,IAAIa,aAAavC,UAAUY,IAAI,CAAC9B;IAEhC,MAAMH,qBAAqBoB;IAE3B,OAAO;QAAEC;IAAU;AACrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/infra-test-loop/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getProjects,\n joinPathFragments,\n type MigrationReturnObject,\n type ProjectConfiguration,\n type TargetConfiguration,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { INFRA_APP_GENERATOR_INFO } from '../../../infra/app/generator.js';\nimport { matchGritQL } from '../../../utils/ast.js';\nimport {\n addCdkTestGlobalSetup,\n CDK_TEST_GLOBAL_SETUP,\n CDK_TEST_GLOBAL_SETUP_ENTRY,\n findVitestConfig,\n renderCdkTestGlobalSetup,\n} from '../../../utils/cdk-test-setup.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { sortObjectKeys } from '../../../utils/object.js';\nimport {\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n} from '../../../utils/shared-constructs-constants.js';\n\n/**\n * Run CDK infrastructure tests against the artifacts their stacks deploy, in a\n * per-run temp directory with CDK asset bundling skipped.\n *\n * The infra `test` target inherited the `^build` target default, so every\n * infra test run first ran every deployed project's lint, test, type-check and\n * bundle. The stacks only need the bundles: `Code.fromAsset` and its siblings\n * throw on a missing asset path, so the edge is narrowed to `^assemble` (the\n * artifact-only chain `synth` and `deploy` already use) rather than removed.\n *\n * Each `new App()` in a test synthesizes into a fresh `cdk.out*` directory\n * under the OS temp dir, which nothing removed, so a workspace's tests leaked\n * into the shared `/tmp`. The vended `tests/global-setup.ts` points `TMPDIR`,\n * `TEMP` and `TMP` at a directory of its own for the run and removes it in\n * teardown. aws-cdk-lib deletes the `cdk.out*` directories an `App` created\n * from a `process.on('exit')` handler, and vitest runs the global teardown\n * while its forked workers are still exiting, so a single `rmSync` can race\n * that delete and return with the directory still there. The teardown\n * therefore retries every 50 ms for up to 2 s, and warns (naming the\n * directory) rather than failing the run if it is still there. It also merges `aws:cdk:bundling-stacks: []` into\n * `CDK_CONTEXT_JSON`, which only affects user-written bundling constructs\n * (`NodejsFunction`, `PythonFunction`); the vended constructs read prebuilt\n * bundles. The setup is registered in the infra project's and the shared\n * constructs' vitest configs.\n *\n * Only the exact shape the generator wrote before is changed. A `test` target,\n * a `globalSetup`, a vitest config or a `tests/global-setup.ts` that differs is\n * left untouched and reported, and a setup file the plugin did not write is\n * never registered. The migration writes the generator's own template, so a migrated project is\n * byte-identical to a freshly generated one. Infra READMEs are left alone: the\n * generator writes them `KeepExisting`, and users edit them.\n */\n\nconst TEST_TARGET = 'test';\nconst TEST_DEPENDS_ON = ['^assemble'];\n\nconst isFixedTestTarget = (target: TargetConfiguration): boolean =>\n Object.keys(target).length === 1 &&\n Array.isArray(target.dependsOn) &&\n target.dependsOn.length === TEST_DEPENDS_ON.length &&\n target.dependsOn.every((dep, index) => dep === TEST_DEPENDS_ON[index]);\n\n/** Any `globalSetup` property in the config. */\nconst ANY_GLOBAL_SETUP = '`globalSetup: $_`';\n\n/** Exactly the entry the generator registers. */\nconst VENDED_GLOBAL_SETUP = `\\`globalSetup: ['${CDK_TEST_GLOBAL_SETUP_ENTRY}']\\``;\n\n/** The `defineConfig(() => ({ test: { ... } }))` shape the generator inserts into. */\nconst RECOGNISED_CONFIG = `\\`test: { $props }\\` where { $props <: within \\`defineConfig($_)\\` }`;\n\n/**\n * Vend and register the global setup for one project, unless any of its files\n * has diverged from the generated shape. Returns the reason it was skipped.\n */\nconst migrateGlobalSetup = async (\n tree: Tree,\n projectName: string,\n root: string,\n): Promise<string | undefined> => {\n const setupPath = joinPathFragments(root, CDK_TEST_GLOBAL_SETUP);\n const configPath = findVitestConfig(tree, root);\n\n if (!configPath) {\n return `${projectName}: no vitest config found in ${root} - add \\`globalSetup: ['${CDK_TEST_GLOBAL_SETUP_ENTRY}']\\` to its \\`test\\` options to give each test run its own temp directory.`;\n }\n\n if (\n tree.exists(setupPath) &&\n (tree.read(setupPath, 'utf-8') ?? '') !== renderCdkTestGlobalSetup()\n ) {\n return `${projectName}: ${setupPath} differs from the vended global setup - left untouched and not registered. Compare it with a freshly generated one, which gives each test run its own temp directory and skips CDK asset bundling, then add \\`globalSetup: ['${CDK_TEST_GLOBAL_SETUP_ENTRY}']\\` to ${configPath}.`;\n }\n\n if (await matchGritQL(tree, configPath, ANY_GLOBAL_SETUP)) {\n if (await matchGritQL(tree, configPath, VENDED_GLOBAL_SETUP)) {\n await addCdkTestGlobalSetup(tree, root);\n return undefined;\n }\n return `${projectName}: ${configPath} already declares a \\`globalSetup\\` - left untouched. Add '${CDK_TEST_GLOBAL_SETUP_ENTRY}' to it to give each test run its own temp directory.`;\n }\n\n if (!(await matchGritQL(tree, configPath, RECOGNISED_CONFIG))) {\n return `${projectName}: ${configPath} has diverged from the generated shape - left untouched. Add \\`globalSetup: ['${CDK_TEST_GLOBAL_SETUP_ENTRY}']\\` to its \\`test\\` options to give each test run its own temp directory.`;\n }\n\n await addCdkTestGlobalSetup(tree, root);\n return undefined;\n};\n\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [];\n\n for (const [projectName, project] of getProjects(tree)) {\n const generator = (project.metadata as { generator?: string } | undefined)\n ?.generator;\n if (generator !== INFRA_APP_GENERATOR_INFO.id) continue;\n\n const testTarget = project.targets?.[TEST_TARGET];\n if (!testTarget) {\n updateProjectConfiguration(tree, projectName, {\n ...project,\n targets: sortObjectKeys({\n ...project.targets,\n [TEST_TARGET]: { dependsOn: [...TEST_DEPENDS_ON] },\n }),\n } as ProjectConfiguration);\n } else if (!isFixedTestTarget(testTarget)) {\n nextSteps.push(\n `${projectName}: the \\`test\\` target in ${joinPathFragments(project.root, 'project.json')} has diverged from the generated shape - left untouched. Set its \\`dependsOn\\` to [\"^assemble\"] so tests build the deployed projects' artifacts rather than every upstream build.`,\n );\n }\n\n const skipped = await migrateGlobalSetup(tree, projectName, project.root);\n if (skipped) nextSteps.push(skipped);\n }\n\n const constructsRoot = joinPathFragments(PACKAGES_DIR, SHARED_CONSTRUCTS_DIR);\n if (tree.exists(joinPathFragments(constructsRoot, 'project.json'))) {\n const skipped = await migrateGlobalSetup(\n tree,\n constructsRoot,\n constructsRoot,\n );\n if (skipped) nextSteps.push(skipped);\n }\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","joinPathFragments","updateProjectConfiguration","INFRA_APP_GENERATOR_INFO","matchGritQL","addCdkTestGlobalSetup","CDK_TEST_GLOBAL_SETUP","CDK_TEST_GLOBAL_SETUP_ENTRY","findVitestConfig","renderCdkTestGlobalSetup","formatFilesInSubtree","sortObjectKeys","PACKAGES_DIR","SHARED_CONSTRUCTS_DIR","TEST_TARGET","TEST_DEPENDS_ON","isFixedTestTarget","target","Object","keys","length","Array","isArray","dependsOn","every","dep","index","ANY_GLOBAL_SETUP","VENDED_GLOBAL_SETUP","RECOGNISED_CONFIG","migrateGlobalSetup","tree","projectName","root","setupPath","configPath","exists","read","undefined","migration","nextSteps","project","generator","metadata","id","testTarget","targets","push","skipped","constructsRoot"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EACXC,iBAAiB,EAKjBC,0BAA0B,QACrB,aAAa;AACpB,SAASC,wBAAwB,QAAQ,kCAAkC;AAC3E,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SACEC,qBAAqB,EACrBC,qBAAqB,EACrBC,2BAA2B,EAC3BC,gBAAgB,EAChBC,wBAAwB,QACnB,mCAAmC;AAC1C,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,SACEC,YAAY,EACZC,qBAAqB,QAChB,gDAAgD;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BC,GAED,MAAMC,cAAc;AACpB,MAAMC,kBAAkB;IAAC;CAAY;AAErC,MAAMC,oBAAoB,CAACC,SACzBC,OAAOC,IAAI,CAACF,QAAQG,MAAM,KAAK,KAC/BC,MAAMC,OAAO,CAACL,OAAOM,SAAS,KAC9BN,OAAOM,SAAS,CAACH,MAAM,KAAKL,gBAAgBK,MAAM,IAClDH,OAAOM,SAAS,CAACC,KAAK,CAAC,CAACC,KAAKC,QAAUD,QAAQV,eAAe,CAAC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,YAAaD,QAAQE,QAAQ,EAC/BD;QACJ,IAAIA,cAAcvC,yBAAyByC,EAAE,EAAE;QAE/C,MAAMC,aAAaJ,QAAQK,OAAO,EAAE,CAAChC,YAAY;QACjD,IAAI,CAAC+B,YAAY;YACf3C,2BAA2B6B,MAAMC,aAAa;gBAC5C,GAAGS,OAAO;gBACVK,SAASnC,eAAe;oBACtB,GAAG8B,QAAQK,OAAO;oBAClB,CAAChC,YAAY,EAAE;wBAAES,WAAW;+BAAIR;yBAAgB;oBAAC;gBACnD;YACF;QACF,OAAO,IAAI,CAACC,kBAAkB6B,aAAa;YACzCL,UAAUO,IAAI,CACZ,GAAGf,YAAY,yBAAyB,EAAE/B,kBAAkBwC,QAAQR,IAAI,EAAE,gBAAgB,iLAAiL,CAAC;QAEhR;QAEA,MAAMe,UAAU,MAAMlB,mBAAmBC,MAAMC,aAAaS,QAAQR,IAAI;QACxE,IAAIe,SAASR,UAAUO,IAAI,CAACC;IAC9B;IAEA,MAAMC,iBAAiBhD,kBAAkBW,cAAcC;IACvD,IAAIkB,KAAKK,MAAM,CAACnC,kBAAkBgD,gBAAgB,kBAAkB;QAClE,MAAMD,UAAU,MAAMlB,mBACpBC,MACAkB,gBACAA;QAEF,IAAID,SAASR,UAAUO,IAAI,CAACC;IAC9B;IAEA,MAAMtC,qBAAqBqB;IAE3B,OAAO;QAAES;IAAU;AACrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/pin-strands-express-peer/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getProjects, joinPathFragments, type Tree } from '@nx/devkit';\nimport { AGENT_CONNECTION_PROJECT_DIR } from '../../../utils/agent-connection/agent-connection.js';\nimport { addDependenciesToPackageJson } from '../../../utils/dependencies.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { TS_VERSIONS } from '../../../utils/versions.js';\n\nconst EXPRESS = 'express';\nconst STRANDS_SDK = '@strands-agents/sdk';\nconst ROOT_PACKAGE_JSON = 'package.json';\n\n/**\n * `express` is an optional peer of `@strands-agents/sdk` that any importer\n * declaring strands without also declaring express can leave undeclared. pnpm\n * suffixes each installed copy of a package by the versions of its peers, so\n * such an importer can resolve express to a different version than the pin\n * every other strands importer uses — splitting `@strands-agents/sdk` into two\n * peer-suffixed instances of the same version.\n *\n * Anything importing both instances then sees two nominal identities of every\n * SDK type — `Agent`, `McpClient`, `Plugin` — and fails to compile with \"Types\n * have separate declarations of a private property\". Declaring express\n * wherever strands is declared keeps the whole strands subgraph on the\n * catalog's single pin. Mirrors the earlier `@aws-sdk/client-s3` peer fix, one\n * optional peer further on.\n *\n * Detection is generic — every project's `package.json` plus the workspace\n * root, checked for \"declares @strands-agents/sdk but not express\" — rather\n * than listing the generators that currently produce that shape, so a future\n * strands importer this migration predates is still covered. The shared\n * agent-connection project is checked explicitly too, in case its project.json\n * is missing or not yet registered when this runs — `getProjects` would miss\n * it then, same as rc.95's `@aws-sdk/client-s3` migration guarded against.\n */\nexport default async function migration(tree: Tree): Promise<void> {\n pinIfNeeded(tree, ROOT_PACKAGE_JSON);\n pinIfNeeded(\n tree,\n joinPathFragments(AGENT_CONNECTION_PROJECT_DIR, 'package.json'),\n );\n\n for (const project of getProjects(tree).values()) {\n pinIfNeeded(tree, joinPathFragments(project.root, 'package.json'));\n }\n\n await formatFilesInSubtree(tree);\n}\n\n/** Declare express on the given manifest, if it declares strands but not express. */\nfunction pinIfNeeded(tree: Tree, packageJsonPath: string): void {\n if (!tree.exists(packageJsonPath)) {\n return;\n }\n\n const packageJson = JSON.parse(tree.read(packageJsonPath, 'utf-8') ?? '{}');\n // Only where a strands client is actually declared — that is what pulls the\n // optional peer. An already-declared express (even a stale range) is left to\n // addDependenciesToPackageJson, which resolves it onto the catalog.\n if (!packageJson.dependencies?.[STRANDS_SDK]) {\n return;\n }\n\n addDependenciesToPackageJson(\n tree,\n { [EXPRESS]: TS_VERSIONS[EXPRESS] },\n {},\n packageJsonPath,\n );\n}\n"],"names":["getProjects","joinPathFragments","AGENT_CONNECTION_PROJECT_DIR","addDependenciesToPackageJson","formatFilesInSubtree","TS_VERSIONS","EXPRESS","STRANDS_SDK","ROOT_PACKAGE_JSON","migration","tree","pinIfNeeded","project","values","root","packageJsonPath","exists","packageJson","JSON","parse","read","dependencies"],"mappings":"AAAA;;;CAGC,GACD,SAASA,WAAW,EAAEC,iBAAiB,QAAmB,aAAa;AACvE,SAASC,4BAA4B,QAAQ,sDAAsD;AACnG,SAASC,4BAA4B,QAAQ,iCAAiC;AAC9E,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,WAAW,QAAQ,6BAA6B;AAEzD,MAAMC,UAAU;AAChB,MAAMC,cAAc;AACpB,MAAMC,oBAAoB;AAE1B;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,eAAe,eAAeC,UAAUC,IAAU;IAChDC,YAAYD,MAAMF;IAClBG,YACED,MACAT,kBAAkBC,8BAA8B;IAGlD,KAAK,MAAMU,WAAWZ,YAAYU,MAAMG,MAAM,GAAI;QAChDF,YAAYD,MAAMT,kBAAkBW,QAAQE,IAAI,EAAE;IACpD;IAEA,MAAMV,qBAAqBM;AAC7B;AAEA,mFAAmF,GACnF,SAASC,YAAYD,IAAU,EAAEK,eAAuB;IACtD,IAAI,CAACL,KAAKM,MAAM,CAACD,kBAAkB;QACjC;IACF;IAEA,MAAME,cAAcC,KAAKC,KAAK,CAACT,KAAKU,IAAI,CAACL,iBAAiB,YAAY;IACtE,4EAA4E;IAC5E,6EAA6E;IAC7E,oEAAoE;IACpE,IAAI,CAACE,YAAYI,YAAY,EAAE,CAACd,YAAY,EAAE;QAC5C;IACF;IAEAJ,6BACEO,MACA;QAAE,CAACJ,QAAQ,EAAED,WAAW,CAACC,QAAQ;IAAC,GAClC,CAAC,GACDS;AAEJ"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/ import { getProjects, joinPathFragments } from "@nx/devkit";
|
|
5
|
-
import { PY_DYNAMODB_GENERATOR_INFO } from "../../../py/dynamodb/generator.js";
|
|
6
|
-
import { formatFilesInSubtree } from "../../../utils/format.js";
|
|
7
|
-
/**
|
|
8
|
-
* Type the `Meta` class of the `BaseModel` that py#dynamodb vends in
|
|
9
|
-
* `<module>/entities/base.py` as a subclass of pynamodb's `MetaProtocol`.
|
|
10
|
-
*
|
|
11
|
-
* pynamodb declares `Model.Meta: MetaProtocol`. The vended nested `class Meta:`
|
|
12
|
-
* defines only some of the protocol's members, and infers `region` as `str`
|
|
13
|
-
* where the protocol declares a mutable `Optional[str]`. From ty 0.0.86 that
|
|
14
|
-
* makes the project's `typecheck` target fail with `invalid-attribute-override`.
|
|
15
|
-
* Subclassing the protocol declares every member with the protocol's type.
|
|
16
|
-
* The members it only annotates are not set on the class, so pynamodb's
|
|
17
|
-
* runtime defaults apply as before.
|
|
18
|
-
*
|
|
19
|
-
* The generator writes base.py once and keeps the user's copy, so this brings
|
|
20
|
-
* existing workspaces up to date. A base.py is edited only where its import
|
|
21
|
-
* line and `Meta` block still have the exact shape the generator wrote. One
|
|
22
|
-
* that has diverged is left untouched and reported via `nextSteps`.
|
|
23
|
-
*/ const OLD_IMPORT = '\nfrom pynamodb.models import Model\n';
|
|
24
|
-
const NEW_IMPORT = '\nfrom pynamodb.models import MetaProtocol, Model\n';
|
|
25
|
-
const OLD_META_HEADER = ' class Meta:\n';
|
|
26
|
-
const NEW_META_HEADER = ' class Meta(MetaProtocol):\n';
|
|
27
|
-
/**
|
|
28
|
-
* The helper the vended `host` line reads the local port through. Workspaces
|
|
29
|
-
* generated before the serve-local -> local-dev rename use `_serve_local`.
|
|
30
|
-
*/ const LOCAL_DEV_HELPERS = [
|
|
31
|
-
'_local_dev',
|
|
32
|
-
'_serve_local'
|
|
33
|
-
];
|
|
34
|
-
/**
|
|
35
|
-
* The quote the block's string literals use: the template's single quotes, or
|
|
36
|
-
* the double quotes `ruff format` rewrites them to.
|
|
37
|
-
*/ const QUOTES = [
|
|
38
|
-
'"',
|
|
39
|
-
"'"
|
|
40
|
-
];
|
|
41
|
-
/** The vended `BaseModel.Meta` block, up to the blank line that ends it. */ const metaBlock = (header, localDevHelper, quote)=>`${header} table_name: str
|
|
42
|
-
region = os.environ.get("AWS_REGION", ${quote}us-east-1${quote})
|
|
43
|
-
host = f"http://localhost:{${localDevHelper}()['port']}" if is_local() else None
|
|
44
|
-
aws_access_key_id = ${quote}UNUSED${quote} if is_local() else None
|
|
45
|
-
aws_secret_access_key = ${quote}UNUSED${quote} if is_local() else None
|
|
46
|
-
|
|
47
|
-
`;
|
|
48
|
-
/** Every shape of the block the generator has written. */ const OLD_META_SHAPES = LOCAL_DEV_HELPERS.flatMap((helper)=>QUOTES.map((quote)=>({
|
|
49
|
-
helper,
|
|
50
|
-
quote
|
|
51
|
-
})));
|
|
52
|
-
const divergedNextStep = (filePath)=>`${filePath}: its BaseModel Meta class or its pynamodb.models import has been customised, so it was left unchanged. If \`ty check\` reports invalid-attribute-override for it, declare it as \`class Meta(MetaProtocol):\`, importing MetaProtocol from pynamodb.models.`;
|
|
53
|
-
/**
|
|
54
|
-
* Rewrite a base.py still in the generated shape. Already migrated and missing
|
|
55
|
-
* files are left alone; a diverged one is reported via nextSteps.
|
|
56
|
-
*/ const migrateBasePy = (tree, filePath, nextSteps)=>{
|
|
57
|
-
if (!tree.exists(filePath)) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const content = tree.read(filePath, 'utf-8') ?? '';
|
|
61
|
-
if (content.includes(NEW_META_HEADER)) {
|
|
62
|
-
return; // Already migrated (or user-added).
|
|
63
|
-
}
|
|
64
|
-
const shape = OLD_META_SHAPES.find(({ helper, quote })=>content.includes(metaBlock(OLD_META_HEADER, helper, quote)));
|
|
65
|
-
if (!shape || !content.includes(OLD_IMPORT)) {
|
|
66
|
-
nextSteps.push(divergedNextStep(filePath));
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
tree.write(filePath, content.replace(OLD_IMPORT, NEW_IMPORT).replace(metaBlock(OLD_META_HEADER, shape.helper, shape.quote), metaBlock(NEW_META_HEADER, shape.helper, shape.quote)));
|
|
70
|
-
};
|
|
71
|
-
export default async function migration(tree) {
|
|
72
|
-
const nextSteps = [];
|
|
73
|
-
for (const project of getProjects(tree).values()){
|
|
74
|
-
const generator = project.metadata?.generator;
|
|
75
|
-
// py#dynamodb writes its package under the project's sourceRoot.
|
|
76
|
-
if (generator !== PY_DYNAMODB_GENERATOR_INFO.id || !project.sourceRoot) {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
migrateBasePy(tree, joinPathFragments(project.sourceRoot, 'entities', 'base.py'), nextSteps);
|
|
80
|
-
}
|
|
81
|
-
await formatFilesInSubtree(tree);
|
|
82
|
-
return {
|
|
83
|
-
nextSteps
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
//# sourceMappingURL=migration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/py-dynamodb-type-base-model-meta/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getProjects,\n joinPathFragments,\n type MigrationReturnObject,\n type Tree,\n} from '@nx/devkit';\nimport { PY_DYNAMODB_GENERATOR_INFO } from '../../../py/dynamodb/generator.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\n\n/**\n * Type the `Meta` class of the `BaseModel` that py#dynamodb vends in\n * `<module>/entities/base.py` as a subclass of pynamodb's `MetaProtocol`.\n *\n * pynamodb declares `Model.Meta: MetaProtocol`. The vended nested `class Meta:`\n * defines only some of the protocol's members, and infers `region` as `str`\n * where the protocol declares a mutable `Optional[str]`. From ty 0.0.86 that\n * makes the project's `typecheck` target fail with `invalid-attribute-override`.\n * Subclassing the protocol declares every member with the protocol's type.\n * The members it only annotates are not set on the class, so pynamodb's\n * runtime defaults apply as before.\n *\n * The generator writes base.py once and keeps the user's copy, so this brings\n * existing workspaces up to date. A base.py is edited only where its import\n * line and `Meta` block still have the exact shape the generator wrote. One\n * that has diverged is left untouched and reported via `nextSteps`.\n */\n\nconst OLD_IMPORT = '\\nfrom pynamodb.models import Model\\n';\nconst NEW_IMPORT = '\\nfrom pynamodb.models import MetaProtocol, Model\\n';\n\nconst OLD_META_HEADER = ' class Meta:\\n';\nconst NEW_META_HEADER = ' class Meta(MetaProtocol):\\n';\n\n/**\n * The helper the vended `host` line reads the local port through. Workspaces\n * generated before the serve-local -> local-dev rename use `_serve_local`.\n */\nconst LOCAL_DEV_HELPERS = ['_local_dev', '_serve_local'];\n\n/**\n * The quote the block's string literals use: the template's single quotes, or\n * the double quotes `ruff format` rewrites them to.\n */\nconst QUOTES = ['\"', \"'\"];\n\n/** The vended `BaseModel.Meta` block, up to the blank line that ends it. */\nconst metaBlock = (\n header: string,\n localDevHelper: string,\n quote: string,\n): string =>\n `${header} table_name: str\n region = os.environ.get(\"AWS_REGION\", ${quote}us-east-1${quote})\n host = f\"http://localhost:{${localDevHelper}()['port']}\" if is_local() else None\n aws_access_key_id = ${quote}UNUSED${quote} if is_local() else None\n aws_secret_access_key = ${quote}UNUSED${quote} if is_local() else None\n\n`;\n\n/** Every shape of the block the generator has written. */\nconst OLD_META_SHAPES = LOCAL_DEV_HELPERS.flatMap((helper) =>\n QUOTES.map((quote) => ({ helper, quote })),\n);\n\nconst divergedNextStep = (filePath: string): string =>\n `${filePath}: its BaseModel Meta class or its pynamodb.models import has been customised, so it was left unchanged. If \\`ty check\\` reports invalid-attribute-override for it, declare it as \\`class Meta(MetaProtocol):\\`, importing MetaProtocol from pynamodb.models.`;\n\n/**\n * Rewrite a base.py still in the generated shape. Already migrated and missing\n * files are left alone; a diverged one is reported via nextSteps.\n */\nconst migrateBasePy = (\n tree: Tree,\n filePath: string,\n nextSteps: string[],\n): void => {\n if (!tree.exists(filePath)) {\n return;\n }\n\n const content = tree.read(filePath, 'utf-8') ?? '';\n if (content.includes(NEW_META_HEADER)) {\n return; // Already migrated (or user-added).\n }\n\n const shape = OLD_META_SHAPES.find(({ helper, quote }) =>\n content.includes(metaBlock(OLD_META_HEADER, helper, quote)),\n );\n if (!shape || !content.includes(OLD_IMPORT)) {\n nextSteps.push(divergedNextStep(filePath));\n return;\n }\n\n tree.write(\n filePath,\n content\n .replace(OLD_IMPORT, NEW_IMPORT)\n .replace(\n metaBlock(OLD_META_HEADER, shape.helper, shape.quote),\n metaBlock(NEW_META_HEADER, shape.helper, shape.quote),\n ),\n );\n};\n\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [];\n\n for (const project of getProjects(tree).values()) {\n const generator = (project.metadata as { generator?: string } | undefined)\n ?.generator;\n // py#dynamodb writes its package under the project's sourceRoot.\n if (generator !== PY_DYNAMODB_GENERATOR_INFO.id || !project.sourceRoot) {\n continue;\n }\n migrateBasePy(\n tree,\n joinPathFragments(project.sourceRoot, 'entities', 'base.py'),\n nextSteps,\n );\n }\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","joinPathFragments","PY_DYNAMODB_GENERATOR_INFO","formatFilesInSubtree","OLD_IMPORT","NEW_IMPORT","OLD_META_HEADER","NEW_META_HEADER","LOCAL_DEV_HELPERS","QUOTES","metaBlock","header","localDevHelper","quote","OLD_META_SHAPES","flatMap","helper","map","divergedNextStep","filePath","migrateBasePy","tree","nextSteps","exists","content","read","includes","shape","find","push","write","replace","migration","project","values","generator","metadata","id","sourceRoot"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EACXC,iBAAiB,QAGZ,aAAa;AACpB,SAASC,0BA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