@aws/nx-plugin 1.0.0-rc.9 → 1.0.0-rc.90
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 +13999 -17963
- package/README.md +30 -110
- package/executors.json +5 -0
- package/generators.json +170 -10
- package/migrations.json +364 -0
- package/package.json +40 -21
- package/src/agentcore-gateway/__snapshots__/generator.spec.ts.snap +344 -0
- package/src/agentcore-gateway/agent-connection/generator.d.ts +19 -0
- package/src/agentcore-gateway/agent-connection/generator.js +95 -0
- package/src/agentcore-gateway/agent-connection/generator.js.map +1 -0
- package/src/agentcore-gateway/agent-connection/schema.d.js +6 -0
- package/src/agentcore-gateway/agent-connection/schema.d.js.map +1 -0
- package/src/agentcore-gateway/agent-connection/schema.d.ts +13 -0
- package/src/agentcore-gateway/agent-connection/schema.json +31 -0
- package/src/agentcore-gateway/attach-upstream.d.ts +49 -0
- package/src/agentcore-gateway/attach-upstream.js +59 -0
- package/src/agentcore-gateway/attach-upstream.js.map +1 -0
- package/src/agentcore-gateway/files/cedar/policies/README.md +61 -0
- package/src/agentcore-gateway/files/cedar/policies/permit-all.cedar +26 -0
- package/src/agentcore-gateway/files/project/http/local-dev.ts.template +77 -0
- package/src/agentcore-gateway/files/project/mcp/local-dev.ts.template +134 -0
- package/src/agentcore-gateway/gateway-connection/generator.d.ts +21 -0
- package/src/agentcore-gateway/gateway-connection/generator.js +103 -0
- package/src/agentcore-gateway/gateway-connection/generator.js.map +1 -0
- package/src/agentcore-gateway/gateway-connection/schema.d.js +6 -0
- package/src/agentcore-gateway/gateway-connection/schema.d.js.map +1 -0
- package/src/agentcore-gateway/gateway-connection/schema.d.ts +13 -0
- package/src/agentcore-gateway/gateway-connection/schema.json +31 -0
- package/src/agentcore-gateway/generator.d.ts +90 -0
- package/src/agentcore-gateway/generator.js +202 -0
- package/src/agentcore-gateway/generator.js.map +1 -0
- package/src/agentcore-gateway/mcp-connection/generator.d.ts +19 -0
- package/src/agentcore-gateway/mcp-connection/generator.js +61 -0
- package/src/agentcore-gateway/mcp-connection/generator.js.map +1 -0
- package/src/agentcore-gateway/mcp-connection/schema.d.js +6 -0
- package/src/agentcore-gateway/mcp-connection/schema.d.js.map +1 -0
- package/src/agentcore-gateway/mcp-connection/schema.d.ts +13 -0
- package/src/agentcore-gateway/mcp-connection/schema.json +31 -0
- package/src/agentcore-gateway/react-connection/__snapshots__/generator.spec.ts.snap +68 -0
- package/src/agentcore-gateway/react-connection/generator.d.ts +19 -0
- package/src/agentcore-gateway/react-connection/generator.js +119 -0
- package/src/agentcore-gateway/react-connection/generator.js.map +1 -0
- package/src/agentcore-gateway/react-connection/schema.d.js +6 -0
- package/src/agentcore-gateway/react-connection/schema.d.js.map +1 -0
- package/src/agentcore-gateway/react-connection/schema.d.ts +13 -0
- package/src/agentcore-gateway/react-connection/schema.json +31 -0
- package/src/agentcore-gateway/schema.d.js +6 -0
- package/src/agentcore-gateway/schema.d.js.map +1 -0
- package/src/agentcore-gateway/schema.d.ts +17 -0
- package/src/agentcore-gateway/schema.json +72 -0
- package/src/agentcore-harness/__snapshots__/generator.spec.ts.snap +237 -0
- package/src/agentcore-harness/files/project/README.md.template +82 -0
- package/src/agentcore-harness/files/project/scripts/chat.ts.template +99 -0
- package/src/agentcore-harness/files/project/src/PROMPT.md.template +16 -0
- package/src/agentcore-harness/generator.d.ts +62 -0
- package/src/agentcore-harness/generator.js +158 -0
- package/src/agentcore-harness/generator.js.map +1 -0
- package/src/agentcore-harness/schema.d.js +8 -0
- package/src/agentcore-harness/schema.d.js.map +1 -0
- package/src/agentcore-harness/schema.d.ts +17 -0
- package/src/agentcore-harness/schema.json +53 -0
- package/src/connection/agent-local-dev.d.ts +49 -0
- package/src/connection/agent-local-dev.js +84 -0
- package/src/connection/agent-local-dev.js.map +1 -0
- package/src/connection/agent-runtime-config.js +9 -14
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/gateway-runtime-config.d.ts +19 -0
- package/src/connection/gateway-runtime-config.js +47 -0
- package/src/connection/gateway-runtime-config.js.map +1 -0
- package/src/connection/generator.d.ts +4 -11
- package/src/connection/generator.js +172 -194
- package/src/connection/generator.js.map +1 -1
- package/src/connection/{serve-local.d.ts → local-dev.d.ts} +3 -3
- package/src/connection/local-dev.js +37 -0
- package/src/connection/local-dev.js.map +1 -0
- package/src/connection/scaffold-catalog.d.ts +267 -0
- package/src/connection/scaffold-catalog.js +347 -0
- package/src/connection/scaffold-catalog.js.map +1 -0
- package/src/connection/schema-resolver.d.ts +5 -0
- package/src/connection/schema-resolver.js +27 -0
- package/src/connection/schema-resolver.js.map +1 -0
- package/src/connection/schema.d.js +6 -0
- package/src/connection/schema.d.js.map +1 -0
- package/src/connection/schema.d.ts +1 -0
- package/src/connection/schema.json +5 -0
- package/src/connection/supported-connections.d.ts +116 -0
- package/src/connection/supported-connections.js +163 -0
- package/src/connection/supported-connections.js.map +1 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -5
- package/src/index.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +172 -87
- package/src/infra/app/files/app/README.md.template +22 -4
- package/src/infra/app/files/app/src/main.ts.template +5 -1
- package/src/infra/app/files/app/src/stages/application-stage.ts.template +1 -1
- package/src/infra/app/generator.d.ts +44 -1
- package/src/infra/app/generator.js +209 -128
- package/src/infra/app/generator.js.map +1 -1
- package/src/infra/app/schema.d.js +6 -0
- package/src/infra/app/schema.d.js.map +1 -0
- package/src/infra/app/schema.d.ts +1 -1
- package/src/infra/app/schema.json +5 -0
- package/src/init/generator.d.ts +31 -0
- package/src/init/generator.js +46 -0
- package/src/init/generator.js.map +1 -0
- package/src/init/schema.d.js +6 -0
- package/src/init/schema.d.js.map +1 -0
- package/src/init/schema.d.ts +16 -0
- package/src/init/schema.json +35 -0
- package/src/internal/test-matrix/generator.d.ts +29 -0
- package/src/internal/test-matrix/generator.js +729 -0
- package/src/internal/test-matrix/generator.js.map +1 -0
- package/src/internal/test-matrix/schema.d.js +6 -0
- package/src/internal/test-matrix/schema.d.js.map +1 -0
- package/src/internal/test-matrix/schema.d.ts +12 -0
- package/src/internal/test-matrix/schema.json +21 -0
- package/src/license/config-types.d.ts +2 -2
- package/src/license/config-types.js +5 -3
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +12 -3
- package/src/license/config.js +295 -242
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/check.d.ts +2 -2
- package/src/license/dependency-check/check.js +51 -46
- package/src/license/dependency-check/check.js.map +1 -1
- package/src/license/dependency-check/collectors/collector.js +41 -71
- package/src/license/dependency-check/collectors/collector.js.map +1 -1
- package/src/license/dependency-check/collectors/npm-collector.js +34 -41
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -1
- package/src/license/dependency-check/collectors/python-collector.js +61 -62
- package/src/license/dependency-check/collectors/python-collector.js.map +1 -1
- package/src/license/dependency-check/evaluator.d.ts +1 -1
- package/src/license/dependency-check/evaluator.js +91 -74
- package/src/license/dependency-check/evaluator.js.map +1 -1
- package/src/license/dependency-check/executor.js +30 -22
- package/src/license/dependency-check/executor.js.map +1 -1
- package/src/license/dependency-check/pre-approved.d.ts +1 -1
- package/src/license/dependency-check/pre-approved.js +949 -336
- package/src/license/dependency-check/pre-approved.js.map +1 -1
- package/src/license/dependency-check/types.d.ts +1 -1
- package/src/license/dependency-check/types.js +2 -3
- package/src/license/dependency-check/types.js.map +1 -1
- package/src/license/generator.d.ts +1 -1
- package/src/license/generator.js +60 -77
- package/src/license/generator.js.map +1 -1
- package/src/license/index.d.ts +4 -4
- package/src/license/index.js +3 -9
- package/src/license/index.js.map +1 -1
- package/src/license/known-exceptions.d.ts +2 -3
- package/src/license/known-exceptions.js +12 -28
- package/src/license/known-exceptions.js.map +1 -1
- package/src/license/schema.d.js +6 -0
- package/src/license/schema.d.js.map +1 -0
- package/src/license/schema.d.ts +2 -0
- package/src/license/schema.json +5 -0
- package/src/license/sync/generator.js +94 -119
- package/src/license/sync/generator.js.map +1 -1
- package/src/license/sync/project-file-sync.d.ts +1 -1
- package/src/license/sync/project-file-sync.js +28 -35
- package/src/license/sync/project-file-sync.js.map +1 -1
- package/src/mcp-server/dev-server.d.ts +1 -0
- package/src/mcp-server/dev-server.js +18 -0
- package/src/mcp-server/dev-server.js.map +1 -0
- package/src/mcp-server/generator-info.d.ts +8 -3
- package/src/mcp-server/generator-info.js +155 -167
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/guide-pipeline.d.ts +1 -1
- package/src/mcp-server/guide-pipeline.js +199 -206
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/guide-render.js +10 -25
- package/src/mcp-server/guide-render.js.map +1 -1
- package/src/mcp-server/index.js +6 -10
- package/src/mcp-server/index.js.map +1 -1
- package/src/mcp-server/mdx-ast.js +39 -57
- package/src/mcp-server/mdx-ast.js.map +1 -1
- package/src/mcp-server/option-filter.js +33 -47
- package/src/mcp-server/option-filter.js.map +1 -1
- package/src/mcp-server/schema-registry.d.ts +9 -3
- package/src/mcp-server/schema-registry.js +41 -38
- package/src/mcp-server/schema-registry.js.map +1 -1
- package/src/mcp-server/schema.d.ts +1 -1
- package/src/mcp-server/schema.js +9 -7
- package/src/mcp-server/schema.js.map +1 -1
- package/src/mcp-server/server.js +24 -24
- package/src/mcp-server/server.js.map +1 -1
- package/src/mcp-server/tools/add-to-existing-project.d.ts +12 -0
- package/src/mcp-server/tools/add-to-existing-project.js +36 -0
- package/src/mcp-server/tools/add-to-existing-project.js.map +1 -0
- package/src/mcp-server/tools/create-workspace-command.js +23 -24
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/general-guidance.d.ts +2 -2
- package/src/mcp-server/tools/general-guidance.js +55 -32
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.d.ts +1 -1
- package/src/mcp-server/tools/generator-guide.js +29 -37
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/mcp-server/tools/list-generators.d.ts +1 -1
- package/src/mcp-server/tools/list-generators.js +19 -25
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/mcp-server/tools/upgrade-workspace.d.ts +11 -0
- package/src/mcp-server/tools/upgrade-workspace.js +32 -0
- package/src/mcp-server/tools/upgrade-workspace.js.map +1 -0
- package/src/migrations/latest/add-assemble-target/metadata.json +3 -0
- package/src/migrations/latest/add-assemble-target/migration.d.ts +6 -0
- package/src/migrations/latest/add-assemble-target/migration.js +241 -0
- package/src/migrations/latest/add-assemble-target/migration.js.map +1 -0
- package/src/migrations/latest/add-destroy-sandbox-target/metadata.json +3 -0
- package/src/migrations/latest/add-destroy-sandbox-target/migration.d.ts +6 -0
- package/src/migrations/latest/add-destroy-sandbox-target/migration.js +150 -0
- package/src/migrations/latest/add-destroy-sandbox-target/migration.js.map +1 -0
- package/src/migrations/latest/declare-cacheable-target-inputs/metadata.json +3 -0
- package/src/migrations/latest/declare-cacheable-target-inputs/migration.d.ts +6 -0
- package/src/migrations/latest/declare-cacheable-target-inputs/migration.js +94 -0
- package/src/migrations/latest/declare-cacheable-target-inputs/migration.js.map +1 -0
- package/src/migrations/latest/dev-target-depends-on-pull-image/metadata.json +3 -0
- package/src/migrations/latest/dev-target-depends-on-pull-image/migration.d.ts +6 -0
- package/src/migrations/latest/dev-target-depends-on-pull-image/migration.js +67 -0
- package/src/migrations/latest/dev-target-depends-on-pull-image/migration.js.map +1 -0
- package/src/migrations/latest/docker-target-cache-soundness/metadata.json +3 -0
- package/src/migrations/latest/docker-target-cache-soundness/migration.d.ts +6 -0
- package/src/migrations/latest/docker-target-cache-soundness/migration.js +95 -0
- package/src/migrations/latest/docker-target-cache-soundness/migration.js.map +1 -0
- package/src/migrations/latest/nx-parallel-default/metadata.json +3 -0
- package/src/migrations/latest/nx-parallel-default/migration.d.ts +14 -0
- package/src/migrations/latest/nx-parallel-default/migration.js +29 -0
- package/src/migrations/latest/nx-parallel-default/migration.js.map +1 -0
- package/src/migrations/latest/open-api-codegen-executor/metadata.json +3 -0
- package/src/migrations/latest/open-api-codegen-executor/migration.d.ts +6 -0
- package/src/migrations/latest/open-api-codegen-executor/migration.js +100 -0
- package/src/migrations/latest/open-api-codegen-executor/migration.js.map +1 -0
- package/src/migrations/latest/python-test-input-scoping/metadata.json +3 -0
- package/src/migrations/latest/python-test-input-scoping/migration.d.ts +6 -0
- package/src/migrations/latest/python-test-input-scoping/migration.js +142 -0
- package/src/migrations/latest/python-test-input-scoping/migration.js.map +1 -0
- package/src/migrations/latest/python-version-drop-exact-patch/metadata.json +3 -0
- package/src/migrations/latest/python-version-drop-exact-patch/migration.d.ts +6 -0
- package/src/migrations/latest/python-version-drop-exact-patch/migration.js +43 -0
- package/src/migrations/latest/python-version-drop-exact-patch/migration.js.map +1 -0
- package/src/migrations/latest/react-website-nx-react-express-override/metadata.json +3 -0
- package/src/migrations/latest/react-website-nx-react-express-override/migration.d.ts +31 -0
- package/src/migrations/latest/react-website-nx-react-express-override/migration.js +74 -0
- package/src/migrations/latest/react-website-nx-react-express-override/migration.js.map +1 -0
- package/src/migrations/latest/terraform-fmt-check/metadata.json +3 -0
- package/src/migrations/latest/terraform-fmt-check/migration.d.ts +6 -0
- package/src/migrations/latest/terraform-fmt-check/migration.js +165 -0
- package/src/migrations/latest/terraform-fmt-check/migration.js.map +1 -0
- package/src/migrations/latest/terraform-provider-plugin-cache/metadata.json +3 -0
- package/src/migrations/latest/terraform-provider-plugin-cache/migration.d.ts +6 -0
- package/src/migrations/latest/terraform-provider-plugin-cache/migration.js +164 -0
- package/src/migrations/latest/terraform-provider-plugin-cache/migration.js.map +1 -0
- package/src/migrations/latest/terraform-rdb-proxy-iam-connect-grant/__snapshots__/migration.spec.ts.snap +23 -0
- package/src/migrations/latest/terraform-rdb-proxy-iam-connect-grant/metadata.json +3 -0
- package/src/migrations/latest/terraform-rdb-proxy-iam-connect-grant/migration.d.ts +6 -0
- package/src/migrations/latest/terraform-rdb-proxy-iam-connect-grant/migration.js +88 -0
- package/src/migrations/latest/terraform-rdb-proxy-iam-connect-grant/migration.js.map +1 -0
- package/src/migrations/latest/vitest-coverage-output-dir/metadata.json +3 -0
- package/src/migrations/latest/vitest-coverage-output-dir/migration.d.ts +6 -0
- package/src/migrations/latest/vitest-coverage-output-dir/migration.js +177 -0
- package/src/migrations/latest/vitest-coverage-output-dir/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.50/0001-modernize-function-props-cast/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.50/0001-modernize-function-props-cast/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.50/0001-modernize-function-props-cast/migration.js +65 -0
- package/src/migrations/v1.0.0-rc.50/0001-modernize-function-props-cast/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.50/0002-restrict-cors-to-custom-domains/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.50/0002-restrict-cors-to-custom-domains/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.50/0002-restrict-cors-to-custom-domains/migration.js +108 -0
- package/src/migrations/v1.0.0-rc.50/0002-restrict-cors-to-custom-domains/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.50/0003-terraform-bootstrap-adopt-existing-bucket/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.50/0003-terraform-bootstrap-adopt-existing-bucket/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.50/0003-terraform-bootstrap-adopt-existing-bucket/migration.js +128 -0
- package/src/migrations/v1.0.0-rc.50/0003-terraform-bootstrap-adopt-existing-bucket/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.52/0001-user-identity-waf-allow-localhost-callback/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.52/0001-user-identity-waf-allow-localhost-callback/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.52/0001-user-identity-waf-allow-localhost-callback/migration.js +215 -0
- package/src/migrations/v1.0.0-rc.52/0001-user-identity-waf-allow-localhost-callback/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.54/0001-order-access-log-delivery-after-bucket-policy/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.54/0001-order-access-log-delivery-after-bucket-policy/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.54/0001-order-access-log-delivery-after-bucket-policy/migration.js +93 -0
- package/src/migrations/v1.0.0-rc.54/0001-order-access-log-delivery-after-bucket-policy/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.55/0001-backfill-generator-metadata/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.55/0001-backfill-generator-metadata/migration.d.ts +96 -0
- package/src/migrations/v1.0.0-rc.55/0001-backfill-generator-metadata/migration.js +670 -0
- package/src/migrations/v1.0.0-rc.55/0001-backfill-generator-metadata/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.56/0001-dynamodb-local-remove-optimize-flag/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.56/0001-dynamodb-local-remove-optimize-flag/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.56/0001-dynamodb-local-remove-optimize-flag/migration.js +89 -0
- package/src/migrations/v1.0.0-rc.56/0001-dynamodb-local-remove-optimize-flag/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.57/0001-ts-agent-session-management-support/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.57/0001-ts-agent-session-management-support/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.57/0001-ts-agent-session-management-support/migration.js +449 -0
- package/src/migrations/v1.0.0-rc.57/0001-ts-agent-session-management-support/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.58/0001-smithy-ssdk-bundle-pins/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.58/0001-smithy-ssdk-bundle-pins/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.58/0001-smithy-ssdk-bundle-pins/migration.js +78 -0
- package/src/migrations/v1.0.0-rc.58/0001-smithy-ssdk-bundle-pins/migration.js.map +1 -0
- package/src/{smithy/project/files/build.Dockerfile.template → migrations/v1.0.0-rc.58/0001-smithy-ssdk-bundle-pins/rc57-service.Dockerfile.fixture} +1 -4
- package/src/migrations/v1.0.0-rc.59/0001-gateway-agent-targets/__snapshots__/migration.spec.ts.snap +223 -0
- package/src/migrations/v1.0.0-rc.59/0001-gateway-agent-targets/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.59/0001-gateway-agent-targets/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.59/0001-gateway-agent-targets/migration.js +217 -0
- package/src/migrations/v1.0.0-rc.59/0001-gateway-agent-targets/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.60/0001-gateway-cognito-passthrough/__snapshots__/migration.spec.ts.snap +149 -0
- package/src/migrations/v1.0.0-rc.60/0001-gateway-cognito-passthrough/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.60/0001-gateway-cognito-passthrough/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.60/0001-gateway-cognito-passthrough/migration.js +195 -0
- package/src/migrations/v1.0.0-rc.60/0001-gateway-cognito-passthrough/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.60/0002-waf-log-group-removal/__snapshots__/migration.spec.ts.snap +57 -0
- package/src/migrations/v1.0.0-rc.60/0002-waf-log-group-removal/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.60/0002-waf-log-group-removal/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.60/0002-waf-log-group-removal/migration.js +77 -0
- package/src/migrations/v1.0.0-rc.60/0002-waf-log-group-removal/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.60/0003-strip-pip-from-python-images/__snapshots__/migration.spec.ts.snap +48 -0
- package/src/migrations/v1.0.0-rc.60/0003-strip-pip-from-python-images/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.60/0003-strip-pip-from-python-images/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.60/0003-strip-pip-from-python-images/migration.js +91 -0
- package/src/migrations/v1.0.0-rc.60/0003-strip-pip-from-python-images/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.61/0001-py-agent-lifespan-construction/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.61/0001-py-agent-lifespan-construction/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.61/0001-py-agent-lifespan-construction/migration.js +412 -0
- package/src/migrations/v1.0.0-rc.61/0001-py-agent-lifespan-construction/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.62/0001-rename-load-runtime-config-target/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.62/0001-rename-load-runtime-config-target/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.62/0001-rename-load-runtime-config-target/migration.js +33 -0
- package/src/migrations/v1.0.0-rc.62/0001-rename-load-runtime-config-target/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.63/0001-add-deploy-sandbox-target/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.63/0001-add-deploy-sandbox-target/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.63/0001-add-deploy-sandbox-target/migration.js +83 -0
- package/src/migrations/v1.0.0-rc.63/0001-add-deploy-sandbox-target/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.64/0001-smithy-build-without-docker/legacy-service.Dockerfile.fixture +95 -0
- package/src/migrations/v1.0.0-rc.64/0001-smithy-build-without-docker/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.64/0001-smithy-build-without-docker/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.64/0001-smithy-build-without-docker/migration.js +154 -0
- package/src/migrations/v1.0.0-rc.64/0001-smithy-build-without-docker/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.65/0001-vite-config-import-meta-dirname/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.65/0001-vite-config-import-meta-dirname/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.65/0001-vite-config-import-meta-dirname/migration.js +71 -0
- package/src/migrations/v1.0.0-rc.65/0001-vite-config-import-meta-dirname/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.65/0002-rolldown-code-splitting/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.65/0002-rolldown-code-splitting/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.65/0002-rolldown-code-splitting/migration.js +57 -0
- package/src/migrations/v1.0.0-rc.65/0002-rolldown-code-splitting/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.67/0001-smithy-server-package-rename/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.67/0001-smithy-server-package-rename/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.67/0001-smithy-server-package-rename/migration.js +123 -0
- package/src/migrations/v1.0.0-rc.67/0001-smithy-server-package-rename/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/build-system-prompt.ts.fixture +23 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/build-user-prompt.ts.fixture +96 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/config-path.ts.fixture +1 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/file-to-translate.ts.fixture +10 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/get-files-to-translate.ts.fixture +96 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/header.ts.fixture +15 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/log.ts.fixture +18 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/main-call.ts.fixture +6 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/main.ts.fixture +79 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/project-root.ts.fixture +1 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/run-with-concurrency.ts.fixture +57 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/scripts-dir.ts.fixture +1 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/files/translate-file-for-language.ts.fixture +61 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/already-migrated.grit +1 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/build-system-prompt.grit +6 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/build-user-prompt.grit +6 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/config-path.grit +1 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/file-to-translate.grit +11 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/get-files-to-translate.grit +7 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/log.grit +3 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/main-call.grit +1 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/main.grit +8 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/project-root.grit +1 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/run-with-concurrency.grit +6 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/grit/translate-file-for-language.grit +6 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/migration.d.ts +2 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/migration.js +103 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/test-fixtures/released-script-first.ts.fixture +430 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/test-fixtures/released-script.ts.fixture +431 -0
- package/src/migrations/v1.0.0-rc.70/0001-py-agent-a2a-lifespan-construction/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.70/0001-py-agent-a2a-lifespan-construction/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.70/0001-py-agent-a2a-lifespan-construction/migration.js +246 -0
- package/src/migrations/v1.0.0-rc.70/0001-py-agent-a2a-lifespan-construction/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.71/0001-py-agent-a2a-httpx-client-per-call/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.71/0001-py-agent-a2a-httpx-client-per-call/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.71/0001-py-agent-a2a-httpx-client-per-call/migration.js +329 -0
- package/src/migrations/v1.0.0-rc.71/0001-py-agent-a2a-httpx-client-per-call/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.72/0001-py-agent-session-management-support/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.72/0001-py-agent-session-management-support/migration.d.ts +2 -0
- package/src/migrations/v1.0.0-rc.72/0001-py-agent-session-management-support/migration.js +308 -0
- package/src/migrations/v1.0.0-rc.72/0001-py-agent-session-management-support/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.73/0001-remove-mcp-inspector-license-exceptions/metadata.json +3 -0
- package/{sdk/utils/ast.d.ts → src/migrations/v1.0.0-rc.73/0001-remove-mcp-inspector-license-exceptions/migration.d.ts} +2 -2
- package/src/migrations/v1.0.0-rc.73/0001-remove-mcp-inspector-license-exceptions/migration.js +38 -0
- package/src/migrations/v1.0.0-rc.73/0001-remove-mcp-inspector-license-exceptions/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.73/0002-apt-security-updates-in-container-images/__snapshots__/migration.spec.ts.snap +90 -0
- package/src/migrations/v1.0.0-rc.73/0002-apt-security-updates-in-container-images/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.73/0002-apt-security-updates-in-container-images/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.73/0002-apt-security-updates-in-container-images/migration.js +90 -0
- package/src/migrations/v1.0.0-rc.73/0002-apt-security-updates-in-container-images/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.74/0001-py-agent-session-id-middleware-extraction/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.74/0001-py-agent-session-id-middleware-extraction/migration.d.ts +2 -0
- package/src/migrations/v1.0.0-rc.74/0001-py-agent-session-id-middleware-extraction/migration.js +118 -0
- package/src/migrations/v1.0.0-rc.74/0001-py-agent-session-id-middleware-extraction/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.75/0001-ts-agent-session-id-middleware-extraction/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.75/0001-ts-agent-session-id-middleware-extraction/migration.d.ts +2 -0
- package/src/migrations/v1.0.0-rc.75/0001-ts-agent-session-id-middleware-extraction/migration.js +136 -0
- package/src/migrations/v1.0.0-rc.75/0001-ts-agent-session-id-middleware-extraction/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.77/0001-dynamodb-configurable-encryption/__snapshots__/migration.spec.ts.snap +429 -0
- package/src/migrations/v1.0.0-rc.77/0001-dynamodb-configurable-encryption/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.77/0001-dynamodb-configurable-encryption/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.77/0001-dynamodb-configurable-encryption/migration.js +325 -0
- package/src/migrations/v1.0.0-rc.77/0001-dynamodb-configurable-encryption/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.77/0002-user-identity-configurable-mfa/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.77/0002-user-identity-configurable-mfa/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.77/0002-user-identity-configurable-mfa/migration.js +362 -0
- package/src/migrations/v1.0.0-rc.77/0002-user-identity-configurable-mfa/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.78/0001-static-website-configurable-waf-encryption/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.78/0001-static-website-configurable-waf-encryption/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.78/0001-static-website-configurable-waf-encryption/migration.js +418 -0
- package/src/migrations/v1.0.0-rc.78/0001-static-website-configurable-waf-encryption/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.79/0001-py-agent-ag-ui-hooks/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.79/0001-py-agent-ag-ui-hooks/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.79/0001-py-agent-ag-ui-hooks/migration.js +113 -0
- package/src/migrations/v1.0.0-rc.79/0001-py-agent-ag-ui-hooks/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.82/0001-terraform-load-runtime-config-src-path/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.82/0001-terraform-load-runtime-config-src-path/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.82/0001-terraform-load-runtime-config-src-path/migration.js +48 -0
- package/src/migrations/v1.0.0-rc.82/0001-terraform-load-runtime-config-src-path/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.82/0002-runtime-config-namespace-defaults/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.82/0002-runtime-config-namespace-defaults/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.82/0002-runtime-config-namespace-defaults/migration.js +131 -0
- package/src/migrations/v1.0.0-rc.82/0002-runtime-config-namespace-defaults/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.83/0001-dynamodb-terraform-app-module-outputs/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.83/0001-dynamodb-terraform-app-module-outputs/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.83/0001-dynamodb-terraform-app-module-outputs/migration.js +69 -0
- package/src/migrations/v1.0.0-rc.83/0001-dynamodb-terraform-app-module-outputs/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.83/0002-terraform-data-resource-destroy-protection/__snapshots__/migration.spec.ts.snap +75 -0
- package/src/migrations/v1.0.0-rc.83/0002-terraform-data-resource-destroy-protection/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.83/0002-terraform-data-resource-destroy-protection/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.83/0002-terraform-data-resource-destroy-protection/migration.js +78 -0
- package/src/migrations/v1.0.0-rc.83/0002-terraform-data-resource-destroy-protection/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.83/0003-terraform-gateway-cedar-render-root-ejs/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.83/0003-terraform-gateway-cedar-render-root-ejs/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.83/0003-terraform-gateway-cedar-render-root-ejs/migration.js +38 -0
- package/src/migrations/v1.0.0-rc.83/0003-terraform-gateway-cedar-render-root-ejs/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.84/0001-rdb-terraform-aurora-app-module-defaults/__snapshots__/migration.spec.ts.snap +54 -0
- package/src/migrations/v1.0.0-rc.84/0001-rdb-terraform-aurora-app-module-defaults/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.84/0001-rdb-terraform-aurora-app-module-defaults/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.84/0001-rdb-terraform-aurora-app-module-defaults/migration.js +86 -0
- package/src/migrations/v1.0.0-rc.84/0001-rdb-terraform-aurora-app-module-defaults/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.84/0002-agentcore-harness-no-tools-by-default/__snapshots__/migration.spec.ts.snap +79 -0
- package/src/migrations/v1.0.0-rc.84/0002-agentcore-harness-no-tools-by-default/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.84/0002-agentcore-harness-no-tools-by-default/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.84/0002-agentcore-harness-no-tools-by-default/migration.js +87 -0
- package/src/migrations/v1.0.0-rc.84/0002-agentcore-harness-no-tools-by-default/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.84/0003-terraform-declare-used-providers/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.84/0003-terraform-declare-used-providers/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.84/0003-terraform-declare-used-providers/migration.js +147 -0
- package/src/migrations/v1.0.0-rc.84/0003-terraform-declare-used-providers/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.84/0004-waf-log-group-cmk-encryption/__snapshots__/migration.spec.ts.snap +286 -0
- package/src/migrations/v1.0.0-rc.84/0004-waf-log-group-cmk-encryption/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.84/0004-waf-log-group-cmk-encryption/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.84/0004-waf-log-group-cmk-encryption/migration.js +238 -0
- package/src/migrations/v1.0.0-rc.84/0004-waf-log-group-cmk-encryption/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.84/0005-terraform-harness-vpc-role-and-memory-grant/__snapshots__/migration.spec.ts.snap +521 -0
- package/src/migrations/v1.0.0-rc.84/0005-terraform-harness-vpc-role-and-memory-grant/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.84/0005-terraform-harness-vpc-role-and-memory-grant/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.84/0005-terraform-harness-vpc-role-and-memory-grant/migration.js +504 -0
- package/src/migrations/v1.0.0-rc.84/0005-terraform-harness-vpc-role-and-memory-grant/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.85/0001-terraform-project-checkov-target-and-bootstrap-destroy/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.85/0001-terraform-project-checkov-target-and-bootstrap-destroy/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.85/0001-terraform-project-checkov-target-and-bootstrap-destroy/migration.js +146 -0
- package/src/migrations/v1.0.0-rc.85/0001-terraform-project-checkov-target-and-bootstrap-destroy/migration.js.map +1 -0
- package/src/open-api/codegen/executor-schema.d.js +6 -0
- package/src/open-api/codegen/executor-schema.d.js.map +1 -0
- package/src/open-api/codegen/executor-schema.d.ts +18 -0
- package/src/open-api/codegen/executor-schema.json +33 -0
- package/src/open-api/codegen/executor.d.ts +18 -0
- package/src/open-api/codegen/executor.js +56 -0
- package/src/open-api/codegen/executor.js.map +1 -0
- package/src/open-api/json-metadata/generator.d.ts +24 -0
- package/src/open-api/json-metadata/generator.js +37 -0
- package/src/open-api/json-metadata/generator.js.map +1 -0
- package/src/open-api/json-metadata/schema.d.js +6 -0
- package/src/open-api/json-metadata/schema.d.js.map +1 -0
- package/src/open-api/json-metadata/schema.d.ts +9 -0
- package/src/open-api/json-metadata/schema.json +20 -0
- package/src/open-api/ts-client/__snapshots__/generator.additional-properties.spec.ts.snap +147 -33
- package/src/open-api/ts-client/__snapshots__/generator.arrays.spec.ts.snap +308 -75
- package/src/open-api/ts-client/__snapshots__/generator.complex-types.spec.ts.snap +298 -74
- package/src/open-api/ts-client/__snapshots__/generator.composite-types.spec.ts.snap +748 -103
- package/src/open-api/ts-client/__snapshots__/generator.content-type.spec.ts.snap +230 -37
- package/src/open-api/ts-client/__snapshots__/generator.duplicate-types.spec.ts.snap +249 -52
- package/src/open-api/ts-client/__snapshots__/generator.edge-cases.spec.ts.snap +5535 -0
- package/src/open-api/ts-client/__snapshots__/generator.fast-api-gaps.spec.ts.snap +736 -0
- package/src/open-api/ts-client/__snapshots__/generator.fast-api.spec.ts.snap +305 -71
- package/src/open-api/ts-client/__snapshots__/generator.multipart.spec.ts.snap +298 -0
- package/src/open-api/ts-client/__snapshots__/generator.primitive-types.spec.ts.snap +353 -82
- package/src/open-api/ts-client/__snapshots__/generator.request.spec.ts.snap +176 -55
- package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +100 -24
- package/src/open-api/ts-client/__snapshots__/generator.response.spec.ts.snap +147 -33
- package/src/open-api/ts-client/__snapshots__/generator.spec-compliance.spec.ts.snap +1883 -0
- package/src/open-api/ts-client/__snapshots__/generator.streaming.spec.ts.snap +392 -88
- package/src/open-api/ts-client/__snapshots__/generator.tags.spec.ts.snap +200 -48
- package/src/open-api/ts-client/files/client.gen.ts.template +358 -24
- package/src/open-api/ts-client/files/types.gen.ts.template +6 -4
- package/src/open-api/ts-client/generator.d.ts +1 -1
- package/src/open-api/ts-client/generator.js +41 -26
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-client/schema.d.js +6 -0
- package/src/open-api/ts-client/schema.d.js.map +1 -0
- package/src/open-api/ts-hooks/files/options-proxy.gen.ts.template +7 -2
- package/src/open-api/ts-hooks/generator.d.ts +1 -1
- package/src/open-api/ts-hooks/generator.js +17 -21
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.spec.tsx +76 -6
- package/src/open-api/ts-hooks/schema.d.js +6 -0
- package/src/open-api/ts-hooks/schema.d.js.map +1 -0
- package/src/open-api/ts-metadata/generator.d.ts +1 -1
- package/src/open-api/ts-metadata/generator.js +12 -20
- package/src/open-api/ts-metadata/generator.js.map +1 -1
- package/src/open-api/ts-metadata/schema.d.js +6 -0
- package/src/open-api/ts-metadata/schema.d.js.map +1 -0
- package/src/open-api/utils/codegen-data/languages.d.ts +1 -7
- package/src/open-api/utils/codegen-data/languages.js +59 -66
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data/types.d.ts +255 -10
- package/src/open-api/utils/codegen-data/types.js +54 -30
- package/src/open-api/utils/codegen-data/types.js.map +1 -1
- package/src/open-api/utils/codegen-data.d.ts +4 -4
- package/src/open-api/utils/codegen-data.js +494 -674
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.d.ts +1 -1
- package/src/open-api/utils/normalise.js +437 -246
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parse.d.ts +1 -1
- package/src/open-api/utils/parse.js +8 -14
- package/src/open-api/utils/parse.js.map +1 -1
- package/src/open-api/utils/parser.d.ts +55 -0
- package/src/open-api/utils/parser.js +787 -0
- package/src/open-api/utils/parser.js.map +1 -0
- package/src/open-api/utils/refs.d.ts +1 -1
- package/src/open-api/utils/refs.js +12 -22
- package/src/open-api/utils/refs.js.map +1 -1
- package/src/open-api/utils/types.d.ts +18 -0
- package/src/open-api/utils/types.js +5 -2
- package/src/open-api/utils/types.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +104 -21
- package/src/preset/generator.d.ts +15 -2
- package/src/preset/generator.js +76 -151
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.js +6 -0
- package/src/preset/schema.d.js.map +1 -0
- package/src/preset/schema.d.ts +6 -3
- package/src/preset/schema.json +16 -5
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +931 -0
- package/src/py/agent/__snapshots__/generator.core.spec.ts.snap +186 -0
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +771 -0
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +1322 -0
- package/src/py/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +231 -0
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client_strands.py.template +29 -0
- package/src/py/agent/a2a-connection/files/langchain/agent-connection/app/__targetAgentSnakeCase___client_langchain.py.template +29 -0
- package/src/py/agent/a2a-connection/generator.d.ts +25 -1
- package/src/py/agent/a2a-connection/generator.js +146 -95
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/a2a-connection/schema.d.js +8 -0
- package/src/py/agent/a2a-connection/schema.d.js.map +1 -0
- package/src/py/agent/a2a-connection/schema.d.ts +2 -1
- package/src/py/agent/a2a-connection/schema.json +5 -0
- package/src/py/agent/files/deploy/Dockerfile.template +15 -1
- package/src/py/agent/files/langchain/a2a/main.py.template +83 -0
- package/src/py/agent/files/langchain/ag-ui/main.py.template +76 -0
- package/src/py/agent/files/langchain/common/agent.py.template +30 -0
- package/src/py/agent/files/langchain/common/middleware/__init__.py.template +0 -0
- package/src/py/agent/files/langchain/common/middleware/session_id_middleware.py.template +17 -0
- package/src/py/agent/files/langchain/common/session.py.template +61 -0
- package/src/py/agent/files/{http → langchain/http}/init.py.template +17 -25
- package/src/py/agent/files/langchain/http/main.py.template +69 -0
- package/src/py/agent/files/strands/a2a/main.py.template +61 -0
- package/src/py/agent/files/strands/ag-ui/main.py.template +86 -0
- package/src/py/agent/files/strands/common/__init__.py.template +0 -0
- package/src/py/agent/files/{common → strands/common}/agent.py.template +13 -2
- package/src/py/agent/files/strands/common/middleware/__init__.py.template +0 -0
- package/src/py/agent/files/strands/common/middleware/session_id_middleware.py.template +17 -0
- package/src/py/agent/files/strands/common/session.py.template +36 -0
- package/src/py/agent/files/strands/http/init.py.template +97 -0
- package/src/py/agent/files/{http → strands/http}/main.py.template +5 -29
- package/src/py/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +184 -0
- package/src/py/agent/gateway-connection/files/agent-connection/app/__gatewaySnakeCase___client_strands.py.template +35 -0
- package/src/py/agent/gateway-connection/files/langchain/agent-connection/app/__gatewaySnakeCase___client_langchain.py.template +34 -0
- package/src/py/agent/gateway-connection/generator.d.ts +33 -0
- package/src/py/agent/gateway-connection/generator.js +153 -0
- package/src/py/agent/gateway-connection/generator.js.map +1 -0
- package/src/py/agent/gateway-connection/schema.d.js +6 -0
- package/src/py/agent/gateway-connection/schema.d.js.map +1 -0
- package/src/py/agent/gateway-connection/schema.d.ts +13 -0
- package/src/py/agent/gateway-connection/schema.json +31 -0
- package/src/py/agent/generator.d.ts +165 -2
- package/src/py/agent/generator.js +445 -199
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +155 -92
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client_strands.py.template +31 -0
- package/src/py/agent/mcp-connection/files/langchain/agent-connection/app/__mcpServerSnakeCase___client_langchain.py.template +31 -0
- package/src/py/agent/mcp-connection/generator.d.ts +24 -1
- package/src/py/agent/mcp-connection/generator.js +103 -130
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/schema.d.js +8 -0
- package/src/py/agent/mcp-connection/schema.d.js.map +1 -0
- package/src/py/agent/mcp-connection/schema.d.ts +2 -1
- package/src/py/agent/mcp-connection/schema.json +5 -0
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +17 -19
- package/src/py/agent/react-connection/generator.d.ts +152 -3
- package/src/py/agent/react-connection/generator.js +114 -65
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/{serve-local.d.ts → local-dev.d.ts} +5 -5
- package/src/py/agent/react-connection/local-dev.js +36 -0
- package/src/py/agent/react-connection/local-dev.js.map +1 -0
- package/src/py/agent/react-connection/schema.d.js +8 -0
- package/src/py/agent/react-connection/schema.d.js.map +1 -0
- package/src/py/agent/react-connection/schema.d.ts +2 -1
- package/src/py/agent/react-connection/schema.json +5 -0
- package/src/py/agent/schema.d.js +6 -0
- package/src/py/agent/schema.d.js.map +1 -0
- package/src/py/agent/schema.d.ts +6 -2
- package/src/py/agent/schema.json +15 -1
- package/src/py/api/generator.d.ts +1 -1
- package/src/py/api/generator.js +12 -11
- package/src/py/api/generator.js.map +1 -1
- package/src/py/api/schema.d.js +6 -0
- package/src/py/api/schema.d.js.map +1 -0
- package/src/py/api/schema.d.ts +2 -1
- package/src/py/api/schema.json +5 -0
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +1592 -0
- package/src/py/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +63 -0
- package/src/py/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/agent-connection/generator.js +45 -0
- package/src/py/dynamodb/agent-connection/generator.js.map +1 -0
- package/src/py/dynamodb/agent-connection/schema.d.js +8 -0
- package/src/py/dynamodb/agent-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/agent-connection/schema.d.ts +15 -0
- package/src/py/dynamodb/agent-connection/schema.json +27 -0
- package/src/py/dynamodb/fast-api-connection/__snapshots__/generator.spec.ts.snap +32 -0
- package/src/py/dynamodb/fast-api-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/fast-api-connection/generator.js +39 -0
- package/src/py/dynamodb/fast-api-connection/generator.js.map +1 -0
- package/src/py/dynamodb/fast-api-connection/schema.d.js +8 -0
- package/src/py/dynamodb/fast-api-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/fast-api-connection/schema.d.ts +13 -0
- package/src/py/dynamodb/fast-api-connection/schema.json +23 -0
- package/src/py/dynamodb/files/__name__/__init__.py.template +6 -0
- package/src/py/dynamodb/files/__name__/client.py.template +39 -0
- package/src/py/dynamodb/files/__name__/entities/__init__.py.template +4 -0
- package/src/py/dynamodb/files/__name__/entities/base.py.template +63 -0
- package/src/py/dynamodb/files/__name__/entities/example.py.template +64 -0
- package/src/py/dynamodb/files/config.json.template +24 -0
- package/src/py/dynamodb/generator.d.ts +39 -0
- package/src/py/dynamodb/generator.js +130 -0
- package/src/py/dynamodb/generator.js.map +1 -0
- package/src/py/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +63 -0
- package/src/py/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/mcp-server-connection/generator.js +45 -0
- package/src/py/dynamodb/mcp-server-connection/generator.js.map +1 -0
- package/src/py/dynamodb/mcp-server-connection/schema.d.js +8 -0
- package/src/py/dynamodb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/mcp-server-connection/schema.d.ts +15 -0
- package/src/py/dynamodb/mcp-server-connection/schema.json +27 -0
- package/src/py/dynamodb/schema.d.js +6 -0
- package/src/py/dynamodb/schema.d.js.map +1 -0
- package/src/py/dynamodb/schema.d.ts +16 -0
- package/src/py/dynamodb/schema.json +76 -0
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +240 -4693
- package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +6661 -0
- package/src/py/fast-api/files/app/__name__/init.py.template +5 -22
- package/src/py/fast-api/files/app/__name__/main.py.template +4 -1
- package/src/py/fast-api/generator.d.ts +73 -1
- package/src/py/fast-api/generator.js +126 -92
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/__snapshots__/generator.spec.ts.snap +4 -3
- package/src/py/fast-api/react/generator.d.ts +17 -2
- package/src/py/fast-api/react/generator.js +38 -26
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/open-api.js +44 -33
- package/src/py/fast-api/react/open-api.js.map +1 -1
- package/src/py/fast-api/react/schema.d.js +6 -0
- package/src/py/fast-api/react/schema.d.js.map +1 -0
- package/src/py/fast-api/react/schema.d.ts +1 -0
- package/src/py/fast-api/react/schema.json +5 -0
- package/src/py/fast-api/schema.d.js +6 -0
- package/src/py/fast-api/schema.d.js.map +1 -0
- package/src/py/fast-api/schema.d.ts +2 -1
- package/src/py/fast-api/schema.json +6 -0
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +12 -4
- package/src/py/lambda-function/files/handler/__lambdaFunctionSnakeCase__.py.template +1 -1
- package/src/py/lambda-function/generator.d.ts +28 -1
- package/src/py/lambda-function/generator.js +88 -61
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.js +6 -0
- package/src/py/lambda-function/schema.d.js.map +1 -0
- package/src/py/lambda-function/schema.d.ts +3 -2
- package/src/py/lambda-function/schema.json +6 -1
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +225 -21
- package/src/py/mcp-server/files/deploy/Dockerfile.template +15 -1
- package/src/py/mcp-server/generator.d.ts +69 -1
- package/src/py/mcp-server/generator.js +211 -137
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/mcp-server/schema.d.js +6 -0
- package/src/py/mcp-server/schema.d.js.map +1 -0
- package/src/py/mcp-server/schema.d.ts +2 -1
- package/src/py/mcp-server/schema.json +6 -0
- package/src/py/project/generator.d.ts +37 -2
- package/src/py/project/generator.js +246 -90
- package/src/py/project/generator.js.map +1 -1
- package/src/py/project/schema.d.js +6 -0
- package/src/py/project/schema.d.js.map +1 -0
- package/src/py/project/schema.d.ts +1 -0
- package/src/py/project/schema.json +6 -0
- package/src/py/rdb/__snapshots__/generator.spec.ts.snap +2113 -0
- package/src/py/rdb/agent-connection/__snapshots__/generator.spec.ts.snap +123 -0
- package/src/py/rdb/agent-connection/generator.d.ts +10 -0
- package/src/py/rdb/agent-connection/generator.js +52 -0
- package/src/py/rdb/agent-connection/generator.js.map +1 -0
- package/src/py/rdb/agent-connection/schema.d.js +8 -0
- package/src/py/rdb/agent-connection/schema.d.js.map +1 -0
- package/src/py/rdb/agent-connection/schema.d.ts +15 -0
- package/src/py/rdb/agent-connection/schema.json +27 -0
- package/src/py/rdb/fast-api-connection/__snapshots__/generator.spec.ts.snap +51 -0
- package/src/py/rdb/fast-api-connection/files/__apiModuleName__/dependencies/__rdbNameSnake__.py.template +14 -0
- package/src/py/rdb/fast-api-connection/generator.d.ts +10 -0
- package/src/py/rdb/fast-api-connection/generator.js +56 -0
- package/src/py/rdb/fast-api-connection/generator.js.map +1 -0
- package/src/py/rdb/fast-api-connection/schema.d.js +8 -0
- package/src/py/rdb/fast-api-connection/schema.d.js.map +1 -0
- package/src/py/rdb/fast-api-connection/schema.d.ts +13 -0
- package/src/py/rdb/fast-api-connection/schema.json +23 -0
- package/src/py/rdb/files/Dockerfile.create-db-user.template +14 -0
- package/src/py/rdb/files/Dockerfile.migration.template +14 -0
- package/src/py/rdb/files/__name__/connection.py.template +55 -0
- package/src/py/rdb/files/__name__/create_db_user_handler.py.template +97 -0
- package/src/py/rdb/files/__name__/migration_handler.py.template +36 -0
- package/src/py/rdb/files/__name__/models/__init__.py.template +3 -0
- package/src/py/rdb/files/__name__/models/example.py.template +8 -0
- package/src/py/rdb/files/__name__/utils.py.template +120 -0
- package/src/py/rdb/files/alembic.ini.template +38 -0
- package/src/py/rdb/files/migrations/env.py.template +80 -0
- package/src/py/rdb/files/migrations/script.py.mako.template +28 -0
- package/src/py/rdb/generator.d.ts +103 -0
- package/src/py/rdb/generator.js +368 -0
- package/src/py/rdb/generator.js.map +1 -0
- package/src/py/rdb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +119 -0
- package/src/py/rdb/mcp-server-connection/generator.d.ts +10 -0
- package/src/py/rdb/mcp-server-connection/generator.js +52 -0
- package/src/py/rdb/mcp-server-connection/generator.js.map +1 -0
- package/src/py/rdb/mcp-server-connection/schema.d.js +8 -0
- package/src/py/rdb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/py/rdb/mcp-server-connection/schema.d.ts +15 -0
- package/src/py/rdb/mcp-server-connection/schema.json +27 -0
- package/src/py/rdb/schema.d.js +6 -0
- package/src/py/rdb/schema.d.js.map +1 -0
- package/src/py/rdb/schema.d.ts +16 -0
- package/src/py/rdb/schema.json +78 -0
- package/src/py/rdb/utils.d.ts +6 -0
- package/src/py/rdb/utils.js +16 -0
- package/src/py/rdb/utils.js.map +1 -0
- package/src/sdk/agentcore-gateway.d.ts +6 -0
- package/src/sdk/agentcore-gateway.js +7 -0
- package/src/sdk/agentcore-gateway.js.map +1 -0
- package/src/sdk/agentcore-harness.d.ts +6 -0
- package/src/sdk/agentcore-harness.js +7 -0
- package/src/sdk/agentcore-harness.js.map +1 -0
- package/src/sdk/connection.d.ts +6 -0
- package/src/sdk/connection.js +6 -0
- package/src/sdk/connection.js.map +1 -0
- package/src/sdk/license.d.ts +8 -0
- package/src/sdk/license.js +7 -0
- package/src/sdk/license.js.map +1 -0
- package/src/sdk/open-api.d.ts +12 -0
- package/src/sdk/open-api.js +9 -0
- package/src/sdk/open-api.js.map +1 -0
- package/src/sdk/py.d.ts +18 -0
- package/src/sdk/py.js +12 -0
- package/src/sdk/py.js.map +1 -0
- package/src/sdk/smithy.d.ts +6 -0
- package/src/sdk/smithy.js +7 -0
- package/src/sdk/smithy.js.map +1 -0
- package/src/sdk/terraform.d.ts +6 -0
- package/src/sdk/terraform.js +7 -0
- package/src/sdk/terraform.js.map +1 -0
- package/src/sdk/ts.d.ts +39 -0
- package/src/sdk/ts.js +41 -0
- package/src/sdk/ts.js.map +1 -0
- package/{sdk/utils/format.d.ts → src/sdk/utils/ast.d.ts} +1 -1
- package/src/sdk/utils/ast.js +6 -0
- package/src/sdk/utils/ast.js.map +1 -0
- package/src/sdk/utils/format.d.ts +5 -0
- package/src/sdk/utils/format.js +6 -0
- package/src/sdk/utils/format.js.map +1 -0
- package/{sdk → src/sdk}/utils/test.d.ts +1 -1
- package/src/sdk/utils/test.js +6 -0
- package/src/sdk/utils/test.js.map +1 -0
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +244 -226
- package/src/smithy/project/files/{smithy-build.json.template → service/smithy-build.json.template} +5 -5
- package/src/smithy/project/files/{src → service/src}/operations/echo.smithy.template +1 -0
- package/src/smithy/project/files/shapes/smithy-build.json.template +7 -0
- package/src/smithy/project/files/shapes/src/main.smithy.template +11 -0
- package/src/smithy/project/files/ssdk-bundle/ssdk.rolldown.config.mjs.template +52 -0
- package/src/smithy/project/generator.d.ts +91 -1
- package/src/smithy/project/generator.js +220 -45
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/project/schema.d.js +6 -0
- package/src/smithy/project/schema.d.js.map +1 -0
- package/src/smithy/project/schema.d.ts +2 -0
- package/src/smithy/project/schema.json +28 -1
- package/src/smithy/react-connection/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/smithy/react-connection/generator.d.ts +16 -1
- package/src/smithy/react-connection/generator.js +54 -48
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/react-connection/schema.d.js +6 -0
- package/src/smithy/react-connection/schema.d.js.map +1 -0
- package/src/smithy/react-connection/schema.d.ts +1 -0
- package/src/smithy/react-connection/schema.json +5 -0
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +2618 -550
- package/src/smithy/ts/api/files/handler.ts.template +3 -3
- package/src/smithy/ts/api/files/local-server.ts.template +3 -3
- 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.d.ts +89 -1
- package/src/smithy/ts/api/generator.js +185 -119
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/smithy/ts/api/schema.d.js +6 -0
- package/src/smithy/ts/api/schema.d.js.map +1 -0
- package/src/smithy/ts/api/schema.d.ts +2 -1
- package/src/smithy/ts/api/schema.json +6 -0
- package/src/terraform/project/files/application/bootstrap/providers.tf.template +11 -0
- package/src/terraform/project/files/application/scripts/bootstrap-destroy.ts.template +111 -0
- package/src/terraform/project/files/application/scripts/bootstrap.ts.template +40 -1
- package/src/terraform/project/files/application/scripts/env.ts.template +11 -0
- package/src/terraform/project/files/application/scripts/init.ts.template +2 -1
- package/src/terraform/project/files/application/src/main.tf.template +6 -1
- package/src/terraform/project/files/application/src/providers.tf.template +9 -3
- package/src/terraform/project/files/checkov/checkov.yml.template +8 -0
- package/src/terraform/project/files/library/src/main.tf.template +9 -0
- package/src/terraform/project/generator.d.ts +62 -2
- package/src/terraform/project/generator.js +340 -117
- package/src/terraform/project/generator.js.map +1 -1
- package/src/terraform/project/schema.d.js +9 -0
- package/src/terraform/project/schema.d.js.map +1 -0
- package/src/terraform/project/schema.d.ts +1 -0
- package/src/terraform/project/schema.json +5 -0
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +2957 -725
- 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 +3 -3
- package/src/trpc/backend/files/src/router.ts.template +2 -2
- package/src/trpc/backend/files/src/schema/echo.ts.template +2 -2
- package/src/trpc/backend/files/src/schema/index.ts.template +1 -1
- package/src/trpc/backend/files-operations/scripts/generate-operations.ts.template +40 -0
- package/src/trpc/backend/generator.d.ts +91 -2
- package/src/trpc/backend/generator.js +186 -100
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.js +6 -0
- package/src/trpc/backend/schema.d.js.map +1 -0
- package/src/trpc/backend/schema.d.ts +2 -1
- package/src/trpc/backend/schema.json +6 -0
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/trpc/react/files/src/components/__apiNameClassName__ClientProvider.tsx.template +3 -3
- package/src/trpc/react/generator.d.ts +39 -2
- package/src/trpc/react/generator.js +105 -63
- package/src/trpc/react/generator.js.map +1 -1
- package/src/trpc/react/schema.d.js +6 -0
- package/src/trpc/react/schema.d.js.map +1 -0
- package/src/trpc/react/schema.d.ts +1 -0
- package/src/trpc/react/schema.json +5 -0
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +1490 -31
- package/src/ts/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +258 -0
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client-strands.ts.template +23 -0
- package/src/ts/agent/a2a-connection/generator.d.ts +47 -1
- package/src/ts/agent/a2a-connection/generator.js +112 -63
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/a2a-connection/schema.d.js +8 -0
- package/src/ts/agent/a2a-connection/schema.d.js.map +1 -0
- package/src/ts/agent/a2a-connection/schema.d.ts +2 -1
- package/src/ts/agent/a2a-connection/schema.json +5 -0
- package/src/ts/agent/files/a2a/index.ts.template +5 -12
- package/src/ts/agent/files/ag-ui/index.ts.template +29 -14
- package/src/ts/agent/files/common/agent.ts.template +11 -2
- package/src/ts/agent/files/common/session.ts.template +43 -0
- package/src/ts/agent/files/common-express/middleware/session-id-middleware.ts.template +16 -0
- package/src/ts/agent/files/deploy/Dockerfile.template +20 -2
- 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 +5 -5
- package/src/ts/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +222 -0
- package/src/ts/agent/gateway-connection/files/agent-connection/app/__gatewayKebabCase__-client-strands.ts.template +30 -0
- package/src/ts/agent/gateway-connection/generator.d.ts +47 -0
- package/src/ts/agent/gateway-connection/generator.js +144 -0
- package/src/ts/agent/gateway-connection/generator.js.map +1 -0
- package/src/ts/agent/gateway-connection/schema.d.js +6 -0
- package/src/ts/agent/gateway-connection/schema.d.js.map +1 -0
- package/src/ts/agent/gateway-connection/schema.d.ts +13 -0
- package/src/ts/agent/gateway-connection/schema.json +31 -0
- package/src/ts/agent/generator.d.ts +206 -1
- package/src/ts/agent/generator.js +342 -159
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +194 -114
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +23 -0
- package/src/ts/agent/mcp-connection/generator.d.ts +38 -1
- package/src/ts/agent/mcp-connection/generator.js +88 -65
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/schema.d.js +8 -0
- package/src/ts/agent/mcp-connection/schema.d.js.map +1 -0
- package/src/ts/agent/mcp-connection/schema.d.ts +2 -1
- package/src/ts/agent/mcp-connection/schema.json +5 -0
- package/src/ts/agent/react-connection/__snapshots__/generator.spec.ts.snap +8 -4
- package/src/ts/agent/react-connection/files/src/components/__agentNameClassName__AgentClientProvider.tsx.template +2 -1
- package/src/ts/agent/react-connection/generator.d.ts +204 -3
- package/src/ts/agent/react-connection/generator.js +158 -99
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/local-dev.d.ts +13 -0
- package/src/ts/agent/react-connection/local-dev.js +17 -0
- package/src/ts/agent/react-connection/local-dev.js.map +1 -0
- package/src/ts/agent/react-connection/schema.d.js +8 -0
- package/src/ts/agent/react-connection/schema.d.js.map +1 -0
- package/src/ts/agent/react-connection/schema.d.ts +2 -1
- package/src/ts/agent/react-connection/schema.json +5 -0
- package/src/ts/agent/schema.d.js +6 -0
- package/src/ts/agent/schema.d.js.map +1 -0
- package/src/ts/agent/schema.d.ts +5 -1
- package/src/ts/agent/schema.json +14 -0
- package/src/ts/api/generator.d.ts +1 -1
- package/src/ts/api/generator.js +16 -16
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.js +6 -0
- package/src/ts/api/schema.d.js.map +1 -0
- package/src/ts/api/schema.d.ts +2 -1
- package/src/ts/api/schema.json +5 -0
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +22 -8
- package/src/ts/astro-docs/files/base/src/content/docs/en/index.mdx.template +2 -2
- package/src/ts/astro-docs/files/base/src/content.config.ts.template +4 -4
- package/src/ts/astro-docs/files/translation/scripts/translate.ts.template +272 -150
- package/src/ts/astro-docs/generator.d.ts +41 -1
- package/src/ts/astro-docs/generator.js +133 -59
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/astro-docs/schema.d.js +6 -0
- package/src/ts/astro-docs/schema.d.js.map +1 -0
- package/src/ts/astro-docs/schema.d.ts +2 -2
- package/src/ts/astro-docs/schema.json +3 -3
- package/src/ts/dcr-proxy/__snapshots__/generator.spec.ts.snap +986 -0
- package/src/ts/dcr-proxy/generator.d.ts +34 -0
- package/src/ts/dcr-proxy/generator.js +115 -0
- package/src/ts/dcr-proxy/generator.js.map +1 -0
- package/src/ts/dcr-proxy/schema.d.js +6 -0
- package/src/ts/dcr-proxy/schema.d.js.map +1 -0
- package/src/ts/dcr-proxy/schema.d.ts +13 -0
- package/src/ts/dcr-proxy/schema.json +44 -0
- package/src/ts/docs/generator.d.ts +1 -1
- package/src/ts/docs/generator.js +10 -10
- package/src/ts/docs/generator.js.map +1 -1
- package/src/ts/docs/schema.d.js +6 -0
- package/src/ts/docs/schema.d.js.map +1 -0
- package/src/ts/docs/schema.d.ts +1 -4
- package/src/ts/docs/schema.json +3 -3
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +481 -527
- package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +23 -5
- package/src/ts/dynamodb/agent-connection/generator.d.ts +1 -1
- package/src/ts/dynamodb/agent-connection/generator.js +27 -23
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/agent-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/agent-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/agent-connection/schema.d.ts +2 -1
- package/src/ts/dynamodb/agent-connection/schema.json +5 -0
- package/src/ts/dynamodb/files/config.json.template +24 -0
- package/src/ts/dynamodb/files/src/client.ts.template +30 -11
- 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 -11
- package/src/ts/dynamodb/generator.d.ts +42 -1
- package/src/ts/dynamodb/generator.js +110 -64
- package/src/ts/dynamodb/generator.js.map +1 -1
- package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +23 -5
- package/src/ts/dynamodb/mcp-server-connection/generator.d.ts +1 -1
- package/src/ts/dynamodb/mcp-server-connection/generator.js +27 -23
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/mcp-server-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.d.ts +2 -1
- package/src/ts/dynamodb/mcp-server-connection/schema.json +5 -0
- package/src/ts/dynamodb/schema.d.js +6 -0
- package/src/ts/dynamodb/schema.d.js.map +1 -0
- package/src/ts/dynamodb/schema.d.ts +3 -1
- package/src/ts/dynamodb/schema.json +26 -2
- package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +12 -3
- package/src/ts/dynamodb/smithy-connection/generator.d.ts +1 -1
- package/src/ts/dynamodb/smithy-connection/generator.js +22 -22
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/smithy-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.ts +1 -0
- package/src/ts/dynamodb/smithy-connection/schema.json +5 -0
- package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +12 -3
- package/src/ts/dynamodb/trpc-connection/generator.d.ts +1 -1
- package/src/ts/dynamodb/trpc-connection/generator.js +22 -22
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/trpc-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.ts +1 -0
- package/src/ts/dynamodb/trpc-connection/schema.json +5 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +19 -9
- package/src/ts/lambda-function/files/handler/__lambdaFunctionKebabCase__.ts.template +2 -1
- package/src/ts/lambda-function/generator.d.ts +39 -1
- package/src/ts/lambda-function/generator.js +98 -65
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/io.js +83 -52
- package/src/ts/lambda-function/io.js.map +1 -1
- package/src/ts/lambda-function/schema.d.js +6 -0
- package/src/ts/lambda-function/schema.d.js.map +1 -0
- package/src/ts/lambda-function/schema.d.ts +2 -1
- package/src/ts/lambda-function/schema.json +5 -0
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +83 -36
- package/src/ts/lib/__snapshots__/vitest.spec.ts.snap +2 -2
- package/src/ts/lib/biome.d.ts +1 -1
- package/src/ts/lib/biome.js +71 -38
- package/src/ts/lib/biome.js.map +1 -1
- package/src/ts/lib/generator.d.ts +24 -1
- package/src/ts/lib/generator.js +128 -94
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/grit/vitest-pass-with-no-tests.grit +1 -4
- package/src/ts/lib/schema.d.js +6 -0
- package/src/ts/lib/schema.d.js.map +1 -0
- package/src/ts/lib/schema.d.ts +1 -1
- package/src/ts/lib/schema.json +5 -0
- package/src/ts/lib/ts-project-utils.d.ts +4 -2
- package/src/ts/lib/ts-project-utils.js +85 -74
- 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 +5 -2
- package/src/ts/lib/types.js.map +1 -1
- package/src/ts/lib/vitest.d.ts +22 -2
- package/src/ts/lib/vitest.js +83 -26
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +225 -44
- package/src/ts/mcp-server/files/Dockerfile.template +20 -2
- package/src/ts/mcp-server/generator.d.ts +111 -1
- package/src/ts/mcp-server/generator.js +234 -168
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/mcp-server/schema.d.js +6 -0
- package/src/ts/mcp-server/schema.d.js.map +1 -0
- package/src/ts/mcp-server/schema.d.ts +2 -1
- package/src/ts/mcp-server/schema.json +6 -0
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +28 -13
- package/src/ts/nx-generator/files/common/schema.d.ts.template +1 -0
- package/src/ts/nx-generator/files/common/schema.json.template +5 -0
- package/src/ts/nx-generator/files/local/generator.spec.ts.template +1 -1
- package/src/ts/nx-generator/files/local/generator.ts.template +3 -3
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +6 -7
- package/src/ts/nx-generator/generator.d.ts +3 -0
- package/src/ts/nx-generator/generator.js +122 -75
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-generator/schema.d.js +6 -0
- package/src/ts/nx-generator/schema.d.js.map +1 -0
- package/src/ts/nx-generator/schema.d.ts +1 -0
- package/src/ts/nx-generator/schema.json +5 -0
- package/src/ts/nx-migration/files/migration.spec.ts.template +26 -0
- package/src/ts/nx-migration/files/migration.ts.template +65 -0
- package/src/ts/nx-migration/files/prompt.md.template +46 -0
- package/src/ts/nx-migration/generator.d.ts +27 -0
- package/src/ts/nx-migration/generator.js +147 -0
- package/src/ts/nx-migration/generator.js.map +1 -0
- package/src/ts/nx-migration/schema.d.js +6 -0
- package/src/ts/nx-migration/schema.d.js.map +1 -0
- package/src/ts/nx-migration/schema.d.ts +13 -0
- package/src/ts/nx-migration/schema.json +63 -0
- package/src/ts/nx-plugin/__snapshots__/generator.spec.ts.snap +36 -25
- package/src/ts/nx-plugin/files/mcp-server/resources/GENERAL_GUIDANCE.md.template +5 -6
- 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 +4 -4
- package/src/ts/nx-plugin/generator.d.ts +4 -1
- package/src/ts/nx-plugin/generator.js +64 -48
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/schema.d.js +9 -0
- package/src/ts/nx-plugin/schema.d.js.map +1 -0
- package/src/ts/nx-plugin/schema.json +5 -0
- package/src/ts/nx-plugin/utils.d.ts +27 -2
- package/src/ts/nx-plugin/utils.js +66 -57
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +711 -877
- package/src/ts/rdb/agent-connection/__snapshots__/generator.spec.ts.snap +16 -6
- package/src/ts/rdb/agent-connection/generator.d.ts +1 -1
- package/src/ts/rdb/agent-connection/generator.js +44 -39
- package/src/ts/rdb/agent-connection/generator.js.map +1 -1
- package/src/ts/rdb/agent-connection/schema.d.js +8 -0
- package/src/ts/rdb/agent-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/agent-connection/schema.d.ts +2 -1
- package/src/ts/rdb/agent-connection/schema.json +5 -0
- package/src/ts/rdb/files/Dockerfile.template +19 -1
- package/src/ts/rdb/files/prisma.config.ts.template +6 -5
- package/src/ts/rdb/files/src/create-db-user-handler.ts.template +9 -11
- package/src/ts/rdb/files/src/migration-handler.ts.template +5 -30
- package/src/ts/rdb/files/src/prisma.ts.template +33 -25
- package/src/ts/rdb/files/src/utils.ts.template +31 -1
- package/src/ts/rdb/generator.d.ts +118 -5
- package/src/ts/rdb/generator.js +272 -127
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +16 -6
- package/src/ts/rdb/mcp-server-connection/generator.d.ts +1 -1
- package/src/ts/rdb/mcp-server-connection/generator.js +42 -37
- package/src/ts/rdb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/schema.d.js +8 -0
- package/src/ts/rdb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/mcp-server-connection/schema.d.ts +2 -1
- package/src/ts/rdb/mcp-server-connection/schema.json +5 -0
- package/src/ts/rdb/schema.d.js +6 -0
- package/src/ts/rdb/schema.d.js.map +1 -0
- package/src/ts/rdb/schema.d.ts +2 -1
- package/src/ts/rdb/schema.json +7 -1
- package/src/ts/rdb/smithy-connection/__snapshots__/generator.spec.ts.snap +18 -9
- package/src/ts/rdb/smithy-connection/generator.d.ts +1 -1
- package/src/ts/rdb/smithy-connection/generator.js +48 -43
- package/src/ts/rdb/smithy-connection/generator.js.map +1 -1
- package/src/ts/rdb/smithy-connection/schema.d.js +8 -0
- package/src/ts/rdb/smithy-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/smithy-connection/schema.d.ts +1 -0
- package/src/ts/rdb/smithy-connection/schema.json +5 -0
- package/src/ts/rdb/trpc-connection/__snapshots__/generator.spec.ts.snap +12 -3
- package/src/ts/rdb/trpc-connection/generator.d.ts +1 -1
- package/src/ts/rdb/trpc-connection/generator.js +37 -31
- package/src/ts/rdb/trpc-connection/generator.js.map +1 -1
- package/src/ts/rdb/trpc-connection/schema.d.js +8 -0
- package/src/ts/rdb/trpc-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/trpc-connection/schema.d.ts +1 -0
- package/src/ts/rdb/trpc-connection/schema.json +5 -0
- package/src/ts/rdb/utils.js +9 -11
- package/src/ts/rdb/utils.js.map +1 -1
- package/src/ts/react-website/agui/files/common/src/hooks/useAgui__agentNameClassName__.tsx.template +17 -16
- package/src/ts/react-website/agui/generator.d.ts +97 -0
- package/src/ts/react-website/agui/generator.js +114 -67
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +1705 -717
- package/src/ts/react-website/app/files/app/common/README.md.template +1 -1
- package/src/ts/react-website/app/generator.d.ts +146 -3
- package/src/ts/react-website/app/generator.js +363 -209
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.js +6 -0
- package/src/ts/react-website/app/schema.d.js.map +1 -0
- package/src/ts/react-website/app/schema.d.ts +3 -3
- package/src/ts/react-website/app/schema.json +12 -6
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +225 -31
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +78 -12
- package/src/ts/react-website/cognito-auth/files/app/components/CognitoAuth/index.tsx.template +2 -2
- package/src/ts/react-website/cognito-auth/generator.d.ts +26 -2
- package/src/ts/react-website/cognito-auth/generator.js +79 -61
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/schema.d.js +6 -0
- package/src/ts/react-website/cognito-auth/schema.d.js.map +1 -0
- package/src/ts/react-website/cognito-auth/schema.d.ts +2 -1
- package/src/ts/react-website/cognito-auth/schema.json +5 -0
- package/src/ts/react-website/cognito-auth/utils.js +34 -32
- package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
- package/src/ts/react-website/runtime-config/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/react-website/runtime-config/files/app/components/RuntimeConfig/index.tsx.template +2 -2
- package/src/ts/react-website/runtime-config/generator.d.ts +1 -1
- package/src/ts/react-website/runtime-config/generator.js +29 -31
- package/src/ts/react-website/runtime-config/generator.js.map +1 -1
- package/src/ts/react-website/runtime-config/schema.d.js +6 -0
- package/src/ts/react-website/runtime-config/schema.d.js.map +1 -0
- package/src/ts/react-website/runtime-config/schema.d.ts +1 -0
- package/src/ts/react-website/runtime-config/schema.json +5 -0
- package/src/ts/sync/generator.d.ts +1 -1
- package/src/ts/sync/generator.js +154 -60
- package/src/ts/sync/generator.js.map +1 -1
- package/src/ts/website/app/generator.d.ts +1 -1
- package/src/ts/website/app/generator.js +10 -10
- package/src/ts/website/app/generator.js.map +1 -1
- package/src/ts/website/app/schema.d.js +6 -0
- package/src/ts/website/app/schema.d.js.map +1 -0
- package/src/ts/website/app/schema.d.ts +3 -3
- package/src/ts/website/app/schema.json +11 -6
- package/src/ts/website/auth/generator.d.ts +2 -2
- package/src/ts/website/auth/generator.js +11 -10
- package/src/ts/website/auth/generator.js.map +1 -1
- package/src/ts/website/auth/schema.d.js +6 -0
- package/src/ts/website/auth/schema.d.js.map +1 -0
- package/src/ts/website/auth/schema.d.ts +2 -1
- package/src/ts/website/auth/schema.json +5 -0
- package/src/utils/__snapshots__/shared-constructs.spec.ts.snap +21 -0
- package/src/utils/add-dependencies.d.ts +38 -0
- package/src/utils/add-dependencies.js +83 -0
- package/src/utils/add-dependencies.js.map +1 -0
- package/src/utils/agent-chat/agent-chat.d.ts +31 -0
- package/src/utils/agent-chat/agent-chat.js +31 -0
- package/src/utils/agent-chat/agent-chat.js.map +1 -0
- package/src/utils/agent-chat/files/a2a/chat.ts.template +33 -0
- package/src/utils/agent-chat/files/ag-ui/chat.ts.template +17 -0
- package/src/utils/agent-chat/files/common/agentcore.ts.template +81 -0
- package/src/utils/agent-chat/files/http-py/chat.ts.template +43 -0
- package/src/utils/agent-chat/files/http-ts/chat.ts.template +54 -0
- package/src/utils/agent-connection/agent-connection.d.ts +149 -26
- package/src/utils/agent-connection/agent-connection.js +510 -108
- 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 +93 -0
- package/src/utils/agent-connection/files/core-auth/agentcore-endpoints.ts.template +37 -0
- package/src/utils/agent-connection/files/core-auth/agentcore-fetch.ts.template +54 -0
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +41 -0
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-transport.ts.template +70 -0
- package/src/utils/agent-connection/files/core-runtime-config/runtime-config.ts.template +35 -33
- package/src/utils/agent-connection/files/core-shared/agentcore-transport.ts.template +39 -0
- package/src/utils/agent-connection/files/core-strands/a2a/agentcore-a2a-client-strands.ts.template +61 -0
- package/src/utils/agent-connection/files/{core-runtime-config/model-errors.ts.template → core-strands/base/model-errors-strands.ts.template} +26 -15
- package/src/utils/agent-connection/files/core-strands/base/tool-errors-strands.ts.template +29 -0
- package/src/utils/agent-connection/files/{core-runtime-config/with-session-id.ts.template → 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 +26 -0
- package/src/utils/agent-connection/files/core-strands/mcp/agentcore-mcp-client-strands.ts.template +27 -0
- package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client_config.py.template +43 -0
- package/src/utils/agent-connection/files/py-core-auth/agentcore_endpoints.py.template +47 -0
- package/src/utils/agent-connection/files/py-core-auth/auth/session.py.template +51 -0
- package/src/utils/agent-connection/files/py-core-gateway/agentcore_gateway_mcp_transport.py.template +28 -0
- package/src/utils/agent-connection/files/py-core-langchain/a2a/agentcore_a2a_client_langchain.py.template +105 -0
- package/src/utils/agent-connection/files/py-core-langchain/gateway/agentcore_gateway_mcp_client_langchain.py.template +57 -0
- package/src/utils/agent-connection/files/py-core-langchain/mcp/agentcore_mcp_client_langchain.py.template +64 -0
- package/src/utils/agent-connection/files/py-core-langchain/s3/s3_checkpoint_saver_langchain.py.template +360 -0
- package/src/utils/agent-connection/files/py-core-mcp/agentcore_mcp_transport.py.template +34 -0
- package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +4 -18
- package/src/utils/agent-connection/files/py-core-runtime-config/session_context.py.template +2 -2
- package/src/utils/agent-connection/files/py-core-shared/agentcore_transport.py.template +40 -0
- package/src/utils/agent-connection/files/py-core-strands/a2a/agentcore_a2a_client_strands.py.template +111 -0
- package/src/utils/agent-connection/files/py-core-strands/base/tool_errors_strands.py.template +24 -0
- package/src/utils/agent-connection/files/{py-core-runtime-config/with_session_id.py.template → py-core-strands/base/with_session_id_strands.py.template} +2 -2
- package/src/utils/agent-connection/files/py-core-strands/gateway/agentcore_gateway_mcp_client_strands.py.template +22 -0
- package/src/utils/agent-connection/files/py-core-strands/mcp/agentcore_mcp_client_strands.py.template +30 -0
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +88 -2
- package/src/utils/agent-core-constructs/agent-core-constructs.js +227 -30
- 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 +273 -9
- package/src/utils/agent-core-constructs/files/cdk/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.ts.template +87 -0
- package/src/utils/agent-core-constructs/files/cdk/app/agentcore-harness/__nameKebabCase__/__nameKebabCase__.ts.template +404 -0
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +624 -0
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/readiness-probe/index.js.template +55 -0
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +288 -1
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +576 -0
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/render-cedar.cjs.template +13 -0
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-harness/__nameKebabCase__/__nameKebabCase__.tf.template +516 -0
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +163 -13
- package/src/utils/agent-core-constructs/files/terraform/core/agentcore-gateway/gateway.tf.template +14 -0
- package/src/utils/api-constructs/api-constructs.d.ts +31 -3
- package/src/utils/api-constructs/api-constructs.js +96 -32
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +24 -19
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +28 -20
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +26 -9
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account/index.js.template +70 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account.ts.template +82 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +56 -17
- package/src/utils/api-constructs/files/cdk/core/api/trpc/trpc-utils.ts.template +1 -1
- package/src/utils/api-constructs/files/cdk/core/api/utils/utils.ts.template +61 -7
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +356 -19
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +635 -14
- package/src/utils/api-constructs/files/terraform/core/api/http/http-api/http-api.tf.template +1 -1
- package/src/utils/api-constructs/files/terraform/core/api/rest/api-gateway-account/api-gateway-account.tf.template +83 -0
- package/src/utils/api-constructs/files/terraform/core/api/rest/rest-api/rest-api.tf.template +65 -18
- package/src/utils/api-constructs/open-api-metadata.d.ts +21 -4
- package/src/utils/api-constructs/open-api-metadata.js +74 -39
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
- package/src/utils/api-constructs/trpc-operations-metadata.d.ts +21 -0
- package/src/utils/api-constructs/trpc-operations-metadata.js +61 -0
- package/src/utils/api-constructs/trpc-operations-metadata.js.map +1 -0
- package/src/utils/ast/website.js +17 -19
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.d.ts +47 -0
- package/src/utils/ast.js +185 -96
- package/src/utils/ast.js.map +1 -1
- package/src/utils/base-tsconfig.d.ts +30 -0
- package/src/utils/base-tsconfig.js +32 -0
- package/src/utils/base-tsconfig.js.map +1 -0
- package/src/utils/bundle/bundle.d.ts +6 -1
- package/src/utils/bundle/bundle.js +70 -48
- package/src/utils/bundle/bundle.js.map +1 -1
- package/src/utils/commands.d.ts +14 -3
- package/src/utils/commands.js +83 -28
- package/src/utils/commands.js.map +1 -1
- package/src/utils/config/index.d.ts +22 -6
- package/src/utils/config/index.js +5 -4
- package/src/utils/config/index.js.map +1 -1
- package/src/utils/config/utils.d.ts +9 -3
- package/src/utils/config/utils.js +56 -59
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +16 -3
- package/src/utils/connection/open-api/react.d.ts +31 -5
- package/src/utils/connection/open-api/react.js +106 -86
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/containers.js +22 -23
- package/src/utils/containers.js.map +1 -1
- package/src/utils/dcr-proxy-constructs/dcr-proxy-constructs.d.ts +38 -0
- package/src/utils/dcr-proxy-constructs/dcr-proxy-constructs.js +95 -0
- package/src/utils/dcr-proxy-constructs/dcr-proxy-constructs.js.map +1 -0
- package/src/utils/dcr-proxy-constructs/files/cdk/app/dcr-proxies/__nameKebabCase__/__nameKebabCase__.ts.template +227 -0
- package/src/utils/dcr-proxy-constructs/files/project/src/handlers/authorization-server-metadata.ts.template +39 -0
- package/src/utils/dcr-proxy-constructs/files/project/src/handlers/authorize.ts.template +26 -0
- package/src/utils/dcr-proxy-constructs/files/project/src/handlers/mcp-proxy.ts.template +89 -0
- package/src/utils/dcr-proxy-constructs/files/project/src/handlers/protected-resource-metadata.ts.template +13 -0
- package/src/utils/dcr-proxy-constructs/files/project/src/handlers/register.ts.template +70 -0
- package/src/utils/dcr-proxy-constructs/files/project/src/handlers/token.ts.template +75 -0
- package/src/utils/dcr-proxy-constructs/files/terraform/app/dcr-proxies/__nameKebabCase__/__nameKebabCase__.tf.template +414 -0
- package/src/utils/declared-dependencies.d.ts +140 -0
- package/src/utils/declared-dependencies.js +64 -0
- package/src/utils/declared-dependencies.js.map +1 -0
- package/src/utils/dependencies.d.ts +18 -0
- package/src/utils/dependencies.js +206 -0
- package/src/utils/dependencies.js.map +1 -0
- package/src/utils/docker.d.ts +101 -0
- package/src/utils/docker.js +135 -0
- package/src/utils/docker.js.map +1 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.d.ts +2 -2
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +39 -33
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -1
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +18 -5
- package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +24 -4
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +66 -18
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +46 -6
- package/src/utils/files/common/constructs/src/core/cloudfront.ts.template +14 -0
- package/src/utils/files/common/constructs/src/core/index.ts.template +5 -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/{ts/dynamodb/files/scripts → utils/files/common/scripts/src/dynamodb}/create-local-table.ts.template +65 -31
- package/src/utils/files/common/scripts/src/dynamodb/pull-image.ts.template +13 -0
- package/src/{ts/dynamodb/files/scripts → utils/files/common/scripts/src/dynamodb}/start-container.ts.template +29 -22
- package/src/utils/files/common/scripts/src/infra/infra-deploy.ts.template +2 -0
- package/src/utils/files/common/scripts/src/infra/infra-destroy.ts.template +2 -0
- package/src/utils/files/common/scripts/src/infra/stage-credentials/cdk-command.ts.template +25 -0
- package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/run.ts.template +3 -3
- package/src/utils/files/common/scripts/src/rdb/mysql/wait-for-mysql-db.ts.template +32 -0
- package/src/utils/files/common/scripts/src/rdb/postgres/wait-for-postgres-db.ts.template +32 -0
- package/src/utils/files/common/scripts/src/rdb/shared/pull-image.ts.template +16 -0
- package/src/utils/files/common/scripts/src/rdb/shared/start-container.ts.template +100 -0
- package/src/utils/files/common/shadcn/readme/README.md.template +3 -3
- package/src/utils/files/common/shadcn/src/index.ts.template +2 -2
- package/src/utils/files/shadcn/components.json.template +1 -1
- package/src/utils/files/terraform/src/core/asset-bucket/asset-bucket.tf.template +63 -72
- package/src/utils/files/terraform/src/core/runtime-config/appconfig/appconfig.tf.template +3 -3
- package/src/utils/files/terraform/src/core/runtime-config/appconfig-deployment/appconfig-deployment.tf.template +13 -7
- package/src/utils/files/terraform/src/core/runtime-config/entry/entry.tf.template +1 -1
- package/src/utils/files/terraform/src/core/runtime-config/read/read.tf.template +9 -4
- package/src/utils/files/terraform/src/metrics/providers.tf.template +12 -0
- package/src/utils/files/website/hooks/sigv4/useSigV4.tsx.template +1 -1
- package/src/utils/format.d.ts +44 -4
- package/src/utils/format.js +323 -198
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.d.ts +24 -5
- package/src/utils/fs.js +40 -15
- package/src/utils/fs.js.map +1 -1
- package/src/utils/function-constructs/files/cdk/app/lambda-functions/__nameKebabCase__.ts.template +1 -1
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/__nameKebabCase__/__nameKebabCase__.tf.template +6 -2
- package/src/utils/function-constructs/function-constructs.d.ts +1 -1
- package/src/utils/function-constructs/function-constructs.js +24 -27
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.d.ts +33 -0
- package/src/utils/generators.js +33 -20
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.js +19 -34
- package/src/utils/git.js.map +1 -1
- package/src/utils/iac-providers.js +5 -5
- package/src/utils/iac-providers.js.map +1 -1
- package/src/utils/iac.d.ts +2 -2
- package/src/utils/iac.js +12 -14
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +218 -30
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +32 -9
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +226 -25
- package/src/utils/identity-constructs/files/terraform/core/user-identity/main.tf.template +33 -0
- package/src/utils/identity-constructs/identity-constructs.d.ts +11 -1
- package/src/utils/identity-constructs/identity-constructs.js +52 -31
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/init.d.ts +73 -0
- package/src/utils/init.js +300 -0
- package/src/utils/init.js.map +1 -0
- package/src/utils/install.d.ts +32 -0
- package/src/utils/install.js +58 -0
- package/src/utils/install.js.map +1 -0
- package/src/utils/js.js +27 -20
- package/src/utils/js.js.map +1 -1
- package/src/utils/lambda-runtime-resolution.d.ts +53 -0
- package/src/utils/lambda-runtime-resolution.js +83 -0
- package/src/utils/lambda-runtime-resolution.js.map +1 -0
- package/src/utils/mcp.d.ts +9 -0
- package/src/utils/mcp.js +42 -41
- package/src/utils/mcp.js.map +1 -1
- package/src/utils/metrics.d.ts +1 -1
- package/src/utils/metrics.js +30 -45
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/migration-manifest.d.ts +58 -0
- package/src/utils/migration-manifest.js +76 -0
- package/src/utils/migration-manifest.js.map +1 -0
- package/src/utils/migration-versions.d.ts +145 -0
- package/src/utils/migration-versions.js +250 -0
- package/src/utils/migration-versions.js.map +1 -0
- package/src/utils/mock-project-graph.js +12 -13
- package/src/utils/mock-project-graph.js.map +1 -1
- package/src/utils/module-format.d.ts +25 -0
- package/src/utils/module-format.js +45 -0
- package/src/utils/module-format.js.map +1 -0
- package/src/utils/names.d.ts +22 -0
- package/src/utils/names.js +44 -48
- package/src/utils/names.js.map +1 -1
- package/src/utils/npm-scope.d.ts +0 -4
- package/src/utils/npm-scope.js +7 -20
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +91 -6
- package/src/utils/nx.js +186 -74
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.js +27 -15
- package/src/utils/nxlv-python.js.map +1 -1
- package/src/utils/object.js +5 -11
- package/src/utils/object.js.map +1 -1
- package/src/utils/open-api-codegen-target.d.ts +28 -0
- package/src/utils/open-api-codegen-target.js +31 -0
- package/src/utils/open-api-codegen-target.js.map +1 -0
- package/src/utils/paths.js +11 -15
- package/src/utils/paths.js.map +1 -1
- package/src/utils/pkg-manager.d.ts +1 -1
- package/src/utils/pkg-manager.js +4 -9
- package/src/utils/pkg-manager.js.map +1 -1
- package/src/utils/pnpm-workspace.d.ts +1 -12
- package/src/utils/pnpm-workspace.js +16 -43
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.d.ts +6 -5
- package/src/utils/port.js +31 -39
- package/src/utils/port.js.map +1 -1
- package/src/utils/project-package-json.d.ts +39 -0
- package/src/utils/project-package-json.js +119 -0
- package/src/utils/project-package-json.js.map +1 -0
- package/src/utils/py.d.ts +18 -4
- package/src/utils/py.js +64 -46
- package/src/utils/py.js.map +1 -1
- package/src/utils/rdb-constructs/files/cdk/app/dbs/__nameKebabCase__.ts.template +72 -18
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +130 -88
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +132 -66
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +78 -162
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +26 -3
- package/src/utils/rdb-constructs/rdb-constructs.js +61 -33
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/ruff.d.ts +59 -0
- package/src/utils/ruff.js +140 -0
- package/src/utils/ruff.js.map +1 -0
- package/src/utils/shared-constructs-constants.d.ts +68 -4
- package/src/utils/shared-constructs-constants.js +68 -15
- package/src/utils/shared-constructs-constants.js.map +1 -1
- package/src/utils/shared-constructs.d.ts +5 -2
- package/src/utils/shared-constructs.js +62 -67
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-dynamodb-scripts.d.ts +18 -0
- package/src/utils/shared-dynamodb-scripts.js +35 -0
- package/src/utils/shared-dynamodb-scripts.js.map +1 -0
- package/src/utils/shared-infra-config.js +31 -30
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-infra-scripts.d.ts +26 -0
- package/src/utils/shared-infra-scripts.js +58 -0
- package/src/utils/shared-infra-scripts.js.map +1 -0
- package/src/utils/shared-rdb-scripts.d.ts +27 -0
- package/src/utils/shared-rdb-scripts.js +59 -0
- package/src/utils/shared-rdb-scripts.js.map +1 -0
- package/src/utils/shared-scripts.d.ts +1 -4
- package/src/utils/shared-scripts.js +12 -38
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.d.ts +26 -1
- package/src/utils/shared-shadcn.js +93 -67
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/smithy.d.ts +59 -0
- package/src/utils/smithy.js +73 -0
- package/src/utils/smithy.js.map +1 -0
- package/src/utils/test-git.d.ts +39 -0
- package/src/utils/test-git.js +117 -0
- package/src/utils/test-git.js.map +1 -0
- package/src/utils/test.d.ts +10 -0
- package/src/utils/test.js +44 -25
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.d.ts +5 -0
- package/src/utils/toml.js +17 -15
- package/src/utils/toml.js.map +1 -1
- package/src/utils/version-upgrade-migration/migration.d.ts +14 -0
- package/src/utils/version-upgrade-migration/migration.js +16 -0
- package/src/utils/version-upgrade-migration/migration.js.map +1 -0
- package/src/utils/version-upgrade-migration/nx-package-updates.d.ts +45 -0
- package/src/utils/version-upgrade-migration/nx-package-updates.js +50 -0
- package/src/utils/version-upgrade-migration/nx-package-updates.js.map +1 -0
- package/src/utils/version-upgrade-migration/owned-dependencies.d.ts +76 -0
- package/src/utils/version-upgrade-migration/owned-dependencies.js +146 -0
- package/src/utils/version-upgrade-migration/owned-dependencies.js.map +1 -0
- package/src/utils/version-upgrade-migration/register.d.ts +29 -0
- package/src/utils/version-upgrade-migration/register.js +42 -0
- package/src/utils/version-upgrade-migration/register.js.map +1 -0
- package/src/utils/version-upgrade-migration/sync-embedded-versions.d.ts +26 -0
- package/src/utils/version-upgrade-migration/sync-embedded-versions.js +352 -0
- package/src/utils/version-upgrade-migration/sync-embedded-versions.js.map +1 -0
- package/src/utils/version-upgrade-migration/sync-lambda-runtimes.d.ts +28 -0
- package/src/utils/version-upgrade-migration/sync-lambda-runtimes.js +148 -0
- package/src/utils/version-upgrade-migration/sync-lambda-runtimes.js.map +1 -0
- package/src/utils/version-upgrade-migration/sync-metrics-version.d.ts +13 -0
- package/src/utils/version-upgrade-migration/sync-metrics-version.js +33 -0
- package/src/utils/version-upgrade-migration/sync-metrics-version.js.map +1 -0
- package/src/utils/version-upgrade-migration/sync-python-language-version.d.ts +31 -0
- package/src/utils/version-upgrade-migration/sync-python-language-version.js +110 -0
- package/src/utils/version-upgrade-migration/sync-python-language-version.js.map +1 -0
- package/src/utils/version-upgrade-migration/sync-vended-versions.d.ts +10 -0
- package/src/utils/version-upgrade-migration/sync-vended-versions.js +547 -0
- package/src/utils/version-upgrade-migration/sync-vended-versions.js.map +1 -0
- package/src/utils/version-upgrade-migration/vended-upgrade.d.ts +14 -0
- package/src/utils/version-upgrade-migration/vended-upgrade.js +40 -0
- package/src/utils/version-upgrade-migration/vended-upgrade.js.map +1 -0
- package/src/utils/versions.d.ts +300 -108
- package/src/utils/versions.js +317 -121
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/app/static-websites/__websiteNameKebabCase__.ts.template +12 -3
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +252 -49
- package/src/utils/website-constructs/files/terraform/app/static-websites/__websiteNameKebabCase__/__websiteNameKebabCase__.tf.template +56 -1
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +205 -107
- package/src/utils/website-constructs/website-constructs.d.ts +12 -1
- package/src/utils/website-constructs/website-constructs.js +49 -30
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- package/bin/aws-nx-mcp.d.ts +0 -2
- package/bin/aws-nx-mcp.js +0 -17
- package/bin/aws-nx-mcp.js.map +0 -1
- package/sdk/connection.d.ts +0 -6
- package/sdk/connection.js +0 -10
- package/sdk/connection.js.map +0 -1
- package/sdk/license.d.ts +0 -8
- package/sdk/license.js +0 -13
- package/sdk/license.js.map +0 -1
- package/sdk/open-api.d.ts +0 -10
- package/sdk/open-api.js +0 -15
- package/sdk/open-api.js.map +0 -1
- package/sdk/py.d.ts +0 -14
- package/sdk/py.js +0 -18
- package/sdk/py.js.map +0 -1
- package/sdk/terraform.d.ts +0 -6
- package/sdk/terraform.js +0 -11
- package/sdk/terraform.js.map +0 -1
- package/sdk/ts.d.ts +0 -29
- package/sdk/ts.js +0 -47
- package/sdk/ts.js.map +0 -1
- package/sdk/utils/ast.js +0 -12
- package/sdk/utils/ast.js.map +0 -1
- package/sdk/utils/format.js +0 -10
- package/sdk/utils/format.js.map +0 -1
- package/sdk/utils/test.js +0 -10
- package/sdk/utils/test.js.map +0 -1
- package/src/connection/agent-serve-local.d.ts +0 -33
- package/src/connection/agent-serve-local.js +0 -48
- package/src/connection/agent-serve-local.js.map +0 -1
- package/src/connection/serve-local.js +0 -41
- package/src/connection/serve-local.js.map +0 -1
- package/src/py/agent/__snapshots__/generator.spec.ts.snap +0 -771
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client.py.template +0 -22
- package/src/py/agent/files/a2a/main.py.template +0 -54
- package/src/py/agent/files/ag-ui/main.py.template +0 -37
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client.py.template +0 -22
- package/src/py/agent/react-connection/serve-local.js +0 -30
- package/src/py/agent/react-connection/serve-local.js.map +0 -1
- package/src/py/agent/scripts/http/chat.ts.template +0 -38
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client.ts.template +0 -19
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client.ts.template +0 -19
- package/src/ts/agent/react-connection/serve-local.d.ts +0 -13
- package/src/ts/agent/react-connection/serve-local.js +0 -19
- package/src/ts/agent/react-connection/serve-local.js.map +0 -1
- package/src/ts/agent/scripts/http/chat.ts.template +0 -35
- package/src/ts/dynamodb/files/scripts/pull-image.ts.template +0 -15
- package/src/ts/dynamodb/files/src/constants.ts.template +0 -9
- package/src/ts/dynamodb/files/src/gsi.ts.template +0 -14
- package/src/ts/rdb/files/scripts/pull-image.ts.template +0 -15
- package/src/ts/rdb/files/scripts/start-container.ts.template +0 -84
- package/src/ts/rdb/files/scripts/wait-for-db.ts.template +0 -55
- package/src/ts/rdb/files/src/constants.ts.template +0 -8
- package/src/ts/rdb/files/src/index.ts.template +0 -2
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client.ts.template +0 -123
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-client.ts.template +0 -128
- package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client.py.template +0 -120
- package/src/utils/agent-connection/files/py-core-mcp/agentcore_mcp_client.py.template +0 -89
- package/src/utils/files/common/scripts/src/infra-deploy.ts.template +0 -2
- package/src/utils/files/common/scripts/src/infra-destroy.ts.template +0 -2
- package/src/utils/files/common/scripts/src/stage-credentials/cdk-command.ts.template +0 -18
- package/src/utils/files/terraform/scripts/reset-runtime-config.ts.template +0 -25
- /package/src/py/agent/files/{common → langchain/common}/__init__.py.template +0 -0
- /package/src/smithy/project/files/{src → service/src}/main.smithy.template +0 -0
- /package/src/utils/agent-connection/files/{py-core-runtime-config/model_errors.py.template → py-core-strands/base/model_errors_strands.py.template} +0 -0
- /package/src/utils/files/common/scripts/src/{index.ts.template → infra/index.ts.template} +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/credentials.ts.template +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/stage-parser.ts.template +0 -0
|
@@ -21,8 +21,8 @@ export default defineConfig(() => ({
|
|
|
21
21
|
},
|
|
22
22
|
plugins: [
|
|
23
23
|
tanstackRouter({
|
|
24
|
-
routesDirectory: resolve(
|
|
25
|
-
generatedRouteTree: resolve(
|
|
24
|
+
routesDirectory: resolve(import.meta.dirname, 'src/routes'),
|
|
25
|
+
generatedRouteTree: resolve(import.meta.dirname, 'src/routeTree.gen.ts'),
|
|
26
26
|
}),
|
|
27
27
|
react(),
|
|
28
28
|
tailwindcss(),
|
|
@@ -32,7 +32,7 @@ export default defineConfig(() => ({
|
|
|
32
32
|
// plugins: [],
|
|
33
33
|
// },
|
|
34
34
|
build: {
|
|
35
|
-
outDir: '../dist/test-app',
|
|
35
|
+
outDir: '../dist/test-app/bundle',
|
|
36
36
|
emptyOutDir: true,
|
|
37
37
|
reportCompressedSize: true,
|
|
38
38
|
commonjsOptions: {
|
|
@@ -48,11 +48,11 @@ export default defineConfig(() => ({
|
|
|
48
48
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
49
49
|
reporters: ['default'],
|
|
50
50
|
coverage: {
|
|
51
|
-
reportsDirectory: '
|
|
51
|
+
reportsDirectory: '../dist/test-app/test-output/vitest/coverage',
|
|
52
52
|
provider: 'v8' as const,
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
|
-
resolve: { tsconfigPaths: true },
|
|
55
|
+
resolve: { tsconfigPaths: true, dedupe: ['react', 'react-dom'] },
|
|
56
56
|
define: { global: {} },
|
|
57
57
|
}));
|
|
58
58
|
"
|
|
@@ -78,8 +78,8 @@ export default defineConfig(() => ({
|
|
|
78
78
|
},
|
|
79
79
|
plugins: [
|
|
80
80
|
tanstackRouter({
|
|
81
|
-
routesDirectory: resolve(
|
|
82
|
-
generatedRouteTree: resolve(
|
|
81
|
+
routesDirectory: resolve(import.meta.dirname, 'src/routes'),
|
|
82
|
+
generatedRouteTree: resolve(import.meta.dirname, 'src/routeTree.gen.ts'),
|
|
83
83
|
}),
|
|
84
84
|
react(),
|
|
85
85
|
],
|
|
@@ -88,7 +88,7 @@ export default defineConfig(() => ({
|
|
|
88
88
|
// plugins: [],
|
|
89
89
|
// },
|
|
90
90
|
build: {
|
|
91
|
-
outDir: '../dist/test-app',
|
|
91
|
+
outDir: '../dist/test-app/bundle',
|
|
92
92
|
emptyOutDir: true,
|
|
93
93
|
reportCompressedSize: true,
|
|
94
94
|
commonjsOptions: {
|
|
@@ -104,11 +104,11 @@ export default defineConfig(() => ({
|
|
|
104
104
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
105
105
|
reporters: ['default'],
|
|
106
106
|
coverage: {
|
|
107
|
-
reportsDirectory: '
|
|
107
|
+
reportsDirectory: '../dist/test-app/test-output/vitest/coverage',
|
|
108
108
|
provider: 'v8' as const,
|
|
109
109
|
},
|
|
110
110
|
},
|
|
111
|
-
resolve: { tsconfigPaths: true },
|
|
111
|
+
resolve: { tsconfigPaths: true, dedupe: ['react', 'react-dom'] },
|
|
112
112
|
define: { global: {} },
|
|
113
113
|
}));
|
|
114
114
|
"
|
|
@@ -131,12 +131,16 @@ exports[`react-website generator > TailwindCSS integration > terraform iac > sho
|
|
|
131
131
|
required_providers {
|
|
132
132
|
aws = {
|
|
133
133
|
source = "hashicorp/aws"
|
|
134
|
-
version = "
|
|
134
|
+
version = "6.62.0"
|
|
135
135
|
configuration_aliases = [aws.us_east_1]
|
|
136
136
|
}
|
|
137
|
+
null = {
|
|
138
|
+
source = "hashicorp/null"
|
|
139
|
+
version = "3.3.1"
|
|
140
|
+
}
|
|
137
141
|
random = {
|
|
138
142
|
source = "hashicorp/random"
|
|
139
|
-
version = "
|
|
143
|
+
version = "3.9.0"
|
|
140
144
|
}
|
|
141
145
|
}
|
|
142
146
|
}
|
|
@@ -152,6 +156,73 @@ variable "website_file_path" {
|
|
|
152
156
|
type = string
|
|
153
157
|
}
|
|
154
158
|
|
|
159
|
+
variable "custom_domain_names" {
|
|
160
|
+
description = "Custom domain names (aliases) for the CloudFront distribution. Requires acm_certificate_arn."
|
|
161
|
+
type = list(string)
|
|
162
|
+
default = []
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
variable "acm_certificate_arn" {
|
|
166
|
+
description = "ARN of an ACM certificate (in us-east-1) for the custom domain names. When set, viewers are required to use TLS 1.2 or later."
|
|
167
|
+
type = string
|
|
168
|
+
default = null
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
variable "enable_waf" {
|
|
172
|
+
description = "Whether to protect the CloudFront distribution with an AWS WAF Web ACL."
|
|
173
|
+
type = bool
|
|
174
|
+
default = true
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
variable "encryption" {
|
|
178
|
+
description = "Server-side encryption for the website and distribution log buckets. One of KMS or S3_MANAGED."
|
|
179
|
+
type = string
|
|
180
|
+
default = "KMS"
|
|
181
|
+
|
|
182
|
+
validation {
|
|
183
|
+
condition = contains(["KMS", "S3_MANAGED"], var.encryption)
|
|
184
|
+
error_message = "encryption must be one of KMS or S3_MANAGED."
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
variable "kms_key_arn" {
|
|
189
|
+
description = "ARN of an existing KMS key used to encrypt the website and distribution log buckets when encryption is KMS. When not provided and create_kms_key is true, a new key is created. Note that a customer-supplied key must already grant the CloudWatch Logs, S3 and CloudFront service principals the necessary permissions in its own key policy."
|
|
190
|
+
type = string
|
|
191
|
+
default = null
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
variable "create_kms_key" {
|
|
195
|
+
description = "Whether to create a KMS key for the website. Only applies when encryption is KMS. Set to false when supplying kms_key_arn."
|
|
196
|
+
type = bool
|
|
197
|
+
default = true
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
variable "enable_key_rotation" {
|
|
201
|
+
description = "Whether the automatically created KMS key has rotation enabled. Only applies when encryption is KMS and create_kms_key is true."
|
|
202
|
+
type = bool
|
|
203
|
+
default = true
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
# Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
207
|
+
# framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
208
|
+
# (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
209
|
+
# Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
210
|
+
# connect-src to your specific origins once they are known.
|
|
211
|
+
locals {
|
|
212
|
+
content_security_policy = "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; connect-src 'self' https: wss:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'"
|
|
213
|
+
|
|
214
|
+
# Delivery source/destination names have a 60 character maximum. Truncate the
|
|
215
|
+
# website name so the longest delivery name stays within the limit.
|
|
216
|
+
access_logs_name_prefix = substr(lower(var.website_name), 0, 16)
|
|
217
|
+
|
|
218
|
+
create_website_key = var.encryption == "KMS" && var.create_kms_key
|
|
219
|
+
website_kms_key_arn = (
|
|
220
|
+
var.encryption != "KMS" ? null :
|
|
221
|
+
local.create_website_key ? aws_kms_key.website_key[0].arn :
|
|
222
|
+
var.kms_key_arn
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
|
|
155
226
|
|
|
156
227
|
# Data sources
|
|
157
228
|
data "aws_caller_identity" "current" {}
|
|
@@ -160,9 +231,11 @@ data "aws_region" "current" {}
|
|
|
160
231
|
|
|
161
232
|
# KMS Key for encryption
|
|
162
233
|
resource "aws_kms_key" "website_key" {
|
|
234
|
+
count = local.create_website_key ? 1 : 0
|
|
235
|
+
|
|
163
236
|
description = "KMS key for \${var.website_name} website encryption"
|
|
164
237
|
deletion_window_in_days = 7
|
|
165
|
-
enable_key_rotation =
|
|
238
|
+
enable_key_rotation = var.enable_key_rotation
|
|
166
239
|
|
|
167
240
|
policy = jsonencode({
|
|
168
241
|
Version = "2012-10-17"
|
|
@@ -188,6 +261,26 @@ resource "aws_kms_key" "website_key" {
|
|
|
188
261
|
]
|
|
189
262
|
Resource = "*"
|
|
190
263
|
},
|
|
264
|
+
{
|
|
265
|
+
Sid = "AllowCloudWatchLogs"
|
|
266
|
+
Effect = "Allow"
|
|
267
|
+
Principal = {
|
|
268
|
+
Service = "logs.\${data.aws_region.current.region}.amazonaws.com"
|
|
269
|
+
}
|
|
270
|
+
Action = [
|
|
271
|
+
"kms:Encrypt",
|
|
272
|
+
"kms:Decrypt",
|
|
273
|
+
"kms:ReEncrypt*",
|
|
274
|
+
"kms:GenerateDataKey*",
|
|
275
|
+
"kms:DescribeKey"
|
|
276
|
+
]
|
|
277
|
+
Resource = "*"
|
|
278
|
+
Condition = {
|
|
279
|
+
ArnLike = {
|
|
280
|
+
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.region}:\${data.aws_caller_identity.current.account_id}:log-group:*"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
191
284
|
{
|
|
192
285
|
Sid = "AllowCloudFrontServicePrincipalSSE-KMS"
|
|
193
286
|
Effect = "Allow"
|
|
@@ -215,22 +308,18 @@ resource "aws_kms_key" "website_key" {
|
|
|
215
308
|
}
|
|
216
309
|
|
|
217
310
|
resource "aws_kms_alias" "website_key_alias" {
|
|
311
|
+
count = local.create_website_key ? 1 : 0
|
|
312
|
+
|
|
218
313
|
name = "alias/\${lower(var.website_name)}-website-key-\${random_id.unique_suffix.hex}"
|
|
219
|
-
target_key_id = aws_kms_key.website_key.key_id
|
|
314
|
+
target_key_id = aws_kms_key.website_key[0].key_id
|
|
220
315
|
}
|
|
221
316
|
|
|
222
|
-
#
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
bucket = "\${lower(var.website_name)}-access-logs-\${random_id.bucket_suffix.hex}"
|
|
229
|
-
force_destroy = true
|
|
230
|
-
|
|
231
|
-
tags = {
|
|
232
|
-
Name = "\${lower(var.website_name)}-access-logs"
|
|
233
|
-
}
|
|
317
|
+
# CloudWatch log group receiving S3 server access logs for the website and
|
|
318
|
+
# distribution log buckets.
|
|
319
|
+
resource "aws_cloudwatch_log_group" "access_logs" {
|
|
320
|
+
name = "/aws/s3/\${lower(var.website_name)}-access-logs-\${random_id.bucket_suffix.hex}"
|
|
321
|
+
retention_in_days = 365
|
|
322
|
+
kms_key_id = local.website_kms_key_arn
|
|
234
323
|
}
|
|
235
324
|
|
|
236
325
|
resource "random_id" "unique_suffix" {
|
|
@@ -241,63 +330,12 @@ resource "random_id" "bucket_suffix" {
|
|
|
241
330
|
byte_length = 8
|
|
242
331
|
}
|
|
243
332
|
|
|
244
|
-
resource "aws_s3_bucket_versioning" "access_logs_versioning" {
|
|
245
|
-
bucket = aws_s3_bucket.access_logs.id
|
|
246
|
-
versioning_configuration {
|
|
247
|
-
status = "Disabled"
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
resource "aws_s3_bucket_server_side_encryption_configuration" "access_logs_encryption" {
|
|
252
|
-
bucket = aws_s3_bucket.access_logs.id
|
|
253
|
-
|
|
254
|
-
rule {
|
|
255
|
-
apply_server_side_encryption_by_default {
|
|
256
|
-
kms_master_key_id = aws_kms_key.website_key.arn
|
|
257
|
-
sse_algorithm = "aws:kms"
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
resource "aws_s3_bucket_public_access_block" "access_logs_pab" {
|
|
263
|
-
bucket = aws_s3_bucket.access_logs.id
|
|
264
|
-
|
|
265
|
-
block_public_acls = true
|
|
266
|
-
block_public_policy = true
|
|
267
|
-
ignore_public_acls = true
|
|
268
|
-
restrict_public_buckets = true
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
resource "aws_s3_bucket_policy" "access_logs_ssl_policy" {
|
|
272
|
-
bucket = aws_s3_bucket.access_logs.id
|
|
273
|
-
|
|
274
|
-
policy = jsonencode({
|
|
275
|
-
Version = "2012-10-17"
|
|
276
|
-
Statement = [
|
|
277
|
-
{
|
|
278
|
-
Sid = "DenyInsecureConnections"
|
|
279
|
-
Effect = "Deny"
|
|
280
|
-
Principal = "*"
|
|
281
|
-
Action = "s3:*"
|
|
282
|
-
Resource = [
|
|
283
|
-
aws_s3_bucket.access_logs.arn,
|
|
284
|
-
"\${aws_s3_bucket.access_logs.arn}/*"
|
|
285
|
-
]
|
|
286
|
-
Condition = {
|
|
287
|
-
Bool = {
|
|
288
|
-
"aws:SecureTransport" = "false"
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
]
|
|
293
|
-
})
|
|
294
|
-
}
|
|
295
|
-
|
|
296
333
|
# Website Bucket
|
|
297
334
|
resource "aws_s3_bucket" "website" {
|
|
298
335
|
#checkov:skip=CKV2_AWS_61:Lifecycle configuration not required for static website content
|
|
299
336
|
#checkov:skip=CKV_AWS_144:Cross-region replication not required for static website
|
|
300
337
|
#checkov:skip=CKV2_AWS_62:Event notifications not required for static website bucket
|
|
338
|
+
#checkov:skip=CKV_AWS_18:Server access logs are delivered to CloudWatch Logs (see aws_cloudwatch_log_delivery.website)
|
|
301
339
|
bucket = "\${lower(var.website_name)}-website-\${random_id.bucket_suffix.hex}"
|
|
302
340
|
force_destroy = true
|
|
303
341
|
|
|
@@ -318,8 +356,8 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "website_encryptio
|
|
|
318
356
|
|
|
319
357
|
rule {
|
|
320
358
|
apply_server_side_encryption_by_default {
|
|
321
|
-
kms_master_key_id =
|
|
322
|
-
sse_algorithm = "aws:kms"
|
|
359
|
+
kms_master_key_id = var.encryption == "KMS" ? local.website_kms_key_arn : null
|
|
360
|
+
sse_algorithm = var.encryption == "KMS" ? "aws:kms" : "AES256"
|
|
323
361
|
}
|
|
324
362
|
}
|
|
325
363
|
}
|
|
@@ -341,20 +379,35 @@ resource "aws_s3_bucket_ownership_controls" "website_ownership" {
|
|
|
341
379
|
}
|
|
342
380
|
}
|
|
343
381
|
|
|
344
|
-
|
|
345
|
-
|
|
382
|
+
# Deliver the website bucket's server access logs to CloudWatch Logs.
|
|
383
|
+
resource "aws_cloudwatch_log_delivery_source" "website" {
|
|
384
|
+
name = "\${local.access_logs_name_prefix}-website-logs-\${random_id.bucket_suffix.hex}"
|
|
385
|
+
log_type = "S3_SERVER_ACCESS_LOGS"
|
|
386
|
+
resource_arn = aws_s3_bucket.website.arn
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
resource "aws_cloudwatch_log_delivery_destination" "access_logs" {
|
|
390
|
+
name = "\${local.access_logs_name_prefix}-access-logs-\${random_id.bucket_suffix.hex}"
|
|
391
|
+
|
|
392
|
+
delivery_destination_configuration {
|
|
393
|
+
destination_resource_arn = aws_cloudwatch_log_group.access_logs.arn
|
|
394
|
+
}
|
|
395
|
+
}
|
|
346
396
|
|
|
347
|
-
|
|
348
|
-
|
|
397
|
+
resource "aws_cloudwatch_log_delivery" "website" {
|
|
398
|
+
delivery_source_name = aws_cloudwatch_log_delivery_source.website.name
|
|
399
|
+
delivery_destination_arn = aws_cloudwatch_log_delivery_destination.access_logs.arn
|
|
349
400
|
}
|
|
350
401
|
|
|
351
402
|
|
|
352
|
-
# Distribution Log Bucket
|
|
403
|
+
# Distribution Log Bucket — holds CloudFront standard access logs (CloudFront
|
|
404
|
+
# delivers only to S3). Its own S3 server access logs go to CloudWatch Logs.
|
|
353
405
|
resource "aws_s3_bucket" "distribution_logs" {
|
|
354
406
|
#checkov:skip=CKV2_AWS_61:Lifecycle configuration not required for CloudFront logs
|
|
355
407
|
#checkov:skip=CKV_AWS_144:Cross-region replication not required for CloudFront logs
|
|
356
408
|
#checkov:skip=CKV2_AWS_62:Event notifications not required for CloudFront logs bucket
|
|
357
409
|
#checkov:skip=CKV_AWS_21:Versioning not required for CloudFront access logs
|
|
410
|
+
#checkov:skip=CKV_AWS_18:Server access logs are delivered to CloudWatch Logs (see aws_cloudwatch_log_delivery.distribution_logs)
|
|
358
411
|
bucket = "\${lower(var.website_name)}-distribution-logs-\${random_id.bucket_suffix.hex}"
|
|
359
412
|
force_destroy = true
|
|
360
413
|
|
|
@@ -368,8 +421,8 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "distribution_logs
|
|
|
368
421
|
|
|
369
422
|
rule {
|
|
370
423
|
apply_server_side_encryption_by_default {
|
|
371
|
-
kms_master_key_id =
|
|
372
|
-
sse_algorithm = "aws:kms"
|
|
424
|
+
kms_master_key_id = var.encryption == "KMS" ? local.website_kms_key_arn : null
|
|
425
|
+
sse_algorithm = var.encryption == "KMS" ? "aws:kms" : "AES256"
|
|
373
426
|
}
|
|
374
427
|
}
|
|
375
428
|
}
|
|
@@ -400,11 +453,16 @@ resource "aws_s3_bucket_acl" "distribution_logs_acl" {
|
|
|
400
453
|
depends_on = [aws_s3_bucket_ownership_controls.distribution_logs_ownership]
|
|
401
454
|
}
|
|
402
455
|
|
|
403
|
-
|
|
404
|
-
|
|
456
|
+
# Deliver the distribution log bucket's server access logs to CloudWatch Logs.
|
|
457
|
+
resource "aws_cloudwatch_log_delivery_source" "distribution_logs" {
|
|
458
|
+
name = "\${local.access_logs_name_prefix}-distribution-logs-\${random_id.bucket_suffix.hex}"
|
|
459
|
+
log_type = "S3_SERVER_ACCESS_LOGS"
|
|
460
|
+
resource_arn = aws_s3_bucket.distribution_logs.arn
|
|
461
|
+
}
|
|
405
462
|
|
|
406
|
-
|
|
407
|
-
|
|
463
|
+
resource "aws_cloudwatch_log_delivery" "distribution_logs" {
|
|
464
|
+
delivery_source_name = aws_cloudwatch_log_delivery_source.distribution_logs.name
|
|
465
|
+
delivery_destination_arn = aws_cloudwatch_log_delivery_destination.access_logs.arn
|
|
408
466
|
}
|
|
409
467
|
|
|
410
468
|
resource "aws_s3_bucket_policy" "distribution_logs_ssl_policy" {
|
|
@@ -434,6 +492,8 @@ resource "aws_s3_bucket_policy" "distribution_logs_ssl_policy" {
|
|
|
434
492
|
|
|
435
493
|
# WAF Web ACL (must be in us-east-1 for CloudFront)
|
|
436
494
|
resource "aws_wafv2_web_acl" "cloudfront_waf" {
|
|
495
|
+
count = var.enable_waf ? 1 : 0
|
|
496
|
+
|
|
437
497
|
#checkov:skip=CKV2_AWS_31:WAF logging disabled
|
|
438
498
|
provider = aws.us_east_1
|
|
439
499
|
name = "\${lower(var.website_name)}-cloudfront-waf-\${random_id.unique_suffix.hex}"
|
|
@@ -512,13 +572,42 @@ resource "aws_cloudfront_origin_access_control" "website_oac" {
|
|
|
512
572
|
signing_protocol = "sigv4"
|
|
513
573
|
}
|
|
514
574
|
|
|
575
|
+
# Security headers applied to all responses.
|
|
576
|
+
resource "aws_cloudfront_response_headers_policy" "website" {
|
|
577
|
+
name = "\${aws_s3_bucket.website.bucket}-security-headers"
|
|
578
|
+
|
|
579
|
+
security_headers_config {
|
|
580
|
+
strict_transport_security {
|
|
581
|
+
access_control_max_age_sec = 63072000
|
|
582
|
+
include_subdomains = true
|
|
583
|
+
preload = true
|
|
584
|
+
override = true
|
|
585
|
+
}
|
|
586
|
+
content_type_options {
|
|
587
|
+
override = true
|
|
588
|
+
}
|
|
589
|
+
frame_options {
|
|
590
|
+
frame_option = "DENY"
|
|
591
|
+
override = true
|
|
592
|
+
}
|
|
593
|
+
referrer_policy {
|
|
594
|
+
referrer_policy = "strict-origin-when-cross-origin"
|
|
595
|
+
override = true
|
|
596
|
+
}
|
|
597
|
+
content_security_policy {
|
|
598
|
+
content_security_policy = local.content_security_policy
|
|
599
|
+
override = true
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
515
604
|
# CloudFront Distribution
|
|
516
605
|
resource "aws_cloudfront_distribution" "website" {
|
|
606
|
+
# See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
517
607
|
#checkov:skip=CKV_AWS_174:Using CloudFront default certificate which does not support TLS v1.2
|
|
518
608
|
#checkov:skip=CKV_AWS_310:Origin failover not required for single S3 origin static website
|
|
519
609
|
#checkov:skip=CKV_AWS_374:Geo restrictions not required for global web application
|
|
520
610
|
#checkov:skip=CKV2_AWS_42:Custom SSL certificate not required for development - using CloudFront default
|
|
521
|
-
#checkov:skip=CKV2_AWS_32:Response headers policy not required for basic static website
|
|
522
611
|
#checkov:skip=CKV2_AWS_47:WAF includes AWSManagedRulesKnownBadInputsRuleSet which provides Log4j protection
|
|
523
612
|
origin {
|
|
524
613
|
domain_name = aws_s3_bucket.website.bucket_regional_domain_name
|
|
@@ -529,7 +618,8 @@ resource "aws_cloudfront_distribution" "website" {
|
|
|
529
618
|
enabled = true
|
|
530
619
|
is_ipv6_enabled = true
|
|
531
620
|
default_root_object = "index.html"
|
|
532
|
-
web_acl_id = aws_wafv2_web_acl.cloudfront_waf.arn
|
|
621
|
+
web_acl_id = var.enable_waf ? aws_wafv2_web_acl.cloudfront_waf[0].arn : null
|
|
622
|
+
aliases = var.custom_domain_names
|
|
533
623
|
|
|
534
624
|
logging_config {
|
|
535
625
|
include_cookies = false
|
|
@@ -548,11 +638,12 @@ resource "aws_cloudfront_distribution" "website" {
|
|
|
548
638
|
}
|
|
549
639
|
}
|
|
550
640
|
|
|
551
|
-
viewer_protocol_policy
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
641
|
+
viewer_protocol_policy = "redirect-to-https"
|
|
642
|
+
response_headers_policy_id = aws_cloudfront_response_headers_policy.website.id
|
|
643
|
+
min_ttl = 0
|
|
644
|
+
default_ttl = 3600
|
|
645
|
+
max_ttl = 86400
|
|
646
|
+
compress = true
|
|
556
647
|
}
|
|
557
648
|
|
|
558
649
|
# Custom error responses for SPA routing
|
|
@@ -575,19 +666,16 @@ resource "aws_cloudfront_distribution" "website" {
|
|
|
575
666
|
}
|
|
576
667
|
|
|
577
668
|
viewer_certificate {
|
|
578
|
-
cloudfront_default_certificate =
|
|
669
|
+
cloudfront_default_certificate = var.acm_certificate_arn == null
|
|
670
|
+
acm_certificate_arn = var.acm_certificate_arn
|
|
671
|
+
ssl_support_method = var.acm_certificate_arn == null ? null : "sni-only"
|
|
672
|
+
minimum_protocol_version = var.acm_certificate_arn == null ? "TLSv1" : "TLSv1.2_2021"
|
|
579
673
|
}
|
|
580
674
|
|
|
581
675
|
tags = {
|
|
582
676
|
Name = "\${lower(var.website_name)}-distribution-\${random_id.unique_suffix.hex}"
|
|
583
677
|
}
|
|
584
678
|
|
|
585
|
-
lifecycle {
|
|
586
|
-
replace_triggered_by = [
|
|
587
|
-
aws_wafv2_web_acl.cloudfront_waf
|
|
588
|
-
]
|
|
589
|
-
}
|
|
590
|
-
|
|
591
679
|
# CloudFront validates access to the distribution logs bucket when it
|
|
592
680
|
# creates the distribution.
|
|
593
681
|
depends_on = [
|
|
@@ -656,8 +744,8 @@ resource "null_resource" "upload_website_files" {
|
|
|
656
744
|
|
|
657
745
|
provisioner "local-exec" {
|
|
658
746
|
command = <<-EOT
|
|
659
|
-
cd "
|
|
660
|
-
uv run --with boto3 python3 -c "
|
|
747
|
+
cd "$ROOT_PATH"
|
|
748
|
+
uv run --with boto3==1.43.82 python3 -c "
|
|
661
749
|
import os
|
|
662
750
|
import sys
|
|
663
751
|
import boto3
|
|
@@ -745,9 +833,14 @@ def sync_to_s3(local_path, bucket_name):
|
|
|
745
833
|
sys.exit(1)
|
|
746
834
|
|
|
747
835
|
# Execute sync
|
|
748
|
-
sync_to_s3(
|
|
836
|
+
sync_to_s3(os.environ['WEBSITE_FILE_PATH'], os.environ['BUCKET_NAME'])
|
|
749
837
|
"
|
|
750
838
|
EOT
|
|
839
|
+
environment = {
|
|
840
|
+
ROOT_PATH = path.root
|
|
841
|
+
WEBSITE_FILE_PATH = var.website_file_path
|
|
842
|
+
BUCKET_NAME = aws_s3_bucket.website.bucket
|
|
843
|
+
}
|
|
751
844
|
}
|
|
752
845
|
|
|
753
846
|
depends_on = [aws_s3_bucket_policy.website_cloudfront_policy]
|
|
@@ -755,11 +848,12 @@ sync_to_s3('\${var.website_file_path}', '\${aws_s3_bucket.website.bucket}')
|
|
|
755
848
|
|
|
756
849
|
# Upload runtime config file
|
|
757
850
|
resource "aws_s3_object" "runtime_config" {
|
|
758
|
-
bucket
|
|
759
|
-
key
|
|
760
|
-
content
|
|
761
|
-
content_type
|
|
762
|
-
|
|
851
|
+
bucket = aws_s3_bucket.website.id
|
|
852
|
+
key = "runtime-config.json"
|
|
853
|
+
content = module.runtime_config_reader.config_json
|
|
854
|
+
content_type = "application/json"
|
|
855
|
+
cache_control = "no-cache"
|
|
856
|
+
etag = md5(module.runtime_config_reader.config_json)
|
|
763
857
|
|
|
764
858
|
depends_on = [null_resource.upload_website_files]
|
|
765
859
|
}
|
|
@@ -774,8 +868,9 @@ resource "null_resource" "cloudfront_invalidation" {
|
|
|
774
868
|
|
|
775
869
|
provisioner "local-exec" {
|
|
776
870
|
command = <<-EOT
|
|
777
|
-
uv run --with boto3 python3 -c "
|
|
871
|
+
uv run --with boto3==1.43.82 python3 -c "
|
|
778
872
|
import boto3
|
|
873
|
+
import os
|
|
779
874
|
import sys
|
|
780
875
|
from botocore.exceptions import ClientError, NoCredentialsError
|
|
781
876
|
|
|
@@ -797,7 +892,7 @@ def create_invalidation(distribution_id):
|
|
|
797
892
|
|
|
798
893
|
invalidation_id = response['Invalidation']['Id']
|
|
799
894
|
print(f'CloudFront cache invalidation created: {invalidation_id}')
|
|
800
|
-
print(f'Distribution:
|
|
895
|
+
print(f'Distribution: {distribution_id}')
|
|
801
896
|
print(f'Status: {response[\\"Invalidation\\"][\\"Status\\"]}')
|
|
802
897
|
|
|
803
898
|
except NoCredentialsError:
|
|
@@ -811,9 +906,12 @@ def create_invalidation(distribution_id):
|
|
|
811
906
|
sys.exit(1)
|
|
812
907
|
|
|
813
908
|
# Execute invalidation
|
|
814
|
-
create_invalidation(
|
|
909
|
+
create_invalidation(os.environ['DISTRIBUTION_ID'])
|
|
815
910
|
"
|
|
816
911
|
EOT
|
|
912
|
+
environment = {
|
|
913
|
+
DISTRIBUTION_ID = aws_cloudfront_distribution.website.id
|
|
914
|
+
}
|
|
817
915
|
}
|
|
818
916
|
|
|
819
917
|
depends_on = [
|
|
@@ -850,18 +948,65 @@ output "cloudfront_domain_name" {
|
|
|
850
948
|
|
|
851
949
|
output "waf_web_acl_arn" {
|
|
852
950
|
description = "ARN of the WAF Web ACL"
|
|
853
|
-
value = aws_wafv2_web_acl.cloudfront_waf.arn
|
|
951
|
+
value = var.enable_waf ? aws_wafv2_web_acl.cloudfront_waf[0].arn : null
|
|
854
952
|
}",
|
|
855
953
|
"test-app.tf": "terraform {
|
|
856
954
|
required_providers {
|
|
857
955
|
aws = {
|
|
858
956
|
source = "hashicorp/aws"
|
|
859
|
-
version = "
|
|
957
|
+
version = "6.62.0"
|
|
860
958
|
configuration_aliases = [aws.us_east_1]
|
|
861
959
|
}
|
|
862
960
|
}
|
|
863
961
|
}
|
|
864
962
|
|
|
963
|
+
variable "custom_domain_names" {
|
|
964
|
+
description = "Custom domain names (aliases) for the CloudFront distribution. Requires acm_certificate_arn."
|
|
965
|
+
type = list(string)
|
|
966
|
+
default = []
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
variable "acm_certificate_arn" {
|
|
970
|
+
description = "ARN of an ACM certificate (in us-east-1) for the custom domain names. When set, viewers are required to use TLS 1.2 or later."
|
|
971
|
+
type = string
|
|
972
|
+
default = null
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
variable "enable_waf" {
|
|
976
|
+
description = "Whether to protect the CloudFront distribution with an AWS WAF Web ACL."
|
|
977
|
+
type = bool
|
|
978
|
+
default = true
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
variable "encryption" {
|
|
982
|
+
description = "Server-side encryption for the website and distribution log buckets. One of KMS or S3_MANAGED."
|
|
983
|
+
type = string
|
|
984
|
+
default = "KMS"
|
|
985
|
+
|
|
986
|
+
validation {
|
|
987
|
+
condition = contains(["KMS", "S3_MANAGED"], var.encryption)
|
|
988
|
+
error_message = "encryption must be one of KMS or S3_MANAGED."
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
variable "kms_key_arn" {
|
|
993
|
+
description = "ARN of an existing KMS key used to encrypt the website and distribution log buckets when encryption is KMS. When not provided and create_kms_key is true, a new key is created. Note that a customer-supplied key must already grant the CloudWatch Logs, S3 and CloudFront service principals the necessary permissions in its own key policy."
|
|
994
|
+
type = string
|
|
995
|
+
default = null
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
variable "create_kms_key" {
|
|
999
|
+
description = "Whether to create a KMS key for the website. Only applies when encryption is KMS. Set to false when supplying kms_key_arn."
|
|
1000
|
+
type = bool
|
|
1001
|
+
default = true
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
variable "enable_key_rotation" {
|
|
1005
|
+
description = "Whether the automatically created KMS key has rotation enabled. Only applies when encryption is KMS and create_kms_key is true."
|
|
1006
|
+
type = bool
|
|
1007
|
+
default = true
|
|
1008
|
+
}
|
|
1009
|
+
|
|
865
1010
|
# Static website module configured for the web package
|
|
866
1011
|
module "static_website" {
|
|
867
1012
|
source = "../../../core/static-website"
|
|
@@ -869,6 +1014,14 @@ module "static_website" {
|
|
|
869
1014
|
website_name = "test-app"
|
|
870
1015
|
website_file_path = "\${path.module}/../../../../../../../dist/test-app/bundle"
|
|
871
1016
|
|
|
1017
|
+
custom_domain_names = var.custom_domain_names
|
|
1018
|
+
acm_certificate_arn = var.acm_certificate_arn
|
|
1019
|
+
enable_waf = var.enable_waf
|
|
1020
|
+
encryption = var.encryption
|
|
1021
|
+
kms_key_arn = var.kms_key_arn
|
|
1022
|
+
create_kms_key = var.create_kms_key
|
|
1023
|
+
enable_key_rotation = var.enable_key_rotation
|
|
1024
|
+
|
|
872
1025
|
providers = {
|
|
873
1026
|
aws.us_east_1 = aws.us_east_1
|
|
874
1027
|
}
|
|
@@ -909,7 +1062,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
909
1062
|
|
|
910
1063
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > biome.json 1`] = `
|
|
911
1064
|
"{
|
|
912
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
1065
|
+
"$schema": "https://biomejs.dev/schemas/2.5.10/schema.json",
|
|
913
1066
|
"root": true,
|
|
914
1067
|
"formatter": {
|
|
915
1068
|
"enabled": true,
|
|
@@ -921,6 +1074,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
921
1074
|
"formatter": {
|
|
922
1075
|
"quoteStyle": "single",
|
|
923
1076
|
"trailingCommas": "all"
|
|
1077
|
+
},
|
|
1078
|
+
"resolver": {
|
|
1079
|
+
"experimentalPnpmCatalogs": true
|
|
924
1080
|
}
|
|
925
1081
|
},
|
|
926
1082
|
"css": {
|
|
@@ -934,9 +1090,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
934
1090
|
"linter": {
|
|
935
1091
|
"enabled": true,
|
|
936
1092
|
"rules": {
|
|
937
|
-
"
|
|
1093
|
+
"preset": "none",
|
|
938
1094
|
"correctness": {
|
|
939
|
-
"noUndeclaredDependencies": "
|
|
1095
|
+
"noUndeclaredDependencies": "error"
|
|
940
1096
|
}
|
|
941
1097
|
}
|
|
942
1098
|
},
|
|
@@ -952,12 +1108,33 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
952
1108
|
"**",
|
|
953
1109
|
"!**/dist",
|
|
954
1110
|
"!**/out-tsc",
|
|
1111
|
+
"!**/test-output",
|
|
955
1112
|
"!**/node_modules",
|
|
956
1113
|
"!**/.nx",
|
|
957
1114
|
"!**/.venv",
|
|
958
|
-
"
|
|
1115
|
+
"!**/.grit",
|
|
1116
|
+
"!**/*.css",
|
|
1117
|
+
"!**/*.gen.*",
|
|
1118
|
+
"!**/generated/**",
|
|
1119
|
+
"!**/tsconfig*.json"
|
|
959
1120
|
]
|
|
960
|
-
}
|
|
1121
|
+
},
|
|
1122
|
+
"overrides": [
|
|
1123
|
+
{
|
|
1124
|
+
"includes": [
|
|
1125
|
+
"**/*.config.{ts,mts,cts,js,mjs,cjs}",
|
|
1126
|
+
"**/*.{spec,test}.{ts,tsx,mts,cts,js,jsx,mjs,cjs}",
|
|
1127
|
+
"**/*.stories.{ts,tsx}"
|
|
1128
|
+
],
|
|
1129
|
+
"linter": {
|
|
1130
|
+
"rules": {
|
|
1131
|
+
"correctness": {
|
|
1132
|
+
"noUndeclaredDependencies": "off"
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
]
|
|
961
1138
|
}
|
|
962
1139
|
"
|
|
963
1140
|
`;
|
|
@@ -970,35 +1147,66 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
970
1147
|
"targetDefaults": {
|
|
971
1148
|
"build": {
|
|
972
1149
|
"cache": true,
|
|
973
|
-
"dependsOn": ["^build"],
|
|
974
1150
|
"inputs": ["default"]
|
|
975
1151
|
},
|
|
976
1152
|
"lint": {
|
|
977
1153
|
"cache": true
|
|
978
1154
|
},
|
|
979
|
-
"
|
|
980
|
-
"cache": true,
|
|
1155
|
+
"test": {
|
|
981
1156
|
"dependsOn": ["^build"],
|
|
982
|
-
"inputs": ["default"
|
|
1157
|
+
"inputs": ["default"]
|
|
983
1158
|
},
|
|
984
1159
|
"@nx/vitest:test": {
|
|
985
1160
|
"cache": true,
|
|
986
|
-
"inputs": ["default", "^
|
|
1161
|
+
"inputs": ["default", "^production"],
|
|
987
1162
|
"configurations": {
|
|
988
1163
|
"update-snapshot": {
|
|
989
1164
|
"args": "--update"
|
|
990
1165
|
}
|
|
991
1166
|
}
|
|
992
1167
|
},
|
|
993
|
-
"test": {
|
|
994
|
-
"dependsOn": ["^build"],
|
|
995
|
-
"inputs": ["default"]
|
|
996
|
-
},
|
|
997
1168
|
"compile": {
|
|
998
1169
|
"cache": true,
|
|
999
1170
|
"inputs": ["default"]
|
|
1000
1171
|
}
|
|
1001
1172
|
},
|
|
1173
|
+
"plugins": [
|
|
1174
|
+
{
|
|
1175
|
+
"plugin": "@nx/js/typescript",
|
|
1176
|
+
"options": {
|
|
1177
|
+
"typecheck": {
|
|
1178
|
+
"targetName": "typecheck"
|
|
1179
|
+
},
|
|
1180
|
+
"build": {
|
|
1181
|
+
"targetName": "compile",
|
|
1182
|
+
"configName": "tsconfig.lib.json",
|
|
1183
|
+
"buildDepsName": "build-deps",
|
|
1184
|
+
"watchDepsName": "watch-deps"
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
},
|
|
1188
|
+
{
|
|
1189
|
+
"plugin": "@nx/vite/plugin",
|
|
1190
|
+
"options": {
|
|
1191
|
+
"buildTargetName": "bundle",
|
|
1192
|
+
"serveTargetName": "serve",
|
|
1193
|
+
"devTargetName": "serve",
|
|
1194
|
+
"previewTargetName": "preview",
|
|
1195
|
+
"serveStaticTargetName": "serve-static",
|
|
1196
|
+
"typecheckTargetName": "vite:typecheck",
|
|
1197
|
+
"buildDepsTargetName": "build-deps",
|
|
1198
|
+
"watchDepsTargetName": "watch-deps"
|
|
1199
|
+
}
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
"plugin": "@nx/vitest",
|
|
1203
|
+
"options": {
|
|
1204
|
+
"testTargetName": "test",
|
|
1205
|
+
"ciTargetName": "test-ci",
|
|
1206
|
+
"testMode": "watch"
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
],
|
|
1002
1210
|
"generators": {
|
|
1003
1211
|
"@nx/react": {
|
|
1004
1212
|
"application": {
|
|
@@ -1020,27 +1228,11 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1020
1228
|
"biome": ["default", "{workspaceRoot}/biome.json"],
|
|
1021
1229
|
"default": [
|
|
1022
1230
|
{
|
|
1023
|
-
"dependentTasksOutputFiles": "
|
|
1231
|
+
"dependentTasksOutputFiles": "!{reports,coverage}/**",
|
|
1024
1232
|
"transitive": true
|
|
1025
1233
|
}
|
|
1026
1234
|
]
|
|
1027
|
-
}
|
|
1028
|
-
"plugins": [
|
|
1029
|
-
{
|
|
1030
|
-
"plugin": "@nx/js/typescript",
|
|
1031
|
-
"options": {
|
|
1032
|
-
"typecheck": {
|
|
1033
|
-
"targetName": "typecheck"
|
|
1034
|
-
},
|
|
1035
|
-
"build": {
|
|
1036
|
-
"targetName": "compile",
|
|
1037
|
-
"configName": "tsconfig.lib.json",
|
|
1038
|
-
"buildDepsName": "build-deps",
|
|
1039
|
-
"watchDepsName": "watch-deps"
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
]
|
|
1235
|
+
}
|
|
1044
1236
|
}
|
|
1045
1237
|
"
|
|
1046
1238
|
`;
|
|
@@ -1048,43 +1240,39 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1048
1240
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > package.json 1`] = `
|
|
1049
1241
|
"{
|
|
1050
1242
|
"name": "@proj/source",
|
|
1051
|
-
"dependencies": {
|
|
1052
|
-
"@cloudscape-design/board-components": "3.0.189",
|
|
1053
|
-
"@cloudscape-design/components": "3.0.1308",
|
|
1054
|
-
"@cloudscape-design/global-styles": "1.0.59",
|
|
1055
|
-
"aws-cdk-lib": "2.258.0",
|
|
1056
|
-
"constructs": "10.6.0",
|
|
1057
|
-
"react": "19.2.7",
|
|
1058
|
-
"react-dom": "19.2.7",
|
|
1059
|
-
"tailwindcss": "4.2.2"
|
|
1060
|
-
},
|
|
1243
|
+
"dependencies": {},
|
|
1061
1244
|
"devDependencies": {
|
|
1062
|
-
"@nx/js": "
|
|
1063
|
-
"@nx/react": "
|
|
1064
|
-
"@nx/vite": "
|
|
1065
|
-
"@nx/vitest": "
|
|
1066
|
-
"@nx/web": "
|
|
1067
|
-
"@swc-node/register": "~1.11.1",
|
|
1068
|
-
"@swc/core": "~1.15.5",
|
|
1245
|
+
"@nx/js": "23.1.2",
|
|
1246
|
+
"@nx/react": "catalog:",
|
|
1247
|
+
"@nx/vite": "23.1.2",
|
|
1248
|
+
"@nx/vitest": "23.1.2",
|
|
1249
|
+
"@nx/web": "23.1.2",
|
|
1069
1250
|
"@swc/helpers": "~0.5.18",
|
|
1070
|
-
"@tailwindcss/vite": "
|
|
1251
|
+
"@tailwindcss/vite": "catalog:",
|
|
1071
1252
|
"@testing-library/dom": "10.4.0",
|
|
1072
1253
|
"@testing-library/react": "16.3.0",
|
|
1073
|
-
"@types/node": "
|
|
1254
|
+
"@types/node": "catalog:",
|
|
1074
1255
|
"@types/react": "^19.0.0",
|
|
1075
1256
|
"@types/react-dom": "^19.0.0",
|
|
1076
1257
|
"@vitejs/plugin-react": "^6.0.0",
|
|
1077
|
-
"@vitest/coverage-v8": "
|
|
1078
|
-
"@vitest/ui": "
|
|
1258
|
+
"@vitest/coverage-v8": "catalog:",
|
|
1259
|
+
"@vitest/ui": "catalog:",
|
|
1079
1260
|
"jiti": "2.4.2",
|
|
1080
|
-
"jsdom": "
|
|
1081
|
-
"typescript": "~
|
|
1082
|
-
"vite": "
|
|
1083
|
-
"vitest": "
|
|
1261
|
+
"jsdom": "^27.1.0",
|
|
1262
|
+
"typescript": "~6.0.3",
|
|
1263
|
+
"vite": "catalog:",
|
|
1264
|
+
"vitest": "catalog:"
|
|
1084
1265
|
},
|
|
1085
1266
|
"type": "module",
|
|
1086
|
-
"
|
|
1087
|
-
"
|
|
1267
|
+
"workspaces": [
|
|
1268
|
+
"packages/*",
|
|
1269
|
+
"test-app",
|
|
1270
|
+
"packages/common/constructs"
|
|
1271
|
+
],
|
|
1272
|
+
"overrides": {
|
|
1273
|
+
"@nx/react": {
|
|
1274
|
+
"express": "5.2.1"
|
|
1275
|
+
}
|
|
1088
1276
|
}
|
|
1089
1277
|
}
|
|
1090
1278
|
"
|
|
@@ -1097,27 +1285,27 @@ This library was generated with [@aws/nx-plugin](https://github.com/awslabs/nx-p
|
|
|
1097
1285
|
|
|
1098
1286
|
## Building
|
|
1099
1287
|
|
|
1100
|
-
Run \`
|
|
1288
|
+
Run \`npx nx build @proj/common-constructs [--skip-nx-cache]\` to build the application.
|
|
1101
1289
|
|
|
1102
1290
|
## Running unit tests
|
|
1103
1291
|
|
|
1104
|
-
Run \`
|
|
1292
|
+
Run \`npx nx test @proj/common-constructs\` to execute the unit tests via Vitest.
|
|
1105
1293
|
|
|
1106
1294
|
### Updating snapshots
|
|
1107
1295
|
|
|
1108
1296
|
To update snapshots, run the following command:
|
|
1109
1297
|
|
|
1110
|
-
\`
|
|
1298
|
+
\`npx nx test @proj/common-constructs --configuration=update-snapshot\`
|
|
1111
1299
|
|
|
1112
1300
|
## Run lint
|
|
1113
1301
|
|
|
1114
|
-
Run \`
|
|
1302
|
+
Run \`npx nx lint @proj/common-constructs\`
|
|
1115
1303
|
|
|
1116
1304
|
### Fixable issues
|
|
1117
1305
|
|
|
1118
1306
|
You can also automatiaclly fix some lint errors by running the following command:
|
|
1119
1307
|
|
|
1120
|
-
\`
|
|
1308
|
+
\`npx nx lint @proj/common-constructs --configuration=fix\`
|
|
1121
1309
|
|
|
1122
1310
|
## Useful links
|
|
1123
1311
|
|
|
@@ -1127,6 +1315,24 @@ You can also automatiaclly fix some lint errors by running the following command
|
|
|
1127
1315
|
"
|
|
1128
1316
|
`;
|
|
1129
1317
|
|
|
1318
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > packages/common/constructs/package.json 1`] = `
|
|
1319
|
+
"{
|
|
1320
|
+
"name": "@proj/common-constructs",
|
|
1321
|
+
"version": "0.0.1",
|
|
1322
|
+
"private": true,
|
|
1323
|
+
"type": "module",
|
|
1324
|
+
"dependencies": {
|
|
1325
|
+
"aws-cdk-lib": "catalog:",
|
|
1326
|
+
"constructs": "catalog:",
|
|
1327
|
+
"tslib": "^2.3.0"
|
|
1328
|
+
},
|
|
1329
|
+
"devDependencies": {
|
|
1330
|
+
"@types/node": "catalog:"
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
"
|
|
1334
|
+
`;
|
|
1335
|
+
|
|
1130
1336
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > packages/common/constructs/project.json 1`] = `
|
|
1131
1337
|
"{
|
|
1132
1338
|
"name": "@proj/common-constructs",
|
|
@@ -1138,6 +1344,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1138
1344
|
"generator": "ts#project"
|
|
1139
1345
|
},
|
|
1140
1346
|
"targets": {
|
|
1347
|
+
"assemble": {
|
|
1348
|
+
"dependsOn": ["compile", "@proj/test-app:assemble"]
|
|
1349
|
+
},
|
|
1141
1350
|
"build": {
|
|
1142
1351
|
"dependsOn": ["lint", "compile", "test", "@proj/test-app:build"]
|
|
1143
1352
|
},
|
|
@@ -1149,27 +1358,37 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1149
1358
|
"cwd": "{projectRoot}"
|
|
1150
1359
|
}
|
|
1151
1360
|
},
|
|
1152
|
-
"
|
|
1361
|
+
"format": {
|
|
1153
1362
|
"executor": "nx:run-commands",
|
|
1154
1363
|
"cache": true,
|
|
1155
1364
|
"inputs": ["biome"],
|
|
1156
1365
|
"options": {
|
|
1157
|
-
"command": "biome
|
|
1366
|
+
"command": "biome format {projectRoot}"
|
|
1158
1367
|
},
|
|
1159
1368
|
"configurations": {
|
|
1160
1369
|
"fix": {
|
|
1161
|
-
"command": "biome
|
|
1370
|
+
"command": "biome format --write {projectRoot}"
|
|
1162
1371
|
},
|
|
1163
1372
|
"skip-lint": {
|
|
1164
1373
|
"command": "node -e \\"\\""
|
|
1165
1374
|
}
|
|
1166
1375
|
}
|
|
1167
1376
|
},
|
|
1168
|
-
"
|
|
1169
|
-
"executor": "
|
|
1170
|
-
"
|
|
1377
|
+
"lint": {
|
|
1378
|
+
"executor": "nx:run-commands",
|
|
1379
|
+
"cache": true,
|
|
1380
|
+
"inputs": ["biome"],
|
|
1381
|
+
"dependsOn": ["format"],
|
|
1171
1382
|
"options": {
|
|
1172
|
-
"
|
|
1383
|
+
"command": "biome lint {projectRoot}"
|
|
1384
|
+
},
|
|
1385
|
+
"configurations": {
|
|
1386
|
+
"fix": {
|
|
1387
|
+
"command": "biome check --write {projectRoot}"
|
|
1388
|
+
},
|
|
1389
|
+
"skip-lint": {
|
|
1390
|
+
"command": "node -e \\"\\""
|
|
1391
|
+
}
|
|
1173
1392
|
}
|
|
1174
1393
|
}
|
|
1175
1394
|
}
|
|
@@ -1190,11 +1409,17 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1190
1409
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > packages/common/constructs/src/app/static-websites/test-app.ts 1`] = `
|
|
1191
1410
|
"import * as url from 'url';
|
|
1192
1411
|
import { Construct } from 'constructs';
|
|
1193
|
-
import { StaticWebsite } from '../../core/index.js';
|
|
1412
|
+
import { StaticWebsite, StaticWebsiteProps } from '../../core/index.js';
|
|
1413
|
+
|
|
1414
|
+
export type TestAppProps = Omit<
|
|
1415
|
+
StaticWebsiteProps,
|
|
1416
|
+
'websiteName' | 'websiteFilePath'
|
|
1417
|
+
>;
|
|
1194
1418
|
|
|
1195
1419
|
export class TestApp extends StaticWebsite {
|
|
1196
|
-
constructor(scope: Construct, id: string) {
|
|
1420
|
+
constructor(scope: Construct, id: string, props?: TestAppProps) {
|
|
1197
1421
|
super(scope, id, {
|
|
1422
|
+
...props,
|
|
1198
1423
|
websiteName: 'TestApp',
|
|
1199
1424
|
websiteFilePath: url.fileURLToPath(
|
|
1200
1425
|
new URL('../../../../../../dist/test-app/bundle', import.meta.url),
|
|
@@ -1282,10 +1507,31 @@ export const suppressRules = (
|
|
|
1282
1507
|
"
|
|
1283
1508
|
`;
|
|
1284
1509
|
|
|
1510
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > packages/common/constructs/src/core/cloudfront.ts 1`] = `
|
|
1511
|
+
"import { CfnDistribution, Distribution } from 'aws-cdk-lib/aws-cloudfront';
|
|
1512
|
+
|
|
1513
|
+
/**
|
|
1514
|
+
* Finds the domain names associated with a CloudFront distribution.
|
|
1515
|
+
*
|
|
1516
|
+
* Includes the distribution's default \`*.cloudfront.net\` domain name plus any custom
|
|
1517
|
+
* domain names (aliases) configured on it.
|
|
1518
|
+
*/
|
|
1519
|
+
export const findCloudFrontDomainNames = (
|
|
1520
|
+
distribution: Distribution,
|
|
1521
|
+
): string[] => {
|
|
1522
|
+
const cfnDistribution = distribution.node.defaultChild as CfnDistribution;
|
|
1523
|
+
const distributionConfig =
|
|
1524
|
+
cfnDistribution.distributionConfig as CfnDistribution.DistributionConfigProperty;
|
|
1525
|
+
return [distribution.domainName, ...(distributionConfig.aliases ?? [])];
|
|
1526
|
+
};
|
|
1527
|
+
"
|
|
1528
|
+
`;
|
|
1529
|
+
|
|
1285
1530
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > packages/common/constructs/src/core/index.ts 1`] = `
|
|
1286
1531
|
"export * from './static-website.js';
|
|
1287
1532
|
export * from './app.js';
|
|
1288
1533
|
export * from './checkov.js';
|
|
1534
|
+
export * from './cloudfront.js';
|
|
1289
1535
|
export * from './runtime-config.js';
|
|
1290
1536
|
export * from './workspace.js';
|
|
1291
1537
|
"
|
|
@@ -1481,11 +1727,21 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1481
1727
|
"import {
|
|
1482
1728
|
CfnOutput,
|
|
1483
1729
|
CfnResource,
|
|
1730
|
+
Duration,
|
|
1484
1731
|
Lazy,
|
|
1732
|
+
Names,
|
|
1485
1733
|
RemovalPolicy,
|
|
1486
1734
|
Stack,
|
|
1487
1735
|
} from 'aws-cdk-lib';
|
|
1488
|
-
import {
|
|
1736
|
+
import {
|
|
1737
|
+
Distribution,
|
|
1738
|
+
HeadersFrameOption,
|
|
1739
|
+
HeadersReferrerPolicy,
|
|
1740
|
+
ResponseHeadersPolicy,
|
|
1741
|
+
SecurityPolicyProtocol,
|
|
1742
|
+
ViewerProtocolPolicy,
|
|
1743
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
1744
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
1489
1745
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
1490
1746
|
import {
|
|
1491
1747
|
BlockPublicAccess,
|
|
@@ -1494,18 +1750,83 @@ import {
|
|
|
1494
1750
|
IBucket,
|
|
1495
1751
|
ObjectOwnership,
|
|
1496
1752
|
} from 'aws-cdk-lib/aws-s3';
|
|
1497
|
-
import {
|
|
1753
|
+
import {
|
|
1754
|
+
BucketDeployment,
|
|
1755
|
+
CacheControl,
|
|
1756
|
+
Source,
|
|
1757
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
1498
1758
|
import { Construct } from 'constructs';
|
|
1499
1759
|
import { RuntimeConfig } from './runtime-config.js';
|
|
1500
|
-
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
1760
|
+
import { IKey, Key } from 'aws-cdk-lib/aws-kms';
|
|
1761
|
+
import {
|
|
1762
|
+
CfnDelivery,
|
|
1763
|
+
CfnDeliveryDestination,
|
|
1764
|
+
CfnDeliverySource,
|
|
1765
|
+
LogGroup,
|
|
1766
|
+
RetentionDays,
|
|
1767
|
+
} from 'aws-cdk-lib/aws-logs';
|
|
1768
|
+
import { Effect, PolicyStatement, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
|
|
1501
1769
|
import { CfnWebACL } from 'aws-cdk-lib/aws-wafv2';
|
|
1502
1770
|
import { suppressRules } from './checkov.js';
|
|
1503
1771
|
|
|
1504
1772
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
1505
1773
|
|
|
1774
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
1775
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
1776
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
1777
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
1778
|
+
// connect-src to your specific origins once they are known.
|
|
1779
|
+
const CONTENT_SECURITY_POLICY = [
|
|
1780
|
+
"default-src 'self'",
|
|
1781
|
+
"script-src 'self'",
|
|
1782
|
+
"style-src 'self' 'unsafe-inline'",
|
|
1783
|
+
"img-src 'self' data:",
|
|
1784
|
+
"font-src 'self' data:",
|
|
1785
|
+
"connect-src 'self' https: wss:",
|
|
1786
|
+
"object-src 'none'",
|
|
1787
|
+
"base-uri 'self'",
|
|
1788
|
+
"frame-ancestors 'none'",
|
|
1789
|
+
].join('; ');
|
|
1790
|
+
|
|
1506
1791
|
export interface StaticWebsiteProps {
|
|
1507
1792
|
readonly websiteName: string;
|
|
1508
1793
|
readonly websiteFilePath: string;
|
|
1794
|
+
/**
|
|
1795
|
+
* Custom domain names for the CloudFront distribution. Requires \`certificate\`.
|
|
1796
|
+
*/
|
|
1797
|
+
readonly domainNames?: string[];
|
|
1798
|
+
/**
|
|
1799
|
+
* ACM certificate for the custom domain names. Must be in us-east-1.
|
|
1800
|
+
* When provided, viewers are required to use TLS 1.2 or later.
|
|
1801
|
+
*/
|
|
1802
|
+
readonly certificate?: ICertificate;
|
|
1803
|
+
/**
|
|
1804
|
+
* Whether to protect the CloudFront distribution with an AWS WAF Web ACL.
|
|
1805
|
+
*
|
|
1806
|
+
* @default true
|
|
1807
|
+
*/
|
|
1808
|
+
readonly enableWaf?: boolean;
|
|
1809
|
+
/**
|
|
1810
|
+
* Server-side encryption for the website and distribution log buckets.
|
|
1811
|
+
*
|
|
1812
|
+
* @default BucketEncryption.KMS
|
|
1813
|
+
*/
|
|
1814
|
+
readonly encryption?: BucketEncryption;
|
|
1815
|
+
/**
|
|
1816
|
+
* KMS key used to encrypt the website and distribution log buckets. Only used when \`encryption\` is
|
|
1817
|
+
* \`BucketEncryption.KMS\`. When not provided, a new key is created. Note that a key imported via
|
|
1818
|
+
* \`Key.fromKeyArn\` must already grant the CloudWatch Logs, S3 and CloudFront service principals the
|
|
1819
|
+
* necessary permissions in its own key policy - \`addToResourcePolicy\` is a no-op on an imported key,
|
|
1820
|
+
* so this construct cannot grant them on your behalf.
|
|
1821
|
+
*/
|
|
1822
|
+
readonly encryptionKey?: IKey;
|
|
1823
|
+
/**
|
|
1824
|
+
* Whether the automatically created KMS key has rotation enabled. Only applies when \`encryption\` is
|
|
1825
|
+
* \`BucketEncryption.KMS\` and no \`encryptionKey\` is supplied.
|
|
1826
|
+
*
|
|
1827
|
+
* @default true
|
|
1828
|
+
*/
|
|
1829
|
+
readonly enableKeyRotation?: boolean;
|
|
1509
1830
|
}
|
|
1510
1831
|
|
|
1511
1832
|
/**
|
|
@@ -1524,39 +1845,53 @@ export class StaticWebsite extends Construct {
|
|
|
1524
1845
|
constructor(
|
|
1525
1846
|
scope: Construct,
|
|
1526
1847
|
id: string,
|
|
1527
|
-
{
|
|
1848
|
+
{
|
|
1849
|
+
websiteFilePath,
|
|
1850
|
+
websiteName,
|
|
1851
|
+
domainNames,
|
|
1852
|
+
certificate,
|
|
1853
|
+
enableWaf = true,
|
|
1854
|
+
encryption = BucketEncryption.KMS,
|
|
1855
|
+
encryptionKey,
|
|
1856
|
+
enableKeyRotation = true,
|
|
1857
|
+
}: StaticWebsiteProps,
|
|
1528
1858
|
) {
|
|
1529
1859
|
super(scope, id);
|
|
1530
|
-
this.node.setContext(
|
|
1531
|
-
'@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy',
|
|
1532
|
-
true,
|
|
1533
|
-
);
|
|
1534
1860
|
|
|
1535
|
-
const websiteKey
|
|
1536
|
-
|
|
1537
|
-
|
|
1861
|
+
const websiteKey: IKey | undefined =
|
|
1862
|
+
encryption === BucketEncryption.KMS
|
|
1863
|
+
? (encryptionKey ?? new Key(this, 'WebsiteKey', { enableKeyRotation }))
|
|
1864
|
+
: undefined;
|
|
1865
|
+
|
|
1866
|
+
// Allow CloudWatch Logs to use the website key for server access log delivery.
|
|
1867
|
+
const stack = Stack.of(this);
|
|
1868
|
+
websiteKey?.addToResourcePolicy(
|
|
1869
|
+
new PolicyStatement({
|
|
1870
|
+
effect: Effect.ALLOW,
|
|
1871
|
+
principals: [
|
|
1872
|
+
new ServicePrincipal(\`logs.\${stack.region}.amazonaws.com\`),
|
|
1873
|
+
],
|
|
1874
|
+
actions: [
|
|
1875
|
+
'kms:Encrypt',
|
|
1876
|
+
'kms:Decrypt',
|
|
1877
|
+
'kms:ReEncrypt*',
|
|
1878
|
+
'kms:GenerateDataKey*',
|
|
1879
|
+
'kms:DescribeKey',
|
|
1880
|
+
],
|
|
1881
|
+
resources: ['*'],
|
|
1882
|
+
conditions: {
|
|
1883
|
+
ArnLike: {
|
|
1884
|
+
'kms:EncryptionContext:aws:logs:arn': \`arn:aws:logs:\${stack.region}:\${stack.account}:log-group:*\`,
|
|
1885
|
+
},
|
|
1886
|
+
},
|
|
1887
|
+
}),
|
|
1888
|
+
);
|
|
1538
1889
|
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1541
|
-
enforceSSL: true,
|
|
1542
|
-
autoDeleteObjects: true,
|
|
1543
|
-
removalPolicy: RemovalPolicy.DESTROY,
|
|
1544
|
-
encryption: BucketEncryption.KMS,
|
|
1890
|
+
const accessLogs = new LogGroup(this, 'AccessLogs', {
|
|
1891
|
+
retention: RetentionDays.ONE_YEAR,
|
|
1545
1892
|
encryptionKey: websiteKey,
|
|
1546
|
-
|
|
1547
|
-
publicReadAccess: false,
|
|
1548
|
-
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
1893
|
+
removalPolicy: RemovalPolicy.DESTROY,
|
|
1549
1894
|
});
|
|
1550
|
-
suppressRules(
|
|
1551
|
-
accessLogsBucket,
|
|
1552
|
-
['CKV_AWS_21'],
|
|
1553
|
-
'Access log bucket does not need versioning enabled',
|
|
1554
|
-
);
|
|
1555
|
-
suppressRules(
|
|
1556
|
-
accessLogsBucket,
|
|
1557
|
-
['CKV_AWS_18'],
|
|
1558
|
-
'Access log bucket does not need an access log bucket',
|
|
1559
|
-
);
|
|
1560
1895
|
|
|
1561
1896
|
// S3 Bucket to hold website files
|
|
1562
1897
|
this.websiteBucket = new Bucket(this, 'WebsiteBucket', {
|
|
@@ -1564,47 +1899,99 @@ export class StaticWebsite extends Construct {
|
|
|
1564
1899
|
enforceSSL: true,
|
|
1565
1900
|
autoDeleteObjects: true,
|
|
1566
1901
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
1567
|
-
encryption
|
|
1902
|
+
encryption,
|
|
1568
1903
|
encryptionKey: websiteKey,
|
|
1569
1904
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_ENFORCED,
|
|
1570
1905
|
publicReadAccess: false,
|
|
1571
1906
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
1572
|
-
serverAccessLogsPrefix: 'website-access-logs',
|
|
1573
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
1574
1907
|
});
|
|
1908
|
+
suppressRules(
|
|
1909
|
+
this.websiteBucket,
|
|
1910
|
+
['CKV_AWS_18'],
|
|
1911
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
1912
|
+
);
|
|
1913
|
+
this.deliverAccessLogsToCloudWatch(
|
|
1914
|
+
'Website',
|
|
1915
|
+
this.websiteBucket,
|
|
1916
|
+
accessLogs,
|
|
1917
|
+
);
|
|
1575
1918
|
// Web ACL
|
|
1576
|
-
const wafStack = new CloudfrontWebAcl(this, 'waf');
|
|
1919
|
+
const wafStack = enableWaf ? new CloudfrontWebAcl(this, 'waf') : undefined;
|
|
1577
1920
|
|
|
1578
|
-
//
|
|
1921
|
+
// Bucket holding CloudFront standard access logs. CloudFront delivers its
|
|
1922
|
+
// own logs to S3 only, so this bucket is retained; its S3 server access
|
|
1923
|
+
// logs are delivered to CloudWatch Logs.
|
|
1579
1924
|
const logBucket = new Bucket(this, 'DistributionLogBucket', {
|
|
1580
1925
|
enforceSSL: true,
|
|
1581
1926
|
autoDeleteObjects: true,
|
|
1582
1927
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
1583
|
-
encryption
|
|
1928
|
+
encryption,
|
|
1584
1929
|
encryptionKey: websiteKey,
|
|
1585
1930
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_PREFERRED,
|
|
1586
1931
|
publicReadAccess: false,
|
|
1587
1932
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
1588
|
-
serverAccessLogsPrefix: 'distribution-access-logs',
|
|
1589
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
1590
1933
|
});
|
|
1591
1934
|
suppressRules(
|
|
1592
1935
|
logBucket,
|
|
1593
1936
|
['CKV_AWS_21'],
|
|
1594
1937
|
'Distribution log bucket does not need versioning enabled',
|
|
1595
1938
|
);
|
|
1939
|
+
suppressRules(
|
|
1940
|
+
logBucket,
|
|
1941
|
+
['CKV_AWS_18'],
|
|
1942
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
1943
|
+
);
|
|
1944
|
+
this.deliverAccessLogsToCloudWatch('Distribution', logBucket, accessLogs);
|
|
1945
|
+
|
|
1946
|
+
// Security headers applied to all responses.
|
|
1947
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
1948
|
+
this,
|
|
1949
|
+
'ResponseHeadersPolicy',
|
|
1950
|
+
{
|
|
1951
|
+
securityHeadersBehavior: {
|
|
1952
|
+
strictTransportSecurity: {
|
|
1953
|
+
accessControlMaxAge: Duration.days(730),
|
|
1954
|
+
includeSubdomains: true,
|
|
1955
|
+
preload: true,
|
|
1956
|
+
override: true,
|
|
1957
|
+
},
|
|
1958
|
+
contentTypeOptions: { override: true },
|
|
1959
|
+
frameOptions: {
|
|
1960
|
+
frameOption: HeadersFrameOption.DENY,
|
|
1961
|
+
override: true,
|
|
1962
|
+
},
|
|
1963
|
+
referrerPolicy: {
|
|
1964
|
+
referrerPolicy:
|
|
1965
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
1966
|
+
override: true,
|
|
1967
|
+
},
|
|
1968
|
+
contentSecurityPolicy: {
|
|
1969
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
1970
|
+
override: true,
|
|
1971
|
+
},
|
|
1972
|
+
},
|
|
1973
|
+
},
|
|
1974
|
+
);
|
|
1596
1975
|
|
|
1597
1976
|
const defaultRootObject = 'index.html';
|
|
1598
1977
|
this.cloudFrontDistribution = new Distribution(
|
|
1599
1978
|
this,
|
|
1600
1979
|
'CloudfrontDistribution',
|
|
1601
1980
|
{
|
|
1602
|
-
webAclId: wafStack
|
|
1981
|
+
webAclId: wafStack?.wafArn,
|
|
1603
1982
|
enableLogging: true,
|
|
1604
1983
|
logBucket: logBucket,
|
|
1984
|
+
...(certificate
|
|
1985
|
+
? {
|
|
1986
|
+
certificate,
|
|
1987
|
+
domainNames,
|
|
1988
|
+
minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
1989
|
+
}
|
|
1990
|
+
: {}),
|
|
1605
1991
|
defaultBehavior: {
|
|
1606
1992
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
1607
1993
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
1994
|
+
responseHeadersPolicy,
|
|
1608
1995
|
},
|
|
1609
1996
|
defaultRootObject,
|
|
1610
1997
|
errorResponses: [
|
|
@@ -1621,16 +2008,31 @@ export class StaticWebsite extends Construct {
|
|
|
1621
2008
|
],
|
|
1622
2009
|
},
|
|
1623
2010
|
);
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
2011
|
+
if (!certificate) {
|
|
2012
|
+
// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
2013
|
+
suppressRules(
|
|
2014
|
+
this.cloudFrontDistribution,
|
|
2015
|
+
['CKV_AWS_174'],
|
|
2016
|
+
'Cloudfront default certificate does not use TLS 1.2',
|
|
2017
|
+
);
|
|
2018
|
+
}
|
|
1629
2019
|
|
|
1630
2020
|
// Deploy Website
|
|
1631
2021
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
2022
|
+
sources: [Source.asset(websiteFilePath)],
|
|
2023
|
+
destinationBucket: this.websiteBucket,
|
|
2024
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
2025
|
+
distribution: this.cloudFrontDistribution,
|
|
2026
|
+
// Exclude the runtime config from this deployment's sync so its default pruning
|
|
2027
|
+
// never deletes the file managed separately by RuntimeConfigDeployment below.
|
|
2028
|
+
exclude: [DEFAULT_RUNTIME_CONFIG_FILENAME],
|
|
2029
|
+
memoryLimit: 1024,
|
|
2030
|
+
});
|
|
2031
|
+
|
|
2032
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
2033
|
+
// must always fetch the latest configuration.
|
|
2034
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
1632
2035
|
sources: [
|
|
1633
|
-
Source.asset(websiteFilePath),
|
|
1634
2036
|
Source.data(
|
|
1635
2037
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
1636
2038
|
Lazy.string({
|
|
@@ -1642,8 +2044,9 @@ export class StaticWebsite extends Construct {
|
|
|
1642
2044
|
),
|
|
1643
2045
|
],
|
|
1644
2046
|
destinationBucket: this.websiteBucket,
|
|
1645
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
1646
2047
|
distribution: this.cloudFrontDistribution,
|
|
2048
|
+
cacheControl: [CacheControl.noCache()],
|
|
2049
|
+
prune: false,
|
|
1647
2050
|
memoryLimit: 1024,
|
|
1648
2051
|
});
|
|
1649
2052
|
|
|
@@ -1664,6 +2067,48 @@ export class StaticWebsite extends Construct {
|
|
|
1664
2067
|
value: this.websiteBucket.bucketName,
|
|
1665
2068
|
});
|
|
1666
2069
|
}
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* Delivers a bucket's S3 server access logs to a CloudWatch log group using
|
|
2073
|
+
* CloudWatch Logs vended log delivery.
|
|
2074
|
+
*/
|
|
2075
|
+
private deliverAccessLogsToCloudWatch(
|
|
2076
|
+
id: string,
|
|
2077
|
+
bucket: IBucket,
|
|
2078
|
+
logGroup: LogGroup,
|
|
2079
|
+
) {
|
|
2080
|
+
const source: CfnDeliverySource = new CfnDeliverySource(
|
|
2081
|
+
this,
|
|
2082
|
+
\`\${id}AccessLogsSource\`,
|
|
2083
|
+
{
|
|
2084
|
+
name: Lazy.string({
|
|
2085
|
+
produce: () => Names.uniqueResourceName(source, { maxLength: 60 }),
|
|
2086
|
+
}),
|
|
2087
|
+
logType: 'S3_SERVER_ACCESS_LOGS',
|
|
2088
|
+
resourceArn: bucket.bucketArn,
|
|
2089
|
+
},
|
|
2090
|
+
);
|
|
2091
|
+
const bucketPolicy = (bucket as Bucket).policy;
|
|
2092
|
+
if (bucketPolicy) {
|
|
2093
|
+
source.node.addDependency(bucketPolicy);
|
|
2094
|
+
}
|
|
2095
|
+
const destination: CfnDeliveryDestination = new CfnDeliveryDestination(
|
|
2096
|
+
this,
|
|
2097
|
+
\`\${id}AccessLogsDestination\`,
|
|
2098
|
+
{
|
|
2099
|
+
name: Lazy.string({
|
|
2100
|
+
produce: () =>
|
|
2101
|
+
Names.uniqueResourceName(destination, { maxLength: 60 }),
|
|
2102
|
+
}),
|
|
2103
|
+
destinationResourceArn: logGroup.logGroupArn,
|
|
2104
|
+
},
|
|
2105
|
+
);
|
|
2106
|
+
const delivery = new CfnDelivery(this, \`\${id}AccessLogsDelivery\`, {
|
|
2107
|
+
deliverySourceName: source.name,
|
|
2108
|
+
deliveryDestinationArn: destination.attrArn,
|
|
2109
|
+
});
|
|
2110
|
+
delivery.addDependency(source);
|
|
2111
|
+
}
|
|
1667
2112
|
}
|
|
1668
2113
|
|
|
1669
2114
|
export class CloudfrontWebAcl extends Stack {
|
|
@@ -1786,9 +2231,13 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1786
2231
|
"emitDeclarationOnly": false,
|
|
1787
2232
|
"module": "nodenext",
|
|
1788
2233
|
"moduleResolution": "nodenext",
|
|
1789
|
-
"types": [
|
|
2234
|
+
"types": [
|
|
2235
|
+
"node"
|
|
2236
|
+
]
|
|
1790
2237
|
},
|
|
1791
|
-
"include": [
|
|
2238
|
+
"include": [
|
|
2239
|
+
"src/**/*.ts"
|
|
2240
|
+
],
|
|
1792
2241
|
"references": [],
|
|
1793
2242
|
"exclude": [
|
|
1794
2243
|
"vite.config.ts",
|
|
@@ -1851,7 +2300,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1851
2300
|
"import { defineConfig } from 'vitest/config';
|
|
1852
2301
|
|
|
1853
2302
|
export default defineConfig(() => ({
|
|
1854
|
-
root:
|
|
2303
|
+
root: import.meta.dirname,
|
|
1855
2304
|
cacheDir: '../../../node_modules/.vite/packages/common/constructs',
|
|
1856
2305
|
test: {
|
|
1857
2306
|
passWithNoTests: true,
|
|
@@ -1862,7 +2311,8 @@ export default defineConfig(() => ({
|
|
|
1862
2311
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
1863
2312
|
reporters: ['default'],
|
|
1864
2313
|
coverage: {
|
|
1865
|
-
reportsDirectory:
|
|
2314
|
+
reportsDirectory:
|
|
2315
|
+
'../../../dist/packages/common/constructs/test-output/vitest/coverage',
|
|
1866
2316
|
provider: 'v8' as const,
|
|
1867
2317
|
},
|
|
1868
2318
|
},
|
|
@@ -1872,9 +2322,25 @@ export default defineConfig(() => ({
|
|
|
1872
2322
|
|
|
1873
2323
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > pnpm-workspace.yaml 1`] = `
|
|
1874
2324
|
"packages:
|
|
1875
|
-
-
|
|
1876
|
-
-
|
|
1877
|
-
-
|
|
2325
|
+
- packages/*
|
|
2326
|
+
- test-app
|
|
2327
|
+
- packages/common/*
|
|
2328
|
+
catalog:
|
|
2329
|
+
vite: 8.2.2
|
|
2330
|
+
vitest: 4.1.11
|
|
2331
|
+
'@vitest/coverage-v8': 4.1.11
|
|
2332
|
+
constructs: 10.8.1
|
|
2333
|
+
aws-cdk-lib: 2.266.0
|
|
2334
|
+
'@types/node': 26.4.0
|
|
2335
|
+
react: 19.2.8
|
|
2336
|
+
react-dom: 19.2.8
|
|
2337
|
+
'@cloudscape-design/components': 3.0.1354
|
|
2338
|
+
'@cloudscape-design/board-components': 3.0.220
|
|
2339
|
+
'@cloudscape-design/global-styles': 1.0.67
|
|
2340
|
+
tailwindcss: 4.3.3
|
|
2341
|
+
'@nx/react': 23.1.2
|
|
2342
|
+
'@vitest/ui': 4.1.11
|
|
2343
|
+
'@tailwindcss/vite': 4.3.3
|
|
1878
2344
|
"
|
|
1879
2345
|
`;
|
|
1880
2346
|
|
|
@@ -1884,37 +2350,37 @@ This library was generated with [@aws/nx-plugin](https://github.com/awslabs/nx-p
|
|
|
1884
2350
|
|
|
1885
2351
|
## Building
|
|
1886
2352
|
|
|
1887
|
-
Run \`
|
|
2353
|
+
Run \`npx nx build @proj/test-app [--skip-nx-cache]\` to build the application.
|
|
1888
2354
|
|
|
1889
2355
|
## Run dev server
|
|
1890
2356
|
|
|
1891
|
-
Run \`
|
|
2357
|
+
Run \`npx nx serve @proj/test-app\`
|
|
1892
2358
|
|
|
1893
2359
|
## Running unit tests
|
|
1894
2360
|
|
|
1895
|
-
Run \`
|
|
2361
|
+
Run \`npx nx test @proj/test-app\` to execute the unit tests via Vitest.
|
|
1896
2362
|
|
|
1897
2363
|
### Updating snapshots
|
|
1898
2364
|
|
|
1899
2365
|
To update snapshots, run the following command:
|
|
1900
2366
|
|
|
1901
|
-
\`
|
|
2367
|
+
\`npx nx test @proj/test-app --configuration=update-snapshot\`
|
|
1902
2368
|
|
|
1903
2369
|
## Run lint
|
|
1904
2370
|
|
|
1905
|
-
Run \`
|
|
2371
|
+
Run \`npx nx lint @proj/test-app\`
|
|
1906
2372
|
|
|
1907
2373
|
### Fixable issues
|
|
1908
2374
|
|
|
1909
2375
|
You can also automatically fix some lint errors by running the following command:
|
|
1910
2376
|
|
|
1911
|
-
\`
|
|
2377
|
+
\`npx nx lint @proj/test-app --configuration=fix\`
|
|
1912
2378
|
|
|
1913
2379
|
### Runtime config
|
|
1914
2380
|
|
|
1915
2381
|
In order to integrate with cognito or trpc backends, you need to have a \`runtime-config.json\` file in your \`/public\` website directory. You can fetch this is follows:
|
|
1916
2382
|
|
|
1917
|
-
\`
|
|
2383
|
+
\`npx nx load-runtime-config @proj/test-app\`
|
|
1918
2384
|
|
|
1919
2385
|
> [!IMPORTANT]
|
|
1920
2386
|
> Ensure you have AWS CLI and curl installed
|
|
@@ -1948,6 +2414,25 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1948
2414
|
"
|
|
1949
2415
|
`;
|
|
1950
2416
|
|
|
2417
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > test-app/package.json 1`] = `
|
|
2418
|
+
"{
|
|
2419
|
+
"name": "@proj/test-app",
|
|
2420
|
+
"version": "0.0.1",
|
|
2421
|
+
"private": true,
|
|
2422
|
+
"type": "module",
|
|
2423
|
+
"dependencies": {
|
|
2424
|
+
"@cloudscape-design/board-components": "catalog:",
|
|
2425
|
+
"@cloudscape-design/components": "catalog:",
|
|
2426
|
+
"@cloudscape-design/global-styles": "catalog:",
|
|
2427
|
+
"react": "catalog:",
|
|
2428
|
+
"react-dom": "catalog:",
|
|
2429
|
+
"tailwindcss": "catalog:"
|
|
2430
|
+
},
|
|
2431
|
+
"devDependencies": {}
|
|
2432
|
+
}
|
|
2433
|
+
"
|
|
2434
|
+
`;
|
|
2435
|
+
|
|
1951
2436
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > test-app/project.json 1`] = `
|
|
1952
2437
|
"{
|
|
1953
2438
|
"name": "@proj/test-app",
|
|
@@ -1959,33 +2444,20 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1959
2444
|
"generator": "ts#react-website",
|
|
1960
2445
|
"ux": "cloudscape",
|
|
1961
2446
|
"framework": "react",
|
|
1962
|
-
"infra": "cloudfront-s3"
|
|
2447
|
+
"infra": "cloudfront-s3",
|
|
2448
|
+
"tailwind": true,
|
|
2449
|
+
"tanstackRouter": false,
|
|
2450
|
+
"iac": "cdk"
|
|
1963
2451
|
},
|
|
1964
2452
|
"targets": {
|
|
1965
|
-
"
|
|
1966
|
-
"dependsOn": ["
|
|
1967
|
-
"options": {
|
|
1968
|
-
"outputPath": "dist/{projectRoot}/bundle"
|
|
1969
|
-
}
|
|
2453
|
+
"assemble": {
|
|
2454
|
+
"dependsOn": ["compile", "bundle"]
|
|
1970
2455
|
},
|
|
1971
|
-
"
|
|
1972
|
-
"
|
|
1973
|
-
"outputs": ["{options.outputPath}"],
|
|
1974
|
-
"defaultConfiguration": "production",
|
|
1975
|
-
"options": {
|
|
1976
|
-
"outputPath": "dist/{projectRoot}/bundle"
|
|
1977
|
-
},
|
|
1978
|
-
"configurations": {
|
|
1979
|
-
"development": {
|
|
1980
|
-
"mode": "development"
|
|
1981
|
-
},
|
|
1982
|
-
"production": {
|
|
1983
|
-
"mode": "production"
|
|
1984
|
-
}
|
|
1985
|
-
}
|
|
2456
|
+
"build": {
|
|
2457
|
+
"dependsOn": ["lint", "compile", "test", "bundle"]
|
|
1986
2458
|
},
|
|
1987
2459
|
"compile": {
|
|
1988
|
-
"dependsOn": ["
|
|
2460
|
+
"dependsOn": ["^compile"],
|
|
1989
2461
|
"executor": "nx:run-commands",
|
|
1990
2462
|
"outputs": ["{workspaceRoot}/dist/{projectRoot}/tsc"],
|
|
1991
2463
|
"options": {
|
|
@@ -1993,86 +2465,54 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1993
2465
|
"cwd": "{projectRoot}"
|
|
1994
2466
|
}
|
|
1995
2467
|
},
|
|
1996
|
-
"
|
|
2468
|
+
"dev": {
|
|
2469
|
+
"executor": "nx:run-commands",
|
|
2470
|
+
"continuous": true,
|
|
2471
|
+
"options": {
|
|
2472
|
+
"command": "vite --mode local-dev",
|
|
2473
|
+
"cwd": "{projectRoot}"
|
|
2474
|
+
}
|
|
2475
|
+
},
|
|
2476
|
+
"format": {
|
|
1997
2477
|
"executor": "nx:run-commands",
|
|
1998
2478
|
"cache": true,
|
|
1999
2479
|
"inputs": ["biome"],
|
|
2000
2480
|
"options": {
|
|
2001
|
-
"command": "biome
|
|
2481
|
+
"command": "biome format {projectRoot}"
|
|
2002
2482
|
},
|
|
2003
2483
|
"configurations": {
|
|
2004
2484
|
"fix": {
|
|
2005
|
-
"command": "biome
|
|
2485
|
+
"command": "biome format --write {projectRoot}"
|
|
2006
2486
|
},
|
|
2007
2487
|
"skip-lint": {
|
|
2008
2488
|
"command": "node -e \\"\\""
|
|
2009
2489
|
}
|
|
2010
2490
|
}
|
|
2011
2491
|
},
|
|
2012
|
-
"
|
|
2492
|
+
"lint": {
|
|
2013
2493
|
"executor": "nx:run-commands",
|
|
2014
|
-
"
|
|
2015
|
-
|
|
2016
|
-
},
|
|
2017
|
-
"options": {
|
|
2018
|
-
"command": "aws s3 cp s3://\`aws cloudformation describe-stacks --query \\"Stacks[?starts_with(StackName, 'proj-')][].Outputs[] | [?contains(OutputKey, 'TestAppWebsiteBucketName')].OutputValue\\" --output text\`/runtime-config.json \\"{projectRoot}/public/runtime-config.json\\""
|
|
2019
|
-
}
|
|
2020
|
-
},
|
|
2021
|
-
"preview": {
|
|
2022
|
-
"dependsOn": ["build"],
|
|
2023
|
-
"executor": "@nx/vite:preview-server",
|
|
2024
|
-
"defaultConfiguration": "development",
|
|
2494
|
+
"cache": true,
|
|
2495
|
+
"inputs": ["biome"],
|
|
2025
2496
|
"options": {
|
|
2026
|
-
"
|
|
2497
|
+
"command": "biome lint {projectRoot}"
|
|
2027
2498
|
},
|
|
2028
2499
|
"configurations": {
|
|
2029
|
-
"
|
|
2030
|
-
"
|
|
2500
|
+
"fix": {
|
|
2501
|
+
"command": "biome check --write {projectRoot}"
|
|
2031
2502
|
},
|
|
2032
|
-
"
|
|
2033
|
-
"
|
|
2503
|
+
"skip-lint": {
|
|
2504
|
+
"command": "node -e \\"\\""
|
|
2034
2505
|
}
|
|
2035
|
-
}
|
|
2036
|
-
},
|
|
2037
|
-
"serve": {
|
|
2038
|
-
"executor": "@nx/vite:dev-server",
|
|
2039
|
-
"defaultConfiguration": "development",
|
|
2040
|
-
"options": {
|
|
2041
|
-
"buildTarget": "@proj/test-app:build"
|
|
2042
2506
|
},
|
|
2043
|
-
"
|
|
2044
|
-
"development": {
|
|
2045
|
-
"buildTarget": "@proj/test-app:build:development",
|
|
2046
|
-
"hmr": true
|
|
2047
|
-
},
|
|
2048
|
-
"production": {
|
|
2049
|
-
"buildTarget": "@proj/test-app:build:production",
|
|
2050
|
-
"hmr": false
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2507
|
+
"dependsOn": ["format"]
|
|
2053
2508
|
},
|
|
2054
|
-
"
|
|
2055
|
-
"executor": "
|
|
2056
|
-
"
|
|
2057
|
-
"
|
|
2058
|
-
"hmr": true,
|
|
2059
|
-
"mode": "serve-local"
|
|
2509
|
+
"load-runtime-config": {
|
|
2510
|
+
"executor": "nx:run-commands",
|
|
2511
|
+
"metadata": {
|
|
2512
|
+
"description": "Load runtime config from your deployed stack for dev purposes. You must set your AWS CLI credentials whilst calling 'npx nx load-runtime-config @proj/test-app'"
|
|
2060
2513
|
},
|
|
2061
|
-
"continuous": true
|
|
2062
|
-
},
|
|
2063
|
-
"serve-static": {
|
|
2064
|
-
"executor": "@nx/web:file-server",
|
|
2065
|
-
"dependsOn": ["build"],
|
|
2066
2514
|
"options": {
|
|
2067
|
-
"
|
|
2068
|
-
"spa": true
|
|
2069
|
-
}
|
|
2070
|
-
},
|
|
2071
|
-
"test": {
|
|
2072
|
-
"executor": "@nx/vitest:test",
|
|
2073
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
2074
|
-
"options": {
|
|
2075
|
-
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
2515
|
+
"command": "aws s3 cp s3://\`aws cloudformation describe-stacks --query \\"Stacks[?starts_with(StackName, 'proj-')][].Outputs[] | [?contains(OutputKey, 'TestAppWebsiteBucketName')].OutputValue\\" --output text\`/runtime-config.json \\"{projectRoot}/public/runtime-config.json\\""
|
|
2076
2516
|
}
|
|
2077
2517
|
}
|
|
2078
2518
|
}
|
|
@@ -2280,15 +2720,22 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2280
2720
|
"outDir": "../dist/test-app/tsc",
|
|
2281
2721
|
"tsBuildInfoFile": "../dist/test-app/tsc/tsconfig.lib.tsbuildinfo",
|
|
2282
2722
|
"jsx": "react-jsx",
|
|
2283
|
-
"lib": [
|
|
2723
|
+
"lib": [
|
|
2724
|
+
"DOM"
|
|
2725
|
+
],
|
|
2284
2726
|
"types": [
|
|
2285
2727
|
"node",
|
|
2286
2728
|
"@nx/react/typings/cssmodule.d.ts",
|
|
2287
2729
|
"@nx/react/typings/image.d.ts",
|
|
2288
2730
|
"vite/client"
|
|
2289
|
-
]
|
|
2731
|
+
],
|
|
2732
|
+
"rootDir": "src",
|
|
2733
|
+
"module": "esnext",
|
|
2734
|
+
"moduleResolution": "bundler"
|
|
2290
2735
|
},
|
|
2291
2736
|
"exclude": [
|
|
2737
|
+
"out-tsc",
|
|
2738
|
+
"dist",
|
|
2292
2739
|
"src/**/*.spec.ts",
|
|
2293
2740
|
"src/**/*.test.ts",
|
|
2294
2741
|
"src/**/*.spec.tsx",
|
|
@@ -2302,7 +2749,12 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2302
2749
|
"vitest.config.ts",
|
|
2303
2750
|
"vitest.config.mts"
|
|
2304
2751
|
],
|
|
2305
|
-
"include": [
|
|
2752
|
+
"include": [
|
|
2753
|
+
"src/**/*.js",
|
|
2754
|
+
"src/**/*.jsx",
|
|
2755
|
+
"src/**/*.ts",
|
|
2756
|
+
"src/**/*.tsx"
|
|
2757
|
+
]
|
|
2306
2758
|
}
|
|
2307
2759
|
"
|
|
2308
2760
|
`;
|
|
@@ -2341,7 +2793,10 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2341
2793
|
"vitest",
|
|
2342
2794
|
"@nx/react/typings/cssmodule.d.ts",
|
|
2343
2795
|
"@nx/react/typings/image.d.ts"
|
|
2344
|
-
]
|
|
2796
|
+
],
|
|
2797
|
+
"jsx": "react-jsx",
|
|
2798
|
+
"module": "esnext",
|
|
2799
|
+
"moduleResolution": "bundler"
|
|
2345
2800
|
},
|
|
2346
2801
|
"include": [
|
|
2347
2802
|
"vite.config.ts",
|
|
@@ -2390,7 +2845,7 @@ export default defineConfig(() => ({
|
|
|
2390
2845
|
// plugins: [],
|
|
2391
2846
|
// },
|
|
2392
2847
|
build: {
|
|
2393
|
-
outDir: '../dist/test-app',
|
|
2848
|
+
outDir: '../dist/test-app/bundle',
|
|
2394
2849
|
emptyOutDir: true,
|
|
2395
2850
|
reportCompressedSize: true,
|
|
2396
2851
|
commonjsOptions: {
|
|
@@ -2406,11 +2861,11 @@ export default defineConfig(() => ({
|
|
|
2406
2861
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
2407
2862
|
reporters: ['default'],
|
|
2408
2863
|
coverage: {
|
|
2409
|
-
reportsDirectory: '
|
|
2864
|
+
reportsDirectory: '../dist/test-app/test-output/vitest/coverage',
|
|
2410
2865
|
provider: 'v8' as const,
|
|
2411
2866
|
},
|
|
2412
2867
|
},
|
|
2413
|
-
resolve: { tsconfigPaths: true },
|
|
2868
|
+
resolve: { tsconfigPaths: true, dedupe: ['react', 'react-dom'] },
|
|
2414
2869
|
define: { global: {} },
|
|
2415
2870
|
}));
|
|
2416
2871
|
"
|
|
@@ -2420,9 +2875,14 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2420
2875
|
"{
|
|
2421
2876
|
"compilerOptions": {
|
|
2422
2877
|
"paths": {
|
|
2423
|
-
"
|
|
2424
|
-
|
|
2878
|
+
"@proj/test-app": [
|
|
2879
|
+
"./test-app/src/index.ts"
|
|
2880
|
+
],
|
|
2881
|
+
"@proj/common-constructs": [
|
|
2882
|
+
"./packages/common/constructs/src/index.ts"
|
|
2883
|
+
]
|
|
2425
2884
|
},
|
|
2885
|
+
"composite": true,
|
|
2426
2886
|
"rootDir": "."
|
|
2427
2887
|
}
|
|
2428
2888
|
}
|
|
@@ -2431,6 +2891,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2431
2891
|
|
|
2432
2892
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > tsconfig.json 1`] = `
|
|
2433
2893
|
"{
|
|
2894
|
+
"extends": "./tsconfig.base.json",
|
|
2895
|
+
"files": [],
|
|
2896
|
+
"include": [],
|
|
2434
2897
|
"references": [
|
|
2435
2898
|
{
|
|
2436
2899
|
"path": "./test-app"
|
|
@@ -2443,11 +2906,19 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2443
2906
|
"
|
|
2444
2907
|
`;
|
|
2445
2908
|
|
|
2446
|
-
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > vitest.
|
|
2447
|
-
"
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2909
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > vitest.config.ts 1`] = `
|
|
2910
|
+
"import { defineConfig } from 'vitest/config';
|
|
2911
|
+
|
|
2912
|
+
export default defineConfig({
|
|
2913
|
+
test: {
|
|
2914
|
+
projects: [
|
|
2915
|
+
'**/vite.config.{mjs,js,ts,mts}',
|
|
2916
|
+
'**/vitest.config.{mjs,js,ts,mts}',
|
|
2917
|
+
'!vitest.config.{mjs,js,ts,mts}',
|
|
2918
|
+
'!vite.config.{mjs,js,ts,mts}',
|
|
2919
|
+
],
|
|
2920
|
+
},
|
|
2921
|
+
});
|
|
2451
2922
|
"
|
|
2452
2923
|
`;
|
|
2453
2924
|
|
|
@@ -2463,7 +2934,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2463
2934
|
|
|
2464
2935
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > biome.json 1`] = `
|
|
2465
2936
|
"{
|
|
2466
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2937
|
+
"$schema": "https://biomejs.dev/schemas/2.5.10/schema.json",
|
|
2467
2938
|
"root": true,
|
|
2468
2939
|
"formatter": {
|
|
2469
2940
|
"enabled": true,
|
|
@@ -2475,6 +2946,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2475
2946
|
"formatter": {
|
|
2476
2947
|
"quoteStyle": "single",
|
|
2477
2948
|
"trailingCommas": "all"
|
|
2949
|
+
},
|
|
2950
|
+
"resolver": {
|
|
2951
|
+
"experimentalPnpmCatalogs": true
|
|
2478
2952
|
}
|
|
2479
2953
|
},
|
|
2480
2954
|
"css": {
|
|
@@ -2488,9 +2962,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2488
2962
|
"linter": {
|
|
2489
2963
|
"enabled": true,
|
|
2490
2964
|
"rules": {
|
|
2491
|
-
"
|
|
2965
|
+
"preset": "none",
|
|
2492
2966
|
"correctness": {
|
|
2493
|
-
"noUndeclaredDependencies": "
|
|
2967
|
+
"noUndeclaredDependencies": "error"
|
|
2494
2968
|
}
|
|
2495
2969
|
}
|
|
2496
2970
|
},
|
|
@@ -2506,12 +2980,33 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2506
2980
|
"**",
|
|
2507
2981
|
"!**/dist",
|
|
2508
2982
|
"!**/out-tsc",
|
|
2983
|
+
"!**/test-output",
|
|
2509
2984
|
"!**/node_modules",
|
|
2510
2985
|
"!**/.nx",
|
|
2511
2986
|
"!**/.venv",
|
|
2512
|
-
"
|
|
2987
|
+
"!**/.grit",
|
|
2988
|
+
"!**/*.css",
|
|
2989
|
+
"!**/*.gen.*",
|
|
2990
|
+
"!**/generated/**",
|
|
2991
|
+
"!**/tsconfig*.json"
|
|
2513
2992
|
]
|
|
2514
|
-
}
|
|
2993
|
+
},
|
|
2994
|
+
"overrides": [
|
|
2995
|
+
{
|
|
2996
|
+
"includes": [
|
|
2997
|
+
"**/*.config.{ts,mts,cts,js,mjs,cjs}",
|
|
2998
|
+
"**/*.{spec,test}.{ts,tsx,mts,cts,js,jsx,mjs,cjs}",
|
|
2999
|
+
"**/*.stories.{ts,tsx}"
|
|
3000
|
+
],
|
|
3001
|
+
"linter": {
|
|
3002
|
+
"rules": {
|
|
3003
|
+
"correctness": {
|
|
3004
|
+
"noUndeclaredDependencies": "off"
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
]
|
|
2515
3010
|
}
|
|
2516
3011
|
"
|
|
2517
3012
|
`;
|
|
@@ -2524,35 +3019,66 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2524
3019
|
"targetDefaults": {
|
|
2525
3020
|
"build": {
|
|
2526
3021
|
"cache": true,
|
|
2527
|
-
"dependsOn": ["^build"],
|
|
2528
3022
|
"inputs": ["default"]
|
|
2529
3023
|
},
|
|
2530
3024
|
"lint": {
|
|
2531
3025
|
"cache": true
|
|
2532
3026
|
},
|
|
2533
|
-
"
|
|
2534
|
-
"cache": true,
|
|
3027
|
+
"test": {
|
|
2535
3028
|
"dependsOn": ["^build"],
|
|
2536
|
-
"inputs": ["default"
|
|
3029
|
+
"inputs": ["default"]
|
|
2537
3030
|
},
|
|
2538
3031
|
"@nx/vitest:test": {
|
|
2539
3032
|
"cache": true,
|
|
2540
|
-
"inputs": ["default", "^
|
|
3033
|
+
"inputs": ["default", "^production"],
|
|
2541
3034
|
"configurations": {
|
|
2542
3035
|
"update-snapshot": {
|
|
2543
3036
|
"args": "--update"
|
|
2544
3037
|
}
|
|
2545
3038
|
}
|
|
2546
3039
|
},
|
|
2547
|
-
"test": {
|
|
2548
|
-
"dependsOn": ["^build"],
|
|
2549
|
-
"inputs": ["default"]
|
|
2550
|
-
},
|
|
2551
3040
|
"compile": {
|
|
2552
3041
|
"cache": true,
|
|
2553
3042
|
"inputs": ["default"]
|
|
2554
3043
|
}
|
|
2555
3044
|
},
|
|
3045
|
+
"plugins": [
|
|
3046
|
+
{
|
|
3047
|
+
"plugin": "@nx/js/typescript",
|
|
3048
|
+
"options": {
|
|
3049
|
+
"typecheck": {
|
|
3050
|
+
"targetName": "typecheck"
|
|
3051
|
+
},
|
|
3052
|
+
"build": {
|
|
3053
|
+
"targetName": "compile",
|
|
3054
|
+
"configName": "tsconfig.lib.json",
|
|
3055
|
+
"buildDepsName": "build-deps",
|
|
3056
|
+
"watchDepsName": "watch-deps"
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
},
|
|
3060
|
+
{
|
|
3061
|
+
"plugin": "@nx/vite/plugin",
|
|
3062
|
+
"options": {
|
|
3063
|
+
"buildTargetName": "bundle",
|
|
3064
|
+
"serveTargetName": "serve",
|
|
3065
|
+
"devTargetName": "serve",
|
|
3066
|
+
"previewTargetName": "preview",
|
|
3067
|
+
"serveStaticTargetName": "serve-static",
|
|
3068
|
+
"typecheckTargetName": "vite:typecheck",
|
|
3069
|
+
"buildDepsTargetName": "build-deps",
|
|
3070
|
+
"watchDepsTargetName": "watch-deps"
|
|
3071
|
+
}
|
|
3072
|
+
},
|
|
3073
|
+
{
|
|
3074
|
+
"plugin": "@nx/vitest",
|
|
3075
|
+
"options": {
|
|
3076
|
+
"testTargetName": "test",
|
|
3077
|
+
"ciTargetName": "test-ci",
|
|
3078
|
+
"testMode": "watch"
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
],
|
|
2556
3082
|
"generators": {
|
|
2557
3083
|
"@nx/react": {
|
|
2558
3084
|
"application": {
|
|
@@ -2574,27 +3100,11 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2574
3100
|
"biome": ["default", "{workspaceRoot}/biome.json"],
|
|
2575
3101
|
"default": [
|
|
2576
3102
|
{
|
|
2577
|
-
"dependentTasksOutputFiles": "
|
|
3103
|
+
"dependentTasksOutputFiles": "!{reports,coverage}/**",
|
|
2578
3104
|
"transitive": true
|
|
2579
3105
|
}
|
|
2580
3106
|
]
|
|
2581
|
-
}
|
|
2582
|
-
"plugins": [
|
|
2583
|
-
{
|
|
2584
|
-
"plugin": "@nx/js/typescript",
|
|
2585
|
-
"options": {
|
|
2586
|
-
"typecheck": {
|
|
2587
|
-
"targetName": "typecheck"
|
|
2588
|
-
},
|
|
2589
|
-
"build": {
|
|
2590
|
-
"targetName": "compile",
|
|
2591
|
-
"configName": "tsconfig.lib.json",
|
|
2592
|
-
"buildDepsName": "build-deps",
|
|
2593
|
-
"watchDepsName": "watch-deps"
|
|
2594
|
-
}
|
|
2595
|
-
}
|
|
2596
|
-
}
|
|
2597
|
-
]
|
|
3107
|
+
}
|
|
2598
3108
|
}
|
|
2599
3109
|
"
|
|
2600
3110
|
`;
|
|
@@ -2602,48 +3112,43 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2602
3112
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > package.json 1`] = `
|
|
2603
3113
|
"{
|
|
2604
3114
|
"name": "@proj/source",
|
|
2605
|
-
"dependencies": {
|
|
2606
|
-
"@cloudscape-design/board-components": "3.0.189",
|
|
2607
|
-
"@cloudscape-design/components": "3.0.1308",
|
|
2608
|
-
"@cloudscape-design/global-styles": "1.0.59",
|
|
2609
|
-
"@tanstack/react-router": "1.170.15",
|
|
2610
|
-
"aws-cdk-lib": "2.258.0",
|
|
2611
|
-
"constructs": "10.6.0",
|
|
2612
|
-
"react": "19.2.7",
|
|
2613
|
-
"react-dom": "19.2.7",
|
|
2614
|
-
"tailwindcss": "4.2.2"
|
|
2615
|
-
},
|
|
3115
|
+
"dependencies": {},
|
|
2616
3116
|
"devDependencies": {
|
|
2617
|
-
"@nx/js": "
|
|
2618
|
-
"@nx/react": "
|
|
2619
|
-
"@nx/vite": "
|
|
2620
|
-
"@nx/vitest": "
|
|
2621
|
-
"@nx/web": "
|
|
2622
|
-
"@swc-node/register": "~1.11.1",
|
|
2623
|
-
"@swc/core": "~1.15.5",
|
|
3117
|
+
"@nx/js": "23.1.2",
|
|
3118
|
+
"@nx/react": "catalog:",
|
|
3119
|
+
"@nx/vite": "23.1.2",
|
|
3120
|
+
"@nx/vitest": "23.1.2",
|
|
3121
|
+
"@nx/web": "23.1.2",
|
|
2624
3122
|
"@swc/helpers": "~0.5.18",
|
|
2625
|
-
"@tailwindcss/vite": "
|
|
2626
|
-
"@tanstack/router-generator": "
|
|
2627
|
-
"@tanstack/router-plugin": "
|
|
2628
|
-
"@tanstack/router-utils": "
|
|
2629
|
-
"@tanstack/virtual-file-routes": "
|
|
3123
|
+
"@tailwindcss/vite": "catalog:",
|
|
3124
|
+
"@tanstack/router-generator": "catalog:",
|
|
3125
|
+
"@tanstack/router-plugin": "catalog:",
|
|
3126
|
+
"@tanstack/router-utils": "catalog:",
|
|
3127
|
+
"@tanstack/virtual-file-routes": "catalog:",
|
|
2630
3128
|
"@testing-library/dom": "10.4.0",
|
|
2631
3129
|
"@testing-library/react": "16.3.0",
|
|
2632
|
-
"@types/node": "
|
|
3130
|
+
"@types/node": "catalog:",
|
|
2633
3131
|
"@types/react": "^19.0.0",
|
|
2634
3132
|
"@types/react-dom": "^19.0.0",
|
|
2635
3133
|
"@vitejs/plugin-react": "^6.0.0",
|
|
2636
|
-
"@vitest/coverage-v8": "
|
|
2637
|
-
"@vitest/ui": "
|
|
3134
|
+
"@vitest/coverage-v8": "catalog:",
|
|
3135
|
+
"@vitest/ui": "catalog:",
|
|
2638
3136
|
"jiti": "2.4.2",
|
|
2639
|
-
"jsdom": "
|
|
2640
|
-
"typescript": "~
|
|
2641
|
-
"vite": "
|
|
2642
|
-
"vitest": "
|
|
3137
|
+
"jsdom": "^27.1.0",
|
|
3138
|
+
"typescript": "~6.0.3",
|
|
3139
|
+
"vite": "catalog:",
|
|
3140
|
+
"vitest": "catalog:"
|
|
2643
3141
|
},
|
|
2644
3142
|
"type": "module",
|
|
2645
|
-
"
|
|
2646
|
-
"
|
|
3143
|
+
"workspaces": [
|
|
3144
|
+
"packages/*",
|
|
3145
|
+
"test-app",
|
|
3146
|
+
"packages/common/constructs"
|
|
3147
|
+
],
|
|
3148
|
+
"overrides": {
|
|
3149
|
+
"@nx/react": {
|
|
3150
|
+
"express": "5.2.1"
|
|
3151
|
+
}
|
|
2647
3152
|
}
|
|
2648
3153
|
}
|
|
2649
3154
|
"
|
|
@@ -2656,27 +3161,27 @@ This library was generated with [@aws/nx-plugin](https://github.com/awslabs/nx-p
|
|
|
2656
3161
|
|
|
2657
3162
|
## Building
|
|
2658
3163
|
|
|
2659
|
-
Run \`
|
|
3164
|
+
Run \`npx nx build @proj/common-constructs [--skip-nx-cache]\` to build the application.
|
|
2660
3165
|
|
|
2661
3166
|
## Running unit tests
|
|
2662
3167
|
|
|
2663
|
-
Run \`
|
|
3168
|
+
Run \`npx nx test @proj/common-constructs\` to execute the unit tests via Vitest.
|
|
2664
3169
|
|
|
2665
3170
|
### Updating snapshots
|
|
2666
3171
|
|
|
2667
3172
|
To update snapshots, run the following command:
|
|
2668
3173
|
|
|
2669
|
-
\`
|
|
3174
|
+
\`npx nx test @proj/common-constructs --configuration=update-snapshot\`
|
|
2670
3175
|
|
|
2671
3176
|
## Run lint
|
|
2672
3177
|
|
|
2673
|
-
Run \`
|
|
3178
|
+
Run \`npx nx lint @proj/common-constructs\`
|
|
2674
3179
|
|
|
2675
3180
|
### Fixable issues
|
|
2676
3181
|
|
|
2677
3182
|
You can also automatiaclly fix some lint errors by running the following command:
|
|
2678
3183
|
|
|
2679
|
-
\`
|
|
3184
|
+
\`npx nx lint @proj/common-constructs --configuration=fix\`
|
|
2680
3185
|
|
|
2681
3186
|
## Useful links
|
|
2682
3187
|
|
|
@@ -2686,6 +3191,24 @@ You can also automatiaclly fix some lint errors by running the following command
|
|
|
2686
3191
|
"
|
|
2687
3192
|
`;
|
|
2688
3193
|
|
|
3194
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > packages/common/constructs/package.json 1`] = `
|
|
3195
|
+
"{
|
|
3196
|
+
"name": "@proj/common-constructs",
|
|
3197
|
+
"version": "0.0.1",
|
|
3198
|
+
"private": true,
|
|
3199
|
+
"type": "module",
|
|
3200
|
+
"dependencies": {
|
|
3201
|
+
"aws-cdk-lib": "catalog:",
|
|
3202
|
+
"constructs": "catalog:",
|
|
3203
|
+
"tslib": "^2.3.0"
|
|
3204
|
+
},
|
|
3205
|
+
"devDependencies": {
|
|
3206
|
+
"@types/node": "catalog:"
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
3209
|
+
"
|
|
3210
|
+
`;
|
|
3211
|
+
|
|
2689
3212
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > packages/common/constructs/project.json 1`] = `
|
|
2690
3213
|
"{
|
|
2691
3214
|
"name": "@proj/common-constructs",
|
|
@@ -2697,6 +3220,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2697
3220
|
"generator": "ts#project"
|
|
2698
3221
|
},
|
|
2699
3222
|
"targets": {
|
|
3223
|
+
"assemble": {
|
|
3224
|
+
"dependsOn": ["compile", "@proj/test-app:assemble"]
|
|
3225
|
+
},
|
|
2700
3226
|
"build": {
|
|
2701
3227
|
"dependsOn": ["lint", "compile", "test", "@proj/test-app:build"]
|
|
2702
3228
|
},
|
|
@@ -2704,14 +3230,31 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2704
3230
|
"executor": "nx:run-commands",
|
|
2705
3231
|
"outputs": ["{workspaceRoot}/dist/{projectRoot}/tsc"],
|
|
2706
3232
|
"options": {
|
|
2707
|
-
"command": "tsc --build tsconfig.lib.json",
|
|
2708
|
-
"cwd": "{projectRoot}"
|
|
3233
|
+
"command": "tsc --build tsconfig.lib.json",
|
|
3234
|
+
"cwd": "{projectRoot}"
|
|
3235
|
+
}
|
|
3236
|
+
},
|
|
3237
|
+
"format": {
|
|
3238
|
+
"executor": "nx:run-commands",
|
|
3239
|
+
"cache": true,
|
|
3240
|
+
"inputs": ["biome"],
|
|
3241
|
+
"options": {
|
|
3242
|
+
"command": "biome format {projectRoot}"
|
|
3243
|
+
},
|
|
3244
|
+
"configurations": {
|
|
3245
|
+
"fix": {
|
|
3246
|
+
"command": "biome format --write {projectRoot}"
|
|
3247
|
+
},
|
|
3248
|
+
"skip-lint": {
|
|
3249
|
+
"command": "node -e \\"\\""
|
|
3250
|
+
}
|
|
2709
3251
|
}
|
|
2710
3252
|
},
|
|
2711
3253
|
"lint": {
|
|
2712
3254
|
"executor": "nx:run-commands",
|
|
2713
3255
|
"cache": true,
|
|
2714
3256
|
"inputs": ["biome"],
|
|
3257
|
+
"dependsOn": ["format"],
|
|
2715
3258
|
"options": {
|
|
2716
3259
|
"command": "biome lint {projectRoot}"
|
|
2717
3260
|
},
|
|
@@ -2723,13 +3266,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2723
3266
|
"command": "node -e \\"\\""
|
|
2724
3267
|
}
|
|
2725
3268
|
}
|
|
2726
|
-
},
|
|
2727
|
-
"test": {
|
|
2728
|
-
"executor": "@nx/vitest:test",
|
|
2729
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
2730
|
-
"options": {
|
|
2731
|
-
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
2732
|
-
}
|
|
2733
3269
|
}
|
|
2734
3270
|
}
|
|
2735
3271
|
}
|
|
@@ -2749,11 +3285,17 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2749
3285
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > packages/common/constructs/src/app/static-websites/test-app.ts 1`] = `
|
|
2750
3286
|
"import * as url from 'url';
|
|
2751
3287
|
import { Construct } from 'constructs';
|
|
2752
|
-
import { StaticWebsite } from '../../core/index.js';
|
|
3288
|
+
import { StaticWebsite, StaticWebsiteProps } from '../../core/index.js';
|
|
3289
|
+
|
|
3290
|
+
export type TestAppProps = Omit<
|
|
3291
|
+
StaticWebsiteProps,
|
|
3292
|
+
'websiteName' | 'websiteFilePath'
|
|
3293
|
+
>;
|
|
2753
3294
|
|
|
2754
3295
|
export class TestApp extends StaticWebsite {
|
|
2755
|
-
constructor(scope: Construct, id: string) {
|
|
3296
|
+
constructor(scope: Construct, id: string, props?: TestAppProps) {
|
|
2756
3297
|
super(scope, id, {
|
|
3298
|
+
...props,
|
|
2757
3299
|
websiteName: 'TestApp',
|
|
2758
3300
|
websiteFilePath: url.fileURLToPath(
|
|
2759
3301
|
new URL('../../../../../../dist/test-app/bundle', import.meta.url),
|
|
@@ -2841,10 +3383,31 @@ export const suppressRules = (
|
|
|
2841
3383
|
"
|
|
2842
3384
|
`;
|
|
2843
3385
|
|
|
3386
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > packages/common/constructs/src/core/cloudfront.ts 1`] = `
|
|
3387
|
+
"import { CfnDistribution, Distribution } from 'aws-cdk-lib/aws-cloudfront';
|
|
3388
|
+
|
|
3389
|
+
/**
|
|
3390
|
+
* Finds the domain names associated with a CloudFront distribution.
|
|
3391
|
+
*
|
|
3392
|
+
* Includes the distribution's default \`*.cloudfront.net\` domain name plus any custom
|
|
3393
|
+
* domain names (aliases) configured on it.
|
|
3394
|
+
*/
|
|
3395
|
+
export const findCloudFrontDomainNames = (
|
|
3396
|
+
distribution: Distribution,
|
|
3397
|
+
): string[] => {
|
|
3398
|
+
const cfnDistribution = distribution.node.defaultChild as CfnDistribution;
|
|
3399
|
+
const distributionConfig =
|
|
3400
|
+
cfnDistribution.distributionConfig as CfnDistribution.DistributionConfigProperty;
|
|
3401
|
+
return [distribution.domainName, ...(distributionConfig.aliases ?? [])];
|
|
3402
|
+
};
|
|
3403
|
+
"
|
|
3404
|
+
`;
|
|
3405
|
+
|
|
2844
3406
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > packages/common/constructs/src/core/index.ts 1`] = `
|
|
2845
3407
|
"export * from './static-website.js';
|
|
2846
3408
|
export * from './app.js';
|
|
2847
3409
|
export * from './checkov.js';
|
|
3410
|
+
export * from './cloudfront.js';
|
|
2848
3411
|
export * from './runtime-config.js';
|
|
2849
3412
|
export * from './workspace.js';
|
|
2850
3413
|
"
|
|
@@ -3040,11 +3603,21 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3040
3603
|
"import {
|
|
3041
3604
|
CfnOutput,
|
|
3042
3605
|
CfnResource,
|
|
3606
|
+
Duration,
|
|
3043
3607
|
Lazy,
|
|
3608
|
+
Names,
|
|
3044
3609
|
RemovalPolicy,
|
|
3045
3610
|
Stack,
|
|
3046
3611
|
} from 'aws-cdk-lib';
|
|
3047
|
-
import {
|
|
3612
|
+
import {
|
|
3613
|
+
Distribution,
|
|
3614
|
+
HeadersFrameOption,
|
|
3615
|
+
HeadersReferrerPolicy,
|
|
3616
|
+
ResponseHeadersPolicy,
|
|
3617
|
+
SecurityPolicyProtocol,
|
|
3618
|
+
ViewerProtocolPolicy,
|
|
3619
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
3620
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
3048
3621
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
3049
3622
|
import {
|
|
3050
3623
|
BlockPublicAccess,
|
|
@@ -3053,18 +3626,83 @@ import {
|
|
|
3053
3626
|
IBucket,
|
|
3054
3627
|
ObjectOwnership,
|
|
3055
3628
|
} from 'aws-cdk-lib/aws-s3';
|
|
3056
|
-
import {
|
|
3629
|
+
import {
|
|
3630
|
+
BucketDeployment,
|
|
3631
|
+
CacheControl,
|
|
3632
|
+
Source,
|
|
3633
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
3057
3634
|
import { Construct } from 'constructs';
|
|
3058
3635
|
import { RuntimeConfig } from './runtime-config.js';
|
|
3059
|
-
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
3636
|
+
import { IKey, Key } from 'aws-cdk-lib/aws-kms';
|
|
3637
|
+
import {
|
|
3638
|
+
CfnDelivery,
|
|
3639
|
+
CfnDeliveryDestination,
|
|
3640
|
+
CfnDeliverySource,
|
|
3641
|
+
LogGroup,
|
|
3642
|
+
RetentionDays,
|
|
3643
|
+
} from 'aws-cdk-lib/aws-logs';
|
|
3644
|
+
import { Effect, PolicyStatement, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
|
|
3060
3645
|
import { CfnWebACL } from 'aws-cdk-lib/aws-wafv2';
|
|
3061
3646
|
import { suppressRules } from './checkov.js';
|
|
3062
3647
|
|
|
3063
3648
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
3064
3649
|
|
|
3650
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
3651
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
3652
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
3653
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
3654
|
+
// connect-src to your specific origins once they are known.
|
|
3655
|
+
const CONTENT_SECURITY_POLICY = [
|
|
3656
|
+
"default-src 'self'",
|
|
3657
|
+
"script-src 'self'",
|
|
3658
|
+
"style-src 'self' 'unsafe-inline'",
|
|
3659
|
+
"img-src 'self' data:",
|
|
3660
|
+
"font-src 'self' data:",
|
|
3661
|
+
"connect-src 'self' https: wss:",
|
|
3662
|
+
"object-src 'none'",
|
|
3663
|
+
"base-uri 'self'",
|
|
3664
|
+
"frame-ancestors 'none'",
|
|
3665
|
+
].join('; ');
|
|
3666
|
+
|
|
3065
3667
|
export interface StaticWebsiteProps {
|
|
3066
3668
|
readonly websiteName: string;
|
|
3067
3669
|
readonly websiteFilePath: string;
|
|
3670
|
+
/**
|
|
3671
|
+
* Custom domain names for the CloudFront distribution. Requires \`certificate\`.
|
|
3672
|
+
*/
|
|
3673
|
+
readonly domainNames?: string[];
|
|
3674
|
+
/**
|
|
3675
|
+
* ACM certificate for the custom domain names. Must be in us-east-1.
|
|
3676
|
+
* When provided, viewers are required to use TLS 1.2 or later.
|
|
3677
|
+
*/
|
|
3678
|
+
readonly certificate?: ICertificate;
|
|
3679
|
+
/**
|
|
3680
|
+
* Whether to protect the CloudFront distribution with an AWS WAF Web ACL.
|
|
3681
|
+
*
|
|
3682
|
+
* @default true
|
|
3683
|
+
*/
|
|
3684
|
+
readonly enableWaf?: boolean;
|
|
3685
|
+
/**
|
|
3686
|
+
* Server-side encryption for the website and distribution log buckets.
|
|
3687
|
+
*
|
|
3688
|
+
* @default BucketEncryption.KMS
|
|
3689
|
+
*/
|
|
3690
|
+
readonly encryption?: BucketEncryption;
|
|
3691
|
+
/**
|
|
3692
|
+
* KMS key used to encrypt the website and distribution log buckets. Only used when \`encryption\` is
|
|
3693
|
+
* \`BucketEncryption.KMS\`. When not provided, a new key is created. Note that a key imported via
|
|
3694
|
+
* \`Key.fromKeyArn\` must already grant the CloudWatch Logs, S3 and CloudFront service principals the
|
|
3695
|
+
* necessary permissions in its own key policy - \`addToResourcePolicy\` is a no-op on an imported key,
|
|
3696
|
+
* so this construct cannot grant them on your behalf.
|
|
3697
|
+
*/
|
|
3698
|
+
readonly encryptionKey?: IKey;
|
|
3699
|
+
/**
|
|
3700
|
+
* Whether the automatically created KMS key has rotation enabled. Only applies when \`encryption\` is
|
|
3701
|
+
* \`BucketEncryption.KMS\` and no \`encryptionKey\` is supplied.
|
|
3702
|
+
*
|
|
3703
|
+
* @default true
|
|
3704
|
+
*/
|
|
3705
|
+
readonly enableKeyRotation?: boolean;
|
|
3068
3706
|
}
|
|
3069
3707
|
|
|
3070
3708
|
/**
|
|
@@ -3083,39 +3721,53 @@ export class StaticWebsite extends Construct {
|
|
|
3083
3721
|
constructor(
|
|
3084
3722
|
scope: Construct,
|
|
3085
3723
|
id: string,
|
|
3086
|
-
{
|
|
3724
|
+
{
|
|
3725
|
+
websiteFilePath,
|
|
3726
|
+
websiteName,
|
|
3727
|
+
domainNames,
|
|
3728
|
+
certificate,
|
|
3729
|
+
enableWaf = true,
|
|
3730
|
+
encryption = BucketEncryption.KMS,
|
|
3731
|
+
encryptionKey,
|
|
3732
|
+
enableKeyRotation = true,
|
|
3733
|
+
}: StaticWebsiteProps,
|
|
3087
3734
|
) {
|
|
3088
3735
|
super(scope, id);
|
|
3089
|
-
this.node.setContext(
|
|
3090
|
-
'@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy',
|
|
3091
|
-
true,
|
|
3092
|
-
);
|
|
3093
3736
|
|
|
3094
|
-
const websiteKey
|
|
3095
|
-
|
|
3096
|
-
|
|
3737
|
+
const websiteKey: IKey | undefined =
|
|
3738
|
+
encryption === BucketEncryption.KMS
|
|
3739
|
+
? (encryptionKey ?? new Key(this, 'WebsiteKey', { enableKeyRotation }))
|
|
3740
|
+
: undefined;
|
|
3741
|
+
|
|
3742
|
+
// Allow CloudWatch Logs to use the website key for server access log delivery.
|
|
3743
|
+
const stack = Stack.of(this);
|
|
3744
|
+
websiteKey?.addToResourcePolicy(
|
|
3745
|
+
new PolicyStatement({
|
|
3746
|
+
effect: Effect.ALLOW,
|
|
3747
|
+
principals: [
|
|
3748
|
+
new ServicePrincipal(\`logs.\${stack.region}.amazonaws.com\`),
|
|
3749
|
+
],
|
|
3750
|
+
actions: [
|
|
3751
|
+
'kms:Encrypt',
|
|
3752
|
+
'kms:Decrypt',
|
|
3753
|
+
'kms:ReEncrypt*',
|
|
3754
|
+
'kms:GenerateDataKey*',
|
|
3755
|
+
'kms:DescribeKey',
|
|
3756
|
+
],
|
|
3757
|
+
resources: ['*'],
|
|
3758
|
+
conditions: {
|
|
3759
|
+
ArnLike: {
|
|
3760
|
+
'kms:EncryptionContext:aws:logs:arn': \`arn:aws:logs:\${stack.region}:\${stack.account}:log-group:*\`,
|
|
3761
|
+
},
|
|
3762
|
+
},
|
|
3763
|
+
}),
|
|
3764
|
+
);
|
|
3097
3765
|
|
|
3098
|
-
const
|
|
3099
|
-
|
|
3100
|
-
enforceSSL: true,
|
|
3101
|
-
autoDeleteObjects: true,
|
|
3102
|
-
removalPolicy: RemovalPolicy.DESTROY,
|
|
3103
|
-
encryption: BucketEncryption.KMS,
|
|
3766
|
+
const accessLogs = new LogGroup(this, 'AccessLogs', {
|
|
3767
|
+
retention: RetentionDays.ONE_YEAR,
|
|
3104
3768
|
encryptionKey: websiteKey,
|
|
3105
|
-
|
|
3106
|
-
publicReadAccess: false,
|
|
3107
|
-
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
3769
|
+
removalPolicy: RemovalPolicy.DESTROY,
|
|
3108
3770
|
});
|
|
3109
|
-
suppressRules(
|
|
3110
|
-
accessLogsBucket,
|
|
3111
|
-
['CKV_AWS_21'],
|
|
3112
|
-
'Access log bucket does not need versioning enabled',
|
|
3113
|
-
);
|
|
3114
|
-
suppressRules(
|
|
3115
|
-
accessLogsBucket,
|
|
3116
|
-
['CKV_AWS_18'],
|
|
3117
|
-
'Access log bucket does not need an access log bucket',
|
|
3118
|
-
);
|
|
3119
3771
|
|
|
3120
3772
|
// S3 Bucket to hold website files
|
|
3121
3773
|
this.websiteBucket = new Bucket(this, 'WebsiteBucket', {
|
|
@@ -3123,47 +3775,99 @@ export class StaticWebsite extends Construct {
|
|
|
3123
3775
|
enforceSSL: true,
|
|
3124
3776
|
autoDeleteObjects: true,
|
|
3125
3777
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
3126
|
-
encryption
|
|
3778
|
+
encryption,
|
|
3127
3779
|
encryptionKey: websiteKey,
|
|
3128
3780
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_ENFORCED,
|
|
3129
3781
|
publicReadAccess: false,
|
|
3130
3782
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
3131
|
-
serverAccessLogsPrefix: 'website-access-logs',
|
|
3132
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
3133
3783
|
});
|
|
3784
|
+
suppressRules(
|
|
3785
|
+
this.websiteBucket,
|
|
3786
|
+
['CKV_AWS_18'],
|
|
3787
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
3788
|
+
);
|
|
3789
|
+
this.deliverAccessLogsToCloudWatch(
|
|
3790
|
+
'Website',
|
|
3791
|
+
this.websiteBucket,
|
|
3792
|
+
accessLogs,
|
|
3793
|
+
);
|
|
3134
3794
|
// Web ACL
|
|
3135
|
-
const wafStack = new CloudfrontWebAcl(this, 'waf');
|
|
3795
|
+
const wafStack = enableWaf ? new CloudfrontWebAcl(this, 'waf') : undefined;
|
|
3136
3796
|
|
|
3137
|
-
//
|
|
3797
|
+
// Bucket holding CloudFront standard access logs. CloudFront delivers its
|
|
3798
|
+
// own logs to S3 only, so this bucket is retained; its S3 server access
|
|
3799
|
+
// logs are delivered to CloudWatch Logs.
|
|
3138
3800
|
const logBucket = new Bucket(this, 'DistributionLogBucket', {
|
|
3139
3801
|
enforceSSL: true,
|
|
3140
3802
|
autoDeleteObjects: true,
|
|
3141
3803
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
3142
|
-
encryption
|
|
3804
|
+
encryption,
|
|
3143
3805
|
encryptionKey: websiteKey,
|
|
3144
3806
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_PREFERRED,
|
|
3145
3807
|
publicReadAccess: false,
|
|
3146
3808
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
3147
|
-
serverAccessLogsPrefix: 'distribution-access-logs',
|
|
3148
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
3149
3809
|
});
|
|
3150
3810
|
suppressRules(
|
|
3151
3811
|
logBucket,
|
|
3152
3812
|
['CKV_AWS_21'],
|
|
3153
3813
|
'Distribution log bucket does not need versioning enabled',
|
|
3154
3814
|
);
|
|
3815
|
+
suppressRules(
|
|
3816
|
+
logBucket,
|
|
3817
|
+
['CKV_AWS_18'],
|
|
3818
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
3819
|
+
);
|
|
3820
|
+
this.deliverAccessLogsToCloudWatch('Distribution', logBucket, accessLogs);
|
|
3821
|
+
|
|
3822
|
+
// Security headers applied to all responses.
|
|
3823
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
3824
|
+
this,
|
|
3825
|
+
'ResponseHeadersPolicy',
|
|
3826
|
+
{
|
|
3827
|
+
securityHeadersBehavior: {
|
|
3828
|
+
strictTransportSecurity: {
|
|
3829
|
+
accessControlMaxAge: Duration.days(730),
|
|
3830
|
+
includeSubdomains: true,
|
|
3831
|
+
preload: true,
|
|
3832
|
+
override: true,
|
|
3833
|
+
},
|
|
3834
|
+
contentTypeOptions: { override: true },
|
|
3835
|
+
frameOptions: {
|
|
3836
|
+
frameOption: HeadersFrameOption.DENY,
|
|
3837
|
+
override: true,
|
|
3838
|
+
},
|
|
3839
|
+
referrerPolicy: {
|
|
3840
|
+
referrerPolicy:
|
|
3841
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
3842
|
+
override: true,
|
|
3843
|
+
},
|
|
3844
|
+
contentSecurityPolicy: {
|
|
3845
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
3846
|
+
override: true,
|
|
3847
|
+
},
|
|
3848
|
+
},
|
|
3849
|
+
},
|
|
3850
|
+
);
|
|
3155
3851
|
|
|
3156
3852
|
const defaultRootObject = 'index.html';
|
|
3157
3853
|
this.cloudFrontDistribution = new Distribution(
|
|
3158
3854
|
this,
|
|
3159
3855
|
'CloudfrontDistribution',
|
|
3160
3856
|
{
|
|
3161
|
-
webAclId: wafStack
|
|
3857
|
+
webAclId: wafStack?.wafArn,
|
|
3162
3858
|
enableLogging: true,
|
|
3163
3859
|
logBucket: logBucket,
|
|
3860
|
+
...(certificate
|
|
3861
|
+
? {
|
|
3862
|
+
certificate,
|
|
3863
|
+
domainNames,
|
|
3864
|
+
minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
3865
|
+
}
|
|
3866
|
+
: {}),
|
|
3164
3867
|
defaultBehavior: {
|
|
3165
3868
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
3166
3869
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
3870
|
+
responseHeadersPolicy,
|
|
3167
3871
|
},
|
|
3168
3872
|
defaultRootObject,
|
|
3169
3873
|
errorResponses: [
|
|
@@ -3180,16 +3884,31 @@ export class StaticWebsite extends Construct {
|
|
|
3180
3884
|
],
|
|
3181
3885
|
},
|
|
3182
3886
|
);
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3887
|
+
if (!certificate) {
|
|
3888
|
+
// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
3889
|
+
suppressRules(
|
|
3890
|
+
this.cloudFrontDistribution,
|
|
3891
|
+
['CKV_AWS_174'],
|
|
3892
|
+
'Cloudfront default certificate does not use TLS 1.2',
|
|
3893
|
+
);
|
|
3894
|
+
}
|
|
3188
3895
|
|
|
3189
3896
|
// Deploy Website
|
|
3190
3897
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
3898
|
+
sources: [Source.asset(websiteFilePath)],
|
|
3899
|
+
destinationBucket: this.websiteBucket,
|
|
3900
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
3901
|
+
distribution: this.cloudFrontDistribution,
|
|
3902
|
+
// Exclude the runtime config from this deployment's sync so its default pruning
|
|
3903
|
+
// never deletes the file managed separately by RuntimeConfigDeployment below.
|
|
3904
|
+
exclude: [DEFAULT_RUNTIME_CONFIG_FILENAME],
|
|
3905
|
+
memoryLimit: 1024,
|
|
3906
|
+
});
|
|
3907
|
+
|
|
3908
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
3909
|
+
// must always fetch the latest configuration.
|
|
3910
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
3191
3911
|
sources: [
|
|
3192
|
-
Source.asset(websiteFilePath),
|
|
3193
3912
|
Source.data(
|
|
3194
3913
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
3195
3914
|
Lazy.string({
|
|
@@ -3201,8 +3920,9 @@ export class StaticWebsite extends Construct {
|
|
|
3201
3920
|
),
|
|
3202
3921
|
],
|
|
3203
3922
|
destinationBucket: this.websiteBucket,
|
|
3204
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
3205
3923
|
distribution: this.cloudFrontDistribution,
|
|
3924
|
+
cacheControl: [CacheControl.noCache()],
|
|
3925
|
+
prune: false,
|
|
3206
3926
|
memoryLimit: 1024,
|
|
3207
3927
|
});
|
|
3208
3928
|
|
|
@@ -3223,6 +3943,48 @@ export class StaticWebsite extends Construct {
|
|
|
3223
3943
|
value: this.websiteBucket.bucketName,
|
|
3224
3944
|
});
|
|
3225
3945
|
}
|
|
3946
|
+
|
|
3947
|
+
/**
|
|
3948
|
+
* Delivers a bucket's S3 server access logs to a CloudWatch log group using
|
|
3949
|
+
* CloudWatch Logs vended log delivery.
|
|
3950
|
+
*/
|
|
3951
|
+
private deliverAccessLogsToCloudWatch(
|
|
3952
|
+
id: string,
|
|
3953
|
+
bucket: IBucket,
|
|
3954
|
+
logGroup: LogGroup,
|
|
3955
|
+
) {
|
|
3956
|
+
const source: CfnDeliverySource = new CfnDeliverySource(
|
|
3957
|
+
this,
|
|
3958
|
+
\`\${id}AccessLogsSource\`,
|
|
3959
|
+
{
|
|
3960
|
+
name: Lazy.string({
|
|
3961
|
+
produce: () => Names.uniqueResourceName(source, { maxLength: 60 }),
|
|
3962
|
+
}),
|
|
3963
|
+
logType: 'S3_SERVER_ACCESS_LOGS',
|
|
3964
|
+
resourceArn: bucket.bucketArn,
|
|
3965
|
+
},
|
|
3966
|
+
);
|
|
3967
|
+
const bucketPolicy = (bucket as Bucket).policy;
|
|
3968
|
+
if (bucketPolicy) {
|
|
3969
|
+
source.node.addDependency(bucketPolicy);
|
|
3970
|
+
}
|
|
3971
|
+
const destination: CfnDeliveryDestination = new CfnDeliveryDestination(
|
|
3972
|
+
this,
|
|
3973
|
+
\`\${id}AccessLogsDestination\`,
|
|
3974
|
+
{
|
|
3975
|
+
name: Lazy.string({
|
|
3976
|
+
produce: () =>
|
|
3977
|
+
Names.uniqueResourceName(destination, { maxLength: 60 }),
|
|
3978
|
+
}),
|
|
3979
|
+
destinationResourceArn: logGroup.logGroupArn,
|
|
3980
|
+
},
|
|
3981
|
+
);
|
|
3982
|
+
const delivery = new CfnDelivery(this, \`\${id}AccessLogsDelivery\`, {
|
|
3983
|
+
deliverySourceName: source.name,
|
|
3984
|
+
deliveryDestinationArn: destination.attrArn,
|
|
3985
|
+
});
|
|
3986
|
+
delivery.addDependency(source);
|
|
3987
|
+
}
|
|
3226
3988
|
}
|
|
3227
3989
|
|
|
3228
3990
|
export class CloudfrontWebAcl extends Stack {
|
|
@@ -3345,9 +4107,13 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3345
4107
|
"emitDeclarationOnly": false,
|
|
3346
4108
|
"module": "nodenext",
|
|
3347
4109
|
"moduleResolution": "nodenext",
|
|
3348
|
-
"types": [
|
|
4110
|
+
"types": [
|
|
4111
|
+
"node"
|
|
4112
|
+
]
|
|
3349
4113
|
},
|
|
3350
|
-
"include": [
|
|
4114
|
+
"include": [
|
|
4115
|
+
"src/**/*.ts"
|
|
4116
|
+
],
|
|
3351
4117
|
"references": [],
|
|
3352
4118
|
"exclude": [
|
|
3353
4119
|
"vite.config.ts",
|
|
@@ -3410,7 +4176,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3410
4176
|
"import { defineConfig } from 'vitest/config';
|
|
3411
4177
|
|
|
3412
4178
|
export default defineConfig(() => ({
|
|
3413
|
-
root:
|
|
4179
|
+
root: import.meta.dirname,
|
|
3414
4180
|
cacheDir: '../../../node_modules/.vite/packages/common/constructs',
|
|
3415
4181
|
test: {
|
|
3416
4182
|
passWithNoTests: true,
|
|
@@ -3421,7 +4187,8 @@ export default defineConfig(() => ({
|
|
|
3421
4187
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
3422
4188
|
reporters: ['default'],
|
|
3423
4189
|
coverage: {
|
|
3424
|
-
reportsDirectory:
|
|
4190
|
+
reportsDirectory:
|
|
4191
|
+
'../../../dist/packages/common/constructs/test-output/vitest/coverage',
|
|
3425
4192
|
provider: 'v8' as const,
|
|
3426
4193
|
},
|
|
3427
4194
|
},
|
|
@@ -3431,9 +4198,30 @@ export default defineConfig(() => ({
|
|
|
3431
4198
|
|
|
3432
4199
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > pnpm-workspace.yaml 1`] = `
|
|
3433
4200
|
"packages:
|
|
3434
|
-
-
|
|
3435
|
-
-
|
|
3436
|
-
-
|
|
4201
|
+
- packages/*
|
|
4202
|
+
- test-app
|
|
4203
|
+
- packages/common/*
|
|
4204
|
+
catalog:
|
|
4205
|
+
vite: 8.2.2
|
|
4206
|
+
vitest: 4.1.11
|
|
4207
|
+
'@vitest/coverage-v8': 4.1.11
|
|
4208
|
+
constructs: 10.8.1
|
|
4209
|
+
aws-cdk-lib: 2.266.0
|
|
4210
|
+
'@types/node': 26.4.0
|
|
4211
|
+
react: 19.2.8
|
|
4212
|
+
react-dom: 19.2.8
|
|
4213
|
+
'@cloudscape-design/components': 3.0.1354
|
|
4214
|
+
'@cloudscape-design/board-components': 3.0.220
|
|
4215
|
+
'@cloudscape-design/global-styles': 1.0.67
|
|
4216
|
+
tailwindcss: 4.3.3
|
|
4217
|
+
'@tanstack/react-router': 1.170.32
|
|
4218
|
+
'@nx/react': 23.1.2
|
|
4219
|
+
'@vitest/ui': 4.1.11
|
|
4220
|
+
'@tailwindcss/vite': 4.3.3
|
|
4221
|
+
'@tanstack/router-plugin': 1.168.35
|
|
4222
|
+
'@tanstack/router-generator': 1.167.33
|
|
4223
|
+
'@tanstack/virtual-file-routes': 1.162.0
|
|
4224
|
+
'@tanstack/router-utils': 1.162.2
|
|
3437
4225
|
"
|
|
3438
4226
|
`;
|
|
3439
4227
|
|
|
@@ -3443,37 +4231,37 @@ This library was generated with [@aws/nx-plugin](https://github.com/awslabs/nx-p
|
|
|
3443
4231
|
|
|
3444
4232
|
## Building
|
|
3445
4233
|
|
|
3446
|
-
Run \`
|
|
4234
|
+
Run \`npx nx build @proj/test-app [--skip-nx-cache]\` to build the application.
|
|
3447
4235
|
|
|
3448
4236
|
## Run dev server
|
|
3449
4237
|
|
|
3450
|
-
Run \`
|
|
4238
|
+
Run \`npx nx serve @proj/test-app\`
|
|
3451
4239
|
|
|
3452
4240
|
## Running unit tests
|
|
3453
4241
|
|
|
3454
|
-
Run \`
|
|
4242
|
+
Run \`npx nx test @proj/test-app\` to execute the unit tests via Vitest.
|
|
3455
4243
|
|
|
3456
4244
|
### Updating snapshots
|
|
3457
4245
|
|
|
3458
4246
|
To update snapshots, run the following command:
|
|
3459
4247
|
|
|
3460
|
-
\`
|
|
4248
|
+
\`npx nx test @proj/test-app --configuration=update-snapshot\`
|
|
3461
4249
|
|
|
3462
4250
|
## Run lint
|
|
3463
4251
|
|
|
3464
|
-
Run \`
|
|
4252
|
+
Run \`npx nx lint @proj/test-app\`
|
|
3465
4253
|
|
|
3466
4254
|
### Fixable issues
|
|
3467
4255
|
|
|
3468
4256
|
You can also automatically fix some lint errors by running the following command:
|
|
3469
4257
|
|
|
3470
|
-
\`
|
|
4258
|
+
\`npx nx lint @proj/test-app --configuration=fix\`
|
|
3471
4259
|
|
|
3472
4260
|
### Runtime config
|
|
3473
4261
|
|
|
3474
4262
|
In order to integrate with cognito or trpc backends, you need to have a \`runtime-config.json\` file in your \`/public\` website directory. You can fetch this is follows:
|
|
3475
4263
|
|
|
3476
|
-
\`
|
|
4264
|
+
\`npx nx load-runtime-config @proj/test-app\`
|
|
3477
4265
|
|
|
3478
4266
|
> [!IMPORTANT]
|
|
3479
4267
|
> Ensure you have AWS CLI and curl installed
|
|
@@ -3507,6 +4295,26 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3507
4295
|
"
|
|
3508
4296
|
`;
|
|
3509
4297
|
|
|
4298
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > test-app/package.json 1`] = `
|
|
4299
|
+
"{
|
|
4300
|
+
"name": "@proj/test-app",
|
|
4301
|
+
"version": "0.0.1",
|
|
4302
|
+
"private": true,
|
|
4303
|
+
"type": "module",
|
|
4304
|
+
"dependencies": {
|
|
4305
|
+
"@cloudscape-design/board-components": "catalog:",
|
|
4306
|
+
"@cloudscape-design/components": "catalog:",
|
|
4307
|
+
"@cloudscape-design/global-styles": "catalog:",
|
|
4308
|
+
"@tanstack/react-router": "catalog:",
|
|
4309
|
+
"react": "catalog:",
|
|
4310
|
+
"react-dom": "catalog:",
|
|
4311
|
+
"tailwindcss": "catalog:"
|
|
4312
|
+
},
|
|
4313
|
+
"devDependencies": {}
|
|
4314
|
+
}
|
|
4315
|
+
"
|
|
4316
|
+
`;
|
|
4317
|
+
|
|
3510
4318
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > test-app/project.json 1`] = `
|
|
3511
4319
|
"{
|
|
3512
4320
|
"name": "@proj/test-app",
|
|
@@ -3518,33 +4326,20 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3518
4326
|
"generator": "ts#react-website",
|
|
3519
4327
|
"ux": "cloudscape",
|
|
3520
4328
|
"framework": "react",
|
|
3521
|
-
"infra": "cloudfront-s3"
|
|
4329
|
+
"infra": "cloudfront-s3",
|
|
4330
|
+
"tailwind": true,
|
|
4331
|
+
"tanstackRouter": true,
|
|
4332
|
+
"iac": "cdk"
|
|
3522
4333
|
},
|
|
3523
4334
|
"targets": {
|
|
3524
|
-
"
|
|
3525
|
-
"dependsOn": ["
|
|
3526
|
-
"options": {
|
|
3527
|
-
"outputPath": "dist/{projectRoot}/bundle"
|
|
3528
|
-
}
|
|
4335
|
+
"assemble": {
|
|
4336
|
+
"dependsOn": ["compile", "bundle"]
|
|
3529
4337
|
},
|
|
3530
|
-
"
|
|
3531
|
-
"
|
|
3532
|
-
"outputs": ["{options.outputPath}"],
|
|
3533
|
-
"defaultConfiguration": "production",
|
|
3534
|
-
"options": {
|
|
3535
|
-
"outputPath": "dist/{projectRoot}/bundle"
|
|
3536
|
-
},
|
|
3537
|
-
"configurations": {
|
|
3538
|
-
"development": {
|
|
3539
|
-
"mode": "development"
|
|
3540
|
-
},
|
|
3541
|
-
"production": {
|
|
3542
|
-
"mode": "production"
|
|
3543
|
-
}
|
|
3544
|
-
}
|
|
4338
|
+
"build": {
|
|
4339
|
+
"dependsOn": ["lint", "compile", "test", "bundle"]
|
|
3545
4340
|
},
|
|
3546
4341
|
"compile": {
|
|
3547
|
-
"dependsOn": ["
|
|
4342
|
+
"dependsOn": ["^compile"],
|
|
3548
4343
|
"executor": "nx:run-commands",
|
|
3549
4344
|
"outputs": ["{workspaceRoot}/dist/{projectRoot}/tsc"],
|
|
3550
4345
|
"options": {
|
|
@@ -3552,86 +4347,54 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3552
4347
|
"cwd": "{projectRoot}"
|
|
3553
4348
|
}
|
|
3554
4349
|
},
|
|
3555
|
-
"
|
|
4350
|
+
"dev": {
|
|
4351
|
+
"executor": "nx:run-commands",
|
|
4352
|
+
"continuous": true,
|
|
4353
|
+
"options": {
|
|
4354
|
+
"command": "vite --mode local-dev",
|
|
4355
|
+
"cwd": "{projectRoot}"
|
|
4356
|
+
}
|
|
4357
|
+
},
|
|
4358
|
+
"format": {
|
|
3556
4359
|
"executor": "nx:run-commands",
|
|
3557
4360
|
"cache": true,
|
|
3558
4361
|
"inputs": ["biome"],
|
|
3559
4362
|
"options": {
|
|
3560
|
-
"command": "biome
|
|
4363
|
+
"command": "biome format {projectRoot}"
|
|
3561
4364
|
},
|
|
3562
4365
|
"configurations": {
|
|
3563
4366
|
"fix": {
|
|
3564
|
-
"command": "biome
|
|
4367
|
+
"command": "biome format --write {projectRoot}"
|
|
3565
4368
|
},
|
|
3566
4369
|
"skip-lint": {
|
|
3567
4370
|
"command": "node -e \\"\\""
|
|
3568
4371
|
}
|
|
3569
4372
|
}
|
|
3570
4373
|
},
|
|
3571
|
-
"
|
|
4374
|
+
"lint": {
|
|
3572
4375
|
"executor": "nx:run-commands",
|
|
3573
|
-
"
|
|
3574
|
-
|
|
3575
|
-
},
|
|
3576
|
-
"options": {
|
|
3577
|
-
"command": "aws s3 cp s3://\`aws cloudformation describe-stacks --query \\"Stacks[?starts_with(StackName, 'proj-')][].Outputs[] | [?contains(OutputKey, 'TestAppWebsiteBucketName')].OutputValue\\" --output text\`/runtime-config.json \\"{projectRoot}/public/runtime-config.json\\""
|
|
3578
|
-
}
|
|
3579
|
-
},
|
|
3580
|
-
"preview": {
|
|
3581
|
-
"dependsOn": ["build"],
|
|
3582
|
-
"executor": "@nx/vite:preview-server",
|
|
3583
|
-
"defaultConfiguration": "development",
|
|
4376
|
+
"cache": true,
|
|
4377
|
+
"inputs": ["biome"],
|
|
3584
4378
|
"options": {
|
|
3585
|
-
"
|
|
4379
|
+
"command": "biome lint {projectRoot}"
|
|
3586
4380
|
},
|
|
3587
4381
|
"configurations": {
|
|
3588
|
-
"
|
|
3589
|
-
"
|
|
4382
|
+
"fix": {
|
|
4383
|
+
"command": "biome check --write {projectRoot}"
|
|
3590
4384
|
},
|
|
3591
|
-
"
|
|
3592
|
-
"
|
|
4385
|
+
"skip-lint": {
|
|
4386
|
+
"command": "node -e \\"\\""
|
|
3593
4387
|
}
|
|
3594
|
-
}
|
|
3595
|
-
},
|
|
3596
|
-
"serve": {
|
|
3597
|
-
"executor": "@nx/vite:dev-server",
|
|
3598
|
-
"defaultConfiguration": "development",
|
|
3599
|
-
"options": {
|
|
3600
|
-
"buildTarget": "@proj/test-app:build"
|
|
3601
4388
|
},
|
|
3602
|
-
"
|
|
3603
|
-
"development": {
|
|
3604
|
-
"buildTarget": "@proj/test-app:build:development",
|
|
3605
|
-
"hmr": true
|
|
3606
|
-
},
|
|
3607
|
-
"production": {
|
|
3608
|
-
"buildTarget": "@proj/test-app:build:production",
|
|
3609
|
-
"hmr": false
|
|
3610
|
-
}
|
|
3611
|
-
}
|
|
4389
|
+
"dependsOn": ["format"]
|
|
3612
4390
|
},
|
|
3613
|
-
"
|
|
3614
|
-
"executor": "
|
|
3615
|
-
"
|
|
3616
|
-
"
|
|
3617
|
-
"hmr": true,
|
|
3618
|
-
"mode": "serve-local"
|
|
4391
|
+
"load-runtime-config": {
|
|
4392
|
+
"executor": "nx:run-commands",
|
|
4393
|
+
"metadata": {
|
|
4394
|
+
"description": "Load runtime config from your deployed stack for dev purposes. You must set your AWS CLI credentials whilst calling 'npx nx load-runtime-config @proj/test-app'"
|
|
3619
4395
|
},
|
|
3620
|
-
"continuous": true
|
|
3621
|
-
},
|
|
3622
|
-
"serve-static": {
|
|
3623
|
-
"executor": "@nx/web:file-server",
|
|
3624
|
-
"dependsOn": ["build"],
|
|
3625
|
-
"options": {
|
|
3626
|
-
"buildTarget": "@proj/test-app:build",
|
|
3627
|
-
"spa": true
|
|
3628
|
-
}
|
|
3629
|
-
},
|
|
3630
|
-
"test": {
|
|
3631
|
-
"executor": "@nx/vitest:test",
|
|
3632
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
3633
4396
|
"options": {
|
|
3634
|
-
"
|
|
4397
|
+
"command": "aws s3 cp s3://\`aws cloudformation describe-stacks --query \\"Stacks[?starts_with(StackName, 'proj-')][].Outputs[] | [?contains(OutputKey, 'TestAppWebsiteBucketName')].OutputValue\\" --output text\`/runtime-config.json \\"{projectRoot}/public/runtime-config.json\\""
|
|
3635
4398
|
}
|
|
3636
4399
|
}
|
|
3637
4400
|
}
|
|
@@ -3917,55 +4680,55 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3917
4680
|
// You should NOT make any changes in this file as it will be overwritten.
|
|
3918
4681
|
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
3919
4682
|
|
|
3920
|
-
import { Route as rootRouteImport } from './routes/__root'
|
|
3921
|
-
import { Route as IndexRouteImport } from './routes/index'
|
|
4683
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
4684
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
3922
4685
|
|
|
3923
4686
|
const IndexRoute = IndexRouteImport.update({
|
|
3924
4687
|
id: '/',
|
|
3925
4688
|
path: '/',
|
|
3926
4689
|
getParentRoute: () => rootRouteImport,
|
|
3927
|
-
} as any)
|
|
4690
|
+
} as any)
|
|
3928
4691
|
|
|
3929
4692
|
export interface FileRoutesByFullPath {
|
|
3930
|
-
'/': typeof IndexRoute
|
|
4693
|
+
'/': typeof IndexRoute
|
|
3931
4694
|
}
|
|
3932
4695
|
export interface FileRoutesByTo {
|
|
3933
|
-
'/': typeof IndexRoute
|
|
4696
|
+
'/': typeof IndexRoute
|
|
3934
4697
|
}
|
|
3935
4698
|
export interface FileRoutesById {
|
|
3936
|
-
__root__: typeof rootRouteImport
|
|
3937
|
-
'/': typeof IndexRoute
|
|
4699
|
+
__root__: typeof rootRouteImport
|
|
4700
|
+
'/': typeof IndexRoute
|
|
3938
4701
|
}
|
|
3939
4702
|
export interface FileRouteTypes {
|
|
3940
|
-
fileRoutesByFullPath: FileRoutesByFullPath
|
|
3941
|
-
fullPaths: '/'
|
|
3942
|
-
fileRoutesByTo: FileRoutesByTo
|
|
3943
|
-
to: '/'
|
|
3944
|
-
id: '__root__' | '/'
|
|
3945
|
-
fileRoutesById: FileRoutesById
|
|
4703
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
4704
|
+
fullPaths: '/'
|
|
4705
|
+
fileRoutesByTo: FileRoutesByTo
|
|
4706
|
+
to: '/'
|
|
4707
|
+
id: '__root__' | '/'
|
|
4708
|
+
fileRoutesById: FileRoutesById
|
|
3946
4709
|
}
|
|
3947
4710
|
export interface RootRouteChildren {
|
|
3948
|
-
IndexRoute: typeof IndexRoute
|
|
4711
|
+
IndexRoute: typeof IndexRoute
|
|
3949
4712
|
}
|
|
3950
4713
|
|
|
3951
4714
|
declare module '@tanstack/react-router' {
|
|
3952
4715
|
interface FileRoutesByPath {
|
|
3953
4716
|
'/': {
|
|
3954
|
-
id: '/'
|
|
3955
|
-
path: '/'
|
|
3956
|
-
fullPath: '/'
|
|
3957
|
-
preLoaderRoute: typeof IndexRouteImport
|
|
3958
|
-
parentRoute: typeof rootRouteImport
|
|
3959
|
-
}
|
|
4717
|
+
id: '/'
|
|
4718
|
+
path: '/'
|
|
4719
|
+
fullPath: '/'
|
|
4720
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
4721
|
+
parentRoute: typeof rootRouteImport
|
|
4722
|
+
}
|
|
3960
4723
|
}
|
|
3961
4724
|
}
|
|
3962
4725
|
|
|
3963
4726
|
const rootRouteChildren: RootRouteChildren = {
|
|
3964
4727
|
IndexRoute: IndexRoute,
|
|
3965
|
-
}
|
|
4728
|
+
}
|
|
3966
4729
|
export const routeTree = rootRouteImport
|
|
3967
4730
|
._addFileChildren(rootRouteChildren)
|
|
3968
|
-
._addFileTypes<FileRouteTypes>()
|
|
4731
|
+
._addFileTypes<FileRouteTypes>()
|
|
3969
4732
|
"
|
|
3970
4733
|
`;
|
|
3971
4734
|
|
|
@@ -4023,15 +4786,22 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4023
4786
|
"outDir": "../dist/test-app/tsc",
|
|
4024
4787
|
"tsBuildInfoFile": "../dist/test-app/tsc/tsconfig.lib.tsbuildinfo",
|
|
4025
4788
|
"jsx": "react-jsx",
|
|
4026
|
-
"lib": [
|
|
4789
|
+
"lib": [
|
|
4790
|
+
"DOM"
|
|
4791
|
+
],
|
|
4027
4792
|
"types": [
|
|
4028
4793
|
"node",
|
|
4029
4794
|
"@nx/react/typings/cssmodule.d.ts",
|
|
4030
4795
|
"@nx/react/typings/image.d.ts",
|
|
4031
4796
|
"vite/client"
|
|
4032
|
-
]
|
|
4797
|
+
],
|
|
4798
|
+
"rootDir": "src",
|
|
4799
|
+
"module": "esnext",
|
|
4800
|
+
"moduleResolution": "bundler"
|
|
4033
4801
|
},
|
|
4034
4802
|
"exclude": [
|
|
4803
|
+
"out-tsc",
|
|
4804
|
+
"dist",
|
|
4035
4805
|
"src/**/*.spec.ts",
|
|
4036
4806
|
"src/**/*.test.ts",
|
|
4037
4807
|
"src/**/*.spec.tsx",
|
|
@@ -4045,7 +4815,12 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4045
4815
|
"vitest.config.ts",
|
|
4046
4816
|
"vitest.config.mts"
|
|
4047
4817
|
],
|
|
4048
|
-
"include": [
|
|
4818
|
+
"include": [
|
|
4819
|
+
"src/**/*.js",
|
|
4820
|
+
"src/**/*.jsx",
|
|
4821
|
+
"src/**/*.ts",
|
|
4822
|
+
"src/**/*.tsx"
|
|
4823
|
+
]
|
|
4049
4824
|
}
|
|
4050
4825
|
"
|
|
4051
4826
|
`;
|
|
@@ -4084,7 +4859,10 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4084
4859
|
"vitest",
|
|
4085
4860
|
"@nx/react/typings/cssmodule.d.ts",
|
|
4086
4861
|
"@nx/react/typings/image.d.ts"
|
|
4087
|
-
]
|
|
4862
|
+
],
|
|
4863
|
+
"jsx": "react-jsx",
|
|
4864
|
+
"module": "esnext",
|
|
4865
|
+
"moduleResolution": "bundler"
|
|
4088
4866
|
},
|
|
4089
4867
|
"include": [
|
|
4090
4868
|
"vite.config.ts",
|
|
@@ -4131,8 +4909,8 @@ export default defineConfig(() => ({
|
|
|
4131
4909
|
},
|
|
4132
4910
|
plugins: [
|
|
4133
4911
|
tanstackRouter({
|
|
4134
|
-
routesDirectory: resolve(
|
|
4135
|
-
generatedRouteTree: resolve(
|
|
4912
|
+
routesDirectory: resolve(import.meta.dirname, 'src/routes'),
|
|
4913
|
+
generatedRouteTree: resolve(import.meta.dirname, 'src/routeTree.gen.ts'),
|
|
4136
4914
|
}),
|
|
4137
4915
|
react(),
|
|
4138
4916
|
tailwindcss(),
|
|
@@ -4142,7 +4920,7 @@ export default defineConfig(() => ({
|
|
|
4142
4920
|
// plugins: [],
|
|
4143
4921
|
// },
|
|
4144
4922
|
build: {
|
|
4145
|
-
outDir: '../dist/test-app',
|
|
4923
|
+
outDir: '../dist/test-app/bundle',
|
|
4146
4924
|
emptyOutDir: true,
|
|
4147
4925
|
reportCompressedSize: true,
|
|
4148
4926
|
commonjsOptions: {
|
|
@@ -4158,11 +4936,11 @@ export default defineConfig(() => ({
|
|
|
4158
4936
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
4159
4937
|
reporters: ['default'],
|
|
4160
4938
|
coverage: {
|
|
4161
|
-
reportsDirectory: '
|
|
4939
|
+
reportsDirectory: '../dist/test-app/test-output/vitest/coverage',
|
|
4162
4940
|
provider: 'v8' as const,
|
|
4163
4941
|
},
|
|
4164
4942
|
},
|
|
4165
|
-
resolve: { tsconfigPaths: true },
|
|
4943
|
+
resolve: { tsconfigPaths: true, dedupe: ['react', 'react-dom'] },
|
|
4166
4944
|
define: { global: {} },
|
|
4167
4945
|
}));
|
|
4168
4946
|
"
|
|
@@ -4172,9 +4950,14 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4172
4950
|
"{
|
|
4173
4951
|
"compilerOptions": {
|
|
4174
4952
|
"paths": {
|
|
4175
|
-
"
|
|
4176
|
-
|
|
4953
|
+
"@proj/test-app": [
|
|
4954
|
+
"./test-app/src/index.ts"
|
|
4955
|
+
],
|
|
4956
|
+
"@proj/common-constructs": [
|
|
4957
|
+
"./packages/common/constructs/src/index.ts"
|
|
4958
|
+
]
|
|
4177
4959
|
},
|
|
4960
|
+
"composite": true,
|
|
4178
4961
|
"rootDir": "."
|
|
4179
4962
|
}
|
|
4180
4963
|
}
|
|
@@ -4183,6 +4966,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4183
4966
|
|
|
4184
4967
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > tsconfig.json 1`] = `
|
|
4185
4968
|
"{
|
|
4969
|
+
"extends": "./tsconfig.base.json",
|
|
4970
|
+
"files": [],
|
|
4971
|
+
"include": [],
|
|
4186
4972
|
"references": [
|
|
4187
4973
|
{
|
|
4188
4974
|
"path": "./test-app"
|
|
@@ -4195,11 +4981,19 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4195
4981
|
"
|
|
4196
4982
|
`;
|
|
4197
4983
|
|
|
4198
|
-
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > vitest.
|
|
4199
|
-
"
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4984
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > vitest.config.ts 1`] = `
|
|
4985
|
+
"import { defineConfig } from 'vitest/config';
|
|
4986
|
+
|
|
4987
|
+
export default defineConfig({
|
|
4988
|
+
test: {
|
|
4989
|
+
projects: [
|
|
4990
|
+
'**/vite.config.{mjs,js,ts,mts}',
|
|
4991
|
+
'**/vitest.config.{mjs,js,ts,mts}',
|
|
4992
|
+
'!vitest.config.{mjs,js,ts,mts}',
|
|
4993
|
+
'!vite.config.{mjs,js,ts,mts}',
|
|
4994
|
+
],
|
|
4995
|
+
},
|
|
4996
|
+
});
|
|
4203
4997
|
"
|
|
4204
4998
|
`;
|
|
4205
4999
|
|
|
@@ -4244,8 +5038,8 @@ export default defineConfig(() => ({
|
|
|
4244
5038
|
},
|
|
4245
5039
|
plugins: [
|
|
4246
5040
|
tanstackRouter({
|
|
4247
|
-
routesDirectory: resolve(
|
|
4248
|
-
generatedRouteTree: resolve(
|
|
5041
|
+
routesDirectory: resolve(import.meta.dirname, 'src/routes'),
|
|
5042
|
+
generatedRouteTree: resolve(import.meta.dirname, 'src/routeTree.gen.ts'),
|
|
4249
5043
|
}),
|
|
4250
5044
|
react(),
|
|
4251
5045
|
tailwindcss(),
|
|
@@ -4255,7 +5049,7 @@ export default defineConfig(() => ({
|
|
|
4255
5049
|
// plugins: [],
|
|
4256
5050
|
// },
|
|
4257
5051
|
build: {
|
|
4258
|
-
outDir: '../dist/test-app',
|
|
5052
|
+
outDir: '../dist/test-app/bundle',
|
|
4259
5053
|
emptyOutDir: true,
|
|
4260
5054
|
reportCompressedSize: true,
|
|
4261
5055
|
commonjsOptions: {
|
|
@@ -4271,11 +5065,11 @@ export default defineConfig(() => ({
|
|
|
4271
5065
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
4272
5066
|
reporters: ['default'],
|
|
4273
5067
|
coverage: {
|
|
4274
|
-
reportsDirectory: '
|
|
5068
|
+
reportsDirectory: '../dist/test-app/test-output/vitest/coverage',
|
|
4275
5069
|
provider: 'v8' as const,
|
|
4276
5070
|
},
|
|
4277
5071
|
},
|
|
4278
|
-
resolve: { tsconfigPaths: true },
|
|
5072
|
+
resolve: { tsconfigPaths: true, dedupe: ['react', 'react-dom'] },
|
|
4279
5073
|
define: { global: {} },
|
|
4280
5074
|
}));
|
|
4281
5075
|
"
|
|
@@ -4520,6 +5314,7 @@ exports[`react-website generator > should generate shared constructs > common/co
|
|
|
4520
5314
|
"export * from './static-website.js';
|
|
4521
5315
|
export * from './app.js';
|
|
4522
5316
|
export * from './checkov.js';
|
|
5317
|
+
export * from './cloudfront.js';
|
|
4523
5318
|
export * from './runtime-config.js';
|
|
4524
5319
|
export * from './workspace.js';
|
|
4525
5320
|
"
|
|
@@ -4529,11 +5324,21 @@ exports[`react-website generator > should generate shared constructs > common/co
|
|
|
4529
5324
|
"import {
|
|
4530
5325
|
CfnOutput,
|
|
4531
5326
|
CfnResource,
|
|
5327
|
+
Duration,
|
|
4532
5328
|
Lazy,
|
|
5329
|
+
Names,
|
|
4533
5330
|
RemovalPolicy,
|
|
4534
5331
|
Stack,
|
|
4535
5332
|
} from 'aws-cdk-lib';
|
|
4536
|
-
import {
|
|
5333
|
+
import {
|
|
5334
|
+
Distribution,
|
|
5335
|
+
HeadersFrameOption,
|
|
5336
|
+
HeadersReferrerPolicy,
|
|
5337
|
+
ResponseHeadersPolicy,
|
|
5338
|
+
SecurityPolicyProtocol,
|
|
5339
|
+
ViewerProtocolPolicy,
|
|
5340
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
5341
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
4537
5342
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
4538
5343
|
import {
|
|
4539
5344
|
BlockPublicAccess,
|
|
@@ -4542,18 +5347,83 @@ import {
|
|
|
4542
5347
|
IBucket,
|
|
4543
5348
|
ObjectOwnership,
|
|
4544
5349
|
} from 'aws-cdk-lib/aws-s3';
|
|
4545
|
-
import {
|
|
5350
|
+
import {
|
|
5351
|
+
BucketDeployment,
|
|
5352
|
+
CacheControl,
|
|
5353
|
+
Source,
|
|
5354
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
4546
5355
|
import { Construct } from 'constructs';
|
|
4547
5356
|
import { RuntimeConfig } from './runtime-config.js';
|
|
4548
|
-
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
5357
|
+
import { IKey, Key } from 'aws-cdk-lib/aws-kms';
|
|
5358
|
+
import {
|
|
5359
|
+
CfnDelivery,
|
|
5360
|
+
CfnDeliveryDestination,
|
|
5361
|
+
CfnDeliverySource,
|
|
5362
|
+
LogGroup,
|
|
5363
|
+
RetentionDays,
|
|
5364
|
+
} from 'aws-cdk-lib/aws-logs';
|
|
5365
|
+
import { Effect, PolicyStatement, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
|
|
4549
5366
|
import { CfnWebACL } from 'aws-cdk-lib/aws-wafv2';
|
|
4550
5367
|
import { suppressRules } from './checkov.js';
|
|
4551
5368
|
|
|
4552
5369
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
4553
5370
|
|
|
5371
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
5372
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
5373
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
5374
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
5375
|
+
// connect-src to your specific origins once they are known.
|
|
5376
|
+
const CONTENT_SECURITY_POLICY = [
|
|
5377
|
+
"default-src 'self'",
|
|
5378
|
+
"script-src 'self'",
|
|
5379
|
+
"style-src 'self' 'unsafe-inline'",
|
|
5380
|
+
"img-src 'self' data:",
|
|
5381
|
+
"font-src 'self' data:",
|
|
5382
|
+
"connect-src 'self' https: wss:",
|
|
5383
|
+
"object-src 'none'",
|
|
5384
|
+
"base-uri 'self'",
|
|
5385
|
+
"frame-ancestors 'none'",
|
|
5386
|
+
].join('; ');
|
|
5387
|
+
|
|
4554
5388
|
export interface StaticWebsiteProps {
|
|
4555
5389
|
readonly websiteName: string;
|
|
4556
5390
|
readonly websiteFilePath: string;
|
|
5391
|
+
/**
|
|
5392
|
+
* Custom domain names for the CloudFront distribution. Requires \`certificate\`.
|
|
5393
|
+
*/
|
|
5394
|
+
readonly domainNames?: string[];
|
|
5395
|
+
/**
|
|
5396
|
+
* ACM certificate for the custom domain names. Must be in us-east-1.
|
|
5397
|
+
* When provided, viewers are required to use TLS 1.2 or later.
|
|
5398
|
+
*/
|
|
5399
|
+
readonly certificate?: ICertificate;
|
|
5400
|
+
/**
|
|
5401
|
+
* Whether to protect the CloudFront distribution with an AWS WAF Web ACL.
|
|
5402
|
+
*
|
|
5403
|
+
* @default true
|
|
5404
|
+
*/
|
|
5405
|
+
readonly enableWaf?: boolean;
|
|
5406
|
+
/**
|
|
5407
|
+
* Server-side encryption for the website and distribution log buckets.
|
|
5408
|
+
*
|
|
5409
|
+
* @default BucketEncryption.KMS
|
|
5410
|
+
*/
|
|
5411
|
+
readonly encryption?: BucketEncryption;
|
|
5412
|
+
/**
|
|
5413
|
+
* KMS key used to encrypt the website and distribution log buckets. Only used when \`encryption\` is
|
|
5414
|
+
* \`BucketEncryption.KMS\`. When not provided, a new key is created. Note that a key imported via
|
|
5415
|
+
* \`Key.fromKeyArn\` must already grant the CloudWatch Logs, S3 and CloudFront service principals the
|
|
5416
|
+
* necessary permissions in its own key policy - \`addToResourcePolicy\` is a no-op on an imported key,
|
|
5417
|
+
* so this construct cannot grant them on your behalf.
|
|
5418
|
+
*/
|
|
5419
|
+
readonly encryptionKey?: IKey;
|
|
5420
|
+
/**
|
|
5421
|
+
* Whether the automatically created KMS key has rotation enabled. Only applies when \`encryption\` is
|
|
5422
|
+
* \`BucketEncryption.KMS\` and no \`encryptionKey\` is supplied.
|
|
5423
|
+
*
|
|
5424
|
+
* @default true
|
|
5425
|
+
*/
|
|
5426
|
+
readonly enableKeyRotation?: boolean;
|
|
4557
5427
|
}
|
|
4558
5428
|
|
|
4559
5429
|
/**
|
|
@@ -4572,39 +5442,53 @@ export class StaticWebsite extends Construct {
|
|
|
4572
5442
|
constructor(
|
|
4573
5443
|
scope: Construct,
|
|
4574
5444
|
id: string,
|
|
4575
|
-
{
|
|
5445
|
+
{
|
|
5446
|
+
websiteFilePath,
|
|
5447
|
+
websiteName,
|
|
5448
|
+
domainNames,
|
|
5449
|
+
certificate,
|
|
5450
|
+
enableWaf = true,
|
|
5451
|
+
encryption = BucketEncryption.KMS,
|
|
5452
|
+
encryptionKey,
|
|
5453
|
+
enableKeyRotation = true,
|
|
5454
|
+
}: StaticWebsiteProps,
|
|
4576
5455
|
) {
|
|
4577
5456
|
super(scope, id);
|
|
4578
|
-
this.node.setContext(
|
|
4579
|
-
'@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy',
|
|
4580
|
-
true,
|
|
4581
|
-
);
|
|
4582
5457
|
|
|
4583
|
-
const websiteKey
|
|
4584
|
-
|
|
4585
|
-
|
|
5458
|
+
const websiteKey: IKey | undefined =
|
|
5459
|
+
encryption === BucketEncryption.KMS
|
|
5460
|
+
? (encryptionKey ?? new Key(this, 'WebsiteKey', { enableKeyRotation }))
|
|
5461
|
+
: undefined;
|
|
5462
|
+
|
|
5463
|
+
// Allow CloudWatch Logs to use the website key for server access log delivery.
|
|
5464
|
+
const stack = Stack.of(this);
|
|
5465
|
+
websiteKey?.addToResourcePolicy(
|
|
5466
|
+
new PolicyStatement({
|
|
5467
|
+
effect: Effect.ALLOW,
|
|
5468
|
+
principals: [
|
|
5469
|
+
new ServicePrincipal(\`logs.\${stack.region}.amazonaws.com\`),
|
|
5470
|
+
],
|
|
5471
|
+
actions: [
|
|
5472
|
+
'kms:Encrypt',
|
|
5473
|
+
'kms:Decrypt',
|
|
5474
|
+
'kms:ReEncrypt*',
|
|
5475
|
+
'kms:GenerateDataKey*',
|
|
5476
|
+
'kms:DescribeKey',
|
|
5477
|
+
],
|
|
5478
|
+
resources: ['*'],
|
|
5479
|
+
conditions: {
|
|
5480
|
+
ArnLike: {
|
|
5481
|
+
'kms:EncryptionContext:aws:logs:arn': \`arn:aws:logs:\${stack.region}:\${stack.account}:log-group:*\`,
|
|
5482
|
+
},
|
|
5483
|
+
},
|
|
5484
|
+
}),
|
|
5485
|
+
);
|
|
4586
5486
|
|
|
4587
|
-
const
|
|
4588
|
-
|
|
4589
|
-
enforceSSL: true,
|
|
4590
|
-
autoDeleteObjects: true,
|
|
4591
|
-
removalPolicy: RemovalPolicy.DESTROY,
|
|
4592
|
-
encryption: BucketEncryption.KMS,
|
|
5487
|
+
const accessLogs = new LogGroup(this, 'AccessLogs', {
|
|
5488
|
+
retention: RetentionDays.ONE_YEAR,
|
|
4593
5489
|
encryptionKey: websiteKey,
|
|
4594
|
-
|
|
4595
|
-
publicReadAccess: false,
|
|
4596
|
-
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
5490
|
+
removalPolicy: RemovalPolicy.DESTROY,
|
|
4597
5491
|
});
|
|
4598
|
-
suppressRules(
|
|
4599
|
-
accessLogsBucket,
|
|
4600
|
-
['CKV_AWS_21'],
|
|
4601
|
-
'Access log bucket does not need versioning enabled',
|
|
4602
|
-
);
|
|
4603
|
-
suppressRules(
|
|
4604
|
-
accessLogsBucket,
|
|
4605
|
-
['CKV_AWS_18'],
|
|
4606
|
-
'Access log bucket does not need an access log bucket',
|
|
4607
|
-
);
|
|
4608
5492
|
|
|
4609
5493
|
// S3 Bucket to hold website files
|
|
4610
5494
|
this.websiteBucket = new Bucket(this, 'WebsiteBucket', {
|
|
@@ -4612,47 +5496,99 @@ export class StaticWebsite extends Construct {
|
|
|
4612
5496
|
enforceSSL: true,
|
|
4613
5497
|
autoDeleteObjects: true,
|
|
4614
5498
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
4615
|
-
encryption
|
|
5499
|
+
encryption,
|
|
4616
5500
|
encryptionKey: websiteKey,
|
|
4617
5501
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_ENFORCED,
|
|
4618
5502
|
publicReadAccess: false,
|
|
4619
5503
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
4620
|
-
serverAccessLogsPrefix: 'website-access-logs',
|
|
4621
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
4622
5504
|
});
|
|
5505
|
+
suppressRules(
|
|
5506
|
+
this.websiteBucket,
|
|
5507
|
+
['CKV_AWS_18'],
|
|
5508
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
5509
|
+
);
|
|
5510
|
+
this.deliverAccessLogsToCloudWatch(
|
|
5511
|
+
'Website',
|
|
5512
|
+
this.websiteBucket,
|
|
5513
|
+
accessLogs,
|
|
5514
|
+
);
|
|
4623
5515
|
// Web ACL
|
|
4624
|
-
const wafStack = new CloudfrontWebAcl(this, 'waf');
|
|
5516
|
+
const wafStack = enableWaf ? new CloudfrontWebAcl(this, 'waf') : undefined;
|
|
4625
5517
|
|
|
4626
|
-
//
|
|
5518
|
+
// Bucket holding CloudFront standard access logs. CloudFront delivers its
|
|
5519
|
+
// own logs to S3 only, so this bucket is retained; its S3 server access
|
|
5520
|
+
// logs are delivered to CloudWatch Logs.
|
|
4627
5521
|
const logBucket = new Bucket(this, 'DistributionLogBucket', {
|
|
4628
5522
|
enforceSSL: true,
|
|
4629
5523
|
autoDeleteObjects: true,
|
|
4630
5524
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
4631
|
-
encryption
|
|
5525
|
+
encryption,
|
|
4632
5526
|
encryptionKey: websiteKey,
|
|
4633
5527
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_PREFERRED,
|
|
4634
5528
|
publicReadAccess: false,
|
|
4635
5529
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
4636
|
-
serverAccessLogsPrefix: 'distribution-access-logs',
|
|
4637
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
4638
5530
|
});
|
|
4639
5531
|
suppressRules(
|
|
4640
5532
|
logBucket,
|
|
4641
5533
|
['CKV_AWS_21'],
|
|
4642
5534
|
'Distribution log bucket does not need versioning enabled',
|
|
4643
5535
|
);
|
|
5536
|
+
suppressRules(
|
|
5537
|
+
logBucket,
|
|
5538
|
+
['CKV_AWS_18'],
|
|
5539
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
5540
|
+
);
|
|
5541
|
+
this.deliverAccessLogsToCloudWatch('Distribution', logBucket, accessLogs);
|
|
5542
|
+
|
|
5543
|
+
// Security headers applied to all responses.
|
|
5544
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
5545
|
+
this,
|
|
5546
|
+
'ResponseHeadersPolicy',
|
|
5547
|
+
{
|
|
5548
|
+
securityHeadersBehavior: {
|
|
5549
|
+
strictTransportSecurity: {
|
|
5550
|
+
accessControlMaxAge: Duration.days(730),
|
|
5551
|
+
includeSubdomains: true,
|
|
5552
|
+
preload: true,
|
|
5553
|
+
override: true,
|
|
5554
|
+
},
|
|
5555
|
+
contentTypeOptions: { override: true },
|
|
5556
|
+
frameOptions: {
|
|
5557
|
+
frameOption: HeadersFrameOption.DENY,
|
|
5558
|
+
override: true,
|
|
5559
|
+
},
|
|
5560
|
+
referrerPolicy: {
|
|
5561
|
+
referrerPolicy:
|
|
5562
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
5563
|
+
override: true,
|
|
5564
|
+
},
|
|
5565
|
+
contentSecurityPolicy: {
|
|
5566
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
5567
|
+
override: true,
|
|
5568
|
+
},
|
|
5569
|
+
},
|
|
5570
|
+
},
|
|
5571
|
+
);
|
|
4644
5572
|
|
|
4645
5573
|
const defaultRootObject = 'index.html';
|
|
4646
5574
|
this.cloudFrontDistribution = new Distribution(
|
|
4647
5575
|
this,
|
|
4648
5576
|
'CloudfrontDistribution',
|
|
4649
5577
|
{
|
|
4650
|
-
webAclId: wafStack
|
|
5578
|
+
webAclId: wafStack?.wafArn,
|
|
4651
5579
|
enableLogging: true,
|
|
4652
5580
|
logBucket: logBucket,
|
|
5581
|
+
...(certificate
|
|
5582
|
+
? {
|
|
5583
|
+
certificate,
|
|
5584
|
+
domainNames,
|
|
5585
|
+
minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
5586
|
+
}
|
|
5587
|
+
: {}),
|
|
4653
5588
|
defaultBehavior: {
|
|
4654
5589
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
4655
5590
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
5591
|
+
responseHeadersPolicy,
|
|
4656
5592
|
},
|
|
4657
5593
|
defaultRootObject,
|
|
4658
5594
|
errorResponses: [
|
|
@@ -4669,16 +5605,31 @@ export class StaticWebsite extends Construct {
|
|
|
4669
5605
|
],
|
|
4670
5606
|
},
|
|
4671
5607
|
);
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
5608
|
+
if (!certificate) {
|
|
5609
|
+
// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
5610
|
+
suppressRules(
|
|
5611
|
+
this.cloudFrontDistribution,
|
|
5612
|
+
['CKV_AWS_174'],
|
|
5613
|
+
'Cloudfront default certificate does not use TLS 1.2',
|
|
5614
|
+
);
|
|
5615
|
+
}
|
|
4677
5616
|
|
|
4678
5617
|
// Deploy Website
|
|
4679
5618
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
5619
|
+
sources: [Source.asset(websiteFilePath)],
|
|
5620
|
+
destinationBucket: this.websiteBucket,
|
|
5621
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
5622
|
+
distribution: this.cloudFrontDistribution,
|
|
5623
|
+
// Exclude the runtime config from this deployment's sync so its default pruning
|
|
5624
|
+
// never deletes the file managed separately by RuntimeConfigDeployment below.
|
|
5625
|
+
exclude: [DEFAULT_RUNTIME_CONFIG_FILENAME],
|
|
5626
|
+
memoryLimit: 1024,
|
|
5627
|
+
});
|
|
5628
|
+
|
|
5629
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
5630
|
+
// must always fetch the latest configuration.
|
|
5631
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
4680
5632
|
sources: [
|
|
4681
|
-
Source.asset(websiteFilePath),
|
|
4682
5633
|
Source.data(
|
|
4683
5634
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
4684
5635
|
Lazy.string({
|
|
@@ -4690,8 +5641,9 @@ export class StaticWebsite extends Construct {
|
|
|
4690
5641
|
),
|
|
4691
5642
|
],
|
|
4692
5643
|
destinationBucket: this.websiteBucket,
|
|
4693
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
4694
5644
|
distribution: this.cloudFrontDistribution,
|
|
5645
|
+
cacheControl: [CacheControl.noCache()],
|
|
5646
|
+
prune: false,
|
|
4695
5647
|
memoryLimit: 1024,
|
|
4696
5648
|
});
|
|
4697
5649
|
|
|
@@ -4712,6 +5664,48 @@ export class StaticWebsite extends Construct {
|
|
|
4712
5664
|
value: this.websiteBucket.bucketName,
|
|
4713
5665
|
});
|
|
4714
5666
|
}
|
|
5667
|
+
|
|
5668
|
+
/**
|
|
5669
|
+
* Delivers a bucket's S3 server access logs to a CloudWatch log group using
|
|
5670
|
+
* CloudWatch Logs vended log delivery.
|
|
5671
|
+
*/
|
|
5672
|
+
private deliverAccessLogsToCloudWatch(
|
|
5673
|
+
id: string,
|
|
5674
|
+
bucket: IBucket,
|
|
5675
|
+
logGroup: LogGroup,
|
|
5676
|
+
) {
|
|
5677
|
+
const source: CfnDeliverySource = new CfnDeliverySource(
|
|
5678
|
+
this,
|
|
5679
|
+
\`\${id}AccessLogsSource\`,
|
|
5680
|
+
{
|
|
5681
|
+
name: Lazy.string({
|
|
5682
|
+
produce: () => Names.uniqueResourceName(source, { maxLength: 60 }),
|
|
5683
|
+
}),
|
|
5684
|
+
logType: 'S3_SERVER_ACCESS_LOGS',
|
|
5685
|
+
resourceArn: bucket.bucketArn,
|
|
5686
|
+
},
|
|
5687
|
+
);
|
|
5688
|
+
const bucketPolicy = (bucket as Bucket).policy;
|
|
5689
|
+
if (bucketPolicy) {
|
|
5690
|
+
source.node.addDependency(bucketPolicy);
|
|
5691
|
+
}
|
|
5692
|
+
const destination: CfnDeliveryDestination = new CfnDeliveryDestination(
|
|
5693
|
+
this,
|
|
5694
|
+
\`\${id}AccessLogsDestination\`,
|
|
5695
|
+
{
|
|
5696
|
+
name: Lazy.string({
|
|
5697
|
+
produce: () =>
|
|
5698
|
+
Names.uniqueResourceName(destination, { maxLength: 60 }),
|
|
5699
|
+
}),
|
|
5700
|
+
destinationResourceArn: logGroup.logGroupArn,
|
|
5701
|
+
},
|
|
5702
|
+
);
|
|
5703
|
+
const delivery = new CfnDelivery(this, \`\${id}AccessLogsDelivery\`, {
|
|
5704
|
+
deliverySourceName: source.name,
|
|
5705
|
+
deliveryDestinationArn: destination.attrArn,
|
|
5706
|
+
});
|
|
5707
|
+
delivery.addDependency(source);
|
|
5708
|
+
}
|
|
4715
5709
|
}
|
|
4716
5710
|
|
|
4717
5711
|
export class CloudfrontWebAcl extends Stack {
|
|
@@ -4780,11 +5774,17 @@ export class CloudfrontWebAcl extends Stack {
|
|
|
4780
5774
|
exports[`react-website generator > should generate shared constructs > test-app.ts 1`] = `
|
|
4781
5775
|
"import * as url from 'url';
|
|
4782
5776
|
import { Construct } from 'constructs';
|
|
4783
|
-
import { StaticWebsite } from '../../core/index.js';
|
|
5777
|
+
import { StaticWebsite, StaticWebsiteProps } from '../../core/index.js';
|
|
5778
|
+
|
|
5779
|
+
export type TestAppProps = Omit<
|
|
5780
|
+
StaticWebsiteProps,
|
|
5781
|
+
'websiteName' | 'websiteFilePath'
|
|
5782
|
+
>;
|
|
4784
5783
|
|
|
4785
5784
|
export class TestApp extends StaticWebsite {
|
|
4786
|
-
constructor(scope: Construct, id: string) {
|
|
5785
|
+
constructor(scope: Construct, id: string, props?: TestAppProps) {
|
|
4787
5786
|
super(scope, id, {
|
|
5787
|
+
...props,
|
|
4788
5788
|
websiteName: 'TestApp',
|
|
4789
5789
|
websiteFilePath: url.fileURLToPath(
|
|
4790
5790
|
new URL('../../../../../../dist/test-app/bundle', import.meta.url),
|
|
@@ -4835,19 +5835,7 @@ root &&
|
|
|
4835
5835
|
"
|
|
4836
5836
|
`;
|
|
4837
5837
|
|
|
4838
|
-
exports[`react-website generator > should handle npm scope prefix correctly > scoped-dependencies 1`] = `
|
|
4839
|
-
{
|
|
4840
|
-
"@cloudscape-design/board-components": "3.0.189",
|
|
4841
|
-
"@cloudscape-design/components": "3.0.1308",
|
|
4842
|
-
"@cloudscape-design/global-styles": "1.0.59",
|
|
4843
|
-
"@tanstack/react-router": "1.170.15",
|
|
4844
|
-
"aws-cdk-lib": "2.258.0",
|
|
4845
|
-
"constructs": "10.6.0",
|
|
4846
|
-
"react": "19.2.7",
|
|
4847
|
-
"react-dom": "19.2.7",
|
|
4848
|
-
"tailwindcss": "4.2.2",
|
|
4849
|
-
}
|
|
4850
|
-
`;
|
|
5838
|
+
exports[`react-website generator > should handle npm scope prefix correctly > scoped-dependencies 1`] = `{}`;
|
|
4851
5839
|
|
|
4852
5840
|
exports[`react-website generator ux tests > Cloudscape > should update package.json with required dependencies > test-app/src/components/AppLayout/index.tsx 1`] = `
|
|
4853
5841
|
"import * as React from 'react';
|
|
@@ -5088,55 +6076,55 @@ exports[`react-website generator ux tests > Cloudscape > should update package.j
|
|
|
5088
6076
|
// You should NOT make any changes in this file as it will be overwritten.
|
|
5089
6077
|
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
5090
6078
|
|
|
5091
|
-
import { Route as rootRouteImport } from './routes/__root'
|
|
5092
|
-
import { Route as IndexRouteImport } from './routes/index'
|
|
6079
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
6080
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
5093
6081
|
|
|
5094
6082
|
const IndexRoute = IndexRouteImport.update({
|
|
5095
6083
|
id: '/',
|
|
5096
6084
|
path: '/',
|
|
5097
6085
|
getParentRoute: () => rootRouteImport,
|
|
5098
|
-
} as any)
|
|
6086
|
+
} as any)
|
|
5099
6087
|
|
|
5100
6088
|
export interface FileRoutesByFullPath {
|
|
5101
|
-
'/': typeof IndexRoute
|
|
6089
|
+
'/': typeof IndexRoute
|
|
5102
6090
|
}
|
|
5103
6091
|
export interface FileRoutesByTo {
|
|
5104
|
-
'/': typeof IndexRoute
|
|
6092
|
+
'/': typeof IndexRoute
|
|
5105
6093
|
}
|
|
5106
6094
|
export interface FileRoutesById {
|
|
5107
|
-
__root__: typeof rootRouteImport
|
|
5108
|
-
'/': typeof IndexRoute
|
|
6095
|
+
__root__: typeof rootRouteImport
|
|
6096
|
+
'/': typeof IndexRoute
|
|
5109
6097
|
}
|
|
5110
6098
|
export interface FileRouteTypes {
|
|
5111
|
-
fileRoutesByFullPath: FileRoutesByFullPath
|
|
5112
|
-
fullPaths: '/'
|
|
5113
|
-
fileRoutesByTo: FileRoutesByTo
|
|
5114
|
-
to: '/'
|
|
5115
|
-
id: '__root__' | '/'
|
|
5116
|
-
fileRoutesById: FileRoutesById
|
|
6099
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
6100
|
+
fullPaths: '/'
|
|
6101
|
+
fileRoutesByTo: FileRoutesByTo
|
|
6102
|
+
to: '/'
|
|
6103
|
+
id: '__root__' | '/'
|
|
6104
|
+
fileRoutesById: FileRoutesById
|
|
5117
6105
|
}
|
|
5118
6106
|
export interface RootRouteChildren {
|
|
5119
|
-
IndexRoute: typeof IndexRoute
|
|
6107
|
+
IndexRoute: typeof IndexRoute
|
|
5120
6108
|
}
|
|
5121
6109
|
|
|
5122
6110
|
declare module '@tanstack/react-router' {
|
|
5123
6111
|
interface FileRoutesByPath {
|
|
5124
6112
|
'/': {
|
|
5125
|
-
id: '/'
|
|
5126
|
-
path: '/'
|
|
5127
|
-
fullPath: '/'
|
|
5128
|
-
preLoaderRoute: typeof IndexRouteImport
|
|
5129
|
-
parentRoute: typeof rootRouteImport
|
|
5130
|
-
}
|
|
6113
|
+
id: '/'
|
|
6114
|
+
path: '/'
|
|
6115
|
+
fullPath: '/'
|
|
6116
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
6117
|
+
parentRoute: typeof rootRouteImport
|
|
6118
|
+
}
|
|
5131
6119
|
}
|
|
5132
6120
|
}
|
|
5133
6121
|
|
|
5134
6122
|
const rootRouteChildren: RootRouteChildren = {
|
|
5135
6123
|
IndexRoute: IndexRoute,
|
|
5136
|
-
}
|
|
6124
|
+
}
|
|
5137
6125
|
export const routeTree = rootRouteImport
|
|
5138
6126
|
._addFileChildren(rootRouteChildren)
|
|
5139
|
-
._addFileTypes<FileRouteTypes>()
|
|
6127
|
+
._addFileTypes<FileRouteTypes>()
|
|
5140
6128
|
"
|
|
5141
6129
|
`;
|
|
5142
6130
|
|
|
@@ -5193,8 +6181,8 @@ import {
|
|
|
5193
6181
|
SidebarInset,
|
|
5194
6182
|
SidebarProvider,
|
|
5195
6183
|
SidebarTrigger,
|
|
5196
|
-
} from '
|
|
5197
|
-
import { Separator } from '
|
|
6184
|
+
} from '@proj/common-shadcn/components/ui/sidebar';
|
|
6185
|
+
import { Separator } from '@proj/common-shadcn/components/ui/separator';
|
|
5198
6186
|
import Config from '../../config';
|
|
5199
6187
|
|
|
5200
6188
|
import { Link, useLocation, useMatchRoute } from '@tanstack/react-router';
|
|
@@ -5205,7 +6193,7 @@ import {
|
|
|
5205
6193
|
BreadcrumbList,
|
|
5206
6194
|
BreadcrumbPage,
|
|
5207
6195
|
BreadcrumbSeparator,
|
|
5208
|
-
} from '
|
|
6196
|
+
} from '@proj/common-shadcn/components/ui/breadcrumb';
|
|
5209
6197
|
import { AppSidebar } from '../app-sidebar';
|
|
5210
6198
|
|
|
5211
6199
|
const getBreadcrumbs = (
|
|
@@ -5316,7 +6304,7 @@ import {
|
|
|
5316
6304
|
Alert as ShadcnAlert,
|
|
5317
6305
|
AlertDescription,
|
|
5318
6306
|
AlertTitle,
|
|
5319
|
-
} from '
|
|
6307
|
+
} from '@proj/common-shadcn/components/ui/alert';
|
|
5320
6308
|
|
|
5321
6309
|
type AlertType = 'info' | 'error';
|
|
5322
6310
|
|
|
@@ -5356,7 +6344,7 @@ import {
|
|
|
5356
6344
|
SidebarMenu,
|
|
5357
6345
|
SidebarMenuButton,
|
|
5358
6346
|
SidebarMenuItem,
|
|
5359
|
-
} from '
|
|
6347
|
+
} from '@proj/common-shadcn/components/ui/sidebar';
|
|
5360
6348
|
import { Link } from '@tanstack/react-router';
|
|
5361
6349
|
|
|
5362
6350
|
import Config from '../config';
|
|
@@ -5398,7 +6386,7 @@ export function AppSidebar() {
|
|
|
5398
6386
|
`;
|
|
5399
6387
|
|
|
5400
6388
|
exports[`react-website generator ux tests > Shadcn > should update package.json with required dependencies > test-app/src/components/spinner.tsx 1`] = `
|
|
5401
|
-
"import { Spinner as ShadcnSpinner } from '
|
|
6389
|
+
"import { Spinner as ShadcnSpinner } from '@proj/common-shadcn/components/ui/spinner';
|
|
5402
6390
|
|
|
5403
6391
|
export const Spinner = ShadcnSpinner;
|
|
5404
6392
|
"
|
|
@@ -5459,55 +6447,55 @@ exports[`react-website generator ux tests > Shadcn > should update package.json
|
|
|
5459
6447
|
// You should NOT make any changes in this file as it will be overwritten.
|
|
5460
6448
|
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
5461
6449
|
|
|
5462
|
-
import { Route as rootRouteImport } from './routes/__root'
|
|
5463
|
-
import { Route as IndexRouteImport } from './routes/index'
|
|
6450
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
6451
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
5464
6452
|
|
|
5465
6453
|
const IndexRoute = IndexRouteImport.update({
|
|
5466
6454
|
id: '/',
|
|
5467
6455
|
path: '/',
|
|
5468
6456
|
getParentRoute: () => rootRouteImport,
|
|
5469
|
-
} as any)
|
|
6457
|
+
} as any)
|
|
5470
6458
|
|
|
5471
6459
|
export interface FileRoutesByFullPath {
|
|
5472
|
-
'/': typeof IndexRoute
|
|
6460
|
+
'/': typeof IndexRoute
|
|
5473
6461
|
}
|
|
5474
6462
|
export interface FileRoutesByTo {
|
|
5475
|
-
'/': typeof IndexRoute
|
|
6463
|
+
'/': typeof IndexRoute
|
|
5476
6464
|
}
|
|
5477
6465
|
export interface FileRoutesById {
|
|
5478
|
-
__root__: typeof rootRouteImport
|
|
5479
|
-
'/': typeof IndexRoute
|
|
6466
|
+
__root__: typeof rootRouteImport
|
|
6467
|
+
'/': typeof IndexRoute
|
|
5480
6468
|
}
|
|
5481
6469
|
export interface FileRouteTypes {
|
|
5482
|
-
fileRoutesByFullPath: FileRoutesByFullPath
|
|
5483
|
-
fullPaths: '/'
|
|
5484
|
-
fileRoutesByTo: FileRoutesByTo
|
|
5485
|
-
to: '/'
|
|
5486
|
-
id: '__root__' | '/'
|
|
5487
|
-
fileRoutesById: FileRoutesById
|
|
6470
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
6471
|
+
fullPaths: '/'
|
|
6472
|
+
fileRoutesByTo: FileRoutesByTo
|
|
6473
|
+
to: '/'
|
|
6474
|
+
id: '__root__' | '/'
|
|
6475
|
+
fileRoutesById: FileRoutesById
|
|
5488
6476
|
}
|
|
5489
6477
|
export interface RootRouteChildren {
|
|
5490
|
-
IndexRoute: typeof IndexRoute
|
|
6478
|
+
IndexRoute: typeof IndexRoute
|
|
5491
6479
|
}
|
|
5492
6480
|
|
|
5493
6481
|
declare module '@tanstack/react-router' {
|
|
5494
6482
|
interface FileRoutesByPath {
|
|
5495
6483
|
'/': {
|
|
5496
|
-
id: '/'
|
|
5497
|
-
path: '/'
|
|
5498
|
-
fullPath: '/'
|
|
5499
|
-
preLoaderRoute: typeof IndexRouteImport
|
|
5500
|
-
parentRoute: typeof rootRouteImport
|
|
5501
|
-
}
|
|
6484
|
+
id: '/'
|
|
6485
|
+
path: '/'
|
|
6486
|
+
fullPath: '/'
|
|
6487
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
6488
|
+
parentRoute: typeof rootRouteImport
|
|
6489
|
+
}
|
|
5502
6490
|
}
|
|
5503
6491
|
}
|
|
5504
6492
|
|
|
5505
6493
|
const rootRouteChildren: RootRouteChildren = {
|
|
5506
6494
|
IndexRoute: IndexRoute,
|
|
5507
|
-
}
|
|
6495
|
+
}
|
|
5508
6496
|
export const routeTree = rootRouteImport
|
|
5509
6497
|
._addFileChildren(rootRouteChildren)
|
|
5510
|
-
._addFileTypes<FileRouteTypes>()
|
|
6498
|
+
._addFileTypes<FileRouteTypes>()
|
|
5511
6499
|
"
|
|
5512
6500
|
`;
|
|
5513
6501
|
|