@aws/nx-plugin 1.0.0-rc.31 → 1.0.0-rc.33

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.
Files changed (198) hide show
  1. package/LICENSE-THIRD-PARTY +72 -70
  2. package/package.json +5 -5
  3. package/src/infra/app/__snapshots__/generator.spec.ts.snap +15 -15
  4. package/src/infra/app/files/app/src/main.ts.template +1 -1
  5. package/src/infra/app/files/app/src/stages/application-stage.ts.template +1 -1
  6. package/src/infra/app/generator.js +3 -1
  7. package/src/infra/app/generator.js.map +1 -1
  8. package/src/open-api/ts-client/__snapshots__/generator.content-type.spec.ts.snap +64 -3
  9. package/src/open-api/ts-client/__snapshots__/generator.multipart.spec.ts.snap +280 -0
  10. package/src/open-api/ts-client/files/client.gen.ts.template +37 -2
  11. package/src/open-api/ts-client/generator.js +5 -1
  12. package/src/open-api/ts-client/generator.js.map +1 -1
  13. package/src/open-api/ts-hooks/files/options-proxy.gen.ts.template +2 -2
  14. package/src/open-api/ts-hooks/generator.js +5 -1
  15. package/src/open-api/ts-hooks/generator.js.map +1 -1
  16. package/src/open-api/utils/normalise.js +13 -6
  17. package/src/open-api/utils/normalise.js.map +1 -1
  18. package/src/open-api/utils/parser.js +12 -1
  19. package/src/open-api/utils/parser.js.map +1 -1
  20. package/src/open-api/utils/types.d.ts +4 -1
  21. package/src/open-api/utils/types.js.map +1 -1
  22. package/src/preset/__snapshots__/generator.spec.ts.snap +1 -1
  23. package/src/preset/generator.d.ts +1 -1
  24. package/src/preset/generator.js +5 -2
  25. package/src/preset/generator.js.map +1 -1
  26. package/src/preset/schema.d.js.map +1 -1
  27. package/src/preset/schema.d.ts +2 -0
  28. package/src/preset/schema.json +6 -0
  29. package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +7 -7
  30. package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +8 -8
  31. package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +89 -3
  32. package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
  33. package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +426 -18
  34. package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
  35. package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +91 -5
  36. package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +283 -11
  37. package/src/smithy/ts/api/files/handler.ts.template +2 -2
  38. package/src/smithy/ts/api/files/local-server.ts.template +2 -2
  39. package/src/smithy/ts/api/files/operations/echo.ts.template +2 -2
  40. package/src/smithy/ts/api/files/service.ts.template +3 -3
  41. package/src/smithy/ts/api/generator.js +3 -1
  42. package/src/smithy/ts/api/generator.js.map +1 -1
  43. package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +426 -18
  44. package/src/trpc/backend/files/src/client/index.ts.template +1 -1
  45. package/src/trpc/backend/files/src/handler.ts.template +1 -1
  46. package/src/trpc/backend/files/src/index.ts.template +5 -5
  47. package/src/trpc/backend/files/src/init.ts.template +1 -1
  48. package/src/trpc/backend/files/src/local-server.ts.template +1 -1
  49. package/src/trpc/backend/files/src/middleware/index.ts.template +7 -7
  50. package/src/trpc/backend/files/src/procedures/echo.ts.template +2 -2
  51. package/src/trpc/backend/files/src/router.ts.template +2 -2
  52. package/src/trpc/backend/files/src/schema/index.ts.template +1 -1
  53. package/src/trpc/backend/generator.js +3 -1
  54. package/src/trpc/backend/generator.js.map +1 -1
  55. package/src/ts/agent/__snapshots__/generator.spec.ts.snap +89 -3
  56. package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client-strands.ts.template +2 -2
  57. package/src/ts/agent/a2a-connection/generator.js +3 -1
  58. package/src/ts/agent/a2a-connection/generator.js.map +1 -1
  59. package/src/ts/agent/files/a2a/index.ts.template +1 -1
  60. package/src/ts/agent/files/ag-ui/index.ts.template +1 -1
  61. package/src/ts/agent/files/http/client.ts.template +2 -2
  62. package/src/ts/agent/files/http/index.ts.template +2 -2
  63. package/src/ts/agent/files/http/router.ts.template +3 -3
  64. package/src/ts/agent/gateway-connection/files/agent-connection/app/__gatewayKebabCase__-client-strands.ts.template +2 -2
  65. package/src/ts/agent/gateway-connection/generator.js +3 -1
  66. package/src/ts/agent/gateway-connection/generator.js.map +1 -1
  67. package/src/ts/agent/generator.js +5 -2
  68. package/src/ts/agent/generator.js.map +1 -1
  69. package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +2 -2
  70. package/src/ts/agent/mcp-connection/generator.js +3 -1
  71. package/src/ts/agent/mcp-connection/generator.js.map +1 -1
  72. package/src/ts/astro-docs/files/translation/scripts/translate.ts.template +3 -2
  73. package/src/ts/astro-docs/generator.js +2 -0
  74. package/src/ts/astro-docs/generator.js.map +1 -1
  75. package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
  76. package/src/ts/dynamodb/files/src/client.ts.template +5 -2
  77. package/src/ts/dynamodb/files/src/entities/example.ts.template +1 -1
  78. package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -1
  79. package/src/ts/dynamodb/files/src/index.ts.template +2 -2
  80. package/src/ts/dynamodb/generator.js +3 -1
  81. package/src/ts/dynamodb/generator.js.map +1 -1
  82. package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
  83. package/src/ts/lib/generator.js +7 -1
  84. package/src/ts/lib/generator.js.map +1 -1
  85. package/src/ts/lib/ts-project-utils.js +19 -4
  86. package/src/ts/lib/ts-project-utils.js.map +1 -1
  87. package/src/ts/lib/types.d.ts +6 -0
  88. package/src/ts/lib/types.js.map +1 -1
  89. package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +94 -31
  90. package/src/ts/mcp-server/generator.js +11 -22
  91. package/src/ts/mcp-server/generator.js.map +1 -1
  92. package/src/ts/nx-generator/files/local/generator.ts.template +2 -2
  93. package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +2 -2
  94. package/src/ts/nx-generator/generator.js +5 -2
  95. package/src/ts/nx-generator/generator.js.map +1 -1
  96. package/src/ts/nx-plugin/files/mcp-server/server.ts.template +5 -5
  97. package/src/ts/nx-plugin/files/mcp-server/tools/create-workspace-command.ts.template +2 -2
  98. package/src/ts/nx-plugin/files/mcp-server/tools/general-guidance.ts.template +1 -1
  99. package/src/ts/nx-plugin/files/mcp-server/tools/generator-guide.ts.template +2 -2
  100. package/src/ts/nx-plugin/files/mcp-server/tools/list-generators.ts.template +2 -2
  101. package/src/ts/nx-plugin/files/mcp-server/utils.ts.template +3 -3
  102. package/src/ts/nx-plugin/generator.js +3 -1
  103. package/src/ts/nx-plugin/generator.js.map +1 -1
  104. package/src/ts/nx-plugin/utils.js +7 -4
  105. package/src/ts/nx-plugin/utils.js.map +1 -1
  106. package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +4 -4
  107. package/src/ts/rdb/files/src/create-db-user-handler.ts.template +2 -2
  108. package/src/ts/rdb/files/src/index.ts.template +1 -1
  109. package/src/ts/rdb/files/src/migration-handler.ts.template +1 -1
  110. package/src/ts/rdb/files/src/prisma.ts.template +7 -4
  111. package/src/ts/rdb/generator.js +3 -1
  112. package/src/ts/rdb/generator.js.map +1 -1
  113. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +35 -35
  114. package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +2 -2
  115. package/src/utils/agent-chat/agent-chat.js +3 -1
  116. package/src/utils/agent-chat/agent-chat.js.map +1 -1
  117. package/src/utils/agent-chat/files/a2a/chat.ts.template +1 -1
  118. package/src/utils/agent-chat/files/ag-ui/chat.ts.template +1 -1
  119. package/src/utils/agent-chat/files/http-py/chat.ts.template +2 -2
  120. package/src/utils/agent-chat/files/http-ts/chat.ts.template +1 -1
  121. package/src/utils/agent-connection/agent-connection.js +4 -1
  122. package/src/utils/agent-connection/agent-connection.js.map +1 -1
  123. package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client-config.ts.template +2 -2
  124. package/src/utils/agent-connection/files/core-auth/agentcore-fetch.ts.template +1 -1
  125. package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +2 -2
  126. package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-transport.ts.template +2 -2
  127. package/src/utils/agent-connection/files/core-shared/agentcore-transport.ts.template +1 -1
  128. package/src/utils/agent-connection/files/core-strands/a2a/agentcore-a2a-client-strands.ts.template +1 -1
  129. package/src/utils/agent-connection/files/core-strands/base/with-session-id-strands.ts.template +1 -1
  130. package/src/utils/agent-connection/files/core-strands/gateway/agentcore-gateway-mcp-client-strands.ts.template +1 -1
  131. package/src/utils/agent-connection/files/core-strands/mcp/agentcore-mcp-client-strands.ts.template +1 -1
  132. package/src/utils/agent-core-constructs/agent-core-constructs.js +10 -3
  133. package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
  134. package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +3 -3
  135. package/src/utils/agent-core-constructs/files/cdk/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.ts.template +4 -4
  136. package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +1 -1
  137. package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +27 -0
  138. package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +60 -1
  139. package/src/utils/api-constructs/api-constructs.js +8 -2
  140. package/src/utils/api-constructs/api-constructs.js.map +1 -1
  141. package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +8 -8
  142. package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +8 -8
  143. package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +3 -3
  144. package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account/index.js.template +32 -20
  145. package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account.ts.template +1 -1
  146. package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +4 -4
  147. package/src/utils/api-constructs/files/cdk/core/api/trpc/trpc-utils.ts.template +1 -1
  148. package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +69 -1
  149. package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +69 -1
  150. package/src/utils/ast.js +16 -0
  151. package/src/utils/ast.js.map +1 -1
  152. package/src/utils/commands.d.ts +1 -1
  153. package/src/utils/commands.js +4 -1
  154. package/src/utils/commands.js.map +1 -1
  155. package/src/utils/dynamodb-constructs/dynamodb-constructs.js +9 -2
  156. package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -1
  157. package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +3 -3
  158. package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +1 -1
  159. package/src/utils/files/common/constructs/src/core/index.ts.template +4 -4
  160. package/src/utils/files/common/constructs/src/index.ts.template +2 -2
  161. package/src/utils/files/common/infra-config/src/index.ts.template +3 -3
  162. package/src/utils/files/common/infra-config/src/resolve-stage.ts.template +2 -2
  163. package/src/utils/files/common/infra-config/src/stages.config.ts.template +1 -1
  164. package/src/utils/files/common/scripts/src/infra/infra-deploy.ts.template +1 -1
  165. package/src/utils/files/common/scripts/src/infra/infra-destroy.ts.template +1 -1
  166. package/src/utils/files/common/scripts/src/infra/stage-credentials/run.ts.template +3 -3
  167. package/src/utils/files/common/shadcn/src/index.ts.template +2 -2
  168. package/src/utils/function-constructs/files/cdk/app/lambda-functions/__nameKebabCase__.ts.template +1 -1
  169. package/src/utils/function-constructs/function-constructs.js +3 -1
  170. package/src/utils/function-constructs/function-constructs.js.map +1 -1
  171. package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +2 -2
  172. package/src/utils/identity-constructs/identity-constructs.js +5 -1
  173. package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
  174. package/src/utils/module-format.d.ts +28 -0
  175. package/src/utils/module-format.js +28 -0
  176. package/src/utils/module-format.js.map +1 -0
  177. package/src/utils/rdb-constructs/files/cdk/app/dbs/__nameKebabCase__.ts.template +5 -5
  178. package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +1 -1
  179. package/src/utils/rdb-constructs/rdb-constructs.js +9 -2
  180. package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
  181. package/src/utils/shared-constructs.js +3 -1
  182. package/src/utils/shared-constructs.js.map +1 -1
  183. package/src/utils/shared-infra-config.js +3 -1
  184. package/src/utils/shared-infra-config.js.map +1 -1
  185. package/src/utils/shared-infra-scripts.js +3 -1
  186. package/src/utils/shared-infra-scripts.js.map +1 -1
  187. package/src/utils/shared-shadcn.js +3 -1
  188. package/src/utils/shared-shadcn.js.map +1 -1
  189. package/src/utils/test.d.ts +2 -0
  190. package/src/utils/test.js +7 -1
  191. package/src/utils/test.js.map +1 -1
  192. package/src/utils/versions.d.ts +61 -61
  193. package/src/utils/versions.js +59 -59
  194. package/src/utils/versions.js.map +1 -1
  195. package/src/utils/website-constructs/files/cdk/app/static-websites/__websiteNameKebabCase__.ts.template +2 -2
  196. package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +2 -2
  197. package/src/utils/website-constructs/website-constructs.js +9 -2
  198. package/src/utils/website-constructs/website-constructs.js.map +1 -1
@@ -3432,30 +3432,6 @@ SOFTWARE.
3432
3432
 
3433
3433
  ---
3434
3434
 
3435
- The following software may be included in this product: @esbuild/linux-x64 (0.28.0)
3436
- This software contains the following license and notice below:
3437
-
3438
- MIT License
3439
-
3440
- Copyright (c) The maintainers of @esbuild/linux-x64 <https://github.com/evanw/esbuild#readme>
3441
-
3442
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
3443
- associated documentation files (the "Software"), to deal in the Software without restriction, including
3444
- without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3445
- copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
3446
- following conditions:
3447
-
3448
- The above copyright notice and this permission notice shall be included in all copies or substantial
3449
- portions of the Software.
3450
-
3451
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
3452
- LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
3453
- EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
3454
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
3455
- USE OR OTHER DEALINGS IN THE SOFTWARE.
3456
-
3457
- ---
3458
-
3459
3435
  The following software may be included in this product: @esbuild/linux-x64 (0.28.1)
3460
3436
  This software contains the following license and notice below:
3461
3437
 
@@ -5307,7 +5283,7 @@ SOFTWARE.
5307
5283
 
5308
5284
  ---
5309
5285
 
5310
- The following software may be included in this product: @oxc-project/types (0.137.0)
5286
+ The following software may be included in this product: @oxc-project/types (0.139.0)
5311
5287
  This software contains the following license and notice below:
5312
5288
 
5313
5289
  MIT License
@@ -5644,7 +5620,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5644
5620
 
5645
5621
  ---
5646
5622
 
5647
- The following software may be included in this product: @rolldown/binding-linux-x64-gnu (1.1.3)
5623
+ The following software may be included in this product: @rolldown/binding-linux-x64-gnu (1.1.5)
5648
5624
  This software contains the following license and notice below:
5649
5625
 
5650
5626
  MIT License
@@ -7036,7 +7012,7 @@ SOFTWARE
7036
7012
 
7037
7013
  ---
7038
7014
 
7039
- The following software may be included in this product: @types/node (25.9.4)
7015
+ The following software may be included in this product: @types/node (26.1.1)
7040
7016
  This software contains the following license and notice below:
7041
7017
 
7042
7018
  MIT License
@@ -7738,7 +7714,7 @@ SOFTWARE.
7738
7714
 
7739
7715
  ---
7740
7716
 
7741
- The following software may be included in this product: @vitest/coverage-v8 (4.1.9)
7717
+ The following software may be included in this product: @vitest/coverage-v8 (4.1.10)
7742
7718
  This software contains the following license and notice below:
7743
7719
 
7744
7720
  MIT License
@@ -7765,7 +7741,7 @@ SOFTWARE.
7765
7741
 
7766
7742
  ---
7767
7743
 
7768
- The following software may be included in this product: @vitest/expect (4.1.9)
7744
+ The following software may be included in this product: @vitest/expect (4.1.10)
7769
7745
  This software contains the following license and notice below:
7770
7746
 
7771
7747
  MIT License
@@ -7792,7 +7768,7 @@ SOFTWARE.
7792
7768
 
7793
7769
  ---
7794
7770
 
7795
- The following software may be included in this product: @vitest/mocker (4.1.9)
7771
+ The following software may be included in this product: @vitest/mocker (4.1.10)
7796
7772
  This software contains the following license and notice below:
7797
7773
 
7798
7774
  MIT License
@@ -7819,7 +7795,7 @@ SOFTWARE.
7819
7795
 
7820
7796
  ---
7821
7797
 
7822
- The following software may be included in this product: @vitest/pretty-format (4.1.9)
7798
+ The following software may be included in this product: @vitest/pretty-format (4.1.10)
7823
7799
  This software contains the following license and notice below:
7824
7800
 
7825
7801
  MIT License
@@ -7846,7 +7822,7 @@ SOFTWARE.
7846
7822
 
7847
7823
  ---
7848
7824
 
7849
- The following software may be included in this product: @vitest/runner (4.1.9)
7825
+ The following software may be included in this product: @vitest/runner (4.1.10)
7850
7826
  This software contains the following license and notice below:
7851
7827
 
7852
7828
  MIT License
@@ -7873,7 +7849,7 @@ SOFTWARE.
7873
7849
 
7874
7850
  ---
7875
7851
 
7876
- The following software may be included in this product: @vitest/snapshot (4.1.9)
7852
+ The following software may be included in this product: @vitest/snapshot (4.1.10)
7877
7853
  This software contains the following license and notice below:
7878
7854
 
7879
7855
  MIT License
@@ -7900,7 +7876,7 @@ SOFTWARE.
7900
7876
 
7901
7877
  ---
7902
7878
 
7903
- The following software may be included in this product: @vitest/spy (4.1.9)
7879
+ The following software may be included in this product: @vitest/spy (4.1.10)
7904
7880
  This software contains the following license and notice below:
7905
7881
 
7906
7882
  MIT License
@@ -7927,7 +7903,7 @@ SOFTWARE.
7927
7903
 
7928
7904
  ---
7929
7905
 
7930
- The following software may be included in this product: @vitest/ui (4.1.9)
7906
+ The following software may be included in this product: @vitest/ui (4.1.10)
7931
7907
  This software contains the following license and notice below:
7932
7908
 
7933
7909
  MIT License
@@ -7954,7 +7930,7 @@ SOFTWARE.
7954
7930
 
7955
7931
  ---
7956
7932
 
7957
- The following software may be included in this product: @vitest/utils (4.1.9)
7933
+ The following software may be included in this product: @vitest/utils (4.1.10)
7958
7934
  This software contains the following license and notice below:
7959
7935
 
7960
7936
  MIT License
@@ -13232,33 +13208,6 @@ SOFTWARE.
13232
13208
 
13233
13209
  ---
13234
13210
 
13235
- The following software may be included in this product: esbuild (0.28.0)
13236
- This software contains the following license and notice below:
13237
-
13238
- MIT License
13239
-
13240
- Copyright (c) 2020 Evan Wallace
13241
-
13242
- Permission is hereby granted, free of charge, to any person obtaining a copy
13243
- of this software and associated documentation files (the "Software"), to deal
13244
- in the Software without restriction, including without limitation the rights
13245
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13246
- copies of the Software, and to permit persons to whom the Software is
13247
- furnished to do so, subject to the following conditions:
13248
-
13249
- The above copyright notice and this permission notice shall be included in all
13250
- copies or substantial portions of the Software.
13251
-
13252
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13253
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13254
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13255
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
13256
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
13257
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
13258
- SOFTWARE.
13259
-
13260
- ---
13261
-
13262
13211
  The following software may be included in this product: esbuild (0.28.1)
13263
13212
  This software contains the following license and notice below:
13264
13213
 
@@ -14844,7 +14793,7 @@ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHE
14844
14793
 
14845
14794
  ---
14846
14795
 
14847
- The following software may be included in this product: fs-extra (11.3.5)
14796
+ The following software may be included in this product: fs-extra (11.3.6)
14848
14797
  This software contains the following license and notice below:
14849
14798
 
14850
14799
  (The MIT License)
@@ -22063,6 +22012,33 @@ THE SOFTWARE.
22063
22012
 
22064
22013
  ---
22065
22014
 
22015
+ The following software may be included in this product: picomatch (4.0.5)
22016
+ This software contains the following license and notice below:
22017
+
22018
+ The MIT License (MIT)
22019
+
22020
+ Copyright (c) 2017-present, Jon Schlinkert.
22021
+
22022
+ Permission is hereby granted, free of charge, to any person obtaining a copy
22023
+ of this software and associated documentation files (the "Software"), to deal
22024
+ in the Software without restriction, including without limitation the rights
22025
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22026
+ copies of the Software, and to permit persons to whom the Software is
22027
+ furnished to do so, subject to the following conditions:
22028
+
22029
+ The above copyright notice and this permission notice shall be included in
22030
+ all copies or substantial portions of the Software.
22031
+
22032
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22033
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22034
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22035
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22036
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22037
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22038
+ THE SOFTWARE.
22039
+
22040
+ ---
22041
+
22066
22042
  The following software may be included in this product: pify (3.0.0)
22067
22043
  This software contains the following license and notice below:
22068
22044
 
@@ -22310,6 +22286,32 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22310
22286
 
22311
22287
  ---
22312
22288
 
22289
+ The following software may be included in this product: postcss (8.5.16)
22290
+ This software contains the following license and notice below:
22291
+
22292
+ The MIT License (MIT)
22293
+
22294
+ Copyright 2013 Andrey Sitnik <andrey@sitnik.es>
22295
+
22296
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
22297
+ this software and associated documentation files (the "Software"), to deal in
22298
+ the Software without restriction, including without limitation the rights to
22299
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
22300
+ the Software, and to permit persons to whom the Software is furnished to do so,
22301
+ subject to the following conditions:
22302
+
22303
+ The above copyright notice and this permission notice shall be included in all
22304
+ copies or substantial portions of the Software.
22305
+
22306
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22307
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22308
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22309
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22310
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22311
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22312
+
22313
+ ---
22314
+
22313
22315
  The following software may be included in this product: postcss-modules (6.0.1)
22314
22316
  This software contains the following license and notice below:
22315
22317
 
@@ -23755,7 +23757,7 @@ IN THE SOFTWARE.
23755
23757
 
23756
23758
  ---
23757
23759
 
23758
- The following software may be included in this product: rolldown (1.1.3)
23760
+ The following software may be included in this product: rolldown (1.1.5)
23759
23761
  This software contains the following license and notice below:
23760
23762
 
23761
23763
  MIT License
@@ -26863,7 +26865,7 @@ SOFTWARE.
26863
26865
 
26864
26866
  ---
26865
26867
 
26866
- The following software may be included in this product: tsx (4.22.4)
26868
+ The following software may be included in this product: tsx (4.23.0)
26867
26869
  This software contains the following license and notice below:
26868
26870
 
26869
26871
  MIT License
@@ -27087,7 +27089,7 @@ SOFTWARE.
27087
27089
 
27088
27090
  ---
27089
27091
 
27090
- The following software may be included in this product: undici-types (7.24.6)
27092
+ The following software may be included in this product: undici-types (8.3.0)
27091
27093
  This software contains the following license and notice below:
27092
27094
 
27093
27095
  MIT License
@@ -27862,7 +27864,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27862
27864
 
27863
27865
  ---
27864
27866
 
27865
- The following software may be included in this product: vite (8.1.0)
27867
+ The following software may be included in this product: vite (8.1.4)
27866
27868
  This software contains the following license and notice below:
27867
27869
 
27868
27870
  # Vite core license
@@ -30155,7 +30157,7 @@ Repository: https://github.com/websockets/ws
30155
30157
 
30156
30158
  ---
30157
30159
 
30158
- The following software may be included in this product: vitest (4.1.9)
30160
+ The following software may be included in this product: vitest (4.1.10)
30159
30161
  This software contains the following license and notice below:
30160
30162
 
30161
30163
  # Vitest core license
@@ -31603,7 +31605,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31603
31605
 
31604
31606
  ---
31605
31607
 
31606
- The following software may be included in this product: @biomejs/js-api (4.0.0)
31608
+ The following software may be included in this product: @biomejs/js-api (6.0.0)
31607
31609
  This software contains the following license and notice below:
31608
31610
 
31609
31611
  Apache License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin",
3
- "version": "1.0.0-rc.31",
3
+ "version": "1.0.0-rc.33",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",
@@ -40,8 +40,8 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@apidevtools/swagger-parser": "12.1.0",
43
- "@biomejs/js-api": "4.0.0",
44
- "@biomejs/wasm-nodejs": "2.5.1",
43
+ "@biomejs/js-api": "6.0.0",
44
+ "@biomejs/wasm-nodejs": "2.5.3",
45
45
  "@getgrit/gritql": "0.0.3",
46
46
  "@iarna/toml": "2.2.5",
47
47
  "@modelcontextprotocol/sdk": "1.29.0",
@@ -77,8 +77,8 @@
77
77
  "typescript": "6.0.3",
78
78
  "unified": "11.0.5",
79
79
  "unist-util-visit": "5.1.0",
80
- "vite": "8.1.0",
81
- "vitest": "4.1.9",
80
+ "vite": "8.1.4",
81
+ "vitest": "4.1.10",
82
82
  "zod": "4.4.3"
83
83
  }
84
84
  }
@@ -3,7 +3,7 @@
3
3
  exports[`infra generator > should add required dependencies to package.json > dependencies 1`] = `
4
4
  {
5
5
  "aws-cdk": "2.1129.0",
6
- "aws-cdk-lib": "2.260.0",
6
+ "aws-cdk-lib": "2.261.0",
7
7
  "constructs": "10.6.0",
8
8
  "esbuild": "0.28.1",
9
9
  "source-map-support": "0.5.21",
@@ -15,13 +15,13 @@ exports[`infra generator > should add required dependencies to package.json > de
15
15
  "@nx/js": "23.0.1",
16
16
  "@nx/vitest": "23.0.1",
17
17
  "@swc/helpers": "~0.5.18",
18
- "@types/node": "25.9.4",
19
- "@vitest/coverage-v8": "4.1.9",
18
+ "@types/node": "26.1.1",
19
+ "@vitest/coverage-v8": "4.1.10",
20
20
  "jsdom": "^27.1.0",
21
- "tsx": "4.22.4",
21
+ "tsx": "4.23.0",
22
22
  "typescript": "~5.9.2",
23
- "vite": "8.1.0",
24
- "vitest": "4.1.9",
23
+ "vite": "8.1.4",
24
+ "vitest": "4.1.10",
25
25
  }
26
26
  `;
27
27
 
@@ -29,7 +29,7 @@ exports[`infra generator > should add required dependencies to package.json > pa
29
29
  {
30
30
  "dependencies": {
31
31
  "aws-cdk": "2.1129.0",
32
- "aws-cdk-lib": "2.260.0",
32
+ "aws-cdk-lib": "2.261.0",
33
33
  "constructs": "10.6.0",
34
34
  "esbuild": "0.28.1",
35
35
  "source-map-support": "0.5.21",
@@ -38,13 +38,13 @@ exports[`infra generator > should add required dependencies to package.json > pa
38
38
  "@nx/js": "23.0.1",
39
39
  "@nx/vitest": "23.0.1",
40
40
  "@swc/helpers": "~0.5.18",
41
- "@types/node": "25.9.4",
42
- "@vitest/coverage-v8": "4.1.9",
41
+ "@types/node": "26.1.1",
42
+ "@vitest/coverage-v8": "4.1.10",
43
43
  "jsdom": "^27.1.0",
44
- "tsx": "4.22.4",
44
+ "tsx": "4.23.0",
45
45
  "typescript": "~5.9.2",
46
- "vite": "8.1.0",
47
- "vitest": "4.1.9",
46
+ "vite": "8.1.4",
47
+ "vitest": "4.1.10",
48
48
  },
49
49
  "name": "@proj/source",
50
50
  "type": "module",
@@ -62,7 +62,7 @@ exports[`infra generator > should configure Checkov target correctly > checkov-t
62
62
  "{workspaceRoot}/dist/{projectRoot}/cdk.out",
63
63
  ],
64
64
  "options": {
65
- "command": "uvx --from checkov==3.3.6 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
65
+ "command": "uvx --from checkov==3.3.8 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
66
66
  },
67
67
  "outputs": [
68
68
  "{workspaceRoot}/dist/{projectRoot}/checkov",
@@ -155,7 +155,7 @@ exports[`infra generator > should configure project.json with correct targets >
155
155
  "{workspaceRoot}/dist/{projectRoot}/cdk.out",
156
156
  ],
157
157
  "options": {
158
- "command": "uvx --from checkov==3.3.6 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
158
+ "command": "uvx --from checkov==3.3.8 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
159
159
  },
160
160
  "outputs": [
161
161
  "{workspaceRoot}/dist/{projectRoot}/checkov",
@@ -711,7 +711,7 @@ exports[`infra generator > should handle custom project names correctly > custom
711
711
  "{workspaceRoot}/dist/{projectRoot}/cdk.out",
712
712
  ],
713
713
  "options": {
714
- "command": "uvx --from checkov==3.3.6 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
714
+ "command": "uvx --from checkov==3.3.8 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
715
715
  },
716
716
  "outputs": [
717
717
  "{workspaceRoot}/dist/{projectRoot}/checkov",
@@ -1,4 +1,4 @@
1
- import { ApplicationStage } from './stages/application-stage.js';
1
+ import { ApplicationStage } from './stages/application-stage<% if (esm) { %>.js<% } %>';
2
2
  import { App } from '<%= scopeAlias %>common-constructs';
3
3
  <% if (stageConfig) { %>import { resolveStage } from '<%= scopeAlias %>common-infra-config';
4
4
  <% } %>
@@ -1,6 +1,6 @@
1
1
  import { Stage, StageProps } from 'aws-cdk-lib';
2
2
  import { Construct } from 'constructs';
3
- import { ApplicationStack } from '../stacks/application-stack.js';
3
+ import { ApplicationStack } from '../stacks/application-stack<% if (esm) { %>.js<% } %>';
4
4
 
5
5
  /**
6
6
  * Defines a collection of CDK Stacks which make up your application
@@ -9,6 +9,7 @@ import { resolveContainers } from "../../utils/containers.js";
9
9
  import { formatFilesInSubtree } from "../../utils/format.js";
10
10
  import { installDependencies } from "../../utils/install.js";
11
11
  import { addGeneratorMetricsIfApplicable } from "../../utils/metrics.js";
12
+ import { esmVars } from "../../utils/module-format.js";
12
13
  import { kebabCase } from "../../utils/names.js";
13
14
  import { getNpmScopePrefix, toScopeAlias } from "../../utils/npm-scope.js";
14
15
  import { addDependencyToTargetIfNotPresent, addGeneratorMetadata, getGeneratorInfo, projectExists } from "../../utils/nx.js";
@@ -75,7 +76,8 @@ export async function tsInfraGenerator(tree, schema) {
75
76
  pkgMgrCmd: getPackageManagerDisplayCommands().exec,
76
77
  dir: lib.dir,
77
78
  stageConfig,
78
- ...schema
79
+ ...schema,
80
+ ...esmVars(tree)
79
81
  }, {
80
82
  overwriteStrategy: OverwriteStrategy.Overwrite
81
83
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/nx-plugin/src/infra/app/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n addDependenciesToPackageJson,\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type ProjectConfiguration,\n readProjectConfiguration,\n type Tree,\n updateJson,\n} from '@nx/devkit';\nimport path from 'path';\nimport tsProjectGenerator, { getTsLibDetails } from '../../ts/lib/generator';\nimport { mergeTsReferences } from '../../ts/lib/ts-project-utils';\nimport { resolveContainers } from '../../utils/containers';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { installDependencies } from '../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { kebabCase } from '../../utils/names';\nimport { getNpmScopePrefix, toScopeAlias } from '../../utils/npm-scope';\nimport {\n addDependencyToTargetIfNotPresent,\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n projectExists,\n} from '../../utils/nx';\nimport { sortObjectKeys } from '../../utils/object';\nimport { getPackageManagerDisplayCommands } from '../../utils/pkg-manager';\nimport { uvxCommand } from '../../utils/py';\nimport { sharedConstructsGenerator } from '../../utils/shared-constructs';\nimport {\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n SHARED_INFRA_CONFIG_DIR,\n} from '../../utils/shared-constructs-constants';\nimport { sharedInfraConfigGenerator } from '../../utils/shared-infra-config';\nimport { sharedInfraScriptsGenerator } from '../../utils/shared-infra-scripts';\nimport { withVersions } from '../../utils/versions';\nimport type { TsInfraGeneratorSchema } from './schema';\n\nexport const INFRA_APP_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport async function tsInfraGenerator(\n tree: Tree,\n schema: TsInfraGeneratorSchema,\n): Promise<GeneratorCallback> {\n const lib = getTsLibDetails(tree, schema);\n\n if (!projectExists(tree, lib.fullyQualifiedName)) {\n await tsProjectGenerator(tree, {\n ...schema,\n preferInstallDependencies: false,\n });\n }\n\n // CDK shells out to a container engine to build image assets. Default\n // (docker) needs no env override; finch is set via CDK_DOCKER per\n // https://docs.aws.amazon.com/cdk/v2/guide/build-containers.html#build-container-replace.\n const containers = await resolveContainers(tree, 'inherit');\n const cdkEnv: Record<string, string> | undefined =\n containers === 'docker' ? undefined : { CDK_DOCKER: containers };\n const withCdkEnv = <T extends Record<string, unknown>>(opts: T): T => {\n if (!cdkEnv) return opts;\n const existingEnv = (opts.env as Record<string, string> | undefined) ?? {};\n return { ...opts, env: { ...existingEnv, ...cdkEnv } } as T;\n };\n\n addGeneratorMetadata(tree, lib.fullyQualifiedName, INFRA_APP_GENERATOR_INFO);\n\n // Shared constructs always in CDK for typescript infra generator\n await sharedConstructsGenerator(tree, {\n iac: 'cdk',\n });\n\n // Shared infra-config and infra-scripts packages (lazy creation, only when enabled)\n const stageConfig = schema.stageConfig ?? false;\n if (stageConfig) {\n await sharedInfraConfigGenerator(tree);\n await sharedInfraScriptsGenerator(tree);\n }\n\n const synthDirFromRoot = `/dist/${lib.dir}/cdk.out`;\n const synthDirFromProject =\n lib.dir\n .split('/')\n .map(() => '..')\n .join('/') + `/dist/${lib.dir}/cdk.out`;\n const distDirFromProjectRoot =\n lib.dir\n .split('/')\n .map(() => '..')\n .join('/') + '/dist/{projectRoot}/cdk.out';\n const projectConfig = readProjectConfiguration(tree, lib.fullyQualifiedName);\n const libraryRoot = projectConfig.root;\n const npmScopePrefix = getNpmScopePrefix(tree);\n const scopeAlias = toScopeAlias(npmScopePrefix);\n const fullyQualifiedName = `${npmScopePrefix}${schema.name}`;\n tree.delete(joinPathFragments(libraryRoot, 'src'));\n\n generateFiles(\n tree, // the virtual file system\n joinPathFragments(import.meta.dirname, './files/app'), // path to the file templates\n libraryRoot, // destination path of the files\n {\n synthDir: synthDirFromProject,\n scopeAlias: scopeAlias,\n namespace: kebabCase(fullyQualifiedName),\n fullyQualifiedName,\n pkgMgrCmd: getPackageManagerDisplayCommands().exec,\n dir: lib.dir,\n stageConfig,\n ...schema,\n },\n {\n overwriteStrategy: OverwriteStrategy.Overwrite,\n },\n );\n\n updateJson(\n tree,\n `${libraryRoot}/project.json`,\n (config: ProjectConfiguration) => {\n config.projectType = 'application';\n addDependencyToTargetIfNotPresent(config, 'build', 'synth');\n addDependencyToTargetIfNotPresent(config, 'build', 'checkov');\n config.targets.compile.outputs = [\n '{workspaceRoot}/dist/{projectRoot}/tsc',\n ];\n config.targets.synth = {\n cache: true,\n executor: 'nx:run-commands',\n inputs: ['default'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/cdk.out'],\n dependsOn: ['^build', 'compile'], // compile clobbers dist directory, so ensure synth runs afterwards\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk synth',\n }),\n };\n config.targets.checkov = {\n cache: true,\n executor: 'nx:run-commands',\n inputs: ['{workspaceRoot}/dist/{projectRoot}/cdk.out'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/checkov'],\n dependsOn: ['synth'],\n options: {\n command: uvxCommand(\n 'checkov',\n '--config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation',\n ),\n },\n };\n config.targets.deploy = {\n executor: 'nx:run-commands',\n dependsOn: ['^build', 'compile'],\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-deploy.ts ${libraryRoot}`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk deploy --require-approval=never',\n }),\n };\n config.targets['deploy-ci'] = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk deploy --require-approval=never --app ${distDirFromProjectRoot}`,\n }),\n };\n config.targets.destroy = {\n executor: 'nx:run-commands',\n dependsOn: ['^build', 'compile'],\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-destroy.ts ${libraryRoot}`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk destroy --require-approval=never',\n }),\n };\n config.targets['destroy-ci'] = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk destroy --require-approval=never --app ${distDirFromProjectRoot}`,\n }),\n };\n config.targets.cdk = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk',\n }),\n };\n config.targets.bootstrap = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk bootstrap',\n }),\n };\n config.targets = sortObjectKeys(config.targets);\n return config;\n },\n );\n\n addDependenciesToPackageJson(\n tree,\n withVersions([\n 'aws-cdk-lib',\n 'aws-cdk',\n 'esbuild',\n 'constructs',\n 'source-map-support',\n ]),\n withVersions(['tsx']),\n );\n\n updateJson(tree, `${libraryRoot}/tsconfig.lib.json`, (tsConfig) => ({\n ...tsConfig,\n references: mergeTsReferences(tsConfig.references, [\n {\n path: `${path.relative(\n libraryRoot,\n `${tree.root}/${PACKAGES_DIR}`,\n )}/${SHARED_CONSTRUCTS_DIR}/tsconfig.lib.json`,\n },\n ...(stageConfig\n ? [\n {\n path: `${path.relative(\n libraryRoot,\n `${tree.root}/${PACKAGES_DIR}`,\n )}/${SHARED_INFRA_CONFIG_DIR}/tsconfig.json`,\n },\n ]\n : []),\n ]),\n }));\n\n await addGeneratorMetricsIfApplicable(tree, [INFRA_APP_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, schema.preferInstallDependencies, {\n languages: ['typescript'],\n });\n}\nexport default tsInfraGenerator;\n"],"names":["addDependenciesToPackageJson","generateFiles","joinPathFragments","OverwriteStrategy","readProjectConfiguration","updateJson","path","tsProjectGenerator","getTsLibDetails","mergeTsReferences","resolveContainers","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","kebabCase","getNpmScopePrefix","toScopeAlias","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","projectExists","sortObjectKeys","getPackageManagerDisplayCommands","uvxCommand","sharedConstructsGenerator","PACKAGES_DIR","SHARED_CONSTRUCTS_DIR","SHARED_INFRA_CONFIG_DIR","sharedInfraConfigGenerator","sharedInfraScriptsGenerator","withVersions","INFRA_APP_GENERATOR_INFO","filename","tsInfraGenerator","tree","schema","lib","fullyQualifiedName","preferInstallDependencies","containers","cdkEnv","undefined","CDK_DOCKER","withCdkEnv","opts","existingEnv","env","iac","stageConfig","synthDirFromRoot","dir","synthDirFromProject","split","map","join","distDirFromProjectRoot","projectConfig","libraryRoot","root","npmScopePrefix","scopeAlias","name","delete","dirname","synthDir","namespace","pkgMgrCmd","exec","overwriteStrategy","Overwrite","config","projectType","targets","compile","outputs","synth","cache","executor","inputs","dependsOn","options","cwd","command","checkov","deploy","destroy","cdk","bootstrap","tsConfig","references","relative","languages"],"mappings":"AAAA;;;CAGC,GACD,SACEA,4BAA4B,EAE5BC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAEjBC,wBAAwB,EAExBC,UAAU,QACL,aAAa;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,sBAAsBC,eAAe,QAAQ,4BAAyB;AAC7E,SAASC,iBAAiB,QAAQ,mCAAgC;AAClE,SAASC,iBAAiB,QAAQ,4BAAyB;AAC3D,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,mBAAmB,QAAQ,yBAAsB;AAC1D,SAASC,+BAA+B,QAAQ,yBAAsB;AACtE,SAASC,SAAS,QAAQ,uBAAoB;AAC9C,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,2BAAwB;AACxE,SACEC,iCAAiC,EACjCC,oBAAoB,EACpBC,gBAAgB,EAEhBC,aAAa,QACR,oBAAiB;AACxB,SAASC,cAAc,QAAQ,wBAAqB;AACpD,SAASC,gCAAgC,Q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zB,WAAW6B,MAAM,GAAGuB,YAAY,kBAAkB,CAAC,EAAE,CAAC+B,WAAc,CAAA;YAClE,GAAGA,QAAQ;YACXC,YAAYhF,kBAAkB+E,SAASC,UAAU,EAAE;gBACjD;oBACEnF,MAAM,GAAGA,KAAKoF,QAAQ,CACpBjC,aACA,GAAGvB,KAAKwB,IAAI,CAAC,CAAC,EAAEjC,cAAc,EAC9B,CAAC,EAAEC,sBAAsB,kBAAkB,CAAC;gBAChD;mBACIsB,cACA;oBACE;wBACE1C,MAAM,GAAGA,KAAKoF,QAAQ,CACpBjC,aACA,GAAGvB,KAAKwB,IAAI,CAAC,CAAC,EAAEjC,cAAc,EAC9B,CAAC,EAAEE,wBAAwB,cAAc,CAAC;oBAC9C;iBACD,GACD,EAAE;aACP;QACH,CAAA;IAEA,MAAMd,gCAAgCqB,MAAM;QAACH;KAAyB;IAEtE,MAAMpB,qBAAqBuB;IAC3B,OAAO,IACLtB,oBAAoBsB,MAAMC,OAAOG,yBAAyB,EAAE;YAC1DqD,WAAW;gBAAC;aAAa;QAC3B;AACJ;AACA,eAAe1D,iBAAiB"}
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/infra/app/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n addDependenciesToPackageJson,\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type ProjectConfiguration,\n readProjectConfiguration,\n type Tree,\n updateJson,\n} from '@nx/devkit';\nimport path from 'path';\nimport tsProjectGenerator, { getTsLibDetails } from '../../ts/lib/generator';\nimport { mergeTsReferences } from '../../ts/lib/ts-project-utils';\nimport { resolveContainers } from '../../utils/containers';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { installDependencies } from '../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { esmVars } from '../../utils/module-format';\nimport { kebabCase } from '../../utils/names';\nimport { getNpmScopePrefix, toScopeAlias } from '../../utils/npm-scope';\nimport {\n addDependencyToTargetIfNotPresent,\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n projectExists,\n} from '../../utils/nx';\nimport { sortObjectKeys } from '../../utils/object';\nimport { getPackageManagerDisplayCommands } from '../../utils/pkg-manager';\nimport { uvxCommand } from '../../utils/py';\nimport { sharedConstructsGenerator } from '../../utils/shared-constructs';\nimport {\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n SHARED_INFRA_CONFIG_DIR,\n} from '../../utils/shared-constructs-constants';\nimport { sharedInfraConfigGenerator } from '../../utils/shared-infra-config';\nimport { sharedInfraScriptsGenerator } from '../../utils/shared-infra-scripts';\nimport { withVersions } from '../../utils/versions';\nimport type { TsInfraGeneratorSchema } from './schema';\n\nexport const INFRA_APP_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport async function tsInfraGenerator(\n tree: Tree,\n schema: TsInfraGeneratorSchema,\n): Promise<GeneratorCallback> {\n const lib = getTsLibDetails(tree, schema);\n\n if (!projectExists(tree, lib.fullyQualifiedName)) {\n await tsProjectGenerator(tree, {\n ...schema,\n preferInstallDependencies: false,\n });\n }\n\n // CDK shells out to a container engine to build image assets. Default\n // (docker) needs no env override; finch is set via CDK_DOCKER per\n // https://docs.aws.amazon.com/cdk/v2/guide/build-containers.html#build-container-replace.\n const containers = await resolveContainers(tree, 'inherit');\n const cdkEnv: Record<string, string> | undefined =\n containers === 'docker' ? undefined : { CDK_DOCKER: containers };\n const withCdkEnv = <T extends Record<string, unknown>>(opts: T): T => {\n if (!cdkEnv) return opts;\n const existingEnv = (opts.env as Record<string, string> | undefined) ?? {};\n return { ...opts, env: { ...existingEnv, ...cdkEnv } } as T;\n };\n\n addGeneratorMetadata(tree, lib.fullyQualifiedName, INFRA_APP_GENERATOR_INFO);\n\n // Shared constructs always in CDK for typescript infra generator\n await sharedConstructsGenerator(tree, {\n iac: 'cdk',\n });\n\n // Shared infra-config and infra-scripts packages (lazy creation, only when enabled)\n const stageConfig = schema.stageConfig ?? false;\n if (stageConfig) {\n await sharedInfraConfigGenerator(tree);\n await sharedInfraScriptsGenerator(tree);\n }\n\n const synthDirFromRoot = `/dist/${lib.dir}/cdk.out`;\n const synthDirFromProject =\n lib.dir\n .split('/')\n .map(() => '..')\n .join('/') + `/dist/${lib.dir}/cdk.out`;\n const distDirFromProjectRoot =\n lib.dir\n .split('/')\n .map(() => '..')\n .join('/') + '/dist/{projectRoot}/cdk.out';\n const projectConfig = readProjectConfiguration(tree, lib.fullyQualifiedName);\n const libraryRoot = projectConfig.root;\n const npmScopePrefix = getNpmScopePrefix(tree);\n const scopeAlias = toScopeAlias(npmScopePrefix);\n const fullyQualifiedName = `${npmScopePrefix}${schema.name}`;\n tree.delete(joinPathFragments(libraryRoot, 'src'));\n\n generateFiles(\n tree, // the virtual file system\n joinPathFragments(import.meta.dirname, './files/app'), // path to the file templates\n libraryRoot, // destination path of the files\n {\n synthDir: synthDirFromProject,\n scopeAlias: scopeAlias,\n namespace: kebabCase(fullyQualifiedName),\n fullyQualifiedName,\n pkgMgrCmd: getPackageManagerDisplayCommands().exec,\n dir: lib.dir,\n stageConfig,\n ...schema,\n ...esmVars(tree),\n },\n {\n overwriteStrategy: OverwriteStrategy.Overwrite,\n },\n );\n\n updateJson(\n tree,\n `${libraryRoot}/project.json`,\n (config: ProjectConfiguration) => {\n config.projectType = 'application';\n addDependencyToTargetIfNotPresent(config, 'build', 'synth');\n addDependencyToTargetIfNotPresent(config, 'build', 'checkov');\n config.targets.compile.outputs = [\n '{workspaceRoot}/dist/{projectRoot}/tsc',\n ];\n config.targets.synth = {\n cache: true,\n executor: 'nx:run-commands',\n inputs: ['default'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/cdk.out'],\n dependsOn: ['^build', 'compile'], // compile clobbers dist directory, so ensure synth runs afterwards\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk synth',\n }),\n };\n config.targets.checkov = {\n cache: true,\n executor: 'nx:run-commands',\n inputs: ['{workspaceRoot}/dist/{projectRoot}/cdk.out'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/checkov'],\n dependsOn: ['synth'],\n options: {\n command: uvxCommand(\n 'checkov',\n '--config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation',\n ),\n },\n };\n config.targets.deploy = {\n executor: 'nx:run-commands',\n dependsOn: ['^build', 'compile'],\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-deploy.ts ${libraryRoot}`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk deploy --require-approval=never',\n }),\n };\n config.targets['deploy-ci'] = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk deploy --require-approval=never --app ${distDirFromProjectRoot}`,\n }),\n };\n config.targets.destroy = {\n executor: 'nx:run-commands',\n dependsOn: ['^build', 'compile'],\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-destroy.ts ${libraryRoot}`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk destroy --require-approval=never',\n }),\n };\n config.targets['destroy-ci'] = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk destroy --require-approval=never --app ${distDirFromProjectRoot}`,\n }),\n };\n config.targets.cdk = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk',\n }),\n };\n config.targets.bootstrap = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk bootstrap',\n }),\n };\n config.targets = sortObjectKeys(config.targets);\n return config;\n },\n );\n\n addDependenciesToPackageJson(\n tree,\n withVersions([\n 'aws-cdk-lib',\n 'aws-cdk',\n 'esbuild',\n 'constructs',\n 'source-map-support',\n ]),\n withVersions(['tsx']),\n );\n\n updateJson(tree, `${libraryRoot}/tsconfig.lib.json`, (tsConfig) => ({\n ...tsConfig,\n references: mergeTsReferences(tsConfig.references, [\n {\n path: `${path.relative(\n libraryRoot,\n `${tree.root}/${PACKAGES_DIR}`,\n )}/${SHARED_CONSTRUCTS_DIR}/tsconfig.lib.json`,\n },\n ...(stageConfig\n ? [\n {\n path: `${path.relative(\n libraryRoot,\n `${tree.root}/${PACKAGES_DIR}`,\n )}/${SHARED_INFRA_CONFIG_DIR}/tsconfig.json`,\n },\n ]\n : []),\n ]),\n }));\n\n await addGeneratorMetricsIfApplicable(tree, [INFRA_APP_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, schema.preferInstallDependencies, {\n languages: ['typescript'],\n });\n}\nexport default tsInfraGenerator;\n"],"names":["addDependenciesToPackageJson","generateFiles","joinPathFragments","OverwriteStrategy","readProjectConfiguration","updateJson","path","tsProjectGenerator","getTsLibDetails","mergeTsReferences","resolveContainers","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","esmVars","kebabCase","getNpmScopePrefix","toScopeAlias","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","projectExists","sortObjectKeys","getPackageManagerDisplayCommands","uvxCommand","sharedConstructsGenerator","PACKAGES_DIR","SHARED_CONSTRUCTS_DIR","SHARED_INFRA_CONFIG_DIR","sharedInfraConfigGenerator","sharedInfraScriptsGenerator","withVersions","INFRA_APP_GENERATOR_INFO","filename","tsInfraGenerator","tree","schema","lib","fullyQualifiedName","preferInstallDependencies","containers","cdkEnv","undefined","CDK_DOCKER","withCdkEnv","opts","existingEnv","env","iac","stageConfig","synthDirFromRoot","dir","synthDirFromProject","split","map","join","distDirFromProjectRoot","projectConfig","libraryRoot","root","npmScopePrefix","scopeAlias","name","delete","dirname","synthDir","namespace","pkgMgrCmd","exec","overwriteStrategy","Overwrite","config","projectType","targets","compile","outputs","synth","cache","executor","inputs","dependsOn","options","cwd","command","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QAACH;KAAyB;IAEtE,MAAMrB,qBAAqBwB;IAC3B,OAAO,IACLvB,oBAAoBuB,MAAMC,OAAOG,yBAAyB,EAAE;YAC1DqD,WAAW;gBAAC;aAAa;QAC3B;AACJ;AACA,eAAe1D,iBAAiB"}
@@ -1,7 +1,10 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
3
  exports[`openApiTsClientGenerator - content type header > should not force Content-Type for multipart/form-data bodies > client.gen.ts 1`] = `
4
- "import type { PostUploadRequest } from './types.gen.js';
4
+ "import type {
5
+ PostUploadRequestContent,
6
+ PostUploadRequest,
7
+ } from './types.gen.js';
5
8
 
6
9
  /**
7
10
  * Utility for serialisation and deserialisation of API types.
@@ -9,6 +12,39 @@ exports[`openApiTsClientGenerator - content type header > should not force Conte
9
12
  export class $IO {
10
13
  public static $mapValues = (data: any, fn: (item: any) => any) =>
11
14
  Object.fromEntries(Object.entries(data).map(([k, v]) => [k, fn(v)]));
15
+
16
+ public static PostUploadRequestContent = {
17
+ toJson: (model: PostUploadRequestContent): any => {
18
+ if (model === undefined || model === null) {
19
+ return model;
20
+ }
21
+ return {
22
+ ...(model.file === undefined
23
+ ? {}
24
+ : {
25
+ file: model.file,
26
+ }),
27
+ ...(model.description === undefined
28
+ ? {}
29
+ : {
30
+ description: model.description,
31
+ }),
32
+ };
33
+ },
34
+ fromJson: (json: any): PostUploadRequestContent => {
35
+ if (json === undefined || json === null) {
36
+ return json;
37
+ }
38
+ return {
39
+ file: json['file'],
40
+ ...(json['description'] === undefined
41
+ ? {}
42
+ : {
43
+ description: json['description'],
44
+ }),
45
+ };
46
+ },
47
+ };
12
48
  }
13
49
 
14
50
  /**
@@ -130,6 +166,26 @@ export class TestApi {
130
166
  });
131
167
  };
132
168
 
169
+ private $formData = (model: { [key: string]: any }): FormData => {
170
+ const formData = new FormData();
171
+ const append = (key: string, value: any): void => {
172
+ if (value === undefined || value === null) {
173
+ return;
174
+ }
175
+ if (value instanceof Blob || typeof value === 'string') {
176
+ formData.append(key, value);
177
+ } else if (Array.isArray(value)) {
178
+ value.forEach((v) => append(key, v));
179
+ } else if (typeof value === 'object') {
180
+ formData.append(key, JSON.stringify(value));
181
+ } else {
182
+ formData.append(key, String(value));
183
+ }
184
+ };
185
+ Object.entries(model).forEach(([key, value]) => append(key, value));
186
+ return formData;
187
+ };
188
+
133
189
  private $fetch: typeof fetch = (...args) =>
134
190
  (this.$config.fetch ?? fetch)(...args);
135
191
 
@@ -137,7 +193,7 @@ export class TestApi {
137
193
  const pathParameters: { [key: string]: any } = {};
138
194
  const queryParameters: { [key: string]: any } = {};
139
195
  const headerParameters: { [key: string]: any } = {};
140
- const body = input as any;
196
+ const body = this.$formData($IO.PostUploadRequestContent.toJson(input));
141
197
 
142
198
  const response = await this.$fetch(
143
199
  this.$url('/upload', pathParameters, queryParameters),
@@ -160,7 +216,12 @@ export class TestApi {
160
216
  `;
161
217
 
162
218
  exports[`openApiTsClientGenerator - content type header > should not force Content-Type for multipart/form-data bodies > types.gen.ts 1`] = `
163
- "export type PostUploadRequest = unknown;
219
+ "export type PostUploadRequestContent = {
220
+ file: Blob;
221
+ description?: string;
222
+ };
223
+
224
+ export type PostUploadRequest = PostUploadRequestContent;
164
225
  export type PostUploadError = never;
165
226
  "
166
227
  `;