@aws/nx-plugin 1.0.0-rc.23 → 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} +6 -843
- 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 -74
- 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/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 -57
- 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 -193
- 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 -51
- 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 +4 -4
- 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.js +128 -89
- 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 +10 -10
- 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 +4 -4
- 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 +30 -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 +1 -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 +154 -260
- 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 +10 -3
- 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.js +129 -146
- 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 +4 -4
- 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 +2 -2
- 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.js +25 -51
- 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.js +43 -52
- 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,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.determineProjectType = exports.resolveConnection = exports.findComponentInMetadata = exports.connectionGenerator = exports.PROJECT_COMPONENT_SENTINEL = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const toml_1 = require("../utils/toml");
|
|
4
|
+
*/ import { joinPathFragments } from "@nx/devkit";
|
|
5
|
+
import agentcoreGatewayGatewayConnectionGenerator from "../agentcore-gateway/gateway-connection/generator.js";
|
|
6
|
+
import { AGENTCORE_GATEWAY_GENERATOR_INFO } from "../agentcore-gateway/generator.js";
|
|
7
|
+
import agentcoreGatewayMcpConnectionGenerator from "../agentcore-gateway/mcp-connection/generator.js";
|
|
8
|
+
import pyAgentA2aConnectionGenerator from "../py/agent/a2a-connection/generator.js";
|
|
9
|
+
import pyAgentGatewayConnectionGenerator from "../py/agent/gateway-connection/generator.js";
|
|
10
|
+
import pyAgentMcpConnectionGenerator from "../py/agent/mcp-connection/generator.js";
|
|
11
|
+
import pyAgentReactConnectionGenerator from "../py/agent/react-connection/generator.js";
|
|
12
|
+
import pyDynamoDBAgentConnectionGenerator from "../py/dynamodb/agent-connection/generator.js";
|
|
13
|
+
import pyDynamoDBFastApiConnectionGenerator from "../py/dynamodb/fast-api-connection/generator.js";
|
|
14
|
+
import { PY_DYNAMODB_GENERATOR_INFO } from "../py/dynamodb/generator.js";
|
|
15
|
+
import pyDynamoDBMcpServerConnectionGenerator from "../py/dynamodb/mcp-server-connection/generator.js";
|
|
16
|
+
import fastApiReactGenerator from "../py/fast-api/react/generator.js";
|
|
17
|
+
import { SMITHY_PROJECT_GENERATOR_INFO } from "../smithy/project/generator.js";
|
|
18
|
+
import smithyReactConnectionGenerator from "../smithy/react-connection/generator.js";
|
|
19
|
+
import { TS_SMITHY_API_GENERATOR_INFO } from "../smithy/ts/api/generator.js";
|
|
20
|
+
import trpcReactGenerator from "../trpc/react/generator.js";
|
|
21
|
+
import tsAgentA2aConnectionGenerator from "../ts/agent/a2a-connection/generator.js";
|
|
22
|
+
import tsAgentGatewayConnectionGenerator from "../ts/agent/gateway-connection/generator.js";
|
|
23
|
+
import tsAgentMcpConnectionGenerator from "../ts/agent/mcp-connection/generator.js";
|
|
24
|
+
import tsAgentReactConnectionGenerator from "../ts/agent/react-connection/generator.js";
|
|
25
|
+
import tsDynamoDBAgentConnectionGenerator from "../ts/dynamodb/agent-connection/generator.js";
|
|
26
|
+
import { TS_DYNAMODB_GENERATOR_INFO } from "../ts/dynamodb/generator.js";
|
|
27
|
+
import tsDynamoDBMcpServerConnectionGenerator from "../ts/dynamodb/mcp-server-connection/generator.js";
|
|
28
|
+
import tsDynamoDBSmithyConnectionGenerator from "../ts/dynamodb/smithy-connection/generator.js";
|
|
29
|
+
import tsDynamoDBTrpcConnectionGenerator from "../ts/dynamodb/trpc-connection/generator.js";
|
|
30
|
+
import tsRdbAgentConnectionGenerator from "../ts/rdb/agent-connection/generator.js";
|
|
31
|
+
import { TS_RDB_GENERATOR_INFO } from "../ts/rdb/generator.js";
|
|
32
|
+
import tsRdbMcpServerConnectionGenerator from "../ts/rdb/mcp-server-connection/generator.js";
|
|
33
|
+
import tsRdbSmithyConnectionGenerator from "../ts/rdb/smithy-connection/generator.js";
|
|
34
|
+
import tsRdbTrpcConnectionGenerator from "../ts/rdb/trpc-connection/generator.js";
|
|
35
|
+
import { hasExportDeclaration } from "../utils/ast.js";
|
|
36
|
+
import { readProjectConfigurationUnqualified } from "../utils/nx.js";
|
|
37
|
+
import { readToml } from "../utils/toml.js";
|
|
43
38
|
/**
|
|
44
39
|
* List of supported source and target project types for connections.
|
|
45
40
|
* These can be project-level types (determined by introspection) or
|
|
46
41
|
* component generator ids (from component metadata).
|
|
47
|
-
*/
|
|
48
|
-
const SUPPORTED_PROJECT_TYPES = [
|
|
42
|
+
*/ const SUPPORTED_PROJECT_TYPES = [
|
|
49
43
|
'ts#trpc-api',
|
|
50
44
|
'py#fast-api',
|
|
51
45
|
'react',
|
|
@@ -53,167 +47,241 @@ const SUPPORTED_PROJECT_TYPES = [
|
|
|
53
47
|
'ts#rdb',
|
|
54
48
|
'ts#dynamodb',
|
|
55
49
|
'py#dynamodb',
|
|
56
|
-
'agentcore-gateway'
|
|
50
|
+
'agentcore-gateway'
|
|
57
51
|
];
|
|
58
52
|
/**
|
|
59
53
|
* Sentinel value for sourceComponent/targetComponent that means
|
|
60
54
|
* "use the project-level connection, not a component".
|
|
61
|
-
*/
|
|
62
|
-
exports.PROJECT_COMPONENT_SENTINEL = '.';
|
|
55
|
+
*/ export const PROJECT_COMPONENT_SENTINEL = '.';
|
|
63
56
|
/**
|
|
64
57
|
* Enumerates the supported project connections.
|
|
65
58
|
* Source and target can be project-level types or component generator ids.
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{
|
|
96
|
-
|
|
59
|
+
*/ const SUPPORTED_CONNECTIONS = [
|
|
60
|
+
{
|
|
61
|
+
source: 'ts#trpc-api',
|
|
62
|
+
target: 'ts#rdb'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
source: 'ts#trpc-api',
|
|
66
|
+
target: 'ts#dynamodb'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
source: 'ts#agent',
|
|
70
|
+
target: 'ts#rdb'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
source: 'smithy',
|
|
74
|
+
target: 'ts#rdb'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
source: 'smithy',
|
|
78
|
+
target: 'ts#dynamodb'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
source: 'ts#mcp-server',
|
|
82
|
+
target: 'ts#rdb'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
source: 'ts#mcp-server',
|
|
86
|
+
target: 'ts#dynamodb'
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
source: 'react',
|
|
90
|
+
target: 'ts#trpc-api'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
source: 'react',
|
|
94
|
+
target: 'py#fast-api'
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
source: 'react',
|
|
98
|
+
target: 'smithy'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
source: 'react',
|
|
102
|
+
target: 'ts#agent'
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
source: 'react',
|
|
106
|
+
target: 'py#agent'
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
source: 'ts#agent',
|
|
110
|
+
target: 'ts#mcp-server'
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
source: 'ts#agent',
|
|
114
|
+
target: 'py#mcp-server'
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
source: 'ts#agent',
|
|
118
|
+
target: 'ts#dynamodb'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
source: 'py#agent',
|
|
122
|
+
target: 'ts#mcp-server'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
source: 'py#agent',
|
|
126
|
+
target: 'py#mcp-server'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
source: 'ts#agent',
|
|
130
|
+
target: 'ts#agent'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
source: 'ts#agent',
|
|
134
|
+
target: 'py#agent'
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
source: 'py#agent',
|
|
138
|
+
target: 'ts#agent'
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
source: 'py#agent',
|
|
142
|
+
target: 'py#agent'
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
source: 'ts#agent',
|
|
146
|
+
target: 'agentcore-gateway'
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
source: 'py#agent',
|
|
150
|
+
target: 'agentcore-gateway'
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
source: 'agentcore-gateway',
|
|
154
|
+
target: 'ts#mcp-server'
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
source: 'agentcore-gateway',
|
|
158
|
+
target: 'py#mcp-server'
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
source: 'agentcore-gateway',
|
|
162
|
+
target: 'agentcore-gateway'
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
source: 'py#fast-api',
|
|
166
|
+
target: 'py#dynamodb'
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
source: 'py#agent',
|
|
170
|
+
target: 'py#dynamodb'
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
source: 'py#mcp-server',
|
|
174
|
+
target: 'py#dynamodb'
|
|
175
|
+
}
|
|
97
176
|
];
|
|
98
177
|
const CONNECTION_GENERATORS = {
|
|
99
|
-
'ts#trpc-api -> ts#rdb': (tree, options)
|
|
100
|
-
'ts#agent -> ts#rdb': (tree, options)
|
|
101
|
-
'smithy -> ts#rdb': (tree, options)
|
|
102
|
-
'ts#mcp-server -> ts#rdb': (tree, options)
|
|
103
|
-
'ts#trpc-api -> ts#dynamodb': (tree, options)
|
|
104
|
-
'ts#agent -> ts#dynamodb': (tree, options)
|
|
105
|
-
'smithy -> ts#dynamodb': (tree, options)
|
|
106
|
-
'ts#mcp-server -> ts#dynamodb': (tree, options)
|
|
107
|
-
'react -> ts#trpc-api': (tree, options)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
'react -> py#fast-api': (tree, options)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
'react -> smithy': (tree, options)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
'react -> ts#agent': (tree, options)
|
|
120
|
-
'react -> py#agent': (tree, options)
|
|
121
|
-
'ts#agent -> ts#mcp-server': (tree, options)
|
|
122
|
-
'ts#agent -> py#mcp-server': (tree, options)
|
|
123
|
-
'py#agent -> ts#mcp-server': (tree, options)
|
|
124
|
-
'py#agent -> py#mcp-server': (tree, options)
|
|
125
|
-
'ts#agent -> ts#agent': (tree, options)
|
|
126
|
-
'ts#agent -> py#agent': (tree, options)
|
|
127
|
-
'py#agent -> ts#agent': (tree, options)
|
|
128
|
-
'py#agent -> py#agent': (tree, options)
|
|
129
|
-
'ts#agent -> agentcore-gateway': (tree, options)
|
|
130
|
-
'py#agent -> agentcore-gateway': (tree, options)
|
|
131
|
-
'agentcore-gateway -> ts#mcp-server': (tree, options)
|
|
132
|
-
'agentcore-gateway -> py#mcp-server': (tree, options)
|
|
133
|
-
'agentcore-gateway -> agentcore-gateway': (tree, options)
|
|
134
|
-
'py#fast-api -> py#dynamodb': (tree, options)
|
|
135
|
-
'py#agent -> py#dynamodb': (tree, options)
|
|
136
|
-
'py#mcp-server -> py#dynamodb': (tree, options)
|
|
178
|
+
'ts#trpc-api -> ts#rdb': (tree, options)=>tsRdbTrpcConnectionGenerator(tree, options),
|
|
179
|
+
'ts#agent -> ts#rdb': (tree, options)=>tsRdbAgentConnectionGenerator(tree, options),
|
|
180
|
+
'smithy -> ts#rdb': (tree, options)=>tsRdbSmithyConnectionGenerator(tree, options),
|
|
181
|
+
'ts#mcp-server -> ts#rdb': (tree, options)=>tsRdbMcpServerConnectionGenerator(tree, options),
|
|
182
|
+
'ts#trpc-api -> ts#dynamodb': (tree, options)=>tsDynamoDBTrpcConnectionGenerator(tree, options),
|
|
183
|
+
'ts#agent -> ts#dynamodb': (tree, options)=>tsDynamoDBAgentConnectionGenerator(tree, options),
|
|
184
|
+
'smithy -> ts#dynamodb': (tree, options)=>tsDynamoDBSmithyConnectionGenerator(tree, options),
|
|
185
|
+
'ts#mcp-server -> ts#dynamodb': (tree, options)=>tsDynamoDBMcpServerConnectionGenerator(tree, options),
|
|
186
|
+
'react -> ts#trpc-api': (tree, options)=>trpcReactGenerator(tree, {
|
|
187
|
+
frontendProjectName: options.sourceProject,
|
|
188
|
+
backendProjectName: options.targetProject
|
|
189
|
+
}),
|
|
190
|
+
'react -> py#fast-api': (tree, options)=>fastApiReactGenerator(tree, {
|
|
191
|
+
frontendProjectName: options.sourceProject,
|
|
192
|
+
fastApiProjectName: options.targetProject
|
|
193
|
+
}),
|
|
194
|
+
'react -> smithy': (tree, options)=>smithyReactConnectionGenerator(tree, {
|
|
195
|
+
frontendProjectName: options.sourceProject,
|
|
196
|
+
smithyModelOrBackendProjectName: options.targetProject
|
|
197
|
+
}),
|
|
198
|
+
'react -> ts#agent': (tree, options)=>tsAgentReactConnectionGenerator(tree, options),
|
|
199
|
+
'react -> py#agent': (tree, options)=>pyAgentReactConnectionGenerator(tree, options),
|
|
200
|
+
'ts#agent -> ts#mcp-server': (tree, options)=>tsAgentMcpConnectionGenerator(tree, options),
|
|
201
|
+
'ts#agent -> py#mcp-server': (tree, options)=>tsAgentMcpConnectionGenerator(tree, options),
|
|
202
|
+
'py#agent -> ts#mcp-server': (tree, options)=>pyAgentMcpConnectionGenerator(tree, options),
|
|
203
|
+
'py#agent -> py#mcp-server': (tree, options)=>pyAgentMcpConnectionGenerator(tree, options),
|
|
204
|
+
'ts#agent -> ts#agent': (tree, options)=>tsAgentA2aConnectionGenerator(tree, options),
|
|
205
|
+
'ts#agent -> py#agent': (tree, options)=>tsAgentA2aConnectionGenerator(tree, options),
|
|
206
|
+
'py#agent -> ts#agent': (tree, options)=>pyAgentA2aConnectionGenerator(tree, options),
|
|
207
|
+
'py#agent -> py#agent': (tree, options)=>pyAgentA2aConnectionGenerator(tree, options),
|
|
208
|
+
'ts#agent -> agentcore-gateway': (tree, options)=>tsAgentGatewayConnectionGenerator(tree, options),
|
|
209
|
+
'py#agent -> agentcore-gateway': (tree, options)=>pyAgentGatewayConnectionGenerator(tree, options),
|
|
210
|
+
'agentcore-gateway -> ts#mcp-server': (tree, options)=>agentcoreGatewayMcpConnectionGenerator(tree, options),
|
|
211
|
+
'agentcore-gateway -> py#mcp-server': (tree, options)=>agentcoreGatewayMcpConnectionGenerator(tree, options),
|
|
212
|
+
'agentcore-gateway -> agentcore-gateway': (tree, options)=>agentcoreGatewayGatewayConnectionGenerator(tree, options),
|
|
213
|
+
'py#fast-api -> py#dynamodb': (tree, options)=>pyDynamoDBFastApiConnectionGenerator(tree, options),
|
|
214
|
+
'py#agent -> py#dynamodb': (tree, options)=>pyDynamoDBAgentConnectionGenerator(tree, options),
|
|
215
|
+
'py#mcp-server -> py#dynamodb': (tree, options)=>pyDynamoDBMcpServerConnectionGenerator(tree, options)
|
|
137
216
|
};
|
|
138
217
|
/**
|
|
139
218
|
* Generator for a connection between two projects
|
|
140
|
-
*/
|
|
141
|
-
const
|
|
142
|
-
const resolved = await (0, exports.resolveConnection)(tree, options);
|
|
219
|
+
*/ export const connectionGenerator = async (tree, options)=>{
|
|
220
|
+
const resolved = await resolveConnection(tree, options);
|
|
143
221
|
const connectionKey = `${resolved.connection.source} -> ${resolved.connection.target}`;
|
|
144
222
|
return await CONNECTION_GENERATORS[connectionKey](tree, {
|
|
145
223
|
sourceProject: options.sourceProject,
|
|
146
224
|
targetProject: options.targetProject,
|
|
147
225
|
sourceComponent: resolved.sourceComponent,
|
|
148
|
-
targetComponent: resolved.targetComponent
|
|
226
|
+
targetComponent: resolved.targetComponent
|
|
149
227
|
});
|
|
150
228
|
};
|
|
151
|
-
exports.connectionGenerator = connectionGenerator;
|
|
152
229
|
/**
|
|
153
230
|
* Find a component in project metadata matching the given reference.
|
|
154
231
|
* Checks by name first, then by path, then by generator.
|
|
155
|
-
*/
|
|
156
|
-
const findComponentInMetadata = (projectConfiguration, componentRef) => {
|
|
232
|
+
*/ export const findComponentInMetadata = (projectConfiguration, componentRef)=>{
|
|
157
233
|
const components = projectConfiguration.metadata?.components ?? [];
|
|
158
|
-
return
|
|
159
|
-
components.find((c) => c.path === componentRef) ??
|
|
160
|
-
components.find((c) => c.generator === componentRef));
|
|
234
|
+
return components.find((c)=>c.name === componentRef) ?? components.find((c)=>c.path === componentRef) ?? components.find((c)=>c.generator === componentRef);
|
|
161
235
|
};
|
|
162
|
-
exports.findComponentInMetadata = findComponentInMetadata;
|
|
163
236
|
/**
|
|
164
237
|
* Gather all connection candidates for a project configuration. This includes:
|
|
165
238
|
* - The project-level type (if it's a supported type)
|
|
166
239
|
* - Each component's generator id as a candidate type
|
|
167
|
-
*/
|
|
168
|
-
const gatherCandidates = async (tree, projectConfig) => {
|
|
240
|
+
*/ const gatherCandidates = async (tree, projectConfig)=>{
|
|
169
241
|
const type = await determineProjectTypeFromConfig(tree, projectConfig);
|
|
170
242
|
const components = projectConfig.metadata?.components ?? [];
|
|
171
243
|
return [
|
|
172
|
-
...
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
244
|
+
...type ? [
|
|
245
|
+
{
|
|
246
|
+
type: type
|
|
247
|
+
}
|
|
248
|
+
] : [],
|
|
249
|
+
...components.map((component)=>({
|
|
250
|
+
type: component.generator,
|
|
251
|
+
component
|
|
252
|
+
}))
|
|
177
253
|
];
|
|
178
254
|
};
|
|
179
255
|
/**
|
|
180
256
|
* Validate that a specified component exists in the project metadata.
|
|
181
257
|
* Skips validation for undefined refs and the project sentinel '.'.
|
|
182
|
-
*/
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return;
|
|
186
|
-
const found = (0, exports.findComponentInMetadata)(projectConfig, componentRef);
|
|
258
|
+
*/ const validateComponent = (componentRef, projectConfig, side)=>{
|
|
259
|
+
if (!componentRef || componentRef === PROJECT_COMPONENT_SENTINEL) return;
|
|
260
|
+
const found = findComponentInMetadata(projectConfig, componentRef);
|
|
187
261
|
if (!found) {
|
|
188
262
|
const components = projectConfig.metadata?.components ?? [];
|
|
189
|
-
throw new Error(`Component '${componentRef}' not found in ${side} project ${projectConfig.name}. ` +
|
|
190
|
-
`Available components: ${components.length > 0 ? components.map((c) => c.name ?? c.generator).join(', ') : 'none'}`);
|
|
263
|
+
throw new Error(`Component '${componentRef}' not found in ${side} project ${projectConfig.name}. ` + `Available components: ${components.length > 0 ? components.map((c)=>c.name ?? c.generator).join(', ') : 'none'}`);
|
|
191
264
|
}
|
|
192
265
|
};
|
|
193
266
|
/**
|
|
194
267
|
* Narrow candidates based on the user's specified component reference.
|
|
195
|
-
*/
|
|
196
|
-
|
|
197
|
-
if (
|
|
198
|
-
return candidates;
|
|
199
|
-
if (componentRef === exports.PROJECT_COMPONENT_SENTINEL) {
|
|
200
|
-
return candidates.filter((c) => !c.component);
|
|
268
|
+
*/ const filterConnectionCandidatesForComponentReference = (componentRef, projectConfig, candidates, supportedConnections, side)=>{
|
|
269
|
+
if (!componentRef) return candidates;
|
|
270
|
+
if (componentRef === PROJECT_COMPONENT_SENTINEL) {
|
|
271
|
+
return candidates.filter((c)=>!c.component);
|
|
201
272
|
}
|
|
202
|
-
const component =
|
|
203
|
-
if (!component)
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
if (!isConnectionParticipant)
|
|
207
|
-
return candidates;
|
|
273
|
+
const component = findComponentInMetadata(projectConfig, componentRef);
|
|
274
|
+
if (!component) return candidates;
|
|
275
|
+
const isConnectionParticipant = supportedConnections.some((c)=>c[side] === component.generator);
|
|
276
|
+
if (!isConnectionParticipant) return candidates;
|
|
208
277
|
// Filter to the specific matched component, not all components with the same generator
|
|
209
|
-
return candidates.filter((c)
|
|
278
|
+
return candidates.filter((c)=>c.component === component);
|
|
210
279
|
};
|
|
211
280
|
/**
|
|
212
281
|
* Resolve the connection to use, considering source/target projects and components.
|
|
213
|
-
*/
|
|
214
|
-
const
|
|
215
|
-
const
|
|
216
|
-
const targetConfig = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.targetProject);
|
|
282
|
+
*/ export const resolveConnection = async (tree, options, supportedConnections = SUPPORTED_CONNECTIONS)=>{
|
|
283
|
+
const sourceConfig = readProjectConfigurationUnqualified(tree, options.sourceProject);
|
|
284
|
+
const targetConfig = readProjectConfigurationUnqualified(tree, options.targetProject);
|
|
217
285
|
// Validate explicitly specified components exist
|
|
218
286
|
validateComponent(options.sourceComponent, sourceConfig, 'source');
|
|
219
287
|
validateComponent(options.targetComponent, targetConfig, 'target');
|
|
@@ -222,60 +290,52 @@ const resolveConnection = async (tree, options, supportedConnections = SUPPORTED
|
|
|
222
290
|
const targetCandidates = filterConnectionCandidatesForComponentReference(options.targetComponent, targetConfig, await gatherCandidates(tree, targetConfig), supportedConnections, 'target');
|
|
223
291
|
// Cross-product candidates and find supported connections
|
|
224
292
|
const matches = [];
|
|
225
|
-
for (const source of sourceCandidates)
|
|
226
|
-
for (const target of targetCandidates)
|
|
227
|
-
const match = supportedConnections.find((c)
|
|
293
|
+
for (const source of sourceCandidates){
|
|
294
|
+
for (const target of targetCandidates){
|
|
295
|
+
const match = supportedConnections.find((c)=>c.source === source.type && c.target === target.type);
|
|
228
296
|
if (match) {
|
|
229
297
|
matches.push({
|
|
230
298
|
connection: match,
|
|
231
299
|
sourceComponent: source.component,
|
|
232
|
-
targetComponent: target.component
|
|
300
|
+
targetComponent: target.component
|
|
233
301
|
});
|
|
234
302
|
}
|
|
235
303
|
}
|
|
236
304
|
}
|
|
237
305
|
if (matches.length === 0) {
|
|
238
|
-
const sourceTypes = [
|
|
239
|
-
|
|
306
|
+
const sourceTypes = [
|
|
307
|
+
...new Set(sourceCandidates.map((c)=>c.type))
|
|
308
|
+
];
|
|
309
|
+
const targetTypes = [
|
|
310
|
+
...new Set(targetCandidates.map((c)=>c.type))
|
|
311
|
+
];
|
|
240
312
|
throw new Error(`This generator does not support a connection from ${options.sourceProject}${sourceTypes.length > 0 ? ` (${sourceTypes.join(', ')})` : ''} to ${options.targetProject}${targetTypes.length > 0 ? ` (${targetTypes.join(', ')})` : ''}`);
|
|
241
313
|
}
|
|
242
314
|
if (matches.length > 1) {
|
|
243
|
-
const connectionDescriptions = matches
|
|
244
|
-
.map((m) => {
|
|
315
|
+
const connectionDescriptions = matches.map((m)=>{
|
|
245
316
|
const sourceName = m.sourceComponent?.name;
|
|
246
317
|
const targetName = m.targetComponent?.name;
|
|
247
|
-
const sourceLabel = sourceName
|
|
248
|
-
|
|
249
|
-
: m.connection.source;
|
|
250
|
-
const targetLabel = targetName
|
|
251
|
-
? `${targetName} (${m.connection.target})`
|
|
252
|
-
: m.connection.target;
|
|
318
|
+
const sourceLabel = sourceName ? `${sourceName} (${m.connection.source})` : m.connection.source;
|
|
319
|
+
const targetLabel = targetName ? `${targetName} (${m.connection.target})` : m.connection.target;
|
|
253
320
|
return `${sourceLabel} -> ${targetLabel}`;
|
|
254
|
-
})
|
|
255
|
-
|
|
256
|
-
throw new Error(`Ambiguous connection from ${options.sourceProject} to ${options.targetProject}. ` +
|
|
257
|
-
`Multiple supported connections found: ${connectionDescriptions}. ` +
|
|
258
|
-
`Please specify sourceComponent and/or targetComponent to disambiguate.`);
|
|
321
|
+
}).join(', ');
|
|
322
|
+
throw new Error(`Ambiguous connection from ${options.sourceProject} to ${options.targetProject}. ` + `Multiple supported connections found: ${connectionDescriptions}. ` + `Please specify sourceComponent and/or targetComponent to disambiguate.`);
|
|
259
323
|
}
|
|
260
324
|
return {
|
|
261
325
|
connection: matches[0].connection,
|
|
262
326
|
sourceComponent: matches[0].sourceComponent,
|
|
263
|
-
targetComponent: matches[0].targetComponent
|
|
327
|
+
targetComponent: matches[0].targetComponent
|
|
264
328
|
};
|
|
265
329
|
};
|
|
266
|
-
exports.resolveConnection = resolveConnection;
|
|
267
330
|
/**
|
|
268
331
|
* Determine whether the given project is of a known project type
|
|
269
|
-
*/
|
|
270
|
-
const
|
|
271
|
-
const projectConfiguration = (0, nx_1.readProjectConfigurationUnqualified)(tree, projectName);
|
|
332
|
+
*/ export const determineProjectType = async (tree, projectName)=>{
|
|
333
|
+
const projectConfiguration = readProjectConfigurationUnqualified(tree, projectName);
|
|
272
334
|
return await determineProjectTypeFromConfig(tree, projectConfiguration);
|
|
273
335
|
};
|
|
274
|
-
exports.determineProjectType = determineProjectType;
|
|
275
336
|
/**
|
|
276
337
|
* Determine whether the given project configuration is of a known project type
|
|
277
|
-
*/
|
|
278
|
-
const determineProjectTypeFromConfig = async (tree, projectConfiguration) => {
|
|
338
|
+
*/ const determineProjectTypeFromConfig = async (tree, projectConfiguration)=>{
|
|
279
339
|
// NB: if adding new checks, ensure these go from most to least specific
|
|
280
340
|
// eg. react website is more specific than typescript project
|
|
281
341
|
if (await isTrpcApi(tree, projectConfiguration)) {
|
|
@@ -304,65 +364,60 @@ const determineProjectTypeFromConfig = async (tree, projectConfiguration) => {
|
|
|
304
364
|
}
|
|
305
365
|
return undefined;
|
|
306
366
|
};
|
|
307
|
-
const sourceRoot = (projectConfiguration)
|
|
308
|
-
|
|
309
|
-
const isTrpcApi = async (tree, projectConfiguration) => {
|
|
367
|
+
const sourceRoot = (projectConfiguration)=>projectConfiguration.sourceRoot ?? joinPathFragments(projectConfiguration.root, 'src');
|
|
368
|
+
const isTrpcApi = async (tree, projectConfiguration)=>{
|
|
310
369
|
// If the project.json says it's a trpc api, there's no need for introspection
|
|
311
370
|
if (projectConfiguration.metadata?.apiType === 'trpc') {
|
|
312
371
|
return true;
|
|
313
372
|
}
|
|
314
373
|
// Find the src/index.ts
|
|
315
|
-
const indexTs = tree.read(
|
|
374
|
+
const indexTs = tree.read(joinPathFragments(sourceRoot(projectConfiguration), 'index.ts'), 'utf-8');
|
|
316
375
|
if (indexTs === null) {
|
|
317
376
|
return false;
|
|
318
377
|
}
|
|
319
378
|
// If the index file exports an AppRouter, it's a trpc api
|
|
320
|
-
if (await
|
|
379
|
+
if (await hasExportDeclaration(tree, indexTs, 'AppRouter')) {
|
|
321
380
|
return true;
|
|
322
381
|
}
|
|
323
382
|
// If there's a src/router.ts or src/lambdas/router.ts which exports an AppRouter, it's a trpc api
|
|
324
|
-
const trpcRouter = tree.read((
|
|
325
|
-
tree.read((0, devkit_1.joinPathFragments)(sourceRoot(projectConfiguration), 'lambdas', 'router.ts'), 'utf-8');
|
|
383
|
+
const trpcRouter = tree.read(joinPathFragments(sourceRoot(projectConfiguration), 'router.ts'), 'utf-8') ?? tree.read(joinPathFragments(sourceRoot(projectConfiguration), 'lambdas', 'router.ts'), 'utf-8');
|
|
326
384
|
if (trpcRouter === null) {
|
|
327
385
|
return false;
|
|
328
386
|
}
|
|
329
|
-
if (await
|
|
387
|
+
if (await hasExportDeclaration(tree, trpcRouter, 'AppRouter')) {
|
|
330
388
|
return true;
|
|
331
389
|
}
|
|
332
390
|
return false;
|
|
333
391
|
};
|
|
334
|
-
const isReact = (tree, projectConfiguration)
|
|
392
|
+
const isReact = (tree, projectConfiguration)=>{
|
|
335
393
|
// if there's a main.tsx, it's a react app
|
|
336
|
-
return tree.exists(
|
|
394
|
+
return tree.exists(joinPathFragments(sourceRoot(projectConfiguration), 'main.tsx'));
|
|
337
395
|
};
|
|
338
|
-
const isFastApi = (tree, projectConfiguration)
|
|
396
|
+
const isFastApi = (tree, projectConfiguration)=>{
|
|
339
397
|
// If the project.json says it's a fast api, there's no need for introspection
|
|
340
398
|
if (projectConfiguration.metadata?.apiType === 'fast-api') {
|
|
341
399
|
return true;
|
|
342
400
|
}
|
|
343
|
-
const pyProjectPath =
|
|
401
|
+
const pyProjectPath = joinPathFragments(projectConfiguration.root, 'pyproject.toml');
|
|
344
402
|
if (tree.exists(pyProjectPath)) {
|
|
345
|
-
const pyProject =
|
|
403
|
+
const pyProject = readToml(tree, pyProjectPath);
|
|
346
404
|
if ((pyProject?.project?.dependencies ?? []).includes('fastapi')) {
|
|
347
405
|
return true;
|
|
348
406
|
}
|
|
349
407
|
}
|
|
350
408
|
return false;
|
|
351
409
|
};
|
|
352
|
-
const isSmithyApi = (_tree, projectConfiguration)
|
|
410
|
+
const isSmithyApi = (_tree, projectConfiguration)=>{
|
|
353
411
|
// Support selecting either the smithy model or backend project
|
|
354
412
|
return [
|
|
355
|
-
|
|
356
|
-
|
|
413
|
+
SMITHY_PROJECT_GENERATOR_INFO.id,
|
|
414
|
+
TS_SMITHY_API_GENERATOR_INFO.id
|
|
357
415
|
].includes((projectConfiguration.metadata ?? {}).generator);
|
|
358
416
|
};
|
|
359
|
-
const isRdb = (projectConfiguration)
|
|
360
|
-
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
const isAgentCoreGateway = (projectConfiguration) => (projectConfiguration.metadata ?? {}).generator ===
|
|
366
|
-
generator_2.AGENTCORE_GATEWAY_GENERATOR_INFO.id;
|
|
367
|
-
exports.default = exports.connectionGenerator;
|
|
417
|
+
const isRdb = (projectConfiguration)=>(projectConfiguration.metadata ?? {}).generator === TS_RDB_GENERATOR_INFO.id;
|
|
418
|
+
const isTsDynamoDB = (projectConfiguration)=>(projectConfiguration.metadata ?? {}).generator === TS_DYNAMODB_GENERATOR_INFO.id;
|
|
419
|
+
const isPyDynamoDB = (projectConfiguration)=>(projectConfiguration.metadata ?? {}).generator === PY_DYNAMODB_GENERATOR_INFO.id;
|
|
420
|
+
const isAgentCoreGateway = (projectConfiguration)=>(projectConfiguration.metadata ?? {}).generator === AGENTCORE_GATEWAY_GENERATOR_INFO.id;
|
|
421
|
+
export default connectionGenerator;
|
|
422
|
+
|
|
368
423
|
//# sourceMappingURL=generator.js.map
|