@aws/nx-plugin 1.0.5 → 1.0.7
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 +71 -93
- package/migrations.json +15 -5
- package/package.json +6 -6
- 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-express-peer/metadata.json +3 -0
- package/src/migrations/latest/pin-strands-express-peer/migration.d.ts +29 -0
- package/src/migrations/latest/pin-strands-express-peer/migration.js +58 -0
- package/src/migrations/latest/pin-strands-express-peer/migration.js.map +1 -0
- package/src/migrations/latest/rdb-drop-lambda-rie/metadata.json +3 -0
- package/src/migrations/latest/rdb-drop-lambda-rie/migration.js +105 -0
- package/src/migrations/latest/rdb-drop-lambda-rie/migration.js.map +1 -0
- package/src/migrations/v1.0.5/0001-api-custom-domain-runtime-config/migration.d.ts +6 -0
- package/src/migrations/v1.0.5/0001-api-custom-domain-runtime-config/migration.js.map +1 -0
- package/src/preset/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +6 -6
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +8 -8
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +4 -4
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
- 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 +4 -4
- package/src/py/rdb/__snapshots__/generator.spec.ts.snap +22 -10
- package/src/py/rdb/files/Dockerfile.create-db-user.template +5 -2
- package/src/py/rdb/files/Dockerfile.migration.template +5 -2
- 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 +26 -30
- package/src/ts/agent/a2a-connection/generator.js +9 -5
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/gateway-connection/generator.d.ts +5 -7
- package/src/ts/agent/gateway-connection/generator.js +12 -0
- package/src/ts/agent/gateway-connection/generator.js.map +1 -1
- package/src/ts/agent/generator.d.ts +3 -8
- package/src/ts/agent/generator.js +16 -2
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/generator.d.ts +5 -7
- package/src/ts/agent/mcp-connection/generator.js +12 -0
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/astro-docs/generator.d.ts +4 -4
- package/src/ts/astro-docs/generator.js +10 -4
- package/src/ts/astro-docs/generator.js.map +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 +10 -8
- package/src/ts/rdb/files/Dockerfile.template +4 -2
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +21 -21
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +2 -2
- package/src/utils/agent-connection/agent-connection.d.ts +28 -5
- package/src/utils/agent-connection/agent-connection.js +39 -14
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/docker.d.ts +1 -1
- package/src/utils/versions.d.ts +57 -57
- package/src/utils/versions.js +56 -56
- package/src/utils/versions.js.map +1 -1
- package/src/migrations/latest/api-custom-domain-runtime-config/migration.js.map +0 -1
- /package/src/migrations/latest/{api-custom-domain-runtime-config → rdb-drop-lambda-rie}/migration.d.ts +0 -0
- /package/src/migrations/{latest/api-custom-domain-runtime-config → v1.0.5/0001-api-custom-domain-runtime-config}/metadata.json +0 -0
- /package/src/migrations/{latest/api-custom-domain-runtime-config → v1.0.5/0001-api-custom-domain-runtime-config}/migration.js +0 -0
package/LICENSE-THIRD-PARTY
CHANGED
|
@@ -108,7 +108,7 @@ THE SOFTWARE.
|
|
|
108
108
|
|
|
109
109
|
---
|
|
110
110
|
|
|
111
|
-
The following software may be included in this product: @astral-sh/ruff-wasm-nodejs (0.16.
|
|
111
|
+
The following software may be included in this product: @astral-sh/ruff-wasm-nodejs (0.16.10)
|
|
112
112
|
This software contains the following license and notice below:
|
|
113
113
|
|
|
114
114
|
MIT License
|
|
@@ -3898,7 +3898,7 @@ SOFTWARE.
|
|
|
3898
3898
|
|
|
3899
3899
|
---
|
|
3900
3900
|
|
|
3901
|
-
The following software may be included in this product: @modelcontextprotocol/sdk (1.
|
|
3901
|
+
The following software may be included in this product: @modelcontextprotocol/sdk (1.32.0)
|
|
3902
3902
|
This software contains the following license and notice below:
|
|
3903
3903
|
|
|
3904
3904
|
MIT License
|
|
@@ -4247,7 +4247,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
4247
4247
|
|
|
4248
4248
|
---
|
|
4249
4249
|
|
|
4250
|
-
The following software may be included in this product: @nxlv/python (23.
|
|
4250
|
+
The following software may be included in this product: @nxlv/python (23.2.1)
|
|
4251
4251
|
This software contains the following license and notice below:
|
|
4252
4252
|
|
|
4253
4253
|
MIT License
|
|
@@ -4274,7 +4274,7 @@ SOFTWARE.
|
|
|
4274
4274
|
|
|
4275
4275
|
---
|
|
4276
4276
|
|
|
4277
|
-
The following software may be included in this product: @oxc-project/types (0.
|
|
4277
|
+
The following software may be included in this product: @oxc-project/types (0.152.0)
|
|
4278
4278
|
This software contains the following license and notice below:
|
|
4279
4279
|
|
|
4280
4280
|
MIT License
|
|
@@ -13381,7 +13381,7 @@ SOFTWARE.**
|
|
|
13381
13381
|
|
|
13382
13382
|
---
|
|
13383
13383
|
|
|
13384
|
-
The following software may be included in this product: proxy-addr (2.0.
|
|
13384
|
+
The following software may be included in this product: proxy-addr (2.0.8)
|
|
13385
13385
|
This software contains the following license and notice below:
|
|
13386
13386
|
|
|
13387
13387
|
(The MIT License)
|
|
@@ -14165,7 +14165,7 @@ SOFTWARE.
|
|
|
14165
14165
|
|
|
14166
14166
|
---
|
|
14167
14167
|
|
|
14168
|
-
The following software may be included in this product: rolldown (1.2.
|
|
14168
|
+
The following software may be included in this product: rolldown (1.2.12)
|
|
14169
14169
|
This software contains the following license and notice below:
|
|
14170
14170
|
|
|
14171
14171
|
MIT License
|
|
@@ -16088,7 +16088,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
16088
16088
|
|
|
16089
16089
|
---
|
|
16090
16090
|
|
|
16091
|
-
The following software may be included in this product: vite (8.3.
|
|
16091
|
+
The following software may be included in this product: vite (8.3.2)
|
|
16092
16092
|
This software contains the following license and notice below:
|
|
16093
16093
|
|
|
16094
16094
|
# Vite core license
|
|
@@ -16767,35 +16767,6 @@ Repository: https://github.com/expressjs/cors
|
|
|
16767
16767
|
|
|
16768
16768
|
---------------------------------------
|
|
16769
16769
|
|
|
16770
|
-
## cross-spawn
|
|
16771
|
-
License: MIT
|
|
16772
|
-
By: André Cruz
|
|
16773
|
-
Repository: https://github.com/moxystudio/node-cross-spawn
|
|
16774
|
-
|
|
16775
|
-
> The MIT License (MIT)
|
|
16776
|
-
>
|
|
16777
|
-
> Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio>
|
|
16778
|
-
>
|
|
16779
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16780
|
-
> of this software and associated documentation files (the "Software"), to deal
|
|
16781
|
-
> in the Software without restriction, including without limitation the rights
|
|
16782
|
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16783
|
-
> copies of the Software, and to permit persons to whom the Software is
|
|
16784
|
-
> furnished to do so, subject to the following conditions:
|
|
16785
|
-
>
|
|
16786
|
-
> The above copyright notice and this permission notice shall be included in
|
|
16787
|
-
> all copies or substantial portions of the Software.
|
|
16788
|
-
>
|
|
16789
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16790
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16791
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16792
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16793
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
16794
|
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
16795
|
-
> THE SOFTWARE.
|
|
16796
|
-
|
|
16797
|
-
---------------------------------------
|
|
16798
|
-
|
|
16799
16770
|
## cssesc
|
|
16800
16771
|
License: MIT
|
|
16801
16772
|
By: Mathias Bynens
|
|
@@ -17319,29 +17290,6 @@ Repository: https://github.com/Rich-Harris/is-reference
|
|
|
17319
17290
|
|
|
17320
17291
|
---------------------------------------
|
|
17321
17292
|
|
|
17322
|
-
## isexe, which
|
|
17323
|
-
License: ISC
|
|
17324
|
-
By: Isaac Z. Schlueter
|
|
17325
|
-
Repositories: https://github.com/isaacs/isexe, https://github.com/isaacs/node-which
|
|
17326
|
-
|
|
17327
|
-
> The ISC License
|
|
17328
|
-
>
|
|
17329
|
-
> Copyright (c) Isaac Z. Schlueter and Contributors
|
|
17330
|
-
>
|
|
17331
|
-
> Permission to use, copy, modify, and/or distribute this software for any
|
|
17332
|
-
> purpose with or without fee is hereby granted, provided that the above
|
|
17333
|
-
> copyright notice and this permission notice appear in all copies.
|
|
17334
|
-
>
|
|
17335
|
-
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
17336
|
-
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
17337
|
-
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
17338
|
-
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
17339
|
-
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
17340
|
-
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
17341
|
-
> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
17342
|
-
|
|
17343
|
-
---------------------------------------
|
|
17344
|
-
|
|
17345
17293
|
## js-tokens
|
|
17346
17294
|
License: MIT
|
|
17347
17295
|
By: Simon Lydell
|
|
@@ -17762,23 +17710,6 @@ Repository: https://github.com/pillarjs/parseurl
|
|
|
17762
17710
|
|
|
17763
17711
|
---------------------------------------
|
|
17764
17712
|
|
|
17765
|
-
## path-key, shebang-regex
|
|
17766
|
-
License: MIT
|
|
17767
|
-
By: Sindre Sorhus
|
|
17768
|
-
Repositories: https://github.com/sindresorhus/path-key, https://github.com/sindresorhus/shebang-regex
|
|
17769
|
-
|
|
17770
|
-
> MIT License
|
|
17771
|
-
>
|
|
17772
|
-
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
17773
|
-
>
|
|
17774
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
17775
|
-
>
|
|
17776
|
-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
17777
|
-
>
|
|
17778
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
17779
|
-
|
|
17780
|
-
---------------------------------------
|
|
17781
|
-
|
|
17782
17713
|
## periscopic
|
|
17783
17714
|
License: MIT
|
|
17784
17715
|
Repository: https://github.com/Rich-Harris/periscopic
|
|
@@ -18089,23 +18020,6 @@ Repositories: https://github.com/lukeed/resolve.exports, https://github.com/luke
|
|
|
18089
18020
|
|
|
18090
18021
|
---------------------------------------
|
|
18091
18022
|
|
|
18092
|
-
## shebang-command
|
|
18093
|
-
License: MIT
|
|
18094
|
-
By: Kevin Mårtensson
|
|
18095
|
-
Repository: https://github.com/kevva/shebang-command
|
|
18096
|
-
|
|
18097
|
-
> MIT License
|
|
18098
|
-
>
|
|
18099
|
-
> Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
|
|
18100
|
-
>
|
|
18101
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
18102
|
-
>
|
|
18103
|
-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
18104
|
-
>
|
|
18105
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
18106
|
-
|
|
18107
|
-
---------------------------------------
|
|
18108
|
-
|
|
18109
18023
|
## shell-quote
|
|
18110
18024
|
License: MIT
|
|
18111
18025
|
By: James Halliday
|
|
@@ -18211,6 +18125,35 @@ Repository: https://github.com/antfu/strip-literal
|
|
|
18211
18125
|
|
|
18212
18126
|
---------------------------------------
|
|
18213
18127
|
|
|
18128
|
+
## tinyexec
|
|
18129
|
+
License: MIT
|
|
18130
|
+
By: James Garbutt
|
|
18131
|
+
Repository: https://github.com/tinylibs/tinyexec
|
|
18132
|
+
|
|
18133
|
+
> MIT License
|
|
18134
|
+
>
|
|
18135
|
+
> Copyright (c) 2024 Tinylibs
|
|
18136
|
+
>
|
|
18137
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18138
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
18139
|
+
> in the Software without restriction, including without limitation the rights
|
|
18140
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18141
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
18142
|
+
> furnished to do so, subject to the following conditions:
|
|
18143
|
+
>
|
|
18144
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
18145
|
+
> copies or substantial portions of the Software.
|
|
18146
|
+
>
|
|
18147
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18148
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18149
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18150
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18151
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18152
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18153
|
+
> SOFTWARE.
|
|
18154
|
+
|
|
18155
|
+
---------------------------------------
|
|
18156
|
+
|
|
18214
18157
|
## to-regex-range
|
|
18215
18158
|
License: MIT
|
|
18216
18159
|
By: Jon Schlinkert, Rouven Weßling
|
|
@@ -27569,6 +27512,41 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
27569
27512
|
|
|
27570
27513
|
---
|
|
27571
27514
|
|
|
27515
|
+
The following software may be included in this product: qs (6.16.0)
|
|
27516
|
+
This software contains the following license and notice below:
|
|
27517
|
+
|
|
27518
|
+
BSD 3-Clause License
|
|
27519
|
+
|
|
27520
|
+
Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors)
|
|
27521
|
+
All rights reserved.
|
|
27522
|
+
|
|
27523
|
+
Redistribution and use in source and binary forms, with or without
|
|
27524
|
+
modification, are permitted provided that the following conditions are met:
|
|
27525
|
+
|
|
27526
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
27527
|
+
list of conditions and the following disclaimer.
|
|
27528
|
+
|
|
27529
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
27530
|
+
this list of conditions and the following disclaimer in the documentation
|
|
27531
|
+
and/or other materials provided with the distribution.
|
|
27532
|
+
|
|
27533
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
27534
|
+
contributors may be used to endorse or promote products derived from
|
|
27535
|
+
this software without specific prior written permission.
|
|
27536
|
+
|
|
27537
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
27538
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
27539
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
27540
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
27541
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
27542
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
27543
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27544
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27545
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27546
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27547
|
+
|
|
27548
|
+
---
|
|
27549
|
+
|
|
27572
27550
|
The following software may be included in this product: smol-toml (1.6.1)
|
|
27573
27551
|
This software contains the following license and notice below:
|
|
27574
27552
|
|
package/migrations.json
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"name": "@aws/nx-plugin",
|
|
4
4
|
"generators": {
|
|
5
|
-
"latest-
|
|
6
|
-
"version": "1.0.
|
|
7
|
-
"description": "
|
|
8
|
-
"implementation": "./src/migrations/latest/
|
|
5
|
+
"latest-pin-strands-express-peer": {
|
|
6
|
+
"version": "1.0.7",
|
|
7
|
+
"description": "Declare express in every project that declares @strands-agents/sdk without it so @strands-agents/sdk resolves to a single peer-suffixed instance",
|
|
8
|
+
"implementation": "./src/migrations/latest/pin-strands-express-peer/migration"
|
|
9
|
+
},
|
|
10
|
+
"latest-rdb-drop-lambda-rie": {
|
|
11
|
+
"version": "1.0.7",
|
|
12
|
+
"description": "Remove the Lambda Runtime Interface Emulator from vended ts#rdb and py#rdb Dockerfiles so its known HIGH vulnerabilities are not present in the image",
|
|
13
|
+
"implementation": "./src/migrations/latest/rdb-drop-lambda-rie/migration"
|
|
9
14
|
},
|
|
10
15
|
"v1.0.0-rc.50-0001-modernize-function-props-cast": {
|
|
11
16
|
"version": "1.0.0-rc.50",
|
|
@@ -382,8 +387,13 @@
|
|
|
382
387
|
"description": "Add the terraform-init target to Terraform projects so the shared provider plugin cache has a single writer",
|
|
383
388
|
"implementation": "./src/migrations/v1.0.3/0001-terraform-init-target/migration"
|
|
384
389
|
},
|
|
385
|
-
"
|
|
390
|
+
"v1.0.5-0001-api-custom-domain-runtime-config": {
|
|
386
391
|
"version": "1.0.5",
|
|
392
|
+
"description": "Publish a configured custom domain as the API URL in runtime config for vended REST/HTTP API constructs and Terraform modules, and add custom domain inputs to the Terraform API modules",
|
|
393
|
+
"implementation": "./src/migrations/v1.0.5/0001-api-custom-domain-runtime-config/migration"
|
|
394
|
+
},
|
|
395
|
+
"sync-vended-versions": {
|
|
396
|
+
"version": "1.0.7",
|
|
387
397
|
"description": "Sync vended dependency versions and the tracked plugin version to those vended by this release",
|
|
388
398
|
"implementation": "./src/utils/version-upgrade-migration/migration"
|
|
389
399
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws/nx-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/awslabs/nx-plugin-for-aws.git",
|
|
@@ -40,17 +40,17 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@apidevtools/swagger-parser": "12.1.0",
|
|
43
|
-
"@astral-sh/ruff-wasm-nodejs": "0.16.
|
|
43
|
+
"@astral-sh/ruff-wasm-nodejs": "0.16.10",
|
|
44
44
|
"@biomejs/js-api": "6.0.0",
|
|
45
|
-
"@biomejs/wasm-nodejs": "2.5.
|
|
45
|
+
"@biomejs/wasm-nodejs": "2.5.15",
|
|
46
46
|
"@getgrit/gritql": "0.0.3",
|
|
47
47
|
"@iarna/toml": "2.2.5",
|
|
48
|
-
"@modelcontextprotocol/sdk": "1.
|
|
48
|
+
"@modelcontextprotocol/sdk": "1.32.0",
|
|
49
49
|
"@nx/devkit": "23.2.1",
|
|
50
50
|
"@nx/js": "23.2.1",
|
|
51
51
|
"@nx/react": "23.2.1",
|
|
52
52
|
"@nx/vite": "23.2.1",
|
|
53
|
-
"@nxlv/python": "23.
|
|
53
|
+
"@nxlv/python": "23.2.1",
|
|
54
54
|
"@phenomnomnominal/tsquery": "6.2.0",
|
|
55
55
|
"@types/estree": "1.0.9",
|
|
56
56
|
"@types/js-yaml": "4.0.9",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"typescript": "6.0.3",
|
|
80
80
|
"unified": "11.0.5",
|
|
81
81
|
"unist-util-visit": "5.1.0",
|
|
82
|
-
"vite": "8.3.
|
|
82
|
+
"vite": "8.3.2",
|
|
83
83
|
"vitest": "4.1.11",
|
|
84
84
|
"zod": "4.6.5"
|
|
85
85
|
},
|
|
@@ -50,7 +50,7 @@ exports[`infra generator > should configure Checkov target correctly > checkov-t
|
|
|
50
50
|
"default",
|
|
51
51
|
],
|
|
52
52
|
"options": {
|
|
53
|
-
"command": "uvx --from checkov==3.3.
|
|
53
|
+
"command": "uvx --from checkov==3.3.22 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
54
54
|
},
|
|
55
55
|
"outputs": [
|
|
56
56
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -150,7 +150,7 @@ exports[`infra generator > should configure project.json with correct targets >
|
|
|
150
150
|
"default",
|
|
151
151
|
],
|
|
152
152
|
"options": {
|
|
153
|
-
"command": "uvx --from checkov==3.3.
|
|
153
|
+
"command": "uvx --from checkov==3.3.22 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
154
154
|
},
|
|
155
155
|
"outputs": [
|
|
156
156
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -762,7 +762,7 @@ exports[`infra generator > should handle custom project names correctly > custom
|
|
|
762
762
|
"default",
|
|
763
763
|
],
|
|
764
764
|
"options": {
|
|
765
|
-
"command": "uvx --from checkov==3.3.
|
|
765
|
+
"command": "uvx --from checkov==3.3.22 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
766
766
|
},
|
|
767
767
|
"outputs": [
|
|
768
768
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { type Tree } from '@nx/devkit';
|
|
6
|
+
/**
|
|
7
|
+
* `express` is an optional peer of `@strands-agents/sdk` that any importer
|
|
8
|
+
* declaring strands without also declaring express can leave undeclared. pnpm
|
|
9
|
+
* suffixes each installed copy of a package by the versions of its peers, so
|
|
10
|
+
* such an importer can resolve express to a different version than the pin
|
|
11
|
+
* every other strands importer uses — splitting `@strands-agents/sdk` into two
|
|
12
|
+
* peer-suffixed instances of the same version.
|
|
13
|
+
*
|
|
14
|
+
* Anything importing both instances then sees two nominal identities of every
|
|
15
|
+
* SDK type — `Agent`, `McpClient`, `Plugin` — and fails to compile with "Types
|
|
16
|
+
* have separate declarations of a private property". Declaring express
|
|
17
|
+
* wherever strands is declared keeps the whole strands subgraph on the
|
|
18
|
+
* catalog's single pin. Mirrors the earlier `@aws-sdk/client-s3` peer fix, one
|
|
19
|
+
* optional peer further on.
|
|
20
|
+
*
|
|
21
|
+
* Detection is generic — every project's `package.json` plus the workspace
|
|
22
|
+
* root, checked for "declares @strands-agents/sdk but not express" — rather
|
|
23
|
+
* than listing the generators that currently produce that shape, so a future
|
|
24
|
+
* strands importer this migration predates is still covered. The shared
|
|
25
|
+
* agent-connection project is checked explicitly too, in case its project.json
|
|
26
|
+
* is missing or not yet registered when this runs — `getProjects` would miss
|
|
27
|
+
* it then, same as rc.95's `@aws-sdk/client-s3` migration guarded against.
|
|
28
|
+
*/
|
|
29
|
+
export default function migration(tree: Tree): Promise<void>;
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { AGENT_CONNECTION_PROJECT_DIR } from "../../../utils/agent-connection/agent-connection.js";
|
|
6
|
+
import { addDependenciesToPackageJson } from "../../../utils/dependencies.js";
|
|
7
|
+
import { formatFilesInSubtree } from "../../../utils/format.js";
|
|
8
|
+
import { TS_VERSIONS } from "../../../utils/versions.js";
|
|
9
|
+
const EXPRESS = 'express';
|
|
10
|
+
const STRANDS_SDK = '@strands-agents/sdk';
|
|
11
|
+
const ROOT_PACKAGE_JSON = 'package.json';
|
|
12
|
+
/**
|
|
13
|
+
* `express` is an optional peer of `@strands-agents/sdk` that any importer
|
|
14
|
+
* declaring strands without also declaring express can leave undeclared. pnpm
|
|
15
|
+
* suffixes each installed copy of a package by the versions of its peers, so
|
|
16
|
+
* such an importer can resolve express to a different version than the pin
|
|
17
|
+
* every other strands importer uses — splitting `@strands-agents/sdk` into two
|
|
18
|
+
* peer-suffixed instances of the same version.
|
|
19
|
+
*
|
|
20
|
+
* Anything importing both instances then sees two nominal identities of every
|
|
21
|
+
* SDK type — `Agent`, `McpClient`, `Plugin` — and fails to compile with "Types
|
|
22
|
+
* have separate declarations of a private property". Declaring express
|
|
23
|
+
* wherever strands is declared keeps the whole strands subgraph on the
|
|
24
|
+
* catalog's single pin. Mirrors the earlier `@aws-sdk/client-s3` peer fix, one
|
|
25
|
+
* optional peer further on.
|
|
26
|
+
*
|
|
27
|
+
* Detection is generic — every project's `package.json` plus the workspace
|
|
28
|
+
* root, checked for "declares @strands-agents/sdk but not express" — rather
|
|
29
|
+
* than listing the generators that currently produce that shape, so a future
|
|
30
|
+
* strands importer this migration predates is still covered. The shared
|
|
31
|
+
* agent-connection project is checked explicitly too, in case its project.json
|
|
32
|
+
* is missing or not yet registered when this runs — `getProjects` would miss
|
|
33
|
+
* it then, same as rc.95's `@aws-sdk/client-s3` migration guarded against.
|
|
34
|
+
*/ export default async function migration(tree) {
|
|
35
|
+
pinIfNeeded(tree, ROOT_PACKAGE_JSON);
|
|
36
|
+
pinIfNeeded(tree, joinPathFragments(AGENT_CONNECTION_PROJECT_DIR, 'package.json'));
|
|
37
|
+
for (const project of getProjects(tree).values()){
|
|
38
|
+
pinIfNeeded(tree, joinPathFragments(project.root, 'package.json'));
|
|
39
|
+
}
|
|
40
|
+
await formatFilesInSubtree(tree);
|
|
41
|
+
}
|
|
42
|
+
/** Declare express on the given manifest, if it declares strands but not express. */ function pinIfNeeded(tree, packageJsonPath) {
|
|
43
|
+
if (!tree.exists(packageJsonPath)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const packageJson = JSON.parse(tree.read(packageJsonPath, 'utf-8') ?? '{}');
|
|
47
|
+
// Only where a strands client is actually declared — that is what pulls the
|
|
48
|
+
// optional peer. An already-declared express (even a stale range) is left to
|
|
49
|
+
// addDependenciesToPackageJson, which resolves it onto the catalog.
|
|
50
|
+
if (!packageJson.dependencies?.[STRANDS_SDK]) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
addDependenciesToPackageJson(tree, {
|
|
54
|
+
[EXPRESS]: TS_VERSIONS[EXPRESS]
|
|
55
|
+
}, {}, packageJsonPath);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,105 @@
|
|
|
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_RDB_GENERATOR_INFO } from "../../../py/rdb/generator.js";
|
|
6
|
+
import { TS_RDB_GENERATOR_INFO } from "../../../ts/rdb/generator.js";
|
|
7
|
+
import { formatFilesInSubtree } from "../../../utils/format.js";
|
|
8
|
+
/**
|
|
9
|
+
* Remove the Lambda Runtime Interface Emulator (RIE) from the vended ts#rdb
|
|
10
|
+
* and py#rdb Dockerfiles.
|
|
11
|
+
*
|
|
12
|
+
* `/lambda-entrypoint.sh` only invokes RIE when AWS_LAMBDA_RUNTIME_API is
|
|
13
|
+
* unset, i.e. for local `docker run` emulation outside Lambda — the deployed
|
|
14
|
+
* function never runs it. Its upstream build lags the Go toolchain, so it
|
|
15
|
+
* carries known HIGH vulnerabilities (net/http and crypto/tls DoS CVEs) the
|
|
16
|
+
* image scan flags with no fixed upstream image coming soon. Stripping it
|
|
17
|
+
* follows the same pattern the templates already use for other unused,
|
|
18
|
+
* vulnerable parts of the base image (py#rdb removing pip, ts#rdb removing
|
|
19
|
+
* the runtime's AWS SDK copy). New workspaces get this from the generator
|
|
20
|
+
* templates; this brings existing ones up to date.
|
|
21
|
+
*
|
|
22
|
+
* Only the three Dockerfiles the ts#rdb / py#rdb generators vend are touched,
|
|
23
|
+
* located from each rdb project's root (recorded in its metadata). Each is
|
|
24
|
+
* edited in place only where its comment + `RUN microdnf upgrade ...` block
|
|
25
|
+
* still has the exact shape the generator wrote before this change; one that
|
|
26
|
+
* has diverged (a customised comment or upgrade command) is left untouched
|
|
27
|
+
* and reported via `nextSteps`.
|
|
28
|
+
*/ const AWS_LAMBDA_RIE = '/usr/local/bin/aws-lambda-rie';
|
|
29
|
+
/**
|
|
30
|
+
* The exact comment + `RUN microdnf upgrade ...` block ts#rdb's Dockerfile had
|
|
31
|
+
* before this migration, and what it becomes.
|
|
32
|
+
*/ const TS_RDB_OLD_UPGRADE = `# Patch OS packages beyond the base image's pinned release, and drop the
|
|
33
|
+
# runtime's convenience copy of the AWS SDK (the handler bundle inlines its
|
|
34
|
+
# own dependencies), keeping the image free of known HIGH/CRITICAL
|
|
35
|
+
# vulnerabilities
|
|
36
|
+
RUN microdnf upgrade -y --releasever latest && microdnf clean all \\
|
|
37
|
+
&& rm -rf /var/runtime/node_modules/@aws-sdk`;
|
|
38
|
+
const TS_RDB_NEW_UPGRADE = `# Patch OS packages beyond the base image's pinned release, and drop the
|
|
39
|
+
# runtime's convenience copy of the AWS SDK (the handler bundle inlines its
|
|
40
|
+
# own dependencies), keeping the image free of known HIGH/CRITICAL
|
|
41
|
+
# vulnerabilities. Also drop the Lambda Runtime Interface Emulator: it is only
|
|
42
|
+
# used for local \`docker run\` emulation outside Lambda, never by the deployed
|
|
43
|
+
# function, and carries known HIGH vulnerabilities.
|
|
44
|
+
RUN microdnf upgrade -y --releasever latest && microdnf clean all \\
|
|
45
|
+
&& rm -rf /var/runtime/node_modules/@aws-sdk ${AWS_LAMBDA_RIE}`;
|
|
46
|
+
/**
|
|
47
|
+
* The exact comment + `RUN microdnf upgrade ...` block py#rdb's two Dockerfiles
|
|
48
|
+
* had before this migration, and what it becomes. Both Dockerfile.migration and
|
|
49
|
+
* Dockerfile.create-db-user share this block verbatim.
|
|
50
|
+
*/ const PY_RDB_OLD_UPGRADE = `# Patch OS packages beyond the base image's pinned release, and drop pip, whose
|
|
51
|
+
# vendored copies of msgpack and setuptools carry known HIGH vulnerabilities.
|
|
52
|
+
# The handler's dependencies are already installed in the image, so nothing
|
|
53
|
+
# installs packages at runtime.
|
|
54
|
+
RUN microdnf upgrade -y --releasever latest && microdnf clean all \\
|
|
55
|
+
&& rm -rf /var/lang/lib/python*/site-packages/pip \\
|
|
56
|
+
/var/lang/lib/python*/site-packages/pip-*.dist-info`;
|
|
57
|
+
const PY_RDB_NEW_UPGRADE = `# Patch OS packages beyond the base image's pinned release, and drop pip, whose
|
|
58
|
+
# vendored copies of msgpack and setuptools carry known HIGH vulnerabilities.
|
|
59
|
+
# The handler's dependencies are already installed in the image, so nothing
|
|
60
|
+
# installs packages at runtime. Also drop the Lambda Runtime Interface
|
|
61
|
+
# Emulator: it is only used for local \`docker run\` emulation outside Lambda,
|
|
62
|
+
# never by the deployed function, and carries known HIGH vulnerabilities.
|
|
63
|
+
RUN microdnf upgrade -y --releasever latest && microdnf clean all \\
|
|
64
|
+
&& rm -rf /var/lang/lib/python*/site-packages/pip \\
|
|
65
|
+
/var/lang/lib/python*/site-packages/pip-*.dist-info \\
|
|
66
|
+
${AWS_LAMBDA_RIE}`;
|
|
67
|
+
/** The marker checked to detect an already-migrated (or user-added) removal. */ const RIE_REMOVED_MARKER = AWS_LAMBDA_RIE;
|
|
68
|
+
const divergedNextStep = (filePath)=>`${filePath}: its microdnf upgrade command has been customised, so it was left unchanged. Remove the Lambda Runtime Interface Emulator by adding "${AWS_LAMBDA_RIE}" to its "rm -rf" — it is only used for local \`docker run\` emulation outside Lambda and carries known HIGH vulnerabilities.`;
|
|
69
|
+
/**
|
|
70
|
+
* Replace a Dockerfile's old comment + upgrade block with the new one, only
|
|
71
|
+
* when the file still has the exact shape the generator wrote. Already
|
|
72
|
+
* migrated and diverged files are both left alone; the latter is reported via
|
|
73
|
+
* nextSteps.
|
|
74
|
+
*/ const migrateDockerfile = (tree, filePath, oldBlock, newBlock, nextSteps)=>{
|
|
75
|
+
if (!tree.exists(filePath)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const content = tree.read(filePath, 'utf-8') ?? '';
|
|
79
|
+
if (content.includes(RIE_REMOVED_MARKER)) {
|
|
80
|
+
return; // Already migrated (or user-added).
|
|
81
|
+
}
|
|
82
|
+
if (!content.includes(oldBlock)) {
|
|
83
|
+
nextSteps.push(divergedNextStep(filePath));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
tree.write(filePath, content.replace(oldBlock, newBlock));
|
|
87
|
+
};
|
|
88
|
+
export default async function migration(tree) {
|
|
89
|
+
const nextSteps = [];
|
|
90
|
+
for (const project of getProjects(tree).values()){
|
|
91
|
+
const generator = project.metadata?.generator;
|
|
92
|
+
if (generator === TS_RDB_GENERATOR_INFO.id) {
|
|
93
|
+
migrateDockerfile(tree, joinPathFragments(project.root, 'Dockerfile'), TS_RDB_OLD_UPGRADE, TS_RDB_NEW_UPGRADE, nextSteps);
|
|
94
|
+
} else if (generator === PY_RDB_GENERATOR_INFO.id) {
|
|
95
|
+
migrateDockerfile(tree, joinPathFragments(project.root, 'Dockerfile.migration'), PY_RDB_OLD_UPGRADE, PY_RDB_NEW_UPGRADE, nextSteps);
|
|
96
|
+
migrateDockerfile(tree, joinPathFragments(project.root, 'Dockerfile.create-db-user'), PY_RDB_OLD_UPGRADE, PY_RDB_NEW_UPGRADE, nextSteps);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
await formatFilesInSubtree(tree);
|
|
100
|
+
return {
|
|
101
|
+
nextSteps
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/rdb-drop-lambda-rie/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_RDB_GENERATOR_INFO } from '../../../py/rdb/generator.js';\nimport { TS_RDB_GENERATOR_INFO } from '../../../ts/rdb/generator.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\n\n/**\n * Remove the Lambda Runtime Interface Emulator (RIE) from the vended ts#rdb\n * and py#rdb Dockerfiles.\n *\n * `/lambda-entrypoint.sh` only invokes RIE when AWS_LAMBDA_RUNTIME_API is\n * unset, i.e. for local `docker run` emulation outside Lambda — the deployed\n * function never runs it. Its upstream build lags the Go toolchain, so it\n * carries known HIGH vulnerabilities (net/http and crypto/tls DoS CVEs) the\n * image scan flags with no fixed upstream image coming soon. Stripping it\n * follows the same pattern the templates already use for other unused,\n * vulnerable parts of the base image (py#rdb removing pip, ts#rdb removing\n * the runtime's AWS SDK copy). New workspaces get this from the generator\n * templates; this brings existing ones up to date.\n *\n * Only the three Dockerfiles the ts#rdb / py#rdb generators vend are touched,\n * located from each rdb project's root (recorded in its metadata). Each is\n * edited in place only where its comment + `RUN microdnf upgrade ...` block\n * still has the exact shape the generator wrote before this change; one that\n * has diverged (a customised comment or upgrade command) is left untouched\n * and reported via `nextSteps`.\n */\n\nconst AWS_LAMBDA_RIE = '/usr/local/bin/aws-lambda-rie';\n\n/**\n * The exact comment + `RUN microdnf upgrade ...` block ts#rdb's Dockerfile had\n * before this migration, and what it becomes.\n */\nconst TS_RDB_OLD_UPGRADE = `# Patch OS packages beyond the base image's pinned release, and drop the\n# runtime's convenience copy of the AWS SDK (the handler bundle inlines its\n# own dependencies), keeping the image free of known HIGH/CRITICAL\n# vulnerabilities\nRUN microdnf upgrade -y --releasever latest && microdnf clean all \\\\\n && rm -rf /var/runtime/node_modules/@aws-sdk`;\nconst TS_RDB_NEW_UPGRADE = `# Patch OS packages beyond the base image's pinned release, and drop the\n# runtime's convenience copy of the AWS SDK (the handler bundle inlines its\n# own dependencies), keeping the image free of known HIGH/CRITICAL\n# vulnerabilities. Also drop the Lambda Runtime Interface Emulator: it is only\n# used for local \\`docker run\\` emulation outside Lambda, never by the deployed\n# function, and carries known HIGH vulnerabilities.\nRUN microdnf upgrade -y --releasever latest && microdnf clean all \\\\\n && rm -rf /var/runtime/node_modules/@aws-sdk ${AWS_LAMBDA_RIE}`;\n\n/**\n * The exact comment + `RUN microdnf upgrade ...` block py#rdb's two Dockerfiles\n * had before this migration, and what it becomes. Both Dockerfile.migration and\n * Dockerfile.create-db-user share this block verbatim.\n */\nconst PY_RDB_OLD_UPGRADE = `# Patch OS packages beyond the base image's pinned release, and drop pip, whose\n# vendored copies of msgpack and setuptools carry known HIGH vulnerabilities.\n# The handler's dependencies are already installed in the image, so nothing\n# installs packages at runtime.\nRUN microdnf upgrade -y --releasever latest && microdnf clean all \\\\\n && rm -rf /var/lang/lib/python*/site-packages/pip \\\\\n /var/lang/lib/python*/site-packages/pip-*.dist-info`;\nconst PY_RDB_NEW_UPGRADE = `# Patch OS packages beyond the base image's pinned release, and drop pip, whose\n# vendored copies of msgpack and setuptools carry known HIGH vulnerabilities.\n# The handler's dependencies are already installed in the image, so nothing\n# installs packages at runtime. Also drop the Lambda Runtime Interface\n# Emulator: it is only used for local \\`docker run\\` emulation outside Lambda,\n# never by the deployed function, and carries known HIGH vulnerabilities.\nRUN microdnf upgrade -y --releasever latest && microdnf clean all \\\\\n && rm -rf /var/lang/lib/python*/site-packages/pip \\\\\n /var/lang/lib/python*/site-packages/pip-*.dist-info \\\\\n ${AWS_LAMBDA_RIE}`;\n\n/** The marker checked to detect an already-migrated (or user-added) removal. */\nconst RIE_REMOVED_MARKER = AWS_LAMBDA_RIE;\n\nconst divergedNextStep = (filePath: string): string =>\n `${filePath}: its microdnf upgrade command has been customised, so it was left unchanged. Remove the Lambda Runtime Interface Emulator by adding \"${AWS_LAMBDA_RIE}\" to its \"rm -rf\" — it is only used for local \\`docker run\\` emulation outside Lambda and carries known HIGH vulnerabilities.`;\n\n/**\n * Replace a Dockerfile's old comment + upgrade block with the new one, only\n * when the file still has the exact shape the generator wrote. Already\n * migrated and diverged files are both left alone; the latter is reported via\n * nextSteps.\n */\nconst migrateDockerfile = (\n tree: Tree,\n filePath: string,\n oldBlock: string,\n newBlock: 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(RIE_REMOVED_MARKER)) {\n return; // Already migrated (or user-added).\n }\n\n if (!content.includes(oldBlock)) {\n nextSteps.push(divergedNextStep(filePath));\n return;\n }\n\n tree.write(filePath, content.replace(oldBlock, newBlock));\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\n if (generator === TS_RDB_GENERATOR_INFO.id) {\n migrateDockerfile(\n tree,\n joinPathFragments(project.root, 'Dockerfile'),\n TS_RDB_OLD_UPGRADE,\n TS_RDB_NEW_UPGRADE,\n nextSteps,\n );\n } else if (generator === PY_RDB_GENERATOR_INFO.id) {\n migrateDockerfile(\n tree,\n joinPathFragments(project.root, 'Dockerfile.migration'),\n PY_RDB_OLD_UPGRADE,\n PY_RDB_NEW_UPGRADE,\n nextSteps,\n );\n migrateDockerfile(\n tree,\n joinPathFragments(project.root, 'Dockerfile.create-db-user'),\n PY_RDB_OLD_UPGRADE,\n PY_RDB_NEW_UPGRADE,\n nextSteps,\n );\n }\n }\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","joinPathFragments","PY_RDB_GENERATOR_INFO","TS_RDB_GENERATOR_INFO","formatFilesInSubtree","AWS_LAMBDA_RIE","TS_RDB_OLD_UPGRADE","TS_RDB_NEW_UPGRADE","PY_RDB_OLD_UPGRADE","PY_RDB_NEW_UPGRADE","RIE_REMOVED_MARKER","divergedNextStep","filePath","migrateDockerfile","tree","oldBlock","newBlock","nextSteps","exists","content","read","includes","push","write","replace","migration","project","values","generator","metadata","id","root"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EACXC,iBAAiB,QAGZ,aAAa;AACpB,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE;;;;;;;;;;;;;;;;;;;;CAoBC,GAED,MAAMC,iBAAiB;AAEvB;;;CAGC,GACD,MAAMC,qBAAqB,CAAC;;;;;gDAKoB,CAAC;AACjD,MAAMC,qBAAqB,CAAC;;;;;;;iDAOqB,EAAEF,gBAAgB;AAEnE;;;;CAIC,GACD,MAAMG,qBAAqB,CAAC;;;;;;uDAM2B,CAAC;AACxD,MAAMC,qBAAqB,CAAC;;;;;;;;;IASxB,EAAEJ,gBAAgB;AAEtB,8EAA8E,GAC9E,MAAMK,qBAAqBL;AAE3B,MAAMM,mBAAmB,CAACC,WACxB,GAAGA,SAAS,sIAAsI,EAAEP,eAAe,6HAA6H,CAAC;AAEnS;;;;;CAKC,GACD,MAAMQ,oBAAoB,CACxBC,MACAF,UACAG,UACAC,UACAC;IAEA,IAAI,CAACH,KAAKI,MAAM,CAACN,WAAW;QAC1B;IACF;IAEA,MAAMO,UAAUL,KAAKM,IAAI,CAACR,UAAU,YAAY;IAChD,IAAIO,QAAQE,QAAQ,CAACX,qBAAqB;QACxC,QAAQ,oCAAoC;IAC9C;IAEA,IAAI,CAACS,QAAQE,QAAQ,CAACN,WAAW;QAC/BE,UAAUK,IAAI,CAACX,iBAAiBC;QAChC;IACF;IAEAE,KAAKS,KAAK,CAACX,UAAUO,QAAQK,OAAO,CAACT,UAAUC;AACjD;AAEA,eAAe,eAAeS,UAC5BX,IAAU;IAEV,MAAMG,YAAsB,EAAE;IAE9B,KAAK,MAAMS,WAAW1B,YAAYc,MAAMa,MAAM,GAAI;QAChD,MAAMC,YAAaF,QAAQG,QAAQ,EAC/BD;QAEJ,IAAIA,cAAczB,sBAAsB2B,EAAE,EAAE;YAC1CjB,kBACEC,MACAb,kBAAkByB,QAAQK,IAAI,EAAE,eAChCzB,oBACAC,oBACAU;QAEJ,OAAO,IAAIW,cAAc1B,sBAAsB4B,EAAE,EAAE;YACjDjB,kBACEC,MACAb,kBAAkByB,QAAQK,IAAI,EAAE,yBAChCvB,oBACAC,oBACAQ;YAEFJ,kBACEC,MACAb,kBAAkByB,QAAQK,IAAI,EAAE,8BAChCvB,oBACAC,oBACAQ;QAEJ;IACF;IAEA,MAAMb,qBAAqBU;IAE3B,OAAO;QAAEG;IAAU;AACrB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { type MigrationReturnObject, type Tree } from '@nx/devkit';
|
|
6
|
+
export default function migration(tree: Tree): Promise<MigrationReturnObject>;
|