@aws/nx-plugin 1.0.0-rc.22 → 1.0.0-rc.24
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 +2088 -971
- package/package.json +25 -10
- package/src/agentcore-gateway/attach-upstream.d.ts +7 -7
- package/src/agentcore-gateway/attach-upstream.js +19 -22
- package/src/agentcore-gateway/attach-upstream.js.map +1 -1
- package/src/agentcore-gateway/gateway-connection/generator.d.ts +3 -3
- package/src/agentcore-gateway/gateway-connection/generator.js +42 -45
- package/src/agentcore-gateway/gateway-connection/generator.js.map +1 -1
- package/src/agentcore-gateway/gateway-connection/schema.d.js +6 -0
- package/src/agentcore-gateway/gateway-connection/schema.d.js.map +1 -0
- package/src/agentcore-gateway/generator.js +89 -72
- package/src/agentcore-gateway/generator.js.map +1 -1
- package/src/agentcore-gateway/mcp-connection/generator.d.ts +2 -2
- package/src/agentcore-gateway/mcp-connection/generator.js +24 -30
- package/src/agentcore-gateway/mcp-connection/generator.js.map +1 -1
- package/src/agentcore-gateway/mcp-connection/schema.d.js +6 -0
- package/src/agentcore-gateway/mcp-connection/schema.d.js.map +1 -0
- package/src/agentcore-gateway/schema.d.js +6 -0
- package/src/agentcore-gateway/schema.d.js.map +1 -0
- package/src/bin/aws-nx-mcp.js +14 -0
- package/src/bin/aws-nx-mcp.js.map +1 -0
- package/src/connection/{agent-serve-local.d.ts → agent-local-dev.d.ts} +5 -5
- package/src/connection/agent-local-dev.js +42 -0
- package/src/connection/agent-local-dev.js.map +1 -0
- package/src/connection/agent-runtime-config.js +9 -14
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/generator.js +262 -207
- package/src/connection/generator.js.map +1 -1
- package/src/connection/{serve-local.d.ts → local-dev.d.ts} +3 -3
- package/src/connection/local-dev.js +37 -0
- package/src/connection/local-dev.js.map +1 -0
- package/src/connection/schema.d.js +6 -0
- package/src/connection/schema.d.js.map +1 -0
- package/src/index.js +2 -5
- package/src/index.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +4 -26
- package/src/infra/app/generator.js +133 -123
- package/src/infra/app/generator.js.map +1 -1
- package/src/infra/app/schema.d.js +6 -0
- package/src/infra/app/schema.d.js.map +1 -0
- package/src/license/config-types.js +5 -3
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +1 -1
- package/src/license/config.js +267 -242
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/check.js +51 -46
- package/src/license/dependency-check/check.js.map +1 -1
- package/src/license/dependency-check/collectors/collector.js +41 -71
- package/src/license/dependency-check/collectors/collector.js.map +1 -1
- package/src/license/dependency-check/collectors/npm-collector.js +34 -41
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -1
- package/src/license/dependency-check/collectors/python-collector.js +55 -62
- package/src/license/dependency-check/collectors/python-collector.js.map +1 -1
- package/src/license/dependency-check/evaluator.js +40 -68
- package/src/license/dependency-check/evaluator.js.map +1 -1
- package/src/license/dependency-check/executor.js +30 -22
- package/src/license/dependency-check/executor.js.map +1 -1
- package/src/license/dependency-check/pre-approved.js +949 -336
- package/src/license/dependency-check/pre-approved.js.map +1 -1
- package/src/license/dependency-check/types.js +2 -3
- package/src/license/dependency-check/types.js.map +1 -1
- package/src/license/generator.js +55 -60
- package/src/license/generator.js.map +1 -1
- package/src/license/index.js +3 -9
- package/src/license/index.js.map +1 -1
- package/src/license/known-exceptions.js +14 -13
- package/src/license/known-exceptions.js.map +1 -1
- package/src/license/schema.d.js +6 -0
- package/src/license/schema.d.js.map +1 -0
- package/src/license/sync/generator.js +94 -119
- package/src/license/sync/generator.js.map +1 -1
- package/src/license/sync/project-file-sync.js +28 -35
- package/src/license/sync/project-file-sync.js.map +1 -1
- package/src/mcp-server/generator-info.js +130 -160
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/guide-pipeline.js +184 -206
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/guide-render.js +10 -25
- package/src/mcp-server/guide-render.js.map +1 -1
- package/src/mcp-server/index.js +6 -10
- package/src/mcp-server/index.js.map +1 -1
- package/src/mcp-server/mdx-ast.js +39 -57
- package/src/mcp-server/mdx-ast.js.map +1 -1
- package/src/mcp-server/option-filter.js +33 -47
- package/src/mcp-server/option-filter.js.map +1 -1
- package/src/mcp-server/schema-registry.js +27 -40
- package/src/mcp-server/schema-registry.js.map +1 -1
- package/src/mcp-server/schema.js +9 -7
- package/src/mcp-server/schema.js.map +1 -1
- package/src/mcp-server/server.js +20 -24
- package/src/mcp-server/server.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.js +23 -24
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/general-guidance.js +28 -25
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.js +29 -37
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/mcp-server/tools/list-generators.js +19 -25
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/open-api/ts-client/generator.js +16 -26
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-client/schema.d.js +6 -0
- package/src/open-api/ts-client/schema.d.js.map +1 -0
- package/src/open-api/ts-hooks/generator.js +13 -21
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/ts-hooks/schema.d.js +6 -0
- package/src/open-api/ts-hooks/schema.d.js.map +1 -0
- package/src/open-api/ts-metadata/generator.js +12 -20
- package/src/open-api/ts-metadata/generator.js.map +1 -1
- package/src/open-api/ts-metadata/schema.d.js +6 -0
- package/src/open-api/ts-metadata/schema.d.js.map +1 -0
- package/src/open-api/utils/codegen-data/languages.js +42 -60
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data/types.js +31 -30
- package/src/open-api/utils/codegen-data/types.js.map +1 -1
- package/src/open-api/utils/codegen-data.js +253 -269
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.js +242 -241
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parse.js +8 -14
- package/src/open-api/utils/parse.js.map +1 -1
- package/src/open-api/utils/refs.js +12 -22
- package/src/open-api/utils/refs.js.map +1 -1
- package/src/open-api/utils/types.js +5 -2
- package/src/open-api/utils/types.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +31 -6
- package/src/preset/generator.d.ts +1 -1
- package/src/preset/generator.js +130 -112
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.js +6 -0
- package/src/preset/schema.d.js.map +1 -0
- package/src/preset/schema.d.ts +0 -1
- package/src/preset/schema.json +0 -5
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +304 -0
- package/src/py/agent/__snapshots__/{generator.spec.ts.snap → generator.frameworks.spec.ts.snap} +18 -845
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +535 -0
- package/src/py/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +1 -2
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client_strands.py.template +1 -1
- package/src/py/agent/a2a-connection/files/langchain/agent-connection/app/__targetAgentSnakeCase___client_langchain.py.template +1 -1
- package/src/py/agent/a2a-connection/generator.js +70 -75
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/a2a-connection/schema.d.js +8 -0
- package/src/py/agent/a2a-connection/schema.d.js.map +1 -0
- package/src/py/agent/files/ag-ui-langchain/main.py.template +10 -0
- package/src/py/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +6 -8
- package/src/py/agent/gateway-connection/files/agent-connection/app/__gatewaySnakeCase___client_strands.py.template +3 -3
- package/src/py/agent/gateway-connection/files/langchain/agent-connection/app/__gatewaySnakeCase___client_langchain.py.template +3 -3
- package/src/py/agent/gateway-connection/generator.js +61 -58
- package/src/py/agent/gateway-connection/generator.js.map +1 -1
- package/src/py/agent/gateway-connection/schema.d.js +6 -0
- package/src/py/agent/gateway-connection/schema.d.js.map +1 -0
- package/src/py/agent/generator.js +227 -194
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +5 -12
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client_strands.py.template +1 -1
- package/src/py/agent/mcp-connection/files/langchain/agent-connection/app/__mcpServerSnakeCase___client_langchain.py.template +1 -1
- package/src/py/agent/mcp-connection/generator.js +53 -52
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/schema.d.js +8 -0
- package/src/py/agent/mcp-connection/schema.d.js.map +1 -0
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +3 -2
- package/src/py/agent/react-connection/generator.js +51 -58
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/{serve-local.d.ts → local-dev.d.ts} +4 -4
- package/src/py/agent/react-connection/local-dev.js +36 -0
- package/src/py/agent/react-connection/local-dev.js.map +1 -0
- package/src/py/agent/react-connection/schema.d.js +8 -0
- package/src/py/agent/react-connection/schema.d.js.map +1 -0
- package/src/py/agent/schema.d.js +6 -0
- package/src/py/agent/schema.d.js.map +1 -0
- package/src/py/api/generator.js +12 -12
- package/src/py/api/generator.js.map +1 -1
- package/src/py/api/schema.d.js +6 -0
- package/src/py/api/schema.d.js.map +1 -0
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +68 -28
- package/src/py/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/dynamodb/agent-connection/generator.js +27 -29
- package/src/py/dynamodb/agent-connection/generator.js.map +1 -1
- package/src/py/dynamodb/agent-connection/schema.d.js +8 -0
- package/src/py/dynamodb/agent-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/fast-api-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/dynamodb/fast-api-connection/generator.js +26 -28
- package/src/py/dynamodb/fast-api-connection/generator.js.map +1 -1
- package/src/py/dynamodb/fast-api-connection/schema.d.js +8 -0
- package/src/py/dynamodb/fast-api-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/files/__name__/client.py.template +5 -5
- package/src/py/dynamodb/files/__name__/entities/base.py.template +2 -2
- package/src/py/dynamodb/files/config.json.template +1 -1
- package/src/py/dynamodb/generator.js +63 -62
- package/src/py/dynamodb/generator.js.map +1 -1
- package/src/py/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/dynamodb/mcp-server-connection/generator.js +27 -29
- package/src/py/dynamodb/mcp-server-connection/generator.js.map +1 -1
- package/src/py/dynamodb/mcp-server-connection/schema.d.js +8 -0
- package/src/py/dynamodb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/schema.d.js +6 -0
- package/src/py/dynamodb/schema.d.js.map +1 -0
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +45 -4632
- package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +4833 -0
- package/src/py/fast-api/generator.js +79 -85
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/__snapshots__/generator.spec.ts.snap +3 -2
- package/src/py/fast-api/react/generator.js +22 -24
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/open-api.js +28 -29
- package/src/py/fast-api/react/open-api.js.map +1 -1
- package/src/py/fast-api/react/schema.d.js +6 -0
- package/src/py/fast-api/react/schema.d.js.map +1 -0
- package/src/py/fast-api/schema.d.js +6 -0
- package/src/py/fast-api/schema.d.js.map +1 -0
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/py/lambda-function/generator.js +57 -58
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.js +6 -0
- package/src/py/lambda-function/schema.d.js.map +1 -0
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/mcp-server/generator.js +149 -131
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/mcp-server/schema.d.js +6 -0
- package/src/py/mcp-server/schema.d.js.map +1 -0
- package/src/py/project/generator.d.ts +14 -1
- package/src/py/project/generator.js +137 -88
- package/src/py/project/generator.js.map +1 -1
- package/src/py/project/schema.d.js +6 -0
- package/src/py/project/schema.d.js.map +1 -0
- package/src/sdk/agentcore-gateway.d.ts +6 -0
- package/src/sdk/agentcore-gateway.js +7 -0
- package/src/sdk/agentcore-gateway.js.map +1 -0
- package/src/sdk/connection.d.ts +6 -0
- package/src/sdk/connection.js +6 -0
- package/src/sdk/connection.js.map +1 -0
- package/{sdk → src/sdk}/license.d.ts +4 -4
- package/src/sdk/license.js +7 -0
- package/src/sdk/license.js.map +1 -0
- package/src/sdk/open-api.d.ts +10 -0
- package/src/sdk/open-api.js +8 -0
- package/src/sdk/open-api.js.map +1 -0
- package/src/sdk/py.d.ts +14 -0
- package/src/sdk/py.js +10 -0
- package/src/sdk/py.js.map +1 -0
- package/src/sdk/terraform.d.ts +6 -0
- package/src/sdk/terraform.js +7 -0
- package/src/sdk/terraform.js.map +1 -0
- package/src/sdk/ts.d.ts +33 -0
- package/src/sdk/ts.js +35 -0
- package/src/sdk/ts.js.map +1 -0
- package/{sdk → src/sdk}/utils/ast.d.ts +2 -2
- package/src/sdk/utils/ast.js +7 -0
- package/src/sdk/utils/ast.js.map +1 -0
- package/{sdk → src/sdk}/utils/format.d.ts +1 -1
- package/src/sdk/utils/format.js +6 -0
- package/src/sdk/utils/format.js.map +1 -0
- package/{sdk → src/sdk}/utils/test.d.ts +1 -1
- package/src/sdk/utils/test.js +6 -0
- package/src/sdk/utils/test.js.map +1 -0
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +2 -8
- package/src/smithy/project/files/build.Dockerfile.template +1 -4
- package/src/smithy/project/generator.js +44 -42
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/project/schema.d.js +6 -0
- package/src/smithy/project/schema.d.js.map +1 -0
- package/src/smithy/react-connection/generator.js +35 -46
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/react-connection/schema.d.js +6 -0
- package/src/smithy/react-connection/schema.d.js.map +1 -0
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +395 -72
- package/src/smithy/ts/api/generator.js +121 -111
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/smithy/ts/api/schema.d.js +6 -0
- package/src/smithy/ts/api/schema.d.js.map +1 -0
- package/src/terraform/project/files/application/src/providers.tf.template +1 -1
- package/src/terraform/project/generator.js +141 -103
- package/src/terraform/project/generator.js.map +1 -1
- package/src/terraform/project/schema.d.js +9 -0
- package/src/terraform/project/schema.d.js.map +1 -0
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +336 -92
- package/src/trpc/backend/generator.js +93 -86
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.js +6 -0
- package/src/trpc/backend/schema.d.js.map +1 -0
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/trpc/react/generator.js +59 -58
- package/src/trpc/react/generator.js.map +1 -1
- package/src/trpc/react/schema.d.js +6 -0
- package/src/trpc/react/schema.d.js.map +1 -0
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +11 -11
- package/src/ts/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client-strands.ts.template +1 -1
- package/src/ts/agent/a2a-connection/generator.js +58 -54
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/a2a-connection/schema.d.js +8 -0
- package/src/ts/agent/a2a-connection/schema.d.js.map +1 -0
- package/src/ts/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/agent/gateway-connection/files/agent-connection/app/__gatewayKebabCase__-client-strands.ts.template +3 -3
- package/src/ts/agent/gateway-connection/generator.js +57 -52
- package/src/ts/agent/gateway-connection/generator.js.map +1 -1
- package/src/ts/agent/gateway-connection/schema.d.js +6 -0
- package/src/ts/agent/gateway-connection/schema.d.js.map +1 -0
- package/src/ts/agent/generator.js +165 -136
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +1 -1
- package/src/ts/agent/mcp-connection/generator.js +48 -46
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/schema.d.js +8 -0
- package/src/ts/agent/mcp-connection/schema.d.js.map +1 -0
- package/src/ts/agent/react-connection/generator.js +79 -79
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/{serve-local.d.ts → local-dev.d.ts} +2 -2
- package/src/ts/agent/react-connection/local-dev.js +17 -0
- package/src/ts/agent/react-connection/local-dev.js.map +1 -0
- package/src/ts/agent/react-connection/schema.d.js +8 -0
- package/src/ts/agent/react-connection/schema.d.js.map +1 -0
- package/src/ts/agent/schema.d.js +6 -0
- package/src/ts/agent/schema.d.js.map +1 -0
- package/src/ts/api/generator.js +16 -18
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.js +6 -0
- package/src/ts/api/schema.d.js.map +1 -0
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +8 -8
- package/src/ts/astro-docs/generator.js +59 -48
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/astro-docs/schema.d.js +6 -0
- package/src/ts/astro-docs/schema.d.js.map +1 -0
- package/src/ts/docs/generator.js +10 -10
- package/src/ts/docs/generator.js.map +1 -1
- package/src/ts/docs/schema.d.js +6 -0
- package/src/ts/docs/schema.d.js.map +1 -0
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +68 -30
- package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/dynamodb/agent-connection/generator.js +21 -23
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/agent-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/agent-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/files/config.json.template +1 -1
- package/src/ts/dynamodb/files/src/client.ts.template +7 -7
- package/src/ts/dynamodb/generator.js +64 -63
- package/src/ts/dynamodb/generator.js.map +1 -1
- package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/dynamodb/mcp-server-connection/generator.js +21 -23
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/mcp-server-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/schema.d.js +6 -0
- package/src/ts/dynamodb/schema.d.js.map +1 -0
- package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/dynamodb/smithy-connection/generator.js +20 -22
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/smithy-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/dynamodb/trpc-connection/generator.js +20 -22
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/trpc-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.js.map +1 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/lambda-function/generator.js +55 -55
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/io.js +83 -52
- package/src/ts/lambda-function/io.js.map +1 -1
- package/src/ts/lambda-function/schema.d.js +6 -0
- package/src/ts/lambda-function/schema.d.js.map +1 -0
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +23 -36
- package/src/ts/lib/biome.js +37 -37
- package/src/ts/lib/biome.js.map +1 -1
- package/src/ts/lib/generator.js +75 -77
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/schema.d.js +6 -0
- package/src/ts/lib/schema.d.js.map +1 -0
- package/src/ts/lib/ts-project-utils.js +65 -70
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/types.js +5 -2
- package/src/ts/lib/types.js.map +1 -1
- package/src/ts/lib/vitest.js +29 -26
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/mcp-server/generator.js +157 -138
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/mcp-server/schema.d.js +6 -0
- package/src/ts/mcp-server/schema.d.js.map +1 -0
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +14 -9
- package/src/ts/nx-generator/files/local/generator.ts.template +3 -3
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +4 -4
- package/src/ts/nx-generator/generator.js +84 -83
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-generator/schema.d.js +6 -0
- package/src/ts/nx-generator/schema.d.js.map +1 -0
- package/src/ts/nx-plugin/__snapshots__/generator.spec.ts.snap +30 -18
- package/src/ts/nx-plugin/files/mcp-server/server.ts.template +5 -5
- package/src/ts/nx-plugin/files/mcp-server/tools/create-workspace-command.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/general-guidance.ts.template +1 -1
- package/src/ts/nx-plugin/files/mcp-server/tools/generator-guide.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/list-generators.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/utils.ts.template +3 -3
- package/src/ts/nx-plugin/generator.js +49 -48
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/schema.d.js +9 -0
- package/src/ts/nx-plugin/schema.d.js.map +1 -0
- package/src/ts/nx-plugin/utils.js +32 -44
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +34 -30
- package/src/ts/rdb/agent-connection/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/ts/rdb/agent-connection/generator.js +38 -39
- package/src/ts/rdb/agent-connection/generator.js.map +1 -1
- package/src/ts/rdb/agent-connection/schema.d.js +8 -0
- package/src/ts/rdb/agent-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/files/config.json.template +1 -1
- package/src/ts/rdb/files/prisma.config.ts.template +2 -2
- package/src/ts/rdb/files/src/prisma.ts.template +7 -7
- package/src/ts/rdb/files/src/utils.ts.template +3 -0
- package/src/ts/rdb/generator.js +130 -117
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/ts/rdb/mcp-server-connection/generator.js +36 -37
- package/src/ts/rdb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/schema.d.js +8 -0
- package/src/ts/rdb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/schema.d.js +6 -0
- package/src/ts/rdb/schema.d.js.map +1 -0
- package/src/ts/rdb/smithy-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/rdb/smithy-connection/generator.js +46 -43
- package/src/ts/rdb/smithy-connection/generator.js.map +1 -1
- package/src/ts/rdb/smithy-connection/schema.d.js +8 -0
- package/src/ts/rdb/smithy-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/trpc-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/rdb/trpc-connection/generator.js +36 -31
- package/src/ts/rdb/trpc-connection/generator.js.map +1 -1
- package/src/ts/rdb/trpc-connection/schema.d.js +8 -0
- package/src/ts/rdb/trpc-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/utils.js +9 -11
- package/src/ts/rdb/utils.js.map +1 -1
- package/src/ts/react-website/agui/generator.js +69 -61
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +179 -332
- package/src/ts/react-website/app/generator.js +197 -188
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.js +6 -0
- package/src/ts/react-website/app/schema.d.js.map +1 -0
- package/src/ts/react-website/app/schema.json +6 -6
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +118 -4
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +27 -7
- package/src/ts/react-website/cognito-auth/files/app/components/CognitoAuth/index.tsx.template +2 -2
- package/src/ts/react-website/cognito-auth/generator.js +60 -60
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/schema.d.js +6 -0
- package/src/ts/react-website/cognito-auth/schema.d.js.map +1 -0
- package/src/ts/react-website/cognito-auth/utils.js +34 -32
- package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
- package/src/ts/react-website/runtime-config/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/react-website/runtime-config/files/app/components/RuntimeConfig/index.tsx.template +2 -2
- package/src/ts/react-website/runtime-config/generator.js +29 -31
- package/src/ts/react-website/runtime-config/generator.js.map +1 -1
- package/src/ts/react-website/runtime-config/schema.d.js +6 -0
- package/src/ts/react-website/runtime-config/schema.d.js.map +1 -0
- package/src/ts/sync/generator.js +60 -59
- package/src/ts/sync/generator.js.map +1 -1
- package/src/ts/website/app/generator.js +10 -10
- package/src/ts/website/app/generator.js.map +1 -1
- package/src/ts/website/app/schema.d.js +6 -0
- package/src/ts/website/app/schema.d.js.map +1 -0
- package/src/ts/website/app/schema.json +6 -6
- package/src/ts/website/auth/generator.js +11 -11
- package/src/ts/website/auth/generator.js.map +1 -1
- package/src/ts/website/auth/schema.d.js +6 -0
- package/src/ts/website/auth/schema.d.js.map +1 -0
- package/src/utils/agent-chat/agent-chat.d.ts +1 -1
- package/src/utils/agent-chat/agent-chat.js +11 -12
- package/src/utils/agent-chat/agent-chat.js.map +1 -1
- package/src/utils/agent-chat/files/a2a/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/ag-ui/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/http-py/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/http-ts/chat.ts.template +1 -1
- package/src/utils/agent-connection/agent-connection.d.ts +9 -3
- package/src/utils/agent-connection/agent-connection.js +133 -147
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/gateway/agentcore-gateway-mcp-client-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/py-core-gateway/agentcore_gateway_mcp_transport.py.template +1 -1
- package/src/utils/agent-connection/files/py-core-langchain/gateway/agentcore_gateway_mcp_client_langchain.py.template +1 -1
- package/src/utils/agent-connection/files/py-core-strands/gateway/agentcore_gateway_mcp_client_strands.py.template +1 -1
- package/src/utils/agent-core-constructs/agent-core-constructs.js +53 -50
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +5 -5
- package/src/utils/agent-core-constructs/files/terraform/core/agentcore-gateway/gateway.tf.template +2 -2
- package/src/utils/api-constructs/api-constructs.js +30 -31
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +14 -6
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account/index.js.template +58 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account.ts.template +82 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +28 -14
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +1 -8
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +91 -4
- package/src/utils/api-constructs/files/terraform/core/api/http/http-api/http-api.tf.template +1 -1
- package/src/utils/api-constructs/files/terraform/core/api/rest/api-gateway-account/api-gateway-account.tf.template +83 -0
- package/src/utils/api-constructs/files/terraform/core/api/rest/rest-api/rest-api.tf.template +5 -11
- package/src/utils/api-constructs/open-api-metadata.js +22 -22
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
- package/src/utils/ast/website.js +17 -19
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.js +72 -97
- package/src/utils/ast.js.map +1 -1
- package/src/utils/bundle/bundle.js +50 -47
- package/src/utils/bundle/bundle.js.map +1 -1
- package/src/utils/commands.js +47 -26
- package/src/utils/commands.js.map +1 -1
- package/src/utils/config/index.d.ts +2 -2
- package/src/utils/config/index.js +5 -4
- package/src/utils/config/index.js.map +1 -1
- package/src/utils/config/utils.js +48 -58
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/connection/open-api/react.d.ts +5 -5
- package/src/utils/connection/open-api/react.js +81 -77
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/containers.js +22 -23
- package/src/utils/containers.js.map +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +32 -33
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -1
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +12 -2
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +1 -1
- package/src/utils/files/common/scripts/src/dynamodb/create-local-table.ts.template +2 -2
- package/src/utils/files/common/scripts/src/dynamodb/pull-image.ts.template +1 -1
- package/src/utils/files/common/scripts/src/dynamodb/start-container.ts.template +17 -2
- package/src/utils/files/common/scripts/src/rdb/mysql/wait-for-mysql-db.ts.template +32 -0
- package/src/utils/files/common/scripts/src/rdb/postgres/wait-for-postgres-db.ts.template +32 -0
- package/src/utils/files/common/scripts/src/rdb/{pull-image.ts.template → shared/pull-image.ts.template} +1 -1
- package/src/utils/files/common/scripts/src/rdb/{start-container.ts.template → shared/start-container.ts.template} +16 -1
- package/src/utils/files/terraform/src/core/asset-bucket/asset-bucket.tf.template +2 -2
- package/src/utils/files/terraform/src/core/runtime-config/appconfig/appconfig.tf.template +1 -1
- package/src/utils/files/terraform/src/core/runtime-config/appconfig-deployment/appconfig-deployment.tf.template +3 -3
- package/src/utils/files/terraform/src/core/runtime-config/entry/entry.tf.template +1 -1
- package/src/utils/files/terraform/src/core/runtime-config/read/read.tf.template +2 -2
- package/src/utils/files/website/hooks/sigv4/useSigV4.tsx.template +1 -1
- package/src/utils/format.js +153 -99
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.js +14 -13
- package/src/utils/fs.js.map +1 -1
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/__nameKebabCase__/__nameKebabCase__.tf.template +2 -2
- package/src/utils/function-constructs/function-constructs.js +21 -26
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.js +18 -20
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.js +19 -34
- package/src/utils/git.js.map +1 -1
- package/src/utils/iac-providers.js +5 -5
- package/src/utils/iac-providers.js.map +1 -1
- package/src/utils/iac.js +12 -14
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +112 -2
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +19 -6
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +104 -2
- package/src/utils/identity-constructs/files/terraform/core/user-identity/main.tf.template +7 -0
- package/src/utils/identity-constructs/identity-constructs.js +24 -28
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/js.js +27 -20
- package/src/utils/js.js.map +1 -1
- package/src/utils/mcp.js +34 -41
- package/src/utils/mcp.js.map +1 -1
- package/src/utils/metrics.js +30 -45
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/mock-project-graph.js +8 -12
- package/src/utils/mock-project-graph.js.map +1 -1
- package/src/utils/names.d.ts +16 -0
- package/src/utils/names.js +39 -48
- package/src/utils/names.js.map +1 -1
- package/src/utils/npm-scope.js +9 -17
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +18 -2
- package/src/utils/nx.js +111 -74
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.js +27 -15
- package/src/utils/nxlv-python.js.map +1 -1
- package/src/utils/object.js +5 -11
- package/src/utils/object.js.map +1 -1
- package/src/utils/paths.js +11 -15
- package/src/utils/paths.js.map +1 -1
- package/src/utils/pkg-manager.js +4 -9
- package/src/utils/pkg-manager.js.map +1 -1
- package/src/utils/pnpm-workspace.js +22 -22
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.js +26 -36
- package/src/utils/port.js.map +1 -1
- package/src/utils/py.d.ts +14 -1
- package/src/utils/py.js +63 -45
- package/src/utils/py.js.map +1 -1
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +3 -3
- package/src/utils/rdb-constructs/rdb-constructs.js +31 -33
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs-constants.js +16 -16
- package/src/utils/shared-constructs-constants.js.map +1 -1
- package/src/utils/shared-constructs.js +57 -54
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-dynamodb-scripts.js +16 -14
- package/src/utils/shared-dynamodb-scripts.js.map +1 -1
- package/src/utils/shared-infra-config.js +30 -31
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-infra-scripts.js +30 -25
- package/src/utils/shared-infra-scripts.js.map +1 -1
- package/src/utils/shared-rdb-scripts.d.ts +8 -3
- package/src/utils/shared-rdb-scripts.js +21 -13
- package/src/utils/shared-rdb-scripts.js.map +1 -1
- package/src/utils/shared-scripts.js +12 -17
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.js +64 -60
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +8 -0
- package/src/utils/test.js +33 -25
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.js +7 -15
- package/src/utils/toml.js.map +1 -1
- package/src/utils/versions.d.ts +31 -4
- package/src/utils/versions.js +40 -23
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/terraform/app/static-websites/__websiteNameKebabCase__/__websiteNameKebabCase__.tf.template +1 -1
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +4 -4
- package/src/utils/website-constructs/website-constructs.js +31 -30
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- package/bin/aws-nx-mcp.js +0 -17
- package/bin/aws-nx-mcp.js.map +0 -1
- package/sdk/agentcore-gateway.d.ts +0 -6
- package/sdk/agentcore-gateway.js +0 -11
- package/sdk/agentcore-gateway.js.map +0 -1
- package/sdk/connection.d.ts +0 -6
- package/sdk/connection.js +0 -10
- package/sdk/connection.js.map +0 -1
- package/sdk/license.js +0 -14
- package/sdk/license.js.map +0 -1
- package/sdk/open-api.d.ts +0 -10
- package/sdk/open-api.js +0 -15
- package/sdk/open-api.js.map +0 -1
- package/sdk/py.d.ts +0 -14
- package/sdk/py.js +0 -18
- package/sdk/py.js.map +0 -1
- package/sdk/terraform.d.ts +0 -6
- package/sdk/terraform.js +0 -11
- package/sdk/terraform.js.map +0 -1
- package/sdk/ts.d.ts +0 -33
- package/sdk/ts.js +0 -53
- package/sdk/ts.js.map +0 -1
- package/sdk/utils/ast.js +0 -12
- package/sdk/utils/ast.js.map +0 -1
- package/sdk/utils/format.js +0 -10
- package/sdk/utils/format.js.map +0 -1
- package/sdk/utils/test.js +0 -10
- package/sdk/utils/test.js.map +0 -1
- package/src/connection/agent-serve-local.js +0 -48
- package/src/connection/agent-serve-local.js.map +0 -1
- package/src/connection/serve-local.js +0 -41
- package/src/connection/serve-local.js.map +0 -1
- package/src/py/agent/react-connection/serve-local.js +0 -38
- package/src/py/agent/react-connection/serve-local.js.map +0 -1
- package/src/ts/agent/react-connection/serve-local.js +0 -19
- package/src/ts/agent/react-connection/serve-local.js.map +0 -1
- package/src/utils/files/common/scripts/src/rdb/wait-for-db.ts.template +0 -59
- /package/src/agentcore-gateway/files/project/{serve-local.ts.template → local-dev.ts.template} +0 -0
- /package/{bin → src/bin}/aws-nx-mcp.d.ts +0 -0
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REACT_WEBSITE_APP_GENERATOR_INFO = exports.SUPPORTED_UX_PROVIDERS = void 0;
|
|
4
|
-
exports.tsReactWebsiteGenerator = tsReactWebsiteGenerator;
|
|
5
1
|
/**
|
|
6
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
4
|
+
*/ import { addDependenciesToPackageJson, generateFiles, installPackagesTask, joinPathFragments, names, OverwriteStrategy, readProjectConfiguration, updateJson, updateProjectConfiguration } from "@nx/devkit";
|
|
5
|
+
import { applicationGenerator } from "@nx/react";
|
|
6
|
+
import { relative, sep } from "path";
|
|
7
|
+
import { addDestructuredImport, addSingleImport, applyGritQL } from "../../../utils/ast.js";
|
|
8
|
+
import { formatFilesInSubtree } from "../../../utils/format.js";
|
|
9
|
+
import { resolveIac } from "../../../utils/iac.js";
|
|
10
|
+
import { addGeneratorMetricsIfApplicable } from "../../../utils/metrics.js";
|
|
11
|
+
import { kebabCase, toClassName, toKebabCase } from "../../../utils/names.js";
|
|
12
|
+
import { getNpmScopePrefix, toScopeAlias } from "../../../utils/npm-scope.js";
|
|
13
|
+
import { addGeneratorMetadata, getGeneratorInfo } from "../../../utils/nx.js";
|
|
14
|
+
import { sortObjectKeys } from "../../../utils/object.js";
|
|
15
|
+
import { getRelativePathToRoot } from "../../../utils/paths.js";
|
|
16
|
+
import { getPackageManagerDisplayCommands } from "../../../utils/pkg-manager.js";
|
|
17
|
+
import { sharedConstructsGenerator } from "../../../utils/shared-constructs.js";
|
|
18
|
+
import { PACKAGES_DIR, SHARED_SHADCN_DIR } from "../../../utils/shared-constructs-constants.js";
|
|
19
|
+
import { sharedShadcnGenerator } from "../../../utils/shared-shadcn.js";
|
|
20
|
+
import { withVersions } from "../../../utils/versions.js";
|
|
21
|
+
import { addWebsiteInfra } from "../../../utils/website-constructs/website-constructs.js";
|
|
22
|
+
import { configureTsProject } from "../../lib/ts-project-utils.js";
|
|
23
|
+
export const SUPPORTED_UX_PROVIDERS = [
|
|
24
|
+
'none',
|
|
25
|
+
'cloudscape',
|
|
26
|
+
'shadcn'
|
|
27
|
+
];
|
|
28
|
+
export const REACT_WEBSITE_APP_GENERATOR_INFO = getGeneratorInfo(import.meta.filename);
|
|
29
|
+
export async function tsReactWebsiteGenerator(tree, schema) {
|
|
31
30
|
const tailwind = schema.tailwind ?? true;
|
|
32
31
|
const tanstackRouter = schema.tanstackRouter ?? true;
|
|
33
|
-
const ux = schema.ux ?? '
|
|
32
|
+
const ux = schema.ux ?? 'shadcn';
|
|
34
33
|
if (ux === 'shadcn' && !tailwind) {
|
|
35
34
|
throw new Error('Shadcn requires TailwindCSS to be enabled.');
|
|
36
35
|
}
|
|
37
|
-
const npmScopePrefix =
|
|
38
|
-
const scopeAlias =
|
|
39
|
-
const websiteNameClassName =
|
|
40
|
-
const websiteNameKebabCase =
|
|
36
|
+
const npmScopePrefix = getNpmScopePrefix(tree);
|
|
37
|
+
const scopeAlias = toScopeAlias(npmScopePrefix);
|
|
38
|
+
const websiteNameClassName = toClassName(schema.name);
|
|
39
|
+
const websiteNameKebabCase = toKebabCase(schema.name);
|
|
41
40
|
const fullyQualifiedName = `${npmScopePrefix}${websiteNameKebabCase}`;
|
|
42
41
|
// NB: interactive nx generator cli can pass empty string
|
|
43
|
-
const websiteContentPath =
|
|
44
|
-
const projectAlreadyExists = tree.exists(
|
|
42
|
+
const websiteContentPath = joinPathFragments(schema.directory || '.', schema.subDirectory || websiteNameKebabCase);
|
|
43
|
+
const projectAlreadyExists = tree.exists(joinPathFragments(websiteContentPath, 'project.json'));
|
|
45
44
|
// TODO: consider exposing and supporting e2e tests
|
|
46
45
|
const e2eTestRunner = 'none';
|
|
47
46
|
if (!projectAlreadyExists) {
|
|
48
|
-
await
|
|
47
|
+
await applicationGenerator(tree, {
|
|
49
48
|
...schema,
|
|
50
49
|
name: fullyQualifiedName,
|
|
51
50
|
directory: websiteContentPath,
|
|
@@ -56,242 +55,258 @@ async function tsReactWebsiteGenerator(tree, schema) {
|
|
|
56
55
|
unitTestRunner: 'vitest',
|
|
57
56
|
useProjectJson: true,
|
|
58
57
|
style: 'css',
|
|
58
|
+
// Register the @nx/vite and @nx/vitest plugins so build/serve/test
|
|
59
|
+
// targets are inferred rather than emitting deprecated executor targets.
|
|
60
|
+
addPlugin: true
|
|
61
|
+
});
|
|
62
|
+
// Pin the inferred target names. The vite production build is exposed as
|
|
63
|
+
// `bundle` (which produces the deployable artifact), leaving `build` as an
|
|
64
|
+
// aggregator over lint/compile/test/bundle. vite's own typecheck is dropped
|
|
65
|
+
// in favour of the tsc `compile`.
|
|
66
|
+
updateJson(tree, 'nx.json', (nxJson)=>{
|
|
67
|
+
for (const plugin of nxJson.plugins ?? []){
|
|
68
|
+
if (typeof plugin === 'string') continue;
|
|
69
|
+
if (plugin.plugin === '@nx/vite/plugin') {
|
|
70
|
+
plugin.options = {
|
|
71
|
+
...plugin.options,
|
|
72
|
+
buildTargetName: 'bundle',
|
|
73
|
+
// Map both of vite's inferred dev-server targets onto `serve` so the
|
|
74
|
+
// plugin doesn't emit a separate `dev`; we author our own `dev`
|
|
75
|
+
// below running the local-dev vite mode.
|
|
76
|
+
serveTargetName: 'serve',
|
|
77
|
+
devTargetName: 'serve',
|
|
78
|
+
previewTargetName: 'preview',
|
|
79
|
+
serveStaticTargetName: 'serve-static',
|
|
80
|
+
typecheckTargetName: 'vite:typecheck'
|
|
81
|
+
};
|
|
82
|
+
} else if (plugin.plugin === '@nx/vitest') {
|
|
83
|
+
plugin.options = {
|
|
84
|
+
...plugin.options,
|
|
85
|
+
testTargetName: 'test'
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return nxJson;
|
|
59
90
|
});
|
|
60
91
|
// Replace with simpler sample source code
|
|
61
|
-
tree.delete(
|
|
92
|
+
tree.delete(joinPathFragments(websiteContentPath, 'src'));
|
|
62
93
|
}
|
|
63
|
-
const projectConfiguration =
|
|
94
|
+
const projectConfiguration = readProjectConfiguration(tree, fullyQualifiedName);
|
|
64
95
|
const targets = projectConfiguration.targets;
|
|
65
96
|
const infra = schema.infra ?? 'cloudfront-s3';
|
|
66
97
|
// Configure load:runtime-config target based on IaC provider (only when infra is not none)
|
|
67
|
-
const iac = infra !== 'none' ? await
|
|
98
|
+
const iac = infra !== 'none' ? await resolveIac(tree, schema.iac) : undefined;
|
|
68
99
|
if (iac === 'cdk') {
|
|
69
100
|
targets['load:runtime-config'] = {
|
|
70
101
|
executor: 'nx:run-commands',
|
|
71
102
|
metadata: {
|
|
72
|
-
description: `Load runtime config from your deployed stack for dev purposes. You must set your AWS CLI credentials whilst calling '${
|
|
103
|
+
description: `Load runtime config from your deployed stack for dev purposes. You must set your AWS CLI credentials whilst calling '${getPackageManagerDisplayCommands().exec} nx run ${fullyQualifiedName}:load:runtime-config'`
|
|
73
104
|
},
|
|
74
105
|
options: {
|
|
75
|
-
command: `aws s3 cp s3://\`aws cloudformation describe-stacks --query "Stacks[?starts_with(StackName, '${
|
|
76
|
-
}
|
|
106
|
+
command: `aws s3 cp s3://\`aws cloudformation describe-stacks --query "Stacks[?starts_with(StackName, '${kebabCase(npmScopePrefix)}-')][].Outputs[] | [?contains(OutputKey, '${websiteNameClassName}WebsiteBucketName')].OutputValue" --output text\`/runtime-config.json "{projectRoot}/public/runtime-config.json"`
|
|
107
|
+
}
|
|
77
108
|
};
|
|
78
|
-
}
|
|
79
|
-
else if (iac === 'terraform') {
|
|
109
|
+
} else if (iac === 'terraform') {
|
|
80
110
|
targets['load:runtime-config'] = {
|
|
81
111
|
executor: 'nx:run-commands',
|
|
82
112
|
metadata: {
|
|
83
|
-
description: "Load runtime config from most recently applied terraform env for dev purposes. Copies the runtime config from the Terraform dist directory to the website's public directory."
|
|
113
|
+
description: "Load runtime config from most recently applied terraform env for dev purposes. Copies the runtime config from the Terraform dist directory to the website's public directory."
|
|
84
114
|
},
|
|
85
115
|
options: {
|
|
86
116
|
command: 'node -e "const fs=require(\'fs\');fs.mkdirSync(process.env.DEST_DIR,{recursive:true});fs.copyFileSync(process.env.SRC_FILE,process.env.DEST_FILE);"',
|
|
87
117
|
env: {
|
|
88
118
|
SRC_FILE: 'dist/packages/common/terraform/runtime-config.json',
|
|
89
119
|
DEST_DIR: `{projectRoot}/public`,
|
|
90
|
-
DEST_FILE: `{projectRoot}/public/runtime-config.json
|
|
91
|
-
}
|
|
92
|
-
}
|
|
120
|
+
DEST_FILE: `{projectRoot}/public/runtime-config.json`
|
|
121
|
+
}
|
|
122
|
+
}
|
|
93
123
|
};
|
|
94
124
|
}
|
|
95
125
|
if (!projectAlreadyExists) {
|
|
96
|
-
const buildTarget = targets['build'];
|
|
97
126
|
targets['compile'] = {
|
|
98
|
-
dependsOn: [
|
|
127
|
+
dependsOn: [
|
|
128
|
+
'^build'
|
|
129
|
+
],
|
|
99
130
|
executor: 'nx:run-commands',
|
|
100
|
-
outputs: [
|
|
131
|
+
outputs: [
|
|
132
|
+
'{workspaceRoot}/dist/{projectRoot}/tsc'
|
|
133
|
+
],
|
|
101
134
|
options: {
|
|
102
135
|
command: 'tsc --build tsconfig.app.json',
|
|
103
|
-
cwd: '{projectRoot}'
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
targets['bundle'] = {
|
|
107
|
-
...buildTarget,
|
|
108
|
-
options: {
|
|
109
|
-
...buildTarget.options,
|
|
110
|
-
outputPath: 'dist/{projectRoot}/bundle',
|
|
111
|
-
},
|
|
136
|
+
cwd: '{projectRoot}'
|
|
137
|
+
}
|
|
112
138
|
};
|
|
139
|
+
// bundle is the @nx/vite/plugin inferred `vite build` (writing to the
|
|
140
|
+
// bundle dir configured in vite.config) — it produces the deployable
|
|
141
|
+
// artifact. build aggregates lint/compile/test/bundle.
|
|
113
142
|
targets['build'] = {
|
|
114
143
|
dependsOn: [
|
|
115
144
|
'lint',
|
|
116
145
|
'compile',
|
|
117
|
-
'bundle',
|
|
118
146
|
'test',
|
|
119
|
-
|
|
120
|
-
]
|
|
121
|
-
options: {
|
|
122
|
-
outputPath: 'dist/{projectRoot}/bundle',
|
|
123
|
-
},
|
|
124
|
-
};
|
|
125
|
-
targets['test'] = {
|
|
126
|
-
...targets['test'],
|
|
127
|
-
options: {
|
|
128
|
-
...(targets['test']?.options ?? {}),
|
|
129
|
-
reportsDirectory: '{workspaceRoot}/coverage/{projectRoot}',
|
|
130
|
-
},
|
|
147
|
+
'bundle'
|
|
148
|
+
]
|
|
131
149
|
};
|
|
132
|
-
//
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
buildTarget: `${fullyQualifiedName}:build:development`,
|
|
137
|
-
hmr: true,
|
|
138
|
-
mode: 'serve-local',
|
|
139
|
-
},
|
|
150
|
+
// Run the website and its connected dependencies locally. Mirrors the
|
|
151
|
+
// inferred `serve` target but with the local-dev vite mode.
|
|
152
|
+
targets['dev'] = {
|
|
153
|
+
executor: 'nx:run-commands',
|
|
140
154
|
continuous: true,
|
|
155
|
+
options: {
|
|
156
|
+
command: 'vite --mode local-dev',
|
|
157
|
+
cwd: '{projectRoot}'
|
|
158
|
+
}
|
|
141
159
|
};
|
|
142
160
|
}
|
|
143
|
-
projectConfiguration.targets =
|
|
144
|
-
|
|
145
|
-
|
|
161
|
+
projectConfiguration.targets = sortObjectKeys(targets);
|
|
162
|
+
updateProjectConfiguration(tree, fullyQualifiedName, projectConfiguration);
|
|
163
|
+
addGeneratorMetadata(tree, projectConfiguration.name, REACT_WEBSITE_APP_GENERATOR_INFO, {
|
|
146
164
|
ux,
|
|
147
165
|
framework: 'react',
|
|
148
|
-
infra
|
|
166
|
+
infra
|
|
149
167
|
});
|
|
150
|
-
await
|
|
168
|
+
await configureTsProject(tree, {
|
|
151
169
|
dir: websiteContentPath,
|
|
152
|
-
fullyQualifiedName
|
|
170
|
+
fullyQualifiedName
|
|
153
171
|
});
|
|
154
172
|
if (ux === 'shadcn') {
|
|
155
|
-
await
|
|
173
|
+
await sharedShadcnGenerator(tree);
|
|
156
174
|
}
|
|
157
175
|
if (iac) {
|
|
158
|
-
await
|
|
159
|
-
iac
|
|
176
|
+
await sharedConstructsGenerator(tree, {
|
|
177
|
+
iac
|
|
160
178
|
});
|
|
161
|
-
await
|
|
179
|
+
await addWebsiteInfra(tree, {
|
|
162
180
|
iac,
|
|
163
181
|
websiteProjectName: fullyQualifiedName,
|
|
164
182
|
scopeAlias,
|
|
165
|
-
websiteContentPath:
|
|
183
|
+
websiteContentPath: joinPathFragments('dist', websiteContentPath),
|
|
166
184
|
websiteNameKebabCase,
|
|
167
|
-
websiteNameClassName
|
|
185
|
+
websiteNameClassName
|
|
168
186
|
});
|
|
169
187
|
}
|
|
170
|
-
const projectConfig =
|
|
188
|
+
const projectConfig = readProjectConfiguration(tree, fullyQualifiedName);
|
|
171
189
|
const libraryRoot = projectConfig.root;
|
|
172
|
-
const sharedShadcnStylesImport =
|
|
173
|
-
|
|
174
|
-
.join('/');
|
|
175
|
-
const sharedShadcnTsconfigRef = (0, path_1.relative)((0, devkit_1.joinPathFragments)(tree.root, websiteContentPath), (0, devkit_1.joinPathFragments)(tree.root, shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_SHADCN_DIR, 'tsconfig.json'))
|
|
176
|
-
.split(path_1.sep)
|
|
177
|
-
.join('/');
|
|
190
|
+
const sharedShadcnStylesImport = relative(joinPathFragments(libraryRoot, 'src'), joinPathFragments(PACKAGES_DIR, SHARED_SHADCN_DIR, 'src', 'styles', 'globals.css')).split(sep).join('/');
|
|
191
|
+
const sharedShadcnTsconfigRef = relative(joinPathFragments(tree.root, websiteContentPath), joinPathFragments(tree.root, PACKAGES_DIR, SHARED_SHADCN_DIR, 'tsconfig.json')).split(sep).join('/');
|
|
178
192
|
const templateOptions = {
|
|
179
193
|
...schema,
|
|
180
194
|
fullyQualifiedName,
|
|
181
|
-
pkgMgrCmd:
|
|
195
|
+
pkgMgrCmd: getPackageManagerDisplayCommands().exec,
|
|
182
196
|
tailwind,
|
|
183
197
|
tanstackRouter,
|
|
184
198
|
scopeAlias,
|
|
185
|
-
sharedShadcnStylesImport
|
|
199
|
+
sharedShadcnStylesImport
|
|
186
200
|
};
|
|
187
|
-
tree.delete(
|
|
188
|
-
const appCommonTemplatePath = (
|
|
189
|
-
const appTemplatePath = (
|
|
190
|
-
|
|
191
|
-
appCommonTemplatePath, // path to the file templates
|
|
192
|
-
libraryRoot, // destination path of the files
|
|
193
|
-
templateOptions, // config object to replace variable in file templates
|
|
194
|
-
{
|
|
201
|
+
tree.delete(joinPathFragments(libraryRoot, 'src', 'app'));
|
|
202
|
+
const appCommonTemplatePath = joinPathFragments(import.meta.dirname, './files/app/common');
|
|
203
|
+
const appTemplatePath = joinPathFragments(import.meta.dirname, `./files/app/${ux.toLowerCase()}`);
|
|
204
|
+
generateFiles(tree, appCommonTemplatePath, libraryRoot, templateOptions, {
|
|
195
205
|
// User-editable source - preserve any edits on re-run
|
|
196
|
-
overwriteStrategy:
|
|
206
|
+
overwriteStrategy: OverwriteStrategy.KeepExisting
|
|
197
207
|
});
|
|
198
|
-
|
|
199
|
-
appTemplatePath, // path to the file templates
|
|
200
|
-
libraryRoot, // destination path of the files
|
|
201
|
-
templateOptions, // config object to replace variable in file templates
|
|
202
|
-
{
|
|
208
|
+
generateFiles(tree, appTemplatePath, libraryRoot, templateOptions, {
|
|
203
209
|
// User-editable source - preserve any edits on re-run
|
|
204
|
-
overwriteStrategy:
|
|
210
|
+
overwriteStrategy: OverwriteStrategy.KeepExisting
|
|
205
211
|
});
|
|
206
212
|
if (tanstackRouter) {
|
|
207
|
-
const routerCommonTemplatePath = (
|
|
208
|
-
const routerTemplatePath = (
|
|
209
|
-
|
|
213
|
+
const routerCommonTemplatePath = joinPathFragments(import.meta.dirname, './files/tanstack-router/common');
|
|
214
|
+
const routerTemplatePath = joinPathFragments(import.meta.dirname, `./files/tanstack-router/${ux.toLowerCase()}`);
|
|
215
|
+
generateFiles(tree, routerCommonTemplatePath, libraryRoot, templateOptions, {
|
|
210
216
|
// User-editable source (and the TanStack-managed route tree) - preserve on re-run
|
|
211
|
-
overwriteStrategy:
|
|
217
|
+
overwriteStrategy: OverwriteStrategy.KeepExisting
|
|
212
218
|
});
|
|
213
|
-
|
|
214
|
-
{
|
|
219
|
+
generateFiles(tree, routerTemplatePath, libraryRoot, templateOptions, {
|
|
215
220
|
// User-editable source - preserve any edits on re-run
|
|
216
|
-
overwriteStrategy:
|
|
221
|
+
overwriteStrategy: OverwriteStrategy.KeepExisting
|
|
217
222
|
});
|
|
218
|
-
tree.delete(
|
|
223
|
+
tree.delete(joinPathFragments(websiteContentPath, 'src', 'app.tsx'));
|
|
219
224
|
}
|
|
220
225
|
if (e2eTestRunner !== 'none') {
|
|
221
226
|
const e2eFullyQualifiedName = `${fullyQualifiedName}-e2e`;
|
|
222
|
-
const e2eRoot =
|
|
223
|
-
(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
overwriteStrategy:
|
|
227
|
+
const e2eRoot = readProjectConfiguration(tree, e2eFullyQualifiedName).root;
|
|
228
|
+
generateFiles(tree, joinPathFragments(import.meta.dirname, `./files/e2e/${e2eTestRunner}`), e2eRoot, {
|
|
229
|
+
...schema,
|
|
230
|
+
...names(fullyQualifiedName)
|
|
231
|
+
}, {
|
|
232
|
+
overwriteStrategy: OverwriteStrategy.KeepExisting
|
|
228
233
|
});
|
|
229
|
-
await
|
|
234
|
+
await configureTsProject(tree, {
|
|
230
235
|
fullyQualifiedName: e2eFullyQualifiedName,
|
|
231
|
-
dir: e2eRoot
|
|
236
|
+
dir: e2eRoot
|
|
232
237
|
});
|
|
233
238
|
}
|
|
234
|
-
const viteConfigPath =
|
|
239
|
+
const viteConfigPath = joinPathFragments(libraryRoot, 'vite.config.mts');
|
|
235
240
|
if (tree.exists(viteConfigPath)) {
|
|
236
241
|
// Add Tanstack Router import if enabled
|
|
237
242
|
if (tanstackRouter) {
|
|
238
|
-
await
|
|
239
|
-
|
|
243
|
+
await addDestructuredImport(tree, viteConfigPath, [
|
|
244
|
+
'tanstackRouter'
|
|
245
|
+
], '@tanstack/router-plugin/vite');
|
|
246
|
+
await addDestructuredImport(tree, viteConfigPath, [
|
|
247
|
+
'resolve'
|
|
248
|
+
], 'path');
|
|
240
249
|
}
|
|
241
250
|
// Add TailwindCSS import if enabled
|
|
242
251
|
if (tailwind) {
|
|
243
|
-
await
|
|
252
|
+
await addSingleImport(tree, viteConfigPath, 'tailwindcss', '@tailwindcss/vite');
|
|
244
253
|
}
|
|
245
|
-
// Update build.outDir
|
|
246
|
-
|
|
247
|
-
|
|
254
|
+
// Update build.outDir. The inferred `vite build` target writes here, so
|
|
255
|
+
// point it at the bundle dir the website infrastructure consumes.
|
|
256
|
+
const outDir = joinPathFragments(getRelativePathToRoot(tree, fullyQualifiedName), 'dist', websiteContentPath, 'bundle');
|
|
257
|
+
await applyGritQL(tree, viteConfigPath, `\`build: { $bprops }\` where { $bprops <: contains \`outDir: $_\` => \`outDir: '${outDir}'\` }`);
|
|
248
258
|
// Add plugins to the plugins array
|
|
249
259
|
if (tanstackRouter) {
|
|
250
260
|
// Prepend tanstackRouter (must be first plugin) — rewrite works for both single/multi-element
|
|
251
|
-
await
|
|
261
|
+
await applyGritQL(tree, viteConfigPath, "`plugins: [$items]` => `plugins: [tanstackRouter({ routesDirectory: resolve(__dirname, 'src/routes'), generatedRouteTree: resolve(__dirname, 'src/routeTree.gen.ts') }), $items]` where { $items <: within `defineConfig($_)`, $items <: not contains `tanstackRouter` }");
|
|
252
262
|
}
|
|
253
263
|
if (tailwind) {
|
|
254
|
-
await
|
|
264
|
+
await applyGritQL(tree, viteConfigPath, '`plugins: [$items]` => `plugins: [$items, tailwindcss()]` where { $items <: within `defineConfig($_)`, $items <: not some `tailwindcss()` }');
|
|
255
265
|
}
|
|
256
266
|
// Use Vite's native tsconfig paths resolution (replaces vite-tsconfig-paths)
|
|
257
|
-
await
|
|
267
|
+
await applyGritQL(tree, viteConfigPath, 'or { `defineConfig(() => ({ $props }))` where { $props <: not some `resolve: $_`, $props += `resolve: { tsconfigPaths: true }` }, `defineConfig({ $props })` where { $props <: not some `resolve: $_`, $props += `resolve: { tsconfigPaths: true }` } }');
|
|
258
268
|
// Add define: { global: {} } to the config (handles both callback and direct forms)
|
|
259
|
-
await
|
|
269
|
+
await applyGritQL(tree, viteConfigPath, 'or { `defineConfig(() => ({ $props }))` where { $props <: not contains `define`, $props += `define: { global: {} }` }, `defineConfig({ $props })` where { $props <: not contains `define`, $props += `define: { global: {} }` } }');
|
|
260
270
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
const outDirToRootRelativePath =
|
|
270
|
-
const distDir =
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
271
|
+
updateJson(tree, joinPathFragments(websiteContentPath, 'tsconfig.json'), (tsconfig)=>({
|
|
272
|
+
...tsconfig,
|
|
273
|
+
compilerOptions: {
|
|
274
|
+
...tsconfig.compilerOptions,
|
|
275
|
+
moduleResolution: 'Bundler',
|
|
276
|
+
module: 'Preserve'
|
|
277
|
+
}
|
|
278
|
+
}));
|
|
279
|
+
const outDirToRootRelativePath = relative(joinPathFragments(tree.root, websiteContentPath), tree.root);
|
|
280
|
+
const distDir = joinPathFragments(outDirToRootRelativePath, 'dist', websiteContentPath, 'tsc');
|
|
281
|
+
updateJson(tree, joinPathFragments(websiteContentPath, 'tsconfig.app.json'), (tsconfig)=>({
|
|
282
|
+
...tsconfig,
|
|
283
|
+
compilerOptions: {
|
|
284
|
+
...tsconfig.compilerOptions,
|
|
285
|
+
outDir: distDir,
|
|
286
|
+
tsBuildInfoFile: joinPathFragments(distDir, 'tsconfig.lib.tsbuildinfo'),
|
|
287
|
+
lib: [
|
|
288
|
+
'DOM'
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
references: ux === 'shadcn' ? [
|
|
292
|
+
...(tsconfig.references ?? []).filter((ref)=>ref.path !== sharedShadcnTsconfigRef),
|
|
282
293
|
{
|
|
283
|
-
path: sharedShadcnTsconfigRef
|
|
284
|
-
}
|
|
285
|
-
]
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
294
|
+
path: sharedShadcnTsconfigRef
|
|
295
|
+
}
|
|
296
|
+
] : tsconfig.references
|
|
297
|
+
}));
|
|
298
|
+
const devDependencies = [
|
|
299
|
+
'@nx/react',
|
|
300
|
+
'@vitest/ui'
|
|
301
|
+
];
|
|
302
|
+
const dependencies = [
|
|
303
|
+
'react',
|
|
304
|
+
'react-dom'
|
|
305
|
+
];
|
|
290
306
|
if (ux === 'cloudscape') {
|
|
291
307
|
dependencies.push('@cloudscape-design/components', '@cloudscape-design/board-components', '@cloudscape-design/global-styles');
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
// not required to add any dependencies because dependencies are added by the common/shadcn package.
|
|
308
|
+
} else if (ux === 'shadcn') {
|
|
309
|
+
// not required to add any dependencies because dependencies are added by the common/shadcn package.
|
|
295
310
|
}
|
|
296
311
|
// Add TailwindCSS dependencies if enabled
|
|
297
312
|
if (tailwind) {
|
|
@@ -302,23 +317,17 @@ async function tsReactWebsiteGenerator(tree, schema) {
|
|
|
302
317
|
dependencies.push('@tanstack/react-router');
|
|
303
318
|
devDependencies.push('@tanstack/router-plugin', '@tanstack/router-generator', '@tanstack/virtual-file-routes', '@tanstack/router-utils');
|
|
304
319
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
if (!pkgJson.scripts.dev) {
|
|
309
|
-
pkgJson.scripts.dev = `nx serve-local ${fullyQualifiedName}`;
|
|
310
|
-
}
|
|
311
|
-
return pkgJson;
|
|
312
|
-
});
|
|
313
|
-
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
|
|
314
|
-
exports.REACT_WEBSITE_APP_GENERATOR_INFO,
|
|
320
|
+
addDependenciesToPackageJson(tree, withVersions(dependencies), withVersions(devDependencies));
|
|
321
|
+
await addGeneratorMetricsIfApplicable(tree, [
|
|
322
|
+
REACT_WEBSITE_APP_GENERATOR_INFO
|
|
315
323
|
]);
|
|
316
|
-
await
|
|
317
|
-
return ()
|
|
324
|
+
await formatFilesInSubtree(tree);
|
|
325
|
+
return ()=>{
|
|
318
326
|
if (!schema.skipInstall) {
|
|
319
|
-
|
|
327
|
+
installPackagesTask(tree);
|
|
320
328
|
}
|
|
321
329
|
};
|
|
322
330
|
}
|
|
323
|
-
|
|
331
|
+
export default tsReactWebsiteGenerator;
|
|
332
|
+
|
|
324
333
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/react-website/app/generator.ts"],"names":[],"mappings":";;;AAyDA,0DA8cC;AAvgBD;;;GAGG;AACH,uCAWoB;AACpB,qCAAiD;AACjD,+BAAqC;AACrC,4CAI4B;AAC5B,kDAA6D;AAC7D,4CAAgD;AAChD,oDAAyE;AACzE,gDAA2E;AAC3E,wDAA2E;AAC3E,0CAI2B;AAC3B,kDAAuD;AACvD,gDAA6D;AAC7D,4DAA8E;AAC9E,wEAA6E;AAC7E,4FAGoD;AACpD,gEAAqE;AACrE,sDAA2E;AAC3E,6FAAuF;AACvF,iEAAgE;AAInD,QAAA,sBAAsB,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAU,CAAC;AAMnE,QAAA,gCAAgC,GAC3C,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,KAAK,UAAU,uBAAuB,CAC3C,IAAU,EACV,MAAqC;IAErC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC;IACzC,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC;IACrD,MAAM,EAAE,GAAO,MAAM,CAAC,EAAE,IAAI,YAAY,CAAC;IACzC,IAAI,EAAE,KAAK,QAAQ,IAAI,CAAC,QAAQ,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IACD,MAAM,cAAc,GAAG,IAAA,6BAAiB,EAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,IAAA,wBAAY,EAAC,cAAc,CAAC,CAAC;IAChD,MAAM,oBAAoB,GAAG,IAAA,mBAAW,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtD,MAAM,oBAAoB,GAAG,IAAA,mBAAW,EAAC,MAAM,CA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AO,CAAC,GAAG,EAAE,CAAC;YACzB,OAAO,CAAC,OAAO,CAAC,GAAG,GAAG,kBAAkB,kBAAkB,EAAE,CAAC;QAC/D,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE;QAC1C,wCAAgC;KACjC,CAAC,CAAC;IAEH,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YACxB,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AACD,kBAAe,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/ts/react-website/app/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n addDependenciesToPackageJson,\n generateFiles,\n installPackagesTask,\n joinPathFragments,\n names,\n OverwriteStrategy,\n readProjectConfiguration,\n type Tree,\n updateJson,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { applicationGenerator } from '@nx/react';\nimport { relative, sep } from 'path';\nimport {\n addDestructuredImport,\n addSingleImport,\n applyGritQL,\n} from '../../../utils/ast';\nimport { formatFilesInSubtree } from '../../../utils/format';\nimport { resolveIac } from '../../../utils/iac';\nimport { addGeneratorMetricsIfApplicable } from '../../../utils/metrics';\nimport { kebabCase, toClassName, toKebabCase } from '../../../utils/names';\nimport { getNpmScopePrefix, toScopeAlias } from '../../../utils/npm-scope';\nimport {\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n} from '../../../utils/nx';\nimport { sortObjectKeys } from '../../../utils/object';\nimport { getRelativePathToRoot } from '../../../utils/paths';\nimport { getPackageManagerDisplayCommands } from '../../../utils/pkg-manager';\nimport { sharedConstructsGenerator } from '../../../utils/shared-constructs';\nimport {\n PACKAGES_DIR,\n SHARED_SHADCN_DIR,\n} from '../../../utils/shared-constructs-constants';\nimport { sharedShadcnGenerator } from '../../../utils/shared-shadcn';\nimport { type ITsDepVersion, withVersions } from '../../../utils/versions';\nimport { addWebsiteInfra } from '../../../utils/website-constructs/website-constructs';\nimport { configureTsProject } from '../../lib/ts-project-utils';\n// typescript factory imports removed — now using GritQL for vite config transforms\nimport type { TsReactWebsiteGeneratorSchema } from './schema';\n\nexport const SUPPORTED_UX_PROVIDERS = ['none', 'cloudscape', 'shadcn'] as const;\n\nexport type UxOption = (typeof SUPPORTED_UX_PROVIDERS)[number];\n\nexport type Ux = UxOption;\n\nexport const REACT_WEBSITE_APP_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\nexport async function tsReactWebsiteGenerator(\n tree: Tree,\n schema: TsReactWebsiteGeneratorSchema,\n) {\n const tailwind = schema.tailwind ?? true;\n const tanstackRouter = schema.tanstackRouter ?? true;\n const ux: Ux = schema.ux ?? 'shadcn';\n if (ux === 'shadcn' && !tailwind) {\n throw new Error('Shadcn requires TailwindCSS to be enabled.');\n }\n const npmScopePrefix = getNpmScopePrefix(tree);\n const scopeAlias = toScopeAlias(npmScopePrefix);\n const websiteNameClassName = toClassName(schema.name);\n const websiteNameKebabCase = toKebabCase(schema.name);\n const fullyQualifiedName = `${npmScopePrefix}${websiteNameKebabCase}`;\n // NB: interactive nx generator cli can pass empty string\n const websiteContentPath = joinPathFragments(\n schema.directory || '.',\n schema.subDirectory || websiteNameKebabCase,\n );\n\n const projectAlreadyExists = tree.exists(\n joinPathFragments(websiteContentPath, 'project.json'),\n );\n\n // TODO: consider exposing and supporting e2e tests\n const e2eTestRunner = 'none';\n\n if (!projectAlreadyExists) {\n await applicationGenerator(tree, {\n ...schema,\n name: fullyQualifiedName,\n directory: websiteContentPath,\n routing: false,\n e2eTestRunner,\n linter: 'none',\n bundler: 'vite',\n unitTestRunner: 'vitest',\n useProjectJson: true,\n style: 'css',\n // Register the @nx/vite and @nx/vitest plugins so build/serve/test\n // targets are inferred rather than emitting deprecated executor targets.\n addPlugin: true,\n });\n\n // Pin the inferred target names. The vite production build is exposed as\n // `bundle` (which produces the deployable artifact), leaving `build` as an\n // aggregator over lint/compile/test/bundle. vite's own typecheck is dropped\n // in favour of the tsc `compile`.\n updateJson(tree, 'nx.json', (nxJson) => {\n for (const plugin of nxJson.plugins ?? []) {\n if (typeof plugin === 'string') continue;\n if (plugin.plugin === '@nx/vite/plugin') {\n plugin.options = {\n ...plugin.options,\n buildTargetName: 'bundle',\n // Map both of vite's inferred dev-server targets onto `serve` so the\n // plugin doesn't emit a separate `dev`; we author our own `dev`\n // below running the local-dev vite mode.\n serveTargetName: 'serve',\n devTargetName: 'serve',\n previewTargetName: 'preview',\n serveStaticTargetName: 'serve-static',\n typecheckTargetName: 'vite:typecheck',\n };\n } else if (plugin.plugin === '@nx/vitest') {\n plugin.options = {\n ...plugin.options,\n testTargetName: 'test',\n };\n }\n }\n return nxJson;\n });\n\n // Replace with simpler sample source code\n tree.delete(joinPathFragments(websiteContentPath, 'src'));\n }\n\n const projectConfiguration = readProjectConfiguration(\n tree,\n fullyQualifiedName,\n );\n\n const targets = projectConfiguration.targets;\n\n const infra = schema.infra ?? 'cloudfront-s3';\n\n // Configure load:runtime-config target based on IaC provider (only when infra is not none)\n const iac = infra !== 'none' ? await resolveIac(tree, schema.iac) : undefined;\n\n if (iac === 'cdk') {\n targets['load:runtime-config'] = {\n executor: 'nx:run-commands',\n metadata: {\n description: `Load runtime config from your deployed stack for dev purposes. You must set your AWS CLI credentials whilst calling '${getPackageManagerDisplayCommands().exec} nx run ${fullyQualifiedName}:load:runtime-config'`,\n },\n options: {\n command: `aws s3 cp s3://\\`aws cloudformation describe-stacks --query \"Stacks[?starts_with(StackName, '${kebabCase(npmScopePrefix)}-')][].Outputs[] | [?contains(OutputKey, '${websiteNameClassName}WebsiteBucketName')].OutputValue\" --output text\\`/runtime-config.json \"{projectRoot}/public/runtime-config.json\"`,\n },\n };\n } else if (iac === 'terraform') {\n targets['load:runtime-config'] = {\n executor: 'nx:run-commands',\n metadata: {\n description:\n \"Load runtime config from most recently applied terraform env for dev purposes. Copies the runtime config from the Terraform dist directory to the website's public directory.\",\n },\n options: {\n command:\n 'node -e \"const fs=require(\\'fs\\');fs.mkdirSync(process.env.DEST_DIR,{recursive:true});fs.copyFileSync(process.env.SRC_FILE,process.env.DEST_FILE);\"',\n env: {\n SRC_FILE: 'dist/packages/common/terraform/runtime-config.json',\n DEST_DIR: `{projectRoot}/public`,\n DEST_FILE: `{projectRoot}/public/runtime-config.json`,\n },\n },\n };\n }\n\n if (!projectAlreadyExists) {\n targets['compile'] = {\n dependsOn: ['^build'],\n executor: 'nx:run-commands',\n outputs: ['{workspaceRoot}/dist/{projectRoot}/tsc'],\n options: {\n command: 'tsc --build tsconfig.app.json',\n cwd: '{projectRoot}',\n },\n };\n // bundle is the @nx/vite/plugin inferred `vite build` (writing to the\n // bundle dir configured in vite.config) — it produces the deployable\n // artifact. build aggregates lint/compile/test/bundle.\n targets['build'] = {\n dependsOn: ['lint', 'compile', 'test', 'bundle'],\n };\n\n // Run the website and its connected dependencies locally. Mirrors the\n // inferred `serve` target but with the local-dev vite mode.\n targets['dev'] = {\n executor: 'nx:run-commands',\n continuous: true,\n options: {\n command: 'vite --mode local-dev',\n cwd: '{projectRoot}',\n },\n };\n }\n\n projectConfiguration.targets = sortObjectKeys(targets);\n\n updateProjectConfiguration(tree, fullyQualifiedName, projectConfiguration);\n addGeneratorMetadata(\n tree,\n projectConfiguration.name,\n REACT_WEBSITE_APP_GENERATOR_INFO,\n {\n ux,\n framework: 'react',\n infra,\n },\n );\n\n await configureTsProject(tree, {\n dir: websiteContentPath,\n fullyQualifiedName,\n });\n\n if (ux === 'shadcn') {\n await sharedShadcnGenerator(tree);\n }\n\n if (iac) {\n await sharedConstructsGenerator(tree, {\n iac,\n });\n\n await addWebsiteInfra(tree, {\n iac,\n websiteProjectName: fullyQualifiedName,\n scopeAlias,\n websiteContentPath: joinPathFragments('dist', websiteContentPath),\n websiteNameKebabCase,\n websiteNameClassName,\n });\n }\n\n const projectConfig = readProjectConfiguration(tree, fullyQualifiedName);\n const libraryRoot = projectConfig.root;\n const sharedShadcnStylesImport = relative(\n joinPathFragments(libraryRoot, 'src'),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_SHADCN_DIR,\n 'src',\n 'styles',\n 'globals.css',\n ),\n )\n .split(sep)\n .join('/');\n const sharedShadcnTsconfigRef = relative(\n joinPathFragments(tree.root, websiteContentPath),\n joinPathFragments(\n tree.root,\n PACKAGES_DIR,\n SHARED_SHADCN_DIR,\n 'tsconfig.json',\n ),\n )\n .split(sep)\n .join('/');\n const templateOptions = {\n ...schema,\n fullyQualifiedName,\n pkgMgrCmd: getPackageManagerDisplayCommands().exec,\n tailwind,\n tanstackRouter,\n scopeAlias,\n sharedShadcnStylesImport,\n };\n tree.delete(joinPathFragments(libraryRoot, 'src', 'app'));\n const appCommonTemplatePath = joinPathFragments(\n import.meta.dirname,\n './files/app/common',\n );\n const appTemplatePath = joinPathFragments(\n import.meta.dirname,\n `./files/app/${ux.toLowerCase()}`,\n );\n\n generateFiles(\n tree, // the virtual file system\n appCommonTemplatePath, // path to the file templates\n libraryRoot, // destination path of the files\n templateOptions, // config object to replace variable in file templates\n {\n // User-editable source - preserve any edits on re-run\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n generateFiles(\n tree, // the virtual file system\n appTemplatePath, // path to the file templates\n libraryRoot, // destination path of the files\n templateOptions, // config object to replace variable in file templates\n {\n // User-editable source - preserve any edits on re-run\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n if (tanstackRouter) {\n const routerCommonTemplatePath = joinPathFragments(\n import.meta.dirname,\n './files/tanstack-router/common',\n );\n const routerTemplatePath = joinPathFragments(\n import.meta.dirname,\n `./files/tanstack-router/${ux.toLowerCase()}`,\n );\n\n generateFiles(\n tree,\n routerCommonTemplatePath,\n libraryRoot,\n templateOptions,\n {\n // User-editable source (and the TanStack-managed route tree) - preserve on re-run\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n generateFiles(\n tree,\n routerTemplatePath,\n libraryRoot,\n templateOptions, // config object to replace variable in file templates\n {\n // User-editable source - preserve any edits on re-run\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n tree.delete(joinPathFragments(websiteContentPath, 'src', 'app.tsx'));\n }\n\n if (e2eTestRunner !== 'none') {\n const e2eFullyQualifiedName = `${fullyQualifiedName}-e2e`;\n const e2eRoot = readProjectConfiguration(tree, e2eFullyQualifiedName).root;\n generateFiles(\n tree, // the virtual file system\n joinPathFragments(import.meta.dirname, `./files/e2e/${e2eTestRunner}`), // path to the file templates\n e2eRoot, // destination path of the files\n { ...schema, ...names(fullyQualifiedName) },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n await configureTsProject(tree, {\n fullyQualifiedName: e2eFullyQualifiedName,\n dir: e2eRoot,\n });\n }\n const viteConfigPath = joinPathFragments(libraryRoot, 'vite.config.mts');\n\n if (tree.exists(viteConfigPath)) {\n // Add Tanstack Router import if enabled\n if (tanstackRouter) {\n await addDestructuredImport(\n tree,\n viteConfigPath,\n ['tanstackRouter'],\n '@tanstack/router-plugin/vite',\n );\n\n await addDestructuredImport(tree, viteConfigPath, ['resolve'], 'path');\n }\n\n // Add TailwindCSS import if enabled\n if (tailwind) {\n await addSingleImport(\n tree,\n viteConfigPath,\n 'tailwindcss',\n '@tailwindcss/vite',\n );\n }\n\n // Update build.outDir. The inferred `vite build` target writes here, so\n // point it at the bundle dir the website infrastructure consumes.\n const outDir = joinPathFragments(\n getRelativePathToRoot(tree, fullyQualifiedName),\n 'dist',\n websiteContentPath,\n 'bundle',\n );\n await applyGritQL(\n tree,\n viteConfigPath,\n `\\`build: { $bprops }\\` where { $bprops <: contains \\`outDir: $_\\` => \\`outDir: '${outDir}'\\` }`,\n );\n\n // Add plugins to the plugins array\n if (tanstackRouter) {\n // Prepend tanstackRouter (must be first plugin) — rewrite works for both single/multi-element\n await applyGritQL(\n tree,\n viteConfigPath,\n \"`plugins: [$items]` => `plugins: [tanstackRouter({ routesDirectory: resolve(__dirname, 'src/routes'), generatedRouteTree: resolve(__dirname, 'src/routeTree.gen.ts') }), $items]` where { $items <: within `defineConfig($_)`, $items <: not contains `tanstackRouter` }\",\n );\n }\n\n if (tailwind) {\n await applyGritQL(\n tree,\n viteConfigPath,\n '`plugins: [$items]` => `plugins: [$items, tailwindcss()]` where { $items <: within `defineConfig($_)`, $items <: not some `tailwindcss()` }',\n );\n }\n\n // Use Vite's native tsconfig paths resolution (replaces vite-tsconfig-paths)\n await applyGritQL(\n tree,\n viteConfigPath,\n 'or { `defineConfig(() => ({ $props }))` where { $props <: not some `resolve: $_`, $props += `resolve: { tsconfigPaths: true }` }, `defineConfig({ $props })` where { $props <: not some `resolve: $_`, $props += `resolve: { tsconfigPaths: true }` } }',\n );\n\n // Add define: { global: {} } to the config (handles both callback and direct forms)\n await applyGritQL(\n tree,\n viteConfigPath,\n 'or { `defineConfig(() => ({ $props }))` where { $props <: not contains `define`, $props += `define: { global: {} }` }, `defineConfig({ $props })` where { $props <: not contains `define`, $props += `define: { global: {} }` } }',\n );\n }\n\n updateJson(\n tree,\n joinPathFragments(websiteContentPath, 'tsconfig.json'),\n (tsconfig) => ({\n ...tsconfig,\n compilerOptions: {\n ...tsconfig.compilerOptions,\n moduleResolution: 'Bundler',\n module: 'Preserve',\n },\n }),\n );\n const outDirToRootRelativePath = relative(\n joinPathFragments(tree.root, websiteContentPath),\n tree.root,\n );\n const distDir = joinPathFragments(\n outDirToRootRelativePath,\n 'dist',\n websiteContentPath,\n 'tsc',\n );\n updateJson(\n tree,\n joinPathFragments(websiteContentPath, 'tsconfig.app.json'),\n (tsconfig) => ({\n ...tsconfig,\n compilerOptions: {\n ...tsconfig.compilerOptions,\n outDir: distDir,\n tsBuildInfoFile: joinPathFragments(distDir, 'tsconfig.lib.tsbuildinfo'),\n lib: ['DOM'],\n },\n references:\n ux === 'shadcn'\n ? [\n ...(tsconfig.references ?? []).filter(\n (ref) => ref.path !== sharedShadcnTsconfigRef,\n ),\n {\n path: sharedShadcnTsconfigRef,\n },\n ]\n : tsconfig.references,\n }),\n );\n\n const devDependencies: ITsDepVersion[] = ['@nx/react', '@vitest/ui'];\n\n const dependencies: ITsDepVersion[] = ['react', 'react-dom'];\n\n if (ux === 'cloudscape') {\n dependencies.push(\n '@cloudscape-design/components',\n '@cloudscape-design/board-components',\n '@cloudscape-design/global-styles',\n );\n } else if (ux === 'shadcn') {\n // not required to add any dependencies because dependencies are added by the common/shadcn package.\n }\n\n // Add TailwindCSS dependencies if enabled\n if (tailwind) {\n dependencies.push('tailwindcss');\n devDependencies.push('@tailwindcss/vite');\n }\n if (tanstackRouter) {\n dependencies.push('@tanstack/react-router');\n devDependencies.push(\n '@tanstack/router-plugin',\n '@tanstack/router-generator',\n '@tanstack/virtual-file-routes',\n '@tanstack/router-utils',\n );\n }\n\n addDependenciesToPackageJson(\n tree,\n withVersions(dependencies),\n withVersions(devDependencies),\n );\n\n await addGeneratorMetricsIfApplicable(tree, [\n REACT_WEBSITE_APP_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n return () => {\n if (!schema.skipInstall) {\n installPackagesTask(tree);\n }\n };\n}\nexport default tsReactWebsiteGenerator;\n"],"names":["addDependenciesToPackageJson","generateFiles","installPackagesTask","joinPathFragments","names","OverwriteStrategy","readProjectConfiguration","updateJson","updateProjectConfiguration","applicationGenerator","relative","sep","addDestructuredImport","addSingleImport","applyGritQL","formatFilesInSubtree","resolveIac","addGeneratorMetricsIfApplicable","kebabCase","toClassName","toKebabCase","getNpmScopePrefix","toScopeAlias","addGeneratorMetadata","getGeneratorInfo","sortObjectKeys","getRelativePathToRoot","getPackageManagerDisplayCommands","sharedConstructsGenerator","PACKAGES_DIR","SHARED_SHADCN_DIR","sharedShadcnGenerator","withVersions","addWebsiteInfra","configureTsProject","SUPPORTED_UX_PROVIDERS","REACT_WEBSITE_APP_GENERATOR_INFO","filename","tsReactWebsiteGenerator","tree","schema","tailwind","tanstackRouter","ux","Error","npmScopePrefix","scopeAlias","websiteNameClassName","name","websiteNameKebabCase","fullyQualifiedName","websiteContentPath","directory","subDirectory","projectAlreadyExists","exists","e2eTestRunner","routing","linter","bundler","unitTestRunner","useProjectJson","style","addPlugin","nxJson","plugin","plugins","options","buildTargetName","serveTargetName","devTargetName","previewTargetName","serveStaticTargetName","typecheckTargetName","testTargetName","delete","projectConfiguration","targets","infra","iac","undefined","executor","metadata","description","exec","command","env","SRC_FILE","DEST_DIR","DEST_FILE","dependsOn","outputs","cwd","continuous","framework","dir","websiteProjectName","projectConfig","libraryRoot","root","sharedShadcnStylesImport","split","join","sharedShadcnTsconfigRef","templateOptions","pkgMgrCmd","appCommonTemplatePath","dirname","appTemplatePath","toLowerCase","overwriteStrategy","KeepExisting","routerCommonTemplatePath","routerTemplatePath","e2eFullyQualifiedName","e2eRoot","viteConfigPath","outDir","tsconfig","compilerOptions","moduleResolution","module","outDirToRootRelativePath","distDir","tsBuildInfoFile","lib","references","filter","ref","path","devDependencies","dependencies","push","skipInstall"],"mappings":"AAAA;;;CAGC,GACD,SACEA,4BAA4B,EAC5BC,aAAa,EACbC,mBAAmB,EACnBC,iBAAiB,EACjBC,KAAK,EACLC,iBAAiB,EACjBC,wBAAwB,EAExBC,UAAU,EACVC,0BAA0B,QACrB,aAAa;AACpB,SAASC,oBAAoB,QAAQ,YAAY;AACjD,SAASC,QAAQ,EAAEC,GAAG,QAAQ,OAAO;AACrC,SACEC,qBAAqB,EACrBC,eAAe,EACfC,WAAW,QACN,wBAAqB;AAC5B,SAASC,oBAAoB,QAAQ,2BAAwB;AAC7D,SAASC,UAAU,QAAQ,wBAAqB;AAChD,SAASC,+BAA+B,QAAQ,4BAAyB;AACzE,SAASC,SAA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