@aws/nx-plugin 1.0.0-rc.32 → 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.
- package/LICENSE-THIRD-PARTY +72 -70
- package/package.json +5 -5
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +15 -15
- package/src/infra/app/files/app/src/main.ts.template +1 -1
- package/src/infra/app/files/app/src/stages/application-stage.ts.template +1 -1
- package/src/infra/app/generator.js +3 -1
- package/src/infra/app/generator.js.map +1 -1
- package/src/open-api/ts-client/files/client.gen.ts.template +1 -1
- package/src/open-api/ts-client/generator.js +5 -1
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-hooks/files/options-proxy.gen.ts.template +2 -2
- package/src/open-api/ts-hooks/generator.js +5 -1
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/preset/generator.d.ts +1 -1
- package/src/preset/generator.js +5 -2
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.js.map +1 -1
- package/src/preset/schema.d.ts +2 -0
- package/src/preset/schema.json +6 -0
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +7 -7
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +8 -8
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +89 -3
- 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 +91 -5
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +7 -7
- package/src/smithy/ts/api/files/handler.ts.template +2 -2
- package/src/smithy/ts/api/files/local-server.ts.template +2 -2
- package/src/smithy/ts/api/files/operations/echo.ts.template +2 -2
- package/src/smithy/ts/api/files/service.ts.template +3 -3
- package/src/smithy/ts/api/generator.js +3 -1
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +12 -12
- package/src/trpc/backend/files/src/client/index.ts.template +1 -1
- package/src/trpc/backend/files/src/handler.ts.template +1 -1
- package/src/trpc/backend/files/src/index.ts.template +5 -5
- package/src/trpc/backend/files/src/init.ts.template +1 -1
- package/src/trpc/backend/files/src/local-server.ts.template +1 -1
- package/src/trpc/backend/files/src/middleware/index.ts.template +7 -7
- package/src/trpc/backend/files/src/procedures/echo.ts.template +2 -2
- package/src/trpc/backend/files/src/router.ts.template +2 -2
- package/src/trpc/backend/files/src/schema/index.ts.template +1 -1
- package/src/trpc/backend/generator.js +3 -1
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +89 -3
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client-strands.ts.template +2 -2
- package/src/ts/agent/a2a-connection/generator.js +3 -1
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/a2a/index.ts.template +1 -1
- package/src/ts/agent/files/ag-ui/index.ts.template +1 -1
- package/src/ts/agent/files/http/client.ts.template +2 -2
- package/src/ts/agent/files/http/index.ts.template +2 -2
- package/src/ts/agent/files/http/router.ts.template +3 -3
- package/src/ts/agent/gateway-connection/files/agent-connection/app/__gatewayKebabCase__-client-strands.ts.template +2 -2
- package/src/ts/agent/gateway-connection/generator.js +3 -1
- package/src/ts/agent/gateway-connection/generator.js.map +1 -1
- package/src/ts/agent/generator.js +5 -2
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +2 -2
- package/src/ts/agent/mcp-connection/generator.js +3 -1
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/astro-docs/files/translation/scripts/translate.ts.template +3 -2
- package/src/ts/astro-docs/generator.js +2 -0
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/dynamodb/files/src/client.ts.template +5 -2
- package/src/ts/dynamodb/files/src/entities/example.ts.template +1 -1
- package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -1
- package/src/ts/dynamodb/files/src/index.ts.template +2 -2
- package/src/ts/dynamodb/generator.js +3 -1
- package/src/ts/dynamodb/generator.js.map +1 -1
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/lib/generator.js +7 -1
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/ts-project-utils.js +19 -4
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/types.d.ts +6 -0
- package/src/ts/lib/types.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +94 -8
- package/src/ts/mcp-server/generator.js +3 -2
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/nx-generator/files/local/generator.ts.template +2 -2
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +2 -2
- package/src/ts/nx-generator/generator.js +5 -2
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-plugin/files/mcp-server/server.ts.template +5 -5
- package/src/ts/nx-plugin/files/mcp-server/tools/create-workspace-command.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/general-guidance.ts.template +1 -1
- package/src/ts/nx-plugin/files/mcp-server/tools/generator-guide.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/list-generators.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/utils.ts.template +3 -3
- package/src/ts/nx-plugin/generator.js +3 -1
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/utils.js +7 -4
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/rdb/files/src/create-db-user-handler.ts.template +2 -2
- package/src/ts/rdb/files/src/index.ts.template +1 -1
- package/src/ts/rdb/files/src/migration-handler.ts.template +1 -1
- package/src/ts/rdb/files/src/prisma.ts.template +7 -4
- package/src/ts/rdb/generator.js +3 -1
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +35 -35
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +2 -2
- package/src/utils/agent-chat/agent-chat.js +3 -1
- package/src/utils/agent-chat/agent-chat.js.map +1 -1
- package/src/utils/agent-chat/files/a2a/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/ag-ui/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/http-py/chat.ts.template +2 -2
- package/src/utils/agent-chat/files/http-ts/chat.ts.template +1 -1
- package/src/utils/agent-connection/agent-connection.js +4 -1
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client-config.ts.template +2 -2
- package/src/utils/agent-connection/files/core-auth/agentcore-fetch.ts.template +1 -1
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +2 -2
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-transport.ts.template +2 -2
- package/src/utils/agent-connection/files/core-shared/agentcore-transport.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/a2a/agentcore-a2a-client-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/base/with-session-id-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/gateway/agentcore-gateway-mcp-client-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/mcp/agentcore-mcp-client-strands.ts.template +1 -1
- package/src/utils/agent-core-constructs/agent-core-constructs.js +10 -3
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +3 -3
- package/src/utils/agent-core-constructs/files/cdk/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.ts.template +4 -4
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +1 -1
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +27 -0
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +60 -1
- package/src/utils/api-constructs/api-constructs.js +8 -2
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +8 -8
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +8 -8
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +3 -3
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account/index.js.template +32 -20
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account.ts.template +1 -1
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +4 -4
- package/src/utils/api-constructs/files/cdk/core/api/trpc/trpc-utils.ts.template +1 -1
- package/src/utils/ast.js +16 -0
- package/src/utils/ast.js.map +1 -1
- package/src/utils/commands.d.ts +1 -1
- package/src/utils/commands.js +4 -1
- package/src/utils/commands.js.map +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +9 -2
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -1
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +3 -3
- package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +1 -1
- package/src/utils/files/common/constructs/src/core/index.ts.template +4 -4
- package/src/utils/files/common/constructs/src/index.ts.template +2 -2
- package/src/utils/files/common/infra-config/src/index.ts.template +3 -3
- package/src/utils/files/common/infra-config/src/resolve-stage.ts.template +2 -2
- package/src/utils/files/common/infra-config/src/stages.config.ts.template +1 -1
- package/src/utils/files/common/scripts/src/infra/infra-deploy.ts.template +1 -1
- package/src/utils/files/common/scripts/src/infra/infra-destroy.ts.template +1 -1
- package/src/utils/files/common/scripts/src/infra/stage-credentials/run.ts.template +3 -3
- package/src/utils/files/common/shadcn/src/index.ts.template +2 -2
- package/src/utils/function-constructs/files/cdk/app/lambda-functions/__nameKebabCase__.ts.template +1 -1
- package/src/utils/function-constructs/function-constructs.js +3 -1
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +2 -2
- package/src/utils/identity-constructs/identity-constructs.js +5 -1
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/module-format.d.ts +28 -0
- package/src/utils/module-format.js +28 -0
- package/src/utils/module-format.js.map +1 -0
- package/src/utils/rdb-constructs/files/cdk/app/dbs/__nameKebabCase__.ts.template +5 -5
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +1 -1
- package/src/utils/rdb-constructs/rdb-constructs.js +9 -2
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs.js +3 -1
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-infra-config.js +3 -1
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-infra-scripts.js +3 -1
- package/src/utils/shared-infra-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.js +3 -1
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +2 -0
- package/src/utils/test.js +7 -1
- package/src/utils/test.js.map +1 -1
- package/src/utils/versions.d.ts +58 -58
- package/src/utils/versions.js +56 -56
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/app/static-websites/__websiteNameKebabCase__.ts.template +2 -2
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +2 -2
- package/src/utils/website-constructs/website-constructs.js +9 -2
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
package/LICENSE-THIRD-PARTY
CHANGED
|
@@ -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.
|
|
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.
|
|
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 (
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 (
|
|
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.
|
|
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.
|
|
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 (
|
|
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.
|
|
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": "
|
|
44
|
-
"@biomejs/wasm-nodejs": "2.5.
|
|
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.
|
|
81
|
-
"vitest": "4.1.
|
|
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.
|
|
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": "
|
|
19
|
-
"@vitest/coverage-v8": "4.1.
|
|
18
|
+
"@types/node": "26.1.1",
|
|
19
|
+
"@vitest/coverage-v8": "4.1.10",
|
|
20
20
|
"jsdom": "^27.1.0",
|
|
21
|
-
"tsx": "4.
|
|
21
|
+
"tsx": "4.23.0",
|
|
22
22
|
"typescript": "~5.9.2",
|
|
23
|
-
"vite": "8.1.
|
|
24
|
-
"vitest": "4.1.
|
|
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.
|
|
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": "
|
|
42
|
-
"@vitest/coverage-v8": "4.1.
|
|
41
|
+
"@types/node": "26.1.1",
|
|
42
|
+
"@vitest/coverage-v8": "4.1.10",
|
|
43
43
|
"jsdom": "^27.1.0",
|
|
44
|
-
"tsx": "4.
|
|
44
|
+
"tsx": "4.23.0",
|
|
45
45
|
"typescript": "~5.9.2",
|
|
46
|
-
"vite": "8.1.
|
|
47
|
-
"vitest": "4.1.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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,iBA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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","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,OAAO,QAAQ,+BAA4B;AACpD,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,QAAQ,6BAA0B;AAC3E,SAASC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B1B,WAAW8B,MAAM,GAAGuB,YAAY,kBAAkB,CAAC,EAAE,CAAC+B,WAAc,CAAA;YAClE,GAAGA,QAAQ;YACXC,YAAYjF,kBAAkBgF,SAASC,UAAU,EAAE;gBACjD;oBACEpF,MAAM,GAAGA,KAAKqF,QAAQ,CACpBjC,aACA,GAAGvB,KAAKwB,IAAI,CAAC,CAAC,EAAEjC,cAAc,EAC9B,CAAC,EAAEC,sBAAsB,kBAAkB,CAAC;gBAChD;mBACIsB,cACA;oBACE;wBACE3C,MAAM,GAAGA,KAAKqF,QAAQ,CACpBjC,aACA,GAAGvB,KAAKwB,IAAI,CAAC,CAAC,EAAEjC,cAAc,EAC9B,CAAC,EAAEE,wBAAwB,cAAc,CAAC;oBAC9C;iBACD,GACD,EAAE;aACP;QACH,CAAA;IAEA,MAAMf,gCAAgCsB,MAAM;QAACH;KAAyB;IAEtE,MAAMrB,qBAAqBwB;IAC3B,OAAO,IACLvB,oBAAoBuB,MAAMC,OAAOG,yBAAyB,EAAE;YAC1DqD,WAAW;gBAAC;aAAa;QAC3B;AACJ;AACA,eAAe1D,iBAAiB"}
|
|
@@ -45,7 +45,7 @@ import type {
|
|
|
45
45
|
<%_ allOperations.filter(p => p.parameters.length > 0).forEach((op) => { _%>
|
|
46
46
|
<%- op.requestTypeName %>,
|
|
47
47
|
<%_ }); _%>
|
|
48
|
-
} from './types.gen
|
|
48
|
+
} from './types.gen<% if (esm) { %>.js<% } %>';
|
|
49
49
|
<%_ } _%>
|
|
50
50
|
<%_
|
|
51
51
|
// Nested arrays of primitives (besides dates) don't need to have .map(...) called to convert them as the base case will be a noop
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/ import { generateFiles } from "@nx/devkit";
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import { formatFilesInSubtree } from "../../utils/format.js";
|
|
7
|
+
import { esmVars } from "../../utils/module-format.js";
|
|
7
8
|
import { buildOpenApiCodeGenData } from "../utils/codegen-data.js";
|
|
8
9
|
import { parseOpenApiSpec } from "../utils/parse.js";
|
|
9
10
|
/**
|
|
@@ -22,7 +23,10 @@ import { parseOpenApiSpec } from "../utils/parse.js";
|
|
|
22
23
|
/**
|
|
23
24
|
* Generate an OpenAPI typescript client in the target directory
|
|
24
25
|
*/ export const generateOpenApiTsClient = (tree, data, outputPath)=>{
|
|
25
|
-
generateFiles(tree, path.join(import.meta.dirname, 'files'), outputPath,
|
|
26
|
+
generateFiles(tree, path.join(import.meta.dirname, 'files'), outputPath, {
|
|
27
|
+
...data,
|
|
28
|
+
...esmVars(tree)
|
|
29
|
+
});
|
|
26
30
|
};
|
|
27
31
|
export default openApiTsClientGenerator;
|
|
28
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/open-api/ts-client/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { generateFiles, type Tree } from '@nx/devkit';\nimport * as path from 'path';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { buildOpenApiCodeGenData } from '../utils/codegen-data';\nimport type { CodeGenData } from '../utils/codegen-data/types';\nimport { parseOpenApiSpec } from '../utils/parse';\nimport type { OpenApiTsClientGeneratorSchema } from './schema';\n\n/**\n * Generates typescript client from an openapi spec\n */\nexport const openApiTsClientGenerator = async (\n tree: Tree,\n options: OpenApiTsClientGeneratorSchema,\n) => {\n const data = await buildOpenApiCodeGenerationData(\n tree,\n options.openApiSpecPath,\n );\n\n generateOpenApiTsClient(tree, data, options.outputPath);\n\n await formatFilesInSubtree(tree);\n};\n\n/**\n * Build a data structure which can be used to generate code from OpenAPI\n */\nexport const buildOpenApiCodeGenerationData = async (\n tree: Tree,\n specPath: string,\n) => {\n const spec = await parseOpenApiSpec(tree, specPath);\n return buildOpenApiCodeGenData(spec);\n};\n\n/**\n * Generate an OpenAPI typescript client in the target directory\n */\nexport const generateOpenApiTsClient = (\n tree: Tree,\n data: CodeGenData,\n outputPath: string,\n) => {\n generateFiles(\n tree,\n path.join(import.meta.dirname, 'files'),\n outputPath,\n data,\n );\n};\n\nexport default openApiTsClientGenerator;\n"],"names":["generateFiles","path","formatFilesInSubtree","buildOpenApiCodeGenData","parseOpenApiSpec","openApiTsClientGenerator","tree","options","data","buildOpenApiCodeGenerationData","openApiSpecPath","generateOpenApiTsClient","outputPath","specPath","spec","join","dirname"],"mappings":"AAAA;;;CAGC,GACD,SAASA,aAAa,QAAmB,aAAa;AACtD,YAAYC,UAAU,OAAO;AAC7B,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,uBAAuB,QAAQ,2BAAwB;AAEhE,SAASC,gBAAgB,QAAQ,oBAAiB;AAGlD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,OACtCC,MACAC;IAEA,MAAMC,OAAO,MAAMC,+BACjBH,MACAC,QAAQG,eAAe;IAGzBC,wBAAwBL,MAAME,MAAMD,QAAQK,UAAU;IAEtD,
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/open-api/ts-client/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { generateFiles, type Tree } from '@nx/devkit';\nimport * as path from 'path';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { esmVars } from '../../utils/module-format';\nimport { buildOpenApiCodeGenData } from '../utils/codegen-data';\nimport type { CodeGenData } from '../utils/codegen-data/types';\nimport { parseOpenApiSpec } from '../utils/parse';\nimport type { OpenApiTsClientGeneratorSchema } from './schema';\n\n/**\n * Generates typescript client from an openapi spec\n */\nexport const openApiTsClientGenerator = async (\n tree: Tree,\n options: OpenApiTsClientGeneratorSchema,\n) => {\n const data = await buildOpenApiCodeGenerationData(\n tree,\n options.openApiSpecPath,\n );\n\n generateOpenApiTsClient(tree, data, options.outputPath);\n\n await formatFilesInSubtree(tree);\n};\n\n/**\n * Build a data structure which can be used to generate code from OpenAPI\n */\nexport const buildOpenApiCodeGenerationData = async (\n tree: Tree,\n specPath: string,\n) => {\n const spec = await parseOpenApiSpec(tree, specPath);\n return buildOpenApiCodeGenData(spec);\n};\n\n/**\n * Generate an OpenAPI typescript client in the target directory\n */\nexport const generateOpenApiTsClient = (\n tree: Tree,\n data: CodeGenData,\n outputPath: string,\n) => {\n generateFiles(\n tree,\n path.join(import.meta.dirname, 'files'),\n outputPath,\n { ...data, ...esmVars(tree) },\n );\n};\n\nexport default openApiTsClientGenerator;\n"],"names":["generateFiles","path","formatFilesInSubtree","esmVars","buildOpenApiCodeGenData","parseOpenApiSpec","openApiTsClientGenerator","tree","options","data","buildOpenApiCodeGenerationData","openApiSpecPath","generateOpenApiTsClient","outputPath","specPath","spec","join","dirname"],"mappings":"AAAA;;;CAGC,GACD,SAASA,aAAa,QAAmB,aAAa;AACtD,YAAYC,UAAU,OAAO;AAC7B,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,OAAO,QAAQ,+BAA4B;AACpD,SAASC,uBAAuB,QAAQ,2BAAwB;AAEhE,SAASC,gBAAgB,QAAQ,oBAAiB;AAGlD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,OACtCC,MACAC;IAEA,MAAMC,OAAO,MAAMC,+BACjBH,MACAC,QAAQG,eAAe;IAGzBC,wBAAwBL,MAAME,MAAMD,QAAQK,UAAU;IAEtD,MAAMX,qBAAqBK;AAC7B,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMG,iCAAiC,OAC5CH,MACAO;IAEA,MAAMC,OAAO,MAAMV,iBAAiBE,MAAMO;IAC1C,OAAOV,wBAAwBW;AACjC,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMH,0BAA0B,CACrCL,MACAE,MACAI;IAEAb,cACEO,MACAN,KAAKe,IAAI,CAAC,YAAYC,OAAO,EAAE,UAC/BJ,YACA;QAAE,GAAGJ,IAAI;QAAE,GAAGN,QAAQI,KAAK;IAAC;AAEhC,EAAE;AAEF,eAAeD,yBAAyB"}
|
|
@@ -41,9 +41,9 @@ import type {
|
|
|
41
41
|
<%_ uniq(allOperations.flatMap((op) => op.isInfiniteQuery && op.infiniteQueryCursorProperty && modelsByName[op.infiniteQueryCursorProperty.type] ? [modelsByName[op.infiniteQueryCursorProperty.type].typescriptType] : [])).forEach((cursorTypeModel) => { _%>
|
|
42
42
|
<%- cursorTypeModel %>,
|
|
43
43
|
<%_ }); _%>
|
|
44
|
-
} from './types.gen
|
|
44
|
+
} from './types.gen<% if (esm) { %>.js<% } %>';
|
|
45
45
|
<%_ } _%>
|
|
46
|
-
import { <%- className %> } from './client.gen
|
|
46
|
+
import { <%- className %> } from './client.gen<% if (esm) { %>.js<% } %>';
|
|
47
47
|
|
|
48
48
|
export interface <%- className %>OptionsProxyConfig {
|
|
49
49
|
client: <%- className %>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/ import { generateFiles } from "@nx/devkit";
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { formatFilesInSubtree } from "../../utils/format.js";
|
|
7
|
+
import { esmVars } from "../../utils/module-format.js";
|
|
7
8
|
import { buildOpenApiCodeGenerationData, generateOpenApiTsClient } from "../ts-client/generator.js";
|
|
8
9
|
/**
|
|
9
10
|
* Generates typescript hooks from an openapi spec
|
|
@@ -16,7 +17,10 @@ import { buildOpenApiCodeGenerationData, generateOpenApiTsClient } from "../ts-c
|
|
|
16
17
|
/**
|
|
17
18
|
* Generate OpenAPI typescript hooks in the target directory
|
|
18
19
|
*/ export const generateOpenApiTsHooks = (tree, data, outputPath)=>{
|
|
19
|
-
generateFiles(tree, path.join(import.meta.dirname, 'files'), outputPath,
|
|
20
|
+
generateFiles(tree, path.join(import.meta.dirname, 'files'), outputPath, {
|
|
21
|
+
...data,
|
|
22
|
+
...esmVars(tree)
|
|
23
|
+
});
|
|
20
24
|
};
|
|
21
25
|
export default openApiTsHooksGenerator;
|
|
22
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/open-api/ts-hooks/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { generateFiles, type Tree } from '@nx/devkit';\nimport path from 'path';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport {\n buildOpenApiCodeGenerationData,\n generateOpenApiTsClient,\n} from '../ts-client/generator';\nimport type { CodeGenData } from '../utils/codegen-data/types';\nimport type { OpenApiTsHooksGeneratorSchema } from './schema';\n\n/**\n * Generates typescript hooks from an openapi spec\n */\nexport const openApiTsHooksGenerator = async (\n tree: Tree,\n options: OpenApiTsHooksGeneratorSchema,\n) => {\n const data = await buildOpenApiCodeGenerationData(\n tree,\n options.openApiSpecPath,\n );\n\n generateOpenApiTsClient(tree, data, options.outputPath);\n generateOpenApiTsHooks(tree, data, options.outputPath);\n\n await formatFilesInSubtree(tree);\n};\n\n/**\n * Generate OpenAPI typescript hooks in the target directory\n */\nexport const generateOpenApiTsHooks = (\n tree: Tree,\n data: CodeGenData,\n outputPath: string,\n) => {\n generateFiles(\n tree,\n path.join(import.meta.dirname, 'files'),\n outputPath,\n data,\n );\n};\n\nexport default openApiTsHooksGenerator;\n"],"names":["generateFiles","path","formatFilesInSubtree","buildOpenApiCodeGenerationData","generateOpenApiTsClient","openApiTsHooksGenerator","tree","options","data","openApiSpecPath","outputPath","generateOpenApiTsHooks","join","dirname"],"mappings":"AAAA;;;CAGC,GACD,SAASA,aAAa,QAAmB,aAAa;AACtD,OAAOC,UAAU,OAAO;AACxB,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SACEC,8BAA8B,EAC9BC,uBAAuB,QAClB,4BAAyB;AAIhC;;CAEC,GACD,OAAO,MAAMC,0BAA0B,OACrCC,MACAC;IAEA,MAAMC,OAAO,MAAML,+BACjBG,MACAC,QAAQE,eAAe;IAGzBL,wBAAwBE,MAAME,MAAMD,QAAQG,UAAU;IACtDC,uBAAuBL,MAAME,MAAMD,QAAQG,UAAU;IAErD,
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/open-api/ts-hooks/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { generateFiles, type Tree } from '@nx/devkit';\nimport path from 'path';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { esmVars } from '../../utils/module-format';\nimport {\n buildOpenApiCodeGenerationData,\n generateOpenApiTsClient,\n} from '../ts-client/generator';\nimport type { CodeGenData } from '../utils/codegen-data/types';\nimport type { OpenApiTsHooksGeneratorSchema } from './schema';\n\n/**\n * Generates typescript hooks from an openapi spec\n */\nexport const openApiTsHooksGenerator = async (\n tree: Tree,\n options: OpenApiTsHooksGeneratorSchema,\n) => {\n const data = await buildOpenApiCodeGenerationData(\n tree,\n options.openApiSpecPath,\n );\n\n generateOpenApiTsClient(tree, data, options.outputPath);\n generateOpenApiTsHooks(tree, data, options.outputPath);\n\n await formatFilesInSubtree(tree);\n};\n\n/**\n * Generate OpenAPI typescript hooks in the target directory\n */\nexport const generateOpenApiTsHooks = (\n tree: Tree,\n data: CodeGenData,\n outputPath: string,\n) => {\n generateFiles(\n tree,\n path.join(import.meta.dirname, 'files'),\n outputPath,\n { ...data, ...esmVars(tree) },\n );\n};\n\nexport default openApiTsHooksGenerator;\n"],"names":["generateFiles","path","formatFilesInSubtree","esmVars","buildOpenApiCodeGenerationData","generateOpenApiTsClient","openApiTsHooksGenerator","tree","options","data","openApiSpecPath","outputPath","generateOpenApiTsHooks","join","dirname"],"mappings":"AAAA;;;CAGC,GACD,SAASA,aAAa,QAAmB,aAAa;AACtD,OAAOC,UAAU,OAAO;AACxB,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,OAAO,QAAQ,+BAA4B;AACpD,SACEC,8BAA8B,EAC9BC,uBAAuB,QAClB,4BAAyB;AAIhC;;CAEC,GACD,OAAO,MAAMC,0BAA0B,OACrCC,MACAC;IAEA,MAAMC,OAAO,MAAML,+BACjBG,MACAC,QAAQE,eAAe;IAGzBL,wBAAwBE,MAAME,MAAMD,QAAQG,UAAU;IACtDC,uBAAuBL,MAAME,MAAMD,QAAQG,UAAU;IAErD,MAAMT,qBAAqBK;AAC7B,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMK,yBAAyB,CACpCL,MACAE,MACAE;IAEAX,cACEO,MACAN,KAAKY,IAAI,CAAC,YAAYC,OAAO,EAAE,UAC/BH,YACA;QAAE,GAAGF,IAAI;QAAE,GAAGN,QAAQI,KAAK;IAAC;AAEhC,EAAE;AAEF,eAAeD,wBAAwB"}
|
|
@@ -334,7 +334,7 @@ exports[`preset generator > should run successfully > package.json 1`] = `
|
|
|
334
334
|
"name": "@proj/source",
|
|
335
335
|
"dependencies": {},
|
|
336
336
|
"devDependencies": {
|
|
337
|
-
"@biomejs/biome": "2.5.
|
|
337
|
+
"@biomejs/biome": "2.5.3",
|
|
338
338
|
"@nx/js": "23.0.1",
|
|
339
339
|
"@nx/workspace": "23.0.1",
|
|
340
340
|
"@swc/helpers": "~0.5.18",
|
|
@@ -29,5 +29,5 @@ export declare const PRESET_GENERATOR_INFO: NxGeneratorInfo;
|
|
|
29
29
|
* isAmazonian(); // false
|
|
30
30
|
*/
|
|
31
31
|
export declare function isAmazonian(): boolean;
|
|
32
|
-
export declare const presetGenerator: (tree: Tree, { iac, gitSecrets, mcp, containers, preferInstallDependencies, }: PresetGeneratorSchema) => Promise<GeneratorCallback>;
|
|
32
|
+
export declare const presetGenerator: (tree: Tree, { iac, gitSecrets, mcp, containers, module, preferInstallDependencies, }: PresetGeneratorSchema) => Promise<GeneratorCallback>;
|
|
33
33
|
export default presetGenerator;
|