@aws/nx-plugin 1.0.0-rc.8 → 1.0.0-rc.80
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 +6006 -4000
- package/README.md +16 -96
- package/generators.json +162 -10
- package/migrations.json +206 -0
- package/package.json +40 -21
- package/src/agentcore-gateway/__snapshots__/generator.spec.ts.snap +295 -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 +89 -0
- package/src/agentcore-gateway/generator.js +212 -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 +238 -0
- package/src/agentcore-harness/files/project/README.md.template +83 -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 +119 -72
- package/src/infra/app/files/app/README.md.template +8 -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 +195 -127
- 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 +713 -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 +3 -3
- package/src/mcp-server/generator-info.js +149 -165
- 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/apt-security-updates-in-container-images/__snapshots__/migration.spec.ts.snap +90 -0
- package/src/migrations/latest/apt-security-updates-in-container-images/metadata.json +3 -0
- package/src/migrations/latest/apt-security-updates-in-container-images/migration.d.ts +6 -0
- package/src/migrations/latest/apt-security-updates-in-container-images/migration.js +90 -0
- package/src/migrations/latest/apt-security-updates-in-container-images/migration.js.map +1 -0
- package/src/migrations/latest/dynamodb-configurable-encryption/__snapshots__/migration.spec.ts.snap +429 -0
- package/src/migrations/latest/dynamodb-configurable-encryption/metadata.json +3 -0
- package/src/migrations/latest/dynamodb-configurable-encryption/migration.d.ts +6 -0
- package/src/migrations/latest/dynamodb-configurable-encryption/migration.js +325 -0
- package/src/migrations/latest/dynamodb-configurable-encryption/migration.js.map +1 -0
- package/src/migrations/latest/py-agent-ag-ui-hooks/metadata.json +3 -0
- package/src/migrations/latest/py-agent-ag-ui-hooks/migration.d.ts +6 -0
- package/src/migrations/latest/py-agent-ag-ui-hooks/migration.js +113 -0
- package/src/migrations/latest/py-agent-ag-ui-hooks/migration.js.map +1 -0
- package/src/migrations/latest/py-agent-session-id-middleware-extraction/metadata.json +3 -0
- package/src/migrations/latest/py-agent-session-id-middleware-extraction/migration.d.ts +2 -0
- package/src/migrations/latest/py-agent-session-id-middleware-extraction/migration.js +118 -0
- package/src/migrations/latest/py-agent-session-id-middleware-extraction/migration.js.map +1 -0
- package/src/migrations/latest/remove-mcp-inspector-license-exceptions/metadata.json +3 -0
- package/{sdk/utils/ast.d.ts → src/migrations/latest/remove-mcp-inspector-license-exceptions/migration.d.ts} +2 -2
- package/src/migrations/latest/remove-mcp-inspector-license-exceptions/migration.js +38 -0
- package/src/migrations/latest/remove-mcp-inspector-license-exceptions/migration.js.map +1 -0
- package/src/migrations/latest/static-website-configurable-waf-encryption/metadata.json +3 -0
- package/src/migrations/latest/static-website-configurable-waf-encryption/migration.d.ts +6 -0
- package/src/migrations/latest/static-website-configurable-waf-encryption/migration.js +418 -0
- package/src/migrations/latest/static-website-configurable-waf-encryption/migration.js.map +1 -0
- package/src/migrations/latest/ts-agent-session-id-middleware-extraction/metadata.json +3 -0
- package/src/migrations/latest/ts-agent-session-id-middleware-extraction/migration.d.ts +2 -0
- package/src/migrations/latest/ts-agent-session-id-middleware-extraction/migration.js +136 -0
- package/src/migrations/latest/ts-agent-session-id-middleware-extraction/migration.js.map +1 -0
- package/src/migrations/latest/user-identity-configurable-mfa/metadata.json +3 -0
- package/src/migrations/latest/user-identity-configurable-mfa/migration.d.ts +6 -0
- package/src/migrations/latest/user-identity-configurable-mfa/migration.js +362 -0
- package/src/migrations/latest/user-identity-configurable-mfa/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/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 +101 -20
- 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 +1310 -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 -0
- 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 +446 -197
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +156 -89
- 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 +105 -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 +1601 -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 +5409 -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 +134 -95
- 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 +31 -29
- 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 +4 -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 +221 -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 +209 -145
- 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 +28 -2
- package/src/py/project/generator.js +248 -130
- 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 +2072 -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 +104 -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 +362 -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 +10 -0
- package/src/sdk/open-api.js +8 -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 +245 -242
- 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 +223 -56
- 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 +871 -109
- 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 +187 -114
- 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/scripts/bootstrap.ts.template +40 -1
- package/src/terraform/project/files/application/src/main.tf.template +6 -1
- package/src/terraform/project/files/application/src/providers.tf.template +1 -1
- package/src/terraform/project/generator.d.ts +51 -1
- package/src/terraform/project/generator.js +212 -111
- 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 +1182 -184
- 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/generator.d.ts +91 -2
- package/src/trpc/backend/generator.js +177 -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 +1483 -28
- 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 +15 -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 +347 -156
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +194 -113
- 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 +28 -14
- 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 +39 -1
- package/src/ts/astro-docs/generator.js +126 -61
- 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 +982 -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 +490 -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 +107 -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 +8 -6
- 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 -45
- package/src/ts/lib/__snapshots__/vitest.spec.ts.snap +1 -1
- package/src/ts/lib/biome.d.ts +1 -1
- package/src/ts/lib/biome.js +71 -35
- package/src/ts/lib/biome.js.map +1 -1
- package/src/ts/lib/generator.d.ts +8 -1
- package/src/ts/lib/generator.js +115 -103
- 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 +14 -2
- package/src/ts/lib/ts-project-utils.js +96 -71
- 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 +11 -2
- package/src/ts/lib/vitest.js +54 -26
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +221 -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 +236 -162
- 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 +124 -72
- 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 +67 -50
- 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 -51
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +555 -644
- 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 +3 -0
- package/src/ts/rdb/generator.d.ts +118 -5
- package/src/ts/rdb/generator.js +285 -138
- 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 +1648 -690
- package/src/ts/react-website/app/files/app/common/README.md.template +1 -1
- package/src/ts/react-website/app/generator.d.ts +143 -3
- package/src/ts/react-website/app/generator.js +335 -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 +198 -33
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +74 -12
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.ux-provider.spec.ts.snap +0 -20
- 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 -64
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/grit/cloudscape-auth-menu.grit +3 -1
- package/src/ts/react-website/cognito-auth/grit/none-auth-menu.grit +1 -0
- package/src/ts/react-website/cognito-auth/grit/shadcn-auth-menu.grit +3 -1
- package/src/ts/react-website/cognito-auth/grit/shadcn-state-declarations.grit +3 -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 +137 -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 +511 -103
- 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-strands/base/model-errors-strands.ts.template +47 -0
- 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/model_errors_strands.py.template +40 -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 +81 -2
- package/src/utils/agent-core-constructs/agent-core-constructs.js +212 -38
- 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 +366 -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 +281 -1
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +521 -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 +282 -0
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +159 -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 +82 -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 +20 -15
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +24 -16
- 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 +101 -12
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +194 -8
- 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 +5 -11
- package/src/utils/api-constructs/open-api-metadata.d.ts +1 -1
- package/src/utils/api-constructs/open-api-metadata.js +22 -22
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
- package/src/utils/ast/website.js +18 -20
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.d.ts +38 -0
- package/src/utils/ast.js +162 -86
- 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 +58 -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 -76
- 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 +93 -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 +410 -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 +89 -0
- package/src/utils/docker.js +125 -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 -41
- 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 +51 -18
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +40 -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/utils/files/common/scripts/src/dynamodb/start-container.ts.template +103 -0
- 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/{stage-credentials → infra/stage-credentials}/cdk-command.ts.template +6 -3
- 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 +115 -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 +1 -1
- package/src/utils/files/terraform/src/core/runtime-config/appconfig-deployment/appconfig-deployment.tf.template +12 -6
- 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/website/hooks/sigv4/useSigV4.tsx.template +1 -1
- package/src/utils/format.d.ts +39 -4
- package/src/utils/format.js +318 -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 +2 -2
- package/src/utils/function-constructs/function-constructs.d.ts +1 -1
- package/src/utils/function-constructs/function-constructs.js +22 -25
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.js +18 -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 +193 -30
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +28 -9
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +177 -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 +72 -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/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 +8 -2
- package/src/utils/metrics.js +61 -46
- 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 +8 -12
- 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 +77 -6
- package/src/utils/nx.js +196 -75
- 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/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 +28 -6
- package/src/utils/port.js +67 -28
- 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 +73 -48
- 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 +112 -88
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +127 -53
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +60 -53
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +14 -3
- package/src/utils/rdb-constructs/rdb-constructs.js +38 -41
- 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 +46 -4
- package/src/utils/shared-constructs-constants.js +50 -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-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-vended-versions.d.ts +10 -0
- package/src/utils/version-upgrade-migration/sync-vended-versions.js +518 -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 +243 -108
- package/src/utils/versions.js +268 -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 +201 -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 -769
- 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/scripts/start-container.ts.template +0 -81
- 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/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/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: {
|
|
@@ -52,7 +52,7 @@ export default defineConfig(() => ({
|
|
|
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: {
|
|
@@ -108,7 +108,7 @@ export default defineConfig(() => ({
|
|
|
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,12 @@ 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.60.0"
|
|
135
135
|
configuration_aliases = [aws.us_east_1]
|
|
136
136
|
}
|
|
137
137
|
random = {
|
|
138
138
|
source = "hashicorp/random"
|
|
139
|
-
version = "
|
|
139
|
+
version = "3.9.0"
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
}
|
|
@@ -152,6 +152,73 @@ variable "website_file_path" {
|
|
|
152
152
|
type = string
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
variable "custom_domain_names" {
|
|
156
|
+
description = "Custom domain names (aliases) for the CloudFront distribution. Requires acm_certificate_arn."
|
|
157
|
+
type = list(string)
|
|
158
|
+
default = []
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
variable "acm_certificate_arn" {
|
|
162
|
+
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."
|
|
163
|
+
type = string
|
|
164
|
+
default = null
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
variable "enable_waf" {
|
|
168
|
+
description = "Whether to protect the CloudFront distribution with an AWS WAF Web ACL."
|
|
169
|
+
type = bool
|
|
170
|
+
default = true
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
variable "encryption" {
|
|
174
|
+
description = "Server-side encryption for the website and distribution log buckets. One of KMS or S3_MANAGED."
|
|
175
|
+
type = string
|
|
176
|
+
default = "KMS"
|
|
177
|
+
|
|
178
|
+
validation {
|
|
179
|
+
condition = contains(["KMS", "S3_MANAGED"], var.encryption)
|
|
180
|
+
error_message = "encryption must be one of KMS or S3_MANAGED."
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
variable "kms_key_arn" {
|
|
185
|
+
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."
|
|
186
|
+
type = string
|
|
187
|
+
default = null
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
variable "create_kms_key" {
|
|
191
|
+
description = "Whether to create a KMS key for the website. Only applies when encryption is KMS. Set to false when supplying kms_key_arn."
|
|
192
|
+
type = bool
|
|
193
|
+
default = true
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
variable "enable_key_rotation" {
|
|
197
|
+
description = "Whether the automatically created KMS key has rotation enabled. Only applies when encryption is KMS and create_kms_key is true."
|
|
198
|
+
type = bool
|
|
199
|
+
default = true
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
# Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
203
|
+
# framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
204
|
+
# (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
205
|
+
# Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
206
|
+
# connect-src to your specific origins once they are known.
|
|
207
|
+
locals {
|
|
208
|
+
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'"
|
|
209
|
+
|
|
210
|
+
# Delivery source/destination names have a 60 character maximum. Truncate the
|
|
211
|
+
# website name so the longest delivery name stays within the limit.
|
|
212
|
+
access_logs_name_prefix = substr(lower(var.website_name), 0, 16)
|
|
213
|
+
|
|
214
|
+
create_website_key = var.encryption == "KMS" && var.create_kms_key
|
|
215
|
+
website_kms_key_arn = (
|
|
216
|
+
var.encryption != "KMS" ? null :
|
|
217
|
+
local.create_website_key ? aws_kms_key.website_key[0].arn :
|
|
218
|
+
var.kms_key_arn
|
|
219
|
+
)
|
|
220
|
+
}
|
|
221
|
+
|
|
155
222
|
|
|
156
223
|
# Data sources
|
|
157
224
|
data "aws_caller_identity" "current" {}
|
|
@@ -160,9 +227,11 @@ data "aws_region" "current" {}
|
|
|
160
227
|
|
|
161
228
|
# KMS Key for encryption
|
|
162
229
|
resource "aws_kms_key" "website_key" {
|
|
230
|
+
count = local.create_website_key ? 1 : 0
|
|
231
|
+
|
|
163
232
|
description = "KMS key for \${var.website_name} website encryption"
|
|
164
233
|
deletion_window_in_days = 7
|
|
165
|
-
enable_key_rotation =
|
|
234
|
+
enable_key_rotation = var.enable_key_rotation
|
|
166
235
|
|
|
167
236
|
policy = jsonencode({
|
|
168
237
|
Version = "2012-10-17"
|
|
@@ -188,6 +257,26 @@ resource "aws_kms_key" "website_key" {
|
|
|
188
257
|
]
|
|
189
258
|
Resource = "*"
|
|
190
259
|
},
|
|
260
|
+
{
|
|
261
|
+
Sid = "AllowCloudWatchLogs"
|
|
262
|
+
Effect = "Allow"
|
|
263
|
+
Principal = {
|
|
264
|
+
Service = "logs.\${data.aws_region.current.region}.amazonaws.com"
|
|
265
|
+
}
|
|
266
|
+
Action = [
|
|
267
|
+
"kms:Encrypt",
|
|
268
|
+
"kms:Decrypt",
|
|
269
|
+
"kms:ReEncrypt*",
|
|
270
|
+
"kms:GenerateDataKey*",
|
|
271
|
+
"kms:DescribeKey"
|
|
272
|
+
]
|
|
273
|
+
Resource = "*"
|
|
274
|
+
Condition = {
|
|
275
|
+
ArnLike = {
|
|
276
|
+
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.region}:\${data.aws_caller_identity.current.account_id}:log-group:*"
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
},
|
|
191
280
|
{
|
|
192
281
|
Sid = "AllowCloudFrontServicePrincipalSSE-KMS"
|
|
193
282
|
Effect = "Allow"
|
|
@@ -215,22 +304,18 @@ resource "aws_kms_key" "website_key" {
|
|
|
215
304
|
}
|
|
216
305
|
|
|
217
306
|
resource "aws_kms_alias" "website_key_alias" {
|
|
307
|
+
count = local.create_website_key ? 1 : 0
|
|
308
|
+
|
|
218
309
|
name = "alias/\${lower(var.website_name)}-website-key-\${random_id.unique_suffix.hex}"
|
|
219
|
-
target_key_id = aws_kms_key.website_key.key_id
|
|
310
|
+
target_key_id = aws_kms_key.website_key[0].key_id
|
|
220
311
|
}
|
|
221
312
|
|
|
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
|
-
}
|
|
313
|
+
# CloudWatch log group receiving S3 server access logs for the website and
|
|
314
|
+
# distribution log buckets.
|
|
315
|
+
resource "aws_cloudwatch_log_group" "access_logs" {
|
|
316
|
+
name = "/aws/s3/\${lower(var.website_name)}-access-logs-\${random_id.bucket_suffix.hex}"
|
|
317
|
+
retention_in_days = 365
|
|
318
|
+
kms_key_id = local.website_kms_key_arn
|
|
234
319
|
}
|
|
235
320
|
|
|
236
321
|
resource "random_id" "unique_suffix" {
|
|
@@ -241,63 +326,12 @@ resource "random_id" "bucket_suffix" {
|
|
|
241
326
|
byte_length = 8
|
|
242
327
|
}
|
|
243
328
|
|
|
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
329
|
# Website Bucket
|
|
297
330
|
resource "aws_s3_bucket" "website" {
|
|
298
331
|
#checkov:skip=CKV2_AWS_61:Lifecycle configuration not required for static website content
|
|
299
332
|
#checkov:skip=CKV_AWS_144:Cross-region replication not required for static website
|
|
300
333
|
#checkov:skip=CKV2_AWS_62:Event notifications not required for static website bucket
|
|
334
|
+
#checkov:skip=CKV_AWS_18:Server access logs are delivered to CloudWatch Logs (see aws_cloudwatch_log_delivery.website)
|
|
301
335
|
bucket = "\${lower(var.website_name)}-website-\${random_id.bucket_suffix.hex}"
|
|
302
336
|
force_destroy = true
|
|
303
337
|
|
|
@@ -318,8 +352,8 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "website_encryptio
|
|
|
318
352
|
|
|
319
353
|
rule {
|
|
320
354
|
apply_server_side_encryption_by_default {
|
|
321
|
-
kms_master_key_id =
|
|
322
|
-
sse_algorithm = "aws:kms"
|
|
355
|
+
kms_master_key_id = var.encryption == "KMS" ? local.website_kms_key_arn : null
|
|
356
|
+
sse_algorithm = var.encryption == "KMS" ? "aws:kms" : "AES256"
|
|
323
357
|
}
|
|
324
358
|
}
|
|
325
359
|
}
|
|
@@ -341,20 +375,35 @@ resource "aws_s3_bucket_ownership_controls" "website_ownership" {
|
|
|
341
375
|
}
|
|
342
376
|
}
|
|
343
377
|
|
|
344
|
-
|
|
345
|
-
|
|
378
|
+
# Deliver the website bucket's server access logs to CloudWatch Logs.
|
|
379
|
+
resource "aws_cloudwatch_log_delivery_source" "website" {
|
|
380
|
+
name = "\${local.access_logs_name_prefix}-website-logs-\${random_id.bucket_suffix.hex}"
|
|
381
|
+
log_type = "S3_SERVER_ACCESS_LOGS"
|
|
382
|
+
resource_arn = aws_s3_bucket.website.arn
|
|
383
|
+
}
|
|
346
384
|
|
|
347
|
-
|
|
348
|
-
|
|
385
|
+
resource "aws_cloudwatch_log_delivery_destination" "access_logs" {
|
|
386
|
+
name = "\${local.access_logs_name_prefix}-access-logs-\${random_id.bucket_suffix.hex}"
|
|
387
|
+
|
|
388
|
+
delivery_destination_configuration {
|
|
389
|
+
destination_resource_arn = aws_cloudwatch_log_group.access_logs.arn
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
resource "aws_cloudwatch_log_delivery" "website" {
|
|
394
|
+
delivery_source_name = aws_cloudwatch_log_delivery_source.website.name
|
|
395
|
+
delivery_destination_arn = aws_cloudwatch_log_delivery_destination.access_logs.arn
|
|
349
396
|
}
|
|
350
397
|
|
|
351
398
|
|
|
352
|
-
# Distribution Log Bucket
|
|
399
|
+
# Distribution Log Bucket — holds CloudFront standard access logs (CloudFront
|
|
400
|
+
# delivers only to S3). Its own S3 server access logs go to CloudWatch Logs.
|
|
353
401
|
resource "aws_s3_bucket" "distribution_logs" {
|
|
354
402
|
#checkov:skip=CKV2_AWS_61:Lifecycle configuration not required for CloudFront logs
|
|
355
403
|
#checkov:skip=CKV_AWS_144:Cross-region replication not required for CloudFront logs
|
|
356
404
|
#checkov:skip=CKV2_AWS_62:Event notifications not required for CloudFront logs bucket
|
|
357
405
|
#checkov:skip=CKV_AWS_21:Versioning not required for CloudFront access logs
|
|
406
|
+
#checkov:skip=CKV_AWS_18:Server access logs are delivered to CloudWatch Logs (see aws_cloudwatch_log_delivery.distribution_logs)
|
|
358
407
|
bucket = "\${lower(var.website_name)}-distribution-logs-\${random_id.bucket_suffix.hex}"
|
|
359
408
|
force_destroy = true
|
|
360
409
|
|
|
@@ -368,8 +417,8 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "distribution_logs
|
|
|
368
417
|
|
|
369
418
|
rule {
|
|
370
419
|
apply_server_side_encryption_by_default {
|
|
371
|
-
kms_master_key_id =
|
|
372
|
-
sse_algorithm = "aws:kms"
|
|
420
|
+
kms_master_key_id = var.encryption == "KMS" ? local.website_kms_key_arn : null
|
|
421
|
+
sse_algorithm = var.encryption == "KMS" ? "aws:kms" : "AES256"
|
|
373
422
|
}
|
|
374
423
|
}
|
|
375
424
|
}
|
|
@@ -400,11 +449,16 @@ resource "aws_s3_bucket_acl" "distribution_logs_acl" {
|
|
|
400
449
|
depends_on = [aws_s3_bucket_ownership_controls.distribution_logs_ownership]
|
|
401
450
|
}
|
|
402
451
|
|
|
403
|
-
|
|
404
|
-
|
|
452
|
+
# Deliver the distribution log bucket's server access logs to CloudWatch Logs.
|
|
453
|
+
resource "aws_cloudwatch_log_delivery_source" "distribution_logs" {
|
|
454
|
+
name = "\${local.access_logs_name_prefix}-distribution-logs-\${random_id.bucket_suffix.hex}"
|
|
455
|
+
log_type = "S3_SERVER_ACCESS_LOGS"
|
|
456
|
+
resource_arn = aws_s3_bucket.distribution_logs.arn
|
|
457
|
+
}
|
|
405
458
|
|
|
406
|
-
|
|
407
|
-
|
|
459
|
+
resource "aws_cloudwatch_log_delivery" "distribution_logs" {
|
|
460
|
+
delivery_source_name = aws_cloudwatch_log_delivery_source.distribution_logs.name
|
|
461
|
+
delivery_destination_arn = aws_cloudwatch_log_delivery_destination.access_logs.arn
|
|
408
462
|
}
|
|
409
463
|
|
|
410
464
|
resource "aws_s3_bucket_policy" "distribution_logs_ssl_policy" {
|
|
@@ -434,6 +488,8 @@ resource "aws_s3_bucket_policy" "distribution_logs_ssl_policy" {
|
|
|
434
488
|
|
|
435
489
|
# WAF Web ACL (must be in us-east-1 for CloudFront)
|
|
436
490
|
resource "aws_wafv2_web_acl" "cloudfront_waf" {
|
|
491
|
+
count = var.enable_waf ? 1 : 0
|
|
492
|
+
|
|
437
493
|
#checkov:skip=CKV2_AWS_31:WAF logging disabled
|
|
438
494
|
provider = aws.us_east_1
|
|
439
495
|
name = "\${lower(var.website_name)}-cloudfront-waf-\${random_id.unique_suffix.hex}"
|
|
@@ -512,13 +568,42 @@ resource "aws_cloudfront_origin_access_control" "website_oac" {
|
|
|
512
568
|
signing_protocol = "sigv4"
|
|
513
569
|
}
|
|
514
570
|
|
|
571
|
+
# Security headers applied to all responses.
|
|
572
|
+
resource "aws_cloudfront_response_headers_policy" "website" {
|
|
573
|
+
name = "\${aws_s3_bucket.website.bucket}-security-headers"
|
|
574
|
+
|
|
575
|
+
security_headers_config {
|
|
576
|
+
strict_transport_security {
|
|
577
|
+
access_control_max_age_sec = 63072000
|
|
578
|
+
include_subdomains = true
|
|
579
|
+
preload = true
|
|
580
|
+
override = true
|
|
581
|
+
}
|
|
582
|
+
content_type_options {
|
|
583
|
+
override = true
|
|
584
|
+
}
|
|
585
|
+
frame_options {
|
|
586
|
+
frame_option = "DENY"
|
|
587
|
+
override = true
|
|
588
|
+
}
|
|
589
|
+
referrer_policy {
|
|
590
|
+
referrer_policy = "strict-origin-when-cross-origin"
|
|
591
|
+
override = true
|
|
592
|
+
}
|
|
593
|
+
content_security_policy {
|
|
594
|
+
content_security_policy = local.content_security_policy
|
|
595
|
+
override = true
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
515
600
|
# CloudFront Distribution
|
|
516
601
|
resource "aws_cloudfront_distribution" "website" {
|
|
602
|
+
# See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
517
603
|
#checkov:skip=CKV_AWS_174:Using CloudFront default certificate which does not support TLS v1.2
|
|
518
604
|
#checkov:skip=CKV_AWS_310:Origin failover not required for single S3 origin static website
|
|
519
605
|
#checkov:skip=CKV_AWS_374:Geo restrictions not required for global web application
|
|
520
606
|
#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
607
|
#checkov:skip=CKV2_AWS_47:WAF includes AWSManagedRulesKnownBadInputsRuleSet which provides Log4j protection
|
|
523
608
|
origin {
|
|
524
609
|
domain_name = aws_s3_bucket.website.bucket_regional_domain_name
|
|
@@ -529,7 +614,8 @@ resource "aws_cloudfront_distribution" "website" {
|
|
|
529
614
|
enabled = true
|
|
530
615
|
is_ipv6_enabled = true
|
|
531
616
|
default_root_object = "index.html"
|
|
532
|
-
web_acl_id = aws_wafv2_web_acl.cloudfront_waf.arn
|
|
617
|
+
web_acl_id = var.enable_waf ? aws_wafv2_web_acl.cloudfront_waf[0].arn : null
|
|
618
|
+
aliases = var.custom_domain_names
|
|
533
619
|
|
|
534
620
|
logging_config {
|
|
535
621
|
include_cookies = false
|
|
@@ -548,11 +634,12 @@ resource "aws_cloudfront_distribution" "website" {
|
|
|
548
634
|
}
|
|
549
635
|
}
|
|
550
636
|
|
|
551
|
-
viewer_protocol_policy
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
637
|
+
viewer_protocol_policy = "redirect-to-https"
|
|
638
|
+
response_headers_policy_id = aws_cloudfront_response_headers_policy.website.id
|
|
639
|
+
min_ttl = 0
|
|
640
|
+
default_ttl = 3600
|
|
641
|
+
max_ttl = 86400
|
|
642
|
+
compress = true
|
|
556
643
|
}
|
|
557
644
|
|
|
558
645
|
# Custom error responses for SPA routing
|
|
@@ -575,19 +662,16 @@ resource "aws_cloudfront_distribution" "website" {
|
|
|
575
662
|
}
|
|
576
663
|
|
|
577
664
|
viewer_certificate {
|
|
578
|
-
cloudfront_default_certificate =
|
|
665
|
+
cloudfront_default_certificate = var.acm_certificate_arn == null
|
|
666
|
+
acm_certificate_arn = var.acm_certificate_arn
|
|
667
|
+
ssl_support_method = var.acm_certificate_arn == null ? null : "sni-only"
|
|
668
|
+
minimum_protocol_version = var.acm_certificate_arn == null ? "TLSv1" : "TLSv1.2_2021"
|
|
579
669
|
}
|
|
580
670
|
|
|
581
671
|
tags = {
|
|
582
672
|
Name = "\${lower(var.website_name)}-distribution-\${random_id.unique_suffix.hex}"
|
|
583
673
|
}
|
|
584
674
|
|
|
585
|
-
lifecycle {
|
|
586
|
-
replace_triggered_by = [
|
|
587
|
-
aws_wafv2_web_acl.cloudfront_waf
|
|
588
|
-
]
|
|
589
|
-
}
|
|
590
|
-
|
|
591
675
|
# CloudFront validates access to the distribution logs bucket when it
|
|
592
676
|
# creates the distribution.
|
|
593
677
|
depends_on = [
|
|
@@ -656,8 +740,8 @@ resource "null_resource" "upload_website_files" {
|
|
|
656
740
|
|
|
657
741
|
provisioner "local-exec" {
|
|
658
742
|
command = <<-EOT
|
|
659
|
-
cd "
|
|
660
|
-
uv run --with boto3 python3 -c "
|
|
743
|
+
cd "$ROOT_PATH"
|
|
744
|
+
uv run --with boto3==1.43.72 python3 -c "
|
|
661
745
|
import os
|
|
662
746
|
import sys
|
|
663
747
|
import boto3
|
|
@@ -745,9 +829,14 @@ def sync_to_s3(local_path, bucket_name):
|
|
|
745
829
|
sys.exit(1)
|
|
746
830
|
|
|
747
831
|
# Execute sync
|
|
748
|
-
sync_to_s3(
|
|
832
|
+
sync_to_s3(os.environ['WEBSITE_FILE_PATH'], os.environ['BUCKET_NAME'])
|
|
749
833
|
"
|
|
750
834
|
EOT
|
|
835
|
+
environment = {
|
|
836
|
+
ROOT_PATH = path.root
|
|
837
|
+
WEBSITE_FILE_PATH = var.website_file_path
|
|
838
|
+
BUCKET_NAME = aws_s3_bucket.website.bucket
|
|
839
|
+
}
|
|
751
840
|
}
|
|
752
841
|
|
|
753
842
|
depends_on = [aws_s3_bucket_policy.website_cloudfront_policy]
|
|
@@ -755,11 +844,12 @@ sync_to_s3('\${var.website_file_path}', '\${aws_s3_bucket.website.bucket}')
|
|
|
755
844
|
|
|
756
845
|
# Upload runtime config file
|
|
757
846
|
resource "aws_s3_object" "runtime_config" {
|
|
758
|
-
bucket
|
|
759
|
-
key
|
|
760
|
-
content
|
|
761
|
-
content_type
|
|
762
|
-
|
|
847
|
+
bucket = aws_s3_bucket.website.id
|
|
848
|
+
key = "runtime-config.json"
|
|
849
|
+
content = module.runtime_config_reader.config_json
|
|
850
|
+
content_type = "application/json"
|
|
851
|
+
cache_control = "no-cache"
|
|
852
|
+
etag = md5(module.runtime_config_reader.config_json)
|
|
763
853
|
|
|
764
854
|
depends_on = [null_resource.upload_website_files]
|
|
765
855
|
}
|
|
@@ -774,8 +864,9 @@ resource "null_resource" "cloudfront_invalidation" {
|
|
|
774
864
|
|
|
775
865
|
provisioner "local-exec" {
|
|
776
866
|
command = <<-EOT
|
|
777
|
-
uv run --with boto3 python3 -c "
|
|
867
|
+
uv run --with boto3==1.43.72 python3 -c "
|
|
778
868
|
import boto3
|
|
869
|
+
import os
|
|
779
870
|
import sys
|
|
780
871
|
from botocore.exceptions import ClientError, NoCredentialsError
|
|
781
872
|
|
|
@@ -797,7 +888,7 @@ def create_invalidation(distribution_id):
|
|
|
797
888
|
|
|
798
889
|
invalidation_id = response['Invalidation']['Id']
|
|
799
890
|
print(f'CloudFront cache invalidation created: {invalidation_id}')
|
|
800
|
-
print(f'Distribution:
|
|
891
|
+
print(f'Distribution: {distribution_id}')
|
|
801
892
|
print(f'Status: {response[\\"Invalidation\\"][\\"Status\\"]}')
|
|
802
893
|
|
|
803
894
|
except NoCredentialsError:
|
|
@@ -811,9 +902,12 @@ def create_invalidation(distribution_id):
|
|
|
811
902
|
sys.exit(1)
|
|
812
903
|
|
|
813
904
|
# Execute invalidation
|
|
814
|
-
create_invalidation(
|
|
905
|
+
create_invalidation(os.environ['DISTRIBUTION_ID'])
|
|
815
906
|
"
|
|
816
907
|
EOT
|
|
908
|
+
environment = {
|
|
909
|
+
DISTRIBUTION_ID = aws_cloudfront_distribution.website.id
|
|
910
|
+
}
|
|
817
911
|
}
|
|
818
912
|
|
|
819
913
|
depends_on = [
|
|
@@ -850,18 +944,65 @@ output "cloudfront_domain_name" {
|
|
|
850
944
|
|
|
851
945
|
output "waf_web_acl_arn" {
|
|
852
946
|
description = "ARN of the WAF Web ACL"
|
|
853
|
-
value = aws_wafv2_web_acl.cloudfront_waf.arn
|
|
947
|
+
value = var.enable_waf ? aws_wafv2_web_acl.cloudfront_waf[0].arn : null
|
|
854
948
|
}",
|
|
855
949
|
"test-app.tf": "terraform {
|
|
856
950
|
required_providers {
|
|
857
951
|
aws = {
|
|
858
952
|
source = "hashicorp/aws"
|
|
859
|
-
version = "
|
|
953
|
+
version = "6.60.0"
|
|
860
954
|
configuration_aliases = [aws.us_east_1]
|
|
861
955
|
}
|
|
862
956
|
}
|
|
863
957
|
}
|
|
864
958
|
|
|
959
|
+
variable "custom_domain_names" {
|
|
960
|
+
description = "Custom domain names (aliases) for the CloudFront distribution. Requires acm_certificate_arn."
|
|
961
|
+
type = list(string)
|
|
962
|
+
default = []
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
variable "acm_certificate_arn" {
|
|
966
|
+
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."
|
|
967
|
+
type = string
|
|
968
|
+
default = null
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
variable "enable_waf" {
|
|
972
|
+
description = "Whether to protect the CloudFront distribution with an AWS WAF Web ACL."
|
|
973
|
+
type = bool
|
|
974
|
+
default = true
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
variable "encryption" {
|
|
978
|
+
description = "Server-side encryption for the website and distribution log buckets. One of KMS or S3_MANAGED."
|
|
979
|
+
type = string
|
|
980
|
+
default = "KMS"
|
|
981
|
+
|
|
982
|
+
validation {
|
|
983
|
+
condition = contains(["KMS", "S3_MANAGED"], var.encryption)
|
|
984
|
+
error_message = "encryption must be one of KMS or S3_MANAGED."
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
variable "kms_key_arn" {
|
|
989
|
+
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."
|
|
990
|
+
type = string
|
|
991
|
+
default = null
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
variable "create_kms_key" {
|
|
995
|
+
description = "Whether to create a KMS key for the website. Only applies when encryption is KMS. Set to false when supplying kms_key_arn."
|
|
996
|
+
type = bool
|
|
997
|
+
default = true
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
variable "enable_key_rotation" {
|
|
1001
|
+
description = "Whether the automatically created KMS key has rotation enabled. Only applies when encryption is KMS and create_kms_key is true."
|
|
1002
|
+
type = bool
|
|
1003
|
+
default = true
|
|
1004
|
+
}
|
|
1005
|
+
|
|
865
1006
|
# Static website module configured for the web package
|
|
866
1007
|
module "static_website" {
|
|
867
1008
|
source = "../../../core/static-website"
|
|
@@ -869,6 +1010,14 @@ module "static_website" {
|
|
|
869
1010
|
website_name = "test-app"
|
|
870
1011
|
website_file_path = "\${path.module}/../../../../../../../dist/test-app/bundle"
|
|
871
1012
|
|
|
1013
|
+
custom_domain_names = var.custom_domain_names
|
|
1014
|
+
acm_certificate_arn = var.acm_certificate_arn
|
|
1015
|
+
enable_waf = var.enable_waf
|
|
1016
|
+
encryption = var.encryption
|
|
1017
|
+
kms_key_arn = var.kms_key_arn
|
|
1018
|
+
create_kms_key = var.create_kms_key
|
|
1019
|
+
enable_key_rotation = var.enable_key_rotation
|
|
1020
|
+
|
|
872
1021
|
providers = {
|
|
873
1022
|
aws.us_east_1 = aws.us_east_1
|
|
874
1023
|
}
|
|
@@ -909,7 +1058,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
909
1058
|
|
|
910
1059
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > biome.json 1`] = `
|
|
911
1060
|
"{
|
|
912
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
1061
|
+
"$schema": "https://biomejs.dev/schemas/2.5.8/schema.json",
|
|
913
1062
|
"root": true,
|
|
914
1063
|
"formatter": {
|
|
915
1064
|
"enabled": true,
|
|
@@ -921,6 +1070,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
921
1070
|
"formatter": {
|
|
922
1071
|
"quoteStyle": "single",
|
|
923
1072
|
"trailingCommas": "all"
|
|
1073
|
+
},
|
|
1074
|
+
"resolver": {
|
|
1075
|
+
"experimentalPnpmCatalogs": true
|
|
924
1076
|
}
|
|
925
1077
|
},
|
|
926
1078
|
"css": {
|
|
@@ -934,9 +1086,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
934
1086
|
"linter": {
|
|
935
1087
|
"enabled": true,
|
|
936
1088
|
"rules": {
|
|
937
|
-
"
|
|
1089
|
+
"preset": "none",
|
|
938
1090
|
"correctness": {
|
|
939
|
-
"noUndeclaredDependencies": "
|
|
1091
|
+
"noUndeclaredDependencies": "error"
|
|
940
1092
|
}
|
|
941
1093
|
}
|
|
942
1094
|
},
|
|
@@ -955,9 +1107,29 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
955
1107
|
"!**/node_modules",
|
|
956
1108
|
"!**/.nx",
|
|
957
1109
|
"!**/.venv",
|
|
958
|
-
"
|
|
1110
|
+
"!**/.grit",
|
|
1111
|
+
"!**/*.css",
|
|
1112
|
+
"!**/*.gen.*",
|
|
1113
|
+
"!**/generated/**",
|
|
1114
|
+
"!**/tsconfig*.json"
|
|
959
1115
|
]
|
|
960
|
-
}
|
|
1116
|
+
},
|
|
1117
|
+
"overrides": [
|
|
1118
|
+
{
|
|
1119
|
+
"includes": [
|
|
1120
|
+
"**/*.config.{ts,mts,cts,js,mjs,cjs}",
|
|
1121
|
+
"**/*.{spec,test}.{ts,tsx,mts,cts,js,jsx,mjs,cjs}",
|
|
1122
|
+
"**/*.stories.{ts,tsx}"
|
|
1123
|
+
],
|
|
1124
|
+
"linter": {
|
|
1125
|
+
"rules": {
|
|
1126
|
+
"correctness": {
|
|
1127
|
+
"noUndeclaredDependencies": "off"
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
]
|
|
961
1133
|
}
|
|
962
1134
|
"
|
|
963
1135
|
`;
|
|
@@ -970,35 +1142,66 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
970
1142
|
"targetDefaults": {
|
|
971
1143
|
"build": {
|
|
972
1144
|
"cache": true,
|
|
973
|
-
"dependsOn": ["^build"],
|
|
974
1145
|
"inputs": ["default"]
|
|
975
1146
|
},
|
|
976
1147
|
"lint": {
|
|
977
1148
|
"cache": true
|
|
978
1149
|
},
|
|
979
|
-
"
|
|
980
|
-
"cache": true,
|
|
1150
|
+
"test": {
|
|
981
1151
|
"dependsOn": ["^build"],
|
|
982
|
-
"inputs": ["default"
|
|
1152
|
+
"inputs": ["default"]
|
|
983
1153
|
},
|
|
984
1154
|
"@nx/vitest:test": {
|
|
985
1155
|
"cache": true,
|
|
986
|
-
"inputs": ["default", "^
|
|
1156
|
+
"inputs": ["default", "^production"],
|
|
987
1157
|
"configurations": {
|
|
988
1158
|
"update-snapshot": {
|
|
989
1159
|
"args": "--update"
|
|
990
1160
|
}
|
|
991
1161
|
}
|
|
992
1162
|
},
|
|
993
|
-
"test": {
|
|
994
|
-
"dependsOn": ["^build"],
|
|
995
|
-
"inputs": ["default"]
|
|
996
|
-
},
|
|
997
1163
|
"compile": {
|
|
998
1164
|
"cache": true,
|
|
999
1165
|
"inputs": ["default"]
|
|
1000
1166
|
}
|
|
1001
1167
|
},
|
|
1168
|
+
"plugins": [
|
|
1169
|
+
{
|
|
1170
|
+
"plugin": "@nx/js/typescript",
|
|
1171
|
+
"options": {
|
|
1172
|
+
"typecheck": {
|
|
1173
|
+
"targetName": "typecheck"
|
|
1174
|
+
},
|
|
1175
|
+
"build": {
|
|
1176
|
+
"targetName": "compile",
|
|
1177
|
+
"configName": "tsconfig.lib.json",
|
|
1178
|
+
"buildDepsName": "build-deps",
|
|
1179
|
+
"watchDepsName": "watch-deps"
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
"plugin": "@nx/vite/plugin",
|
|
1185
|
+
"options": {
|
|
1186
|
+
"buildTargetName": "bundle",
|
|
1187
|
+
"serveTargetName": "serve",
|
|
1188
|
+
"devTargetName": "serve",
|
|
1189
|
+
"previewTargetName": "preview",
|
|
1190
|
+
"serveStaticTargetName": "serve-static",
|
|
1191
|
+
"typecheckTargetName": "vite:typecheck",
|
|
1192
|
+
"buildDepsTargetName": "build-deps",
|
|
1193
|
+
"watchDepsTargetName": "watch-deps"
|
|
1194
|
+
}
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
"plugin": "@nx/vitest",
|
|
1198
|
+
"options": {
|
|
1199
|
+
"testTargetName": "test",
|
|
1200
|
+
"ciTargetName": "test-ci",
|
|
1201
|
+
"testMode": "watch"
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
],
|
|
1002
1205
|
"generators": {
|
|
1003
1206
|
"@nx/react": {
|
|
1004
1207
|
"application": {
|
|
@@ -1024,23 +1227,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1024
1227
|
"transitive": true
|
|
1025
1228
|
}
|
|
1026
1229
|
]
|
|
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
|
-
]
|
|
1230
|
+
}
|
|
1044
1231
|
}
|
|
1045
1232
|
"
|
|
1046
1233
|
`;
|
|
@@ -1048,44 +1235,35 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1048
1235
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > package.json 1`] = `
|
|
1049
1236
|
"{
|
|
1050
1237
|
"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
|
-
},
|
|
1238
|
+
"dependencies": {},
|
|
1061
1239
|
"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",
|
|
1240
|
+
"@nx/js": "23.1.1",
|
|
1241
|
+
"@nx/react": "catalog:",
|
|
1242
|
+
"@nx/vite": "23.1.1",
|
|
1243
|
+
"@nx/vitest": "23.1.1",
|
|
1244
|
+
"@nx/web": "23.1.1",
|
|
1069
1245
|
"@swc/helpers": "~0.5.18",
|
|
1070
|
-
"@tailwindcss/vite": "
|
|
1246
|
+
"@tailwindcss/vite": "catalog:",
|
|
1071
1247
|
"@testing-library/dom": "10.4.0",
|
|
1072
1248
|
"@testing-library/react": "16.3.0",
|
|
1073
|
-
"@types/node": "
|
|
1249
|
+
"@types/node": "catalog:",
|
|
1074
1250
|
"@types/react": "^19.0.0",
|
|
1075
1251
|
"@types/react-dom": "^19.0.0",
|
|
1076
1252
|
"@vitejs/plugin-react": "^6.0.0",
|
|
1077
|
-
"@vitest/coverage-v8": "
|
|
1078
|
-
"@vitest/ui": "
|
|
1253
|
+
"@vitest/coverage-v8": "catalog:",
|
|
1254
|
+
"@vitest/ui": "catalog:",
|
|
1079
1255
|
"jiti": "2.4.2",
|
|
1080
|
-
"jsdom": "
|
|
1081
|
-
"typescript": "~
|
|
1082
|
-
"vite": "
|
|
1083
|
-
"vitest": "
|
|
1256
|
+
"jsdom": "^27.1.0",
|
|
1257
|
+
"typescript": "~6.0.3",
|
|
1258
|
+
"vite": "catalog:",
|
|
1259
|
+
"vitest": "catalog:"
|
|
1084
1260
|
},
|
|
1085
1261
|
"type": "module",
|
|
1086
|
-
"
|
|
1087
|
-
"
|
|
1088
|
-
|
|
1262
|
+
"workspaces": [
|
|
1263
|
+
"packages/*",
|
|
1264
|
+
"test-app",
|
|
1265
|
+
"packages/common/constructs"
|
|
1266
|
+
]
|
|
1089
1267
|
}
|
|
1090
1268
|
"
|
|
1091
1269
|
`;
|
|
@@ -1127,6 +1305,24 @@ You can also automatiaclly fix some lint errors by running the following command
|
|
|
1127
1305
|
"
|
|
1128
1306
|
`;
|
|
1129
1307
|
|
|
1308
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > packages/common/constructs/package.json 1`] = `
|
|
1309
|
+
"{
|
|
1310
|
+
"name": "@proj/common-constructs",
|
|
1311
|
+
"version": "0.0.1",
|
|
1312
|
+
"private": true,
|
|
1313
|
+
"type": "module",
|
|
1314
|
+
"dependencies": {
|
|
1315
|
+
"aws-cdk-lib": "catalog:",
|
|
1316
|
+
"constructs": "catalog:",
|
|
1317
|
+
"tslib": "^2.3.0"
|
|
1318
|
+
},
|
|
1319
|
+
"devDependencies": {
|
|
1320
|
+
"@types/node": "catalog:"
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
"
|
|
1324
|
+
`;
|
|
1325
|
+
|
|
1130
1326
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > packages/common/constructs/project.json 1`] = `
|
|
1131
1327
|
"{
|
|
1132
1328
|
"name": "@proj/common-constructs",
|
|
@@ -1134,6 +1330,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1134
1330
|
"sourceRoot": "packages/common/constructs/src",
|
|
1135
1331
|
"projectType": "library",
|
|
1136
1332
|
"tags": [],
|
|
1333
|
+
"metadata": {
|
|
1334
|
+
"generator": "ts#project"
|
|
1335
|
+
},
|
|
1137
1336
|
"targets": {
|
|
1138
1337
|
"build": {
|
|
1139
1338
|
"dependsOn": ["lint", "compile", "test", "@proj/test-app:build"]
|
|
@@ -1146,32 +1345,39 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1146
1345
|
"cwd": "{projectRoot}"
|
|
1147
1346
|
}
|
|
1148
1347
|
},
|
|
1149
|
-
"
|
|
1348
|
+
"format": {
|
|
1150
1349
|
"executor": "nx:run-commands",
|
|
1151
1350
|
"cache": true,
|
|
1152
1351
|
"inputs": ["biome"],
|
|
1153
1352
|
"options": {
|
|
1154
|
-
"command": "biome
|
|
1353
|
+
"command": "biome format {projectRoot}"
|
|
1155
1354
|
},
|
|
1156
1355
|
"configurations": {
|
|
1157
1356
|
"fix": {
|
|
1158
|
-
"command": "biome
|
|
1357
|
+
"command": "biome format --write {projectRoot}"
|
|
1159
1358
|
},
|
|
1160
1359
|
"skip-lint": {
|
|
1161
1360
|
"command": "node -e \\"\\""
|
|
1162
1361
|
}
|
|
1163
1362
|
}
|
|
1164
1363
|
},
|
|
1165
|
-
"
|
|
1166
|
-
"executor": "
|
|
1167
|
-
"
|
|
1364
|
+
"lint": {
|
|
1365
|
+
"executor": "nx:run-commands",
|
|
1366
|
+
"cache": true,
|
|
1367
|
+
"inputs": ["biome"],
|
|
1368
|
+
"dependsOn": ["format"],
|
|
1168
1369
|
"options": {
|
|
1169
|
-
"
|
|
1370
|
+
"command": "biome lint {projectRoot}"
|
|
1371
|
+
},
|
|
1372
|
+
"configurations": {
|
|
1373
|
+
"fix": {
|
|
1374
|
+
"command": "biome check --write {projectRoot}"
|
|
1375
|
+
},
|
|
1376
|
+
"skip-lint": {
|
|
1377
|
+
"command": "node -e \\"\\""
|
|
1378
|
+
}
|
|
1170
1379
|
}
|
|
1171
1380
|
}
|
|
1172
|
-
},
|
|
1173
|
-
"metadata": {
|
|
1174
|
-
"generator": "ts#project"
|
|
1175
1381
|
}
|
|
1176
1382
|
}
|
|
1177
1383
|
"
|
|
@@ -1190,11 +1396,17 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1190
1396
|
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
1397
|
"import * as url from 'url';
|
|
1192
1398
|
import { Construct } from 'constructs';
|
|
1193
|
-
import { StaticWebsite } from '../../core/index.js';
|
|
1399
|
+
import { StaticWebsite, StaticWebsiteProps } from '../../core/index.js';
|
|
1400
|
+
|
|
1401
|
+
export type TestAppProps = Omit<
|
|
1402
|
+
StaticWebsiteProps,
|
|
1403
|
+
'websiteName' | 'websiteFilePath'
|
|
1404
|
+
>;
|
|
1194
1405
|
|
|
1195
1406
|
export class TestApp extends StaticWebsite {
|
|
1196
|
-
constructor(scope: Construct, id: string) {
|
|
1407
|
+
constructor(scope: Construct, id: string, props?: TestAppProps) {
|
|
1197
1408
|
super(scope, id, {
|
|
1409
|
+
...props,
|
|
1198
1410
|
websiteName: 'TestApp',
|
|
1199
1411
|
websiteFilePath: url.fileURLToPath(
|
|
1200
1412
|
new URL('../../../../../../dist/test-app/bundle', import.meta.url),
|
|
@@ -1282,10 +1494,31 @@ export const suppressRules = (
|
|
|
1282
1494
|
"
|
|
1283
1495
|
`;
|
|
1284
1496
|
|
|
1497
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > packages/common/constructs/src/core/cloudfront.ts 1`] = `
|
|
1498
|
+
"import { CfnDistribution, Distribution } from 'aws-cdk-lib/aws-cloudfront';
|
|
1499
|
+
|
|
1500
|
+
/**
|
|
1501
|
+
* Finds the domain names associated with a CloudFront distribution.
|
|
1502
|
+
*
|
|
1503
|
+
* Includes the distribution's default \`*.cloudfront.net\` domain name plus any custom
|
|
1504
|
+
* domain names (aliases) configured on it.
|
|
1505
|
+
*/
|
|
1506
|
+
export const findCloudFrontDomainNames = (
|
|
1507
|
+
distribution: Distribution,
|
|
1508
|
+
): string[] => {
|
|
1509
|
+
const cfnDistribution = distribution.node.defaultChild as CfnDistribution;
|
|
1510
|
+
const distributionConfig =
|
|
1511
|
+
cfnDistribution.distributionConfig as CfnDistribution.DistributionConfigProperty;
|
|
1512
|
+
return [distribution.domainName, ...(distributionConfig.aliases ?? [])];
|
|
1513
|
+
};
|
|
1514
|
+
"
|
|
1515
|
+
`;
|
|
1516
|
+
|
|
1285
1517
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > packages/common/constructs/src/core/index.ts 1`] = `
|
|
1286
1518
|
"export * from './static-website.js';
|
|
1287
1519
|
export * from './app.js';
|
|
1288
1520
|
export * from './checkov.js';
|
|
1521
|
+
export * from './cloudfront.js';
|
|
1289
1522
|
export * from './runtime-config.js';
|
|
1290
1523
|
export * from './workspace.js';
|
|
1291
1524
|
"
|
|
@@ -1481,11 +1714,21 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1481
1714
|
"import {
|
|
1482
1715
|
CfnOutput,
|
|
1483
1716
|
CfnResource,
|
|
1717
|
+
Duration,
|
|
1484
1718
|
Lazy,
|
|
1719
|
+
Names,
|
|
1485
1720
|
RemovalPolicy,
|
|
1486
1721
|
Stack,
|
|
1487
1722
|
} from 'aws-cdk-lib';
|
|
1488
|
-
import {
|
|
1723
|
+
import {
|
|
1724
|
+
Distribution,
|
|
1725
|
+
HeadersFrameOption,
|
|
1726
|
+
HeadersReferrerPolicy,
|
|
1727
|
+
ResponseHeadersPolicy,
|
|
1728
|
+
SecurityPolicyProtocol,
|
|
1729
|
+
ViewerProtocolPolicy,
|
|
1730
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
1731
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
1489
1732
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
1490
1733
|
import {
|
|
1491
1734
|
BlockPublicAccess,
|
|
@@ -1494,18 +1737,83 @@ import {
|
|
|
1494
1737
|
IBucket,
|
|
1495
1738
|
ObjectOwnership,
|
|
1496
1739
|
} from 'aws-cdk-lib/aws-s3';
|
|
1497
|
-
import {
|
|
1740
|
+
import {
|
|
1741
|
+
BucketDeployment,
|
|
1742
|
+
CacheControl,
|
|
1743
|
+
Source,
|
|
1744
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
1498
1745
|
import { Construct } from 'constructs';
|
|
1499
1746
|
import { RuntimeConfig } from './runtime-config.js';
|
|
1500
|
-
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
1747
|
+
import { IKey, Key } from 'aws-cdk-lib/aws-kms';
|
|
1748
|
+
import {
|
|
1749
|
+
CfnDelivery,
|
|
1750
|
+
CfnDeliveryDestination,
|
|
1751
|
+
CfnDeliverySource,
|
|
1752
|
+
LogGroup,
|
|
1753
|
+
RetentionDays,
|
|
1754
|
+
} from 'aws-cdk-lib/aws-logs';
|
|
1755
|
+
import { Effect, PolicyStatement, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
|
|
1501
1756
|
import { CfnWebACL } from 'aws-cdk-lib/aws-wafv2';
|
|
1502
1757
|
import { suppressRules } from './checkov.js';
|
|
1503
1758
|
|
|
1504
1759
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
1505
1760
|
|
|
1761
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
1762
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
1763
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
1764
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
1765
|
+
// connect-src to your specific origins once they are known.
|
|
1766
|
+
const CONTENT_SECURITY_POLICY = [
|
|
1767
|
+
"default-src 'self'",
|
|
1768
|
+
"script-src 'self'",
|
|
1769
|
+
"style-src 'self' 'unsafe-inline'",
|
|
1770
|
+
"img-src 'self' data:",
|
|
1771
|
+
"font-src 'self' data:",
|
|
1772
|
+
"connect-src 'self' https: wss:",
|
|
1773
|
+
"object-src 'none'",
|
|
1774
|
+
"base-uri 'self'",
|
|
1775
|
+
"frame-ancestors 'none'",
|
|
1776
|
+
].join('; ');
|
|
1777
|
+
|
|
1506
1778
|
export interface StaticWebsiteProps {
|
|
1507
1779
|
readonly websiteName: string;
|
|
1508
1780
|
readonly websiteFilePath: string;
|
|
1781
|
+
/**
|
|
1782
|
+
* Custom domain names for the CloudFront distribution. Requires \`certificate\`.
|
|
1783
|
+
*/
|
|
1784
|
+
readonly domainNames?: string[];
|
|
1785
|
+
/**
|
|
1786
|
+
* ACM certificate for the custom domain names. Must be in us-east-1.
|
|
1787
|
+
* When provided, viewers are required to use TLS 1.2 or later.
|
|
1788
|
+
*/
|
|
1789
|
+
readonly certificate?: ICertificate;
|
|
1790
|
+
/**
|
|
1791
|
+
* Whether to protect the CloudFront distribution with an AWS WAF Web ACL.
|
|
1792
|
+
*
|
|
1793
|
+
* @default true
|
|
1794
|
+
*/
|
|
1795
|
+
readonly enableWaf?: boolean;
|
|
1796
|
+
/**
|
|
1797
|
+
* Server-side encryption for the website and distribution log buckets.
|
|
1798
|
+
*
|
|
1799
|
+
* @default BucketEncryption.KMS
|
|
1800
|
+
*/
|
|
1801
|
+
readonly encryption?: BucketEncryption;
|
|
1802
|
+
/**
|
|
1803
|
+
* KMS key used to encrypt the website and distribution log buckets. Only used when \`encryption\` is
|
|
1804
|
+
* \`BucketEncryption.KMS\`. When not provided, a new key is created. Note that a key imported via
|
|
1805
|
+
* \`Key.fromKeyArn\` must already grant the CloudWatch Logs, S3 and CloudFront service principals the
|
|
1806
|
+
* necessary permissions in its own key policy - \`addToResourcePolicy\` is a no-op on an imported key,
|
|
1807
|
+
* so this construct cannot grant them on your behalf.
|
|
1808
|
+
*/
|
|
1809
|
+
readonly encryptionKey?: IKey;
|
|
1810
|
+
/**
|
|
1811
|
+
* Whether the automatically created KMS key has rotation enabled. Only applies when \`encryption\` is
|
|
1812
|
+
* \`BucketEncryption.KMS\` and no \`encryptionKey\` is supplied.
|
|
1813
|
+
*
|
|
1814
|
+
* @default true
|
|
1815
|
+
*/
|
|
1816
|
+
readonly enableKeyRotation?: boolean;
|
|
1509
1817
|
}
|
|
1510
1818
|
|
|
1511
1819
|
/**
|
|
@@ -1524,39 +1832,53 @@ export class StaticWebsite extends Construct {
|
|
|
1524
1832
|
constructor(
|
|
1525
1833
|
scope: Construct,
|
|
1526
1834
|
id: string,
|
|
1527
|
-
{
|
|
1835
|
+
{
|
|
1836
|
+
websiteFilePath,
|
|
1837
|
+
websiteName,
|
|
1838
|
+
domainNames,
|
|
1839
|
+
certificate,
|
|
1840
|
+
enableWaf = true,
|
|
1841
|
+
encryption = BucketEncryption.KMS,
|
|
1842
|
+
encryptionKey,
|
|
1843
|
+
enableKeyRotation = true,
|
|
1844
|
+
}: StaticWebsiteProps,
|
|
1528
1845
|
) {
|
|
1529
1846
|
super(scope, id);
|
|
1530
|
-
this.node.setContext(
|
|
1531
|
-
'@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy',
|
|
1532
|
-
true,
|
|
1533
|
-
);
|
|
1534
1847
|
|
|
1535
|
-
const websiteKey
|
|
1536
|
-
|
|
1537
|
-
|
|
1848
|
+
const websiteKey: IKey | undefined =
|
|
1849
|
+
encryption === BucketEncryption.KMS
|
|
1850
|
+
? (encryptionKey ?? new Key(this, 'WebsiteKey', { enableKeyRotation }))
|
|
1851
|
+
: undefined;
|
|
1852
|
+
|
|
1853
|
+
// Allow CloudWatch Logs to use the website key for server access log delivery.
|
|
1854
|
+
const stack = Stack.of(this);
|
|
1855
|
+
websiteKey?.addToResourcePolicy(
|
|
1856
|
+
new PolicyStatement({
|
|
1857
|
+
effect: Effect.ALLOW,
|
|
1858
|
+
principals: [
|
|
1859
|
+
new ServicePrincipal(\`logs.\${stack.region}.amazonaws.com\`),
|
|
1860
|
+
],
|
|
1861
|
+
actions: [
|
|
1862
|
+
'kms:Encrypt',
|
|
1863
|
+
'kms:Decrypt',
|
|
1864
|
+
'kms:ReEncrypt*',
|
|
1865
|
+
'kms:GenerateDataKey*',
|
|
1866
|
+
'kms:DescribeKey',
|
|
1867
|
+
],
|
|
1868
|
+
resources: ['*'],
|
|
1869
|
+
conditions: {
|
|
1870
|
+
ArnLike: {
|
|
1871
|
+
'kms:EncryptionContext:aws:logs:arn': \`arn:aws:logs:\${stack.region}:\${stack.account}:log-group:*\`,
|
|
1872
|
+
},
|
|
1873
|
+
},
|
|
1874
|
+
}),
|
|
1875
|
+
);
|
|
1538
1876
|
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1541
|
-
enforceSSL: true,
|
|
1542
|
-
autoDeleteObjects: true,
|
|
1543
|
-
removalPolicy: RemovalPolicy.DESTROY,
|
|
1544
|
-
encryption: BucketEncryption.KMS,
|
|
1877
|
+
const accessLogs = new LogGroup(this, 'AccessLogs', {
|
|
1878
|
+
retention: RetentionDays.ONE_YEAR,
|
|
1545
1879
|
encryptionKey: websiteKey,
|
|
1546
|
-
|
|
1547
|
-
publicReadAccess: false,
|
|
1548
|
-
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
1880
|
+
removalPolicy: RemovalPolicy.DESTROY,
|
|
1549
1881
|
});
|
|
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
1882
|
|
|
1561
1883
|
// S3 Bucket to hold website files
|
|
1562
1884
|
this.websiteBucket = new Bucket(this, 'WebsiteBucket', {
|
|
@@ -1564,47 +1886,99 @@ export class StaticWebsite extends Construct {
|
|
|
1564
1886
|
enforceSSL: true,
|
|
1565
1887
|
autoDeleteObjects: true,
|
|
1566
1888
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
1567
|
-
encryption
|
|
1889
|
+
encryption,
|
|
1568
1890
|
encryptionKey: websiteKey,
|
|
1569
1891
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_ENFORCED,
|
|
1570
1892
|
publicReadAccess: false,
|
|
1571
1893
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
1572
|
-
serverAccessLogsPrefix: 'website-access-logs',
|
|
1573
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
1574
1894
|
});
|
|
1895
|
+
suppressRules(
|
|
1896
|
+
this.websiteBucket,
|
|
1897
|
+
['CKV_AWS_18'],
|
|
1898
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
1899
|
+
);
|
|
1900
|
+
this.deliverAccessLogsToCloudWatch(
|
|
1901
|
+
'Website',
|
|
1902
|
+
this.websiteBucket,
|
|
1903
|
+
accessLogs,
|
|
1904
|
+
);
|
|
1575
1905
|
// Web ACL
|
|
1576
|
-
const wafStack = new CloudfrontWebAcl(this, 'waf');
|
|
1906
|
+
const wafStack = enableWaf ? new CloudfrontWebAcl(this, 'waf') : undefined;
|
|
1577
1907
|
|
|
1578
|
-
//
|
|
1908
|
+
// Bucket holding CloudFront standard access logs. CloudFront delivers its
|
|
1909
|
+
// own logs to S3 only, so this bucket is retained; its S3 server access
|
|
1910
|
+
// logs are delivered to CloudWatch Logs.
|
|
1579
1911
|
const logBucket = new Bucket(this, 'DistributionLogBucket', {
|
|
1580
1912
|
enforceSSL: true,
|
|
1581
1913
|
autoDeleteObjects: true,
|
|
1582
1914
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
1583
|
-
encryption
|
|
1915
|
+
encryption,
|
|
1584
1916
|
encryptionKey: websiteKey,
|
|
1585
1917
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_PREFERRED,
|
|
1586
1918
|
publicReadAccess: false,
|
|
1587
1919
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
1588
|
-
serverAccessLogsPrefix: 'distribution-access-logs',
|
|
1589
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
1590
1920
|
});
|
|
1591
1921
|
suppressRules(
|
|
1592
1922
|
logBucket,
|
|
1593
1923
|
['CKV_AWS_21'],
|
|
1594
1924
|
'Distribution log bucket does not need versioning enabled',
|
|
1595
1925
|
);
|
|
1926
|
+
suppressRules(
|
|
1927
|
+
logBucket,
|
|
1928
|
+
['CKV_AWS_18'],
|
|
1929
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
1930
|
+
);
|
|
1931
|
+
this.deliverAccessLogsToCloudWatch('Distribution', logBucket, accessLogs);
|
|
1932
|
+
|
|
1933
|
+
// Security headers applied to all responses.
|
|
1934
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
1935
|
+
this,
|
|
1936
|
+
'ResponseHeadersPolicy',
|
|
1937
|
+
{
|
|
1938
|
+
securityHeadersBehavior: {
|
|
1939
|
+
strictTransportSecurity: {
|
|
1940
|
+
accessControlMaxAge: Duration.days(730),
|
|
1941
|
+
includeSubdomains: true,
|
|
1942
|
+
preload: true,
|
|
1943
|
+
override: true,
|
|
1944
|
+
},
|
|
1945
|
+
contentTypeOptions: { override: true },
|
|
1946
|
+
frameOptions: {
|
|
1947
|
+
frameOption: HeadersFrameOption.DENY,
|
|
1948
|
+
override: true,
|
|
1949
|
+
},
|
|
1950
|
+
referrerPolicy: {
|
|
1951
|
+
referrerPolicy:
|
|
1952
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
1953
|
+
override: true,
|
|
1954
|
+
},
|
|
1955
|
+
contentSecurityPolicy: {
|
|
1956
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
1957
|
+
override: true,
|
|
1958
|
+
},
|
|
1959
|
+
},
|
|
1960
|
+
},
|
|
1961
|
+
);
|
|
1596
1962
|
|
|
1597
1963
|
const defaultRootObject = 'index.html';
|
|
1598
1964
|
this.cloudFrontDistribution = new Distribution(
|
|
1599
1965
|
this,
|
|
1600
1966
|
'CloudfrontDistribution',
|
|
1601
1967
|
{
|
|
1602
|
-
webAclId: wafStack
|
|
1968
|
+
webAclId: wafStack?.wafArn,
|
|
1603
1969
|
enableLogging: true,
|
|
1604
1970
|
logBucket: logBucket,
|
|
1971
|
+
...(certificate
|
|
1972
|
+
? {
|
|
1973
|
+
certificate,
|
|
1974
|
+
domainNames,
|
|
1975
|
+
minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
1976
|
+
}
|
|
1977
|
+
: {}),
|
|
1605
1978
|
defaultBehavior: {
|
|
1606
1979
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
1607
1980
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
1981
|
+
responseHeadersPolicy,
|
|
1608
1982
|
},
|
|
1609
1983
|
defaultRootObject,
|
|
1610
1984
|
errorResponses: [
|
|
@@ -1621,16 +1995,31 @@ export class StaticWebsite extends Construct {
|
|
|
1621
1995
|
],
|
|
1622
1996
|
},
|
|
1623
1997
|
);
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1998
|
+
if (!certificate) {
|
|
1999
|
+
// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
2000
|
+
suppressRules(
|
|
2001
|
+
this.cloudFrontDistribution,
|
|
2002
|
+
['CKV_AWS_174'],
|
|
2003
|
+
'Cloudfront default certificate does not use TLS 1.2',
|
|
2004
|
+
);
|
|
2005
|
+
}
|
|
1629
2006
|
|
|
1630
2007
|
// Deploy Website
|
|
1631
2008
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
2009
|
+
sources: [Source.asset(websiteFilePath)],
|
|
2010
|
+
destinationBucket: this.websiteBucket,
|
|
2011
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
2012
|
+
distribution: this.cloudFrontDistribution,
|
|
2013
|
+
// Exclude the runtime config from this deployment's sync so its default pruning
|
|
2014
|
+
// never deletes the file managed separately by RuntimeConfigDeployment below.
|
|
2015
|
+
exclude: [DEFAULT_RUNTIME_CONFIG_FILENAME],
|
|
2016
|
+
memoryLimit: 1024,
|
|
2017
|
+
});
|
|
2018
|
+
|
|
2019
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
2020
|
+
// must always fetch the latest configuration.
|
|
2021
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
1632
2022
|
sources: [
|
|
1633
|
-
Source.asset(websiteFilePath),
|
|
1634
2023
|
Source.data(
|
|
1635
2024
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
1636
2025
|
Lazy.string({
|
|
@@ -1642,8 +2031,9 @@ export class StaticWebsite extends Construct {
|
|
|
1642
2031
|
),
|
|
1643
2032
|
],
|
|
1644
2033
|
destinationBucket: this.websiteBucket,
|
|
1645
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
1646
2034
|
distribution: this.cloudFrontDistribution,
|
|
2035
|
+
cacheControl: [CacheControl.noCache()],
|
|
2036
|
+
prune: false,
|
|
1647
2037
|
memoryLimit: 1024,
|
|
1648
2038
|
});
|
|
1649
2039
|
|
|
@@ -1664,6 +2054,48 @@ export class StaticWebsite extends Construct {
|
|
|
1664
2054
|
value: this.websiteBucket.bucketName,
|
|
1665
2055
|
});
|
|
1666
2056
|
}
|
|
2057
|
+
|
|
2058
|
+
/**
|
|
2059
|
+
* Delivers a bucket's S3 server access logs to a CloudWatch log group using
|
|
2060
|
+
* CloudWatch Logs vended log delivery.
|
|
2061
|
+
*/
|
|
2062
|
+
private deliverAccessLogsToCloudWatch(
|
|
2063
|
+
id: string,
|
|
2064
|
+
bucket: IBucket,
|
|
2065
|
+
logGroup: LogGroup,
|
|
2066
|
+
) {
|
|
2067
|
+
const source: CfnDeliverySource = new CfnDeliverySource(
|
|
2068
|
+
this,
|
|
2069
|
+
\`\${id}AccessLogsSource\`,
|
|
2070
|
+
{
|
|
2071
|
+
name: Lazy.string({
|
|
2072
|
+
produce: () => Names.uniqueResourceName(source, { maxLength: 60 }),
|
|
2073
|
+
}),
|
|
2074
|
+
logType: 'S3_SERVER_ACCESS_LOGS',
|
|
2075
|
+
resourceArn: bucket.bucketArn,
|
|
2076
|
+
},
|
|
2077
|
+
);
|
|
2078
|
+
const bucketPolicy = (bucket as Bucket).policy;
|
|
2079
|
+
if (bucketPolicy) {
|
|
2080
|
+
source.node.addDependency(bucketPolicy);
|
|
2081
|
+
}
|
|
2082
|
+
const destination: CfnDeliveryDestination = new CfnDeliveryDestination(
|
|
2083
|
+
this,
|
|
2084
|
+
\`\${id}AccessLogsDestination\`,
|
|
2085
|
+
{
|
|
2086
|
+
name: Lazy.string({
|
|
2087
|
+
produce: () =>
|
|
2088
|
+
Names.uniqueResourceName(destination, { maxLength: 60 }),
|
|
2089
|
+
}),
|
|
2090
|
+
destinationResourceArn: logGroup.logGroupArn,
|
|
2091
|
+
},
|
|
2092
|
+
);
|
|
2093
|
+
const delivery = new CfnDelivery(this, \`\${id}AccessLogsDelivery\`, {
|
|
2094
|
+
deliverySourceName: source.name,
|
|
2095
|
+
deliveryDestinationArn: destination.attrArn,
|
|
2096
|
+
});
|
|
2097
|
+
delivery.addDependency(source);
|
|
2098
|
+
}
|
|
1667
2099
|
}
|
|
1668
2100
|
|
|
1669
2101
|
export class CloudfrontWebAcl extends Stack {
|
|
@@ -1786,9 +2218,13 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1786
2218
|
"emitDeclarationOnly": false,
|
|
1787
2219
|
"module": "nodenext",
|
|
1788
2220
|
"moduleResolution": "nodenext",
|
|
1789
|
-
"types": [
|
|
2221
|
+
"types": [
|
|
2222
|
+
"node"
|
|
2223
|
+
]
|
|
1790
2224
|
},
|
|
1791
|
-
"include": [
|
|
2225
|
+
"include": [
|
|
2226
|
+
"src/**/*.ts"
|
|
2227
|
+
],
|
|
1792
2228
|
"references": [],
|
|
1793
2229
|
"exclude": [
|
|
1794
2230
|
"vite.config.ts",
|
|
@@ -1851,7 +2287,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1851
2287
|
"import { defineConfig } from 'vitest/config';
|
|
1852
2288
|
|
|
1853
2289
|
export default defineConfig(() => ({
|
|
1854
|
-
root:
|
|
2290
|
+
root: import.meta.dirname,
|
|
1855
2291
|
cacheDir: '../../../node_modules/.vite/packages/common/constructs',
|
|
1856
2292
|
test: {
|
|
1857
2293
|
passWithNoTests: true,
|
|
@@ -1872,9 +2308,25 @@ export default defineConfig(() => ({
|
|
|
1872
2308
|
|
|
1873
2309
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > pnpm-workspace.yaml 1`] = `
|
|
1874
2310
|
"packages:
|
|
1875
|
-
-
|
|
1876
|
-
-
|
|
1877
|
-
-
|
|
2311
|
+
- packages/*
|
|
2312
|
+
- test-app
|
|
2313
|
+
- packages/common/*
|
|
2314
|
+
catalog:
|
|
2315
|
+
vite: 8.2.1
|
|
2316
|
+
vitest: 4.1.10
|
|
2317
|
+
'@vitest/coverage-v8': 4.1.10
|
|
2318
|
+
constructs: 10.8.1
|
|
2319
|
+
aws-cdk-lib: 2.265.0
|
|
2320
|
+
'@types/node': 26.2.0
|
|
2321
|
+
react: 19.2.8
|
|
2322
|
+
react-dom: 19.2.8
|
|
2323
|
+
'@cloudscape-design/components': 3.0.1347
|
|
2324
|
+
'@cloudscape-design/board-components': 3.0.218
|
|
2325
|
+
'@cloudscape-design/global-styles': 1.0.66
|
|
2326
|
+
tailwindcss: 4.3.3
|
|
2327
|
+
'@nx/react': 23.1.1
|
|
2328
|
+
'@vitest/ui': 4.1.10
|
|
2329
|
+
'@tailwindcss/vite': 4.3.3
|
|
1878
2330
|
"
|
|
1879
2331
|
`;
|
|
1880
2332
|
|
|
@@ -1914,7 +2366,7 @@ You can also automatically fix some lint errors by running the following command
|
|
|
1914
2366
|
|
|
1915
2367
|
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
2368
|
|
|
1917
|
-
\`pnpm nx
|
|
2369
|
+
\`pnpm nx load-runtime-config @proj/test-app\`
|
|
1918
2370
|
|
|
1919
2371
|
> [!IMPORTANT]
|
|
1920
2372
|
> Ensure you have AWS CLI and curl installed
|
|
@@ -1948,6 +2400,25 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1948
2400
|
"
|
|
1949
2401
|
`;
|
|
1950
2402
|
|
|
2403
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > test-app/package.json 1`] = `
|
|
2404
|
+
"{
|
|
2405
|
+
"name": "@proj/test-app",
|
|
2406
|
+
"version": "0.0.1",
|
|
2407
|
+
"private": true,
|
|
2408
|
+
"type": "module",
|
|
2409
|
+
"dependencies": {
|
|
2410
|
+
"@cloudscape-design/board-components": "catalog:",
|
|
2411
|
+
"@cloudscape-design/components": "catalog:",
|
|
2412
|
+
"@cloudscape-design/global-styles": "catalog:",
|
|
2413
|
+
"react": "catalog:",
|
|
2414
|
+
"react-dom": "catalog:",
|
|
2415
|
+
"tailwindcss": "catalog:"
|
|
2416
|
+
},
|
|
2417
|
+
"devDependencies": {}
|
|
2418
|
+
}
|
|
2419
|
+
"
|
|
2420
|
+
`;
|
|
2421
|
+
|
|
1951
2422
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > test-app/project.json 1`] = `
|
|
1952
2423
|
"{
|
|
1953
2424
|
"name": "@proj/test-app",
|
|
@@ -1959,33 +2430,17 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1959
2430
|
"generator": "ts#react-website",
|
|
1960
2431
|
"ux": "cloudscape",
|
|
1961
2432
|
"framework": "react",
|
|
1962
|
-
"infra": "cloudfront-s3"
|
|
2433
|
+
"infra": "cloudfront-s3",
|
|
2434
|
+
"tailwind": true,
|
|
2435
|
+
"tanstackRouter": false,
|
|
2436
|
+
"iac": "cdk"
|
|
1963
2437
|
},
|
|
1964
2438
|
"targets": {
|
|
1965
2439
|
"build": {
|
|
1966
|
-
"dependsOn": ["lint", "compile", "
|
|
1967
|
-
"options": {
|
|
1968
|
-
"outputPath": "dist/{projectRoot}/bundle"
|
|
1969
|
-
}
|
|
1970
|
-
},
|
|
1971
|
-
"bundle": {
|
|
1972
|
-
"executor": "@nx/vite:build",
|
|
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
|
-
}
|
|
2440
|
+
"dependsOn": ["lint", "compile", "test", "bundle"]
|
|
1986
2441
|
},
|
|
1987
2442
|
"compile": {
|
|
1988
|
-
"dependsOn": ["
|
|
2443
|
+
"dependsOn": ["^build"],
|
|
1989
2444
|
"executor": "nx:run-commands",
|
|
1990
2445
|
"outputs": ["{workspaceRoot}/dist/{projectRoot}/tsc"],
|
|
1991
2446
|
"options": {
|
|
@@ -1993,72 +2448,30 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1993
2448
|
"cwd": "{projectRoot}"
|
|
1994
2449
|
}
|
|
1995
2450
|
},
|
|
1996
|
-
"
|
|
2451
|
+
"dev": {
|
|
1997
2452
|
"executor": "nx:run-commands",
|
|
1998
|
-
"
|
|
1999
|
-
"description": "Load runtime config from your deployed stack for dev purposes. You must set your AWS CLI credentials whilst calling 'pnpm nx run @proj/test-app:load:runtime-config'"
|
|
2000
|
-
},
|
|
2001
|
-
"options": {
|
|
2002
|
-
"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\\""
|
|
2003
|
-
}
|
|
2004
|
-
},
|
|
2005
|
-
"preview": {
|
|
2006
|
-
"dependsOn": ["build"],
|
|
2007
|
-
"executor": "@nx/vite:preview-server",
|
|
2008
|
-
"defaultConfiguration": "development",
|
|
2453
|
+
"continuous": true,
|
|
2009
2454
|
"options": {
|
|
2010
|
-
"
|
|
2011
|
-
|
|
2012
|
-
"configurations": {
|
|
2013
|
-
"development": {
|
|
2014
|
-
"buildTarget": "@proj/test-app:build:development"
|
|
2015
|
-
},
|
|
2016
|
-
"production": {
|
|
2017
|
-
"buildTarget": "@proj/test-app:build:production"
|
|
2018
|
-
}
|
|
2455
|
+
"command": "vite --mode local-dev",
|
|
2456
|
+
"cwd": "{projectRoot}"
|
|
2019
2457
|
}
|
|
2020
2458
|
},
|
|
2021
|
-
"
|
|
2022
|
-
"executor": "
|
|
2023
|
-
"
|
|
2459
|
+
"format": {
|
|
2460
|
+
"executor": "nx:run-commands",
|
|
2461
|
+
"cache": true,
|
|
2462
|
+
"inputs": ["biome"],
|
|
2024
2463
|
"options": {
|
|
2025
|
-
"
|
|
2464
|
+
"command": "biome format {projectRoot}"
|
|
2026
2465
|
},
|
|
2027
2466
|
"configurations": {
|
|
2028
|
-
"
|
|
2029
|
-
"
|
|
2030
|
-
"hmr": true
|
|
2467
|
+
"fix": {
|
|
2468
|
+
"command": "biome format --write {projectRoot}"
|
|
2031
2469
|
},
|
|
2032
|
-
"
|
|
2033
|
-
"
|
|
2034
|
-
"hmr": false
|
|
2470
|
+
"skip-lint": {
|
|
2471
|
+
"command": "node -e \\"\\""
|
|
2035
2472
|
}
|
|
2036
2473
|
}
|
|
2037
2474
|
},
|
|
2038
|
-
"serve-local": {
|
|
2039
|
-
"executor": "@nx/vite:dev-server",
|
|
2040
|
-
"options": {
|
|
2041
|
-
"buildTarget": "@proj/test-app:build:development",
|
|
2042
|
-
"hmr": true,
|
|
2043
|
-
"mode": "serve-local"
|
|
2044
|
-
},
|
|
2045
|
-
"continuous": true
|
|
2046
|
-
},
|
|
2047
|
-
"serve-static": {
|
|
2048
|
-
"executor": "@nx/web:file-server",
|
|
2049
|
-
"dependsOn": ["build"],
|
|
2050
|
-
"options": {
|
|
2051
|
-
"buildTarget": "@proj/test-app:build",
|
|
2052
|
-
"spa": true
|
|
2053
|
-
}
|
|
2054
|
-
},
|
|
2055
|
-
"test": {
|
|
2056
|
-
"executor": "@nx/vitest:test",
|
|
2057
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
2058
|
-
"options": {
|
|
2059
|
-
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
2060
|
-
}
|
|
2061
|
-
},
|
|
2062
2475
|
"lint": {
|
|
2063
2476
|
"executor": "nx:run-commands",
|
|
2064
2477
|
"cache": true,
|
|
@@ -2073,6 +2486,16 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2073
2486
|
"skip-lint": {
|
|
2074
2487
|
"command": "node -e \\"\\""
|
|
2075
2488
|
}
|
|
2489
|
+
},
|
|
2490
|
+
"dependsOn": ["format"]
|
|
2491
|
+
},
|
|
2492
|
+
"load-runtime-config": {
|
|
2493
|
+
"executor": "nx:run-commands",
|
|
2494
|
+
"metadata": {
|
|
2495
|
+
"description": "Load runtime config from your deployed stack for dev purposes. You must set your AWS CLI credentials whilst calling 'pnpm nx load-runtime-config @proj/test-app'"
|
|
2496
|
+
},
|
|
2497
|
+
"options": {
|
|
2498
|
+
"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
2499
|
}
|
|
2077
2500
|
}
|
|
2078
2501
|
}
|
|
@@ -2280,15 +2703,22 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2280
2703
|
"outDir": "../dist/test-app/tsc",
|
|
2281
2704
|
"tsBuildInfoFile": "../dist/test-app/tsc/tsconfig.lib.tsbuildinfo",
|
|
2282
2705
|
"jsx": "react-jsx",
|
|
2283
|
-
"lib": [
|
|
2706
|
+
"lib": [
|
|
2707
|
+
"DOM"
|
|
2708
|
+
],
|
|
2284
2709
|
"types": [
|
|
2285
2710
|
"node",
|
|
2286
2711
|
"@nx/react/typings/cssmodule.d.ts",
|
|
2287
2712
|
"@nx/react/typings/image.d.ts",
|
|
2288
2713
|
"vite/client"
|
|
2289
|
-
]
|
|
2714
|
+
],
|
|
2715
|
+
"rootDir": "src",
|
|
2716
|
+
"module": "esnext",
|
|
2717
|
+
"moduleResolution": "bundler"
|
|
2290
2718
|
},
|
|
2291
2719
|
"exclude": [
|
|
2720
|
+
"out-tsc",
|
|
2721
|
+
"dist",
|
|
2292
2722
|
"src/**/*.spec.ts",
|
|
2293
2723
|
"src/**/*.test.ts",
|
|
2294
2724
|
"src/**/*.spec.tsx",
|
|
@@ -2302,7 +2732,12 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2302
2732
|
"vitest.config.ts",
|
|
2303
2733
|
"vitest.config.mts"
|
|
2304
2734
|
],
|
|
2305
|
-
"include": [
|
|
2735
|
+
"include": [
|
|
2736
|
+
"src/**/*.js",
|
|
2737
|
+
"src/**/*.jsx",
|
|
2738
|
+
"src/**/*.ts",
|
|
2739
|
+
"src/**/*.tsx"
|
|
2740
|
+
]
|
|
2306
2741
|
}
|
|
2307
2742
|
"
|
|
2308
2743
|
`;
|
|
@@ -2341,7 +2776,10 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2341
2776
|
"vitest",
|
|
2342
2777
|
"@nx/react/typings/cssmodule.d.ts",
|
|
2343
2778
|
"@nx/react/typings/image.d.ts"
|
|
2344
|
-
]
|
|
2779
|
+
],
|
|
2780
|
+
"jsx": "react-jsx",
|
|
2781
|
+
"module": "esnext",
|
|
2782
|
+
"moduleResolution": "bundler"
|
|
2345
2783
|
},
|
|
2346
2784
|
"include": [
|
|
2347
2785
|
"vite.config.ts",
|
|
@@ -2390,7 +2828,7 @@ export default defineConfig(() => ({
|
|
|
2390
2828
|
// plugins: [],
|
|
2391
2829
|
// },
|
|
2392
2830
|
build: {
|
|
2393
|
-
outDir: '../dist/test-app',
|
|
2831
|
+
outDir: '../dist/test-app/bundle',
|
|
2394
2832
|
emptyOutDir: true,
|
|
2395
2833
|
reportCompressedSize: true,
|
|
2396
2834
|
commonjsOptions: {
|
|
@@ -2410,7 +2848,7 @@ export default defineConfig(() => ({
|
|
|
2410
2848
|
provider: 'v8' as const,
|
|
2411
2849
|
},
|
|
2412
2850
|
},
|
|
2413
|
-
resolve: { tsconfigPaths: true },
|
|
2851
|
+
resolve: { tsconfigPaths: true, dedupe: ['react', 'react-dom'] },
|
|
2414
2852
|
define: { global: {} },
|
|
2415
2853
|
}));
|
|
2416
2854
|
"
|
|
@@ -2420,9 +2858,14 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2420
2858
|
"{
|
|
2421
2859
|
"compilerOptions": {
|
|
2422
2860
|
"paths": {
|
|
2423
|
-
"
|
|
2424
|
-
|
|
2861
|
+
"@proj/test-app": [
|
|
2862
|
+
"./test-app/src/index.ts"
|
|
2863
|
+
],
|
|
2864
|
+
"@proj/common-constructs": [
|
|
2865
|
+
"./packages/common/constructs/src/index.ts"
|
|
2866
|
+
]
|
|
2425
2867
|
},
|
|
2868
|
+
"composite": true,
|
|
2426
2869
|
"rootDir": "."
|
|
2427
2870
|
}
|
|
2428
2871
|
}
|
|
@@ -2431,6 +2874,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2431
2874
|
|
|
2432
2875
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > tsconfig.json 1`] = `
|
|
2433
2876
|
"{
|
|
2877
|
+
"extends": "./tsconfig.base.json",
|
|
2878
|
+
"files": [],
|
|
2879
|
+
"include": [],
|
|
2434
2880
|
"references": [
|
|
2435
2881
|
{
|
|
2436
2882
|
"path": "./test-app"
|
|
@@ -2443,11 +2889,19 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2443
2889
|
"
|
|
2444
2890
|
`;
|
|
2445
2891
|
|
|
2446
|
-
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > vitest.
|
|
2447
|
-
"
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2892
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > vitest.config.ts 1`] = `
|
|
2893
|
+
"import { defineConfig } from 'vitest/config';
|
|
2894
|
+
|
|
2895
|
+
export default defineConfig({
|
|
2896
|
+
test: {
|
|
2897
|
+
projects: [
|
|
2898
|
+
'**/vite.config.{mjs,js,ts,mts}',
|
|
2899
|
+
'**/vitest.config.{mjs,js,ts,mts}',
|
|
2900
|
+
'!vitest.config.{mjs,js,ts,mts}',
|
|
2901
|
+
'!vite.config.{mjs,js,ts,mts}',
|
|
2902
|
+
],
|
|
2903
|
+
},
|
|
2904
|
+
});
|
|
2451
2905
|
"
|
|
2452
2906
|
`;
|
|
2453
2907
|
|
|
@@ -2463,7 +2917,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2463
2917
|
|
|
2464
2918
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > biome.json 1`] = `
|
|
2465
2919
|
"{
|
|
2466
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2920
|
+
"$schema": "https://biomejs.dev/schemas/2.5.8/schema.json",
|
|
2467
2921
|
"root": true,
|
|
2468
2922
|
"formatter": {
|
|
2469
2923
|
"enabled": true,
|
|
@@ -2475,6 +2929,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2475
2929
|
"formatter": {
|
|
2476
2930
|
"quoteStyle": "single",
|
|
2477
2931
|
"trailingCommas": "all"
|
|
2932
|
+
},
|
|
2933
|
+
"resolver": {
|
|
2934
|
+
"experimentalPnpmCatalogs": true
|
|
2478
2935
|
}
|
|
2479
2936
|
},
|
|
2480
2937
|
"css": {
|
|
@@ -2488,9 +2945,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2488
2945
|
"linter": {
|
|
2489
2946
|
"enabled": true,
|
|
2490
2947
|
"rules": {
|
|
2491
|
-
"
|
|
2948
|
+
"preset": "none",
|
|
2492
2949
|
"correctness": {
|
|
2493
|
-
"noUndeclaredDependencies": "
|
|
2950
|
+
"noUndeclaredDependencies": "error"
|
|
2494
2951
|
}
|
|
2495
2952
|
}
|
|
2496
2953
|
},
|
|
@@ -2509,9 +2966,29 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2509
2966
|
"!**/node_modules",
|
|
2510
2967
|
"!**/.nx",
|
|
2511
2968
|
"!**/.venv",
|
|
2512
|
-
"
|
|
2969
|
+
"!**/.grit",
|
|
2970
|
+
"!**/*.css",
|
|
2971
|
+
"!**/*.gen.*",
|
|
2972
|
+
"!**/generated/**",
|
|
2973
|
+
"!**/tsconfig*.json"
|
|
2513
2974
|
]
|
|
2514
|
-
}
|
|
2975
|
+
},
|
|
2976
|
+
"overrides": [
|
|
2977
|
+
{
|
|
2978
|
+
"includes": [
|
|
2979
|
+
"**/*.config.{ts,mts,cts,js,mjs,cjs}",
|
|
2980
|
+
"**/*.{spec,test}.{ts,tsx,mts,cts,js,jsx,mjs,cjs}",
|
|
2981
|
+
"**/*.stories.{ts,tsx}"
|
|
2982
|
+
],
|
|
2983
|
+
"linter": {
|
|
2984
|
+
"rules": {
|
|
2985
|
+
"correctness": {
|
|
2986
|
+
"noUndeclaredDependencies": "off"
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
]
|
|
2515
2992
|
}
|
|
2516
2993
|
"
|
|
2517
2994
|
`;
|
|
@@ -2524,35 +3001,66 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2524
3001
|
"targetDefaults": {
|
|
2525
3002
|
"build": {
|
|
2526
3003
|
"cache": true,
|
|
2527
|
-
"dependsOn": ["^build"],
|
|
2528
3004
|
"inputs": ["default"]
|
|
2529
3005
|
},
|
|
2530
3006
|
"lint": {
|
|
2531
3007
|
"cache": true
|
|
2532
3008
|
},
|
|
2533
|
-
"
|
|
2534
|
-
"cache": true,
|
|
3009
|
+
"test": {
|
|
2535
3010
|
"dependsOn": ["^build"],
|
|
2536
|
-
"inputs": ["default"
|
|
3011
|
+
"inputs": ["default"]
|
|
2537
3012
|
},
|
|
2538
3013
|
"@nx/vitest:test": {
|
|
2539
3014
|
"cache": true,
|
|
2540
|
-
"inputs": ["default", "^
|
|
3015
|
+
"inputs": ["default", "^production"],
|
|
2541
3016
|
"configurations": {
|
|
2542
3017
|
"update-snapshot": {
|
|
2543
3018
|
"args": "--update"
|
|
2544
3019
|
}
|
|
2545
3020
|
}
|
|
2546
3021
|
},
|
|
2547
|
-
"test": {
|
|
2548
|
-
"dependsOn": ["^build"],
|
|
2549
|
-
"inputs": ["default"]
|
|
2550
|
-
},
|
|
2551
3022
|
"compile": {
|
|
2552
3023
|
"cache": true,
|
|
2553
3024
|
"inputs": ["default"]
|
|
2554
3025
|
}
|
|
2555
3026
|
},
|
|
3027
|
+
"plugins": [
|
|
3028
|
+
{
|
|
3029
|
+
"plugin": "@nx/js/typescript",
|
|
3030
|
+
"options": {
|
|
3031
|
+
"typecheck": {
|
|
3032
|
+
"targetName": "typecheck"
|
|
3033
|
+
},
|
|
3034
|
+
"build": {
|
|
3035
|
+
"targetName": "compile",
|
|
3036
|
+
"configName": "tsconfig.lib.json",
|
|
3037
|
+
"buildDepsName": "build-deps",
|
|
3038
|
+
"watchDepsName": "watch-deps"
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
},
|
|
3042
|
+
{
|
|
3043
|
+
"plugin": "@nx/vite/plugin",
|
|
3044
|
+
"options": {
|
|
3045
|
+
"buildTargetName": "bundle",
|
|
3046
|
+
"serveTargetName": "serve",
|
|
3047
|
+
"devTargetName": "serve",
|
|
3048
|
+
"previewTargetName": "preview",
|
|
3049
|
+
"serveStaticTargetName": "serve-static",
|
|
3050
|
+
"typecheckTargetName": "vite:typecheck",
|
|
3051
|
+
"buildDepsTargetName": "build-deps",
|
|
3052
|
+
"watchDepsTargetName": "watch-deps"
|
|
3053
|
+
}
|
|
3054
|
+
},
|
|
3055
|
+
{
|
|
3056
|
+
"plugin": "@nx/vitest",
|
|
3057
|
+
"options": {
|
|
3058
|
+
"testTargetName": "test",
|
|
3059
|
+
"ciTargetName": "test-ci",
|
|
3060
|
+
"testMode": "watch"
|
|
3061
|
+
}
|
|
3062
|
+
}
|
|
3063
|
+
],
|
|
2556
3064
|
"generators": {
|
|
2557
3065
|
"@nx/react": {
|
|
2558
3066
|
"application": {
|
|
@@ -2578,23 +3086,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2578
3086
|
"transitive": true
|
|
2579
3087
|
}
|
|
2580
3088
|
]
|
|
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
|
-
]
|
|
3089
|
+
}
|
|
2598
3090
|
}
|
|
2599
3091
|
"
|
|
2600
3092
|
`;
|
|
@@ -2602,49 +3094,39 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2602
3094
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > package.json 1`] = `
|
|
2603
3095
|
"{
|
|
2604
3096
|
"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
|
-
},
|
|
3097
|
+
"dependencies": {},
|
|
2616
3098
|
"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",
|
|
3099
|
+
"@nx/js": "23.1.1",
|
|
3100
|
+
"@nx/react": "catalog:",
|
|
3101
|
+
"@nx/vite": "23.1.1",
|
|
3102
|
+
"@nx/vitest": "23.1.1",
|
|
3103
|
+
"@nx/web": "23.1.1",
|
|
2624
3104
|
"@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": "
|
|
3105
|
+
"@tailwindcss/vite": "catalog:",
|
|
3106
|
+
"@tanstack/router-generator": "catalog:",
|
|
3107
|
+
"@tanstack/router-plugin": "catalog:",
|
|
3108
|
+
"@tanstack/router-utils": "catalog:",
|
|
3109
|
+
"@tanstack/virtual-file-routes": "catalog:",
|
|
2630
3110
|
"@testing-library/dom": "10.4.0",
|
|
2631
3111
|
"@testing-library/react": "16.3.0",
|
|
2632
|
-
"@types/node": "
|
|
3112
|
+
"@types/node": "catalog:",
|
|
2633
3113
|
"@types/react": "^19.0.0",
|
|
2634
3114
|
"@types/react-dom": "^19.0.0",
|
|
2635
3115
|
"@vitejs/plugin-react": "^6.0.0",
|
|
2636
|
-
"@vitest/coverage-v8": "
|
|
2637
|
-
"@vitest/ui": "
|
|
3116
|
+
"@vitest/coverage-v8": "catalog:",
|
|
3117
|
+
"@vitest/ui": "catalog:",
|
|
2638
3118
|
"jiti": "2.4.2",
|
|
2639
|
-
"jsdom": "
|
|
2640
|
-
"typescript": "~
|
|
2641
|
-
"vite": "
|
|
2642
|
-
"vitest": "
|
|
3119
|
+
"jsdom": "^27.1.0",
|
|
3120
|
+
"typescript": "~6.0.3",
|
|
3121
|
+
"vite": "catalog:",
|
|
3122
|
+
"vitest": "catalog:"
|
|
2643
3123
|
},
|
|
2644
3124
|
"type": "module",
|
|
2645
|
-
"
|
|
2646
|
-
"
|
|
2647
|
-
|
|
3125
|
+
"workspaces": [
|
|
3126
|
+
"packages/*",
|
|
3127
|
+
"test-app",
|
|
3128
|
+
"packages/common/constructs"
|
|
3129
|
+
]
|
|
2648
3130
|
}
|
|
2649
3131
|
"
|
|
2650
3132
|
`;
|
|
@@ -2686,6 +3168,24 @@ You can also automatiaclly fix some lint errors by running the following command
|
|
|
2686
3168
|
"
|
|
2687
3169
|
`;
|
|
2688
3170
|
|
|
3171
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > packages/common/constructs/package.json 1`] = `
|
|
3172
|
+
"{
|
|
3173
|
+
"name": "@proj/common-constructs",
|
|
3174
|
+
"version": "0.0.1",
|
|
3175
|
+
"private": true,
|
|
3176
|
+
"type": "module",
|
|
3177
|
+
"dependencies": {
|
|
3178
|
+
"aws-cdk-lib": "catalog:",
|
|
3179
|
+
"constructs": "catalog:",
|
|
3180
|
+
"tslib": "^2.3.0"
|
|
3181
|
+
},
|
|
3182
|
+
"devDependencies": {
|
|
3183
|
+
"@types/node": "catalog:"
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
"
|
|
3187
|
+
`;
|
|
3188
|
+
|
|
2689
3189
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > packages/common/constructs/project.json 1`] = `
|
|
2690
3190
|
"{
|
|
2691
3191
|
"name": "@proj/common-constructs",
|
|
@@ -2693,6 +3193,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2693
3193
|
"sourceRoot": "packages/common/constructs/src",
|
|
2694
3194
|
"projectType": "library",
|
|
2695
3195
|
"tags": [],
|
|
3196
|
+
"metadata": {
|
|
3197
|
+
"generator": "ts#project"
|
|
3198
|
+
},
|
|
2696
3199
|
"targets": {
|
|
2697
3200
|
"build": {
|
|
2698
3201
|
"dependsOn": ["lint", "compile", "test", "@proj/test-app:build"]
|
|
@@ -2701,14 +3204,31 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2701
3204
|
"executor": "nx:run-commands",
|
|
2702
3205
|
"outputs": ["{workspaceRoot}/dist/{projectRoot}/tsc"],
|
|
2703
3206
|
"options": {
|
|
2704
|
-
"command": "tsc --build tsconfig.lib.json",
|
|
2705
|
-
"cwd": "{projectRoot}"
|
|
3207
|
+
"command": "tsc --build tsconfig.lib.json",
|
|
3208
|
+
"cwd": "{projectRoot}"
|
|
3209
|
+
}
|
|
3210
|
+
},
|
|
3211
|
+
"format": {
|
|
3212
|
+
"executor": "nx:run-commands",
|
|
3213
|
+
"cache": true,
|
|
3214
|
+
"inputs": ["biome"],
|
|
3215
|
+
"options": {
|
|
3216
|
+
"command": "biome format {projectRoot}"
|
|
3217
|
+
},
|
|
3218
|
+
"configurations": {
|
|
3219
|
+
"fix": {
|
|
3220
|
+
"command": "biome format --write {projectRoot}"
|
|
3221
|
+
},
|
|
3222
|
+
"skip-lint": {
|
|
3223
|
+
"command": "node -e \\"\\""
|
|
3224
|
+
}
|
|
2706
3225
|
}
|
|
2707
3226
|
},
|
|
2708
3227
|
"lint": {
|
|
2709
3228
|
"executor": "nx:run-commands",
|
|
2710
3229
|
"cache": true,
|
|
2711
3230
|
"inputs": ["biome"],
|
|
3231
|
+
"dependsOn": ["format"],
|
|
2712
3232
|
"options": {
|
|
2713
3233
|
"command": "biome lint {projectRoot}"
|
|
2714
3234
|
},
|
|
@@ -2720,17 +3240,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2720
3240
|
"command": "node -e \\"\\""
|
|
2721
3241
|
}
|
|
2722
3242
|
}
|
|
2723
|
-
},
|
|
2724
|
-
"test": {
|
|
2725
|
-
"executor": "@nx/vitest:test",
|
|
2726
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
2727
|
-
"options": {
|
|
2728
|
-
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
2729
|
-
}
|
|
2730
3243
|
}
|
|
2731
|
-
},
|
|
2732
|
-
"metadata": {
|
|
2733
|
-
"generator": "ts#project"
|
|
2734
3244
|
}
|
|
2735
3245
|
}
|
|
2736
3246
|
"
|
|
@@ -2749,11 +3259,17 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2749
3259
|
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
3260
|
"import * as url from 'url';
|
|
2751
3261
|
import { Construct } from 'constructs';
|
|
2752
|
-
import { StaticWebsite } from '../../core/index.js';
|
|
3262
|
+
import { StaticWebsite, StaticWebsiteProps } from '../../core/index.js';
|
|
3263
|
+
|
|
3264
|
+
export type TestAppProps = Omit<
|
|
3265
|
+
StaticWebsiteProps,
|
|
3266
|
+
'websiteName' | 'websiteFilePath'
|
|
3267
|
+
>;
|
|
2753
3268
|
|
|
2754
3269
|
export class TestApp extends StaticWebsite {
|
|
2755
|
-
constructor(scope: Construct, id: string) {
|
|
3270
|
+
constructor(scope: Construct, id: string, props?: TestAppProps) {
|
|
2756
3271
|
super(scope, id, {
|
|
3272
|
+
...props,
|
|
2757
3273
|
websiteName: 'TestApp',
|
|
2758
3274
|
websiteFilePath: url.fileURLToPath(
|
|
2759
3275
|
new URL('../../../../../../dist/test-app/bundle', import.meta.url),
|
|
@@ -2841,10 +3357,31 @@ export const suppressRules = (
|
|
|
2841
3357
|
"
|
|
2842
3358
|
`;
|
|
2843
3359
|
|
|
3360
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > packages/common/constructs/src/core/cloudfront.ts 1`] = `
|
|
3361
|
+
"import { CfnDistribution, Distribution } from 'aws-cdk-lib/aws-cloudfront';
|
|
3362
|
+
|
|
3363
|
+
/**
|
|
3364
|
+
* Finds the domain names associated with a CloudFront distribution.
|
|
3365
|
+
*
|
|
3366
|
+
* Includes the distribution's default \`*.cloudfront.net\` domain name plus any custom
|
|
3367
|
+
* domain names (aliases) configured on it.
|
|
3368
|
+
*/
|
|
3369
|
+
export const findCloudFrontDomainNames = (
|
|
3370
|
+
distribution: Distribution,
|
|
3371
|
+
): string[] => {
|
|
3372
|
+
const cfnDistribution = distribution.node.defaultChild as CfnDistribution;
|
|
3373
|
+
const distributionConfig =
|
|
3374
|
+
cfnDistribution.distributionConfig as CfnDistribution.DistributionConfigProperty;
|
|
3375
|
+
return [distribution.domainName, ...(distributionConfig.aliases ?? [])];
|
|
3376
|
+
};
|
|
3377
|
+
"
|
|
3378
|
+
`;
|
|
3379
|
+
|
|
2844
3380
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > packages/common/constructs/src/core/index.ts 1`] = `
|
|
2845
3381
|
"export * from './static-website.js';
|
|
2846
3382
|
export * from './app.js';
|
|
2847
3383
|
export * from './checkov.js';
|
|
3384
|
+
export * from './cloudfront.js';
|
|
2848
3385
|
export * from './runtime-config.js';
|
|
2849
3386
|
export * from './workspace.js';
|
|
2850
3387
|
"
|
|
@@ -3040,11 +3577,21 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3040
3577
|
"import {
|
|
3041
3578
|
CfnOutput,
|
|
3042
3579
|
CfnResource,
|
|
3580
|
+
Duration,
|
|
3043
3581
|
Lazy,
|
|
3582
|
+
Names,
|
|
3044
3583
|
RemovalPolicy,
|
|
3045
3584
|
Stack,
|
|
3046
3585
|
} from 'aws-cdk-lib';
|
|
3047
|
-
import {
|
|
3586
|
+
import {
|
|
3587
|
+
Distribution,
|
|
3588
|
+
HeadersFrameOption,
|
|
3589
|
+
HeadersReferrerPolicy,
|
|
3590
|
+
ResponseHeadersPolicy,
|
|
3591
|
+
SecurityPolicyProtocol,
|
|
3592
|
+
ViewerProtocolPolicy,
|
|
3593
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
3594
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
3048
3595
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
3049
3596
|
import {
|
|
3050
3597
|
BlockPublicAccess,
|
|
@@ -3053,18 +3600,83 @@ import {
|
|
|
3053
3600
|
IBucket,
|
|
3054
3601
|
ObjectOwnership,
|
|
3055
3602
|
} from 'aws-cdk-lib/aws-s3';
|
|
3056
|
-
import {
|
|
3603
|
+
import {
|
|
3604
|
+
BucketDeployment,
|
|
3605
|
+
CacheControl,
|
|
3606
|
+
Source,
|
|
3607
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
3057
3608
|
import { Construct } from 'constructs';
|
|
3058
3609
|
import { RuntimeConfig } from './runtime-config.js';
|
|
3059
|
-
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
3610
|
+
import { IKey, Key } from 'aws-cdk-lib/aws-kms';
|
|
3611
|
+
import {
|
|
3612
|
+
CfnDelivery,
|
|
3613
|
+
CfnDeliveryDestination,
|
|
3614
|
+
CfnDeliverySource,
|
|
3615
|
+
LogGroup,
|
|
3616
|
+
RetentionDays,
|
|
3617
|
+
} from 'aws-cdk-lib/aws-logs';
|
|
3618
|
+
import { Effect, PolicyStatement, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
|
|
3060
3619
|
import { CfnWebACL } from 'aws-cdk-lib/aws-wafv2';
|
|
3061
3620
|
import { suppressRules } from './checkov.js';
|
|
3062
3621
|
|
|
3063
3622
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
3064
3623
|
|
|
3624
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
3625
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
3626
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
3627
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
3628
|
+
// connect-src to your specific origins once they are known.
|
|
3629
|
+
const CONTENT_SECURITY_POLICY = [
|
|
3630
|
+
"default-src 'self'",
|
|
3631
|
+
"script-src 'self'",
|
|
3632
|
+
"style-src 'self' 'unsafe-inline'",
|
|
3633
|
+
"img-src 'self' data:",
|
|
3634
|
+
"font-src 'self' data:",
|
|
3635
|
+
"connect-src 'self' https: wss:",
|
|
3636
|
+
"object-src 'none'",
|
|
3637
|
+
"base-uri 'self'",
|
|
3638
|
+
"frame-ancestors 'none'",
|
|
3639
|
+
].join('; ');
|
|
3640
|
+
|
|
3065
3641
|
export interface StaticWebsiteProps {
|
|
3066
3642
|
readonly websiteName: string;
|
|
3067
3643
|
readonly websiteFilePath: string;
|
|
3644
|
+
/**
|
|
3645
|
+
* Custom domain names for the CloudFront distribution. Requires \`certificate\`.
|
|
3646
|
+
*/
|
|
3647
|
+
readonly domainNames?: string[];
|
|
3648
|
+
/**
|
|
3649
|
+
* ACM certificate for the custom domain names. Must be in us-east-1.
|
|
3650
|
+
* When provided, viewers are required to use TLS 1.2 or later.
|
|
3651
|
+
*/
|
|
3652
|
+
readonly certificate?: ICertificate;
|
|
3653
|
+
/**
|
|
3654
|
+
* Whether to protect the CloudFront distribution with an AWS WAF Web ACL.
|
|
3655
|
+
*
|
|
3656
|
+
* @default true
|
|
3657
|
+
*/
|
|
3658
|
+
readonly enableWaf?: boolean;
|
|
3659
|
+
/**
|
|
3660
|
+
* Server-side encryption for the website and distribution log buckets.
|
|
3661
|
+
*
|
|
3662
|
+
* @default BucketEncryption.KMS
|
|
3663
|
+
*/
|
|
3664
|
+
readonly encryption?: BucketEncryption;
|
|
3665
|
+
/**
|
|
3666
|
+
* KMS key used to encrypt the website and distribution log buckets. Only used when \`encryption\` is
|
|
3667
|
+
* \`BucketEncryption.KMS\`. When not provided, a new key is created. Note that a key imported via
|
|
3668
|
+
* \`Key.fromKeyArn\` must already grant the CloudWatch Logs, S3 and CloudFront service principals the
|
|
3669
|
+
* necessary permissions in its own key policy - \`addToResourcePolicy\` is a no-op on an imported key,
|
|
3670
|
+
* so this construct cannot grant them on your behalf.
|
|
3671
|
+
*/
|
|
3672
|
+
readonly encryptionKey?: IKey;
|
|
3673
|
+
/**
|
|
3674
|
+
* Whether the automatically created KMS key has rotation enabled. Only applies when \`encryption\` is
|
|
3675
|
+
* \`BucketEncryption.KMS\` and no \`encryptionKey\` is supplied.
|
|
3676
|
+
*
|
|
3677
|
+
* @default true
|
|
3678
|
+
*/
|
|
3679
|
+
readonly enableKeyRotation?: boolean;
|
|
3068
3680
|
}
|
|
3069
3681
|
|
|
3070
3682
|
/**
|
|
@@ -3083,39 +3695,53 @@ export class StaticWebsite extends Construct {
|
|
|
3083
3695
|
constructor(
|
|
3084
3696
|
scope: Construct,
|
|
3085
3697
|
id: string,
|
|
3086
|
-
{
|
|
3698
|
+
{
|
|
3699
|
+
websiteFilePath,
|
|
3700
|
+
websiteName,
|
|
3701
|
+
domainNames,
|
|
3702
|
+
certificate,
|
|
3703
|
+
enableWaf = true,
|
|
3704
|
+
encryption = BucketEncryption.KMS,
|
|
3705
|
+
encryptionKey,
|
|
3706
|
+
enableKeyRotation = true,
|
|
3707
|
+
}: StaticWebsiteProps,
|
|
3087
3708
|
) {
|
|
3088
3709
|
super(scope, id);
|
|
3089
|
-
this.node.setContext(
|
|
3090
|
-
'@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy',
|
|
3091
|
-
true,
|
|
3092
|
-
);
|
|
3093
3710
|
|
|
3094
|
-
const websiteKey
|
|
3095
|
-
|
|
3096
|
-
|
|
3711
|
+
const websiteKey: IKey | undefined =
|
|
3712
|
+
encryption === BucketEncryption.KMS
|
|
3713
|
+
? (encryptionKey ?? new Key(this, 'WebsiteKey', { enableKeyRotation }))
|
|
3714
|
+
: undefined;
|
|
3715
|
+
|
|
3716
|
+
// Allow CloudWatch Logs to use the website key for server access log delivery.
|
|
3717
|
+
const stack = Stack.of(this);
|
|
3718
|
+
websiteKey?.addToResourcePolicy(
|
|
3719
|
+
new PolicyStatement({
|
|
3720
|
+
effect: Effect.ALLOW,
|
|
3721
|
+
principals: [
|
|
3722
|
+
new ServicePrincipal(\`logs.\${stack.region}.amazonaws.com\`),
|
|
3723
|
+
],
|
|
3724
|
+
actions: [
|
|
3725
|
+
'kms:Encrypt',
|
|
3726
|
+
'kms:Decrypt',
|
|
3727
|
+
'kms:ReEncrypt*',
|
|
3728
|
+
'kms:GenerateDataKey*',
|
|
3729
|
+
'kms:DescribeKey',
|
|
3730
|
+
],
|
|
3731
|
+
resources: ['*'],
|
|
3732
|
+
conditions: {
|
|
3733
|
+
ArnLike: {
|
|
3734
|
+
'kms:EncryptionContext:aws:logs:arn': \`arn:aws:logs:\${stack.region}:\${stack.account}:log-group:*\`,
|
|
3735
|
+
},
|
|
3736
|
+
},
|
|
3737
|
+
}),
|
|
3738
|
+
);
|
|
3097
3739
|
|
|
3098
|
-
const
|
|
3099
|
-
|
|
3100
|
-
enforceSSL: true,
|
|
3101
|
-
autoDeleteObjects: true,
|
|
3102
|
-
removalPolicy: RemovalPolicy.DESTROY,
|
|
3103
|
-
encryption: BucketEncryption.KMS,
|
|
3740
|
+
const accessLogs = new LogGroup(this, 'AccessLogs', {
|
|
3741
|
+
retention: RetentionDays.ONE_YEAR,
|
|
3104
3742
|
encryptionKey: websiteKey,
|
|
3105
|
-
|
|
3106
|
-
publicReadAccess: false,
|
|
3107
|
-
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
3743
|
+
removalPolicy: RemovalPolicy.DESTROY,
|
|
3108
3744
|
});
|
|
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
3745
|
|
|
3120
3746
|
// S3 Bucket to hold website files
|
|
3121
3747
|
this.websiteBucket = new Bucket(this, 'WebsiteBucket', {
|
|
@@ -3123,47 +3749,99 @@ export class StaticWebsite extends Construct {
|
|
|
3123
3749
|
enforceSSL: true,
|
|
3124
3750
|
autoDeleteObjects: true,
|
|
3125
3751
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
3126
|
-
encryption
|
|
3752
|
+
encryption,
|
|
3127
3753
|
encryptionKey: websiteKey,
|
|
3128
3754
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_ENFORCED,
|
|
3129
3755
|
publicReadAccess: false,
|
|
3130
3756
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
3131
|
-
serverAccessLogsPrefix: 'website-access-logs',
|
|
3132
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
3133
3757
|
});
|
|
3758
|
+
suppressRules(
|
|
3759
|
+
this.websiteBucket,
|
|
3760
|
+
['CKV_AWS_18'],
|
|
3761
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
3762
|
+
);
|
|
3763
|
+
this.deliverAccessLogsToCloudWatch(
|
|
3764
|
+
'Website',
|
|
3765
|
+
this.websiteBucket,
|
|
3766
|
+
accessLogs,
|
|
3767
|
+
);
|
|
3134
3768
|
// Web ACL
|
|
3135
|
-
const wafStack = new CloudfrontWebAcl(this, 'waf');
|
|
3769
|
+
const wafStack = enableWaf ? new CloudfrontWebAcl(this, 'waf') : undefined;
|
|
3136
3770
|
|
|
3137
|
-
//
|
|
3771
|
+
// Bucket holding CloudFront standard access logs. CloudFront delivers its
|
|
3772
|
+
// own logs to S3 only, so this bucket is retained; its S3 server access
|
|
3773
|
+
// logs are delivered to CloudWatch Logs.
|
|
3138
3774
|
const logBucket = new Bucket(this, 'DistributionLogBucket', {
|
|
3139
3775
|
enforceSSL: true,
|
|
3140
3776
|
autoDeleteObjects: true,
|
|
3141
3777
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
3142
|
-
encryption
|
|
3778
|
+
encryption,
|
|
3143
3779
|
encryptionKey: websiteKey,
|
|
3144
3780
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_PREFERRED,
|
|
3145
3781
|
publicReadAccess: false,
|
|
3146
3782
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
3147
|
-
serverAccessLogsPrefix: 'distribution-access-logs',
|
|
3148
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
3149
3783
|
});
|
|
3150
3784
|
suppressRules(
|
|
3151
3785
|
logBucket,
|
|
3152
3786
|
['CKV_AWS_21'],
|
|
3153
3787
|
'Distribution log bucket does not need versioning enabled',
|
|
3154
3788
|
);
|
|
3789
|
+
suppressRules(
|
|
3790
|
+
logBucket,
|
|
3791
|
+
['CKV_AWS_18'],
|
|
3792
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
3793
|
+
);
|
|
3794
|
+
this.deliverAccessLogsToCloudWatch('Distribution', logBucket, accessLogs);
|
|
3795
|
+
|
|
3796
|
+
// Security headers applied to all responses.
|
|
3797
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
3798
|
+
this,
|
|
3799
|
+
'ResponseHeadersPolicy',
|
|
3800
|
+
{
|
|
3801
|
+
securityHeadersBehavior: {
|
|
3802
|
+
strictTransportSecurity: {
|
|
3803
|
+
accessControlMaxAge: Duration.days(730),
|
|
3804
|
+
includeSubdomains: true,
|
|
3805
|
+
preload: true,
|
|
3806
|
+
override: true,
|
|
3807
|
+
},
|
|
3808
|
+
contentTypeOptions: { override: true },
|
|
3809
|
+
frameOptions: {
|
|
3810
|
+
frameOption: HeadersFrameOption.DENY,
|
|
3811
|
+
override: true,
|
|
3812
|
+
},
|
|
3813
|
+
referrerPolicy: {
|
|
3814
|
+
referrerPolicy:
|
|
3815
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
3816
|
+
override: true,
|
|
3817
|
+
},
|
|
3818
|
+
contentSecurityPolicy: {
|
|
3819
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
3820
|
+
override: true,
|
|
3821
|
+
},
|
|
3822
|
+
},
|
|
3823
|
+
},
|
|
3824
|
+
);
|
|
3155
3825
|
|
|
3156
3826
|
const defaultRootObject = 'index.html';
|
|
3157
3827
|
this.cloudFrontDistribution = new Distribution(
|
|
3158
3828
|
this,
|
|
3159
3829
|
'CloudfrontDistribution',
|
|
3160
3830
|
{
|
|
3161
|
-
webAclId: wafStack
|
|
3831
|
+
webAclId: wafStack?.wafArn,
|
|
3162
3832
|
enableLogging: true,
|
|
3163
3833
|
logBucket: logBucket,
|
|
3834
|
+
...(certificate
|
|
3835
|
+
? {
|
|
3836
|
+
certificate,
|
|
3837
|
+
domainNames,
|
|
3838
|
+
minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
3839
|
+
}
|
|
3840
|
+
: {}),
|
|
3164
3841
|
defaultBehavior: {
|
|
3165
3842
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
3166
3843
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
3844
|
+
responseHeadersPolicy,
|
|
3167
3845
|
},
|
|
3168
3846
|
defaultRootObject,
|
|
3169
3847
|
errorResponses: [
|
|
@@ -3180,16 +3858,31 @@ export class StaticWebsite extends Construct {
|
|
|
3180
3858
|
],
|
|
3181
3859
|
},
|
|
3182
3860
|
);
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3861
|
+
if (!certificate) {
|
|
3862
|
+
// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
3863
|
+
suppressRules(
|
|
3864
|
+
this.cloudFrontDistribution,
|
|
3865
|
+
['CKV_AWS_174'],
|
|
3866
|
+
'Cloudfront default certificate does not use TLS 1.2',
|
|
3867
|
+
);
|
|
3868
|
+
}
|
|
3188
3869
|
|
|
3189
3870
|
// Deploy Website
|
|
3190
3871
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
3872
|
+
sources: [Source.asset(websiteFilePath)],
|
|
3873
|
+
destinationBucket: this.websiteBucket,
|
|
3874
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
3875
|
+
distribution: this.cloudFrontDistribution,
|
|
3876
|
+
// Exclude the runtime config from this deployment's sync so its default pruning
|
|
3877
|
+
// never deletes the file managed separately by RuntimeConfigDeployment below.
|
|
3878
|
+
exclude: [DEFAULT_RUNTIME_CONFIG_FILENAME],
|
|
3879
|
+
memoryLimit: 1024,
|
|
3880
|
+
});
|
|
3881
|
+
|
|
3882
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
3883
|
+
// must always fetch the latest configuration.
|
|
3884
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
3191
3885
|
sources: [
|
|
3192
|
-
Source.asset(websiteFilePath),
|
|
3193
3886
|
Source.data(
|
|
3194
3887
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
3195
3888
|
Lazy.string({
|
|
@@ -3201,8 +3894,9 @@ export class StaticWebsite extends Construct {
|
|
|
3201
3894
|
),
|
|
3202
3895
|
],
|
|
3203
3896
|
destinationBucket: this.websiteBucket,
|
|
3204
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
3205
3897
|
distribution: this.cloudFrontDistribution,
|
|
3898
|
+
cacheControl: [CacheControl.noCache()],
|
|
3899
|
+
prune: false,
|
|
3206
3900
|
memoryLimit: 1024,
|
|
3207
3901
|
});
|
|
3208
3902
|
|
|
@@ -3223,6 +3917,48 @@ export class StaticWebsite extends Construct {
|
|
|
3223
3917
|
value: this.websiteBucket.bucketName,
|
|
3224
3918
|
});
|
|
3225
3919
|
}
|
|
3920
|
+
|
|
3921
|
+
/**
|
|
3922
|
+
* Delivers a bucket's S3 server access logs to a CloudWatch log group using
|
|
3923
|
+
* CloudWatch Logs vended log delivery.
|
|
3924
|
+
*/
|
|
3925
|
+
private deliverAccessLogsToCloudWatch(
|
|
3926
|
+
id: string,
|
|
3927
|
+
bucket: IBucket,
|
|
3928
|
+
logGroup: LogGroup,
|
|
3929
|
+
) {
|
|
3930
|
+
const source: CfnDeliverySource = new CfnDeliverySource(
|
|
3931
|
+
this,
|
|
3932
|
+
\`\${id}AccessLogsSource\`,
|
|
3933
|
+
{
|
|
3934
|
+
name: Lazy.string({
|
|
3935
|
+
produce: () => Names.uniqueResourceName(source, { maxLength: 60 }),
|
|
3936
|
+
}),
|
|
3937
|
+
logType: 'S3_SERVER_ACCESS_LOGS',
|
|
3938
|
+
resourceArn: bucket.bucketArn,
|
|
3939
|
+
},
|
|
3940
|
+
);
|
|
3941
|
+
const bucketPolicy = (bucket as Bucket).policy;
|
|
3942
|
+
if (bucketPolicy) {
|
|
3943
|
+
source.node.addDependency(bucketPolicy);
|
|
3944
|
+
}
|
|
3945
|
+
const destination: CfnDeliveryDestination = new CfnDeliveryDestination(
|
|
3946
|
+
this,
|
|
3947
|
+
\`\${id}AccessLogsDestination\`,
|
|
3948
|
+
{
|
|
3949
|
+
name: Lazy.string({
|
|
3950
|
+
produce: () =>
|
|
3951
|
+
Names.uniqueResourceName(destination, { maxLength: 60 }),
|
|
3952
|
+
}),
|
|
3953
|
+
destinationResourceArn: logGroup.logGroupArn,
|
|
3954
|
+
},
|
|
3955
|
+
);
|
|
3956
|
+
const delivery = new CfnDelivery(this, \`\${id}AccessLogsDelivery\`, {
|
|
3957
|
+
deliverySourceName: source.name,
|
|
3958
|
+
deliveryDestinationArn: destination.attrArn,
|
|
3959
|
+
});
|
|
3960
|
+
delivery.addDependency(source);
|
|
3961
|
+
}
|
|
3226
3962
|
}
|
|
3227
3963
|
|
|
3228
3964
|
export class CloudfrontWebAcl extends Stack {
|
|
@@ -3345,9 +4081,13 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3345
4081
|
"emitDeclarationOnly": false,
|
|
3346
4082
|
"module": "nodenext",
|
|
3347
4083
|
"moduleResolution": "nodenext",
|
|
3348
|
-
"types": [
|
|
4084
|
+
"types": [
|
|
4085
|
+
"node"
|
|
4086
|
+
]
|
|
3349
4087
|
},
|
|
3350
|
-
"include": [
|
|
4088
|
+
"include": [
|
|
4089
|
+
"src/**/*.ts"
|
|
4090
|
+
],
|
|
3351
4091
|
"references": [],
|
|
3352
4092
|
"exclude": [
|
|
3353
4093
|
"vite.config.ts",
|
|
@@ -3410,7 +4150,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3410
4150
|
"import { defineConfig } from 'vitest/config';
|
|
3411
4151
|
|
|
3412
4152
|
export default defineConfig(() => ({
|
|
3413
|
-
root:
|
|
4153
|
+
root: import.meta.dirname,
|
|
3414
4154
|
cacheDir: '../../../node_modules/.vite/packages/common/constructs',
|
|
3415
4155
|
test: {
|
|
3416
4156
|
passWithNoTests: true,
|
|
@@ -3431,9 +4171,30 @@ export default defineConfig(() => ({
|
|
|
3431
4171
|
|
|
3432
4172
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > pnpm-workspace.yaml 1`] = `
|
|
3433
4173
|
"packages:
|
|
3434
|
-
-
|
|
3435
|
-
-
|
|
3436
|
-
-
|
|
4174
|
+
- packages/*
|
|
4175
|
+
- test-app
|
|
4176
|
+
- packages/common/*
|
|
4177
|
+
catalog:
|
|
4178
|
+
vite: 8.2.1
|
|
4179
|
+
vitest: 4.1.10
|
|
4180
|
+
'@vitest/coverage-v8': 4.1.10
|
|
4181
|
+
constructs: 10.8.1
|
|
4182
|
+
aws-cdk-lib: 2.265.0
|
|
4183
|
+
'@types/node': 26.2.0
|
|
4184
|
+
react: 19.2.8
|
|
4185
|
+
react-dom: 19.2.8
|
|
4186
|
+
'@cloudscape-design/components': 3.0.1347
|
|
4187
|
+
'@cloudscape-design/board-components': 3.0.218
|
|
4188
|
+
'@cloudscape-design/global-styles': 1.0.66
|
|
4189
|
+
tailwindcss: 4.3.3
|
|
4190
|
+
'@tanstack/react-router': 1.170.29
|
|
4191
|
+
'@nx/react': 23.1.1
|
|
4192
|
+
'@vitest/ui': 4.1.10
|
|
4193
|
+
'@tailwindcss/vite': 4.3.3
|
|
4194
|
+
'@tanstack/router-plugin': 1.168.32
|
|
4195
|
+
'@tanstack/router-generator': 1.167.30
|
|
4196
|
+
'@tanstack/virtual-file-routes': 1.162.0
|
|
4197
|
+
'@tanstack/router-utils': 1.162.2
|
|
3437
4198
|
"
|
|
3438
4199
|
`;
|
|
3439
4200
|
|
|
@@ -3473,7 +4234,7 @@ You can also automatically fix some lint errors by running the following command
|
|
|
3473
4234
|
|
|
3474
4235
|
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
4236
|
|
|
3476
|
-
\`pnpm nx
|
|
4237
|
+
\`pnpm nx load-runtime-config @proj/test-app\`
|
|
3477
4238
|
|
|
3478
4239
|
> [!IMPORTANT]
|
|
3479
4240
|
> Ensure you have AWS CLI and curl installed
|
|
@@ -3507,6 +4268,26 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3507
4268
|
"
|
|
3508
4269
|
`;
|
|
3509
4270
|
|
|
4271
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > test-app/package.json 1`] = `
|
|
4272
|
+
"{
|
|
4273
|
+
"name": "@proj/test-app",
|
|
4274
|
+
"version": "0.0.1",
|
|
4275
|
+
"private": true,
|
|
4276
|
+
"type": "module",
|
|
4277
|
+
"dependencies": {
|
|
4278
|
+
"@cloudscape-design/board-components": "catalog:",
|
|
4279
|
+
"@cloudscape-design/components": "catalog:",
|
|
4280
|
+
"@cloudscape-design/global-styles": "catalog:",
|
|
4281
|
+
"@tanstack/react-router": "catalog:",
|
|
4282
|
+
"react": "catalog:",
|
|
4283
|
+
"react-dom": "catalog:",
|
|
4284
|
+
"tailwindcss": "catalog:"
|
|
4285
|
+
},
|
|
4286
|
+
"devDependencies": {}
|
|
4287
|
+
}
|
|
4288
|
+
"
|
|
4289
|
+
`;
|
|
4290
|
+
|
|
3510
4291
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > test-app/project.json 1`] = `
|
|
3511
4292
|
"{
|
|
3512
4293
|
"name": "@proj/test-app",
|
|
@@ -3518,33 +4299,17 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3518
4299
|
"generator": "ts#react-website",
|
|
3519
4300
|
"ux": "cloudscape",
|
|
3520
4301
|
"framework": "react",
|
|
3521
|
-
"infra": "cloudfront-s3"
|
|
4302
|
+
"infra": "cloudfront-s3",
|
|
4303
|
+
"tailwind": true,
|
|
4304
|
+
"tanstackRouter": true,
|
|
4305
|
+
"iac": "cdk"
|
|
3522
4306
|
},
|
|
3523
4307
|
"targets": {
|
|
3524
4308
|
"build": {
|
|
3525
|
-
"dependsOn": ["lint", "compile", "
|
|
3526
|
-
"options": {
|
|
3527
|
-
"outputPath": "dist/{projectRoot}/bundle"
|
|
3528
|
-
}
|
|
3529
|
-
},
|
|
3530
|
-
"bundle": {
|
|
3531
|
-
"executor": "@nx/vite:build",
|
|
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
|
-
}
|
|
4309
|
+
"dependsOn": ["lint", "compile", "test", "bundle"]
|
|
3545
4310
|
},
|
|
3546
4311
|
"compile": {
|
|
3547
|
-
"dependsOn": ["
|
|
4312
|
+
"dependsOn": ["^build"],
|
|
3548
4313
|
"executor": "nx:run-commands",
|
|
3549
4314
|
"outputs": ["{workspaceRoot}/dist/{projectRoot}/tsc"],
|
|
3550
4315
|
"options": {
|
|
@@ -3552,72 +4317,30 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3552
4317
|
"cwd": "{projectRoot}"
|
|
3553
4318
|
}
|
|
3554
4319
|
},
|
|
3555
|
-
"
|
|
4320
|
+
"dev": {
|
|
3556
4321
|
"executor": "nx:run-commands",
|
|
3557
|
-
"
|
|
3558
|
-
"description": "Load runtime config from your deployed stack for dev purposes. You must set your AWS CLI credentials whilst calling 'pnpm nx run @proj/test-app:load:runtime-config'"
|
|
3559
|
-
},
|
|
3560
|
-
"options": {
|
|
3561
|
-
"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\\""
|
|
3562
|
-
}
|
|
3563
|
-
},
|
|
3564
|
-
"preview": {
|
|
3565
|
-
"dependsOn": ["build"],
|
|
3566
|
-
"executor": "@nx/vite:preview-server",
|
|
3567
|
-
"defaultConfiguration": "development",
|
|
4322
|
+
"continuous": true,
|
|
3568
4323
|
"options": {
|
|
3569
|
-
"
|
|
3570
|
-
|
|
3571
|
-
"configurations": {
|
|
3572
|
-
"development": {
|
|
3573
|
-
"buildTarget": "@proj/test-app:build:development"
|
|
3574
|
-
},
|
|
3575
|
-
"production": {
|
|
3576
|
-
"buildTarget": "@proj/test-app:build:production"
|
|
3577
|
-
}
|
|
4324
|
+
"command": "vite --mode local-dev",
|
|
4325
|
+
"cwd": "{projectRoot}"
|
|
3578
4326
|
}
|
|
3579
4327
|
},
|
|
3580
|
-
"
|
|
3581
|
-
"executor": "
|
|
3582
|
-
"
|
|
4328
|
+
"format": {
|
|
4329
|
+
"executor": "nx:run-commands",
|
|
4330
|
+
"cache": true,
|
|
4331
|
+
"inputs": ["biome"],
|
|
3583
4332
|
"options": {
|
|
3584
|
-
"
|
|
4333
|
+
"command": "biome format {projectRoot}"
|
|
3585
4334
|
},
|
|
3586
4335
|
"configurations": {
|
|
3587
|
-
"
|
|
3588
|
-
"
|
|
3589
|
-
"hmr": true
|
|
4336
|
+
"fix": {
|
|
4337
|
+
"command": "biome format --write {projectRoot}"
|
|
3590
4338
|
},
|
|
3591
|
-
"
|
|
3592
|
-
"
|
|
3593
|
-
"hmr": false
|
|
4339
|
+
"skip-lint": {
|
|
4340
|
+
"command": "node -e \\"\\""
|
|
3594
4341
|
}
|
|
3595
4342
|
}
|
|
3596
4343
|
},
|
|
3597
|
-
"serve-local": {
|
|
3598
|
-
"executor": "@nx/vite:dev-server",
|
|
3599
|
-
"options": {
|
|
3600
|
-
"buildTarget": "@proj/test-app:build:development",
|
|
3601
|
-
"hmr": true,
|
|
3602
|
-
"mode": "serve-local"
|
|
3603
|
-
},
|
|
3604
|
-
"continuous": true
|
|
3605
|
-
},
|
|
3606
|
-
"serve-static": {
|
|
3607
|
-
"executor": "@nx/web:file-server",
|
|
3608
|
-
"dependsOn": ["build"],
|
|
3609
|
-
"options": {
|
|
3610
|
-
"buildTarget": "@proj/test-app:build",
|
|
3611
|
-
"spa": true
|
|
3612
|
-
}
|
|
3613
|
-
},
|
|
3614
|
-
"test": {
|
|
3615
|
-
"executor": "@nx/vitest:test",
|
|
3616
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
3617
|
-
"options": {
|
|
3618
|
-
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
3619
|
-
}
|
|
3620
|
-
},
|
|
3621
4344
|
"lint": {
|
|
3622
4345
|
"executor": "nx:run-commands",
|
|
3623
4346
|
"cache": true,
|
|
@@ -3632,6 +4355,16 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3632
4355
|
"skip-lint": {
|
|
3633
4356
|
"command": "node -e \\"\\""
|
|
3634
4357
|
}
|
|
4358
|
+
},
|
|
4359
|
+
"dependsOn": ["format"]
|
|
4360
|
+
},
|
|
4361
|
+
"load-runtime-config": {
|
|
4362
|
+
"executor": "nx:run-commands",
|
|
4363
|
+
"metadata": {
|
|
4364
|
+
"description": "Load runtime config from your deployed stack for dev purposes. You must set your AWS CLI credentials whilst calling 'pnpm nx load-runtime-config @proj/test-app'"
|
|
4365
|
+
},
|
|
4366
|
+
"options": {
|
|
4367
|
+
"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
4368
|
}
|
|
3636
4369
|
}
|
|
3637
4370
|
}
|
|
@@ -3917,55 +4650,55 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3917
4650
|
// You should NOT make any changes in this file as it will be overwritten.
|
|
3918
4651
|
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
3919
4652
|
|
|
3920
|
-
import { Route as rootRouteImport } from './routes/__root'
|
|
3921
|
-
import { Route as IndexRouteImport } from './routes/index'
|
|
4653
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
4654
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
3922
4655
|
|
|
3923
4656
|
const IndexRoute = IndexRouteImport.update({
|
|
3924
4657
|
id: '/',
|
|
3925
4658
|
path: '/',
|
|
3926
4659
|
getParentRoute: () => rootRouteImport,
|
|
3927
|
-
} as any)
|
|
4660
|
+
} as any)
|
|
3928
4661
|
|
|
3929
4662
|
export interface FileRoutesByFullPath {
|
|
3930
|
-
'/': typeof IndexRoute
|
|
4663
|
+
'/': typeof IndexRoute
|
|
3931
4664
|
}
|
|
3932
4665
|
export interface FileRoutesByTo {
|
|
3933
|
-
'/': typeof IndexRoute
|
|
4666
|
+
'/': typeof IndexRoute
|
|
3934
4667
|
}
|
|
3935
4668
|
export interface FileRoutesById {
|
|
3936
|
-
__root__: typeof rootRouteImport
|
|
3937
|
-
'/': typeof IndexRoute
|
|
4669
|
+
__root__: typeof rootRouteImport
|
|
4670
|
+
'/': typeof IndexRoute
|
|
3938
4671
|
}
|
|
3939
4672
|
export interface FileRouteTypes {
|
|
3940
|
-
fileRoutesByFullPath: FileRoutesByFullPath
|
|
3941
|
-
fullPaths: '/'
|
|
3942
|
-
fileRoutesByTo: FileRoutesByTo
|
|
3943
|
-
to: '/'
|
|
3944
|
-
id: '__root__' | '/'
|
|
3945
|
-
fileRoutesById: FileRoutesById
|
|
4673
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
4674
|
+
fullPaths: '/'
|
|
4675
|
+
fileRoutesByTo: FileRoutesByTo
|
|
4676
|
+
to: '/'
|
|
4677
|
+
id: '__root__' | '/'
|
|
4678
|
+
fileRoutesById: FileRoutesById
|
|
3946
4679
|
}
|
|
3947
4680
|
export interface RootRouteChildren {
|
|
3948
|
-
IndexRoute: typeof IndexRoute
|
|
4681
|
+
IndexRoute: typeof IndexRoute
|
|
3949
4682
|
}
|
|
3950
4683
|
|
|
3951
4684
|
declare module '@tanstack/react-router' {
|
|
3952
4685
|
interface FileRoutesByPath {
|
|
3953
4686
|
'/': {
|
|
3954
|
-
id: '/'
|
|
3955
|
-
path: '/'
|
|
3956
|
-
fullPath: '/'
|
|
3957
|
-
preLoaderRoute: typeof IndexRouteImport
|
|
3958
|
-
parentRoute: typeof rootRouteImport
|
|
3959
|
-
}
|
|
4687
|
+
id: '/'
|
|
4688
|
+
path: '/'
|
|
4689
|
+
fullPath: '/'
|
|
4690
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
4691
|
+
parentRoute: typeof rootRouteImport
|
|
4692
|
+
}
|
|
3960
4693
|
}
|
|
3961
4694
|
}
|
|
3962
4695
|
|
|
3963
4696
|
const rootRouteChildren: RootRouteChildren = {
|
|
3964
4697
|
IndexRoute: IndexRoute,
|
|
3965
|
-
}
|
|
4698
|
+
}
|
|
3966
4699
|
export const routeTree = rootRouteImport
|
|
3967
4700
|
._addFileChildren(rootRouteChildren)
|
|
3968
|
-
._addFileTypes<FileRouteTypes>()
|
|
4701
|
+
._addFileTypes<FileRouteTypes>()
|
|
3969
4702
|
"
|
|
3970
4703
|
`;
|
|
3971
4704
|
|
|
@@ -4023,15 +4756,22 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4023
4756
|
"outDir": "../dist/test-app/tsc",
|
|
4024
4757
|
"tsBuildInfoFile": "../dist/test-app/tsc/tsconfig.lib.tsbuildinfo",
|
|
4025
4758
|
"jsx": "react-jsx",
|
|
4026
|
-
"lib": [
|
|
4759
|
+
"lib": [
|
|
4760
|
+
"DOM"
|
|
4761
|
+
],
|
|
4027
4762
|
"types": [
|
|
4028
4763
|
"node",
|
|
4029
4764
|
"@nx/react/typings/cssmodule.d.ts",
|
|
4030
4765
|
"@nx/react/typings/image.d.ts",
|
|
4031
4766
|
"vite/client"
|
|
4032
|
-
]
|
|
4767
|
+
],
|
|
4768
|
+
"rootDir": "src",
|
|
4769
|
+
"module": "esnext",
|
|
4770
|
+
"moduleResolution": "bundler"
|
|
4033
4771
|
},
|
|
4034
4772
|
"exclude": [
|
|
4773
|
+
"out-tsc",
|
|
4774
|
+
"dist",
|
|
4035
4775
|
"src/**/*.spec.ts",
|
|
4036
4776
|
"src/**/*.test.ts",
|
|
4037
4777
|
"src/**/*.spec.tsx",
|
|
@@ -4045,7 +4785,12 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4045
4785
|
"vitest.config.ts",
|
|
4046
4786
|
"vitest.config.mts"
|
|
4047
4787
|
],
|
|
4048
|
-
"include": [
|
|
4788
|
+
"include": [
|
|
4789
|
+
"src/**/*.js",
|
|
4790
|
+
"src/**/*.jsx",
|
|
4791
|
+
"src/**/*.ts",
|
|
4792
|
+
"src/**/*.tsx"
|
|
4793
|
+
]
|
|
4049
4794
|
}
|
|
4050
4795
|
"
|
|
4051
4796
|
`;
|
|
@@ -4084,7 +4829,10 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4084
4829
|
"vitest",
|
|
4085
4830
|
"@nx/react/typings/cssmodule.d.ts",
|
|
4086
4831
|
"@nx/react/typings/image.d.ts"
|
|
4087
|
-
]
|
|
4832
|
+
],
|
|
4833
|
+
"jsx": "react-jsx",
|
|
4834
|
+
"module": "esnext",
|
|
4835
|
+
"moduleResolution": "bundler"
|
|
4088
4836
|
},
|
|
4089
4837
|
"include": [
|
|
4090
4838
|
"vite.config.ts",
|
|
@@ -4131,8 +4879,8 @@ export default defineConfig(() => ({
|
|
|
4131
4879
|
},
|
|
4132
4880
|
plugins: [
|
|
4133
4881
|
tanstackRouter({
|
|
4134
|
-
routesDirectory: resolve(
|
|
4135
|
-
generatedRouteTree: resolve(
|
|
4882
|
+
routesDirectory: resolve(import.meta.dirname, 'src/routes'),
|
|
4883
|
+
generatedRouteTree: resolve(import.meta.dirname, 'src/routeTree.gen.ts'),
|
|
4136
4884
|
}),
|
|
4137
4885
|
react(),
|
|
4138
4886
|
tailwindcss(),
|
|
@@ -4142,7 +4890,7 @@ export default defineConfig(() => ({
|
|
|
4142
4890
|
// plugins: [],
|
|
4143
4891
|
// },
|
|
4144
4892
|
build: {
|
|
4145
|
-
outDir: '../dist/test-app',
|
|
4893
|
+
outDir: '../dist/test-app/bundle',
|
|
4146
4894
|
emptyOutDir: true,
|
|
4147
4895
|
reportCompressedSize: true,
|
|
4148
4896
|
commonjsOptions: {
|
|
@@ -4162,7 +4910,7 @@ export default defineConfig(() => ({
|
|
|
4162
4910
|
provider: 'v8' as const,
|
|
4163
4911
|
},
|
|
4164
4912
|
},
|
|
4165
|
-
resolve: { tsconfigPaths: true },
|
|
4913
|
+
resolve: { tsconfigPaths: true, dedupe: ['react', 'react-dom'] },
|
|
4166
4914
|
define: { global: {} },
|
|
4167
4915
|
}));
|
|
4168
4916
|
"
|
|
@@ -4172,9 +4920,14 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4172
4920
|
"{
|
|
4173
4921
|
"compilerOptions": {
|
|
4174
4922
|
"paths": {
|
|
4175
|
-
"
|
|
4176
|
-
|
|
4923
|
+
"@proj/test-app": [
|
|
4924
|
+
"./test-app/src/index.ts"
|
|
4925
|
+
],
|
|
4926
|
+
"@proj/common-constructs": [
|
|
4927
|
+
"./packages/common/constructs/src/index.ts"
|
|
4928
|
+
]
|
|
4177
4929
|
},
|
|
4930
|
+
"composite": true,
|
|
4178
4931
|
"rootDir": "."
|
|
4179
4932
|
}
|
|
4180
4933
|
}
|
|
@@ -4183,6 +4936,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4183
4936
|
|
|
4184
4937
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > tsconfig.json 1`] = `
|
|
4185
4938
|
"{
|
|
4939
|
+
"extends": "./tsconfig.base.json",
|
|
4940
|
+
"files": [],
|
|
4941
|
+
"include": [],
|
|
4186
4942
|
"references": [
|
|
4187
4943
|
{
|
|
4188
4944
|
"path": "./test-app"
|
|
@@ -4195,11 +4951,19 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4195
4951
|
"
|
|
4196
4952
|
`;
|
|
4197
4953
|
|
|
4198
|
-
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > vitest.
|
|
4199
|
-
"
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4954
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > vitest.config.ts 1`] = `
|
|
4955
|
+
"import { defineConfig } from 'vitest/config';
|
|
4956
|
+
|
|
4957
|
+
export default defineConfig({
|
|
4958
|
+
test: {
|
|
4959
|
+
projects: [
|
|
4960
|
+
'**/vite.config.{mjs,js,ts,mts}',
|
|
4961
|
+
'**/vitest.config.{mjs,js,ts,mts}',
|
|
4962
|
+
'!vitest.config.{mjs,js,ts,mts}',
|
|
4963
|
+
'!vite.config.{mjs,js,ts,mts}',
|
|
4964
|
+
],
|
|
4965
|
+
},
|
|
4966
|
+
});
|
|
4203
4967
|
"
|
|
4204
4968
|
`;
|
|
4205
4969
|
|
|
@@ -4244,8 +5008,8 @@ export default defineConfig(() => ({
|
|
|
4244
5008
|
},
|
|
4245
5009
|
plugins: [
|
|
4246
5010
|
tanstackRouter({
|
|
4247
|
-
routesDirectory: resolve(
|
|
4248
|
-
generatedRouteTree: resolve(
|
|
5011
|
+
routesDirectory: resolve(import.meta.dirname, 'src/routes'),
|
|
5012
|
+
generatedRouteTree: resolve(import.meta.dirname, 'src/routeTree.gen.ts'),
|
|
4249
5013
|
}),
|
|
4250
5014
|
react(),
|
|
4251
5015
|
tailwindcss(),
|
|
@@ -4255,7 +5019,7 @@ export default defineConfig(() => ({
|
|
|
4255
5019
|
// plugins: [],
|
|
4256
5020
|
// },
|
|
4257
5021
|
build: {
|
|
4258
|
-
outDir: '../dist/test-app',
|
|
5022
|
+
outDir: '../dist/test-app/bundle',
|
|
4259
5023
|
emptyOutDir: true,
|
|
4260
5024
|
reportCompressedSize: true,
|
|
4261
5025
|
commonjsOptions: {
|
|
@@ -4275,7 +5039,7 @@ export default defineConfig(() => ({
|
|
|
4275
5039
|
provider: 'v8' as const,
|
|
4276
5040
|
},
|
|
4277
5041
|
},
|
|
4278
|
-
resolve: { tsconfigPaths: true },
|
|
5042
|
+
resolve: { tsconfigPaths: true, dedupe: ['react', 'react-dom'] },
|
|
4279
5043
|
define: { global: {} },
|
|
4280
5044
|
}));
|
|
4281
5045
|
"
|
|
@@ -4520,6 +5284,7 @@ exports[`react-website generator > should generate shared constructs > common/co
|
|
|
4520
5284
|
"export * from './static-website.js';
|
|
4521
5285
|
export * from './app.js';
|
|
4522
5286
|
export * from './checkov.js';
|
|
5287
|
+
export * from './cloudfront.js';
|
|
4523
5288
|
export * from './runtime-config.js';
|
|
4524
5289
|
export * from './workspace.js';
|
|
4525
5290
|
"
|
|
@@ -4529,11 +5294,21 @@ exports[`react-website generator > should generate shared constructs > common/co
|
|
|
4529
5294
|
"import {
|
|
4530
5295
|
CfnOutput,
|
|
4531
5296
|
CfnResource,
|
|
5297
|
+
Duration,
|
|
4532
5298
|
Lazy,
|
|
5299
|
+
Names,
|
|
4533
5300
|
RemovalPolicy,
|
|
4534
5301
|
Stack,
|
|
4535
5302
|
} from 'aws-cdk-lib';
|
|
4536
|
-
import {
|
|
5303
|
+
import {
|
|
5304
|
+
Distribution,
|
|
5305
|
+
HeadersFrameOption,
|
|
5306
|
+
HeadersReferrerPolicy,
|
|
5307
|
+
ResponseHeadersPolicy,
|
|
5308
|
+
SecurityPolicyProtocol,
|
|
5309
|
+
ViewerProtocolPolicy,
|
|
5310
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
5311
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
4537
5312
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
4538
5313
|
import {
|
|
4539
5314
|
BlockPublicAccess,
|
|
@@ -4542,18 +5317,83 @@ import {
|
|
|
4542
5317
|
IBucket,
|
|
4543
5318
|
ObjectOwnership,
|
|
4544
5319
|
} from 'aws-cdk-lib/aws-s3';
|
|
4545
|
-
import {
|
|
5320
|
+
import {
|
|
5321
|
+
BucketDeployment,
|
|
5322
|
+
CacheControl,
|
|
5323
|
+
Source,
|
|
5324
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
4546
5325
|
import { Construct } from 'constructs';
|
|
4547
5326
|
import { RuntimeConfig } from './runtime-config.js';
|
|
4548
|
-
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
5327
|
+
import { IKey, Key } from 'aws-cdk-lib/aws-kms';
|
|
5328
|
+
import {
|
|
5329
|
+
CfnDelivery,
|
|
5330
|
+
CfnDeliveryDestination,
|
|
5331
|
+
CfnDeliverySource,
|
|
5332
|
+
LogGroup,
|
|
5333
|
+
RetentionDays,
|
|
5334
|
+
} from 'aws-cdk-lib/aws-logs';
|
|
5335
|
+
import { Effect, PolicyStatement, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
|
|
4549
5336
|
import { CfnWebACL } from 'aws-cdk-lib/aws-wafv2';
|
|
4550
5337
|
import { suppressRules } from './checkov.js';
|
|
4551
5338
|
|
|
4552
5339
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
4553
5340
|
|
|
5341
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
5342
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
5343
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
5344
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
5345
|
+
// connect-src to your specific origins once they are known.
|
|
5346
|
+
const CONTENT_SECURITY_POLICY = [
|
|
5347
|
+
"default-src 'self'",
|
|
5348
|
+
"script-src 'self'",
|
|
5349
|
+
"style-src 'self' 'unsafe-inline'",
|
|
5350
|
+
"img-src 'self' data:",
|
|
5351
|
+
"font-src 'self' data:",
|
|
5352
|
+
"connect-src 'self' https: wss:",
|
|
5353
|
+
"object-src 'none'",
|
|
5354
|
+
"base-uri 'self'",
|
|
5355
|
+
"frame-ancestors 'none'",
|
|
5356
|
+
].join('; ');
|
|
5357
|
+
|
|
4554
5358
|
export interface StaticWebsiteProps {
|
|
4555
5359
|
readonly websiteName: string;
|
|
4556
5360
|
readonly websiteFilePath: string;
|
|
5361
|
+
/**
|
|
5362
|
+
* Custom domain names for the CloudFront distribution. Requires \`certificate\`.
|
|
5363
|
+
*/
|
|
5364
|
+
readonly domainNames?: string[];
|
|
5365
|
+
/**
|
|
5366
|
+
* ACM certificate for the custom domain names. Must be in us-east-1.
|
|
5367
|
+
* When provided, viewers are required to use TLS 1.2 or later.
|
|
5368
|
+
*/
|
|
5369
|
+
readonly certificate?: ICertificate;
|
|
5370
|
+
/**
|
|
5371
|
+
* Whether to protect the CloudFront distribution with an AWS WAF Web ACL.
|
|
5372
|
+
*
|
|
5373
|
+
* @default true
|
|
5374
|
+
*/
|
|
5375
|
+
readonly enableWaf?: boolean;
|
|
5376
|
+
/**
|
|
5377
|
+
* Server-side encryption for the website and distribution log buckets.
|
|
5378
|
+
*
|
|
5379
|
+
* @default BucketEncryption.KMS
|
|
5380
|
+
*/
|
|
5381
|
+
readonly encryption?: BucketEncryption;
|
|
5382
|
+
/**
|
|
5383
|
+
* KMS key used to encrypt the website and distribution log buckets. Only used when \`encryption\` is
|
|
5384
|
+
* \`BucketEncryption.KMS\`. When not provided, a new key is created. Note that a key imported via
|
|
5385
|
+
* \`Key.fromKeyArn\` must already grant the CloudWatch Logs, S3 and CloudFront service principals the
|
|
5386
|
+
* necessary permissions in its own key policy - \`addToResourcePolicy\` is a no-op on an imported key,
|
|
5387
|
+
* so this construct cannot grant them on your behalf.
|
|
5388
|
+
*/
|
|
5389
|
+
readonly encryptionKey?: IKey;
|
|
5390
|
+
/**
|
|
5391
|
+
* Whether the automatically created KMS key has rotation enabled. Only applies when \`encryption\` is
|
|
5392
|
+
* \`BucketEncryption.KMS\` and no \`encryptionKey\` is supplied.
|
|
5393
|
+
*
|
|
5394
|
+
* @default true
|
|
5395
|
+
*/
|
|
5396
|
+
readonly enableKeyRotation?: boolean;
|
|
4557
5397
|
}
|
|
4558
5398
|
|
|
4559
5399
|
/**
|
|
@@ -4572,39 +5412,53 @@ export class StaticWebsite extends Construct {
|
|
|
4572
5412
|
constructor(
|
|
4573
5413
|
scope: Construct,
|
|
4574
5414
|
id: string,
|
|
4575
|
-
{
|
|
5415
|
+
{
|
|
5416
|
+
websiteFilePath,
|
|
5417
|
+
websiteName,
|
|
5418
|
+
domainNames,
|
|
5419
|
+
certificate,
|
|
5420
|
+
enableWaf = true,
|
|
5421
|
+
encryption = BucketEncryption.KMS,
|
|
5422
|
+
encryptionKey,
|
|
5423
|
+
enableKeyRotation = true,
|
|
5424
|
+
}: StaticWebsiteProps,
|
|
4576
5425
|
) {
|
|
4577
5426
|
super(scope, id);
|
|
4578
|
-
this.node.setContext(
|
|
4579
|
-
'@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy',
|
|
4580
|
-
true,
|
|
4581
|
-
);
|
|
4582
5427
|
|
|
4583
|
-
const websiteKey
|
|
4584
|
-
|
|
4585
|
-
|
|
5428
|
+
const websiteKey: IKey | undefined =
|
|
5429
|
+
encryption === BucketEncryption.KMS
|
|
5430
|
+
? (encryptionKey ?? new Key(this, 'WebsiteKey', { enableKeyRotation }))
|
|
5431
|
+
: undefined;
|
|
5432
|
+
|
|
5433
|
+
// Allow CloudWatch Logs to use the website key for server access log delivery.
|
|
5434
|
+
const stack = Stack.of(this);
|
|
5435
|
+
websiteKey?.addToResourcePolicy(
|
|
5436
|
+
new PolicyStatement({
|
|
5437
|
+
effect: Effect.ALLOW,
|
|
5438
|
+
principals: [
|
|
5439
|
+
new ServicePrincipal(\`logs.\${stack.region}.amazonaws.com\`),
|
|
5440
|
+
],
|
|
5441
|
+
actions: [
|
|
5442
|
+
'kms:Encrypt',
|
|
5443
|
+
'kms:Decrypt',
|
|
5444
|
+
'kms:ReEncrypt*',
|
|
5445
|
+
'kms:GenerateDataKey*',
|
|
5446
|
+
'kms:DescribeKey',
|
|
5447
|
+
],
|
|
5448
|
+
resources: ['*'],
|
|
5449
|
+
conditions: {
|
|
5450
|
+
ArnLike: {
|
|
5451
|
+
'kms:EncryptionContext:aws:logs:arn': \`arn:aws:logs:\${stack.region}:\${stack.account}:log-group:*\`,
|
|
5452
|
+
},
|
|
5453
|
+
},
|
|
5454
|
+
}),
|
|
5455
|
+
);
|
|
4586
5456
|
|
|
4587
|
-
const
|
|
4588
|
-
|
|
4589
|
-
enforceSSL: true,
|
|
4590
|
-
autoDeleteObjects: true,
|
|
4591
|
-
removalPolicy: RemovalPolicy.DESTROY,
|
|
4592
|
-
encryption: BucketEncryption.KMS,
|
|
5457
|
+
const accessLogs = new LogGroup(this, 'AccessLogs', {
|
|
5458
|
+
retention: RetentionDays.ONE_YEAR,
|
|
4593
5459
|
encryptionKey: websiteKey,
|
|
4594
|
-
|
|
4595
|
-
publicReadAccess: false,
|
|
4596
|
-
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
5460
|
+
removalPolicy: RemovalPolicy.DESTROY,
|
|
4597
5461
|
});
|
|
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
5462
|
|
|
4609
5463
|
// S3 Bucket to hold website files
|
|
4610
5464
|
this.websiteBucket = new Bucket(this, 'WebsiteBucket', {
|
|
@@ -4612,47 +5466,99 @@ export class StaticWebsite extends Construct {
|
|
|
4612
5466
|
enforceSSL: true,
|
|
4613
5467
|
autoDeleteObjects: true,
|
|
4614
5468
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
4615
|
-
encryption
|
|
5469
|
+
encryption,
|
|
4616
5470
|
encryptionKey: websiteKey,
|
|
4617
5471
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_ENFORCED,
|
|
4618
5472
|
publicReadAccess: false,
|
|
4619
5473
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
4620
|
-
serverAccessLogsPrefix: 'website-access-logs',
|
|
4621
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
4622
5474
|
});
|
|
5475
|
+
suppressRules(
|
|
5476
|
+
this.websiteBucket,
|
|
5477
|
+
['CKV_AWS_18'],
|
|
5478
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
5479
|
+
);
|
|
5480
|
+
this.deliverAccessLogsToCloudWatch(
|
|
5481
|
+
'Website',
|
|
5482
|
+
this.websiteBucket,
|
|
5483
|
+
accessLogs,
|
|
5484
|
+
);
|
|
4623
5485
|
// Web ACL
|
|
4624
|
-
const wafStack = new CloudfrontWebAcl(this, 'waf');
|
|
5486
|
+
const wafStack = enableWaf ? new CloudfrontWebAcl(this, 'waf') : undefined;
|
|
4625
5487
|
|
|
4626
|
-
//
|
|
5488
|
+
// Bucket holding CloudFront standard access logs. CloudFront delivers its
|
|
5489
|
+
// own logs to S3 only, so this bucket is retained; its S3 server access
|
|
5490
|
+
// logs are delivered to CloudWatch Logs.
|
|
4627
5491
|
const logBucket = new Bucket(this, 'DistributionLogBucket', {
|
|
4628
5492
|
enforceSSL: true,
|
|
4629
5493
|
autoDeleteObjects: true,
|
|
4630
5494
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
4631
|
-
encryption
|
|
5495
|
+
encryption,
|
|
4632
5496
|
encryptionKey: websiteKey,
|
|
4633
5497
|
objectOwnership: ObjectOwnership.BUCKET_OWNER_PREFERRED,
|
|
4634
5498
|
publicReadAccess: false,
|
|
4635
5499
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
4636
|
-
serverAccessLogsPrefix: 'distribution-access-logs',
|
|
4637
|
-
serverAccessLogsBucket: accessLogsBucket,
|
|
4638
5500
|
});
|
|
4639
5501
|
suppressRules(
|
|
4640
5502
|
logBucket,
|
|
4641
5503
|
['CKV_AWS_21'],
|
|
4642
5504
|
'Distribution log bucket does not need versioning enabled',
|
|
4643
5505
|
);
|
|
5506
|
+
suppressRules(
|
|
5507
|
+
logBucket,
|
|
5508
|
+
['CKV_AWS_18'],
|
|
5509
|
+
'Server access logs are delivered to CloudWatch Logs',
|
|
5510
|
+
);
|
|
5511
|
+
this.deliverAccessLogsToCloudWatch('Distribution', logBucket, accessLogs);
|
|
5512
|
+
|
|
5513
|
+
// Security headers applied to all responses.
|
|
5514
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
5515
|
+
this,
|
|
5516
|
+
'ResponseHeadersPolicy',
|
|
5517
|
+
{
|
|
5518
|
+
securityHeadersBehavior: {
|
|
5519
|
+
strictTransportSecurity: {
|
|
5520
|
+
accessControlMaxAge: Duration.days(730),
|
|
5521
|
+
includeSubdomains: true,
|
|
5522
|
+
preload: true,
|
|
5523
|
+
override: true,
|
|
5524
|
+
},
|
|
5525
|
+
contentTypeOptions: { override: true },
|
|
5526
|
+
frameOptions: {
|
|
5527
|
+
frameOption: HeadersFrameOption.DENY,
|
|
5528
|
+
override: true,
|
|
5529
|
+
},
|
|
5530
|
+
referrerPolicy: {
|
|
5531
|
+
referrerPolicy:
|
|
5532
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
5533
|
+
override: true,
|
|
5534
|
+
},
|
|
5535
|
+
contentSecurityPolicy: {
|
|
5536
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
5537
|
+
override: true,
|
|
5538
|
+
},
|
|
5539
|
+
},
|
|
5540
|
+
},
|
|
5541
|
+
);
|
|
4644
5542
|
|
|
4645
5543
|
const defaultRootObject = 'index.html';
|
|
4646
5544
|
this.cloudFrontDistribution = new Distribution(
|
|
4647
5545
|
this,
|
|
4648
5546
|
'CloudfrontDistribution',
|
|
4649
5547
|
{
|
|
4650
|
-
webAclId: wafStack
|
|
5548
|
+
webAclId: wafStack?.wafArn,
|
|
4651
5549
|
enableLogging: true,
|
|
4652
5550
|
logBucket: logBucket,
|
|
5551
|
+
...(certificate
|
|
5552
|
+
? {
|
|
5553
|
+
certificate,
|
|
5554
|
+
domainNames,
|
|
5555
|
+
minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
5556
|
+
}
|
|
5557
|
+
: {}),
|
|
4653
5558
|
defaultBehavior: {
|
|
4654
5559
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
4655
5560
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
5561
|
+
responseHeadersPolicy,
|
|
4656
5562
|
},
|
|
4657
5563
|
defaultRootObject,
|
|
4658
5564
|
errorResponses: [
|
|
@@ -4669,16 +5575,31 @@ export class StaticWebsite extends Construct {
|
|
|
4669
5575
|
],
|
|
4670
5576
|
},
|
|
4671
5577
|
);
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
5578
|
+
if (!certificate) {
|
|
5579
|
+
// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
5580
|
+
suppressRules(
|
|
5581
|
+
this.cloudFrontDistribution,
|
|
5582
|
+
['CKV_AWS_174'],
|
|
5583
|
+
'Cloudfront default certificate does not use TLS 1.2',
|
|
5584
|
+
);
|
|
5585
|
+
}
|
|
4677
5586
|
|
|
4678
5587
|
// Deploy Website
|
|
4679
5588
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
5589
|
+
sources: [Source.asset(websiteFilePath)],
|
|
5590
|
+
destinationBucket: this.websiteBucket,
|
|
5591
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
5592
|
+
distribution: this.cloudFrontDistribution,
|
|
5593
|
+
// Exclude the runtime config from this deployment's sync so its default pruning
|
|
5594
|
+
// never deletes the file managed separately by RuntimeConfigDeployment below.
|
|
5595
|
+
exclude: [DEFAULT_RUNTIME_CONFIG_FILENAME],
|
|
5596
|
+
memoryLimit: 1024,
|
|
5597
|
+
});
|
|
5598
|
+
|
|
5599
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
5600
|
+
// must always fetch the latest configuration.
|
|
5601
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
4680
5602
|
sources: [
|
|
4681
|
-
Source.asset(websiteFilePath),
|
|
4682
5603
|
Source.data(
|
|
4683
5604
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
4684
5605
|
Lazy.string({
|
|
@@ -4690,8 +5611,9 @@ export class StaticWebsite extends Construct {
|
|
|
4690
5611
|
),
|
|
4691
5612
|
],
|
|
4692
5613
|
destinationBucket: this.websiteBucket,
|
|
4693
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
4694
5614
|
distribution: this.cloudFrontDistribution,
|
|
5615
|
+
cacheControl: [CacheControl.noCache()],
|
|
5616
|
+
prune: false,
|
|
4695
5617
|
memoryLimit: 1024,
|
|
4696
5618
|
});
|
|
4697
5619
|
|
|
@@ -4712,6 +5634,48 @@ export class StaticWebsite extends Construct {
|
|
|
4712
5634
|
value: this.websiteBucket.bucketName,
|
|
4713
5635
|
});
|
|
4714
5636
|
}
|
|
5637
|
+
|
|
5638
|
+
/**
|
|
5639
|
+
* Delivers a bucket's S3 server access logs to a CloudWatch log group using
|
|
5640
|
+
* CloudWatch Logs vended log delivery.
|
|
5641
|
+
*/
|
|
5642
|
+
private deliverAccessLogsToCloudWatch(
|
|
5643
|
+
id: string,
|
|
5644
|
+
bucket: IBucket,
|
|
5645
|
+
logGroup: LogGroup,
|
|
5646
|
+
) {
|
|
5647
|
+
const source: CfnDeliverySource = new CfnDeliverySource(
|
|
5648
|
+
this,
|
|
5649
|
+
\`\${id}AccessLogsSource\`,
|
|
5650
|
+
{
|
|
5651
|
+
name: Lazy.string({
|
|
5652
|
+
produce: () => Names.uniqueResourceName(source, { maxLength: 60 }),
|
|
5653
|
+
}),
|
|
5654
|
+
logType: 'S3_SERVER_ACCESS_LOGS',
|
|
5655
|
+
resourceArn: bucket.bucketArn,
|
|
5656
|
+
},
|
|
5657
|
+
);
|
|
5658
|
+
const bucketPolicy = (bucket as Bucket).policy;
|
|
5659
|
+
if (bucketPolicy) {
|
|
5660
|
+
source.node.addDependency(bucketPolicy);
|
|
5661
|
+
}
|
|
5662
|
+
const destination: CfnDeliveryDestination = new CfnDeliveryDestination(
|
|
5663
|
+
this,
|
|
5664
|
+
\`\${id}AccessLogsDestination\`,
|
|
5665
|
+
{
|
|
5666
|
+
name: Lazy.string({
|
|
5667
|
+
produce: () =>
|
|
5668
|
+
Names.uniqueResourceName(destination, { maxLength: 60 }),
|
|
5669
|
+
}),
|
|
5670
|
+
destinationResourceArn: logGroup.logGroupArn,
|
|
5671
|
+
},
|
|
5672
|
+
);
|
|
5673
|
+
const delivery = new CfnDelivery(this, \`\${id}AccessLogsDelivery\`, {
|
|
5674
|
+
deliverySourceName: source.name,
|
|
5675
|
+
deliveryDestinationArn: destination.attrArn,
|
|
5676
|
+
});
|
|
5677
|
+
delivery.addDependency(source);
|
|
5678
|
+
}
|
|
4715
5679
|
}
|
|
4716
5680
|
|
|
4717
5681
|
export class CloudfrontWebAcl extends Stack {
|
|
@@ -4780,11 +5744,17 @@ export class CloudfrontWebAcl extends Stack {
|
|
|
4780
5744
|
exports[`react-website generator > should generate shared constructs > test-app.ts 1`] = `
|
|
4781
5745
|
"import * as url from 'url';
|
|
4782
5746
|
import { Construct } from 'constructs';
|
|
4783
|
-
import { StaticWebsite } from '../../core/index.js';
|
|
5747
|
+
import { StaticWebsite, StaticWebsiteProps } from '../../core/index.js';
|
|
5748
|
+
|
|
5749
|
+
export type TestAppProps = Omit<
|
|
5750
|
+
StaticWebsiteProps,
|
|
5751
|
+
'websiteName' | 'websiteFilePath'
|
|
5752
|
+
>;
|
|
4784
5753
|
|
|
4785
5754
|
export class TestApp extends StaticWebsite {
|
|
4786
|
-
constructor(scope: Construct, id: string) {
|
|
5755
|
+
constructor(scope: Construct, id: string, props?: TestAppProps) {
|
|
4787
5756
|
super(scope, id, {
|
|
5757
|
+
...props,
|
|
4788
5758
|
websiteName: 'TestApp',
|
|
4789
5759
|
websiteFilePath: url.fileURLToPath(
|
|
4790
5760
|
new URL('../../../../../../dist/test-app/bundle', import.meta.url),
|
|
@@ -4835,19 +5805,7 @@ root &&
|
|
|
4835
5805
|
"
|
|
4836
5806
|
`;
|
|
4837
5807
|
|
|
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
|
-
`;
|
|
5808
|
+
exports[`react-website generator > should handle npm scope prefix correctly > scoped-dependencies 1`] = `{}`;
|
|
4851
5809
|
|
|
4852
5810
|
exports[`react-website generator ux tests > Cloudscape > should update package.json with required dependencies > test-app/src/components/AppLayout/index.tsx 1`] = `
|
|
4853
5811
|
"import * as React from 'react';
|
|
@@ -5088,55 +6046,55 @@ exports[`react-website generator ux tests > Cloudscape > should update package.j
|
|
|
5088
6046
|
// You should NOT make any changes in this file as it will be overwritten.
|
|
5089
6047
|
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
5090
6048
|
|
|
5091
|
-
import { Route as rootRouteImport } from './routes/__root'
|
|
5092
|
-
import { Route as IndexRouteImport } from './routes/index'
|
|
6049
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
6050
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
5093
6051
|
|
|
5094
6052
|
const IndexRoute = IndexRouteImport.update({
|
|
5095
6053
|
id: '/',
|
|
5096
6054
|
path: '/',
|
|
5097
6055
|
getParentRoute: () => rootRouteImport,
|
|
5098
|
-
} as any)
|
|
6056
|
+
} as any)
|
|
5099
6057
|
|
|
5100
6058
|
export interface FileRoutesByFullPath {
|
|
5101
|
-
'/': typeof IndexRoute
|
|
6059
|
+
'/': typeof IndexRoute
|
|
5102
6060
|
}
|
|
5103
6061
|
export interface FileRoutesByTo {
|
|
5104
|
-
'/': typeof IndexRoute
|
|
6062
|
+
'/': typeof IndexRoute
|
|
5105
6063
|
}
|
|
5106
6064
|
export interface FileRoutesById {
|
|
5107
|
-
__root__: typeof rootRouteImport
|
|
5108
|
-
'/': typeof IndexRoute
|
|
6065
|
+
__root__: typeof rootRouteImport
|
|
6066
|
+
'/': typeof IndexRoute
|
|
5109
6067
|
}
|
|
5110
6068
|
export interface FileRouteTypes {
|
|
5111
|
-
fileRoutesByFullPath: FileRoutesByFullPath
|
|
5112
|
-
fullPaths: '/'
|
|
5113
|
-
fileRoutesByTo: FileRoutesByTo
|
|
5114
|
-
to: '/'
|
|
5115
|
-
id: '__root__' | '/'
|
|
5116
|
-
fileRoutesById: FileRoutesById
|
|
6069
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
6070
|
+
fullPaths: '/'
|
|
6071
|
+
fileRoutesByTo: FileRoutesByTo
|
|
6072
|
+
to: '/'
|
|
6073
|
+
id: '__root__' | '/'
|
|
6074
|
+
fileRoutesById: FileRoutesById
|
|
5117
6075
|
}
|
|
5118
6076
|
export interface RootRouteChildren {
|
|
5119
|
-
IndexRoute: typeof IndexRoute
|
|
6077
|
+
IndexRoute: typeof IndexRoute
|
|
5120
6078
|
}
|
|
5121
6079
|
|
|
5122
6080
|
declare module '@tanstack/react-router' {
|
|
5123
6081
|
interface FileRoutesByPath {
|
|
5124
6082
|
'/': {
|
|
5125
|
-
id: '/'
|
|
5126
|
-
path: '/'
|
|
5127
|
-
fullPath: '/'
|
|
5128
|
-
preLoaderRoute: typeof IndexRouteImport
|
|
5129
|
-
parentRoute: typeof rootRouteImport
|
|
5130
|
-
}
|
|
6083
|
+
id: '/'
|
|
6084
|
+
path: '/'
|
|
6085
|
+
fullPath: '/'
|
|
6086
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
6087
|
+
parentRoute: typeof rootRouteImport
|
|
6088
|
+
}
|
|
5131
6089
|
}
|
|
5132
6090
|
}
|
|
5133
6091
|
|
|
5134
6092
|
const rootRouteChildren: RootRouteChildren = {
|
|
5135
6093
|
IndexRoute: IndexRoute,
|
|
5136
|
-
}
|
|
6094
|
+
}
|
|
5137
6095
|
export const routeTree = rootRouteImport
|
|
5138
6096
|
._addFileChildren(rootRouteChildren)
|
|
5139
|
-
._addFileTypes<FileRouteTypes>()
|
|
6097
|
+
._addFileTypes<FileRouteTypes>()
|
|
5140
6098
|
"
|
|
5141
6099
|
`;
|
|
5142
6100
|
|
|
@@ -5193,8 +6151,8 @@ import {
|
|
|
5193
6151
|
SidebarInset,
|
|
5194
6152
|
SidebarProvider,
|
|
5195
6153
|
SidebarTrigger,
|
|
5196
|
-
} from '
|
|
5197
|
-
import { Separator } from '
|
|
6154
|
+
} from '@proj/common-shadcn/components/ui/sidebar';
|
|
6155
|
+
import { Separator } from '@proj/common-shadcn/components/ui/separator';
|
|
5198
6156
|
import Config from '../../config';
|
|
5199
6157
|
|
|
5200
6158
|
import { Link, useLocation, useMatchRoute } from '@tanstack/react-router';
|
|
@@ -5205,7 +6163,7 @@ import {
|
|
|
5205
6163
|
BreadcrumbList,
|
|
5206
6164
|
BreadcrumbPage,
|
|
5207
6165
|
BreadcrumbSeparator,
|
|
5208
|
-
} from '
|
|
6166
|
+
} from '@proj/common-shadcn/components/ui/breadcrumb';
|
|
5209
6167
|
import { AppSidebar } from '../app-sidebar';
|
|
5210
6168
|
|
|
5211
6169
|
const getBreadcrumbs = (
|
|
@@ -5316,7 +6274,7 @@ import {
|
|
|
5316
6274
|
Alert as ShadcnAlert,
|
|
5317
6275
|
AlertDescription,
|
|
5318
6276
|
AlertTitle,
|
|
5319
|
-
} from '
|
|
6277
|
+
} from '@proj/common-shadcn/components/ui/alert';
|
|
5320
6278
|
|
|
5321
6279
|
type AlertType = 'info' | 'error';
|
|
5322
6280
|
|
|
@@ -5356,7 +6314,7 @@ import {
|
|
|
5356
6314
|
SidebarMenu,
|
|
5357
6315
|
SidebarMenuButton,
|
|
5358
6316
|
SidebarMenuItem,
|
|
5359
|
-
} from '
|
|
6317
|
+
} from '@proj/common-shadcn/components/ui/sidebar';
|
|
5360
6318
|
import { Link } from '@tanstack/react-router';
|
|
5361
6319
|
|
|
5362
6320
|
import Config from '../config';
|
|
@@ -5398,7 +6356,7 @@ export function AppSidebar() {
|
|
|
5398
6356
|
`;
|
|
5399
6357
|
|
|
5400
6358
|
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 '
|
|
6359
|
+
"import { Spinner as ShadcnSpinner } from '@proj/common-shadcn/components/ui/spinner';
|
|
5402
6360
|
|
|
5403
6361
|
export const Spinner = ShadcnSpinner;
|
|
5404
6362
|
"
|
|
@@ -5459,55 +6417,55 @@ exports[`react-website generator ux tests > Shadcn > should update package.json
|
|
|
5459
6417
|
// You should NOT make any changes in this file as it will be overwritten.
|
|
5460
6418
|
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
5461
6419
|
|
|
5462
|
-
import { Route as rootRouteImport } from './routes/__root'
|
|
5463
|
-
import { Route as IndexRouteImport } from './routes/index'
|
|
6420
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
6421
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
5464
6422
|
|
|
5465
6423
|
const IndexRoute = IndexRouteImport.update({
|
|
5466
6424
|
id: '/',
|
|
5467
6425
|
path: '/',
|
|
5468
6426
|
getParentRoute: () => rootRouteImport,
|
|
5469
|
-
} as any)
|
|
6427
|
+
} as any)
|
|
5470
6428
|
|
|
5471
6429
|
export interface FileRoutesByFullPath {
|
|
5472
|
-
'/': typeof IndexRoute
|
|
6430
|
+
'/': typeof IndexRoute
|
|
5473
6431
|
}
|
|
5474
6432
|
export interface FileRoutesByTo {
|
|
5475
|
-
'/': typeof IndexRoute
|
|
6433
|
+
'/': typeof IndexRoute
|
|
5476
6434
|
}
|
|
5477
6435
|
export interface FileRoutesById {
|
|
5478
|
-
__root__: typeof rootRouteImport
|
|
5479
|
-
'/': typeof IndexRoute
|
|
6436
|
+
__root__: typeof rootRouteImport
|
|
6437
|
+
'/': typeof IndexRoute
|
|
5480
6438
|
}
|
|
5481
6439
|
export interface FileRouteTypes {
|
|
5482
|
-
fileRoutesByFullPath: FileRoutesByFullPath
|
|
5483
|
-
fullPaths: '/'
|
|
5484
|
-
fileRoutesByTo: FileRoutesByTo
|
|
5485
|
-
to: '/'
|
|
5486
|
-
id: '__root__' | '/'
|
|
5487
|
-
fileRoutesById: FileRoutesById
|
|
6440
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
6441
|
+
fullPaths: '/'
|
|
6442
|
+
fileRoutesByTo: FileRoutesByTo
|
|
6443
|
+
to: '/'
|
|
6444
|
+
id: '__root__' | '/'
|
|
6445
|
+
fileRoutesById: FileRoutesById
|
|
5488
6446
|
}
|
|
5489
6447
|
export interface RootRouteChildren {
|
|
5490
|
-
IndexRoute: typeof IndexRoute
|
|
6448
|
+
IndexRoute: typeof IndexRoute
|
|
5491
6449
|
}
|
|
5492
6450
|
|
|
5493
6451
|
declare module '@tanstack/react-router' {
|
|
5494
6452
|
interface FileRoutesByPath {
|
|
5495
6453
|
'/': {
|
|
5496
|
-
id: '/'
|
|
5497
|
-
path: '/'
|
|
5498
|
-
fullPath: '/'
|
|
5499
|
-
preLoaderRoute: typeof IndexRouteImport
|
|
5500
|
-
parentRoute: typeof rootRouteImport
|
|
5501
|
-
}
|
|
6454
|
+
id: '/'
|
|
6455
|
+
path: '/'
|
|
6456
|
+
fullPath: '/'
|
|
6457
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
6458
|
+
parentRoute: typeof rootRouteImport
|
|
6459
|
+
}
|
|
5502
6460
|
}
|
|
5503
6461
|
}
|
|
5504
6462
|
|
|
5505
6463
|
const rootRouteChildren: RootRouteChildren = {
|
|
5506
6464
|
IndexRoute: IndexRoute,
|
|
5507
|
-
}
|
|
6465
|
+
}
|
|
5508
6466
|
export const routeTree = rootRouteImport
|
|
5509
6467
|
._addFileChildren(rootRouteChildren)
|
|
5510
|
-
._addFileTypes<FileRouteTypes>()
|
|
6468
|
+
._addFileTypes<FileRouteTypes>()
|
|
5511
6469
|
"
|
|
5512
6470
|
`;
|
|
5513
6471
|
|