@aws/nx-plugin 1.0.0-rc.2 → 1.0.0-rc.21
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 +3552 -4179
- package/README.md +8 -8
- package/executors.json +9 -0
- package/generators.json +100 -1
- package/package.json +16 -12
- package/sdk/agentcore-gateway.d.ts +6 -0
- package/sdk/agentcore-gateway.js +11 -0
- package/sdk/agentcore-gateway.js.map +1 -0
- package/sdk/license.d.ts +8 -0
- package/sdk/license.js +14 -0
- package/sdk/license.js.map +1 -0
- package/sdk/py.d.ts +6 -6
- package/sdk/py.js +7 -7
- package/sdk/py.js.map +1 -1
- package/sdk/ts.d.ts +18 -14
- package/sdk/ts.js +38 -32
- package/sdk/ts.js.map +1 -1
- package/src/agentcore-gateway/attach-upstream.d.ts +33 -0
- package/src/agentcore-gateway/attach-upstream.js +41 -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/serve-local.ts.template +134 -0
- package/src/agentcore-gateway/gateway-connection/generator.d.ts +21 -0
- package/src/agentcore-gateway/gateway-connection/generator.js +102 -0
- package/src/agentcore-gateway/gateway-connection/generator.js.map +1 -0
- package/src/agentcore-gateway/gateway-connection/schema.d.ts +12 -0
- package/src/agentcore-gateway/gateway-connection/schema.json +26 -0
- package/src/agentcore-gateway/generator.d.ts +25 -0
- package/src/agentcore-gateway/generator.js +129 -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 +63 -0
- package/src/agentcore-gateway/mcp-connection/generator.js.map +1 -0
- package/src/agentcore-gateway/mcp-connection/schema.d.ts +12 -0
- package/src/agentcore-gateway/mcp-connection/schema.json +26 -0
- package/src/agentcore-gateway/schema.d.ts +16 -0
- package/src/agentcore-gateway/schema.json +65 -0
- package/src/connection/agent-runtime-config.d.ts +1 -1
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/agent-serve-local.d.ts +2 -2
- package/src/connection/agent-serve-local.js +1 -1
- package/src/connection/agent-serve-local.js.map +1 -1
- package/src/connection/generator.d.ts +5 -5
- package/src/connection/generator.js +93 -37
- package/src/connection/generator.js.map +1 -1
- package/src/connection/serve-local.d.ts +1 -1
- package/src/connection/serve-local.js +1 -1
- package/src/connection/serve-local.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +47 -58
- package/src/infra/app/generator.d.ts +3 -3
- package/src/infra/app/generator.js +19 -17
- package/src/infra/app/generator.js.map +1 -1
- 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 +4 -0
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +65 -7
- package/src/license/config.js +315 -7
- 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 +111 -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 +76 -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 +75 -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 +121 -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 +122 -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 +43 -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 +1280 -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 +7 -0
- package/src/license/dependency-check/types.js.map +1 -0
- package/src/license/generator.d.ts +3 -3
- package/src/license/generator.js +102 -14
- package/src/license/generator.js.map +1 -1
- package/src/license/index.d.ts +8 -0
- package/src/license/index.js +13 -0
- package/src/license/index.js.map +1 -0
- package/src/license/known-exceptions.d.ts +6 -0
- package/src/license/known-exceptions.js +26 -0
- package/src/license/known-exceptions.js.map +1 -0
- package/src/license/schema.d.ts +5 -0
- package/src/license/schema.json +6 -0
- package/src/license/sync/generator.d.ts +2 -2
- package/src/license/sync/generator.js +15 -15
- 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.map +1 -1
- package/src/mcp-server/generator-info.d.ts +5 -1
- package/src/mcp-server/generator-info.js +7 -7
- 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 +2 -2
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/mdx-ast.js +4 -0
- package/src/mcp-server/mdx-ast.js.map +1 -1
- package/src/mcp-server/schema-registry.d.ts +9 -3
- package/src/mcp-server/schema-registry.js +22 -6
- package/src/mcp-server/schema-registry.js.map +1 -1
- package/src/mcp-server/server.js +3 -3
- 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 +4 -4
- 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 +2 -2
- 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.map +1 -1
- package/src/mcp-server/tools/list-generators.d.ts +2 -2
- package/src/mcp-server/tools/list-generators.js +1 -1
- 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 +2 -2
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.d.ts +3 -3
- package/src/open-api/ts-hooks/generator.js +2 -2
- 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-metadata/generator.d.ts +3 -3
- package/src/open-api/ts-metadata/generator.js +1 -1
- package/src/open-api/ts-metadata/generator.js.map +1 -1
- package/src/open-api/utils/codegen-data/languages.d.ts +5 -1
- package/src/open-api/utils/codegen-data/languages.js +4 -4
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data.d.ts +6 -2
- package/src/open-api/utils/codegen-data.js +6 -6
- 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 +5 -5
- 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 +4 -0
- package/src/open-api/utils/parse.js.map +1 -1
- package/src/open-api/utils/refs.d.ts +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +131 -13
- package/src/preset/generator.d.ts +4 -4
- package/src/preset/generator.js +21 -14
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.ts +3 -1
- package/src/preset/schema.json +5 -0
- package/src/py/agent/__snapshots__/generator.spec.ts.snap +659 -21
- package/src/py/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +201 -0
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client_strands.py.template +30 -0
- package/src/py/agent/a2a-connection/generator.d.ts +3 -3
- package/src/py/agent/a2a-connection/generator.js +11 -10
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/files/common/agent.py.template +2 -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/gateway-connection/__snapshots__/generator.spec.ts.snap +197 -0
- package/src/py/agent/gateway-connection/files/agent-connection/app/__gatewaySnakeCase___client_strands.py.template +35 -0
- package/src/py/agent/gateway-connection/generator.d.ts +10 -0
- package/src/py/agent/gateway-connection/generator.js +106 -0
- package/src/py/agent/gateway-connection/generator.js.map +1 -0
- package/src/py/agent/gateway-connection/schema.d.ts +12 -0
- package/src/py/agent/gateway-connection/schema.json +26 -0
- package/src/py/agent/generator.d.ts +3 -3
- package/src/py/agent/generator.js +47 -38
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +167 -81
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client_strands.py.template +30 -0
- package/src/py/agent/mcp-connection/generator.d.ts +3 -3
- package/src/py/agent/mcp-connection/generator.js +11 -81
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +8 -17
- package/src/py/agent/react-connection/generator.d.ts +3 -3
- package/src/py/agent/react-connection/generator.js +4 -4
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/serve-local.d.ts +2 -2
- package/src/py/agent/react-connection/serve-local.js.map +1 -1
- package/src/py/api/generator.d.ts +3 -3
- package/src/py/api/generator.js.map +1 -1
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +1486 -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.ts +14 -0
- package/src/py/dynamodb/agent-connection/schema.json +22 -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.ts +12 -0
- package/src/py/dynamodb/fast-api-connection/schema.json +18 -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 +106 -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.ts +14 -0
- package/src/py/dynamodb/mcp-server-connection/schema.json +22 -0
- package/src/py/dynamodb/schema.d.ts +15 -0
- package/src/py/dynamodb/schema.json +70 -0
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +167 -39
- 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 +23 -17
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/py/fast-api/react/generator.d.ts +3 -3
- package/src/py/fast-api/react/generator.js +2 -2
- 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 +5 -2
- package/src/py/fast-api/react/open-api.js.map +1 -1
- package/src/py/lambda-function/generator.d.ts +3 -3
- package/src/py/lambda-function/generator.js +11 -11
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +83 -13
- package/src/py/mcp-server/generator.d.ts +3 -3
- package/src/py/mcp-server/generator.js +33 -26
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/project/generator.d.ts +3 -3
- package/src/py/project/generator.js +96 -70
- package/src/py/project/generator.js.map +1 -1
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +19 -16
- package/src/smithy/project/files/build.Dockerfile.template +1 -0
- 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 +30 -28
- package/src/smithy/project/generator.js.map +1 -1
- 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 +3 -3
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +14 -34
- package/src/smithy/ts/api/generator.d.ts +3 -3
- package/src/smithy/ts/api/generator.js +18 -12
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/terraform/project/files/application/src/main.tf.template +6 -1
- package/src/terraform/project/generator.d.ts +3 -3
- package/src/terraform/project/generator.js +13 -8
- package/src/terraform/project/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +163 -18
- 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 +3 -3
- package/src/trpc/backend/generator.js +11 -10
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +2 -2
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/trpc/react/files/src/components/__apiNameClassName__ClientProvider.tsx.template +3 -3
- package/src/trpc/react/generator.d.ts +3 -3
- package/src/trpc/react/generator.js +5 -5
- package/src/trpc/react/generator.js.map +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +652 -14
- 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 +8 -8
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- 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 +106 -0
- package/src/ts/agent/gateway-connection/generator.js.map +1 -0
- package/src/ts/agent/gateway-connection/schema.d.ts +12 -0
- package/src/ts/agent/gateway-connection/schema.json +26 -0
- package/src/ts/agent/generator.d.ts +3 -3
- package/src/ts/agent/generator.js +44 -32
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +191 -110
- 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 +9 -21
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/generator.d.ts +3 -3
- package/src/ts/agent/react-connection/generator.js +9 -9
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/serve-local.d.ts +2 -2
- package/src/ts/api/generator.d.ts +3 -3
- package/src/ts/api/generator.js +4 -4
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.ts +2 -1
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +7 -8
- package/src/ts/astro-docs/generator.d.ts +3 -3
- package/src/ts/astro-docs/generator.js +14 -11
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/docs/generator.d.ts +3 -3
- package/src/ts/docs/generator.js.map +1 -1
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +1352 -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 +32 -0
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/agent-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/agent-connection/schema.json +22 -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 +111 -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 +32 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.json +22 -0
- package/src/ts/dynamodb/schema.d.ts +15 -0
- package/src/ts/dynamodb/schema.json +70 -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 +30 -0
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/smithy-connection/schema.json +18 -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 +30 -0
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/trpc-connection/schema.json +18 -0
- package/src/ts/lambda-function/generator.d.ts +3 -3
- package/src/ts/lambda-function/generator.js +8 -8
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +32 -65
- 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 +27 -29
- 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/ts-project-utils.d.ts +12 -2
- package/src/ts/lib/ts-project-utils.js +30 -10
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/vitest.d.ts +2 -2
- package/src/ts/lib/vitest.js +1 -1
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +82 -12
- package/src/ts/mcp-server/generator.d.ts +3 -3
- package/src/ts/mcp-server/generator.js +34 -12
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +19 -14
- package/src/ts/nx-generator/generator.d.ts +2 -2
- package/src/ts/nx-generator/generator.js +52 -19
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-plugin/generator.d.ts +3 -3
- package/src/ts/nx-plugin/generator.js +10 -9
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/utils.d.ts +1 -1
- package/src/ts/nx-plugin/utils.js +10 -4
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +252 -388
- package/src/ts/rdb/agent-connection/generator.d.ts +3 -3
- package/src/ts/rdb/agent-connection/generator.js +4 -4
- package/src/ts/rdb/agent-connection/generator.js.map +1 -1
- package/src/ts/rdb/files/config.json.template +14 -0
- package/src/ts/rdb/files/prisma.config.ts.template +5 -4
- package/src/ts/rdb/files/src/index.ts.template +0 -1
- package/src/ts/rdb/files/src/prisma.ts.template +26 -21
- package/src/ts/rdb/generator.d.ts +3 -7
- package/src/ts/rdb/generator.js +52 -41
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/generator.d.ts +3 -3
- package/src/ts/rdb/mcp-server-connection/generator.js +4 -4
- package/src/ts/rdb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/rdb/smithy-connection/generator.d.ts +3 -3
- package/src/ts/rdb/smithy-connection/generator.js +4 -4
- package/src/ts/rdb/smithy-connection/generator.js.map +1 -1
- package/src/ts/rdb/trpc-connection/generator.d.ts +3 -3
- package/src/ts/rdb/trpc-connection/generator.js +3 -3
- package/src/ts/rdb/trpc-connection/generator.js.map +1 -1
- package/src/ts/rdb/utils.d.ts +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 +4 -5
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +530 -367
- package/src/ts/react-website/app/generator.d.ts +3 -3
- package/src/ts/react-website/app/generator.js +21 -17
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +1 -7
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +9 -3
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.ux-provider.spec.ts.snap +0 -20
- package/src/ts/react-website/cognito-auth/generator.d.ts +3 -3
- package/src/ts/react-website/cognito-auth/generator.js +10 -13
- 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/utils.d.ts +1 -1
- package/src/ts/react-website/cognito-auth/utils.js +1 -1
- package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
- package/src/ts/react-website/runtime-config/generator.d.ts +3 -3
- package/src/ts/react-website/runtime-config/generator.js +4 -4
- package/src/ts/react-website/runtime-config/generator.js.map +1 -1
- package/src/ts/sync/generator.d.ts +3 -3
- package/src/ts/sync/generator.js +2 -2
- 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 +1 -1
- package/src/ts/website/app/generator.js.map +1 -1
- package/src/ts/website/auth/generator.d.ts +3 -3
- package/src/ts/website/auth/generator.js +1 -1
- package/src/ts/website/auth/generator.js.map +1 -1
- package/src/utils/agent-chat/agent-chat.d.ts +31 -0
- package/src/utils/agent-chat/agent-chat.js +30 -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 +67 -24
- package/src/utils/agent-connection/agent-connection.js +236 -44
- 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-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 +57 -12
- 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 +40 -0
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +375 -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 +335 -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 +77 -9
- 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 +1 -1
- 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 +9 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +23 -1
- package/src/utils/api-constructs/files/cdk/core/api/utils/utils.ts.template +61 -7
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +3 -0
- package/src/utils/api-constructs/open-api-metadata.d.ts +2 -2
- 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 +3 -3
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.d.ts +33 -1
- package/src/utils/ast.js +89 -4
- package/src/utils/ast.js.map +1 -1
- package/src/utils/bundle/bundle.d.ts +1 -1
- package/src/utils/bundle/bundle.js +2 -2
- package/src/utils/bundle/bundle.js.map +1 -1
- package/src/utils/config/index.d.ts +5 -5
- package/src/utils/config/utils.d.ts +13 -3
- package/src/utils/config/utils.js +37 -5
- 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 +1 -1
- package/src/utils/connection/open-api/react.js +4 -4
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/containers.d.ts +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.d.ts +18 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +49 -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 +62 -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 +91 -0
- package/src/utils/files/common/scripts/src/rdb/pull-image.ts.template +16 -0
- package/src/utils/files/common/scripts/src/rdb/start-container.ts.template +102 -0
- package/src/utils/files/common/scripts/src/rdb/wait-for-db.ts.template +59 -0
- package/src/utils/files/terraform/src/core/runtime-config/appconfig-deployment/appconfig-deployment.tf.template +9 -3
- package/src/utils/files/terraform/src/core/runtime-config/read/read.tf.template +7 -2
- package/src/utils/format.d.ts +45 -2
- package/src/utils/format.js +167 -46
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.d.ts +1 -1
- package/src/utils/fs.js.map +1 -1
- package/src/utils/function-constructs/function-constructs.d.ts +2 -2
- package/src/utils/function-constructs/function-constructs.js +1 -1
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.d.ts +4 -0
- package/src/utils/generators.js +4 -4
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.d.ts +1 -1
- package/src/utils/git.js.map +1 -1
- package/src/utils/iac.d.ts +1 -1
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +1 -5
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +9 -3
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +2 -4
- package/src/utils/identity-constructs/identity-constructs.d.ts +2 -2
- package/src/utils/identity-constructs/identity-constructs.js +1 -1
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/js.d.ts +4 -0
- package/src/utils/js.js +4 -4
- package/src/utils/js.js.map +1 -1
- package/src/utils/mcp.d.ts +25 -0
- package/src/utils/mcp.js +81 -0
- package/src/utils/mcp.js.map +1 -0
- package/src/utils/metrics.d.ts +9 -3
- package/src/utils/metrics.js +58 -28
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/npm-scope.d.ts +1 -1
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +7 -2
- package/src/utils/nx.js +46 -14
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.d.ts +1 -1
- package/src/utils/paths.d.ts +1 -1
- package/src/utils/pnpm-workspace.d.ts +1 -1
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.d.ts +31 -3
- package/src/utils/port.js +74 -4
- package/src/utils/port.js.map +1 -1
- package/src/utils/py.d.ts +2 -2
- package/src/utils/py.js +13 -6
- 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 +30 -1
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +38 -16
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +28 -13
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +5 -4
- package/src/utils/rdb-constructs/rdb-constructs.js +3 -11
- 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 +2 -1
- 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 +7 -7
- 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 +23 -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 +1 -1
- 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 +35 -0
- package/src/utils/shared-infra-scripts.js.map +1 -0
- package/src/utils/shared-rdb-scripts.d.ts +11 -0
- package/src/utils/shared-rdb-scripts.js +20 -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 +2 -23
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.d.ts +1 -1
- package/src/utils/shared-shadcn.js +1 -13
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +5 -1
- package/src/utils/test.js +9 -5
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.d.ts +1 -1
- package/src/utils/toml.js +4 -0
- package/src/utils/toml.js.map +1 -1
- package/src/utils/versions.d.ts +82 -83
- package/src/utils/versions.js +81 -82
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +72 -5
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +63 -15
- package/src/utils/website-constructs/website-constructs.d.ts +2 -2
- package/src/utils/website-constructs/website-constructs.js +1 -1
- package/src/utils/website-constructs/website-constructs.js.map +1 -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/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/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/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}/cdk-command.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
|
@@ -7,6 +7,8 @@ import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
|
|
7
7
|
/// <reference types='vitest' />
|
|
8
8
|
import { defineConfig } from 'vite';
|
|
9
9
|
import react from '@vitejs/plugin-react';
|
|
10
|
+
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
11
|
+
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
|
10
12
|
|
|
11
13
|
export default defineConfig(() => ({
|
|
12
14
|
root: import.meta.dirname,
|
|
@@ -25,11 +27,13 @@ export default defineConfig(() => ({
|
|
|
25
27
|
generatedRouteTree: resolve(__dirname, 'src/routeTree.gen.ts'),
|
|
26
28
|
}),
|
|
27
29
|
react(),
|
|
30
|
+
nxViteTsPaths(),
|
|
31
|
+
nxCopyAssetsPlugin(['*.md']),
|
|
28
32
|
tailwindcss(),
|
|
29
33
|
],
|
|
30
34
|
// Uncomment this if you are using workers.
|
|
31
35
|
// worker: {
|
|
32
|
-
//
|
|
36
|
+
// plugins: () => [ nxViteTsPaths() ],
|
|
33
37
|
// },
|
|
34
38
|
build: {
|
|
35
39
|
outDir: '../dist/test-app',
|
|
@@ -40,6 +44,7 @@ export default defineConfig(() => ({
|
|
|
40
44
|
},
|
|
41
45
|
},
|
|
42
46
|
test: {
|
|
47
|
+
passWithNoTests: true,
|
|
43
48
|
name: '@proj/test-app',
|
|
44
49
|
watch: false,
|
|
45
50
|
globals: true,
|
|
@@ -47,10 +52,9 @@ export default defineConfig(() => ({
|
|
|
47
52
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
48
53
|
reporters: ['default'],
|
|
49
54
|
coverage: {
|
|
50
|
-
reportsDirectory: '
|
|
55
|
+
reportsDirectory: '../coverage/test-app',
|
|
51
56
|
provider: 'v8' as const,
|
|
52
57
|
},
|
|
53
|
-
passWithNoTests: true,
|
|
54
58
|
},
|
|
55
59
|
resolve: { tsconfigPaths: true },
|
|
56
60
|
define: { global: {} },
|
|
@@ -64,6 +68,8 @@ import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
|
|
64
68
|
/// <reference types='vitest' />
|
|
65
69
|
import { defineConfig } from 'vite';
|
|
66
70
|
import react from '@vitejs/plugin-react';
|
|
71
|
+
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
72
|
+
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
|
67
73
|
|
|
68
74
|
export default defineConfig(() => ({
|
|
69
75
|
root: import.meta.dirname,
|
|
@@ -82,10 +88,12 @@ export default defineConfig(() => ({
|
|
|
82
88
|
generatedRouteTree: resolve(__dirname, 'src/routeTree.gen.ts'),
|
|
83
89
|
}),
|
|
84
90
|
react(),
|
|
91
|
+
nxViteTsPaths(),
|
|
92
|
+
nxCopyAssetsPlugin(['*.md']),
|
|
85
93
|
],
|
|
86
94
|
// Uncomment this if you are using workers.
|
|
87
95
|
// worker: {
|
|
88
|
-
//
|
|
96
|
+
// plugins: () => [ nxViteTsPaths() ],
|
|
89
97
|
// },
|
|
90
98
|
build: {
|
|
91
99
|
outDir: '../dist/test-app',
|
|
@@ -96,6 +104,7 @@ export default defineConfig(() => ({
|
|
|
96
104
|
},
|
|
97
105
|
},
|
|
98
106
|
test: {
|
|
107
|
+
passWithNoTests: true,
|
|
99
108
|
name: '@proj/test-app',
|
|
100
109
|
watch: false,
|
|
101
110
|
globals: true,
|
|
@@ -103,10 +112,9 @@ export default defineConfig(() => ({
|
|
|
103
112
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
104
113
|
reporters: ['default'],
|
|
105
114
|
coverage: {
|
|
106
|
-
reportsDirectory: '
|
|
115
|
+
reportsDirectory: '../coverage/test-app',
|
|
107
116
|
provider: 'v8' as const,
|
|
108
117
|
},
|
|
109
|
-
passWithNoTests: true,
|
|
110
118
|
},
|
|
111
119
|
resolve: { tsconfigPaths: true },
|
|
112
120
|
define: { global: {} },
|
|
@@ -152,6 +160,15 @@ variable "website_file_path" {
|
|
|
152
160
|
type = string
|
|
153
161
|
}
|
|
154
162
|
|
|
163
|
+
# Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
164
|
+
# framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
165
|
+
# (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
166
|
+
# Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
167
|
+
# connect-src to your specific origins once they are known.
|
|
168
|
+
locals {
|
|
169
|
+
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'"
|
|
170
|
+
}
|
|
171
|
+
|
|
155
172
|
|
|
156
173
|
# Data sources
|
|
157
174
|
data "aws_caller_identity" "current" {}
|
|
@@ -512,13 +529,41 @@ resource "aws_cloudfront_origin_access_control" "website_oac" {
|
|
|
512
529
|
signing_protocol = "sigv4"
|
|
513
530
|
}
|
|
514
531
|
|
|
532
|
+
# Security headers applied to all responses.
|
|
533
|
+
resource "aws_cloudfront_response_headers_policy" "website" {
|
|
534
|
+
name = "\${aws_s3_bucket.website.bucket}-security-headers"
|
|
535
|
+
|
|
536
|
+
security_headers_config {
|
|
537
|
+
strict_transport_security {
|
|
538
|
+
access_control_max_age_sec = 63072000
|
|
539
|
+
include_subdomains = true
|
|
540
|
+
preload = true
|
|
541
|
+
override = true
|
|
542
|
+
}
|
|
543
|
+
content_type_options {
|
|
544
|
+
override = true
|
|
545
|
+
}
|
|
546
|
+
frame_options {
|
|
547
|
+
frame_option = "DENY"
|
|
548
|
+
override = true
|
|
549
|
+
}
|
|
550
|
+
referrer_policy {
|
|
551
|
+
referrer_policy = "strict-origin-when-cross-origin"
|
|
552
|
+
override = true
|
|
553
|
+
}
|
|
554
|
+
content_security_policy {
|
|
555
|
+
content_security_policy = local.content_security_policy
|
|
556
|
+
override = true
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
515
561
|
# CloudFront Distribution
|
|
516
562
|
resource "aws_cloudfront_distribution" "website" {
|
|
517
563
|
#checkov:skip=CKV_AWS_174:Using CloudFront default certificate which does not support TLS v1.2
|
|
518
564
|
#checkov:skip=CKV_AWS_310:Origin failover not required for single S3 origin static website
|
|
519
565
|
#checkov:skip=CKV_AWS_374:Geo restrictions not required for global web application
|
|
520
566
|
#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
567
|
#checkov:skip=CKV2_AWS_47:WAF includes AWSManagedRulesKnownBadInputsRuleSet which provides Log4j protection
|
|
523
568
|
origin {
|
|
524
569
|
domain_name = aws_s3_bucket.website.bucket_regional_domain_name
|
|
@@ -548,11 +593,12 @@ resource "aws_cloudfront_distribution" "website" {
|
|
|
548
593
|
}
|
|
549
594
|
}
|
|
550
595
|
|
|
551
|
-
viewer_protocol_policy
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
596
|
+
viewer_protocol_policy = "redirect-to-https"
|
|
597
|
+
response_headers_policy_id = aws_cloudfront_response_headers_policy.website.id
|
|
598
|
+
min_ttl = 0
|
|
599
|
+
default_ttl = 3600
|
|
600
|
+
max_ttl = 86400
|
|
601
|
+
compress = true
|
|
556
602
|
}
|
|
557
603
|
|
|
558
604
|
# Custom error responses for SPA routing
|
|
@@ -656,7 +702,7 @@ resource "null_resource" "upload_website_files" {
|
|
|
656
702
|
|
|
657
703
|
provisioner "local-exec" {
|
|
658
704
|
command = <<-EOT
|
|
659
|
-
cd "
|
|
705
|
+
cd "$ROOT_PATH"
|
|
660
706
|
uv run --with boto3 python3 -c "
|
|
661
707
|
import os
|
|
662
708
|
import sys
|
|
@@ -745,9 +791,14 @@ def sync_to_s3(local_path, bucket_name):
|
|
|
745
791
|
sys.exit(1)
|
|
746
792
|
|
|
747
793
|
# Execute sync
|
|
748
|
-
sync_to_s3(
|
|
794
|
+
sync_to_s3(os.environ['WEBSITE_FILE_PATH'], os.environ['BUCKET_NAME'])
|
|
749
795
|
"
|
|
750
796
|
EOT
|
|
797
|
+
environment = {
|
|
798
|
+
ROOT_PATH = path.root
|
|
799
|
+
WEBSITE_FILE_PATH = var.website_file_path
|
|
800
|
+
BUCKET_NAME = aws_s3_bucket.website.bucket
|
|
801
|
+
}
|
|
751
802
|
}
|
|
752
803
|
|
|
753
804
|
depends_on = [aws_s3_bucket_policy.website_cloudfront_policy]
|
|
@@ -755,11 +806,12 @@ sync_to_s3('\${var.website_file_path}', '\${aws_s3_bucket.website.bucket}')
|
|
|
755
806
|
|
|
756
807
|
# Upload runtime config file
|
|
757
808
|
resource "aws_s3_object" "runtime_config" {
|
|
758
|
-
bucket
|
|
759
|
-
key
|
|
760
|
-
content
|
|
761
|
-
content_type
|
|
762
|
-
|
|
809
|
+
bucket = aws_s3_bucket.website.id
|
|
810
|
+
key = "runtime-config.json"
|
|
811
|
+
content = module.runtime_config_reader.config_json
|
|
812
|
+
content_type = "application/json"
|
|
813
|
+
cache_control = "no-cache"
|
|
814
|
+
etag = md5(module.runtime_config_reader.config_json)
|
|
763
815
|
|
|
764
816
|
depends_on = [null_resource.upload_website_files]
|
|
765
817
|
}
|
|
@@ -776,6 +828,7 @@ resource "null_resource" "cloudfront_invalidation" {
|
|
|
776
828
|
command = <<-EOT
|
|
777
829
|
uv run --with boto3 python3 -c "
|
|
778
830
|
import boto3
|
|
831
|
+
import os
|
|
779
832
|
import sys
|
|
780
833
|
from botocore.exceptions import ClientError, NoCredentialsError
|
|
781
834
|
|
|
@@ -797,7 +850,7 @@ def create_invalidation(distribution_id):
|
|
|
797
850
|
|
|
798
851
|
invalidation_id = response['Invalidation']['Id']
|
|
799
852
|
print(f'CloudFront cache invalidation created: {invalidation_id}')
|
|
800
|
-
print(f'Distribution:
|
|
853
|
+
print(f'Distribution: {distribution_id}')
|
|
801
854
|
print(f'Status: {response[\\"Invalidation\\"][\\"Status\\"]}')
|
|
802
855
|
|
|
803
856
|
except NoCredentialsError:
|
|
@@ -811,9 +864,12 @@ def create_invalidation(distribution_id):
|
|
|
811
864
|
sys.exit(1)
|
|
812
865
|
|
|
813
866
|
# Execute invalidation
|
|
814
|
-
create_invalidation(
|
|
867
|
+
create_invalidation(os.environ['DISTRIBUTION_ID'])
|
|
815
868
|
"
|
|
816
869
|
EOT
|
|
870
|
+
environment = {
|
|
871
|
+
DISTRIBUTION_ID = aws_cloudfront_distribution.website.id
|
|
872
|
+
}
|
|
817
873
|
}
|
|
818
874
|
|
|
819
875
|
depends_on = [
|
|
@@ -905,61 +961,71 @@ vitest.config.*.timestamp*
|
|
|
905
961
|
runtime-config.json"
|
|
906
962
|
`;
|
|
907
963
|
|
|
964
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > .prettierignore 1`] = `
|
|
965
|
+
"# Add files here to ignore them from prettier formatting
|
|
966
|
+
/dist
|
|
967
|
+
/coverage
|
|
968
|
+
/.nx/cache
|
|
969
|
+
/.nx/workspace-data"
|
|
970
|
+
`;
|
|
971
|
+
|
|
908
972
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > .prettierrc 1`] = `
|
|
909
973
|
"{ "singleQuote": true }
|
|
910
974
|
"
|
|
911
975
|
`;
|
|
912
976
|
|
|
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
|
-
],
|
|
977
|
+
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > biome.json 1`] = `
|
|
978
|
+
"{
|
|
979
|
+
"$schema": "https://biomejs.dev/schemas/2.4.16/schema.json",
|
|
980
|
+
"root": true,
|
|
981
|
+
"formatter": {
|
|
982
|
+
"enabled": true,
|
|
983
|
+
"indentStyle": "space",
|
|
984
|
+
"indentWidth": 2,
|
|
985
|
+
"lineWidth": 80
|
|
929
986
|
},
|
|
930
|
-
{
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
{
|
|
940
|
-
sourceTag: '*',
|
|
941
|
-
onlyDependOnLibsWithTags: ['*'],
|
|
942
|
-
},
|
|
943
|
-
],
|
|
944
|
-
},
|
|
945
|
-
],
|
|
987
|
+
"javascript": {
|
|
988
|
+
"formatter": {
|
|
989
|
+
"quoteStyle": "single",
|
|
990
|
+
"trailingCommas": "all"
|
|
991
|
+
}
|
|
992
|
+
},
|
|
993
|
+
"css": {
|
|
994
|
+
"formatter": {
|
|
995
|
+
"quoteStyle": "single"
|
|
946
996
|
},
|
|
997
|
+
"linter": {
|
|
998
|
+
"enabled": false
|
|
999
|
+
}
|
|
947
1000
|
},
|
|
948
|
-
{
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
'**/*.cjs',
|
|
957
|
-
'**/*.mjs',
|
|
958
|
-
],
|
|
959
|
-
// Override or add rules here
|
|
960
|
-
rules: {},
|
|
1001
|
+
"linter": {
|
|
1002
|
+
"enabled": true,
|
|
1003
|
+
"rules": {
|
|
1004
|
+
"recommended": false,
|
|
1005
|
+
"correctness": {
|
|
1006
|
+
"noUndeclaredDependencies": "warn"
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
961
1009
|
},
|
|
962
|
-
|
|
1010
|
+
"assist": {
|
|
1011
|
+
"actions": {
|
|
1012
|
+
"source": {
|
|
1013
|
+
"organizeImports": "on"
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
"files": {
|
|
1018
|
+
"includes": [
|
|
1019
|
+
"**",
|
|
1020
|
+
"!**/dist",
|
|
1021
|
+
"!**/out-tsc",
|
|
1022
|
+
"!**/node_modules",
|
|
1023
|
+
"!**/.nx",
|
|
1024
|
+
"!**/.venv",
|
|
1025
|
+
"!**/*.css"
|
|
1026
|
+
]
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
963
1029
|
"
|
|
964
1030
|
`;
|
|
965
1031
|
|
|
@@ -977,17 +1043,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
977
1043
|
"lint": {
|
|
978
1044
|
"cache": true
|
|
979
1045
|
},
|
|
980
|
-
"@nx/eslint:lint": {
|
|
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
1046
|
"@nx/vite:build": {
|
|
992
1047
|
"cache": true,
|
|
993
1048
|
"dependsOn": ["^build"],
|
|
@@ -1016,7 +1071,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1016
1071
|
"application": {
|
|
1017
1072
|
"babel": true,
|
|
1018
1073
|
"style": "css",
|
|
1019
|
-
"linter": "
|
|
1074
|
+
"linter": "none",
|
|
1020
1075
|
"bundler": "vite"
|
|
1021
1076
|
},
|
|
1022
1077
|
"component": {
|
|
@@ -1024,16 +1079,12 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1024
1079
|
},
|
|
1025
1080
|
"library": {
|
|
1026
1081
|
"style": "css",
|
|
1027
|
-
"linter": "
|
|
1082
|
+
"linter": "none"
|
|
1028
1083
|
}
|
|
1029
1084
|
}
|
|
1030
1085
|
},
|
|
1031
1086
|
"namedInputs": {
|
|
1032
|
-
"
|
|
1033
|
-
"default",
|
|
1034
|
-
"{workspaceRoot}/eslint.config.mjs",
|
|
1035
|
-
"{projectRoot}/eslint.config.mjs"
|
|
1036
|
-
],
|
|
1087
|
+
"biome": ["default", "{workspaceRoot}/biome.json"],
|
|
1037
1088
|
"default": [
|
|
1038
1089
|
{
|
|
1039
1090
|
"dependentTasksOutputFiles": "**/*",
|
|
@@ -1065,52 +1116,39 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1065
1116
|
"{
|
|
1066
1117
|
"name": "@proj/source",
|
|
1067
1118
|
"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.
|
|
1119
|
+
"@cloudscape-design/board-components": "3.0.190",
|
|
1120
|
+
"@cloudscape-design/components": "3.0.1310",
|
|
1121
|
+
"@cloudscape-design/global-styles": "1.0.60",
|
|
1122
|
+
"aws-cdk-lib": "2.259.0",
|
|
1072
1123
|
"constructs": "10.6.0",
|
|
1073
|
-
"react": "19.2.
|
|
1074
|
-
"react-dom": "19.2.
|
|
1075
|
-
"tailwindcss": "4.
|
|
1124
|
+
"react": "19.2.7",
|
|
1125
|
+
"react-dom": "19.2.7",
|
|
1126
|
+
"tailwindcss": "4.2.2"
|
|
1076
1127
|
},
|
|
1077
1128
|
"devDependencies": {
|
|
1078
|
-
"@
|
|
1079
|
-
"@nx/
|
|
1080
|
-
"@nx/
|
|
1081
|
-
"@nx/
|
|
1082
|
-
"@nx/
|
|
1083
|
-
"@nx/vite": "22.7.3",
|
|
1084
|
-
"@nx/vitest": "22.7.3",
|
|
1085
|
-
"@nx/web": "22.7.3",
|
|
1129
|
+
"@nx/js": "22.7.5",
|
|
1130
|
+
"@nx/react": "22.7.5",
|
|
1131
|
+
"@nx/vite": "22.7.5",
|
|
1132
|
+
"@nx/vitest": "22.7.5",
|
|
1133
|
+
"@nx/web": "22.7.5",
|
|
1086
1134
|
"@swc-node/register": "~1.11.1",
|
|
1087
|
-
"@swc/cli": "~0.8.0",
|
|
1088
1135
|
"@swc/core": "~1.15.5",
|
|
1089
1136
|
"@swc/helpers": "~0.5.18",
|
|
1090
|
-
"@tailwindcss/vite": "4.
|
|
1137
|
+
"@tailwindcss/vite": "4.2.2",
|
|
1091
1138
|
"@testing-library/dom": "10.4.0",
|
|
1092
1139
|
"@testing-library/react": "16.3.0",
|
|
1093
|
-
"@types/node": "25.9.
|
|
1140
|
+
"@types/node": "25.9.3",
|
|
1094
1141
|
"@types/react": "^19.0.0",
|
|
1095
1142
|
"@types/react-dom": "^19.0.0",
|
|
1096
1143
|
"@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.5",
|
|
1104
|
-
"eslint-plugin-react": "7.35.0",
|
|
1105
|
-
"eslint-plugin-react-hooks": "5.0.0",
|
|
1144
|
+
"@vitest/coverage-v8": "4.1.8",
|
|
1145
|
+
"@vitest/ui": "4.1.8",
|
|
1106
1146
|
"jiti": "2.4.2",
|
|
1107
1147
|
"jsdom": "~22.1.0",
|
|
1108
|
-
"
|
|
1109
|
-
"prettier": "3.8.3",
|
|
1148
|
+
"prettier": "~3.6.2",
|
|
1110
1149
|
"typescript": "~5.9.2",
|
|
1111
|
-
"
|
|
1112
|
-
"
|
|
1113
|
-
"vitest": "4.1.7"
|
|
1150
|
+
"vite": "8.0.16",
|
|
1151
|
+
"vitest": "4.1.8"
|
|
1114
1152
|
},
|
|
1115
1153
|
"type": "module",
|
|
1116
1154
|
"scripts": {
|
|
@@ -1153,35 +1191,7 @@ You can also automatiaclly fix some lint errors by running the following command
|
|
|
1153
1191
|
|
|
1154
1192
|
- [common-constructs reference docs](TODO)
|
|
1155
1193
|
- [Learn more about NX](https://nx.dev/getting-started/intro)
|
|
1156
|
-
"
|
|
1157
|
-
`;
|
|
1158
1194
|
|
|
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
|
-
|
|
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
1195
|
"
|
|
1186
1196
|
`;
|
|
1187
1197
|
|
|
@@ -1192,6 +1202,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1192
1202
|
"sourceRoot": "packages/common/constructs/src",
|
|
1193
1203
|
"projectType": "library",
|
|
1194
1204
|
"tags": [],
|
|
1205
|
+
"metadata": {
|
|
1206
|
+
"generator": "ts#project"
|
|
1207
|
+
},
|
|
1195
1208
|
"targets": {
|
|
1196
1209
|
"build": {
|
|
1197
1210
|
"dependsOn": ["lint", "compile", "test", "@proj/test-app:build"]
|
|
@@ -1205,15 +1218,18 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1205
1218
|
}
|
|
1206
1219
|
},
|
|
1207
1220
|
"lint": {
|
|
1208
|
-
"executor": "
|
|
1221
|
+
"executor": "nx:run-commands",
|
|
1209
1222
|
"cache": true,
|
|
1210
|
-
"inputs": ["
|
|
1223
|
+
"inputs": ["biome"],
|
|
1224
|
+
"options": {
|
|
1225
|
+
"command": "biome lint {projectRoot}"
|
|
1226
|
+
},
|
|
1211
1227
|
"configurations": {
|
|
1212
1228
|
"fix": {
|
|
1213
|
-
"
|
|
1229
|
+
"command": "biome check --write {projectRoot}"
|
|
1214
1230
|
},
|
|
1215
1231
|
"skip-lint": {
|
|
1216
|
-
"
|
|
1232
|
+
"command": "node -e \\"\\""
|
|
1217
1233
|
}
|
|
1218
1234
|
}
|
|
1219
1235
|
},
|
|
@@ -1224,9 +1240,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1224
1240
|
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
1225
1241
|
}
|
|
1226
1242
|
}
|
|
1227
|
-
},
|
|
1228
|
-
"metadata": {
|
|
1229
|
-
"generator": "ts#project"
|
|
1230
1243
|
}
|
|
1231
1244
|
}
|
|
1232
1245
|
"
|
|
@@ -1536,11 +1549,18 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1536
1549
|
"import {
|
|
1537
1550
|
CfnOutput,
|
|
1538
1551
|
CfnResource,
|
|
1552
|
+
Duration,
|
|
1539
1553
|
Lazy,
|
|
1540
1554
|
RemovalPolicy,
|
|
1541
1555
|
Stack,
|
|
1542
1556
|
} from 'aws-cdk-lib';
|
|
1543
|
-
import {
|
|
1557
|
+
import {
|
|
1558
|
+
Distribution,
|
|
1559
|
+
HeadersFrameOption,
|
|
1560
|
+
HeadersReferrerPolicy,
|
|
1561
|
+
ResponseHeadersPolicy,
|
|
1562
|
+
ViewerProtocolPolicy,
|
|
1563
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
1544
1564
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
1545
1565
|
import {
|
|
1546
1566
|
BlockPublicAccess,
|
|
@@ -1549,7 +1569,11 @@ import {
|
|
|
1549
1569
|
IBucket,
|
|
1550
1570
|
ObjectOwnership,
|
|
1551
1571
|
} from 'aws-cdk-lib/aws-s3';
|
|
1552
|
-
import {
|
|
1572
|
+
import {
|
|
1573
|
+
BucketDeployment,
|
|
1574
|
+
CacheControl,
|
|
1575
|
+
Source,
|
|
1576
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
1553
1577
|
import { Construct } from 'constructs';
|
|
1554
1578
|
import { RuntimeConfig } from './runtime-config.js';
|
|
1555
1579
|
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
@@ -1558,6 +1582,23 @@ import { suppressRules } from './checkov.js';
|
|
|
1558
1582
|
|
|
1559
1583
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
1560
1584
|
|
|
1585
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
1586
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
1587
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
1588
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
1589
|
+
// connect-src to your specific origins once they are known.
|
|
1590
|
+
const CONTENT_SECURITY_POLICY = [
|
|
1591
|
+
"default-src 'self'",
|
|
1592
|
+
"script-src 'self'",
|
|
1593
|
+
"style-src 'self' 'unsafe-inline'",
|
|
1594
|
+
"img-src 'self' data:",
|
|
1595
|
+
"font-src 'self' data:",
|
|
1596
|
+
"connect-src 'self' https: wss:",
|
|
1597
|
+
"object-src 'none'",
|
|
1598
|
+
"base-uri 'self'",
|
|
1599
|
+
"frame-ancestors 'none'",
|
|
1600
|
+
].join('; ');
|
|
1601
|
+
|
|
1561
1602
|
export interface StaticWebsiteProps {
|
|
1562
1603
|
readonly websiteName: string;
|
|
1563
1604
|
readonly websiteFilePath: string;
|
|
@@ -1649,6 +1690,36 @@ export class StaticWebsite extends Construct {
|
|
|
1649
1690
|
'Distribution log bucket does not need versioning enabled',
|
|
1650
1691
|
);
|
|
1651
1692
|
|
|
1693
|
+
// Security headers applied to all responses.
|
|
1694
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
1695
|
+
this,
|
|
1696
|
+
'ResponseHeadersPolicy',
|
|
1697
|
+
{
|
|
1698
|
+
securityHeadersBehavior: {
|
|
1699
|
+
strictTransportSecurity: {
|
|
1700
|
+
accessControlMaxAge: Duration.days(730),
|
|
1701
|
+
includeSubdomains: true,
|
|
1702
|
+
preload: true,
|
|
1703
|
+
override: true,
|
|
1704
|
+
},
|
|
1705
|
+
contentTypeOptions: { override: true },
|
|
1706
|
+
frameOptions: {
|
|
1707
|
+
frameOption: HeadersFrameOption.DENY,
|
|
1708
|
+
override: true,
|
|
1709
|
+
},
|
|
1710
|
+
referrerPolicy: {
|
|
1711
|
+
referrerPolicy:
|
|
1712
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
1713
|
+
override: true,
|
|
1714
|
+
},
|
|
1715
|
+
contentSecurityPolicy: {
|
|
1716
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
1717
|
+
override: true,
|
|
1718
|
+
},
|
|
1719
|
+
},
|
|
1720
|
+
},
|
|
1721
|
+
);
|
|
1722
|
+
|
|
1652
1723
|
const defaultRootObject = 'index.html';
|
|
1653
1724
|
this.cloudFrontDistribution = new Distribution(
|
|
1654
1725
|
this,
|
|
@@ -1660,6 +1731,7 @@ export class StaticWebsite extends Construct {
|
|
|
1660
1731
|
defaultBehavior: {
|
|
1661
1732
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
1662
1733
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
1734
|
+
responseHeadersPolicy,
|
|
1663
1735
|
},
|
|
1664
1736
|
defaultRootObject,
|
|
1665
1737
|
errorResponses: [
|
|
@@ -1684,8 +1756,17 @@ export class StaticWebsite extends Construct {
|
|
|
1684
1756
|
|
|
1685
1757
|
// Deploy Website
|
|
1686
1758
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
1759
|
+
sources: [Source.asset(websiteFilePath)],
|
|
1760
|
+
destinationBucket: this.websiteBucket,
|
|
1761
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
1762
|
+
distribution: this.cloudFrontDistribution,
|
|
1763
|
+
memoryLimit: 1024,
|
|
1764
|
+
});
|
|
1765
|
+
|
|
1766
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
1767
|
+
// must always fetch the latest configuration.
|
|
1768
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
1687
1769
|
sources: [
|
|
1688
|
-
Source.asset(websiteFilePath),
|
|
1689
1770
|
Source.data(
|
|
1690
1771
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
1691
1772
|
Lazy.string({
|
|
@@ -1697,8 +1778,9 @@ export class StaticWebsite extends Construct {
|
|
|
1697
1778
|
),
|
|
1698
1779
|
],
|
|
1699
1780
|
destinationBucket: this.websiteBucket,
|
|
1700
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
1701
1781
|
distribution: this.cloudFrontDistribution,
|
|
1782
|
+
cacheControl: [CacheControl.noCache()],
|
|
1783
|
+
prune: false,
|
|
1702
1784
|
memoryLimit: 1024,
|
|
1703
1785
|
});
|
|
1704
1786
|
|
|
@@ -1909,6 +1991,7 @@ export default defineConfig(() => ({
|
|
|
1909
1991
|
root: __dirname,
|
|
1910
1992
|
cacheDir: '../../../node_modules/.vite/packages/common/constructs',
|
|
1911
1993
|
test: {
|
|
1994
|
+
passWithNoTests: true,
|
|
1912
1995
|
name: '@proj/common-constructs',
|
|
1913
1996
|
watch: false,
|
|
1914
1997
|
globals: true,
|
|
@@ -1919,7 +2002,6 @@ export default defineConfig(() => ({
|
|
|
1919
2002
|
reportsDirectory: './test-output/vitest/coverage',
|
|
1920
2003
|
provider: 'v8' as const,
|
|
1921
2004
|
},
|
|
1922
|
-
passWithNoTests: true,
|
|
1923
2005
|
},
|
|
1924
2006
|
}));
|
|
1925
2007
|
"
|
|
@@ -1935,7 +2017,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1935
2017
|
|
|
1936
2018
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > test-app/README.md 1`] = `
|
|
1937
2019
|
"# @proj/test-app
|
|
1938
|
-
|
|
1939
2020
|
This library was generated with [@aws/nx-plugin](https://github.com/awslabs/nx-plugin-for-aws/).
|
|
1940
2021
|
|
|
1941
2022
|
## Building
|
|
@@ -1984,22 +2065,6 @@ In order to integrate with cognito or trpc backends, you need to have a \`runtim
|
|
|
1984
2065
|
"
|
|
1985
2066
|
`;
|
|
1986
2067
|
|
|
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
2068
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > test-app/index.html 1`] = `
|
|
2004
2069
|
"<!doctype html>
|
|
2005
2070
|
<html lang="en">
|
|
@@ -2066,15 +2131,18 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2066
2131
|
}
|
|
2067
2132
|
},
|
|
2068
2133
|
"lint": {
|
|
2069
|
-
"executor": "
|
|
2134
|
+
"executor": "nx:run-commands",
|
|
2070
2135
|
"cache": true,
|
|
2071
|
-
"inputs": ["
|
|
2136
|
+
"inputs": ["biome"],
|
|
2137
|
+
"options": {
|
|
2138
|
+
"command": "biome lint {projectRoot}"
|
|
2139
|
+
},
|
|
2072
2140
|
"configurations": {
|
|
2073
2141
|
"fix": {
|
|
2074
|
-
"
|
|
2142
|
+
"command": "biome check --write {projectRoot}"
|
|
2075
2143
|
},
|
|
2076
2144
|
"skip-lint": {
|
|
2077
|
-
"
|
|
2145
|
+
"command": "node -e \\"\\""
|
|
2078
2146
|
}
|
|
2079
2147
|
}
|
|
2080
2148
|
},
|
|
@@ -2399,9 +2467,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2399
2467
|
|
|
2400
2468
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > test-app/tsconfig.spec.json 1`] = `
|
|
2401
2469
|
"{
|
|
2402
|
-
"extends": "
|
|
2470
|
+
"extends": "./tsconfig.json",
|
|
2403
2471
|
"compilerOptions": {
|
|
2404
|
-
"outDir": "
|
|
2472
|
+
"outDir": "../dist/out-tsc",
|
|
2405
2473
|
"types": [
|
|
2406
2474
|
"vitest/globals",
|
|
2407
2475
|
"vitest/importMeta",
|
|
@@ -2441,6 +2509,8 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2441
2509
|
/// <reference types='vitest' />
|
|
2442
2510
|
import { defineConfig } from 'vite';
|
|
2443
2511
|
import react from '@vitejs/plugin-react';
|
|
2512
|
+
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
2513
|
+
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
|
2444
2514
|
|
|
2445
2515
|
export default defineConfig(() => ({
|
|
2446
2516
|
root: import.meta.dirname,
|
|
@@ -2453,10 +2523,15 @@ export default defineConfig(() => ({
|
|
|
2453
2523
|
port: 4300,
|
|
2454
2524
|
host: 'localhost',
|
|
2455
2525
|
},
|
|
2456
|
-
plugins: [
|
|
2526
|
+
plugins: [
|
|
2527
|
+
react(),
|
|
2528
|
+
nxViteTsPaths(),
|
|
2529
|
+
nxCopyAssetsPlugin(['*.md']),
|
|
2530
|
+
tailwindcss(),
|
|
2531
|
+
],
|
|
2457
2532
|
// Uncomment this if you are using workers.
|
|
2458
2533
|
// worker: {
|
|
2459
|
-
//
|
|
2534
|
+
// plugins: () => [ nxViteTsPaths() ],
|
|
2460
2535
|
// },
|
|
2461
2536
|
build: {
|
|
2462
2537
|
outDir: '../dist/test-app',
|
|
@@ -2467,6 +2542,7 @@ export default defineConfig(() => ({
|
|
|
2467
2542
|
},
|
|
2468
2543
|
},
|
|
2469
2544
|
test: {
|
|
2545
|
+
passWithNoTests: true,
|
|
2470
2546
|
name: '@proj/test-app',
|
|
2471
2547
|
watch: false,
|
|
2472
2548
|
globals: true,
|
|
@@ -2474,10 +2550,9 @@ export default defineConfig(() => ({
|
|
|
2474
2550
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
2475
2551
|
reporters: ['default'],
|
|
2476
2552
|
coverage: {
|
|
2477
|
-
reportsDirectory: '
|
|
2553
|
+
reportsDirectory: '../coverage/test-app',
|
|
2478
2554
|
provider: 'v8' as const,
|
|
2479
2555
|
},
|
|
2480
|
-
passWithNoTests: true,
|
|
2481
2556
|
},
|
|
2482
2557
|
resolve: { tsconfigPaths: true },
|
|
2483
2558
|
define: { global: {} },
|
|
@@ -2528,61 +2603,71 @@ vitest.config.*.timestamp*
|
|
|
2528
2603
|
runtime-config.json"
|
|
2529
2604
|
`;
|
|
2530
2605
|
|
|
2606
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > .prettierignore 1`] = `
|
|
2607
|
+
"# Add files here to ignore them from prettier formatting
|
|
2608
|
+
/dist
|
|
2609
|
+
/coverage
|
|
2610
|
+
/.nx/cache
|
|
2611
|
+
/.nx/workspace-data"
|
|
2612
|
+
`;
|
|
2613
|
+
|
|
2531
2614
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > .prettierrc 1`] = `
|
|
2532
2615
|
"{ "singleQuote": true }
|
|
2533
2616
|
"
|
|
2534
2617
|
`;
|
|
2535
2618
|
|
|
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
|
-
],
|
|
2619
|
+
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > biome.json 1`] = `
|
|
2620
|
+
"{
|
|
2621
|
+
"$schema": "https://biomejs.dev/schemas/2.4.16/schema.json",
|
|
2622
|
+
"root": true,
|
|
2623
|
+
"formatter": {
|
|
2624
|
+
"enabled": true,
|
|
2625
|
+
"indentStyle": "space",
|
|
2626
|
+
"indentWidth": 2,
|
|
2627
|
+
"lineWidth": 80
|
|
2552
2628
|
},
|
|
2553
|
-
{
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
{
|
|
2563
|
-
sourceTag: '*',
|
|
2564
|
-
onlyDependOnLibsWithTags: ['*'],
|
|
2565
|
-
},
|
|
2566
|
-
],
|
|
2567
|
-
},
|
|
2568
|
-
],
|
|
2629
|
+
"javascript": {
|
|
2630
|
+
"formatter": {
|
|
2631
|
+
"quoteStyle": "single",
|
|
2632
|
+
"trailingCommas": "all"
|
|
2633
|
+
}
|
|
2634
|
+
},
|
|
2635
|
+
"css": {
|
|
2636
|
+
"formatter": {
|
|
2637
|
+
"quoteStyle": "single"
|
|
2569
2638
|
},
|
|
2639
|
+
"linter": {
|
|
2640
|
+
"enabled": false
|
|
2641
|
+
}
|
|
2570
2642
|
},
|
|
2571
|
-
{
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
'**/*.cjs',
|
|
2580
|
-
'**/*.mjs',
|
|
2581
|
-
],
|
|
2582
|
-
// Override or add rules here
|
|
2583
|
-
rules: {},
|
|
2643
|
+
"linter": {
|
|
2644
|
+
"enabled": true,
|
|
2645
|
+
"rules": {
|
|
2646
|
+
"recommended": false,
|
|
2647
|
+
"correctness": {
|
|
2648
|
+
"noUndeclaredDependencies": "warn"
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2584
2651
|
},
|
|
2585
|
-
|
|
2652
|
+
"assist": {
|
|
2653
|
+
"actions": {
|
|
2654
|
+
"source": {
|
|
2655
|
+
"organizeImports": "on"
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
},
|
|
2659
|
+
"files": {
|
|
2660
|
+
"includes": [
|
|
2661
|
+
"**",
|
|
2662
|
+
"!**/dist",
|
|
2663
|
+
"!**/out-tsc",
|
|
2664
|
+
"!**/node_modules",
|
|
2665
|
+
"!**/.nx",
|
|
2666
|
+
"!**/.venv",
|
|
2667
|
+
"!**/*.css"
|
|
2668
|
+
]
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2586
2671
|
"
|
|
2587
2672
|
`;
|
|
2588
2673
|
|
|
@@ -2600,17 +2685,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2600
2685
|
"lint": {
|
|
2601
2686
|
"cache": true
|
|
2602
2687
|
},
|
|
2603
|
-
"@nx/eslint:lint": {
|
|
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
2688
|
"@nx/vite:build": {
|
|
2615
2689
|
"cache": true,
|
|
2616
2690
|
"dependsOn": ["^build"],
|
|
@@ -2639,7 +2713,7 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2639
2713
|
"application": {
|
|
2640
2714
|
"babel": true,
|
|
2641
2715
|
"style": "css",
|
|
2642
|
-
"linter": "
|
|
2716
|
+
"linter": "none",
|
|
2643
2717
|
"bundler": "vite"
|
|
2644
2718
|
},
|
|
2645
2719
|
"component": {
|
|
@@ -2647,16 +2721,12 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2647
2721
|
},
|
|
2648
2722
|
"library": {
|
|
2649
2723
|
"style": "css",
|
|
2650
|
-
"linter": "
|
|
2724
|
+
"linter": "none"
|
|
2651
2725
|
}
|
|
2652
2726
|
}
|
|
2653
2727
|
},
|
|
2654
2728
|
"namedInputs": {
|
|
2655
|
-
"
|
|
2656
|
-
"default",
|
|
2657
|
-
"{workspaceRoot}/eslint.config.mjs",
|
|
2658
|
-
"{projectRoot}/eslint.config.mjs"
|
|
2659
|
-
],
|
|
2729
|
+
"biome": ["default", "{workspaceRoot}/biome.json"],
|
|
2660
2730
|
"default": [
|
|
2661
2731
|
{
|
|
2662
2732
|
"dependentTasksOutputFiles": "**/*",
|
|
@@ -2688,57 +2758,44 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2688
2758
|
"{
|
|
2689
2759
|
"name": "@proj/source",
|
|
2690
2760
|
"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.
|
|
2761
|
+
"@cloudscape-design/board-components": "3.0.190",
|
|
2762
|
+
"@cloudscape-design/components": "3.0.1310",
|
|
2763
|
+
"@cloudscape-design/global-styles": "1.0.60",
|
|
2764
|
+
"@tanstack/react-router": "1.170.15",
|
|
2765
|
+
"aws-cdk-lib": "2.259.0",
|
|
2696
2766
|
"constructs": "10.6.0",
|
|
2697
|
-
"react": "19.2.
|
|
2698
|
-
"react-dom": "19.2.
|
|
2699
|
-
"tailwindcss": "4.
|
|
2767
|
+
"react": "19.2.7",
|
|
2768
|
+
"react-dom": "19.2.7",
|
|
2769
|
+
"tailwindcss": "4.2.2"
|
|
2700
2770
|
},
|
|
2701
2771
|
"devDependencies": {
|
|
2702
|
-
"@
|
|
2703
|
-
"@nx/
|
|
2704
|
-
"@nx/
|
|
2705
|
-
"@nx/
|
|
2706
|
-
"@nx/
|
|
2707
|
-
"@nx/vite": "22.7.3",
|
|
2708
|
-
"@nx/vitest": "22.7.3",
|
|
2709
|
-
"@nx/web": "22.7.3",
|
|
2772
|
+
"@nx/js": "22.7.5",
|
|
2773
|
+
"@nx/react": "22.7.5",
|
|
2774
|
+
"@nx/vite": "22.7.5",
|
|
2775
|
+
"@nx/vitest": "22.7.5",
|
|
2776
|
+
"@nx/web": "22.7.5",
|
|
2710
2777
|
"@swc-node/register": "~1.11.1",
|
|
2711
|
-
"@swc/cli": "~0.8.0",
|
|
2712
2778
|
"@swc/core": "~1.15.5",
|
|
2713
2779
|
"@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.
|
|
2780
|
+
"@tailwindcss/vite": "4.2.2",
|
|
2781
|
+
"@tanstack/router-generator": "1.167.17",
|
|
2782
|
+
"@tanstack/router-plugin": "1.168.18",
|
|
2783
|
+
"@tanstack/router-utils": "1.162.2",
|
|
2718
2784
|
"@tanstack/virtual-file-routes": "1.162.0",
|
|
2719
2785
|
"@testing-library/dom": "10.4.0",
|
|
2720
2786
|
"@testing-library/react": "16.3.0",
|
|
2721
|
-
"@types/node": "25.9.
|
|
2787
|
+
"@types/node": "25.9.3",
|
|
2722
2788
|
"@types/react": "^19.0.0",
|
|
2723
2789
|
"@types/react-dom": "^19.0.0",
|
|
2724
2790
|
"@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.5",
|
|
2732
|
-
"eslint-plugin-react": "7.35.0",
|
|
2733
|
-
"eslint-plugin-react-hooks": "5.0.0",
|
|
2791
|
+
"@vitest/coverage-v8": "4.1.8",
|
|
2792
|
+
"@vitest/ui": "4.1.8",
|
|
2734
2793
|
"jiti": "2.4.2",
|
|
2735
2794
|
"jsdom": "~22.1.0",
|
|
2736
|
-
"
|
|
2737
|
-
"prettier": "3.8.3",
|
|
2795
|
+
"prettier": "~3.6.2",
|
|
2738
2796
|
"typescript": "~5.9.2",
|
|
2739
|
-
"
|
|
2740
|
-
"
|
|
2741
|
-
"vitest": "4.1.7"
|
|
2797
|
+
"vite": "8.0.16",
|
|
2798
|
+
"vitest": "4.1.8"
|
|
2742
2799
|
},
|
|
2743
2800
|
"type": "module",
|
|
2744
2801
|
"scripts": {
|
|
@@ -2781,35 +2838,7 @@ You can also automatiaclly fix some lint errors by running the following command
|
|
|
2781
2838
|
|
|
2782
2839
|
- [common-constructs reference docs](TODO)
|
|
2783
2840
|
- [Learn more about NX](https://nx.dev/getting-started/intro)
|
|
2784
|
-
"
|
|
2785
|
-
`;
|
|
2786
2841
|
|
|
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
2842
|
"
|
|
2814
2843
|
`;
|
|
2815
2844
|
|
|
@@ -2820,6 +2849,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2820
2849
|
"sourceRoot": "packages/common/constructs/src",
|
|
2821
2850
|
"projectType": "library",
|
|
2822
2851
|
"tags": [],
|
|
2852
|
+
"metadata": {
|
|
2853
|
+
"generator": "ts#project"
|
|
2854
|
+
},
|
|
2823
2855
|
"targets": {
|
|
2824
2856
|
"build": {
|
|
2825
2857
|
"dependsOn": ["lint", "compile", "test", "@proj/test-app:build"]
|
|
@@ -2833,15 +2865,18 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2833
2865
|
}
|
|
2834
2866
|
},
|
|
2835
2867
|
"lint": {
|
|
2836
|
-
"executor": "
|
|
2868
|
+
"executor": "nx:run-commands",
|
|
2837
2869
|
"cache": true,
|
|
2838
|
-
"inputs": ["
|
|
2870
|
+
"inputs": ["biome"],
|
|
2871
|
+
"options": {
|
|
2872
|
+
"command": "biome lint {projectRoot}"
|
|
2873
|
+
},
|
|
2839
2874
|
"configurations": {
|
|
2840
2875
|
"fix": {
|
|
2841
|
-
"
|
|
2876
|
+
"command": "biome check --write {projectRoot}"
|
|
2842
2877
|
},
|
|
2843
2878
|
"skip-lint": {
|
|
2844
|
-
"
|
|
2879
|
+
"command": "node -e \\"\\""
|
|
2845
2880
|
}
|
|
2846
2881
|
}
|
|
2847
2882
|
},
|
|
@@ -2852,9 +2887,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2852
2887
|
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
2853
2888
|
}
|
|
2854
2889
|
}
|
|
2855
|
-
},
|
|
2856
|
-
"metadata": {
|
|
2857
|
-
"generator": "ts#project"
|
|
2858
2890
|
}
|
|
2859
2891
|
}
|
|
2860
2892
|
"
|
|
@@ -3164,11 +3196,18 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3164
3196
|
"import {
|
|
3165
3197
|
CfnOutput,
|
|
3166
3198
|
CfnResource,
|
|
3199
|
+
Duration,
|
|
3167
3200
|
Lazy,
|
|
3168
3201
|
RemovalPolicy,
|
|
3169
3202
|
Stack,
|
|
3170
3203
|
} from 'aws-cdk-lib';
|
|
3171
|
-
import {
|
|
3204
|
+
import {
|
|
3205
|
+
Distribution,
|
|
3206
|
+
HeadersFrameOption,
|
|
3207
|
+
HeadersReferrerPolicy,
|
|
3208
|
+
ResponseHeadersPolicy,
|
|
3209
|
+
ViewerProtocolPolicy,
|
|
3210
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
3172
3211
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
3173
3212
|
import {
|
|
3174
3213
|
BlockPublicAccess,
|
|
@@ -3177,7 +3216,11 @@ import {
|
|
|
3177
3216
|
IBucket,
|
|
3178
3217
|
ObjectOwnership,
|
|
3179
3218
|
} from 'aws-cdk-lib/aws-s3';
|
|
3180
|
-
import {
|
|
3219
|
+
import {
|
|
3220
|
+
BucketDeployment,
|
|
3221
|
+
CacheControl,
|
|
3222
|
+
Source,
|
|
3223
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
3181
3224
|
import { Construct } from 'constructs';
|
|
3182
3225
|
import { RuntimeConfig } from './runtime-config.js';
|
|
3183
3226
|
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
@@ -3186,6 +3229,23 @@ import { suppressRules } from './checkov.js';
|
|
|
3186
3229
|
|
|
3187
3230
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
3188
3231
|
|
|
3232
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
3233
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
3234
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
3235
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
3236
|
+
// connect-src to your specific origins once they are known.
|
|
3237
|
+
const CONTENT_SECURITY_POLICY = [
|
|
3238
|
+
"default-src 'self'",
|
|
3239
|
+
"script-src 'self'",
|
|
3240
|
+
"style-src 'self' 'unsafe-inline'",
|
|
3241
|
+
"img-src 'self' data:",
|
|
3242
|
+
"font-src 'self' data:",
|
|
3243
|
+
"connect-src 'self' https: wss:",
|
|
3244
|
+
"object-src 'none'",
|
|
3245
|
+
"base-uri 'self'",
|
|
3246
|
+
"frame-ancestors 'none'",
|
|
3247
|
+
].join('; ');
|
|
3248
|
+
|
|
3189
3249
|
export interface StaticWebsiteProps {
|
|
3190
3250
|
readonly websiteName: string;
|
|
3191
3251
|
readonly websiteFilePath: string;
|
|
@@ -3277,6 +3337,36 @@ export class StaticWebsite extends Construct {
|
|
|
3277
3337
|
'Distribution log bucket does not need versioning enabled',
|
|
3278
3338
|
);
|
|
3279
3339
|
|
|
3340
|
+
// Security headers applied to all responses.
|
|
3341
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
3342
|
+
this,
|
|
3343
|
+
'ResponseHeadersPolicy',
|
|
3344
|
+
{
|
|
3345
|
+
securityHeadersBehavior: {
|
|
3346
|
+
strictTransportSecurity: {
|
|
3347
|
+
accessControlMaxAge: Duration.days(730),
|
|
3348
|
+
includeSubdomains: true,
|
|
3349
|
+
preload: true,
|
|
3350
|
+
override: true,
|
|
3351
|
+
},
|
|
3352
|
+
contentTypeOptions: { override: true },
|
|
3353
|
+
frameOptions: {
|
|
3354
|
+
frameOption: HeadersFrameOption.DENY,
|
|
3355
|
+
override: true,
|
|
3356
|
+
},
|
|
3357
|
+
referrerPolicy: {
|
|
3358
|
+
referrerPolicy:
|
|
3359
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
3360
|
+
override: true,
|
|
3361
|
+
},
|
|
3362
|
+
contentSecurityPolicy: {
|
|
3363
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
3364
|
+
override: true,
|
|
3365
|
+
},
|
|
3366
|
+
},
|
|
3367
|
+
},
|
|
3368
|
+
);
|
|
3369
|
+
|
|
3280
3370
|
const defaultRootObject = 'index.html';
|
|
3281
3371
|
this.cloudFrontDistribution = new Distribution(
|
|
3282
3372
|
this,
|
|
@@ -3288,6 +3378,7 @@ export class StaticWebsite extends Construct {
|
|
|
3288
3378
|
defaultBehavior: {
|
|
3289
3379
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
3290
3380
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
3381
|
+
responseHeadersPolicy,
|
|
3291
3382
|
},
|
|
3292
3383
|
defaultRootObject,
|
|
3293
3384
|
errorResponses: [
|
|
@@ -3312,8 +3403,17 @@ export class StaticWebsite extends Construct {
|
|
|
3312
3403
|
|
|
3313
3404
|
// Deploy Website
|
|
3314
3405
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
3406
|
+
sources: [Source.asset(websiteFilePath)],
|
|
3407
|
+
destinationBucket: this.websiteBucket,
|
|
3408
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
3409
|
+
distribution: this.cloudFrontDistribution,
|
|
3410
|
+
memoryLimit: 1024,
|
|
3411
|
+
});
|
|
3412
|
+
|
|
3413
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
3414
|
+
// must always fetch the latest configuration.
|
|
3415
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
3315
3416
|
sources: [
|
|
3316
|
-
Source.asset(websiteFilePath),
|
|
3317
3417
|
Source.data(
|
|
3318
3418
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
3319
3419
|
Lazy.string({
|
|
@@ -3325,8 +3425,9 @@ export class StaticWebsite extends Construct {
|
|
|
3325
3425
|
),
|
|
3326
3426
|
],
|
|
3327
3427
|
destinationBucket: this.websiteBucket,
|
|
3328
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
3329
3428
|
distribution: this.cloudFrontDistribution,
|
|
3429
|
+
cacheControl: [CacheControl.noCache()],
|
|
3430
|
+
prune: false,
|
|
3330
3431
|
memoryLimit: 1024,
|
|
3331
3432
|
});
|
|
3332
3433
|
|
|
@@ -3537,6 +3638,7 @@ export default defineConfig(() => ({
|
|
|
3537
3638
|
root: __dirname,
|
|
3538
3639
|
cacheDir: '../../../node_modules/.vite/packages/common/constructs',
|
|
3539
3640
|
test: {
|
|
3641
|
+
passWithNoTests: true,
|
|
3540
3642
|
name: '@proj/common-constructs',
|
|
3541
3643
|
watch: false,
|
|
3542
3644
|
globals: true,
|
|
@@ -3547,7 +3649,6 @@ export default defineConfig(() => ({
|
|
|
3547
3649
|
reportsDirectory: './test-output/vitest/coverage',
|
|
3548
3650
|
provider: 'v8' as const,
|
|
3549
3651
|
},
|
|
3550
|
-
passWithNoTests: true,
|
|
3551
3652
|
},
|
|
3552
3653
|
}));
|
|
3553
3654
|
"
|
|
@@ -3563,7 +3664,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3563
3664
|
|
|
3564
3665
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > test-app/README.md 1`] = `
|
|
3565
3666
|
"# @proj/test-app
|
|
3566
|
-
|
|
3567
3667
|
This library was generated with [@aws/nx-plugin](https://github.com/awslabs/nx-plugin-for-aws/).
|
|
3568
3668
|
|
|
3569
3669
|
## Building
|
|
@@ -3612,22 +3712,6 @@ In order to integrate with cognito or trpc backends, you need to have a \`runtim
|
|
|
3612
3712
|
"
|
|
3613
3713
|
`;
|
|
3614
3714
|
|
|
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
3715
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > test-app/index.html 1`] = `
|
|
3632
3716
|
"<!doctype html>
|
|
3633
3717
|
<html lang="en">
|
|
@@ -3694,15 +3778,18 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3694
3778
|
}
|
|
3695
3779
|
},
|
|
3696
3780
|
"lint": {
|
|
3697
|
-
"executor": "
|
|
3781
|
+
"executor": "nx:run-commands",
|
|
3698
3782
|
"cache": true,
|
|
3699
|
-
"inputs": ["
|
|
3783
|
+
"inputs": ["biome"],
|
|
3784
|
+
"options": {
|
|
3785
|
+
"command": "biome lint {projectRoot}"
|
|
3786
|
+
},
|
|
3700
3787
|
"configurations": {
|
|
3701
3788
|
"fix": {
|
|
3702
|
-
"
|
|
3789
|
+
"command": "biome check --write {projectRoot}"
|
|
3703
3790
|
},
|
|
3704
3791
|
"skip-lint": {
|
|
3705
|
-
"
|
|
3792
|
+
"command": "node -e \\"\\""
|
|
3706
3793
|
}
|
|
3707
3794
|
}
|
|
3708
3795
|
},
|
|
@@ -4211,9 +4298,9 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4211
4298
|
|
|
4212
4299
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > test-app/tsconfig.spec.json 1`] = `
|
|
4213
4300
|
"{
|
|
4214
|
-
"extends": "
|
|
4301
|
+
"extends": "./tsconfig.json",
|
|
4215
4302
|
"compilerOptions": {
|
|
4216
|
-
"outDir": "
|
|
4303
|
+
"outDir": "../dist/out-tsc",
|
|
4217
4304
|
"types": [
|
|
4218
4305
|
"vitest/globals",
|
|
4219
4306
|
"vitest/importMeta",
|
|
@@ -4255,6 +4342,8 @@ import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
|
|
4255
4342
|
/// <reference types='vitest' />
|
|
4256
4343
|
import { defineConfig } from 'vite';
|
|
4257
4344
|
import react from '@vitejs/plugin-react';
|
|
4345
|
+
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
4346
|
+
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
|
4258
4347
|
|
|
4259
4348
|
export default defineConfig(() => ({
|
|
4260
4349
|
root: import.meta.dirname,
|
|
@@ -4273,11 +4362,13 @@ export default defineConfig(() => ({
|
|
|
4273
4362
|
generatedRouteTree: resolve(__dirname, 'src/routeTree.gen.ts'),
|
|
4274
4363
|
}),
|
|
4275
4364
|
react(),
|
|
4365
|
+
nxViteTsPaths(),
|
|
4366
|
+
nxCopyAssetsPlugin(['*.md']),
|
|
4276
4367
|
tailwindcss(),
|
|
4277
4368
|
],
|
|
4278
4369
|
// Uncomment this if you are using workers.
|
|
4279
4370
|
// worker: {
|
|
4280
|
-
//
|
|
4371
|
+
// plugins: () => [ nxViteTsPaths() ],
|
|
4281
4372
|
// },
|
|
4282
4373
|
build: {
|
|
4283
4374
|
outDir: '../dist/test-app',
|
|
@@ -4288,6 +4379,7 @@ export default defineConfig(() => ({
|
|
|
4288
4379
|
},
|
|
4289
4380
|
},
|
|
4290
4381
|
test: {
|
|
4382
|
+
passWithNoTests: true,
|
|
4291
4383
|
name: '@proj/test-app',
|
|
4292
4384
|
watch: false,
|
|
4293
4385
|
globals: true,
|
|
@@ -4295,10 +4387,9 @@ export default defineConfig(() => ({
|
|
|
4295
4387
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
4296
4388
|
reporters: ['default'],
|
|
4297
4389
|
coverage: {
|
|
4298
|
-
reportsDirectory: '
|
|
4390
|
+
reportsDirectory: '../coverage/test-app',
|
|
4299
4391
|
provider: 'v8' as const,
|
|
4300
4392
|
},
|
|
4301
|
-
passWithNoTests: true,
|
|
4302
4393
|
},
|
|
4303
4394
|
resolve: { tsconfigPaths: true },
|
|
4304
4395
|
define: { global: {} },
|
|
@@ -4368,6 +4459,8 @@ import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
|
|
4368
4459
|
/// <reference types='vitest' />
|
|
4369
4460
|
import { defineConfig } from 'vite';
|
|
4370
4461
|
import react from '@vitejs/plugin-react';
|
|
4462
|
+
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
4463
|
+
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
|
4371
4464
|
|
|
4372
4465
|
export default defineConfig(() => ({
|
|
4373
4466
|
root: import.meta.dirname,
|
|
@@ -4386,11 +4479,13 @@ export default defineConfig(() => ({
|
|
|
4386
4479
|
generatedRouteTree: resolve(__dirname, 'src/routeTree.gen.ts'),
|
|
4387
4480
|
}),
|
|
4388
4481
|
react(),
|
|
4482
|
+
nxViteTsPaths(),
|
|
4483
|
+
nxCopyAssetsPlugin(['*.md']),
|
|
4389
4484
|
tailwindcss(),
|
|
4390
4485
|
],
|
|
4391
4486
|
// Uncomment this if you are using workers.
|
|
4392
4487
|
// worker: {
|
|
4393
|
-
//
|
|
4488
|
+
// plugins: () => [ nxViteTsPaths() ],
|
|
4394
4489
|
// },
|
|
4395
4490
|
build: {
|
|
4396
4491
|
outDir: '../dist/test-app',
|
|
@@ -4401,6 +4496,7 @@ export default defineConfig(() => ({
|
|
|
4401
4496
|
},
|
|
4402
4497
|
},
|
|
4403
4498
|
test: {
|
|
4499
|
+
passWithNoTests: true,
|
|
4404
4500
|
name: '@proj/test-app',
|
|
4405
4501
|
watch: false,
|
|
4406
4502
|
globals: true,
|
|
@@ -4408,10 +4504,9 @@ export default defineConfig(() => ({
|
|
|
4408
4504
|
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
4409
4505
|
reporters: ['default'],
|
|
4410
4506
|
coverage: {
|
|
4411
|
-
reportsDirectory: '
|
|
4507
|
+
reportsDirectory: '../coverage/test-app',
|
|
4412
4508
|
provider: 'v8' as const,
|
|
4413
4509
|
},
|
|
4414
|
-
passWithNoTests: true,
|
|
4415
4510
|
},
|
|
4416
4511
|
resolve: { tsconfigPaths: true },
|
|
4417
4512
|
define: { global: {} },
|
|
@@ -4667,11 +4762,18 @@ exports[`react-website generator > should generate shared constructs > common/co
|
|
|
4667
4762
|
"import {
|
|
4668
4763
|
CfnOutput,
|
|
4669
4764
|
CfnResource,
|
|
4765
|
+
Duration,
|
|
4670
4766
|
Lazy,
|
|
4671
4767
|
RemovalPolicy,
|
|
4672
4768
|
Stack,
|
|
4673
4769
|
} from 'aws-cdk-lib';
|
|
4674
|
-
import {
|
|
4770
|
+
import {
|
|
4771
|
+
Distribution,
|
|
4772
|
+
HeadersFrameOption,
|
|
4773
|
+
HeadersReferrerPolicy,
|
|
4774
|
+
ResponseHeadersPolicy,
|
|
4775
|
+
ViewerProtocolPolicy,
|
|
4776
|
+
} from 'aws-cdk-lib/aws-cloudfront';
|
|
4675
4777
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
4676
4778
|
import {
|
|
4677
4779
|
BlockPublicAccess,
|
|
@@ -4680,7 +4782,11 @@ import {
|
|
|
4680
4782
|
IBucket,
|
|
4681
4783
|
ObjectOwnership,
|
|
4682
4784
|
} from 'aws-cdk-lib/aws-s3';
|
|
4683
|
-
import {
|
|
4785
|
+
import {
|
|
4786
|
+
BucketDeployment,
|
|
4787
|
+
CacheControl,
|
|
4788
|
+
Source,
|
|
4789
|
+
} from 'aws-cdk-lib/aws-s3-deployment';
|
|
4684
4790
|
import { Construct } from 'constructs';
|
|
4685
4791
|
import { RuntimeConfig } from './runtime-config.js';
|
|
4686
4792
|
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
@@ -4689,6 +4795,23 @@ import { suppressRules } from './checkov.js';
|
|
|
4689
4795
|
|
|
4690
4796
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
4691
4797
|
|
|
4798
|
+
// Content-Security-Policy enforced on all responses. Restricts scripts and
|
|
4799
|
+
// framing to mitigate XSS and clickjacking, while permitting HTTPS/WSS calls
|
|
4800
|
+
// (connect-src) to AWS service endpoints such as API Gateway, Cognito and
|
|
4801
|
+
// Bedrock AgentCore which are only known at deploy time. Edit this to tighten
|
|
4802
|
+
// connect-src to your specific origins once they are known.
|
|
4803
|
+
const CONTENT_SECURITY_POLICY = [
|
|
4804
|
+
"default-src 'self'",
|
|
4805
|
+
"script-src 'self'",
|
|
4806
|
+
"style-src 'self' 'unsafe-inline'",
|
|
4807
|
+
"img-src 'self' data:",
|
|
4808
|
+
"font-src 'self' data:",
|
|
4809
|
+
"connect-src 'self' https: wss:",
|
|
4810
|
+
"object-src 'none'",
|
|
4811
|
+
"base-uri 'self'",
|
|
4812
|
+
"frame-ancestors 'none'",
|
|
4813
|
+
].join('; ');
|
|
4814
|
+
|
|
4692
4815
|
export interface StaticWebsiteProps {
|
|
4693
4816
|
readonly websiteName: string;
|
|
4694
4817
|
readonly websiteFilePath: string;
|
|
@@ -4780,6 +4903,36 @@ export class StaticWebsite extends Construct {
|
|
|
4780
4903
|
'Distribution log bucket does not need versioning enabled',
|
|
4781
4904
|
);
|
|
4782
4905
|
|
|
4906
|
+
// Security headers applied to all responses.
|
|
4907
|
+
const responseHeadersPolicy = new ResponseHeadersPolicy(
|
|
4908
|
+
this,
|
|
4909
|
+
'ResponseHeadersPolicy',
|
|
4910
|
+
{
|
|
4911
|
+
securityHeadersBehavior: {
|
|
4912
|
+
strictTransportSecurity: {
|
|
4913
|
+
accessControlMaxAge: Duration.days(730),
|
|
4914
|
+
includeSubdomains: true,
|
|
4915
|
+
preload: true,
|
|
4916
|
+
override: true,
|
|
4917
|
+
},
|
|
4918
|
+
contentTypeOptions: { override: true },
|
|
4919
|
+
frameOptions: {
|
|
4920
|
+
frameOption: HeadersFrameOption.DENY,
|
|
4921
|
+
override: true,
|
|
4922
|
+
},
|
|
4923
|
+
referrerPolicy: {
|
|
4924
|
+
referrerPolicy:
|
|
4925
|
+
HeadersReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,
|
|
4926
|
+
override: true,
|
|
4927
|
+
},
|
|
4928
|
+
contentSecurityPolicy: {
|
|
4929
|
+
contentSecurityPolicy: CONTENT_SECURITY_POLICY,
|
|
4930
|
+
override: true,
|
|
4931
|
+
},
|
|
4932
|
+
},
|
|
4933
|
+
},
|
|
4934
|
+
);
|
|
4935
|
+
|
|
4783
4936
|
const defaultRootObject = 'index.html';
|
|
4784
4937
|
this.cloudFrontDistribution = new Distribution(
|
|
4785
4938
|
this,
|
|
@@ -4791,6 +4944,7 @@ export class StaticWebsite extends Construct {
|
|
|
4791
4944
|
defaultBehavior: {
|
|
4792
4945
|
origin: S3BucketOrigin.withOriginAccessControl(this.websiteBucket),
|
|
4793
4946
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
4947
|
+
responseHeadersPolicy,
|
|
4794
4948
|
},
|
|
4795
4949
|
defaultRootObject,
|
|
4796
4950
|
errorResponses: [
|
|
@@ -4815,8 +4969,17 @@ export class StaticWebsite extends Construct {
|
|
|
4815
4969
|
|
|
4816
4970
|
// Deploy Website
|
|
4817
4971
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
4972
|
+
sources: [Source.asset(websiteFilePath)],
|
|
4973
|
+
destinationBucket: this.websiteBucket,
|
|
4974
|
+
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
4975
|
+
distribution: this.cloudFrontDistribution,
|
|
4976
|
+
memoryLimit: 1024,
|
|
4977
|
+
});
|
|
4978
|
+
|
|
4979
|
+
// Deploy runtime-config.json separately so it is never cached - clients
|
|
4980
|
+
// must always fetch the latest configuration.
|
|
4981
|
+
new BucketDeployment(this, 'RuntimeConfigDeployment', {
|
|
4818
4982
|
sources: [
|
|
4819
|
-
Source.asset(websiteFilePath),
|
|
4820
4983
|
Source.data(
|
|
4821
4984
|
DEFAULT_RUNTIME_CONFIG_FILENAME,
|
|
4822
4985
|
Lazy.string({
|
|
@@ -4828,8 +4991,9 @@ export class StaticWebsite extends Construct {
|
|
|
4828
4991
|
),
|
|
4829
4992
|
],
|
|
4830
4993
|
destinationBucket: this.websiteBucket,
|
|
4831
|
-
// Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
|
|
4832
4994
|
distribution: this.cloudFrontDistribution,
|
|
4995
|
+
cacheControl: [CacheControl.noCache()],
|
|
4996
|
+
prune: false,
|
|
4833
4997
|
memoryLimit: 1024,
|
|
4834
4998
|
});
|
|
4835
4999
|
|
|
@@ -4975,15 +5139,15 @@ root &&
|
|
|
4975
5139
|
|
|
4976
5140
|
exports[`react-website generator > should handle npm scope prefix correctly > scoped-dependencies 1`] = `
|
|
4977
5141
|
{
|
|
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.
|
|
5142
|
+
"@cloudscape-design/board-components": "3.0.190",
|
|
5143
|
+
"@cloudscape-design/components": "3.0.1310",
|
|
5144
|
+
"@cloudscape-design/global-styles": "1.0.60",
|
|
5145
|
+
"@tanstack/react-router": "1.170.15",
|
|
5146
|
+
"aws-cdk-lib": "2.259.0",
|
|
4983
5147
|
"constructs": "10.6.0",
|
|
4984
|
-
"react": "19.2.
|
|
4985
|
-
"react-dom": "19.2.
|
|
4986
|
-
"tailwindcss": "4.
|
|
5148
|
+
"react": "19.2.7",
|
|
5149
|
+
"react-dom": "19.2.7",
|
|
5150
|
+
"tailwindcss": "4.2.2",
|
|
4987
5151
|
}
|
|
4988
5152
|
`;
|
|
4989
5153
|
|
|
@@ -5687,6 +5851,5 @@ function RouteComponent() {
|
|
|
5687
5851
|
|
|
5688
5852
|
exports[`react-website generator ux tests > Shadcn > should update package.json with required dependencies > test-app/src/styles.css 1`] = `
|
|
5689
5853
|
"@import '../../packages/common/shadcn/src/styles/globals.css';
|
|
5690
|
-
@source './**/*.{ts,tsx}';
|
|
5691
|
-
"
|
|
5854
|
+
@source './**/*.{ts,tsx}';"
|
|
5692
5855
|
`;
|