@aws/nx-plugin 1.0.0-rc.3 → 1.0.0-rc.30
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 +7246 -5532
- package/README.md +8 -8
- package/executors.json +9 -0
- package/generators.json +100 -1
- package/package.json +35 -16
- package/src/agentcore-gateway/attach-upstream.d.ts +33 -0
- package/src/agentcore-gateway/attach-upstream.js +38 -0
- package/src/agentcore-gateway/attach-upstream.js.map +1 -0
- package/src/agentcore-gateway/files/cedar/policies/README.md +52 -0
- package/src/agentcore-gateway/files/cedar/policies/permit-all.cedar +11 -0
- package/src/agentcore-gateway/files/project/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 +101 -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 +25 -0
- package/src/agentcore-gateway/generator.js +149 -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 +59 -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/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 +70 -0
- package/src/bin/aws-nx-mcp.js +14 -0
- package/src/bin/aws-nx-mcp.js.map +1 -0
- package/src/connection/{agent-serve-local.d.ts → agent-local-dev.d.ts} +7 -7
- package/src/connection/agent-local-dev.js +42 -0
- package/src/connection/agent-local-dev.js.map +1 -0
- package/src/connection/agent-runtime-config.d.ts +1 -1
- package/src/connection/agent-runtime-config.js +9 -14
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/generator.d.ts +7 -14
- package/src/connection/generator.js +158 -177
- package/src/connection/generator.js.map +1 -1
- package/src/connection/local-dev.d.ts +15 -0
- package/src/connection/local-dev.js +37 -0
- package/src/connection/local-dev.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 +98 -0
- package/src/connection/supported-connections.js +138 -0
- package/src/connection/supported-connections.js.map +1 -0
- package/src/index.js +2 -5
- package/src/index.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +51 -81
- package/src/infra/app/generator.d.ts +3 -3
- package/src/infra/app/generator.js +141 -123
- 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/license/__snapshots__/config.spec.ts.snap +23 -0
- package/src/license/config-types.d.ts +18 -1
- package/src/license/config-types.js +8 -2
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +65 -7
- package/src/license/config.js +442 -109
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/check.d.ts +16 -0
- package/src/license/dependency-check/check.js +116 -0
- package/src/license/dependency-check/check.js.map +1 -0
- package/src/license/dependency-check/collectors/collector.d.ts +21 -0
- package/src/license/dependency-check/collectors/collector.js +46 -0
- package/src/license/dependency-check/collectors/collector.js.map +1 -0
- package/src/license/dependency-check/collectors/npm-collector.d.ts +10 -0
- package/src/license/dependency-check/collectors/npm-collector.js +68 -0
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -0
- package/src/license/dependency-check/collectors/python-collector.d.ts +23 -0
- package/src/license/dependency-check/collectors/python-collector.js +114 -0
- package/src/license/dependency-check/collectors/python-collector.js.map +1 -0
- package/src/license/dependency-check/evaluator.d.ts +9 -0
- package/src/license/dependency-check/evaluator.js +94 -0
- package/src/license/dependency-check/evaluator.js.map +1 -0
- package/src/license/dependency-check/executor-schema.json +6 -0
- package/src/license/dependency-check/executor.d.ts +9 -0
- package/src/license/dependency-check/executor.js +51 -0
- package/src/license/dependency-check/executor.js.map +1 -0
- package/src/license/dependency-check/pre-approved.d.ts +6 -0
- package/src/license/dependency-check/pre-approved.js +1893 -0
- package/src/license/dependency-check/pre-approved.js.map +1 -0
- package/src/license/dependency-check/types.d.ts +45 -0
- package/src/license/dependency-check/types.js +6 -0
- package/src/license/dependency-check/types.js.map +1 -0
- package/src/license/generator.d.ts +3 -3
- package/src/license/generator.js +127 -30
- package/src/license/generator.js.map +1 -1
- package/src/license/index.d.ts +8 -0
- package/src/license/index.js +7 -0
- package/src/license/index.js.map +1 -0
- package/src/license/known-exceptions.d.ts +7 -0
- package/src/license/known-exceptions.js +39 -0
- package/src/license/known-exceptions.js.map +1 -0
- package/src/license/schema.d.js +6 -0
- package/src/license/schema.d.js.map +1 -0
- package/src/license/schema.d.ts +7 -0
- package/src/license/schema.json +11 -0
- package/src/license/sync/generator.d.ts +2 -2
- package/src/license/sync/generator.js +100 -125
- package/src/license/sync/generator.js.map +1 -1
- package/src/license/sync/project-file-sync.d.ts +3 -3
- 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/generator-info.d.ts +5 -1
- package/src/mcp-server/generator-info.js +130 -160
- 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 +184 -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 +42 -56
- 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.js +9 -7
- package/src/mcp-server/schema.js.map +1 -1
- package/src/mcp-server/server.js +20 -24
- package/src/mcp-server/server.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.d.ts +1 -1
- 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 +46 -25
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.d.ts +2 -2
- 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 +2 -2
- package/src/mcp-server/tools/list-generators.js +19 -25
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +1 -1
- package/src/open-api/ts-client/generator.d.ts +3 -3
- package/src/open-api/ts-client/generator.js +16 -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/generator.d.ts +3 -3
- package/src/open-api/ts-hooks/generator.js +13 -21
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.spec.tsx +14 -14
- 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 +3 -3
- 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 +5 -1
- package/src/open-api/utils/codegen-data/languages.js +42 -60
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data/types.js +31 -30
- package/src/open-api/utils/codegen-data/types.js.map +1 -1
- package/src/open-api/utils/codegen-data.d.ts +6 -2
- package/src/open-api/utils/codegen-data.js +253 -269
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.d.ts +5 -1
- package/src/open-api/utils/normalise.js +242 -241
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parse.d.ts +2 -2
- package/src/open-api/utils/parse.js +11 -13
- package/src/open-api/utils/parse.js.map +1 -1
- 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.js +5 -2
- package/src/open-api/utils/types.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +160 -17
- package/src/preset/generator.d.ts +4 -4
- package/src/preset/generator.js +140 -112
- 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 +4 -2
- package/src/preset/schema.json +10 -5
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +304 -0
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +734 -0
- package/src/py/agent/__snapshots__/{generator.spec.ts.snap → generator.protocols.spec.ts.snap} +80 -314
- package/src/py/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +189 -0
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client_strands.py.template +30 -0
- package/src/py/agent/a2a-connection/files/langchain/agent-connection/app/__targetAgentSnakeCase___client_langchain.py.template +28 -0
- package/src/py/agent/a2a-connection/generator.d.ts +3 -3
- package/src/py/agent/a2a-connection/generator.js +113 -85
- 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 +1 -0
- package/src/py/agent/a2a-connection/schema.json +5 -0
- package/src/py/agent/files/a2a-langchain/main.py.template +89 -0
- package/src/py/agent/files/ag-ui-langchain/main.py.template +83 -0
- package/src/py/agent/files/common/agent.py.template +2 -0
- package/src/py/agent/files/common-langchain/agent.py.template +30 -0
- package/src/py/agent/files/http/init.py.template +7 -25
- package/src/py/agent/files/http/main.py.template +2 -3
- package/src/py/agent/files/http-langchain/main.py.template +84 -0
- 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 +10 -0
- package/src/py/agent/gateway-connection/generator.js +119 -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 +3 -3
- package/src/py/agent/generator.js +280 -180
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +153 -89
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client_strands.py.template +30 -0
- package/src/py/agent/mcp-connection/files/langchain/agent-connection/app/__mcpServerSnakeCase___client_langchain.py.template +30 -0
- package/src/py/agent/mcp-connection/generator.d.ts +3 -3
- package/src/py/agent/mcp-connection/generator.js +65 -126
- 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 +1 -0
- package/src/py/agent/mcp-connection/schema.json +5 -0
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +11 -19
- package/src/py/agent/react-connection/generator.d.ts +4 -4
- package/src/py/agent/react-connection/generator.js +55 -59
- 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} +6 -6
- 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 +1 -0
- 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 +2 -1
- package/src/py/agent/schema.json +6 -1
- package/src/py/api/generator.d.ts +3 -3
- 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 +1 -0
- package/src/py/api/schema.json +5 -0
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +1526 -0
- package/src/py/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/py/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/agent-connection/generator.js +39 -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 +23 -0
- package/src/py/dynamodb/fast-api-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/fast-api-connection/generator.js +37 -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 +10 -0
- package/src/py/dynamodb/generator.js +110 -0
- package/src/py/dynamodb/generator.js.map +1 -0
- package/src/py/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/py/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/mcp-server-connection/generator.js +39 -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 +75 -0
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +212 -4678
- package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +4833 -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 +3 -3
- package/src/py/fast-api/generator.js +90 -87
- 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 +4 -4
- package/src/py/fast-api/react/generator.js +25 -25
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/open-api.d.ts +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 +1 -0
- package/src/py/fast-api/schema.json +5 -0
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/py/lambda-function/generator.d.ts +3 -3
- package/src/py/lambda-function/generator.js +60 -59
- 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 +1 -0
- package/src/py/lambda-function/schema.json +5 -0
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +87 -17
- package/src/py/mcp-server/generator.d.ts +3 -3
- package/src/py/mcp-server/generator.js +152 -125
- 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 +1 -0
- package/src/py/mcp-server/schema.json +5 -0
- package/src/py/project/generator.d.ts +17 -4
- package/src/py/project/generator.js +205 -127
- 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 +5 -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/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 +14 -0
- package/src/sdk/py.js +10 -0
- package/src/sdk/py.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 +33 -0
- package/src/sdk/ts.js +35 -0
- package/src/sdk/ts.js.map +1 -0
- package/{sdk → src/sdk}/utils/ast.d.ts +1 -2
- package/src/sdk/utils/ast.js +6 -0
- package/src/sdk/utils/ast.js.map +1 -0
- package/{sdk → src/sdk}/utils/format.d.ts +1 -1
- 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 +19 -24
- package/src/smithy/project/files/build.Dockerfile.template +1 -4
- package/src/smithy/project/files/src/operations/echo.smithy.template +1 -0
- package/src/smithy/project/generator.d.ts +3 -3
- package/src/smithy/project/generator.js +64 -57
- 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 +1 -0
- package/src/smithy/project/schema.json +5 -0
- package/src/smithy/react-connection/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/smithy/react-connection/generator.d.ts +3 -3
- package/src/smithy/react-connection/generator.js +39 -47
- 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 +409 -106
- package/src/smithy/ts/api/generator.d.ts +3 -3
- package/src/smithy/ts/api/generator.js +127 -106
- 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 +1 -0
- package/src/smithy/ts/api/schema.json +5 -0
- 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 +3 -3
- package/src/terraform/project/generator.js +156 -104
- 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 +499 -110
- package/src/trpc/backend/files/src/procedures/echo.ts.template +1 -1
- package/src/trpc/backend/files/src/schema/echo.ts.template +2 -2
- package/src/trpc/backend/generator.d.ts +4 -4
- package/src/trpc/backend/generator.js +97 -85
- 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 +3 -2
- package/src/trpc/backend/schema.json +5 -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 +4 -4
- package/src/trpc/react/generator.js +63 -58
- 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 +656 -18
- package/src/ts/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +256 -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 +3 -3
- package/src/ts/agent/a2a-connection/generator.js +63 -56
- 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 +1 -0
- package/src/ts/agent/a2a-connection/schema.json +5 -0
- package/src/ts/agent/files/common/agent.ts.template +6 -2
- package/src/ts/agent/files/http/router.ts.template +1 -1
- package/src/ts/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +220 -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 +10 -0
- package/src/ts/agent/gateway-connection/generator.js +114 -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 +3 -3
- package/src/ts/agent/generator.js +188 -144
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +192 -111
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +22 -0
- package/src/ts/agent/mcp-connection/generator.d.ts +3 -3
- package/src/ts/agent/mcp-connection/generator.js +53 -60
- 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 +1 -0
- package/src/ts/agent/mcp-connection/schema.json +5 -0
- package/src/ts/agent/react-connection/generator.d.ts +4 -4
- package/src/ts/agent/react-connection/generator.js +86 -80
- 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 +1 -0
- 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 +1 -0
- package/src/ts/agent/schema.json +5 -0
- package/src/ts/api/generator.d.ts +3 -3
- 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 +3 -1
- package/src/ts/api/schema.json +5 -0
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +15 -16
- package/src/ts/astro-docs/generator.d.ts +3 -3
- package/src/ts/astro-docs/generator.js +69 -54
- 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/docs/generator.d.ts +3 -3
- 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 +1390 -0
- package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/agent-connection/generator.js +30 -0
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -0
- 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 +15 -0
- package/src/ts/dynamodb/agent-connection/schema.json +27 -0
- package/src/ts/dynamodb/files/config.json.template +24 -0
- package/src/ts/dynamodb/files/src/client.ts.template +61 -0
- package/src/ts/dynamodb/files/src/entities/example.ts.template +47 -0
- package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -0
- package/src/ts/dynamodb/files/src/index.ts.template +2 -0
- package/src/ts/dynamodb/generator.d.ts +10 -0
- package/src/ts/dynamodb/generator.js +116 -0
- package/src/ts/dynamodb/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js +30 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -0
- 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 +15 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.json +27 -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 +16 -0
- package/src/ts/dynamodb/schema.json +75 -0
- package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/smithy-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/smithy-connection/generator.js +28 -0
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -0
- 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 +13 -0
- package/src/ts/dynamodb/smithy-connection/schema.json +23 -0
- package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/trpc-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/trpc-connection/generator.js +28 -0
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -0
- 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 +13 -0
- package/src/ts/dynamodb/trpc-connection/schema.json +23 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/lambda-function/generator.d.ts +3 -3
- package/src/ts/lambda-function/generator.js +59 -56
- 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 +1 -0
- package/src/ts/lambda-function/schema.json +5 -0
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +53 -99
- package/src/ts/lib/__snapshots__/vitest.spec.ts.snap +24 -0
- package/src/ts/lib/biome.d.ts +7 -0
- package/src/ts/lib/biome.js +58 -0
- package/src/ts/lib/biome.js.map +1 -0
- package/src/ts/lib/generator.d.ts +3 -3
- package/src/ts/lib/generator.js +96 -96
- 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 +12 -2
- package/src/ts/lib/ts-project-utils.js +80 -65
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/types.js +5 -2
- package/src/ts/lib/types.js.map +1 -1
- package/src/ts/lib/vitest.d.ts +2 -2
- package/src/ts/lib/vitest.js +29 -26
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +83 -13
- package/src/ts/mcp-server/generator.d.ts +3 -3
- package/src/ts/mcp-server/generator.js +164 -120
- 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 +1 -0
- package/src/ts/mcp-server/schema.json +5 -0
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +46 -26
- 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.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 +2 -2
- package/src/ts/nx-generator/generator.js +111 -74
- 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-plugin/__snapshots__/generator.spec.ts.snap +30 -18
- package/src/ts/nx-plugin/files/mcp-server/server.ts.template +5 -5
- package/src/ts/nx-plugin/files/mcp-server/tools/create-workspace-command.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/general-guidance.ts.template +1 -1
- package/src/ts/nx-plugin/files/mcp-server/tools/generator-guide.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/list-generators.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/utils.ts.template +3 -3
- package/src/ts/nx-plugin/generator.d.ts +3 -3
- package/src/ts/nx-plugin/generator.js +60 -51
- 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 +1 -1
- package/src/ts/nx-plugin/utils.js +32 -38
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +312 -482
- package/src/ts/rdb/agent-connection/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/ts/rdb/agent-connection/generator.d.ts +3 -3
- package/src/ts/rdb/agent-connection/generator.js +38 -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 +1 -0
- package/src/ts/rdb/agent-connection/schema.json +5 -0
- package/src/ts/rdb/files/config.json.template +14 -0
- package/src/ts/rdb/files/prisma.config.ts.template +6 -5
- package/src/ts/rdb/files/src/create-db-user-handler.ts.template +7 -9
- package/src/ts/rdb/files/src/index.ts.template +0 -1
- package/src/ts/rdb/files/src/migration-handler.ts.template +1 -28
- package/src/ts/rdb/files/src/prisma.ts.template +28 -23
- package/src/ts/rdb/files/src/utils.ts.template +3 -0
- package/src/ts/rdb/generator.d.ts +3 -7
- package/src/ts/rdb/generator.js +158 -130
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/ts/rdb/mcp-server-connection/generator.d.ts +3 -3
- package/src/ts/rdb/mcp-server-connection/generator.js +36 -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 +1 -0
- 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 +1 -0
- package/src/ts/rdb/schema.json +5 -0
- package/src/ts/rdb/smithy-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/rdb/smithy-connection/generator.d.ts +3 -3
- package/src/ts/rdb/smithy-connection/generator.js +46 -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 +3 -3
- package/src/ts/rdb/trpc-connection/generator.d.ts +3 -3
- package/src/ts/rdb/trpc-connection/generator.js +36 -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.d.ts +1 -1
- 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 +1 -16
- package/src/ts/react-website/agui/generator.d.ts +1 -1
- package/src/ts/react-website/agui/generator.js +69 -62
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +626 -612
- package/src/ts/react-website/app/generator.d.ts +4 -4
- package/src/ts/react-website/app/generator.js +217 -192
- 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 +1 -1
- package/src/ts/react-website/app/schema.json +11 -6
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +129 -18
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +36 -10
- 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 +4 -4
- package/src/ts/react-website/cognito-auth/generator.js +64 -63
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/grit/cloudscape-auth-menu.grit +8 -6
- package/src/ts/react-website/cognito-auth/grit/cognito-auth-wrapper.grit +1 -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 +1 -0
- package/src/ts/react-website/cognito-auth/schema.json +5 -0
- package/src/ts/react-website/cognito-auth/utils.d.ts +1 -1
- 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 +3 -3
- 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 +3 -3
- package/src/ts/sync/generator.js +60 -59
- package/src/ts/sync/generator.js.map +1 -1
- package/src/ts/website/app/generator.d.ts +3 -3
- 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 +1 -1
- package/src/ts/website/app/schema.json +11 -6
- package/src/ts/website/auth/generator.d.ts +4 -4
- 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 +1 -0
- package/src/ts/website/auth/schema.json +5 -0
- package/src/utils/agent-chat/agent-chat.d.ts +31 -0
- package/src/utils/agent-chat/agent-chat.js +29 -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 +117 -25
- package/src/utils/agent-connection/agent-connection.js +411 -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 +22 -32
- 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 +36 -0
- 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 +99 -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-mcp/agentcore_mcp_transport.py.template +34 -0
- package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +5 -18
- 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 +66 -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/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 +11 -3
- package/src/utils/agent-core-constructs/agent-core-constructs.js +86 -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 +4 -0
- package/src/utils/agent-core-constructs/files/cdk/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.ts.template +50 -0
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +487 -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/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +449 -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/core/agent-core/runtime.tf.template +80 -12
- 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 +2 -2
- package/src/utils/api-constructs/api-constructs.js +30 -31
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +3 -0
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +23 -6
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account/index.js.template +58 -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 +51 -15
- 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 +1 -8
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +94 -4
- 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 +2 -2
- 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.d.ts +5 -1
- package/src/utils/ast/website.js +18 -20
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.d.ts +33 -1
- package/src/utils/ast.js +130 -70
- package/src/utils/ast.js.map +1 -1
- package/src/utils/bundle/bundle.d.ts +1 -1
- package/src/utils/bundle/bundle.js +50 -47
- package/src/utils/bundle/bundle.js.map +1 -1
- package/src/utils/commands.js +47 -26
- package/src/utils/commands.js.map +1 -1
- package/src/utils/config/index.d.ts +5 -5
- package/src/utils/config/index.js +5 -4
- package/src/utils/config/index.js.map +1 -1
- package/src/utils/config/utils.d.ts +13 -3
- package/src/utils/config/utils.js +65 -43
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +1 -1
- package/src/utils/connection/open-api/react.d.ts +6 -6
- package/src/utils/connection/open-api/react.js +81 -77
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/containers.d.ts +1 -1
- package/src/utils/containers.js +22 -23
- package/src/utils/containers.js.map +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.d.ts +18 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +48 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -0
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +43 -0
- package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +105 -0
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +72 -0
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +155 -0
- package/src/utils/files/common/scripts/src/dynamodb/create-local-table.ts.template +195 -0
- 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 +106 -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/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 +117 -0
- package/src/utils/files/terraform/src/core/asset-bucket/asset-bucket.tf.template +2 -2
- 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 +45 -2
- package/src/utils/format.js +323 -81
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.d.ts +1 -1
- package/src/utils/fs.js +14 -13
- package/src/utils/fs.js.map +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 +2 -2
- package/src/utils/function-constructs/function-constructs.js +21 -26
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.d.ts +4 -0
- package/src/utils/generators.js +18 -20
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.d.ts +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 +1 -1
- 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 +123 -14
- 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 +106 -6
- package/src/utils/identity-constructs/files/terraform/core/user-identity/main.tf.template +7 -0
- package/src/utils/identity-constructs/identity-constructs.d.ts +2 -2
- package/src/utils/identity-constructs/identity-constructs.js +24 -28
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/install.d.ts +32 -0
- package/src/utils/install.js +56 -0
- package/src/utils/install.js.map +1 -0
- package/src/utils/js.d.ts +4 -0
- package/src/utils/js.js +27 -20
- package/src/utils/js.js.map +1 -1
- package/src/utils/mcp.d.ts +25 -0
- package/src/utils/mcp.js +74 -0
- package/src/utils/mcp.js.map +1 -0
- package/src/utils/metrics.d.ts +9 -3
- package/src/utils/metrics.js +61 -46
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/mock-project-graph.js +8 -12
- package/src/utils/mock-project-graph.js.map +1 -1
- package/src/utils/names.d.ts +16 -0
- package/src/utils/names.js +39 -48
- package/src/utils/names.js.map +1 -1
- package/src/utils/npm-scope.d.ts +1 -1
- package/src/utils/npm-scope.js +9 -17
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +25 -4
- package/src/utils/nx.js +144 -75
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.d.ts +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.d.ts +1 -1
- package/src/utils/paths.js +11 -15
- package/src/utils/paths.js.map +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 -1
- package/src/utils/pnpm-workspace.js +22 -22
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.d.ts +31 -3
- package/src/utils/port.js +72 -12
- package/src/utils/port.js.map +1 -1
- package/src/utils/py.d.ts +16 -3
- package/src/utils/py.js +72 -47
- package/src/utils/py.js.map +1 -1
- package/src/utils/rdb-constructs/files/cdk/app/dbs/__nameKebabCase__.ts.template +12 -2
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +35 -16
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +42 -48
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +31 -16
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +5 -4
- package/src/utils/rdb-constructs/rdb-constructs.js +31 -41
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs-constants.d.ts +1 -0
- package/src/utils/shared-constructs-constants.js +16 -15
- package/src/utils/shared-constructs-constants.js.map +1 -1
- package/src/utils/shared-constructs.d.ts +2 -2
- package/src/utils/shared-constructs.js +57 -54
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-dynamodb-scripts.d.ts +11 -0
- package/src/utils/shared-dynamodb-scripts.js +25 -0
- package/src/utils/shared-dynamodb-scripts.js.map +1 -0
- package/src/utils/shared-infra-config.d.ts +1 -1
- package/src/utils/shared-infra-config.js +30 -31
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-infra-scripts.d.ts +11 -0
- package/src/utils/shared-infra-scripts.js +40 -0
- package/src/utils/shared-infra-scripts.js.map +1 -0
- package/src/utils/shared-rdb-scripts.d.ts +16 -0
- package/src/utils/shared-rdb-scripts.js +28 -0
- package/src/utils/shared-rdb-scripts.js.map +1 -0
- package/src/utils/shared-scripts.d.ts +2 -5
- package/src/utils/shared-scripts.js +12 -38
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.d.ts +1 -1
- package/src/utils/shared-shadcn.js +64 -72
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +13 -1
- package/src/utils/test.js +35 -23
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.d.ts +1 -1
- package/src/utils/toml.js +10 -14
- package/src/utils/toml.js.map +1 -1
- package/src/utils/versions.d.ts +116 -84
- package/src/utils/versions.js +124 -102
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +73 -5
- package/src/utils/website-constructs/files/terraform/app/static-websites/__websiteNameKebabCase__/__websiteNameKebabCase__.tf.template +1 -1
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +68 -19
- package/src/utils/website-constructs/website-constructs.d.ts +2 -2
- package/src/utils/website-constructs/website-constructs.js +31 -30
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- 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/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.js +0 -48
- package/src/connection/agent-serve-local.js.map +0 -1
- package/src/connection/serve-local.d.ts +0 -15
- package/src/connection/serve-local.js +0 -41
- package/src/connection/serve-local.js.map +0 -1
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client.py.template +0 -22
- 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/lib/eslint.d.ts +0 -14
- package/src/ts/lib/eslint.js +0 -90
- package/src/ts/lib/eslint.js.map +0 -1
- package/src/ts/lib/grit/eslint-dependency-checks-warn.grit +0 -1
- package/src/ts/rdb/files/scripts/docker-pull.ts.template +0 -15
- package/src/ts/rdb/files/scripts/docker-start.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/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/{bin → src/bin}/aws-nx-mcp.d.ts +0 -0
- /package/src/utils/agent-connection/files/{core-runtime-config/with-session-id.ts.template → core-strands/base/with-session-id-strands.ts.template} +0 -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} +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/{infra-deploy.ts.template → infra/infra-deploy.ts.template} +0 -0
- /package/src/utils/files/common/scripts/src/{infra-destroy.ts.template → infra/infra-destroy.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}/run.ts.template +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/stage-parser.ts.template +0 -0
|
@@ -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: {
|
|
@@ -40,6 +40,7 @@ export default defineConfig(() => ({
|
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
test: {
|
|
43
|
+
passWithNoTests: true,
|
|
43
44
|
name: '@proj/test-app',
|
|
44
45
|
watch: false,
|
|
45
46
|
globals: true,
|
|
@@ -50,7 +51,6 @@ export default defineConfig(() => ({
|
|
|
50
51
|
reportsDirectory: './test-output/vitest/coverage',
|
|
51
52
|
provider: 'v8' as const,
|
|
52
53
|
},
|
|
53
|
-
passWithNoTests: true,
|
|
54
54
|
},
|
|
55
55
|
resolve: { tsconfigPaths: true },
|
|
56
56
|
define: { global: {} },
|
|
@@ -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: {
|
|
@@ -96,6 +96,7 @@ export default defineConfig(() => ({
|
|
|
96
96
|
},
|
|
97
97
|
},
|
|
98
98
|
test: {
|
|
99
|
+
passWithNoTests: true,
|
|
99
100
|
name: '@proj/test-app',
|
|
100
101
|
watch: false,
|
|
101
102
|
globals: true,
|
|
@@ -106,7 +107,6 @@ export default defineConfig(() => ({
|
|
|
106
107
|
reportsDirectory: './test-output/vitest/coverage',
|
|
107
108
|
provider: 'v8' as const,
|
|
108
109
|
},
|
|
109
|
-
passWithNoTests: true,
|
|
110
110
|
},
|
|
111
111
|
resolve: { tsconfigPaths: true },
|
|
112
112
|
define: { global: {} },
|
|
@@ -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.52.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,15 @@ variable "website_file_path" {
|
|
|
152
152
|
type = string
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
# Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
156
|
+
# framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
157
|
+
# (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
158
|
+
# Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
159
|
+
# connect-src to your specific origins once they are known.
|
|
160
|
+
locals {
|
|
161
|
+
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'"
|
|
162
|
+
}
|
|
163
|
+
|
|
155
164
|
|
|
156
165
|
# Data sources
|
|
157
166
|
data "aws_caller_identity" "current" {}
|
|
@@ -512,13 +521,42 @@ resource "aws_cloudfront_origin_access_control" "website_oac" {
|
|
|
512
521
|
signing_protocol = "sigv4"
|
|
513
522
|
}
|
|
514
523
|
|
|
524
|
+
# Security headers applied to all responses.
|
|
525
|
+
resource "aws_cloudfront_response_headers_policy" "website" {
|
|
526
|
+
name = "\${aws_s3_bucket.website.bucket}-security-headers"
|
|
527
|
+
|
|
528
|
+
security_headers_config {
|
|
529
|
+
strict_transport_security {
|
|
530
|
+
access_control_max_age_sec = 63072000
|
|
531
|
+
include_subdomains = true
|
|
532
|
+
preload = true
|
|
533
|
+
override = true
|
|
534
|
+
}
|
|
535
|
+
content_type_options {
|
|
536
|
+
override = true
|
|
537
|
+
}
|
|
538
|
+
frame_options {
|
|
539
|
+
frame_option = "DENY"
|
|
540
|
+
override = true
|
|
541
|
+
}
|
|
542
|
+
referrer_policy {
|
|
543
|
+
referrer_policy = "strict-origin-when-cross-origin"
|
|
544
|
+
override = true
|
|
545
|
+
}
|
|
546
|
+
content_security_policy {
|
|
547
|
+
content_security_policy = local.content_security_policy
|
|
548
|
+
override = true
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
515
553
|
# CloudFront Distribution
|
|
516
554
|
resource "aws_cloudfront_distribution" "website" {
|
|
555
|
+
# See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
517
556
|
#checkov:skip=CKV_AWS_174:Using CloudFront default certificate which does not support TLS v1.2
|
|
518
557
|
#checkov:skip=CKV_AWS_310:Origin failover not required for single S3 origin static website
|
|
519
558
|
#checkov:skip=CKV_AWS_374:Geo restrictions not required for global web application
|
|
520
559
|
#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
560
|
#checkov:skip=CKV2_AWS_47:WAF includes AWSManagedRulesKnownBadInputsRuleSet which provides Log4j protection
|
|
523
561
|
origin {
|
|
524
562
|
domain_name = aws_s3_bucket.website.bucket_regional_domain_name
|
|
@@ -548,11 +586,12 @@ resource "aws_cloudfront_distribution" "website" {
|
|
|
548
586
|
}
|
|
549
587
|
}
|
|
550
588
|
|
|
551
|
-
viewer_protocol_policy
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
589
|
+
viewer_protocol_policy = "redirect-to-https"
|
|
590
|
+
response_headers_policy_id = aws_cloudfront_response_headers_policy.website.id
|
|
591
|
+
min_ttl = 0
|
|
592
|
+
default_ttl = 3600
|
|
593
|
+
max_ttl = 86400
|
|
594
|
+
compress = true
|
|
556
595
|
}
|
|
557
596
|
|
|
558
597
|
# Custom error responses for SPA routing
|
|
@@ -656,8 +695,8 @@ resource "null_resource" "upload_website_files" {
|
|
|
656
695
|
|
|
657
696
|
provisioner "local-exec" {
|
|
658
697
|
command = <<-EOT
|
|
659
|
-
cd "
|
|
660
|
-
uv run --with boto3 python3 -c "
|
|
698
|
+
cd "$ROOT_PATH"
|
|
699
|
+
uv run --with boto3==1.43.37 python3 -c "
|
|
661
700
|
import os
|
|
662
701
|
import sys
|
|
663
702
|
import boto3
|
|
@@ -745,9 +784,14 @@ def sync_to_s3(local_path, bucket_name):
|
|
|
745
784
|
sys.exit(1)
|
|
746
785
|
|
|
747
786
|
# Execute sync
|
|
748
|
-
sync_to_s3(
|
|
787
|
+
sync_to_s3(os.environ['WEBSITE_FILE_PATH'], os.environ['BUCKET_NAME'])
|
|
749
788
|
"
|
|
750
789
|
EOT
|
|
790
|
+
environment = {
|
|
791
|
+
ROOT_PATH = path.root
|
|
792
|
+
WEBSITE_FILE_PATH = var.website_file_path
|
|
793
|
+
BUCKET_NAME = aws_s3_bucket.website.bucket
|
|
794
|
+
}
|
|
751
795
|
}
|
|
752
796
|
|
|
753
797
|
depends_on = [aws_s3_bucket_policy.website_cloudfront_policy]
|
|
@@ -755,11 +799,12 @@ sync_to_s3('\${var.website_file_path}', '\${aws_s3_bucket.website.bucket}')
|
|
|
755
799
|
|
|
756
800
|
# Upload runtime config file
|
|
757
801
|
resource "aws_s3_object" "runtime_config" {
|
|
758
|
-
bucket
|
|
759
|
-
key
|
|
760
|
-
content
|
|
761
|
-
content_type
|
|
762
|
-
|
|
802
|
+
bucket = aws_s3_bucket.website.id
|
|
803
|
+
key = "runtime-config.json"
|
|
804
|
+
content = module.runtime_config_reader.config_json
|
|
805
|
+
content_type = "application/json"
|
|
806
|
+
cache_control = "no-cache"
|
|
807
|
+
etag = md5(module.runtime_config_reader.config_json)
|
|
763
808
|
|
|
764
809
|
depends_on = [null_resource.upload_website_files]
|
|
765
810
|
}
|
|
@@ -774,8 +819,9 @@ resource "null_resource" "cloudfront_invalidation" {
|
|
|
774
819
|
|
|
775
820
|
provisioner "local-exec" {
|
|
776
821
|
command = <<-EOT
|
|
777
|
-
uv run --with boto3 python3 -c "
|
|
822
|
+
uv run --with boto3==1.43.37 python3 -c "
|
|
778
823
|
import boto3
|
|
824
|
+
import os
|
|
779
825
|
import sys
|
|
780
826
|
from botocore.exceptions import ClientError, NoCredentialsError
|
|
781
827
|
|
|
@@ -797,7 +843,7 @@ def create_invalidation(distribution_id):
|
|
|
797
843
|
|
|
798
844
|
invalidation_id = response['Invalidation']['Id']
|
|
799
845
|
print(f'CloudFront cache invalidation created: {invalidation_id}')
|
|
800
|
-
print(f'Distribution:
|
|
846
|
+
print(f'Distribution: {distribution_id}')
|
|
801
847
|
print(f'Status: {response[\\"Invalidation\\"][\\"Status\\"]}')
|
|
802
848
|
|
|
803
849
|
except NoCredentialsError:
|
|
@@ -811,9 +857,12 @@ def create_invalidation(distribution_id):
|
|
|
811
857
|
sys.exit(1)
|
|
812
858
|
|
|
813
859
|
# Execute invalidation
|
|
814
|
-
create_invalidation(
|
|
860
|
+
create_invalidation(os.environ['DISTRIBUTION_ID'])
|
|
815
861
|
"
|
|
816
862
|
EOT
|
|
863
|
+
environment = {
|
|
864
|
+
DISTRIBUTION_ID = aws_cloudfront_distribution.website.id
|
|
865
|
+
}
|
|
817
866
|
}
|
|
818
867
|
|
|
819
868
|
depends_on = [
|
|
@@ -856,7 +905,7 @@ output "waf_web_acl_arn" {
|
|
|
856
905
|
required_providers {
|
|
857
906
|
aws = {
|
|
858
907
|
source = "hashicorp/aws"
|
|
859
|
-
version = "
|
|
908
|
+
version = "6.52.0"
|
|
860
909
|
configuration_aliases = [aws.us_east_1]
|
|
861
910
|
}
|
|
862
911
|
}
|
|
@@ -905,61 +954,60 @@ vitest.config.*.timestamp*
|
|
|
905
954
|
runtime-config.json"
|
|
906
955
|
`;
|
|
907
956
|
|
|
908
|
-
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > .prettierrc 1`] = `
|
|
909
|
-
"{ "singleQuote": true }
|
|
910
|
-
"
|
|
911
|
-
`;
|
|
957
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > .prettierrc 1`] = `"{"singleQuote":true}"`;
|
|
912
958
|
|
|
913
|
-
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly >
|
|
914
|
-
"
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
{
|
|
923
|
-
ignores: [
|
|
924
|
-
'**/dist',
|
|
925
|
-
'**/out-tsc',
|
|
926
|
-
'**/vite.config.*.timestamp*',
|
|
927
|
-
'**/vitest.config.*.timestamp*',
|
|
928
|
-
],
|
|
959
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > biome.json 1`] = `
|
|
960
|
+
"{
|
|
961
|
+
"$schema": "https://biomejs.dev/schemas/2.4.16/schema.json",
|
|
962
|
+
"root": true,
|
|
963
|
+
"formatter": {
|
|
964
|
+
"enabled": true,
|
|
965
|
+
"indentStyle": "space",
|
|
966
|
+
"indentWidth": 2,
|
|
967
|
+
"lineWidth": 80
|
|
929
968
|
},
|
|
930
|
-
{
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
{
|
|
940
|
-
sourceTag: '*',
|
|
941
|
-
onlyDependOnLibsWithTags: ['*'],
|
|
942
|
-
},
|
|
943
|
-
],
|
|
944
|
-
},
|
|
945
|
-
],
|
|
969
|
+
"javascript": {
|
|
970
|
+
"formatter": {
|
|
971
|
+
"quoteStyle": "single",
|
|
972
|
+
"trailingCommas": "all"
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
"css": {
|
|
976
|
+
"formatter": {
|
|
977
|
+
"quoteStyle": "single"
|
|
946
978
|
},
|
|
979
|
+
"linter": {
|
|
980
|
+
"enabled": false
|
|
981
|
+
}
|
|
947
982
|
},
|
|
948
|
-
{
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
'**/*.cjs',
|
|
957
|
-
'**/*.mjs',
|
|
958
|
-
],
|
|
959
|
-
// Override or add rules here
|
|
960
|
-
rules: {},
|
|
983
|
+
"linter": {
|
|
984
|
+
"enabled": true,
|
|
985
|
+
"rules": {
|
|
986
|
+
"recommended": false,
|
|
987
|
+
"correctness": {
|
|
988
|
+
"noUndeclaredDependencies": "warn"
|
|
989
|
+
}
|
|
990
|
+
}
|
|
961
991
|
},
|
|
962
|
-
|
|
992
|
+
"assist": {
|
|
993
|
+
"actions": {
|
|
994
|
+
"source": {
|
|
995
|
+
"organizeImports": "on"
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
},
|
|
999
|
+
"files": {
|
|
1000
|
+
"includes": [
|
|
1001
|
+
"**",
|
|
1002
|
+
"!**/dist",
|
|
1003
|
+
"!**/out-tsc",
|
|
1004
|
+
"!**/node_modules",
|
|
1005
|
+
"!**/.nx",
|
|
1006
|
+
"!**/.venv",
|
|
1007
|
+
"!**/*.css"
|
|
1008
|
+
]
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
963
1011
|
"
|
|
964
1012
|
`;
|
|
965
1013
|
|
|
@@ -971,52 +1019,72 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
971
1019
|
"targetDefaults": {
|
|
972
1020
|
"build": {
|
|
973
1021
|
"cache": true,
|
|
974
|
-
"dependsOn": ["^build"],
|
|
975
1022
|
"inputs": ["default"]
|
|
976
1023
|
},
|
|
977
1024
|
"lint": {
|
|
978
1025
|
"cache": true
|
|
979
1026
|
},
|
|
980
|
-
"
|
|
981
|
-
"cache": true,
|
|
982
|
-
"inputs": [
|
|
983
|
-
"default",
|
|
984
|
-
"^default",
|
|
985
|
-
"{workspaceRoot}/.eslintrc.json",
|
|
986
|
-
"{workspaceRoot}/.eslintignore",
|
|
987
|
-
"{workspaceRoot}/eslint.config.mjs",
|
|
988
|
-
"{workspaceRoot}/tools/eslint-rules/**/*"
|
|
989
|
-
]
|
|
990
|
-
},
|
|
991
|
-
"@nx/vite:build": {
|
|
992
|
-
"cache": true,
|
|
1027
|
+
"test": {
|
|
993
1028
|
"dependsOn": ["^build"],
|
|
994
|
-
"inputs": ["default"
|
|
1029
|
+
"inputs": ["default"]
|
|
995
1030
|
},
|
|
996
1031
|
"@nx/vitest:test": {
|
|
997
1032
|
"cache": true,
|
|
998
|
-
"inputs": ["default", "^
|
|
1033
|
+
"inputs": ["default", "^production"],
|
|
999
1034
|
"configurations": {
|
|
1000
1035
|
"update-snapshot": {
|
|
1001
1036
|
"args": "--update"
|
|
1002
1037
|
}
|
|
1003
1038
|
}
|
|
1004
1039
|
},
|
|
1005
|
-
"test": {
|
|
1006
|
-
"dependsOn": ["^build"],
|
|
1007
|
-
"inputs": ["default"]
|
|
1008
|
-
},
|
|
1009
1040
|
"compile": {
|
|
1010
1041
|
"cache": true,
|
|
1011
1042
|
"inputs": ["default"]
|
|
1012
1043
|
}
|
|
1013
1044
|
},
|
|
1045
|
+
"plugins": [
|
|
1046
|
+
{
|
|
1047
|
+
"plugin": "@nx/js/typescript",
|
|
1048
|
+
"options": {
|
|
1049
|
+
"typecheck": {
|
|
1050
|
+
"targetName": "typecheck"
|
|
1051
|
+
},
|
|
1052
|
+
"build": {
|
|
1053
|
+
"targetName": "compile",
|
|
1054
|
+
"configName": "tsconfig.lib.json",
|
|
1055
|
+
"buildDepsName": "build-deps",
|
|
1056
|
+
"watchDepsName": "watch-deps"
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
},
|
|
1060
|
+
{
|
|
1061
|
+
"plugin": "@nx/vite/plugin",
|
|
1062
|
+
"options": {
|
|
1063
|
+
"buildTargetName": "bundle",
|
|
1064
|
+
"serveTargetName": "serve",
|
|
1065
|
+
"devTargetName": "serve",
|
|
1066
|
+
"previewTargetName": "preview",
|
|
1067
|
+
"serveStaticTargetName": "serve-static",
|
|
1068
|
+
"typecheckTargetName": "vite:typecheck",
|
|
1069
|
+
"buildDepsTargetName": "build-deps",
|
|
1070
|
+
"watchDepsTargetName": "watch-deps"
|
|
1071
|
+
}
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
"plugin": "@nx/vitest",
|
|
1075
|
+
"options": {
|
|
1076
|
+
"testTargetName": "test",
|
|
1077
|
+
"ciTargetName": "test-ci",
|
|
1078
|
+
"testMode": "watch"
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
],
|
|
1014
1082
|
"generators": {
|
|
1015
1083
|
"@nx/react": {
|
|
1016
1084
|
"application": {
|
|
1017
1085
|
"babel": true,
|
|
1018
1086
|
"style": "css",
|
|
1019
|
-
"linter": "
|
|
1087
|
+
"linter": "none",
|
|
1020
1088
|
"bundler": "vite"
|
|
1021
1089
|
},
|
|
1022
1090
|
"component": {
|
|
@@ -1024,39 +1092,19 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1024
1092
|
},
|
|
1025
1093
|
"library": {
|
|
1026
1094
|
"style": "css",
|
|
1027
|
-
"linter": "
|
|
1095
|
+
"linter": "none"
|
|
1028
1096
|
}
|
|
1029
1097
|
}
|
|
1030
1098
|
},
|
|
1031
1099
|
"namedInputs": {
|
|
1032
|
-
"
|
|
1033
|
-
"default",
|
|
1034
|
-
"{workspaceRoot}/eslint.config.mjs",
|
|
1035
|
-
"{projectRoot}/eslint.config.mjs"
|
|
1036
|
-
],
|
|
1100
|
+
"biome": ["default", "{workspaceRoot}/biome.json"],
|
|
1037
1101
|
"default": [
|
|
1038
1102
|
{
|
|
1039
1103
|
"dependentTasksOutputFiles": "**/*",
|
|
1040
1104
|
"transitive": true
|
|
1041
1105
|
}
|
|
1042
1106
|
]
|
|
1043
|
-
}
|
|
1044
|
-
"plugins": [
|
|
1045
|
-
{
|
|
1046
|
-
"plugin": "@nx/js/typescript",
|
|
1047
|
-
"options": {
|
|
1048
|
-
"typecheck": {
|
|
1049
|
-
"targetName": "typecheck"
|
|
1050
|
-
},
|
|
1051
|
-
"build": {
|
|
1052
|
-
"targetName": "compile",
|
|
1053
|
-
"configName": "tsconfig.lib.json",
|
|
1054
|
-
"buildDepsName": "build-deps",
|
|
1055
|
-
"watchDepsName": "watch-deps"
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
]
|
|
1107
|
+
}
|
|
1060
1108
|
}
|
|
1061
1109
|
"
|
|
1062
1110
|
`;
|
|
@@ -1065,57 +1113,38 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1065
1113
|
"{
|
|
1066
1114
|
"name": "@proj/source",
|
|
1067
1115
|
"dependencies": {
|
|
1068
|
-
"@cloudscape-design/board-components": "3.0.
|
|
1069
|
-
"@cloudscape-design/components": "3.0.
|
|
1070
|
-
"@cloudscape-design/global-styles": "1.0.
|
|
1071
|
-
"aws-cdk-lib": "2.
|
|
1116
|
+
"@cloudscape-design/board-components": "3.0.197",
|
|
1117
|
+
"@cloudscape-design/components": "3.0.1320",
|
|
1118
|
+
"@cloudscape-design/global-styles": "1.0.61",
|
|
1119
|
+
"aws-cdk-lib": "2.260.0",
|
|
1072
1120
|
"constructs": "10.6.0",
|
|
1073
1121
|
"react": "19.2.7",
|
|
1074
1122
|
"react-dom": "19.2.7",
|
|
1075
|
-
"tailwindcss": "4.
|
|
1123
|
+
"tailwindcss": "4.2.2"
|
|
1076
1124
|
},
|
|
1077
1125
|
"devDependencies": {
|
|
1078
|
-
"@
|
|
1079
|
-
"@nx/
|
|
1080
|
-
"@nx/
|
|
1081
|
-
"@nx/
|
|
1082
|
-
"@nx/
|
|
1083
|
-
"@nx/vite": "22.7.5",
|
|
1084
|
-
"@nx/vitest": "22.7.5",
|
|
1085
|
-
"@nx/web": "22.7.5",
|
|
1086
|
-
"@swc-node/register": "~1.11.1",
|
|
1087
|
-
"@swc/cli": "~0.8.0",
|
|
1088
|
-
"@swc/core": "~1.15.5",
|
|
1126
|
+
"@nx/js": "23.0.1",
|
|
1127
|
+
"@nx/react": "23.0.1",
|
|
1128
|
+
"@nx/vite": "23.0.1",
|
|
1129
|
+
"@nx/vitest": "23.0.1",
|
|
1130
|
+
"@nx/web": "23.0.1",
|
|
1089
1131
|
"@swc/helpers": "~0.5.18",
|
|
1090
|
-
"@tailwindcss/vite": "4.
|
|
1132
|
+
"@tailwindcss/vite": "4.2.2",
|
|
1091
1133
|
"@testing-library/dom": "10.4.0",
|
|
1092
1134
|
"@testing-library/react": "16.3.0",
|
|
1093
|
-
"@types/node": "25.9.
|
|
1135
|
+
"@types/node": "25.9.4",
|
|
1094
1136
|
"@types/react": "^19.0.0",
|
|
1095
1137
|
"@types/react-dom": "^19.0.0",
|
|
1096
1138
|
"@vitejs/plugin-react": "^6.0.0",
|
|
1097
|
-
"@vitest/coverage-v8": "4.1.
|
|
1098
|
-
"@vitest/ui": "4.1.
|
|
1099
|
-
"eslint": "^9.8.0",
|
|
1100
|
-
"eslint-config-prettier": "^10.0.0",
|
|
1101
|
-
"eslint-plugin-import": "2.31.0",
|
|
1102
|
-
"eslint-plugin-jsx-a11y": "6.10.1",
|
|
1103
|
-
"eslint-plugin-prettier": "5.5.6",
|
|
1104
|
-
"eslint-plugin-react": "7.35.0",
|
|
1105
|
-
"eslint-plugin-react-hooks": "5.0.0",
|
|
1139
|
+
"@vitest/coverage-v8": "4.1.9",
|
|
1140
|
+
"@vitest/ui": "4.1.9",
|
|
1106
1141
|
"jiti": "2.4.2",
|
|
1107
|
-
"jsdom": "
|
|
1108
|
-
"jsonc-eslint-parser": "3.1.0",
|
|
1109
|
-
"prettier": "3.8.3",
|
|
1142
|
+
"jsdom": "^27.1.0",
|
|
1110
1143
|
"typescript": "~5.9.2",
|
|
1111
|
-
"
|
|
1112
|
-
"
|
|
1113
|
-
"vitest": "4.1.7"
|
|
1144
|
+
"vite": "8.1.0",
|
|
1145
|
+
"vitest": "4.1.9"
|
|
1114
1146
|
},
|
|
1115
|
-
"type": "module"
|
|
1116
|
-
"scripts": {
|
|
1117
|
-
"dev": "nx serve-local @proj/test-app"
|
|
1118
|
-
}
|
|
1147
|
+
"type": "module"
|
|
1119
1148
|
}
|
|
1120
1149
|
"
|
|
1121
1150
|
`;
|
|
@@ -1153,35 +1182,7 @@ You can also automatiaclly fix some lint errors by running the following command
|
|
|
1153
1182
|
|
|
1154
1183
|
- [common-constructs reference docs](TODO)
|
|
1155
1184
|
- [Learn more about NX](https://nx.dev/getting-started/intro)
|
|
1156
|
-
"
|
|
1157
|
-
`;
|
|
1158
|
-
|
|
1159
|
-
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > packages/common/constructs/eslint.config.mjs 1`] = `
|
|
1160
|
-
"import baseConfig from '../../../eslint.config.mjs';
|
|
1161
1185
|
|
|
1162
|
-
export default [
|
|
1163
|
-
...baseConfig,
|
|
1164
|
-
{
|
|
1165
|
-
files: ['**/*.json'],
|
|
1166
|
-
rules: {
|
|
1167
|
-
'@nx/dependency-checks': [
|
|
1168
|
-
'warn',
|
|
1169
|
-
{
|
|
1170
|
-
ignoredFiles: [
|
|
1171
|
-
'{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}',
|
|
1172
|
-
'{projectRoot}/vitest.config.{js,ts,mjs,mts}',
|
|
1173
|
-
],
|
|
1174
|
-
},
|
|
1175
|
-
],
|
|
1176
|
-
},
|
|
1177
|
-
languageOptions: {
|
|
1178
|
-
parser: await import('jsonc-eslint-parser'),
|
|
1179
|
-
},
|
|
1180
|
-
},
|
|
1181
|
-
{
|
|
1182
|
-
ignores: ['**/out-tsc'],
|
|
1183
|
-
},
|
|
1184
|
-
];
|
|
1185
1186
|
"
|
|
1186
1187
|
`;
|
|
1187
1188
|
|
|
@@ -1192,6 +1193,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1192
1193
|
"sourceRoot": "packages/common/constructs/src",
|
|
1193
1194
|
"projectType": "library",
|
|
1194
1195
|
"tags": [],
|
|
1196
|
+
"metadata": {
|
|
1197
|
+
"generator": "ts#project"
|
|
1198
|
+
},
|
|
1195
1199
|
"targets": {
|
|
1196
1200
|
"build": {
|
|
1197
1201
|
"dependsOn": ["lint", "compile", "test", "@proj/test-app:build"]
|
|
@@ -1205,28 +1209,21 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1205
1209
|
}
|
|
1206
1210
|
},
|
|
1207
1211
|
"lint": {
|
|
1208
|
-
"executor": "
|
|
1212
|
+
"executor": "nx:run-commands",
|
|
1209
1213
|
"cache": true,
|
|
1210
|
-
"inputs": ["
|
|
1214
|
+
"inputs": ["biome"],
|
|
1215
|
+
"options": {
|
|
1216
|
+
"command": "biome lint {projectRoot}"
|
|
1217
|
+
},
|
|
1211
1218
|
"configurations": {
|
|
1212
1219
|
"fix": {
|
|
1213
|
-
"
|
|
1220
|
+
"command": "biome check --write {projectRoot}"
|
|
1214
1221
|
},
|
|
1215
1222
|
"skip-lint": {
|
|
1216
|
-
"
|
|
1223
|
+
"command": "node -e \\"\\""
|
|
1217
1224
|
}
|
|
1218
1225
|
}
|
|
1219
|
-
},
|
|
1220
|
-
"test": {
|
|
1221
|
-
"executor": "@nx/vitest:test",
|
|
1222
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
1223
|
-
"options": {
|
|
1224
|
-
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
1225
|
-
}
|
|
1226
1226
|
}
|
|
1227
|
-
},
|
|
1228
|
-
"metadata": {
|
|
1229
|
-
"generator": "ts#project"
|
|
1230
1227
|
}
|
|
1231
1228
|
}
|
|
1232
1229
|
"
|
|
@@ -1536,11 +1533,18 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1536
1533
|
"import {
|
|
1537
1534
|
CfnOutput,
|
|
1538
1535
|
CfnResource,
|
|
1536
|
+
Duration,
|
|
1539
1537
|
Lazy,
|
|
1540
1538
|
RemovalPolicy,
|
|
1541
1539
|
Stack,
|
|
1542
1540
|
} from 'aws-cdk-lib';
|
|
1543
|
-
import {
|
|
1541
|
+
import {
|
|
1542
|
+
Distribution,
|
|
1543
|
+
HeadersFrameOption,
|
|
1544
|
+
HeadersReferrerPolicy,
|
|
1545
|
+
ResponseHeadersPolicy,
|
|
1546
|
+
ViewerProtocolPolicy,
|
|
1547
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
1544
1548
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
1545
1549
|
import {
|
|
1546
1550
|
BlockPublicAccess,
|
|
@@ -1549,7 +1553,11 @@ import {
|
|
|
1549
1553
|
IBucket,
|
|
1550
1554
|
ObjectOwnership,
|
|
1551
1555
|
} from 'aws-cdk-lib/aws-s3';
|
|
1552
|
-
import {
|
|
1556
|
+
import {
|
|
1557
|
+
BucketDeployment,
|
|
1558
|
+
CacheControl,
|
|
1559
|
+
Source,
|
|
1560
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
1553
1561
|
import { Construct } from 'constructs';
|
|
1554
1562
|
import { RuntimeConfig } from './runtime-config.js';
|
|
1555
1563
|
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
@@ -1558,6 +1566,23 @@ import { suppressRules } from './checkov.js';
|
|
|
1558
1566
|
|
|
1559
1567
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
1560
1568
|
|
|
1569
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
1570
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
1571
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
1572
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
1573
|
+
// connect-src to your specific origins once they are known.
|
|
1574
|
+
const CONTENT_SECURITY_POLICY = [
|
|
1575
|
+
"default-src 'self'",
|
|
1576
|
+
"script-src 'self'",
|
|
1577
|
+
"style-src 'self' 'unsafe-inline'",
|
|
1578
|
+
"img-src 'self' data:",
|
|
1579
|
+
"font-src 'self' data:",
|
|
1580
|
+
"connect-src 'self' https: wss:",
|
|
1581
|
+
"object-src 'none'",
|
|
1582
|
+
"base-uri 'self'",
|
|
1583
|
+
"frame-ancestors 'none'",
|
|
1584
|
+
].join('; ');
|
|
1585
|
+
|
|
1561
1586
|
export interface StaticWebsiteProps {
|
|
1562
1587
|
readonly websiteName: string;
|
|
1563
1588
|
readonly websiteFilePath: string;
|
|
@@ -1649,6 +1674,36 @@ export class StaticWebsite extends Construct {
|
|
|
1649
1674
|
'Distribution log bucket does not need versioning enabled',
|
|
1650
1675
|
);
|
|
1651
1676
|
|
|
1677
|
+
// Security headers applied to all responses.
|
|
1678
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
1679
|
+
this,
|
|
1680
|
+
'ResponseHeadersPolicy',
|
|
1681
|
+
{
|
|
1682
|
+
securityHeadersBehavior: {
|
|
1683
|
+
strictTransportSecurity: {
|
|
1684
|
+
accessControlMaxAge: Duration.days(730),
|
|
1685
|
+
includeSubdomains: true,
|
|
1686
|
+
preload: true,
|
|
1687
|
+
override: true,
|
|
1688
|
+
},
|
|
1689
|
+
contentTypeOptions: { override: true },
|
|
1690
|
+
frameOptions: {
|
|
1691
|
+
frameOption: HeadersFrameOption.DENY,
|
|
1692
|
+
override: true,
|
|
1693
|
+
},
|
|
1694
|
+
referrerPolicy: {
|
|
1695
|
+
referrerPolicy:
|
|
1696
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
1697
|
+
override: true,
|
|
1698
|
+
},
|
|
1699
|
+
contentSecurityPolicy: {
|
|
1700
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
1701
|
+
override: true,
|
|
1702
|
+
},
|
|
1703
|
+
},
|
|
1704
|
+
},
|
|
1705
|
+
);
|
|
1706
|
+
|
|
1652
1707
|
const defaultRootObject = 'index.html';
|
|
1653
1708
|
this.cloudFrontDistribution = new Distribution(
|
|
1654
1709
|
this,
|
|
@@ -1660,6 +1715,7 @@ export class StaticWebsite extends Construct {
|
|
|
1660
1715
|
defaultBehavior: {
|
|
1661
1716
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
1662
1717
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
1718
|
+
responseHeadersPolicy,
|
|
1663
1719
|
},
|
|
1664
1720
|
defaultRootObject,
|
|
1665
1721
|
errorResponses: [
|
|
@@ -1676,6 +1732,7 @@ export class StaticWebsite extends Construct {
|
|
|
1676
1732
|
],
|
|
1677
1733
|
},
|
|
1678
1734
|
);
|
|
1735
|
+
// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
1679
1736
|
suppressRules(
|
|
1680
1737
|
this.cloudFrontDistribution,
|
|
1681
1738
|
['CKV_AWS_174'],
|
|
@@ -1684,8 +1741,17 @@ export class StaticWebsite extends Construct {
|
|
|
1684
1741
|
|
|
1685
1742
|
// Deploy Website
|
|
1686
1743
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
1744
|
+
sources: [Source.asset(websiteFilePath)],
|
|
1745
|
+
destinationBucket: this.websiteBucket,
|
|
1746
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
1747
|
+
distribution: this.cloudFrontDistribution,
|
|
1748
|
+
memoryLimit: 1024,
|
|
1749
|
+
});
|
|
1750
|
+
|
|
1751
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
1752
|
+
// must always fetch the latest configuration.
|
|
1753
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
1687
1754
|
sources: [
|
|
1688
|
-
Source.asset(websiteFilePath),
|
|
1689
1755
|
Source.data(
|
|
1690
1756
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
1691
1757
|
Lazy.string({
|
|
@@ -1697,8 +1763,9 @@ export class StaticWebsite extends Construct {
|
|
|
1697
1763
|
),
|
|
1698
1764
|
],
|
|
1699
1765
|
destinationBucket: this.websiteBucket,
|
|
1700
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
1701
1766
|
distribution: this.cloudFrontDistribution,
|
|
1767
|
+
cacheControl: [CacheControl.noCache()],
|
|
1768
|
+
prune: false,
|
|
1702
1769
|
memoryLimit: 1024,
|
|
1703
1770
|
});
|
|
1704
1771
|
|
|
@@ -1909,6 +1976,7 @@ export default defineConfig(() => ({
|
|
|
1909
1976
|
root: __dirname,
|
|
1910
1977
|
cacheDir: '../../../node_modules/.vite/packages/common/constructs',
|
|
1911
1978
|
test: {
|
|
1979
|
+
passWithNoTests: true,
|
|
1912
1980
|
name: '@proj/common-constructs',
|
|
1913
1981
|
watch: false,
|
|
1914
1982
|
globals: true,
|
|
@@ -1919,7 +1987,6 @@ export default defineConfig(() => ({
|
|
|
1919
1987
|
reportsDirectory: './test-output/vitest/coverage',
|
|
1920
1988
|
provider: 'v8' as const,
|
|
1921
1989
|
},
|
|
1922
|
-
passWithNoTests: true,
|
|
1923
1990
|
},
|
|
1924
1991
|
}));
|
|
1925
1992
|
"
|
|
@@ -1927,15 +1994,14 @@ export default defineConfig(() => ({
|
|
|
1927
1994
|
|
|
1928
1995
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > pnpm-workspace.yaml 1`] = `
|
|
1929
1996
|
"packages:
|
|
1930
|
-
-
|
|
1931
|
-
-
|
|
1932
|
-
-
|
|
1997
|
+
- "packages/*"
|
|
1998
|
+
- "test-app"
|
|
1999
|
+
- "packages/common/*"
|
|
1933
2000
|
"
|
|
1934
2001
|
`;
|
|
1935
2002
|
|
|
1936
2003
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > test-app/README.md 1`] = `
|
|
1937
2004
|
"# @proj/test-app
|
|
1938
|
-
|
|
1939
2005
|
This library was generated with [@aws/nx-plugin](https://github.com/awslabs/nx-plugin-for-aws/).
|
|
1940
2006
|
|
|
1941
2007
|
## Building
|
|
@@ -1984,24 +2050,8 @@ In order to integrate with cognito or trpc backends, you need to have a \`runtim
|
|
|
1984
2050
|
"
|
|
1985
2051
|
`;
|
|
1986
2052
|
|
|
1987
|
-
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > test-app/eslint.config.mjs 1`] = `
|
|
1988
|
-
"import nx from '@nx/eslint-plugin';
|
|
1989
|
-
import baseConfig from '../eslint.config.mjs';
|
|
1990
|
-
|
|
1991
|
-
export default [
|
|
1992
|
-
...nx.configs['flat/react'],
|
|
1993
|
-
...baseConfig,
|
|
1994
|
-
{
|
|
1995
|
-
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
1996
|
-
// Override or add rules here
|
|
1997
|
-
rules: {},
|
|
1998
|
-
},
|
|
1999
|
-
];
|
|
2000
|
-
"
|
|
2001
|
-
`;
|
|
2002
|
-
|
|
2003
2053
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > test-app/index.html 1`] = `
|
|
2004
|
-
"<!
|
|
2054
|
+
"<!DOCTYPE html>
|
|
2005
2055
|
<html lang="en">
|
|
2006
2056
|
<head>
|
|
2007
2057
|
<meta charset="utf-8" />
|
|
@@ -2035,29 +2085,10 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2035
2085
|
},
|
|
2036
2086
|
"targets": {
|
|
2037
2087
|
"build": {
|
|
2038
|
-
"dependsOn": ["lint", "compile", "
|
|
2039
|
-
"options": {
|
|
2040
|
-
"outputPath": "dist/{projectRoot}/bundle"
|
|
2041
|
-
}
|
|
2042
|
-
},
|
|
2043
|
-
"bundle": {
|
|
2044
|
-
"executor": "@nx/vite:build",
|
|
2045
|
-
"outputs": ["{options.outputPath}"],
|
|
2046
|
-
"defaultConfiguration": "production",
|
|
2047
|
-
"options": {
|
|
2048
|
-
"outputPath": "dist/{projectRoot}/bundle"
|
|
2049
|
-
},
|
|
2050
|
-
"configurations": {
|
|
2051
|
-
"development": {
|
|
2052
|
-
"mode": "development"
|
|
2053
|
-
},
|
|
2054
|
-
"production": {
|
|
2055
|
-
"mode": "production"
|
|
2056
|
-
}
|
|
2057
|
-
}
|
|
2088
|
+
"dependsOn": ["lint", "compile", "test", "bundle"]
|
|
2058
2089
|
},
|
|
2059
2090
|
"compile": {
|
|
2060
|
-
"dependsOn": ["
|
|
2091
|
+
"dependsOn": ["^build"],
|
|
2061
2092
|
"executor": "nx:run-commands",
|
|
2062
2093
|
"outputs": ["{workspaceRoot}/dist/{projectRoot}/tsc"],
|
|
2063
2094
|
"options": {
|
|
@@ -2065,16 +2096,27 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2065
2096
|
"cwd": "{projectRoot}"
|
|
2066
2097
|
}
|
|
2067
2098
|
},
|
|
2099
|
+
"dev": {
|
|
2100
|
+
"executor": "nx:run-commands",
|
|
2101
|
+
"continuous": true,
|
|
2102
|
+
"options": {
|
|
2103
|
+
"command": "vite --mode local-dev",
|
|
2104
|
+
"cwd": "{projectRoot}"
|
|
2105
|
+
}
|
|
2106
|
+
},
|
|
2068
2107
|
"lint": {
|
|
2069
|
-
"executor": "
|
|
2108
|
+
"executor": "nx:run-commands",
|
|
2070
2109
|
"cache": true,
|
|
2071
|
-
"inputs": ["
|
|
2110
|
+
"inputs": ["biome"],
|
|
2111
|
+
"options": {
|
|
2112
|
+
"command": "biome lint {projectRoot}"
|
|
2113
|
+
},
|
|
2072
2114
|
"configurations": {
|
|
2073
2115
|
"fix": {
|
|
2074
|
-
"
|
|
2116
|
+
"command": "biome check --write {projectRoot}"
|
|
2075
2117
|
},
|
|
2076
2118
|
"skip-lint": {
|
|
2077
|
-
"
|
|
2119
|
+
"command": "node -e \\"\\""
|
|
2078
2120
|
}
|
|
2079
2121
|
}
|
|
2080
2122
|
},
|
|
@@ -2086,63 +2128,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2086
2128
|
"options": {
|
|
2087
2129
|
"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\\""
|
|
2088
2130
|
}
|
|
2089
|
-
},
|
|
2090
|
-
"preview": {
|
|
2091
|
-
"dependsOn": ["build"],
|
|
2092
|
-
"executor": "@nx/vite:preview-server",
|
|
2093
|
-
"defaultConfiguration": "development",
|
|
2094
|
-
"options": {
|
|
2095
|
-
"buildTarget": "@proj/test-app:build"
|
|
2096
|
-
},
|
|
2097
|
-
"configurations": {
|
|
2098
|
-
"development": {
|
|
2099
|
-
"buildTarget": "@proj/test-app:build:development"
|
|
2100
|
-
},
|
|
2101
|
-
"production": {
|
|
2102
|
-
"buildTarget": "@proj/test-app:build:production"
|
|
2103
|
-
}
|
|
2104
|
-
}
|
|
2105
|
-
},
|
|
2106
|
-
"serve": {
|
|
2107
|
-
"executor": "@nx/vite:dev-server",
|
|
2108
|
-
"defaultConfiguration": "development",
|
|
2109
|
-
"options": {
|
|
2110
|
-
"buildTarget": "@proj/test-app:build"
|
|
2111
|
-
},
|
|
2112
|
-
"configurations": {
|
|
2113
|
-
"development": {
|
|
2114
|
-
"buildTarget": "@proj/test-app:build:development",
|
|
2115
|
-
"hmr": true
|
|
2116
|
-
},
|
|
2117
|
-
"production": {
|
|
2118
|
-
"buildTarget": "@proj/test-app:build:production",
|
|
2119
|
-
"hmr": false
|
|
2120
|
-
}
|
|
2121
|
-
}
|
|
2122
|
-
},
|
|
2123
|
-
"serve-local": {
|
|
2124
|
-
"executor": "@nx/vite:dev-server",
|
|
2125
|
-
"options": {
|
|
2126
|
-
"buildTarget": "@proj/test-app:build:development",
|
|
2127
|
-
"hmr": true,
|
|
2128
|
-
"mode": "serve-local"
|
|
2129
|
-
},
|
|
2130
|
-
"continuous": true
|
|
2131
|
-
},
|
|
2132
|
-
"serve-static": {
|
|
2133
|
-
"executor": "@nx/web:file-server",
|
|
2134
|
-
"dependsOn": ["build"],
|
|
2135
|
-
"options": {
|
|
2136
|
-
"buildTarget": "@proj/test-app:build",
|
|
2137
|
-
"spa": true
|
|
2138
|
-
}
|
|
2139
|
-
},
|
|
2140
|
-
"test": {
|
|
2141
|
-
"executor": "@nx/vitest:test",
|
|
2142
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
2143
|
-
"options": {
|
|
2144
|
-
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
2145
|
-
}
|
|
2146
2131
|
}
|
|
2147
2132
|
}
|
|
2148
2133
|
}
|
|
@@ -2355,9 +2340,14 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2355
2340
|
"@nx/react/typings/cssmodule.d.ts",
|
|
2356
2341
|
"@nx/react/typings/image.d.ts",
|
|
2357
2342
|
"vite/client"
|
|
2358
|
-
]
|
|
2343
|
+
],
|
|
2344
|
+
"rootDir": "src",
|
|
2345
|
+
"module": "esnext",
|
|
2346
|
+
"moduleResolution": "bundler"
|
|
2359
2347
|
},
|
|
2360
2348
|
"exclude": [
|
|
2349
|
+
"out-tsc",
|
|
2350
|
+
"dist",
|
|
2361
2351
|
"src/**/*.spec.ts",
|
|
2362
2352
|
"src/**/*.test.ts",
|
|
2363
2353
|
"src/**/*.spec.tsx",
|
|
@@ -2410,7 +2400,10 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2410
2400
|
"vitest",
|
|
2411
2401
|
"@nx/react/typings/cssmodule.d.ts",
|
|
2412
2402
|
"@nx/react/typings/image.d.ts"
|
|
2413
|
-
]
|
|
2403
|
+
],
|
|
2404
|
+
"jsx": "react-jsx",
|
|
2405
|
+
"module": "esnext",
|
|
2406
|
+
"moduleResolution": "bundler"
|
|
2414
2407
|
},
|
|
2415
2408
|
"include": [
|
|
2416
2409
|
"vite.config.ts",
|
|
@@ -2459,7 +2452,7 @@ export default defineConfig(() => ({
|
|
|
2459
2452
|
// plugins: [],
|
|
2460
2453
|
// },
|
|
2461
2454
|
build: {
|
|
2462
|
-
outDir: '../dist/test-app',
|
|
2455
|
+
outDir: '../dist/test-app/bundle',
|
|
2463
2456
|
emptyOutDir: true,
|
|
2464
2457
|
reportCompressedSize: true,
|
|
2465
2458
|
commonjsOptions: {
|
|
@@ -2467,6 +2460,7 @@ export default defineConfig(() => ({
|
|
|
2467
2460
|
},
|
|
2468
2461
|
},
|
|
2469
2462
|
test: {
|
|
2463
|
+
passWithNoTests: true,
|
|
2470
2464
|
name: '@proj/test-app',
|
|
2471
2465
|
watch: false,
|
|
2472
2466
|
globals: true,
|
|
@@ -2477,7 +2471,6 @@ export default defineConfig(() => ({
|
|
|
2477
2471
|
reportsDirectory: './test-output/vitest/coverage',
|
|
2478
2472
|
provider: 'v8' as const,
|
|
2479
2473
|
},
|
|
2480
|
-
passWithNoTests: true,
|
|
2481
2474
|
},
|
|
2482
2475
|
resolve: { tsconfigPaths: true },
|
|
2483
2476
|
define: { global: {} },
|
|
@@ -2492,6 +2485,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2492
2485
|
":proj/test-app": ["./test-app/src/index.ts"],
|
|
2493
2486
|
":proj/common-constructs": ["./packages/common/constructs/src/index.ts"]
|
|
2494
2487
|
},
|
|
2488
|
+
"composite": true,
|
|
2495
2489
|
"rootDir": "."
|
|
2496
2490
|
}
|
|
2497
2491
|
}
|
|
@@ -2500,6 +2494,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2500
2494
|
|
|
2501
2495
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > tsconfig.json 1`] = `
|
|
2502
2496
|
"{
|
|
2497
|
+
"extends": "./tsconfig.base.json",
|
|
2498
|
+
"files": [],
|
|
2499
|
+
"include": [],
|
|
2503
2500
|
"references": [
|
|
2504
2501
|
{
|
|
2505
2502
|
"path": "./test-app"
|
|
@@ -2528,61 +2525,60 @@ vitest.config.*.timestamp*
|
|
|
2528
2525
|
runtime-config.json"
|
|
2529
2526
|
`;
|
|
2530
2527
|
|
|
2531
|
-
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > .prettierrc 1`] = `
|
|
2532
|
-
"{ "singleQuote": true }
|
|
2533
|
-
"
|
|
2534
|
-
`;
|
|
2528
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > .prettierrc 1`] = `"{"singleQuote":true}"`;
|
|
2535
2529
|
|
|
2536
|
-
exports[`react-website generator > Tanstack router integration > should generate website with router correctly >
|
|
2537
|
-
"
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
{
|
|
2546
|
-
ignores: [
|
|
2547
|
-
'**/dist',
|
|
2548
|
-
'**/out-tsc',
|
|
2549
|
-
'**/vite.config.*.timestamp*',
|
|
2550
|
-
'**/vitest.config.*.timestamp*',
|
|
2551
|
-
],
|
|
2530
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > biome.json 1`] = `
|
|
2531
|
+
"{
|
|
2532
|
+
"$schema": "https://biomejs.dev/schemas/2.4.16/schema.json",
|
|
2533
|
+
"root": true,
|
|
2534
|
+
"formatter": {
|
|
2535
|
+
"enabled": true,
|
|
2536
|
+
"indentStyle": "space",
|
|
2537
|
+
"indentWidth": 2,
|
|
2538
|
+
"lineWidth": 80
|
|
2552
2539
|
},
|
|
2553
|
-
{
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
{
|
|
2563
|
-
sourceTag: '*',
|
|
2564
|
-
onlyDependOnLibsWithTags: ['*'],
|
|
2565
|
-
},
|
|
2566
|
-
],
|
|
2567
|
-
},
|
|
2568
|
-
],
|
|
2540
|
+
"javascript": {
|
|
2541
|
+
"formatter": {
|
|
2542
|
+
"quoteStyle": "single",
|
|
2543
|
+
"trailingCommas": "all"
|
|
2544
|
+
}
|
|
2545
|
+
},
|
|
2546
|
+
"css": {
|
|
2547
|
+
"formatter": {
|
|
2548
|
+
"quoteStyle": "single"
|
|
2569
2549
|
},
|
|
2550
|
+
"linter": {
|
|
2551
|
+
"enabled": false
|
|
2552
|
+
}
|
|
2570
2553
|
},
|
|
2571
|
-
{
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
'**/*.cjs',
|
|
2580
|
-
'**/*.mjs',
|
|
2581
|
-
],
|
|
2582
|
-
// Override or add rules here
|
|
2583
|
-
rules: {},
|
|
2554
|
+
"linter": {
|
|
2555
|
+
"enabled": true,
|
|
2556
|
+
"rules": {
|
|
2557
|
+
"recommended": false,
|
|
2558
|
+
"correctness": {
|
|
2559
|
+
"noUndeclaredDependencies": "warn"
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2584
2562
|
},
|
|
2585
|
-
|
|
2563
|
+
"assist": {
|
|
2564
|
+
"actions": {
|
|
2565
|
+
"source": {
|
|
2566
|
+
"organizeImports": "on"
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
},
|
|
2570
|
+
"files": {
|
|
2571
|
+
"includes": [
|
|
2572
|
+
"**",
|
|
2573
|
+
"!**/dist",
|
|
2574
|
+
"!**/out-tsc",
|
|
2575
|
+
"!**/node_modules",
|
|
2576
|
+
"!**/.nx",
|
|
2577
|
+
"!**/.venv",
|
|
2578
|
+
"!**/*.css"
|
|
2579
|
+
]
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2586
2582
|
"
|
|
2587
2583
|
`;
|
|
2588
2584
|
|
|
@@ -2594,52 +2590,72 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2594
2590
|
"targetDefaults": {
|
|
2595
2591
|
"build": {
|
|
2596
2592
|
"cache": true,
|
|
2597
|
-
"dependsOn": ["^build"],
|
|
2598
2593
|
"inputs": ["default"]
|
|
2599
2594
|
},
|
|
2600
2595
|
"lint": {
|
|
2601
2596
|
"cache": true
|
|
2602
2597
|
},
|
|
2603
|
-
"
|
|
2604
|
-
"cache": true,
|
|
2605
|
-
"inputs": [
|
|
2606
|
-
"default",
|
|
2607
|
-
"^default",
|
|
2608
|
-
"{workspaceRoot}/.eslintrc.json",
|
|
2609
|
-
"{workspaceRoot}/.eslintignore",
|
|
2610
|
-
"{workspaceRoot}/eslint.config.mjs",
|
|
2611
|
-
"{workspaceRoot}/tools/eslint-rules/**/*"
|
|
2612
|
-
]
|
|
2613
|
-
},
|
|
2614
|
-
"@nx/vite:build": {
|
|
2615
|
-
"cache": true,
|
|
2598
|
+
"test": {
|
|
2616
2599
|
"dependsOn": ["^build"],
|
|
2617
|
-
"inputs": ["default"
|
|
2600
|
+
"inputs": ["default"]
|
|
2618
2601
|
},
|
|
2619
2602
|
"@nx/vitest:test": {
|
|
2620
2603
|
"cache": true,
|
|
2621
|
-
"inputs": ["default", "^
|
|
2604
|
+
"inputs": ["default", "^production"],
|
|
2622
2605
|
"configurations": {
|
|
2623
2606
|
"update-snapshot": {
|
|
2624
2607
|
"args": "--update"
|
|
2625
2608
|
}
|
|
2626
2609
|
}
|
|
2627
2610
|
},
|
|
2628
|
-
"test": {
|
|
2629
|
-
"dependsOn": ["^build"],
|
|
2630
|
-
"inputs": ["default"]
|
|
2631
|
-
},
|
|
2632
2611
|
"compile": {
|
|
2633
2612
|
"cache": true,
|
|
2634
2613
|
"inputs": ["default"]
|
|
2635
2614
|
}
|
|
2636
2615
|
},
|
|
2616
|
+
"plugins": [
|
|
2617
|
+
{
|
|
2618
|
+
"plugin": "@nx/js/typescript",
|
|
2619
|
+
"options": {
|
|
2620
|
+
"typecheck": {
|
|
2621
|
+
"targetName": "typecheck"
|
|
2622
|
+
},
|
|
2623
|
+
"build": {
|
|
2624
|
+
"targetName": "compile",
|
|
2625
|
+
"configName": "tsconfig.lib.json",
|
|
2626
|
+
"buildDepsName": "build-deps",
|
|
2627
|
+
"watchDepsName": "watch-deps"
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
},
|
|
2631
|
+
{
|
|
2632
|
+
"plugin": "@nx/vite/plugin",
|
|
2633
|
+
"options": {
|
|
2634
|
+
"buildTargetName": "bundle",
|
|
2635
|
+
"serveTargetName": "serve",
|
|
2636
|
+
"devTargetName": "serve",
|
|
2637
|
+
"previewTargetName": "preview",
|
|
2638
|
+
"serveStaticTargetName": "serve-static",
|
|
2639
|
+
"typecheckTargetName": "vite:typecheck",
|
|
2640
|
+
"buildDepsTargetName": "build-deps",
|
|
2641
|
+
"watchDepsTargetName": "watch-deps"
|
|
2642
|
+
}
|
|
2643
|
+
},
|
|
2644
|
+
{
|
|
2645
|
+
"plugin": "@nx/vitest",
|
|
2646
|
+
"options": {
|
|
2647
|
+
"testTargetName": "test",
|
|
2648
|
+
"ciTargetName": "test-ci",
|
|
2649
|
+
"testMode": "watch"
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
],
|
|
2637
2653
|
"generators": {
|
|
2638
2654
|
"@nx/react": {
|
|
2639
2655
|
"application": {
|
|
2640
2656
|
"babel": true,
|
|
2641
2657
|
"style": "css",
|
|
2642
|
-
"linter": "
|
|
2658
|
+
"linter": "none",
|
|
2643
2659
|
"bundler": "vite"
|
|
2644
2660
|
},
|
|
2645
2661
|
"component": {
|
|
@@ -2647,39 +2663,19 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2647
2663
|
},
|
|
2648
2664
|
"library": {
|
|
2649
2665
|
"style": "css",
|
|
2650
|
-
"linter": "
|
|
2666
|
+
"linter": "none"
|
|
2651
2667
|
}
|
|
2652
2668
|
}
|
|
2653
2669
|
},
|
|
2654
2670
|
"namedInputs": {
|
|
2655
|
-
"
|
|
2656
|
-
"default",
|
|
2657
|
-
"{workspaceRoot}/eslint.config.mjs",
|
|
2658
|
-
"{projectRoot}/eslint.config.mjs"
|
|
2659
|
-
],
|
|
2671
|
+
"biome": ["default", "{workspaceRoot}/biome.json"],
|
|
2660
2672
|
"default": [
|
|
2661
2673
|
{
|
|
2662
2674
|
"dependentTasksOutputFiles": "**/*",
|
|
2663
2675
|
"transitive": true
|
|
2664
2676
|
}
|
|
2665
2677
|
]
|
|
2666
|
-
}
|
|
2667
|
-
"plugins": [
|
|
2668
|
-
{
|
|
2669
|
-
"plugin": "@nx/js/typescript",
|
|
2670
|
-
"options": {
|
|
2671
|
-
"typecheck": {
|
|
2672
|
-
"targetName": "typecheck"
|
|
2673
|
-
},
|
|
2674
|
-
"build": {
|
|
2675
|
-
"targetName": "compile",
|
|
2676
|
-
"configName": "tsconfig.lib.json",
|
|
2677
|
-
"buildDepsName": "build-deps",
|
|
2678
|
-
"watchDepsName": "watch-deps"
|
|
2679
|
-
}
|
|
2680
|
-
}
|
|
2681
|
-
}
|
|
2682
|
-
]
|
|
2678
|
+
}
|
|
2683
2679
|
}
|
|
2684
2680
|
"
|
|
2685
2681
|
`;
|
|
@@ -2688,62 +2684,43 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2688
2684
|
"{
|
|
2689
2685
|
"name": "@proj/source",
|
|
2690
2686
|
"dependencies": {
|
|
2691
|
-
"@cloudscape-design/board-components": "3.0.
|
|
2692
|
-
"@cloudscape-design/components": "3.0.
|
|
2693
|
-
"@cloudscape-design/global-styles": "1.0.
|
|
2694
|
-
"@tanstack/react-router": "1.170.
|
|
2695
|
-
"aws-cdk-lib": "2.
|
|
2687
|
+
"@cloudscape-design/board-components": "3.0.197",
|
|
2688
|
+
"@cloudscape-design/components": "3.0.1320",
|
|
2689
|
+
"@cloudscape-design/global-styles": "1.0.61",
|
|
2690
|
+
"@tanstack/react-router": "1.170.16",
|
|
2691
|
+
"aws-cdk-lib": "2.260.0",
|
|
2696
2692
|
"constructs": "10.6.0",
|
|
2697
2693
|
"react": "19.2.7",
|
|
2698
2694
|
"react-dom": "19.2.7",
|
|
2699
|
-
"tailwindcss": "4.
|
|
2695
|
+
"tailwindcss": "4.2.2"
|
|
2700
2696
|
},
|
|
2701
2697
|
"devDependencies": {
|
|
2702
|
-
"@
|
|
2703
|
-
"@nx/
|
|
2704
|
-
"@nx/
|
|
2705
|
-
"@nx/
|
|
2706
|
-
"@nx/
|
|
2707
|
-
"@nx/vite": "22.7.5",
|
|
2708
|
-
"@nx/vitest": "22.7.5",
|
|
2709
|
-
"@nx/web": "22.7.5",
|
|
2710
|
-
"@swc-node/register": "~1.11.1",
|
|
2711
|
-
"@swc/cli": "~0.8.0",
|
|
2712
|
-
"@swc/core": "~1.15.5",
|
|
2698
|
+
"@nx/js": "23.0.1",
|
|
2699
|
+
"@nx/react": "23.0.1",
|
|
2700
|
+
"@nx/vite": "23.0.1",
|
|
2701
|
+
"@nx/vitest": "23.0.1",
|
|
2702
|
+
"@nx/web": "23.0.1",
|
|
2713
2703
|
"@swc/helpers": "~0.5.18",
|
|
2714
|
-
"@tailwindcss/vite": "4.
|
|
2715
|
-
"@tanstack/router-generator": "1.167.
|
|
2716
|
-
"@tanstack/router-plugin": "1.168.
|
|
2717
|
-
"@tanstack/router-utils": "1.162.
|
|
2704
|
+
"@tailwindcss/vite": "4.2.2",
|
|
2705
|
+
"@tanstack/router-generator": "1.167.17",
|
|
2706
|
+
"@tanstack/router-plugin": "1.168.18",
|
|
2707
|
+
"@tanstack/router-utils": "1.162.2",
|
|
2718
2708
|
"@tanstack/virtual-file-routes": "1.162.0",
|
|
2719
2709
|
"@testing-library/dom": "10.4.0",
|
|
2720
2710
|
"@testing-library/react": "16.3.0",
|
|
2721
|
-
"@types/node": "25.9.
|
|
2711
|
+
"@types/node": "25.9.4",
|
|
2722
2712
|
"@types/react": "^19.0.0",
|
|
2723
2713
|
"@types/react-dom": "^19.0.0",
|
|
2724
2714
|
"@vitejs/plugin-react": "^6.0.0",
|
|
2725
|
-
"@vitest/coverage-v8": "4.1.
|
|
2726
|
-
"@vitest/ui": "4.1.
|
|
2727
|
-
"eslint": "^9.8.0",
|
|
2728
|
-
"eslint-config-prettier": "^10.0.0",
|
|
2729
|
-
"eslint-plugin-import": "2.31.0",
|
|
2730
|
-
"eslint-plugin-jsx-a11y": "6.10.1",
|
|
2731
|
-
"eslint-plugin-prettier": "5.5.6",
|
|
2732
|
-
"eslint-plugin-react": "7.35.0",
|
|
2733
|
-
"eslint-plugin-react-hooks": "5.0.0",
|
|
2715
|
+
"@vitest/coverage-v8": "4.1.9",
|
|
2716
|
+
"@vitest/ui": "4.1.9",
|
|
2734
2717
|
"jiti": "2.4.2",
|
|
2735
|
-
"jsdom": "
|
|
2736
|
-
"jsonc-eslint-parser": "3.1.0",
|
|
2737
|
-
"prettier": "3.8.3",
|
|
2718
|
+
"jsdom": "^27.1.0",
|
|
2738
2719
|
"typescript": "~5.9.2",
|
|
2739
|
-
"
|
|
2740
|
-
"
|
|
2741
|
-
"vitest": "4.1.7"
|
|
2720
|
+
"vite": "8.1.0",
|
|
2721
|
+
"vitest": "4.1.9"
|
|
2742
2722
|
},
|
|
2743
|
-
"type": "module"
|
|
2744
|
-
"scripts": {
|
|
2745
|
-
"dev": "nx serve-local @proj/test-app"
|
|
2746
|
-
}
|
|
2723
|
+
"type": "module"
|
|
2747
2724
|
}
|
|
2748
2725
|
"
|
|
2749
2726
|
`;
|
|
@@ -2781,35 +2758,7 @@ You can also automatiaclly fix some lint errors by running the following command
|
|
|
2781
2758
|
|
|
2782
2759
|
- [common-constructs reference docs](TODO)
|
|
2783
2760
|
- [Learn more about NX](https://nx.dev/getting-started/intro)
|
|
2784
|
-
"
|
|
2785
|
-
`;
|
|
2786
2761
|
|
|
2787
|
-
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > packages/common/constructs/eslint.config.mjs 1`] = `
|
|
2788
|
-
"import baseConfig from '../../../eslint.config.mjs';
|
|
2789
|
-
|
|
2790
|
-
export default [
|
|
2791
|
-
...baseConfig,
|
|
2792
|
-
{
|
|
2793
|
-
files: ['**/*.json'],
|
|
2794
|
-
rules: {
|
|
2795
|
-
'@nx/dependency-checks': [
|
|
2796
|
-
'warn',
|
|
2797
|
-
{
|
|
2798
|
-
ignoredFiles: [
|
|
2799
|
-
'{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}',
|
|
2800
|
-
'{projectRoot}/vitest.config.{js,ts,mjs,mts}',
|
|
2801
|
-
],
|
|
2802
|
-
},
|
|
2803
|
-
],
|
|
2804
|
-
},
|
|
2805
|
-
languageOptions: {
|
|
2806
|
-
parser: await import('jsonc-eslint-parser'),
|
|
2807
|
-
},
|
|
2808
|
-
},
|
|
2809
|
-
{
|
|
2810
|
-
ignores: ['**/out-tsc'],
|
|
2811
|
-
},
|
|
2812
|
-
];
|
|
2813
2762
|
"
|
|
2814
2763
|
`;
|
|
2815
2764
|
|
|
@@ -2820,6 +2769,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2820
2769
|
"sourceRoot": "packages/common/constructs/src",
|
|
2821
2770
|
"projectType": "library",
|
|
2822
2771
|
"tags": [],
|
|
2772
|
+
"metadata": {
|
|
2773
|
+
"generator": "ts#project"
|
|
2774
|
+
},
|
|
2823
2775
|
"targets": {
|
|
2824
2776
|
"build": {
|
|
2825
2777
|
"dependsOn": ["lint", "compile", "test", "@proj/test-app:build"]
|
|
@@ -2833,28 +2785,21 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2833
2785
|
}
|
|
2834
2786
|
},
|
|
2835
2787
|
"lint": {
|
|
2836
|
-
"executor": "
|
|
2788
|
+
"executor": "nx:run-commands",
|
|
2837
2789
|
"cache": true,
|
|
2838
|
-
"inputs": ["
|
|
2790
|
+
"inputs": ["biome"],
|
|
2791
|
+
"options": {
|
|
2792
|
+
"command": "biome lint {projectRoot}"
|
|
2793
|
+
},
|
|
2839
2794
|
"configurations": {
|
|
2840
2795
|
"fix": {
|
|
2841
|
-
"
|
|
2796
|
+
"command": "biome check --write {projectRoot}"
|
|
2842
2797
|
},
|
|
2843
2798
|
"skip-lint": {
|
|
2844
|
-
"
|
|
2799
|
+
"command": "node -e \\"\\""
|
|
2845
2800
|
}
|
|
2846
2801
|
}
|
|
2847
|
-
},
|
|
2848
|
-
"test": {
|
|
2849
|
-
"executor": "@nx/vitest:test",
|
|
2850
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
2851
|
-
"options": {
|
|
2852
|
-
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
2853
|
-
}
|
|
2854
2802
|
}
|
|
2855
|
-
},
|
|
2856
|
-
"metadata": {
|
|
2857
|
-
"generator": "ts#project"
|
|
2858
2803
|
}
|
|
2859
2804
|
}
|
|
2860
2805
|
"
|
|
@@ -3164,11 +3109,18 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3164
3109
|
"import {
|
|
3165
3110
|
CfnOutput,
|
|
3166
3111
|
CfnResource,
|
|
3112
|
+
Duration,
|
|
3167
3113
|
Lazy,
|
|
3168
3114
|
RemovalPolicy,
|
|
3169
3115
|
Stack,
|
|
3170
3116
|
} from 'aws-cdk-lib';
|
|
3171
|
-
import {
|
|
3117
|
+
import {
|
|
3118
|
+
Distribution,
|
|
3119
|
+
HeadersFrameOption,
|
|
3120
|
+
HeadersReferrerPolicy,
|
|
3121
|
+
ResponseHeadersPolicy,
|
|
3122
|
+
ViewerProtocolPolicy,
|
|
3123
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
3172
3124
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
3173
3125
|
import {
|
|
3174
3126
|
BlockPublicAccess,
|
|
@@ -3177,7 +3129,11 @@ import {
|
|
|
3177
3129
|
IBucket,
|
|
3178
3130
|
ObjectOwnership,
|
|
3179
3131
|
} from 'aws-cdk-lib/aws-s3';
|
|
3180
|
-
import {
|
|
3132
|
+
import {
|
|
3133
|
+
BucketDeployment,
|
|
3134
|
+
CacheControl,
|
|
3135
|
+
Source,
|
|
3136
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
3181
3137
|
import { Construct } from 'constructs';
|
|
3182
3138
|
import { RuntimeConfig } from './runtime-config.js';
|
|
3183
3139
|
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
@@ -3186,6 +3142,23 @@ import { suppressRules } from './checkov.js';
|
|
|
3186
3142
|
|
|
3187
3143
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
3188
3144
|
|
|
3145
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
3146
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
3147
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
3148
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
3149
|
+
// connect-src to your specific origins once they are known.
|
|
3150
|
+
const CONTENT_SECURITY_POLICY = [
|
|
3151
|
+
"default-src 'self'",
|
|
3152
|
+
"script-src 'self'",
|
|
3153
|
+
"style-src 'self' 'unsafe-inline'",
|
|
3154
|
+
"img-src 'self' data:",
|
|
3155
|
+
"font-src 'self' data:",
|
|
3156
|
+
"connect-src 'self' https: wss:",
|
|
3157
|
+
"object-src 'none'",
|
|
3158
|
+
"base-uri 'self'",
|
|
3159
|
+
"frame-ancestors 'none'",
|
|
3160
|
+
].join('; ');
|
|
3161
|
+
|
|
3189
3162
|
export interface StaticWebsiteProps {
|
|
3190
3163
|
readonly websiteName: string;
|
|
3191
3164
|
readonly websiteFilePath: string;
|
|
@@ -3277,6 +3250,36 @@ export class StaticWebsite extends Construct {
|
|
|
3277
3250
|
'Distribution log bucket does not need versioning enabled',
|
|
3278
3251
|
);
|
|
3279
3252
|
|
|
3253
|
+
// Security headers applied to all responses.
|
|
3254
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
3255
|
+
this,
|
|
3256
|
+
'ResponseHeadersPolicy',
|
|
3257
|
+
{
|
|
3258
|
+
securityHeadersBehavior: {
|
|
3259
|
+
strictTransportSecurity: {
|
|
3260
|
+
accessControlMaxAge: Duration.days(730),
|
|
3261
|
+
includeSubdomains: true,
|
|
3262
|
+
preload: true,
|
|
3263
|
+
override: true,
|
|
3264
|
+
},
|
|
3265
|
+
contentTypeOptions: { override: true },
|
|
3266
|
+
frameOptions: {
|
|
3267
|
+
frameOption: HeadersFrameOption.DENY,
|
|
3268
|
+
override: true,
|
|
3269
|
+
},
|
|
3270
|
+
referrerPolicy: {
|
|
3271
|
+
referrerPolicy:
|
|
3272
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
3273
|
+
override: true,
|
|
3274
|
+
},
|
|
3275
|
+
contentSecurityPolicy: {
|
|
3276
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
3277
|
+
override: true,
|
|
3278
|
+
},
|
|
3279
|
+
},
|
|
3280
|
+
},
|
|
3281
|
+
);
|
|
3282
|
+
|
|
3280
3283
|
const defaultRootObject = 'index.html';
|
|
3281
3284
|
this.cloudFrontDistribution = new Distribution(
|
|
3282
3285
|
this,
|
|
@@ -3288,6 +3291,7 @@ export class StaticWebsite extends Construct {
|
|
|
3288
3291
|
defaultBehavior: {
|
|
3289
3292
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
3290
3293
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
3294
|
+
responseHeadersPolicy,
|
|
3291
3295
|
},
|
|
3292
3296
|
defaultRootObject,
|
|
3293
3297
|
errorResponses: [
|
|
@@ -3304,6 +3308,7 @@ export class StaticWebsite extends Construct {
|
|
|
3304
3308
|
],
|
|
3305
3309
|
},
|
|
3306
3310
|
);
|
|
3311
|
+
// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
3307
3312
|
suppressRules(
|
|
3308
3313
|
this.cloudFrontDistribution,
|
|
3309
3314
|
['CKV_AWS_174'],
|
|
@@ -3312,8 +3317,17 @@ export class StaticWebsite extends Construct {
|
|
|
3312
3317
|
|
|
3313
3318
|
// Deploy Website
|
|
3314
3319
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
3320
|
+
sources: [Source.asset(websiteFilePath)],
|
|
3321
|
+
destinationBucket: this.websiteBucket,
|
|
3322
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
3323
|
+
distribution: this.cloudFrontDistribution,
|
|
3324
|
+
memoryLimit: 1024,
|
|
3325
|
+
});
|
|
3326
|
+
|
|
3327
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
3328
|
+
// must always fetch the latest configuration.
|
|
3329
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
3315
3330
|
sources: [
|
|
3316
|
-
Source.asset(websiteFilePath),
|
|
3317
3331
|
Source.data(
|
|
3318
3332
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
3319
3333
|
Lazy.string({
|
|
@@ -3325,8 +3339,9 @@ export class StaticWebsite extends Construct {
|
|
|
3325
3339
|
),
|
|
3326
3340
|
],
|
|
3327
3341
|
destinationBucket: this.websiteBucket,
|
|
3328
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
3329
3342
|
distribution: this.cloudFrontDistribution,
|
|
3343
|
+
cacheControl: [CacheControl.noCache()],
|
|
3344
|
+
prune: false,
|
|
3330
3345
|
memoryLimit: 1024,
|
|
3331
3346
|
});
|
|
3332
3347
|
|
|
@@ -3537,6 +3552,7 @@ export default defineConfig(() => ({
|
|
|
3537
3552
|
root: __dirname,
|
|
3538
3553
|
cacheDir: '../../../node_modules/.vite/packages/common/constructs',
|
|
3539
3554
|
test: {
|
|
3555
|
+
passWithNoTests: true,
|
|
3540
3556
|
name: '@proj/common-constructs',
|
|
3541
3557
|
watch: false,
|
|
3542
3558
|
globals: true,
|
|
@@ -3547,7 +3563,6 @@ export default defineConfig(() => ({
|
|
|
3547
3563
|
reportsDirectory: './test-output/vitest/coverage',
|
|
3548
3564
|
provider: 'v8' as const,
|
|
3549
3565
|
},
|
|
3550
|
-
passWithNoTests: true,
|
|
3551
3566
|
},
|
|
3552
3567
|
}));
|
|
3553
3568
|
"
|
|
@@ -3555,15 +3570,14 @@ export default defineConfig(() => ({
|
|
|
3555
3570
|
|
|
3556
3571
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > pnpm-workspace.yaml 1`] = `
|
|
3557
3572
|
"packages:
|
|
3558
|
-
-
|
|
3559
|
-
-
|
|
3560
|
-
-
|
|
3573
|
+
- "packages/*"
|
|
3574
|
+
- "test-app"
|
|
3575
|
+
- "packages/common/*"
|
|
3561
3576
|
"
|
|
3562
3577
|
`;
|
|
3563
3578
|
|
|
3564
3579
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > test-app/README.md 1`] = `
|
|
3565
3580
|
"# @proj/test-app
|
|
3566
|
-
|
|
3567
3581
|
This library was generated with [@aws/nx-plugin](https://github.com/awslabs/nx-plugin-for-aws/).
|
|
3568
3582
|
|
|
3569
3583
|
## Building
|
|
@@ -3612,24 +3626,8 @@ In order to integrate with cognito or trpc backends, you need to have a \`runtim
|
|
|
3612
3626
|
"
|
|
3613
3627
|
`;
|
|
3614
3628
|
|
|
3615
|
-
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > test-app/eslint.config.mjs 1`] = `
|
|
3616
|
-
"import nx from '@nx/eslint-plugin';
|
|
3617
|
-
import baseConfig from '../eslint.config.mjs';
|
|
3618
|
-
|
|
3619
|
-
export default [
|
|
3620
|
-
...nx.configs['flat/react'],
|
|
3621
|
-
...baseConfig,
|
|
3622
|
-
{
|
|
3623
|
-
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
3624
|
-
// Override or add rules here
|
|
3625
|
-
rules: {},
|
|
3626
|
-
},
|
|
3627
|
-
];
|
|
3628
|
-
"
|
|
3629
|
-
`;
|
|
3630
|
-
|
|
3631
3629
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > test-app/index.html 1`] = `
|
|
3632
|
-
"<!
|
|
3630
|
+
"<!DOCTYPE html>
|
|
3633
3631
|
<html lang="en">
|
|
3634
3632
|
<head>
|
|
3635
3633
|
<meta charset="utf-8" />
|
|
@@ -3663,29 +3661,10 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3663
3661
|
},
|
|
3664
3662
|
"targets": {
|
|
3665
3663
|
"build": {
|
|
3666
|
-
"dependsOn": ["lint", "compile", "
|
|
3667
|
-
"options": {
|
|
3668
|
-
"outputPath": "dist/{projectRoot}/bundle"
|
|
3669
|
-
}
|
|
3670
|
-
},
|
|
3671
|
-
"bundle": {
|
|
3672
|
-
"executor": "@nx/vite:build",
|
|
3673
|
-
"outputs": ["{options.outputPath}"],
|
|
3674
|
-
"defaultConfiguration": "production",
|
|
3675
|
-
"options": {
|
|
3676
|
-
"outputPath": "dist/{projectRoot}/bundle"
|
|
3677
|
-
},
|
|
3678
|
-
"configurations": {
|
|
3679
|
-
"development": {
|
|
3680
|
-
"mode": "development"
|
|
3681
|
-
},
|
|
3682
|
-
"production": {
|
|
3683
|
-
"mode": "production"
|
|
3684
|
-
}
|
|
3685
|
-
}
|
|
3664
|
+
"dependsOn": ["lint", "compile", "test", "bundle"]
|
|
3686
3665
|
},
|
|
3687
3666
|
"compile": {
|
|
3688
|
-
"dependsOn": ["
|
|
3667
|
+
"dependsOn": ["^build"],
|
|
3689
3668
|
"executor": "nx:run-commands",
|
|
3690
3669
|
"outputs": ["{workspaceRoot}/dist/{projectRoot}/tsc"],
|
|
3691
3670
|
"options": {
|
|
@@ -3693,16 +3672,27 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3693
3672
|
"cwd": "{projectRoot}"
|
|
3694
3673
|
}
|
|
3695
3674
|
},
|
|
3675
|
+
"dev": {
|
|
3676
|
+
"executor": "nx:run-commands",
|
|
3677
|
+
"continuous": true,
|
|
3678
|
+
"options": {
|
|
3679
|
+
"command": "vite --mode local-dev",
|
|
3680
|
+
"cwd": "{projectRoot}"
|
|
3681
|
+
}
|
|
3682
|
+
},
|
|
3696
3683
|
"lint": {
|
|
3697
|
-
"executor": "
|
|
3684
|
+
"executor": "nx:run-commands",
|
|
3698
3685
|
"cache": true,
|
|
3699
|
-
"inputs": ["
|
|
3686
|
+
"inputs": ["biome"],
|
|
3687
|
+
"options": {
|
|
3688
|
+
"command": "biome lint {projectRoot}"
|
|
3689
|
+
},
|
|
3700
3690
|
"configurations": {
|
|
3701
3691
|
"fix": {
|
|
3702
|
-
"
|
|
3692
|
+
"command": "biome check --write {projectRoot}"
|
|
3703
3693
|
},
|
|
3704
3694
|
"skip-lint": {
|
|
3705
|
-
"
|
|
3695
|
+
"command": "node -e \\"\\""
|
|
3706
3696
|
}
|
|
3707
3697
|
}
|
|
3708
3698
|
},
|
|
@@ -3714,63 +3704,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3714
3704
|
"options": {
|
|
3715
3705
|
"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\\""
|
|
3716
3706
|
}
|
|
3717
|
-
},
|
|
3718
|
-
"preview": {
|
|
3719
|
-
"dependsOn": ["build"],
|
|
3720
|
-
"executor": "@nx/vite:preview-server",
|
|
3721
|
-
"defaultConfiguration": "development",
|
|
3722
|
-
"options": {
|
|
3723
|
-
"buildTarget": "@proj/test-app:build"
|
|
3724
|
-
},
|
|
3725
|
-
"configurations": {
|
|
3726
|
-
"development": {
|
|
3727
|
-
"buildTarget": "@proj/test-app:build:development"
|
|
3728
|
-
},
|
|
3729
|
-
"production": {
|
|
3730
|
-
"buildTarget": "@proj/test-app:build:production"
|
|
3731
|
-
}
|
|
3732
|
-
}
|
|
3733
|
-
},
|
|
3734
|
-
"serve": {
|
|
3735
|
-
"executor": "@nx/vite:dev-server",
|
|
3736
|
-
"defaultConfiguration": "development",
|
|
3737
|
-
"options": {
|
|
3738
|
-
"buildTarget": "@proj/test-app:build"
|
|
3739
|
-
},
|
|
3740
|
-
"configurations": {
|
|
3741
|
-
"development": {
|
|
3742
|
-
"buildTarget": "@proj/test-app:build:development",
|
|
3743
|
-
"hmr": true
|
|
3744
|
-
},
|
|
3745
|
-
"production": {
|
|
3746
|
-
"buildTarget": "@proj/test-app:build:production",
|
|
3747
|
-
"hmr": false
|
|
3748
|
-
}
|
|
3749
|
-
}
|
|
3750
|
-
},
|
|
3751
|
-
"serve-local": {
|
|
3752
|
-
"executor": "@nx/vite:dev-server",
|
|
3753
|
-
"options": {
|
|
3754
|
-
"buildTarget": "@proj/test-app:build:development",
|
|
3755
|
-
"hmr": true,
|
|
3756
|
-
"mode": "serve-local"
|
|
3757
|
-
},
|
|
3758
|
-
"continuous": true
|
|
3759
|
-
},
|
|
3760
|
-
"serve-static": {
|
|
3761
|
-
"executor": "@nx/web:file-server",
|
|
3762
|
-
"dependsOn": ["build"],
|
|
3763
|
-
"options": {
|
|
3764
|
-
"buildTarget": "@proj/test-app:build",
|
|
3765
|
-
"spa": true
|
|
3766
|
-
}
|
|
3767
|
-
},
|
|
3768
|
-
"test": {
|
|
3769
|
-
"executor": "@nx/vitest:test",
|
|
3770
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
3771
|
-
"options": {
|
|
3772
|
-
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
3773
|
-
}
|
|
3774
3707
|
}
|
|
3775
3708
|
}
|
|
3776
3709
|
}
|
|
@@ -4167,9 +4100,14 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4167
4100
|
"@nx/react/typings/cssmodule.d.ts",
|
|
4168
4101
|
"@nx/react/typings/image.d.ts",
|
|
4169
4102
|
"vite/client"
|
|
4170
|
-
]
|
|
4103
|
+
],
|
|
4104
|
+
"rootDir": "src",
|
|
4105
|
+
"module": "esnext",
|
|
4106
|
+
"moduleResolution": "bundler"
|
|
4171
4107
|
},
|
|
4172
4108
|
"exclude": [
|
|
4109
|
+
"out-tsc",
|
|
4110
|
+
"dist",
|
|
4173
4111
|
"src/**/*.spec.ts",
|
|
4174
4112
|
"src/**/*.test.ts",
|
|
4175
4113
|
"src/**/*.spec.tsx",
|
|
@@ -4222,7 +4160,10 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4222
4160
|
"vitest",
|
|
4223
4161
|
"@nx/react/typings/cssmodule.d.ts",
|
|
4224
4162
|
"@nx/react/typings/image.d.ts"
|
|
4225
|
-
]
|
|
4163
|
+
],
|
|
4164
|
+
"jsx": "react-jsx",
|
|
4165
|
+
"module": "esnext",
|
|
4166
|
+
"moduleResolution": "bundler"
|
|
4226
4167
|
},
|
|
4227
4168
|
"include": [
|
|
4228
4169
|
"vite.config.ts",
|
|
@@ -4280,7 +4221,7 @@ export default defineConfig(() => ({
|
|
|
4280
4221
|
// plugins: [],
|
|
4281
4222
|
// },
|
|
4282
4223
|
build: {
|
|
4283
|
-
outDir: '../dist/test-app',
|
|
4224
|
+
outDir: '../dist/test-app/bundle',
|
|
4284
4225
|
emptyOutDir: true,
|
|
4285
4226
|
reportCompressedSize: true,
|
|
4286
4227
|
commonjsOptions: {
|
|
@@ -4288,6 +4229,7 @@ export default defineConfig(() => ({
|
|
|
4288
4229
|
},
|
|
4289
4230
|
},
|
|
4290
4231
|
test: {
|
|
4232
|
+
passWithNoTests: true,
|
|
4291
4233
|
name: '@proj/test-app',
|
|
4292
4234
|
watch: false,
|
|
4293
4235
|
globals: true,
|
|
@@ -4298,7 +4240,6 @@ export default defineConfig(() => ({
|
|
|
4298
4240
|
reportsDirectory: './test-output/vitest/coverage',
|
|
4299
4241
|
provider: 'v8' as const,
|
|
4300
4242
|
},
|
|
4301
|
-
passWithNoTests: true,
|
|
4302
4243
|
},
|
|
4303
4244
|
resolve: { tsconfigPaths: true },
|
|
4304
4245
|
define: { global: {} },
|
|
@@ -4313,6 +4254,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4313
4254
|
":proj/test-app": ["./test-app/src/index.ts"],
|
|
4314
4255
|
":proj/common-constructs": ["./packages/common/constructs/src/index.ts"]
|
|
4315
4256
|
},
|
|
4257
|
+
"composite": true,
|
|
4316
4258
|
"rootDir": "."
|
|
4317
4259
|
}
|
|
4318
4260
|
}
|
|
@@ -4321,6 +4263,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4321
4263
|
|
|
4322
4264
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > tsconfig.json 1`] = `
|
|
4323
4265
|
"{
|
|
4266
|
+
"extends": "./tsconfig.base.json",
|
|
4267
|
+
"files": [],
|
|
4268
|
+
"include": [],
|
|
4324
4269
|
"references": [
|
|
4325
4270
|
{
|
|
4326
4271
|
"path": "./test-app"
|
|
@@ -4393,7 +4338,7 @@ export default defineConfig(() => ({
|
|
|
4393
4338
|
// plugins: [],
|
|
4394
4339
|
// },
|
|
4395
4340
|
build: {
|
|
4396
|
-
outDir: '../dist/test-app',
|
|
4341
|
+
outDir: '../dist/test-app/bundle',
|
|
4397
4342
|
emptyOutDir: true,
|
|
4398
4343
|
reportCompressedSize: true,
|
|
4399
4344
|
commonjsOptions: {
|
|
@@ -4401,6 +4346,7 @@ export default defineConfig(() => ({
|
|
|
4401
4346
|
},
|
|
4402
4347
|
},
|
|
4403
4348
|
test: {
|
|
4349
|
+
passWithNoTests: true,
|
|
4404
4350
|
name: '@proj/test-app',
|
|
4405
4351
|
watch: false,
|
|
4406
4352
|
globals: true,
|
|
@@ -4411,7 +4357,6 @@ export default defineConfig(() => ({
|
|
|
4411
4357
|
reportsDirectory: './test-output/vitest/coverage',
|
|
4412
4358
|
provider: 'v8' as const,
|
|
4413
4359
|
},
|
|
4414
|
-
passWithNoTests: true,
|
|
4415
4360
|
},
|
|
4416
4361
|
resolve: { tsconfigPaths: true },
|
|
4417
4362
|
define: { global: {} },
|
|
@@ -4667,11 +4612,18 @@ exports[`react-website generator > should generate shared constructs > common/co
|
|
|
4667
4612
|
"import {
|
|
4668
4613
|
CfnOutput,
|
|
4669
4614
|
CfnResource,
|
|
4615
|
+
Duration,
|
|
4670
4616
|
Lazy,
|
|
4671
4617
|
RemovalPolicy,
|
|
4672
4618
|
Stack,
|
|
4673
4619
|
} from 'aws-cdk-lib';
|
|
4674
|
-
import {
|
|
4620
|
+
import {
|
|
4621
|
+
Distribution,
|
|
4622
|
+
HeadersFrameOption,
|
|
4623
|
+
HeadersReferrerPolicy,
|
|
4624
|
+
ResponseHeadersPolicy,
|
|
4625
|
+
ViewerProtocolPolicy,
|
|
4626
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
4675
4627
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
4676
4628
|
import {
|
|
4677
4629
|
BlockPublicAccess,
|
|
@@ -4680,7 +4632,11 @@ import {
|
|
|
4680
4632
|
IBucket,
|
|
4681
4633
|
ObjectOwnership,
|
|
4682
4634
|
} from 'aws-cdk-lib/aws-s3';
|
|
4683
|
-
import {
|
|
4635
|
+
import {
|
|
4636
|
+
BucketDeployment,
|
|
4637
|
+
CacheControl,
|
|
4638
|
+
Source,
|
|
4639
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
4684
4640
|
import { Construct } from 'constructs';
|
|
4685
4641
|
import { RuntimeConfig } from './runtime-config.js';
|
|
4686
4642
|
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
@@ -4689,6 +4645,23 @@ import { suppressRules } from './checkov.js';
|
|
|
4689
4645
|
|
|
4690
4646
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
4691
4647
|
|
|
4648
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
4649
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
4650
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
4651
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
4652
|
+
// connect-src to your specific origins once they are known.
|
|
4653
|
+
const CONTENT_SECURITY_POLICY = [
|
|
4654
|
+
"default-src 'self'",
|
|
4655
|
+
"script-src 'self'",
|
|
4656
|
+
"style-src 'self' 'unsafe-inline'",
|
|
4657
|
+
"img-src 'self' data:",
|
|
4658
|
+
"font-src 'self' data:",
|
|
4659
|
+
"connect-src 'self' https: wss:",
|
|
4660
|
+
"object-src 'none'",
|
|
4661
|
+
"base-uri 'self'",
|
|
4662
|
+
"frame-ancestors 'none'",
|
|
4663
|
+
].join('; ');
|
|
4664
|
+
|
|
4692
4665
|
export interface StaticWebsiteProps {
|
|
4693
4666
|
readonly websiteName: string;
|
|
4694
4667
|
readonly websiteFilePath: string;
|
|
@@ -4780,6 +4753,36 @@ export class StaticWebsite extends Construct {
|
|
|
4780
4753
|
'Distribution log bucket does not need versioning enabled',
|
|
4781
4754
|
);
|
|
4782
4755
|
|
|
4756
|
+
// Security headers applied to all responses.
|
|
4757
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
4758
|
+
this,
|
|
4759
|
+
'ResponseHeadersPolicy',
|
|
4760
|
+
{
|
|
4761
|
+
securityHeadersBehavior: {
|
|
4762
|
+
strictTransportSecurity: {
|
|
4763
|
+
accessControlMaxAge: Duration.days(730),
|
|
4764
|
+
includeSubdomains: true,
|
|
4765
|
+
preload: true,
|
|
4766
|
+
override: true,
|
|
4767
|
+
},
|
|
4768
|
+
contentTypeOptions: { override: true },
|
|
4769
|
+
frameOptions: {
|
|
4770
|
+
frameOption: HeadersFrameOption.DENY,
|
|
4771
|
+
override: true,
|
|
4772
|
+
},
|
|
4773
|
+
referrerPolicy: {
|
|
4774
|
+
referrerPolicy:
|
|
4775
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
4776
|
+
override: true,
|
|
4777
|
+
},
|
|
4778
|
+
contentSecurityPolicy: {
|
|
4779
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
4780
|
+
override: true,
|
|
4781
|
+
},
|
|
4782
|
+
},
|
|
4783
|
+
},
|
|
4784
|
+
);
|
|
4785
|
+
|
|
4783
4786
|
const defaultRootObject = 'index.html';
|
|
4784
4787
|
this.cloudFrontDistribution = new Distribution(
|
|
4785
4788
|
this,
|
|
@@ -4791,6 +4794,7 @@ export class StaticWebsite extends Construct {
|
|
|
4791
4794
|
defaultBehavior: {
|
|
4792
4795
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
4793
4796
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
4797
|
+
responseHeadersPolicy,
|
|
4794
4798
|
},
|
|
4795
4799
|
defaultRootObject,
|
|
4796
4800
|
errorResponses: [
|
|
@@ -4807,6 +4811,7 @@ export class StaticWebsite extends Construct {
|
|
|
4807
4811
|
],
|
|
4808
4812
|
},
|
|
4809
4813
|
);
|
|
4814
|
+
// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesGeneral.html
|
|
4810
4815
|
suppressRules(
|
|
4811
4816
|
this.cloudFrontDistribution,
|
|
4812
4817
|
['CKV_AWS_174'],
|
|
@@ -4815,8 +4820,17 @@ export class StaticWebsite extends Construct {
|
|
|
4815
4820
|
|
|
4816
4821
|
// Deploy Website
|
|
4817
4822
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
4823
|
+
sources: [Source.asset(websiteFilePath)],
|
|
4824
|
+
destinationBucket: this.websiteBucket,
|
|
4825
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
4826
|
+
distribution: this.cloudFrontDistribution,
|
|
4827
|
+
memoryLimit: 1024,
|
|
4828
|
+
});
|
|
4829
|
+
|
|
4830
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
4831
|
+
// must always fetch the latest configuration.
|
|
4832
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
4818
4833
|
sources: [
|
|
4819
|
-
Source.asset(websiteFilePath),
|
|
4820
4834
|
Source.data(
|
|
4821
4835
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
4822
4836
|
Lazy.string({
|
|
@@ -4828,8 +4842,9 @@ export class StaticWebsite extends Construct {
|
|
|
4828
4842
|
),
|
|
4829
4843
|
],
|
|
4830
4844
|
destinationBucket: this.websiteBucket,
|
|
4831
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
4832
4845
|
distribution: this.cloudFrontDistribution,
|
|
4846
|
+
cacheControl: [CacheControl.noCache()],
|
|
4847
|
+
prune: false,
|
|
4833
4848
|
memoryLimit: 1024,
|
|
4834
4849
|
});
|
|
4835
4850
|
|
|
@@ -4975,15 +4990,15 @@ root &&
|
|
|
4975
4990
|
|
|
4976
4991
|
exports[`react-website generator > should handle npm scope prefix correctly > scoped-dependencies 1`] = `
|
|
4977
4992
|
{
|
|
4978
|
-
"@cloudscape-design/board-components": "3.0.
|
|
4979
|
-
"@cloudscape-design/components": "3.0.
|
|
4980
|
-
"@cloudscape-design/global-styles": "1.0.
|
|
4981
|
-
"@tanstack/react-router": "1.170.
|
|
4982
|
-
"aws-cdk-lib": "2.
|
|
4993
|
+
"@cloudscape-design/board-components": "3.0.197",
|
|
4994
|
+
"@cloudscape-design/components": "3.0.1320",
|
|
4995
|
+
"@cloudscape-design/global-styles": "1.0.61",
|
|
4996
|
+
"@tanstack/react-router": "1.170.16",
|
|
4997
|
+
"aws-cdk-lib": "2.260.0",
|
|
4983
4998
|
"constructs": "10.6.0",
|
|
4984
4999
|
"react": "19.2.7",
|
|
4985
5000
|
"react-dom": "19.2.7",
|
|
4986
|
-
"tailwindcss": "4.
|
|
5001
|
+
"tailwindcss": "4.2.2",
|
|
4987
5002
|
}
|
|
4988
5003
|
`;
|
|
4989
5004
|
|
|
@@ -5687,6 +5702,5 @@ function RouteComponent() {
|
|
|
5687
5702
|
|
|
5688
5703
|
exports[`react-website generator ux tests > Shadcn > should update package.json with required dependencies > test-app/src/styles.css 1`] = `
|
|
5689
5704
|
"@import '../../packages/common/shadcn/src/styles/globals.css';
|
|
5690
|
-
@source './**/*.{ts,tsx}';
|
|
5691
|
-
"
|
|
5705
|
+
@source './**/*.{ts,tsx}';"
|
|
5692
5706
|
`;
|