@aws/nx-plugin 1.0.0-rc.24 → 1.0.0-rc.26
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 +2020 -702
- package/package.json +6 -6
- package/src/agentcore-gateway/gateway-connection/generator.d.ts +1 -1
- package/src/agentcore-gateway/gateway-connection/generator.js +7 -5
- package/src/agentcore-gateway/gateway-connection/generator.js.map +1 -1
- package/src/agentcore-gateway/gateway-connection/schema.d.js.map +1 -1
- package/src/agentcore-gateway/gateway-connection/schema.d.ts +1 -0
- package/src/agentcore-gateway/gateway-connection/schema.json +5 -0
- package/src/agentcore-gateway/generator.js +7 -4
- package/src/agentcore-gateway/generator.js.map +1 -1
- package/src/agentcore-gateway/mcp-connection/generator.d.ts +1 -1
- package/src/agentcore-gateway/mcp-connection/generator.js +7 -5
- package/src/agentcore-gateway/mcp-connection/generator.js.map +1 -1
- package/src/agentcore-gateway/mcp-connection/schema.d.js.map +1 -1
- package/src/agentcore-gateway/mcp-connection/schema.d.ts +1 -0
- package/src/agentcore-gateway/mcp-connection/schema.json +5 -0
- package/src/agentcore-gateway/schema.d.js.map +1 -1
- package/src/agentcore-gateway/schema.d.ts +1 -0
- package/src/agentcore-gateway/schema.json +5 -0
- package/src/connection/generator.d.ts +3 -10
- package/src/connection/generator.js +18 -148
- package/src/connection/generator.js.map +1 -1
- package/src/connection/schema.d.js.map +1 -1
- package/src/connection/schema.d.ts +1 -0
- package/src/connection/schema.json +5 -0
- package/src/connection/supported-connections.d.ts +98 -0
- package/src/connection/supported-connections.js +138 -0
- package/src/connection/supported-connections.js.map +1 -0
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +29 -21
- package/src/infra/app/generator.js +12 -6
- package/src/infra/app/generator.js.map +1 -1
- package/src/infra/app/schema.d.js.map +1 -1
- package/src/infra/app/schema.d.ts +1 -1
- package/src/infra/app/schema.json +5 -0
- package/src/license/schema.d.js.map +1 -1
- package/src/license/schema.d.ts +2 -0
- package/src/license/schema.json +5 -0
- package/src/mcp-server/tools/general-guidance.js +17 -0
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/preset/generator.d.ts +1 -1
- package/src/preset/generator.js +8 -5
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.js.map +1 -1
- package/src/preset/schema.d.ts +1 -0
- package/src/preset/schema.json +5 -0
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +9 -9
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +10 -10
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +1 -1
- package/src/py/agent/a2a-connection/generator.js +7 -4
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/a2a-connection/schema.d.js.map +1 -1
- package/src/py/agent/a2a-connection/schema.d.ts +1 -0
- package/src/py/agent/a2a-connection/schema.json +5 -0
- package/src/py/agent/gateway-connection/generator.js +7 -4
- package/src/py/agent/gateway-connection/generator.js.map +1 -1
- package/src/py/agent/gateway-connection/schema.d.js.map +1 -1
- package/src/py/agent/gateway-connection/schema.d.ts +1 -0
- package/src/py/agent/gateway-connection/schema.json +5 -0
- package/src/py/agent/generator.js +8 -6
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/generator.js +7 -4
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/schema.d.js.map +1 -1
- package/src/py/agent/mcp-connection/schema.d.ts +1 -0
- package/src/py/agent/mcp-connection/schema.json +5 -0
- package/src/py/agent/react-connection/generator.d.ts +1 -1
- package/src/py/agent/react-connection/generator.js +7 -4
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/schema.d.js.map +1 -1
- package/src/py/agent/react-connection/schema.d.ts +1 -0
- package/src/py/agent/react-connection/schema.json +5 -0
- package/src/py/agent/schema.d.js.map +1 -1
- package/src/py/agent/schema.d.ts +1 -0
- package/src/py/agent/schema.json +5 -0
- package/src/py/api/generator.js +2 -1
- package/src/py/api/generator.js.map +1 -1
- package/src/py/api/schema.d.js.map +1 -1
- package/src/py/api/schema.d.ts +1 -0
- package/src/py/api/schema.json +5 -0
- package/src/py/dynamodb/agent-connection/generator.js +8 -6
- package/src/py/dynamodb/agent-connection/generator.js.map +1 -1
- package/src/py/dynamodb/agent-connection/schema.d.js.map +1 -1
- package/src/py/dynamodb/agent-connection/schema.d.ts +1 -0
- package/src/py/dynamodb/agent-connection/schema.json +5 -0
- package/src/py/dynamodb/fast-api-connection/generator.js +8 -6
- package/src/py/dynamodb/fast-api-connection/generator.js.map +1 -1
- package/src/py/dynamodb/fast-api-connection/schema.d.js.map +1 -1
- package/src/py/dynamodb/fast-api-connection/schema.d.ts +1 -0
- package/src/py/dynamodb/fast-api-connection/schema.json +5 -0
- package/src/py/dynamodb/generator.js +10 -7
- package/src/py/dynamodb/generator.js.map +1 -1
- package/src/py/dynamodb/mcp-server-connection/generator.js +8 -6
- package/src/py/dynamodb/mcp-server-connection/generator.js.map +1 -1
- package/src/py/dynamodb/mcp-server-connection/schema.d.js.map +1 -1
- package/src/py/dynamodb/mcp-server-connection/schema.d.ts +1 -0
- package/src/py/dynamodb/mcp-server-connection/schema.json +5 -0
- package/src/py/dynamodb/schema.d.js.map +1 -1
- package/src/py/dynamodb/schema.d.ts +1 -0
- package/src/py/dynamodb/schema.json +5 -0
- package/src/py/fast-api/generator.js +10 -7
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/generator.d.ts +2 -2
- package/src/py/fast-api/react/generator.js +7 -5
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/schema.d.js.map +1 -1
- package/src/py/fast-api/react/schema.d.ts +1 -0
- package/src/py/fast-api/react/schema.json +5 -0
- package/src/py/fast-api/schema.d.js.map +1 -1
- package/src/py/fast-api/schema.d.ts +1 -0
- package/src/py/fast-api/schema.json +5 -0
- package/src/py/lambda-function/generator.js +8 -6
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.js.map +1 -1
- package/src/py/lambda-function/schema.d.ts +1 -0
- package/src/py/lambda-function/schema.json +5 -0
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/mcp-server/generator.js +8 -6
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/mcp-server/schema.d.js.map +1 -1
- package/src/py/mcp-server/schema.d.ts +1 -0
- package/src/py/mcp-server/schema.json +5 -0
- package/src/py/project/generator.js +9 -6
- package/src/py/project/generator.js.map +1 -1
- package/src/py/project/schema.d.js.map +1 -1
- package/src/py/project/schema.d.ts +1 -0
- package/src/py/project/schema.json +5 -0
- package/src/sdk/open-api.d.ts +1 -1
- package/src/sdk/open-api.js +1 -1
- package/src/sdk/open-api.js.map +1 -1
- package/src/sdk/utils/ast.d.ts +1 -2
- package/src/sdk/utils/ast.js +1 -2
- package/src/sdk/utils/ast.js.map +1 -1
- package/src/smithy/project/generator.js +7 -4
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/project/schema.d.js.map +1 -1
- package/src/smithy/project/schema.d.ts +1 -0
- package/src/smithy/project/schema.json +5 -0
- package/src/smithy/react-connection/generator.js +7 -4
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/react-connection/schema.d.js.map +1 -1
- package/src/smithy/react-connection/schema.d.ts +1 -0
- package/src/smithy/react-connection/schema.json +5 -0
- package/src/smithy/ts/api/generator.js +11 -6
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/smithy/ts/api/schema.d.js.map +1 -1
- package/src/smithy/ts/api/schema.d.ts +1 -0
- package/src/smithy/ts/api/schema.json +5 -0
- package/src/terraform/project/generator.js +13 -4
- package/src/terraform/project/generator.js.map +1 -1
- package/src/terraform/project/schema.d.js.map +1 -1
- package/src/terraform/project/schema.d.ts +1 -0
- package/src/terraform/project/schema.json +5 -0
- package/src/trpc/backend/generator.d.ts +1 -1
- package/src/trpc/backend/generator.js +9 -5
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +1 -0
- package/src/trpc/backend/schema.json +5 -0
- package/src/trpc/react/generator.d.ts +1 -1
- package/src/trpc/react/generator.js +9 -5
- package/src/trpc/react/generator.js.map +1 -1
- package/src/trpc/react/schema.d.js.map +1 -1
- package/src/trpc/react/schema.d.ts +1 -0
- package/src/trpc/react/schema.json +5 -0
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/agent/a2a-connection/generator.js +7 -4
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/a2a-connection/schema.d.js.map +1 -1
- package/src/ts/agent/a2a-connection/schema.d.ts +1 -0
- package/src/ts/agent/a2a-connection/schema.json +5 -0
- package/src/ts/agent/gateway-connection/generator.js +7 -4
- package/src/ts/agent/gateway-connection/generator.js.map +1 -1
- package/src/ts/agent/gateway-connection/schema.d.js.map +1 -1
- package/src/ts/agent/gateway-connection/schema.d.ts +1 -0
- package/src/ts/agent/gateway-connection/schema.json +5 -0
- package/src/ts/agent/generator.js +7 -4
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/generator.js +7 -4
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/schema.d.js.map +1 -1
- package/src/ts/agent/mcp-connection/schema.d.ts +1 -0
- package/src/ts/agent/mcp-connection/schema.json +5 -0
- package/src/ts/agent/react-connection/generator.d.ts +1 -1
- package/src/ts/agent/react-connection/generator.js +14 -8
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/schema.d.js.map +1 -1
- package/src/ts/agent/react-connection/schema.d.ts +1 -0
- package/src/ts/agent/react-connection/schema.json +5 -0
- package/src/ts/agent/schema.d.js.map +1 -1
- package/src/ts/agent/schema.d.ts +1 -0
- package/src/ts/agent/schema.json +5 -0
- package/src/ts/api/generator.js +4 -2
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.js.map +1 -1
- package/src/ts/api/schema.d.ts +1 -0
- package/src/ts/api/schema.json +5 -0
- package/src/ts/astro-docs/generator.js +7 -6
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/astro-docs/schema.d.js.map +1 -1
- package/src/ts/astro-docs/schema.d.ts +2 -2
- package/src/ts/astro-docs/schema.json +3 -3
- package/src/ts/docs/schema.d.js.map +1 -1
- package/src/ts/docs/schema.d.ts +1 -4
- package/src/ts/docs/schema.json +3 -3
- package/src/ts/dynamodb/agent-connection/schema.d.js.map +1 -1
- package/src/ts/dynamodb/agent-connection/schema.d.ts +1 -0
- package/src/ts/dynamodb/agent-connection/schema.json +5 -0
- package/src/ts/dynamodb/generator.js +9 -5
- package/src/ts/dynamodb/generator.js.map +1 -1
- package/src/ts/dynamodb/mcp-server-connection/schema.d.js.map +1 -1
- package/src/ts/dynamodb/mcp-server-connection/schema.d.ts +1 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.json +5 -0
- package/src/ts/dynamodb/schema.d.js.map +1 -1
- package/src/ts/dynamodb/schema.d.ts +1 -0
- package/src/ts/dynamodb/schema.json +5 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.js.map +1 -1
- package/src/ts/dynamodb/smithy-connection/schema.d.ts +1 -0
- package/src/ts/dynamodb/smithy-connection/schema.json +5 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.js.map +1 -1
- package/src/ts/dynamodb/trpc-connection/schema.d.ts +1 -0
- package/src/ts/dynamodb/trpc-connection/schema.json +5 -0
- package/src/ts/lambda-function/generator.js +7 -4
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/schema.d.js.map +1 -1
- package/src/ts/lambda-function/schema.d.ts +1 -0
- package/src/ts/lambda-function/schema.json +5 -0
- package/src/ts/lib/generator.js +10 -6
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/schema.d.js.map +1 -1
- package/src/ts/lib/schema.d.ts +1 -1
- package/src/ts/lib/schema.json +5 -0
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/mcp-server/generator.js +7 -4
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/mcp-server/schema.d.js.map +1 -1
- package/src/ts/mcp-server/schema.d.ts +1 -0
- package/src/ts/mcp-server/schema.json +5 -0
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +18 -8
- package/src/ts/nx-generator/files/common/schema.d.ts.template +1 -0
- package/src/ts/nx-generator/files/common/schema.json.template +5 -0
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +3 -4
- package/src/ts/nx-generator/generator.js +7 -4
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-generator/schema.d.js.map +1 -1
- package/src/ts/nx-generator/schema.d.ts +1 -0
- package/src/ts/nx-generator/schema.json +5 -0
- package/src/ts/nx-plugin/generator.js +13 -6
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/schema.json +5 -0
- package/src/ts/rdb/agent-connection/schema.d.js.map +1 -1
- package/src/ts/rdb/agent-connection/schema.d.ts +1 -0
- package/src/ts/rdb/agent-connection/schema.json +5 -0
- package/src/ts/rdb/generator.js +9 -5
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/schema.d.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/schema.d.ts +1 -0
- package/src/ts/rdb/mcp-server-connection/schema.json +5 -0
- package/src/ts/rdb/schema.d.js.map +1 -1
- package/src/ts/rdb/schema.d.ts +1 -0
- package/src/ts/rdb/schema.json +5 -0
- package/src/ts/rdb/smithy-connection/schema.d.js.map +1 -1
- package/src/ts/rdb/smithy-connection/schema.d.ts +1 -0
- package/src/ts/rdb/smithy-connection/schema.json +5 -0
- package/src/ts/rdb/trpc-connection/schema.d.js.map +1 -1
- package/src/ts/rdb/trpc-connection/schema.d.ts +1 -0
- package/src/ts/rdb/trpc-connection/schema.json +5 -0
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +26 -26
- package/src/ts/react-website/app/generator.d.ts +1 -1
- package/src/ts/react-website/app/generator.js +18 -6
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.js.map +1 -1
- package/src/ts/react-website/app/schema.d.ts +1 -1
- package/src/ts/react-website/app/schema.json +5 -0
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +10 -7
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +1 -1
- package/src/ts/react-website/cognito-auth/generator.d.ts +1 -1
- package/src/ts/react-website/cognito-auth/generator.js +9 -5
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/schema.d.js.map +1 -1
- package/src/ts/react-website/cognito-auth/schema.d.ts +1 -0
- package/src/ts/react-website/cognito-auth/schema.json +5 -0
- package/src/ts/react-website/runtime-config/schema.d.js.map +1 -1
- package/src/ts/react-website/runtime-config/schema.d.ts +1 -0
- package/src/ts/react-website/runtime-config/schema.json +5 -0
- package/src/ts/website/app/schema.d.js.map +1 -1
- package/src/ts/website/app/schema.d.ts +1 -1
- package/src/ts/website/app/schema.json +5 -0
- package/src/ts/website/auth/generator.d.ts +1 -1
- package/src/ts/website/auth/generator.js +2 -1
- package/src/ts/website/auth/generator.js.map +1 -1
- package/src/ts/website/auth/schema.d.js.map +1 -1
- package/src/ts/website/auth/schema.d.ts +1 -0
- package/src/ts/website/auth/schema.json +5 -0
- package/src/utils/files/common/scripts/src/infra/stage-credentials/cdk-command.ts.template +11 -3
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +10 -7
- package/src/utils/install.d.ts +32 -0
- package/src/utils/install.js +56 -0
- package/src/utils/install.js.map +1 -0
- package/src/utils/versions.d.ts +64 -64
- package/src/utils/versions.js +63 -63
- package/src/utils/versions.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../packages/nx-plugin/src/connection/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n joinPathFragments,\n type ProjectConfiguration,\n type Tree,\n} from '@nx/devkit';\nimport agentcoreGatewayGatewayConnectionGenerator from '../agentcore-gateway/gateway-connection/generator';\nimport { AGENTCORE_GATEWAY_GENERATOR_INFO } from '../agentcore-gateway/generator';\nimport agentcoreGatewayMcpConnectionGenerator from '../agentcore-gateway/mcp-connection/generator';\nimport pyAgentA2aConnectionGenerator from '../py/agent/a2a-connection/generator';\nimport pyAgentGatewayConnectionGenerator from '../py/agent/gateway-connection/generator';\nimport pyAgentMcpConnectionGenerator from '../py/agent/mcp-connection/generator';\nimport pyAgentReactConnectionGenerator from '../py/agent/react-connection/generator';\nimport pyDynamoDBAgentConnectionGenerator from '../py/dynamodb/agent-connection/generator';\nimport pyDynamoDBFastApiConnectionGenerator from '../py/dynamodb/fast-api-connection/generator';\nimport { PY_DYNAMODB_GENERATOR_INFO } from '../py/dynamodb/generator';\nimport pyDynamoDBMcpServerConnectionGenerator from '../py/dynamodb/mcp-server-connection/generator';\nimport fastApiReactGenerator from '../py/fast-api/react/generator';\nimport { SMITHY_PROJECT_GENERATOR_INFO } from '../smithy/project/generator';\nimport smithyReactConnectionGenerator from '../smithy/react-connection/generator';\nimport { TS_SMITHY_API_GENERATOR_INFO } from '../smithy/ts/api/generator';\nimport trpcReactGenerator from '../trpc/react/generator';\nimport tsAgentA2aConnectionGenerator from '../ts/agent/a2a-connection/generator';\nimport tsAgentGatewayConnectionGenerator from '../ts/agent/gateway-connection/generator';\nimport tsAgentMcpConnectionGenerator from '../ts/agent/mcp-connection/generator';\nimport tsAgentReactConnectionGenerator from '../ts/agent/react-connection/generator';\nimport tsDynamoDBAgentConnectionGenerator from '../ts/dynamodb/agent-connection/generator';\nimport { TS_DYNAMODB_GENERATOR_INFO } from '../ts/dynamodb/generator';\nimport tsDynamoDBMcpServerConnectionGenerator from '../ts/dynamodb/mcp-server-connection/generator';\nimport tsDynamoDBSmithyConnectionGenerator from '../ts/dynamodb/smithy-connection/generator';\nimport tsDynamoDBTrpcConnectionGenerator from '../ts/dynamodb/trpc-connection/generator';\nimport tsRdbAgentConnectionGenerator from '../ts/rdb/agent-connection/generator';\nimport { TS_RDB_GENERATOR_INFO } from '../ts/rdb/generator';\nimport tsRdbMcpServerConnectionGenerator from '../ts/rdb/mcp-server-connection/generator';\nimport tsRdbSmithyConnectionGenerator from '../ts/rdb/smithy-connection/generator';\nimport tsRdbTrpcConnectionGenerator from '../ts/rdb/trpc-connection/generator';\nimport { hasExportDeclaration } from '../utils/ast';\nimport {\n type ComponentMetadata,\n readProjectConfigurationUnqualified,\n} from '../utils/nx';\nimport { readToml } from '../utils/toml';\nimport type { ConnectionGeneratorSchema } from './schema';\n\n/**\n * List of supported source and target project types for connections.\n * These can be project-level types (determined by introspection) or\n * component generator ids (from component metadata).\n */\nconst SUPPORTED_PROJECT_TYPES = [\n 'ts#trpc-api',\n 'py#fast-api',\n 'react',\n 'smithy',\n 'ts#rdb',\n 'ts#dynamodb',\n 'py#dynamodb',\n 'agentcore-gateway',\n] as const;\n\ntype ProjectType = (typeof SUPPORTED_PROJECT_TYPES)[number];\n\nexport type Connection = { source: string; target: string };\n\n/**\n * Sentinel value for sourceComponent/targetComponent that means\n * \"use the project-level connection, not a component\".\n */\nexport const PROJECT_COMPONENT_SENTINEL = '.';\n\n/**\n * The result of resolving a connection, including the matched connection\n * and any resolved source/target component metadata.\n */\nexport interface ResolvedConnection {\n readonly connection: Connection;\n readonly sourceComponent?: ComponentMetadata;\n readonly targetComponent?: ComponentMetadata;\n}\n\n/**\n * Enumerates the supported project connections.\n * Source and target can be project-level types or component generator ids.\n */\nconst SUPPORTED_CONNECTIONS = [\n { source: 'ts#trpc-api', target: 'ts#rdb' },\n { source: 'ts#trpc-api', target: 'ts#dynamodb' },\n { source: 'ts#agent', target: 'ts#rdb' },\n { source: 'smithy', target: 'ts#rdb' },\n { source: 'smithy', target: 'ts#dynamodb' },\n { source: 'ts#mcp-server', target: 'ts#rdb' },\n { source: 'ts#mcp-server', target: 'ts#dynamodb' },\n { source: 'react', target: 'ts#trpc-api' },\n { source: 'react', target: 'py#fast-api' },\n { source: 'react', target: 'smithy' },\n { source: 'react', target: 'ts#agent' },\n { source: 'react', target: 'py#agent' },\n { source: 'ts#agent', target: 'ts#mcp-server' },\n { source: 'ts#agent', target: 'py#mcp-server' },\n { source: 'ts#agent', target: 'ts#dynamodb' },\n { source: 'py#agent', target: 'ts#mcp-server' },\n { source: 'py#agent', target: 'py#mcp-server' },\n { source: 'ts#agent', target: 'ts#agent' },\n { source: 'ts#agent', target: 'py#agent' },\n { source: 'py#agent', target: 'ts#agent' },\n { source: 'py#agent', target: 'py#agent' },\n { source: 'ts#agent', target: 'agentcore-gateway' },\n { source: 'py#agent', target: 'agentcore-gateway' },\n { source: 'agentcore-gateway', target: 'ts#mcp-server' },\n { source: 'agentcore-gateway', target: 'py#mcp-server' },\n { source: 'agentcore-gateway', target: 'agentcore-gateway' },\n { source: 'py#fast-api', target: 'py#dynamodb' },\n { source: 'py#agent', target: 'py#dynamodb' },\n { source: 'py#mcp-server', target: 'py#dynamodb' },\n] as const satisfies readonly Connection[];\n\ntype ConnectionKey = (typeof SUPPORTED_CONNECTIONS)[number] extends infer C\n ? C extends Connection\n ? `${C['source']} -> ${C['target']}`\n : never\n : never;\n\n/**\n * Generators for each connection type\n */\n/**\n * Options passed to connection generators, including resolved component metadata.\n */\nexport interface ResolvedConnectionOptions {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: ComponentMetadata;\n targetComponent?: ComponentMetadata;\n}\n\nconst CONNECTION_GENERATORS = {\n 'ts#trpc-api -> ts#rdb': (tree, options) =>\n tsRdbTrpcConnectionGenerator(tree, options),\n 'ts#agent -> ts#rdb': (tree, options) =>\n tsRdbAgentConnectionGenerator(tree, options),\n 'smithy -> ts#rdb': (tree, options) =>\n tsRdbSmithyConnectionGenerator(tree, options),\n 'ts#mcp-server -> ts#rdb': (tree, options) =>\n tsRdbMcpServerConnectionGenerator(tree, options),\n 'ts#trpc-api -> ts#dynamodb': (tree, options) =>\n tsDynamoDBTrpcConnectionGenerator(tree, options),\n 'ts#agent -> ts#dynamodb': (tree, options) =>\n tsDynamoDBAgentConnectionGenerator(tree, options),\n 'smithy -> ts#dynamodb': (tree, options) =>\n tsDynamoDBSmithyConnectionGenerator(tree, options),\n 'ts#mcp-server -> ts#dynamodb': (tree, options) =>\n tsDynamoDBMcpServerConnectionGenerator(tree, options),\n 'react -> ts#trpc-api': (tree, options) =>\n trpcReactGenerator(tree, {\n frontendProjectName: options.sourceProject,\n backendProjectName: options.targetProject,\n }),\n 'react -> py#fast-api': (tree, options) =>\n fastApiReactGenerator(tree, {\n frontendProjectName: options.sourceProject,\n fastApiProjectName: options.targetProject,\n }),\n 'react -> smithy': (tree, options) =>\n smithyReactConnectionGenerator(tree, {\n frontendProjectName: options.sourceProject,\n smithyModelOrBackendProjectName: options.targetProject,\n }),\n 'react -> ts#agent': (tree, options) =>\n tsAgentReactConnectionGenerator(tree, options),\n 'react -> py#agent': (tree, options) =>\n pyAgentReactConnectionGenerator(tree, options),\n 'ts#agent -> ts#mcp-server': (tree, options) =>\n tsAgentMcpConnectionGenerator(tree, options),\n 'ts#agent -> py#mcp-server': (tree, options) =>\n tsAgentMcpConnectionGenerator(tree, options),\n 'py#agent -> ts#mcp-server': (tree, options) =>\n pyAgentMcpConnectionGenerator(tree, options),\n 'py#agent -> py#mcp-server': (tree, options) =>\n pyAgentMcpConnectionGenerator(tree, options),\n 'ts#agent -> ts#agent': (tree, options) =>\n tsAgentA2aConnectionGenerator(tree, options),\n 'ts#agent -> py#agent': (tree, options) =>\n tsAgentA2aConnectionGenerator(tree, options),\n 'py#agent -> ts#agent': (tree, options) =>\n pyAgentA2aConnectionGenerator(tree, options),\n 'py#agent -> py#agent': (tree, options) =>\n pyAgentA2aConnectionGenerator(tree, options),\n 'ts#agent -> agentcore-gateway': (tree, options) =>\n tsAgentGatewayConnectionGenerator(tree, options),\n 'py#agent -> agentcore-gateway': (tree, options) =>\n pyAgentGatewayConnectionGenerator(tree, options),\n 'agentcore-gateway -> ts#mcp-server': (tree, options) =>\n agentcoreGatewayMcpConnectionGenerator(tree, options),\n 'agentcore-gateway -> py#mcp-server': (tree, options) =>\n agentcoreGatewayMcpConnectionGenerator(tree, options),\n 'agentcore-gateway -> agentcore-gateway': (tree, options) =>\n agentcoreGatewayGatewayConnectionGenerator(tree, options),\n 'py#fast-api -> py#dynamodb': (tree, options) =>\n pyDynamoDBFastApiConnectionGenerator(tree, options),\n 'py#agent -> py#dynamodb': (tree, options) =>\n pyDynamoDBAgentConnectionGenerator(tree, options),\n 'py#mcp-server -> py#dynamodb': (tree, options) =>\n pyDynamoDBMcpServerConnectionGenerator(tree, options),\n} satisfies Record<\n ConnectionKey,\n (tree: Tree, options: ResolvedConnectionOptions) => Promise<any>\n>;\n\n/**\n * Generator for a connection between two projects\n */\nexport const connectionGenerator = async (\n tree: Tree,\n options: ConnectionGeneratorSchema,\n) => {\n const resolved = await resolveConnection(tree, options);\n\n const connectionKey =\n `${resolved.connection.source} -> ${resolved.connection.target}` as ConnectionKey;\n\n return await CONNECTION_GENERATORS[connectionKey](tree, {\n sourceProject: options.sourceProject,\n targetProject: options.targetProject,\n sourceComponent: resolved.sourceComponent,\n targetComponent: resolved.targetComponent,\n });\n};\n\n/**\n * Find a component in project metadata matching the given reference.\n * Checks by name first, then by path, then by generator.\n */\nexport const findComponentInMetadata = (\n projectConfiguration: ProjectConfiguration,\n componentRef: string,\n): ComponentMetadata | undefined => {\n const components: ComponentMetadata[] =\n (projectConfiguration.metadata as any)?.components ?? [];\n\n return (\n components.find((c) => c.name === componentRef) ??\n components.find((c) => c.path === componentRef) ??\n components.find((c) => c.generator === componentRef)\n );\n};\n\n/**\n * Represents a candidate source or target for a connection, which may be\n * the project itself or a specific component within the project.\n */\ninterface ConnectionCandidate {\n readonly type: string;\n readonly component?: ComponentMetadata;\n}\n\n/**\n * A matched connection between source and target candidates.\n */\ninterface ConnectionMatch {\n readonly connection: Connection;\n readonly sourceComponent?: ComponentMetadata;\n readonly targetComponent?: ComponentMetadata;\n}\n\n/**\n * Gather all connection candidates for a project configuration. This includes:\n * - The project-level type (if it's a supported type)\n * - Each component's generator id as a candidate type\n */\nconst gatherCandidates = async (\n tree: Tree,\n projectConfig: ProjectConfiguration,\n): Promise<ConnectionCandidate[]> => {\n const type = await determineProjectTypeFromConfig(tree, projectConfig);\n const components: ComponentMetadata[] =\n (projectConfig.metadata as any)?.components ?? [];\n\n return [\n ...(type ? [{ type: type }] : []),\n ...components.map((component) => ({\n type: component.generator,\n component,\n })),\n ];\n};\n\n/**\n * Validate that a specified component exists in the project metadata.\n * Skips validation for undefined refs and the project sentinel '.'.\n */\nconst validateComponent = (\n componentRef: string | undefined,\n projectConfig: ProjectConfiguration,\n side: 'source' | 'target',\n) => {\n if (!componentRef || componentRef === PROJECT_COMPONENT_SENTINEL) return;\n const found = findComponentInMetadata(projectConfig, componentRef);\n if (!found) {\n const components: ComponentMetadata[] =\n (projectConfig.metadata as any)?.components ?? [];\n throw new Error(\n `Component '${componentRef}' not found in ${side} project ${projectConfig.name}. ` +\n `Available components: ${components.length > 0 ? components.map((c) => c.name ?? c.generator).join(', ') : 'none'}`,\n );\n }\n};\n\n/**\n * Narrow candidates based on the user's specified component reference.\n */\nconst filterConnectionCandidatesForComponentReference = (\n componentRef: string | undefined,\n projectConfig: ProjectConfiguration,\n candidates: ConnectionCandidate[],\n supportedConnections: readonly Connection[],\n side: 'source' | 'target',\n): ConnectionCandidate[] => {\n if (!componentRef) return candidates;\n if (componentRef === PROJECT_COMPONENT_SENTINEL) {\n return candidates.filter((c) => !c.component);\n }\n const component = findComponentInMetadata(projectConfig, componentRef);\n if (!component) return candidates;\n const isConnectionParticipant = supportedConnections.some(\n (c) => c[side] === component.generator,\n );\n if (!isConnectionParticipant) return candidates;\n // Filter to the specific matched component, not all components with the same generator\n return candidates.filter((c) => c.component === component);\n};\n\n/**\n * Resolve the connection to use, considering source/target projects and components.\n */\nexport const resolveConnection = async (\n tree: Tree,\n options: ConnectionGeneratorSchema,\n supportedConnections: readonly Connection[] = SUPPORTED_CONNECTIONS,\n): Promise<ResolvedConnection> => {\n const sourceConfig = readProjectConfigurationUnqualified(\n tree,\n options.sourceProject,\n );\n const targetConfig = readProjectConfigurationUnqualified(\n tree,\n options.targetProject,\n );\n\n // Validate explicitly specified components exist\n validateComponent(options.sourceComponent, sourceConfig, 'source');\n validateComponent(options.targetComponent, targetConfig, 'target');\n\n // Gather and narrow candidates\n const sourceCandidates = filterConnectionCandidatesForComponentReference(\n options.sourceComponent,\n sourceConfig,\n await gatherCandidates(tree, sourceConfig),\n supportedConnections,\n 'source',\n );\n const targetCandidates = filterConnectionCandidatesForComponentReference(\n options.targetComponent,\n targetConfig,\n await gatherCandidates(tree, targetConfig),\n supportedConnections,\n 'target',\n );\n\n // Cross-product candidates and find supported connections\n const matches: ConnectionMatch[] = [];\n for (const source of sourceCandidates) {\n for (const target of targetCandidates) {\n const match = supportedConnections.find(\n (c) => c.source === source.type && c.target === target.type,\n );\n if (match) {\n matches.push({\n connection: match,\n sourceComponent: source.component,\n targetComponent: target.component,\n });\n }\n }\n }\n\n if (matches.length === 0) {\n const sourceTypes = [...new Set(sourceCandidates.map((c) => c.type))];\n const targetTypes = [...new Set(targetCandidates.map((c) => c.type))];\n throw new Error(\n `This generator does not support a connection from ${options.sourceProject}${sourceTypes.length > 0 ? ` (${sourceTypes.join(', ')})` : ''} to ${options.targetProject}${targetTypes.length > 0 ? ` (${targetTypes.join(', ')})` : ''}`,\n );\n }\n\n if (matches.length > 1) {\n const connectionDescriptions = matches\n .map((m) => {\n const sourceName = m.sourceComponent?.name;\n const targetName = m.targetComponent?.name;\n const sourceLabel = sourceName\n ? `${sourceName} (${m.connection.source})`\n : m.connection.source;\n const targetLabel = targetName\n ? `${targetName} (${m.connection.target})`\n : m.connection.target;\n return `${sourceLabel} -> ${targetLabel}`;\n })\n .join(', ');\n throw new Error(\n `Ambiguous connection from ${options.sourceProject} to ${options.targetProject}. ` +\n `Multiple supported connections found: ${connectionDescriptions}. ` +\n `Please specify sourceComponent and/or targetComponent to disambiguate.`,\n );\n }\n\n return {\n connection: matches[0].connection,\n sourceComponent: matches[0].sourceComponent,\n targetComponent: matches[0].targetComponent,\n };\n};\n\n/**\n * Determine whether the given project is of a known project type\n */\nexport const determineProjectType = async (\n tree: Tree,\n projectName: string,\n): Promise<ProjectType | undefined> => {\n const projectConfiguration = readProjectConfigurationUnqualified(\n tree,\n projectName,\n );\n return await determineProjectTypeFromConfig(tree, projectConfiguration);\n};\n\n/**\n * Determine whether the given project configuration is of a known project type\n */\nconst determineProjectTypeFromConfig = async (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): Promise<ProjectType | undefined> => {\n // NB: if adding new checks, ensure these go from most to least specific\n // eg. react website is more specific than typescript project\n\n if (await isTrpcApi(tree, projectConfiguration)) {\n return 'ts#trpc-api';\n }\n\n if (isFastApi(tree, projectConfiguration)) {\n return 'py#fast-api';\n }\n\n if (isSmithyApi(tree, projectConfiguration)) {\n return 'smithy';\n }\n\n if (isReact(tree, projectConfiguration)) {\n return 'react';\n }\n\n if (isRdb(projectConfiguration)) {\n return 'ts#rdb';\n }\n\n if (isTsDynamoDB(projectConfiguration)) {\n return 'ts#dynamodb';\n }\n\n if (isPyDynamoDB(projectConfiguration)) {\n return 'py#dynamodb';\n }\n\n if (isAgentCoreGateway(projectConfiguration)) {\n return 'agentcore-gateway';\n }\n\n return undefined;\n};\n\nconst sourceRoot = (projectConfiguration: ProjectConfiguration) =>\n projectConfiguration.sourceRoot ??\n joinPathFragments(projectConfiguration.root, 'src');\n\nconst isTrpcApi = async (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): Promise<boolean> => {\n // If the project.json says it's a trpc api, there's no need for introspection\n if ((projectConfiguration.metadata as any)?.apiType === 'trpc') {\n return true;\n }\n\n // Find the src/index.ts\n const indexTs = tree.read(\n joinPathFragments(sourceRoot(projectConfiguration), 'index.ts'),\n 'utf-8',\n );\n if (indexTs === null) {\n return false;\n }\n\n // If the index file exports an AppRouter, it's a trpc api\n if (await hasExportDeclaration(tree, indexTs, 'AppRouter')) {\n return true;\n }\n\n // If there's a src/router.ts or src/lambdas/router.ts which exports an AppRouter, it's a trpc api\n const trpcRouter =\n tree.read(\n joinPathFragments(sourceRoot(projectConfiguration), 'router.ts'),\n 'utf-8',\n ) ??\n tree.read(\n joinPathFragments(\n sourceRoot(projectConfiguration),\n 'lambdas',\n 'router.ts',\n ),\n 'utf-8',\n );\n\n if (trpcRouter === null) {\n return false;\n }\n\n if (await hasExportDeclaration(tree, trpcRouter, 'AppRouter')) {\n return true;\n }\n\n return false;\n};\n\nconst isReact = (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // if there's a main.tsx, it's a react app\n return tree.exists(\n joinPathFragments(sourceRoot(projectConfiguration), 'main.tsx'),\n );\n};\n\nconst isFastApi = (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // If the project.json says it's a fast api, there's no need for introspection\n if ((projectConfiguration.metadata as any)?.apiType === 'fast-api') {\n return true;\n }\n\n const pyProjectPath = joinPathFragments(\n projectConfiguration.root,\n 'pyproject.toml',\n );\n if (tree.exists(pyProjectPath)) {\n const pyProject = readToml(tree, pyProjectPath);\n if (((pyProject as any)?.project?.dependencies ?? []).includes('fastapi')) {\n return true;\n }\n }\n\n return false;\n};\n\nconst isSmithyApi = (\n _tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // Support selecting either the smithy model or backend project\n return [\n SMITHY_PROJECT_GENERATOR_INFO.id,\n TS_SMITHY_API_GENERATOR_INFO.id,\n ].includes(((projectConfiguration.metadata as any) ?? {}).generator);\n};\n\nconst isRdb = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n TS_RDB_GENERATOR_INFO.id;\n\nconst isTsDynamoDB = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n TS_DYNAMODB_GENERATOR_INFO.id;\n\nconst isPyDynamoDB = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n PY_DYNAMODB_GENERATOR_INFO.id;\n\nconst isAgentCoreGateway = (\n projectConfiguration: ProjectConfiguration,\n): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n AGENTCORE_GATEWAY_GENERATOR_INFO.id;\n\nexport default connectionGenerator;\n"],"names":["joinPathFragments","agentcoreGatewayGatewayConnectionGenerator","AGENTCORE_GATEWAY_GENERATOR_INFO","agentcoreGatewayMcpConnectionGenerator","pyAgentA2aConnectionGenerator","pyAgentGatewayConnectionGenerator","pyAgentMcpConnectionGenerator","pyAgentReactConnectionGenerator","pyDynamoDBAgentConnectionGenerator","pyDynamoDBFastApiConnectionGenerator","PY_DYNAMODB_GENERATOR_INFO","pyDynamoDBMcpServerConnectionGenerator","fastApiReactGenerator","SMITHY_PROJECT_GENERATOR_INFO","smithyReactConnectionGenerator","TS_SMITHY_API_GENERATOR_INFO","trpcReactGenerator","tsAgentA2aConnectionGenerator","tsAgentGatewayConnectionGenerator","tsAgentMcpConnectionGenerator","tsAgentReactConnectionGenerator","tsDynamoDBAgentConnectionGenerator","TS_DYNAMODB_GENERATOR_INFO","tsDynamoDBMcpServerConnectionGenerator","tsDynamoDBSmithyConnectionGenerator","tsDynamoDBTrpcConnectionGenerator","tsRdbAgentConnectionGenerator","TS_RDB_GENERATOR_INFO","tsRdbMcpServerConnectionGenerator","tsRdbSmithyConnectionGenerator","tsRdbTrpcConnectionGenerator","hasExportDeclaration","readProjectConfigurationUnqualified","readToml","SUPPORTED_PROJECT_TYPES","PROJECT_COMPONENT_SENTINEL","SUPPORTED_CONNECTIONS","source","target","CONNECTION_GENERATORS","tree","options","frontendProjectName","sourceProject","backendProjectName","targetProject","fastApiProjectName","smithyModelOrBackendProjectName","connectionGenerator","resolved","resolveConnection","connectionKey","connection","sourceComponent","targetComponent","findComponentInMetadata","projectConfiguration","componentRef","components","metadata","find","c","name","path","generator","gatherCandidates","projectConfig","type","determineProjectTypeFromConfig","map","component","validateComponent","side","found","Error","length","join","filterConnectionCandidatesForComponentReference","candidates","supportedConnections","filter","isConnectionParticipant","some","sourceConfig","targetConfig","sourceCandidates","targetCandidates","matches","match","push","sourceTypes","Set","targetTypes","connectionDescriptions","m","sourceName","targetName","sourceLabel","targetLabel","determineProjectType","projectName","isTrpcApi","isFastApi","isSmithyApi","isReact","isRdb","isTsDynamoDB","isPyDynamoDB","isAgentCoreGateway","undefined","sourceRoot","root","apiType","indexTs","read","trpcRouter","exists","pyProjectPath","pyProject","project","dependencies","includes","_tree","id"],"mappings":"AAAA;;;CAGC,GACD,SACEA,iBAAiB,QAGZ,aAAa;AACpB,OAAOC,gDAAgD,uDAAoD;AAC3G,SAASC,gCAAgC,QAAQ,oCAAiC;AAClF,OAAOC,4CAA4C,mDAAgD;AACnG,OAAOC,mCAAmC,0CAAuC;AACjF,OAAOC,uCAAuC,8CAA2C;AACzF,OAAOC,mCAAmC,0CAAuC;AACjF,OAAOC,qCAAqC,4CAAyC;AACrF,OAAOC,wCAAwC,+CAA4C;AAC3F,OAAOC,0CAA0C,kDAA+C;AAChG,SAASC,0BAA0B,QAAQ,8BAA2B;AACtE,OAAOC,4CAA4C,oDAAiD;AACpG,OAAOC,2BAA2B,oCAAiC;AACnE,SAASC,6BAA6B,QAAQ,iCAA8B;AAC5E,OAAOC,oCAAoC,0CAAuC;AAClF,SAASC,4BAA4B,QAAQ,gCAA6B;AAC1E,OAAOC,wBAAwB,6BAA0B;AACzD,OAAOC,mCAAmC,0CAAuC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QACjC,IAAI,AAAC,CAAA,AAACC,WAAmBC,SAASC,gBAAgB,EAAE,AAAD,EAAGC,QAAQ,CAAC,YAAY;YACzE,OAAO;QACT;IACF;IAEA,OAAO;AACT;AAEA,MAAMlB,cAAc,CAClBmB,OACAlE;IAEA,+DAA+D;IAC/D,OAAO;QACL3C,8BAA8B8G,EAAE;QAChC5G,6BAA6B4G,EAAE;KAChC,CAACF,QAAQ,CAAC,AAAC,CAAA,AAACjE,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS;AACrE;AAEA,MAAMyC,QAAQ,CAACjD,uBACb,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxDrC,sBAAsBgG,EAAE;AAE1B,MAAMjB,eAAe,CAAClD,uBACpB,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxD1C,2BAA2BqG,EAAE;AAE/B,MAAMhB,eAAe,CAACnD,uBACpB,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxDtD,2BAA2BiH,EAAE;AAE/B,MAAMf,qBAAqB,CACzBpD,uBAEA,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxD9D,iCAAiCyH,EAAE;AAErC,eAAe3E,oBAAoB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/nx-plugin/src/connection/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n joinPathFragments,\n type ProjectConfiguration,\n type Tree,\n} from '@nx/devkit';\nimport agentcoreGatewayGatewayConnectionGenerator from '../agentcore-gateway/gateway-connection/generator';\nimport { AGENTCORE_GATEWAY_GENERATOR_INFO } from '../agentcore-gateway/generator';\nimport agentcoreGatewayMcpConnectionGenerator from '../agentcore-gateway/mcp-connection/generator';\nimport pyAgentA2aConnectionGenerator from '../py/agent/a2a-connection/generator';\nimport pyAgentGatewayConnectionGenerator from '../py/agent/gateway-connection/generator';\nimport pyAgentMcpConnectionGenerator from '../py/agent/mcp-connection/generator';\nimport pyAgentReactConnectionGenerator from '../py/agent/react-connection/generator';\nimport pyDynamoDBAgentConnectionGenerator from '../py/dynamodb/agent-connection/generator';\nimport pyDynamoDBFastApiConnectionGenerator from '../py/dynamodb/fast-api-connection/generator';\nimport { PY_DYNAMODB_GENERATOR_INFO } from '../py/dynamodb/generator';\nimport pyDynamoDBMcpServerConnectionGenerator from '../py/dynamodb/mcp-server-connection/generator';\nimport fastApiReactGenerator from '../py/fast-api/react/generator';\nimport { SMITHY_PROJECT_GENERATOR_INFO } from '../smithy/project/generator';\nimport smithyReactConnectionGenerator from '../smithy/react-connection/generator';\nimport { TS_SMITHY_API_GENERATOR_INFO } from '../smithy/ts/api/generator';\nimport trpcReactGenerator from '../trpc/react/generator';\nimport tsAgentA2aConnectionGenerator from '../ts/agent/a2a-connection/generator';\nimport tsAgentGatewayConnectionGenerator from '../ts/agent/gateway-connection/generator';\nimport tsAgentMcpConnectionGenerator from '../ts/agent/mcp-connection/generator';\nimport tsAgentReactConnectionGenerator from '../ts/agent/react-connection/generator';\nimport tsDynamoDBAgentConnectionGenerator from '../ts/dynamodb/agent-connection/generator';\nimport { TS_DYNAMODB_GENERATOR_INFO } from '../ts/dynamodb/generator';\nimport tsDynamoDBMcpServerConnectionGenerator from '../ts/dynamodb/mcp-server-connection/generator';\nimport tsDynamoDBSmithyConnectionGenerator from '../ts/dynamodb/smithy-connection/generator';\nimport tsDynamoDBTrpcConnectionGenerator from '../ts/dynamodb/trpc-connection/generator';\nimport tsRdbAgentConnectionGenerator from '../ts/rdb/agent-connection/generator';\nimport { TS_RDB_GENERATOR_INFO } from '../ts/rdb/generator';\nimport tsRdbMcpServerConnectionGenerator from '../ts/rdb/mcp-server-connection/generator';\nimport tsRdbSmithyConnectionGenerator from '../ts/rdb/smithy-connection/generator';\nimport tsRdbTrpcConnectionGenerator from '../ts/rdb/trpc-connection/generator';\nimport { hasExportDeclaration } from '../utils/ast';\nimport {\n type ComponentMetadata,\n readProjectConfigurationUnqualified,\n} from '../utils/nx';\nimport { readToml } from '../utils/toml';\nimport type { ConnectionGeneratorSchema } from './schema';\nimport {\n type Connection,\n type ConnectionKey,\n SUPPORTED_CONNECTIONS,\n type SUPPORTED_PROJECT_TYPES,\n} from './supported-connections';\n\nexport type { Connection };\n\ntype ProjectType = (typeof SUPPORTED_PROJECT_TYPES)[number];\n\n/**\n * Sentinel value for sourceComponent/targetComponent that means\n * \"use the project-level connection, not a component\".\n */\nexport const PROJECT_COMPONENT_SENTINEL = '.';\n\n/**\n * The result of resolving a connection, including the matched connection\n * and any resolved source/target component metadata.\n */\nexport interface ResolvedConnection {\n readonly connection: Connection;\n readonly sourceComponent?: ComponentMetadata;\n readonly targetComponent?: ComponentMetadata;\n}\n\n/**\n * Generators for each connection type\n */\n/**\n * Options passed to connection generators, including resolved component metadata.\n */\nexport interface ResolvedConnectionOptions {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: ComponentMetadata;\n targetComponent?: ComponentMetadata;\n preferInstallDependencies?: boolean;\n}\n\nconst CONNECTION_GENERATORS = {\n 'ts#trpc-api -> ts#rdb': (tree, options) =>\n tsRdbTrpcConnectionGenerator(tree, options),\n 'ts#agent -> ts#rdb': (tree, options) =>\n tsRdbAgentConnectionGenerator(tree, options),\n 'ts#smithy-api -> ts#rdb': (tree, options) =>\n tsRdbSmithyConnectionGenerator(tree, options),\n 'ts#mcp-server -> ts#rdb': (tree, options) =>\n tsRdbMcpServerConnectionGenerator(tree, options),\n 'ts#trpc-api -> ts#dynamodb': (tree, options) =>\n tsDynamoDBTrpcConnectionGenerator(tree, options),\n 'ts#agent -> ts#dynamodb': (tree, options) =>\n tsDynamoDBAgentConnectionGenerator(tree, options),\n 'ts#smithy-api -> ts#dynamodb': (tree, options) =>\n tsDynamoDBSmithyConnectionGenerator(tree, options),\n 'ts#mcp-server -> ts#dynamodb': (tree, options) =>\n tsDynamoDBMcpServerConnectionGenerator(tree, options),\n 'ts#react-website -> ts#trpc-api': (tree, options) =>\n trpcReactGenerator(tree, {\n frontendProjectName: options.sourceProject,\n backendProjectName: options.targetProject,\n preferInstallDependencies: options.preferInstallDependencies,\n }),\n 'ts#react-website -> py#fast-api': (tree, options) =>\n fastApiReactGenerator(tree, {\n frontendProjectName: options.sourceProject,\n fastApiProjectName: options.targetProject,\n preferInstallDependencies: options.preferInstallDependencies,\n }),\n 'ts#react-website -> ts#smithy-api': (tree, options) =>\n smithyReactConnectionGenerator(tree, {\n frontendProjectName: options.sourceProject,\n smithyModelOrBackendProjectName: options.targetProject,\n preferInstallDependencies: options.preferInstallDependencies,\n }),\n 'ts#react-website -> ts#agent': (tree, options) =>\n tsAgentReactConnectionGenerator(tree, options),\n 'ts#react-website -> py#agent': (tree, options) =>\n pyAgentReactConnectionGenerator(tree, options),\n 'ts#agent -> ts#mcp-server': (tree, options) =>\n tsAgentMcpConnectionGenerator(tree, options),\n 'ts#agent -> py#mcp-server': (tree, options) =>\n tsAgentMcpConnectionGenerator(tree, options),\n 'py#agent -> ts#mcp-server': (tree, options) =>\n pyAgentMcpConnectionGenerator(tree, options),\n 'py#agent -> py#mcp-server': (tree, options) =>\n pyAgentMcpConnectionGenerator(tree, options),\n 'ts#agent -> ts#agent': (tree, options) =>\n tsAgentA2aConnectionGenerator(tree, options),\n 'ts#agent -> py#agent': (tree, options) =>\n tsAgentA2aConnectionGenerator(tree, options),\n 'py#agent -> ts#agent': (tree, options) =>\n pyAgentA2aConnectionGenerator(tree, options),\n 'py#agent -> py#agent': (tree, options) =>\n pyAgentA2aConnectionGenerator(tree, options),\n 'ts#agent -> agentcore-gateway': (tree, options) =>\n tsAgentGatewayConnectionGenerator(tree, options),\n 'py#agent -> agentcore-gateway': (tree, options) =>\n pyAgentGatewayConnectionGenerator(tree, options),\n 'agentcore-gateway -> ts#mcp-server': (tree, options) =>\n agentcoreGatewayMcpConnectionGenerator(tree, options),\n 'agentcore-gateway -> py#mcp-server': (tree, options) =>\n agentcoreGatewayMcpConnectionGenerator(tree, options),\n 'agentcore-gateway -> agentcore-gateway': (tree, options) =>\n agentcoreGatewayGatewayConnectionGenerator(tree, options),\n 'py#fast-api -> py#dynamodb': (tree, options) =>\n pyDynamoDBFastApiConnectionGenerator(tree, options),\n 'py#agent -> py#dynamodb': (tree, options) =>\n pyDynamoDBAgentConnectionGenerator(tree, options),\n 'py#mcp-server -> py#dynamodb': (tree, options) =>\n pyDynamoDBMcpServerConnectionGenerator(tree, options),\n} satisfies Record<\n ConnectionKey,\n (tree: Tree, options: ResolvedConnectionOptions) => Promise<any>\n>;\n\n/**\n * Generator for a connection between two projects\n */\nexport const connectionGenerator = async (\n tree: Tree,\n options: ConnectionGeneratorSchema,\n) => {\n const resolved = await resolveConnection(tree, options);\n\n const connectionKey =\n `${resolved.connection.source} -> ${resolved.connection.target}` as ConnectionKey;\n\n return await CONNECTION_GENERATORS[connectionKey](tree, {\n sourceProject: options.sourceProject,\n targetProject: options.targetProject,\n sourceComponent: resolved.sourceComponent,\n targetComponent: resolved.targetComponent,\n preferInstallDependencies: options.preferInstallDependencies,\n });\n};\n\n/**\n * Find a component in project metadata matching the given reference.\n * Checks by name first, then by path, then by generator.\n */\nexport const findComponentInMetadata = (\n projectConfiguration: ProjectConfiguration,\n componentRef: string,\n): ComponentMetadata | undefined => {\n const components: ComponentMetadata[] =\n (projectConfiguration.metadata as any)?.components ?? [];\n\n return (\n components.find((c) => c.name === componentRef) ??\n components.find((c) => c.path === componentRef) ??\n components.find((c) => c.generator === componentRef)\n );\n};\n\n/**\n * Represents a candidate source or target for a connection, which may be\n * the project itself or a specific component within the project.\n */\ninterface ConnectionCandidate {\n readonly type: string;\n readonly component?: ComponentMetadata;\n}\n\n/**\n * A matched connection between source and target candidates.\n */\ninterface ConnectionMatch {\n readonly connection: Connection;\n readonly sourceComponent?: ComponentMetadata;\n readonly targetComponent?: ComponentMetadata;\n}\n\n/**\n * Gather all connection candidates for a project configuration. This includes:\n * - The project-level type (if it's a supported type)\n * - Each component's generator id as a candidate type\n */\nconst gatherCandidates = async (\n tree: Tree,\n projectConfig: ProjectConfiguration,\n): Promise<ConnectionCandidate[]> => {\n const type = await determineProjectTypeFromConfig(tree, projectConfig);\n const components: ComponentMetadata[] =\n (projectConfig.metadata as any)?.components ?? [];\n\n return [\n ...(type ? [{ type: type }] : []),\n ...components.map((component) => ({\n type: component.generator,\n component,\n })),\n ];\n};\n\n/**\n * Validate that a specified component exists in the project metadata.\n * Skips validation for undefined refs and the project sentinel '.'.\n */\nconst validateComponent = (\n componentRef: string | undefined,\n projectConfig: ProjectConfiguration,\n side: 'source' | 'target',\n) => {\n if (!componentRef || componentRef === PROJECT_COMPONENT_SENTINEL) return;\n const found = findComponentInMetadata(projectConfig, componentRef);\n if (!found) {\n const components: ComponentMetadata[] =\n (projectConfig.metadata as any)?.components ?? [];\n throw new Error(\n `Component '${componentRef}' not found in ${side} project ${projectConfig.name}. ` +\n `Available components: ${components.length > 0 ? components.map((c) => c.name ?? c.generator).join(', ') : 'none'}`,\n );\n }\n};\n\n/**\n * Narrow candidates based on the user's specified component reference.\n */\nconst filterConnectionCandidatesForComponentReference = (\n componentRef: string | undefined,\n projectConfig: ProjectConfiguration,\n candidates: ConnectionCandidate[],\n supportedConnections: readonly Connection[],\n side: 'source' | 'target',\n): ConnectionCandidate[] => {\n if (!componentRef) return candidates;\n if (componentRef === PROJECT_COMPONENT_SENTINEL) {\n return candidates.filter((c) => !c.component);\n }\n const component = findComponentInMetadata(projectConfig, componentRef);\n if (!component) return candidates;\n const isConnectionParticipant = supportedConnections.some(\n (c) => c[side] === component.generator,\n );\n if (!isConnectionParticipant) return candidates;\n // Filter to the specific matched component, not all components with the same generator\n return candidates.filter((c) => c.component === component);\n};\n\n/**\n * Resolve the connection to use, considering source/target projects and components.\n */\nexport const resolveConnection = async (\n tree: Tree,\n options: ConnectionGeneratorSchema,\n supportedConnections: readonly Connection[] = SUPPORTED_CONNECTIONS,\n): Promise<ResolvedConnection> => {\n const sourceConfig = readProjectConfigurationUnqualified(\n tree,\n options.sourceProject,\n );\n const targetConfig = readProjectConfigurationUnqualified(\n tree,\n options.targetProject,\n );\n\n // Validate explicitly specified components exist\n validateComponent(options.sourceComponent, sourceConfig, 'source');\n validateComponent(options.targetComponent, targetConfig, 'target');\n\n // Gather and narrow candidates\n const sourceCandidates = filterConnectionCandidatesForComponentReference(\n options.sourceComponent,\n sourceConfig,\n await gatherCandidates(tree, sourceConfig),\n supportedConnections,\n 'source',\n );\n const targetCandidates = filterConnectionCandidatesForComponentReference(\n options.targetComponent,\n targetConfig,\n await gatherCandidates(tree, targetConfig),\n supportedConnections,\n 'target',\n );\n\n // Cross-product candidates and find supported connections\n const matches: ConnectionMatch[] = [];\n for (const source of sourceCandidates) {\n for (const target of targetCandidates) {\n const match = supportedConnections.find(\n (c) => c.source === source.type && c.target === target.type,\n );\n if (match) {\n matches.push({\n connection: match,\n sourceComponent: source.component,\n targetComponent: target.component,\n });\n }\n }\n }\n\n if (matches.length === 0) {\n const sourceTypes = [...new Set(sourceCandidates.map((c) => c.type))];\n const targetTypes = [...new Set(targetCandidates.map((c) => c.type))];\n throw new Error(\n `This generator does not support a connection from ${options.sourceProject}${sourceTypes.length > 0 ? ` (${sourceTypes.join(', ')})` : ''} to ${options.targetProject}${targetTypes.length > 0 ? ` (${targetTypes.join(', ')})` : ''}`,\n );\n }\n\n if (matches.length > 1) {\n const connectionDescriptions = matches\n .map((m) => {\n const sourceName = m.sourceComponent?.name;\n const targetName = m.targetComponent?.name;\n const sourceLabel = sourceName\n ? `${sourceName} (${m.connection.source})`\n : m.connection.source;\n const targetLabel = targetName\n ? `${targetName} (${m.connection.target})`\n : m.connection.target;\n return `${sourceLabel} -> ${targetLabel}`;\n })\n .join(', ');\n throw new Error(\n `Ambiguous connection from ${options.sourceProject} to ${options.targetProject}. ` +\n `Multiple supported connections found: ${connectionDescriptions}. ` +\n `Please specify sourceComponent and/or targetComponent to disambiguate.`,\n );\n }\n\n return {\n connection: matches[0].connection,\n sourceComponent: matches[0].sourceComponent,\n targetComponent: matches[0].targetComponent,\n };\n};\n\n/**\n * Determine whether the given project is of a known project type\n */\nexport const determineProjectType = async (\n tree: Tree,\n projectName: string,\n): Promise<ProjectType | undefined> => {\n const projectConfiguration = readProjectConfigurationUnqualified(\n tree,\n projectName,\n );\n return await determineProjectTypeFromConfig(tree, projectConfiguration);\n};\n\n/**\n * Determine whether the given project configuration is of a known project type\n */\nconst determineProjectTypeFromConfig = async (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): Promise<ProjectType | undefined> => {\n // NB: if adding new checks, ensure these go from most to least specific\n // eg. react website is more specific than typescript project\n\n if (await isTrpcApi(tree, projectConfiguration)) {\n return 'ts#trpc-api';\n }\n\n if (isFastApi(tree, projectConfiguration)) {\n return 'py#fast-api';\n }\n\n if (isSmithyApi(tree, projectConfiguration)) {\n return 'ts#smithy-api';\n }\n\n if (isReact(tree, projectConfiguration)) {\n return 'ts#react-website';\n }\n\n if (isRdb(projectConfiguration)) {\n return 'ts#rdb';\n }\n\n if (isTsDynamoDB(projectConfiguration)) {\n return 'ts#dynamodb';\n }\n\n if (isPyDynamoDB(projectConfiguration)) {\n return 'py#dynamodb';\n }\n\n if (isAgentCoreGateway(projectConfiguration)) {\n return 'agentcore-gateway';\n }\n\n return undefined;\n};\n\nconst sourceRoot = (projectConfiguration: ProjectConfiguration) =>\n projectConfiguration.sourceRoot ??\n joinPathFragments(projectConfiguration.root, 'src');\n\nconst isTrpcApi = async (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): Promise<boolean> => {\n // If the project.json says it's a trpc api, there's no need for introspection\n if ((projectConfiguration.metadata as any)?.apiType === 'trpc') {\n return true;\n }\n\n // Find the src/index.ts\n const indexTs = tree.read(\n joinPathFragments(sourceRoot(projectConfiguration), 'index.ts'),\n 'utf-8',\n );\n if (indexTs === null) {\n return false;\n }\n\n // If the index file exports an AppRouter, it's a trpc api\n if (await hasExportDeclaration(tree, indexTs, 'AppRouter')) {\n return true;\n }\n\n // If there's a src/router.ts or src/lambdas/router.ts which exports an AppRouter, it's a trpc api\n const trpcRouter =\n tree.read(\n joinPathFragments(sourceRoot(projectConfiguration), 'router.ts'),\n 'utf-8',\n ) ??\n tree.read(\n joinPathFragments(\n sourceRoot(projectConfiguration),\n 'lambdas',\n 'router.ts',\n ),\n 'utf-8',\n );\n\n if (trpcRouter === null) {\n return false;\n }\n\n if (await hasExportDeclaration(tree, trpcRouter, 'AppRouter')) {\n return true;\n }\n\n return false;\n};\n\nconst isReact = (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // if there's a main.tsx, it's a react app\n return tree.exists(\n joinPathFragments(sourceRoot(projectConfiguration), 'main.tsx'),\n );\n};\n\nconst isFastApi = (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // If the project.json says it's a fast api, there's no need for introspection\n if ((projectConfiguration.metadata as any)?.apiType === 'fast-api') {\n return true;\n }\n\n const pyProjectPath = joinPathFragments(\n projectConfiguration.root,\n 'pyproject.toml',\n );\n if (tree.exists(pyProjectPath)) {\n const pyProject = readToml(tree, pyProjectPath);\n if (((pyProject as any)?.project?.dependencies ?? []).includes('fastapi')) {\n return true;\n }\n }\n\n return false;\n};\n\nconst isSmithyApi = (\n _tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // Support selecting either the smithy model or backend project\n return [\n SMITHY_PROJECT_GENERATOR_INFO.id,\n TS_SMITHY_API_GENERATOR_INFO.id,\n ].includes(((projectConfiguration.metadata as any) ?? {}).generator);\n};\n\nconst isRdb = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n TS_RDB_GENERATOR_INFO.id;\n\nconst isTsDynamoDB = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n TS_DYNAMODB_GENERATOR_INFO.id;\n\nconst isPyDynamoDB = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n PY_DYNAMODB_GENERATOR_INFO.id;\n\nconst isAgentCoreGateway = (\n projectConfiguration: ProjectConfiguration,\n): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n AGENTCORE_GATEWAY_GENERATOR_INFO.id;\n\nexport default connectionGenerator;\n"],"names":["joinPathFragments","agentcoreGatewayGatewayConnectionGenerator","AGENTCORE_GATEWAY_GENERATOR_INFO","agentcoreGatewayMcpConnectionGenerator","pyAgentA2aConnectionGenerator","pyAgentGatewayConnectionGenerator","pyAgentMcpConnectionGenerator","pyAgentReactConnectionGenerator","pyDynamoDBAgentConnectionGenerator","pyDynamoDBFastApiConnectionGenerator","PY_DYNAMODB_GENERATOR_INFO","pyDynamoDBMcpServerConnectionGenerator","fastApiReactGenerator","SMITHY_PROJECT_GENERATOR_INFO","smithyReactConnectionGenerator","TS_SMITHY_API_GENERATOR_INFO","trpcReactGenerator","tsAgentA2aConnectionGenerator","tsAgentGatewayConnectionGenerator","tsAgentMcpConnectionGenerator","tsAgentReactConnectionGenerator","tsDynamoDBAgentConnectionGenerator","TS_DYNAMODB_GENERATOR_INFO","tsDynamoDBMcpServerConnectionGenerator","tsDynamoDBSmithyConnectionGenerator","tsDynamoDBTrpcConnectionGenerator","tsRdbAgentConnectionGenerator","TS_RDB_GENERATOR_INFO","tsRdbMcpServerConnectionGenerator","tsRdbSmithyConnectionGenerator","tsRdbTrpcConnectionGenerator","hasExportDeclaration","readProjectConfigurationUnqualified","readToml","SUPPORTED_CONNECTIONS","PROJECT_COMPONENT_SENTINEL","CONNECTION_GENERATORS","tree","options","frontendProjectName","sourceProject","backendProjectName","targetProject","preferInstallDependencies","fastApiProjectName","smithyModelOrBackendProjectName","connectionGenerator","resolved","resolveConnection","connectionKey","connection","source","target","sourceComponent","targetComponent","findComponentInMetadata","projectConfiguration","componentRef","components","metadata","find","c","name","path","generator","gatherCandidates","projectConfig","type","determineProjectTypeFromConfig","map","component","validateComponent","side","found","Error","length","join","filterConnectionCandidatesForComponentReference","candidates","supportedConnections","filter","isConnectionParticipant","some","sourceConfig","targetConfig","sourceCandidates","targetCandidates","matches","match","push","sourceTypes","Set","targetTypes","connectionDescriptions","m","sourceName","targetName","sourceLabel","targetLabel","determineProjectType","projectName","isTrpcApi","isFastApi","isSmithyApi","isReact","isRdb","isTsDynamoDB","isPyDynamoDB","isAgentCoreGateway","undefined","sourceRoot","root","apiType","indexTs","read","trpcRouter","exists","pyProjectPath","pyProject","project","dependencies","includes","_tree","id"],"mappings":"AAAA;;;CAGC,GACD,SACEA,iBAAiB,QAGZ,aAAa;AACpB,OAAOC,gDAAgD,uDAAoD;AAC3G,SAASC,gCAAgC,QAAQ,oCAAiC;AAClF,OAAOC,4CAA4C,mDAAgD;AACnG,OAAOC,mCAAmC,0CAAuC;AACjF,OAAOC,uCAAuC,8CAA2C;AACzF,OAAOC,mCAAmC,0CAAuC;AACjF,OAAOC,qCAAqC,4CAAyC;AACrF,OAAOC,wCAAwC,+CAA4C;AAC3F,OAAOC,0CAA0C,kDAA+C;AAChG,SAASC,0BAA0B,QAAQ,8BAA2B;AACtE,OAAOC,4CAA4C,oDAAiD;AACpG,OAAOC,2BAA2B,oCAAiC;AACnE,SAASC,6BAA6B,QAAQ,iCAA8B;AAC5E,OAAOC,oCAAoC,0CAAuC;AAClF,SAASC,4BAA4B,QAAQ,gCAA6B;AAC1E,OAAOC,wBAAwB,6BAA0B;AACzD,OAAOC,mCAAmC,0CAAuC;AACjF,OAAOC,uCAAuC,8CAA2C;AACzF,OAAOC,mCAAmC,0CAAuC;AACjF,OAAOC,qCAAqC,4CAAyC;AACrF,OAAOC,wCAAwC,+CAA4C;AAC3F,SAASC,0BAA0B,QAAQ,8BAA2B;AACtE,OAAOC,4CAA4C,oDAAiD;A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F;IAEA,OAAO;AACT;AAEA,MAAMlB,cAAc,CAClBmB,OACAlE;IAEA,+DAA+D;IAC/D,OAAO;QACL3C,8BAA8B8G,EAAE;QAChC5G,6BAA6B4G,EAAE;KAChC,CAACF,QAAQ,CAAC,AAAC,CAAA,AAACjE,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS;AACrE;AAEA,MAAMyC,QAAQ,CAACjD,uBACb,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxDrC,sBAAsBgG,EAAE;AAE1B,MAAMjB,eAAe,CAAClD,uBACpB,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxD1C,2BAA2BqG,EAAE;AAE/B,MAAMhB,eAAe,CAACnD,uBACpB,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxDtD,2BAA2BiH,EAAE;AAE/B,MAAMf,qBAAqB,CACzBpD,uBAEA,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxD9D,iCAAiCyH,EAAE;AAErC,eAAe7E,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../packages/nx-plugin/src/connection/schema.d.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface ConnectionGeneratorSchema {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: string;\n targetComponent?: string;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAED,
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/nx-plugin/src/connection/schema.d.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface ConnectionGeneratorSchema {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: string;\n targetComponent?: string;\n preferInstallDependencies?: boolean;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAED,WAMC"}
|
|
@@ -27,6 +27,11 @@
|
|
|
27
27
|
"targetComponent": {
|
|
28
28
|
"type": "string",
|
|
29
29
|
"description": "The target component to connect to (component name, path relative to target project root, or generator id). Use '.' to explicitly select the project as the target."
|
|
30
|
+
},
|
|
31
|
+
"preferInstallDependencies": {
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"description": "Whether to prefer installing dependencies after the generator runs. Set to false to defer installing when batching multiple generators (an install still runs if needed so subsequent generators can compute the Nx project graph); install once at the end.",
|
|
34
|
+
"default": true
|
|
30
35
|
}
|
|
31
36
|
},
|
|
32
37
|
"required": ["sourceProject", "targetProject"]
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
export type Connection = {
|
|
6
|
+
source: string;
|
|
7
|
+
target: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const SUPPORTED_PROJECT_TYPES: readonly ["ts#trpc-api", "py#fast-api", "ts#react-website", "ts#smithy-api", "ts#rdb", "ts#dynamodb", "py#dynamodb", "agentcore-gateway"];
|
|
10
|
+
export declare const SUPPORTED_CONNECTIONS: readonly [{
|
|
11
|
+
readonly source: "ts#trpc-api";
|
|
12
|
+
readonly target: "ts#rdb";
|
|
13
|
+
}, {
|
|
14
|
+
readonly source: "ts#trpc-api";
|
|
15
|
+
readonly target: "ts#dynamodb";
|
|
16
|
+
}, {
|
|
17
|
+
readonly source: "ts#agent";
|
|
18
|
+
readonly target: "ts#rdb";
|
|
19
|
+
}, {
|
|
20
|
+
readonly source: "ts#smithy-api";
|
|
21
|
+
readonly target: "ts#rdb";
|
|
22
|
+
}, {
|
|
23
|
+
readonly source: "ts#smithy-api";
|
|
24
|
+
readonly target: "ts#dynamodb";
|
|
25
|
+
}, {
|
|
26
|
+
readonly source: "ts#mcp-server";
|
|
27
|
+
readonly target: "ts#rdb";
|
|
28
|
+
}, {
|
|
29
|
+
readonly source: "ts#mcp-server";
|
|
30
|
+
readonly target: "ts#dynamodb";
|
|
31
|
+
}, {
|
|
32
|
+
readonly source: "ts#react-website";
|
|
33
|
+
readonly target: "ts#trpc-api";
|
|
34
|
+
}, {
|
|
35
|
+
readonly source: "ts#react-website";
|
|
36
|
+
readonly target: "py#fast-api";
|
|
37
|
+
}, {
|
|
38
|
+
readonly source: "ts#react-website";
|
|
39
|
+
readonly target: "ts#smithy-api";
|
|
40
|
+
}, {
|
|
41
|
+
readonly source: "ts#react-website";
|
|
42
|
+
readonly target: "ts#agent";
|
|
43
|
+
}, {
|
|
44
|
+
readonly source: "ts#react-website";
|
|
45
|
+
readonly target: "py#agent";
|
|
46
|
+
}, {
|
|
47
|
+
readonly source: "ts#agent";
|
|
48
|
+
readonly target: "ts#mcp-server";
|
|
49
|
+
}, {
|
|
50
|
+
readonly source: "ts#agent";
|
|
51
|
+
readonly target: "py#mcp-server";
|
|
52
|
+
}, {
|
|
53
|
+
readonly source: "ts#agent";
|
|
54
|
+
readonly target: "ts#dynamodb";
|
|
55
|
+
}, {
|
|
56
|
+
readonly source: "py#agent";
|
|
57
|
+
readonly target: "ts#mcp-server";
|
|
58
|
+
}, {
|
|
59
|
+
readonly source: "py#agent";
|
|
60
|
+
readonly target: "py#mcp-server";
|
|
61
|
+
}, {
|
|
62
|
+
readonly source: "ts#agent";
|
|
63
|
+
readonly target: "ts#agent";
|
|
64
|
+
}, {
|
|
65
|
+
readonly source: "ts#agent";
|
|
66
|
+
readonly target: "py#agent";
|
|
67
|
+
}, {
|
|
68
|
+
readonly source: "py#agent";
|
|
69
|
+
readonly target: "ts#agent";
|
|
70
|
+
}, {
|
|
71
|
+
readonly source: "py#agent";
|
|
72
|
+
readonly target: "py#agent";
|
|
73
|
+
}, {
|
|
74
|
+
readonly source: "ts#agent";
|
|
75
|
+
readonly target: "agentcore-gateway";
|
|
76
|
+
}, {
|
|
77
|
+
readonly source: "py#agent";
|
|
78
|
+
readonly target: "agentcore-gateway";
|
|
79
|
+
}, {
|
|
80
|
+
readonly source: "agentcore-gateway";
|
|
81
|
+
readonly target: "ts#mcp-server";
|
|
82
|
+
}, {
|
|
83
|
+
readonly source: "agentcore-gateway";
|
|
84
|
+
readonly target: "py#mcp-server";
|
|
85
|
+
}, {
|
|
86
|
+
readonly source: "agentcore-gateway";
|
|
87
|
+
readonly target: "agentcore-gateway";
|
|
88
|
+
}, {
|
|
89
|
+
readonly source: "py#fast-api";
|
|
90
|
+
readonly target: "py#dynamodb";
|
|
91
|
+
}, {
|
|
92
|
+
readonly source: "py#agent";
|
|
93
|
+
readonly target: "py#dynamodb";
|
|
94
|
+
}, {
|
|
95
|
+
readonly source: "py#mcp-server";
|
|
96
|
+
readonly target: "py#dynamodb";
|
|
97
|
+
}];
|
|
98
|
+
export type ConnectionKey = (typeof SUPPORTED_CONNECTIONS)[number] extends infer C ? C extends Connection ? `${C['source']} -> ${C['target']}` : never : never;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/ // Supported source/target project types: either project-level types (resolved
|
|
5
|
+
// by introspection) or component generator ids (from component metadata).
|
|
6
|
+
export const SUPPORTED_PROJECT_TYPES = [
|
|
7
|
+
'ts#trpc-api',
|
|
8
|
+
'py#fast-api',
|
|
9
|
+
'ts#react-website',
|
|
10
|
+
'ts#smithy-api',
|
|
11
|
+
'ts#rdb',
|
|
12
|
+
'ts#dynamodb',
|
|
13
|
+
'py#dynamodb',
|
|
14
|
+
'agentcore-gateway'
|
|
15
|
+
];
|
|
16
|
+
// The single source of truth for supported connections, in a dependency-free
|
|
17
|
+
// module so the e2e connection matrix can import it without pulling in the
|
|
18
|
+
// generator implementation graph.
|
|
19
|
+
export const SUPPORTED_CONNECTIONS = [
|
|
20
|
+
{
|
|
21
|
+
source: 'ts#trpc-api',
|
|
22
|
+
target: 'ts#rdb'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
source: 'ts#trpc-api',
|
|
26
|
+
target: 'ts#dynamodb'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
source: 'ts#agent',
|
|
30
|
+
target: 'ts#rdb'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
source: 'ts#smithy-api',
|
|
34
|
+
target: 'ts#rdb'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
source: 'ts#smithy-api',
|
|
38
|
+
target: 'ts#dynamodb'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
source: 'ts#mcp-server',
|
|
42
|
+
target: 'ts#rdb'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
source: 'ts#mcp-server',
|
|
46
|
+
target: 'ts#dynamodb'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
source: 'ts#react-website',
|
|
50
|
+
target: 'ts#trpc-api'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
source: 'ts#react-website',
|
|
54
|
+
target: 'py#fast-api'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
source: 'ts#react-website',
|
|
58
|
+
target: 'ts#smithy-api'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
source: 'ts#react-website',
|
|
62
|
+
target: 'ts#agent'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
source: 'ts#react-website',
|
|
66
|
+
target: 'py#agent'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
source: 'ts#agent',
|
|
70
|
+
target: 'ts#mcp-server'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
source: 'ts#agent',
|
|
74
|
+
target: 'py#mcp-server'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
source: 'ts#agent',
|
|
78
|
+
target: 'ts#dynamodb'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
source: 'py#agent',
|
|
82
|
+
target: 'ts#mcp-server'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
source: 'py#agent',
|
|
86
|
+
target: 'py#mcp-server'
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
source: 'ts#agent',
|
|
90
|
+
target: 'ts#agent'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
source: 'ts#agent',
|
|
94
|
+
target: 'py#agent'
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
source: 'py#agent',
|
|
98
|
+
target: 'ts#agent'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
source: 'py#agent',
|
|
102
|
+
target: 'py#agent'
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
source: 'ts#agent',
|
|
106
|
+
target: 'agentcore-gateway'
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
source: 'py#agent',
|
|
110
|
+
target: 'agentcore-gateway'
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
source: 'agentcore-gateway',
|
|
114
|
+
target: 'ts#mcp-server'
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
source: 'agentcore-gateway',
|
|
118
|
+
target: 'py#mcp-server'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
source: 'agentcore-gateway',
|
|
122
|
+
target: 'agentcore-gateway'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
source: 'py#fast-api',
|
|
126
|
+
target: 'py#dynamodb'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
source: 'py#agent',
|
|
130
|
+
target: 'py#dynamodb'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
source: 'py#mcp-server',
|
|
134
|
+
target: 'py#dynamodb'
|
|
135
|
+
}
|
|
136
|
+
];
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=supported-connections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/nx-plugin/src/connection/supported-connections.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type Connection = { source: string; target: string };\n\n// Supported source/target project types: either project-level types (resolved\n// by introspection) or component generator ids (from component metadata).\nexport const SUPPORTED_PROJECT_TYPES = [\n 'ts#trpc-api',\n 'py#fast-api',\n 'ts#react-website',\n 'ts#smithy-api',\n 'ts#rdb',\n 'ts#dynamodb',\n 'py#dynamodb',\n 'agentcore-gateway',\n] as const;\n\n// The single source of truth for supported connections, in a dependency-free\n// module so the e2e connection matrix can import it without pulling in the\n// generator implementation graph.\nexport const SUPPORTED_CONNECTIONS = [\n { source: 'ts#trpc-api', target: 'ts#rdb' },\n { source: 'ts#trpc-api', target: 'ts#dynamodb' },\n { source: 'ts#agent', target: 'ts#rdb' },\n { source: 'ts#smithy-api', target: 'ts#rdb' },\n { source: 'ts#smithy-api', target: 'ts#dynamodb' },\n { source: 'ts#mcp-server', target: 'ts#rdb' },\n { source: 'ts#mcp-server', target: 'ts#dynamodb' },\n { source: 'ts#react-website', target: 'ts#trpc-api' },\n { source: 'ts#react-website', target: 'py#fast-api' },\n { source: 'ts#react-website', target: 'ts#smithy-api' },\n { source: 'ts#react-website', target: 'ts#agent' },\n { source: 'ts#react-website', target: 'py#agent' },\n { source: 'ts#agent', target: 'ts#mcp-server' },\n { source: 'ts#agent', target: 'py#mcp-server' },\n { source: 'ts#agent', target: 'ts#dynamodb' },\n { source: 'py#agent', target: 'ts#mcp-server' },\n { source: 'py#agent', target: 'py#mcp-server' },\n { source: 'ts#agent', target: 'ts#agent' },\n { source: 'ts#agent', target: 'py#agent' },\n { source: 'py#agent', target: 'ts#agent' },\n { source: 'py#agent', target: 'py#agent' },\n { source: 'ts#agent', target: 'agentcore-gateway' },\n { source: 'py#agent', target: 'agentcore-gateway' },\n { source: 'agentcore-gateway', target: 'ts#mcp-server' },\n { source: 'agentcore-gateway', target: 'py#mcp-server' },\n { source: 'agentcore-gateway', target: 'agentcore-gateway' },\n { source: 'py#fast-api', target: 'py#dynamodb' },\n { source: 'py#agent', target: 'py#dynamodb' },\n { source: 'py#mcp-server', target: 'py#dynamodb' },\n] as const satisfies readonly Connection[];\n\n// `<source> -> <target>` string union of every supported connection. Used to\n// key exhaustive maps so a new connection is a compile error until handled.\nexport type ConnectionKey =\n (typeof SUPPORTED_CONNECTIONS)[number] extends infer C\n ? C extends Connection\n ? `${C['source']} -> ${C['target']}`\n : never\n : never;\n"],"names":["SUPPORTED_PROJECT_TYPES","SUPPORTED_CONNECTIONS","source","target"],"mappings":"AAAA;;;CAGC,GAID,8EAA8E;AAC9E,0EAA0E;AAC1E,OAAO,MAAMA,0BAA0B;IACrC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AAEX,6EAA6E;AAC7E,2EAA2E;AAC3E,kCAAkC;AAClC,OAAO,MAAMC,wBAAwB;IACnC;QAAEC,QAAQ;QAAeC,QAAQ;IAAS;IAC1C;QAAED,QAAQ;QAAeC,QAAQ;IAAc;IAC/C;QAAED,QAAQ;QAAYC,QAAQ;IAAS;IACvC;QAAED,QAAQ;QAAiBC,QAAQ;IAAS;IAC5C;QAAED,QAAQ;QAAiBC,QAAQ;IAAc;IACjD;QAAED,QAAQ;QAAiBC,QAAQ;IAAS;IAC5C;QAAED,QAAQ;QAAiBC,QAAQ;IAAc;IACjD;QAAED,QAAQ;QAAoBC,QAAQ;IAAc;IACpD;QAAED,QAAQ;QAAoBC,QAAQ;IAAc;IACpD;QAAED,QAAQ;QAAoBC,QAAQ;IAAgB;IACtD;QAAED,QAAQ;QAAoBC,QAAQ;IAAW;IACjD;QAAED,QAAQ;QAAoBC,QAAQ;IAAW;IACjD;QAAED,QAAQ;QAAYC,QAAQ;IAAgB;IAC9C;QAAED,QAAQ;QAAYC,QAAQ;IAAgB;IAC9C;QAAED,QAAQ;QAAYC,QAAQ;IAAc;IAC5C;QAAED,QAAQ;QAAYC,QAAQ;IAAgB;IAC9C;QAAED,QAAQ;QAAYC,QAAQ;IAAgB;IAC9C;QAAED,QAAQ;QAAYC,QAAQ;IAAW;IACzC;QAAED,QAAQ;QAAYC,QAAQ;IAAW;IACzC;QAAED,QAAQ;QAAYC,QAAQ;IAAW;IACzC;QAAED,QAAQ;QAAYC,QAAQ;IAAW;IACzC;QAAED,QAAQ;QAAYC,QAAQ;IAAoB;IAClD;QAAED,QAAQ;QAAYC,QAAQ;IAAoB;IAClD;QAAED,QAAQ;QAAqBC,QAAQ;IAAgB;IACvD;QAAED,QAAQ;QAAqBC,QAAQ;IAAgB;IACvD;QAAED,QAAQ;QAAqBC,QAAQ;IAAoB;IAC3D;QAAED,QAAQ;QAAeC,QAAQ;IAAc;IAC/C;QAAED,QAAQ;QAAYC,QAAQ;IAAc;IAC5C;QAAED,QAAQ;QAAiBC,QAAQ;IAAc;CAClD,CAA0C"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`infra generator > should add required dependencies to package.json > dependencies 1`] = `
|
|
4
4
|
{
|
|
5
|
-
"aws-cdk": "2.
|
|
6
|
-
"aws-cdk-lib": "2.
|
|
5
|
+
"aws-cdk": "2.1129.0",
|
|
6
|
+
"aws-cdk-lib": "2.260.0",
|
|
7
7
|
"constructs": "10.6.0",
|
|
8
8
|
"esbuild": "0.28.1",
|
|
9
9
|
"source-map-support": "0.5.21",
|
|
@@ -15,21 +15,21 @@ exports[`infra generator > should add required dependencies to package.json > de
|
|
|
15
15
|
"@nx/js": "23.0.1",
|
|
16
16
|
"@nx/vitest": "23.0.1",
|
|
17
17
|
"@swc/helpers": "~0.5.18",
|
|
18
|
-
"@types/node": "25.9.
|
|
19
|
-
"@vitest/coverage-v8": "4.1.
|
|
18
|
+
"@types/node": "25.9.4",
|
|
19
|
+
"@vitest/coverage-v8": "4.1.9",
|
|
20
20
|
"jsdom": "^27.1.0",
|
|
21
21
|
"tsx": "4.22.4",
|
|
22
22
|
"typescript": "~5.9.2",
|
|
23
|
-
"vite": "8.0
|
|
24
|
-
"vitest": "4.1.
|
|
23
|
+
"vite": "8.1.0",
|
|
24
|
+
"vitest": "4.1.9",
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
27
27
|
|
|
28
28
|
exports[`infra generator > should add required dependencies to package.json > package-json 1`] = `
|
|
29
29
|
{
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"aws-cdk": "2.
|
|
32
|
-
"aws-cdk-lib": "2.
|
|
31
|
+
"aws-cdk": "2.1129.0",
|
|
32
|
+
"aws-cdk-lib": "2.260.0",
|
|
33
33
|
"constructs": "10.6.0",
|
|
34
34
|
"esbuild": "0.28.1",
|
|
35
35
|
"source-map-support": "0.5.21",
|
|
@@ -38,13 +38,13 @@ exports[`infra generator > should add required dependencies to package.json > pa
|
|
|
38
38
|
"@nx/js": "23.0.1",
|
|
39
39
|
"@nx/vitest": "23.0.1",
|
|
40
40
|
"@swc/helpers": "~0.5.18",
|
|
41
|
-
"@types/node": "25.9.
|
|
42
|
-
"@vitest/coverage-v8": "4.1.
|
|
41
|
+
"@types/node": "25.9.4",
|
|
42
|
+
"@vitest/coverage-v8": "4.1.9",
|
|
43
43
|
"jsdom": "^27.1.0",
|
|
44
44
|
"tsx": "4.22.4",
|
|
45
45
|
"typescript": "~5.9.2",
|
|
46
|
-
"vite": "8.0
|
|
47
|
-
"vitest": "4.1.
|
|
46
|
+
"vite": "8.1.0",
|
|
47
|
+
"vitest": "4.1.9",
|
|
48
48
|
},
|
|
49
49
|
"name": "@proj/source",
|
|
50
50
|
"type": "module",
|
|
@@ -62,7 +62,7 @@ exports[`infra generator > should configure Checkov target correctly > checkov-t
|
|
|
62
62
|
"{workspaceRoot}/dist/{projectRoot}/cdk.out",
|
|
63
63
|
],
|
|
64
64
|
"options": {
|
|
65
|
-
"command": "uvx --from checkov==3.3.
|
|
65
|
+
"command": "uvx --from checkov==3.3.6 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
66
66
|
},
|
|
67
67
|
"outputs": [
|
|
68
68
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -90,7 +90,7 @@ exports[`infra generator > should configure project.json with correct targets >
|
|
|
90
90
|
],
|
|
91
91
|
"executor": "nx:run-commands",
|
|
92
92
|
"options": {
|
|
93
|
-
"command": "cdk deploy --require-approval=never",
|
|
93
|
+
"command": "cdk deploy --require-approval=never --express",
|
|
94
94
|
"cwd": "{projectRoot}",
|
|
95
95
|
},
|
|
96
96
|
}
|
|
@@ -155,7 +155,7 @@ exports[`infra generator > should configure project.json with correct targets >
|
|
|
155
155
|
"{workspaceRoot}/dist/{projectRoot}/cdk.out",
|
|
156
156
|
],
|
|
157
157
|
"options": {
|
|
158
|
-
"command": "uvx --from checkov==3.3.
|
|
158
|
+
"command": "uvx --from checkov==3.3.6 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
159
159
|
},
|
|
160
160
|
"outputs": [
|
|
161
161
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -178,7 +178,7 @@ exports[`infra generator > should configure project.json with correct targets >
|
|
|
178
178
|
],
|
|
179
179
|
"executor": "nx:run-commands",
|
|
180
180
|
"options": {
|
|
181
|
-
"command": "cdk deploy --require-approval=never",
|
|
181
|
+
"command": "cdk deploy --require-approval=never --express",
|
|
182
182
|
"cwd": "{projectRoot}",
|
|
183
183
|
},
|
|
184
184
|
},
|
|
@@ -711,7 +711,7 @@ exports[`infra generator > should handle custom project names correctly > custom
|
|
|
711
711
|
"{workspaceRoot}/dist/{projectRoot}/cdk.out",
|
|
712
712
|
],
|
|
713
713
|
"options": {
|
|
714
|
-
"command": "uvx --from checkov==3.3.
|
|
714
|
+
"command": "uvx --from checkov==3.3.6 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
715
715
|
},
|
|
716
716
|
"outputs": [
|
|
717
717
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -734,7 +734,7 @@ exports[`infra generator > should handle custom project names correctly > custom
|
|
|
734
734
|
],
|
|
735
735
|
"executor": "nx:run-commands",
|
|
736
736
|
"options": {
|
|
737
|
-
"command": "cdk deploy --require-approval=never",
|
|
737
|
+
"command": "cdk deploy --require-approval=never --express",
|
|
738
738
|
"cwd": "{projectRoot}",
|
|
739
739
|
},
|
|
740
740
|
},
|
|
@@ -983,6 +983,9 @@ exports[`infra generator > with stageConfig > should snapshot generated scripts
|
|
|
983
983
|
* Defaults to --require-approval=never (standard for local dev deploys).
|
|
984
984
|
* If the user explicitly passes --require-approval with any value, we
|
|
985
985
|
* respect their choice and don't add the default.
|
|
986
|
+
*
|
|
987
|
+
* Deploys default to --express (CloudFormation express mode) for faster
|
|
988
|
+
* local iteration. Pass --no-express to opt out.
|
|
986
989
|
*/
|
|
987
990
|
export function buildCdkCommand(
|
|
988
991
|
action: string,
|
|
@@ -991,9 +994,14 @@ export function buildCdkCommand(
|
|
|
991
994
|
const hasRequireApproval = remainingArgs.some(
|
|
992
995
|
(a) => a === '--require-approval' || a.startsWith('--require-approval='),
|
|
993
996
|
);
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
+
const hasExpressFlag = remainingArgs.some(
|
|
998
|
+
(a) => a === '--express' || a === '--no-express',
|
|
999
|
+
);
|
|
1000
|
+
const defaults = [
|
|
1001
|
+
...(hasRequireApproval ? [] : ['--require-approval=never']),
|
|
1002
|
+
...(action === 'deploy' && !hasExpressFlag ? ['--express'] : []),
|
|
1003
|
+
];
|
|
1004
|
+
return ['cdk', action, ...defaults, ...remainingArgs];
|
|
997
1005
|
}
|
|
998
1006
|
"
|
|
999
1007
|
`;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/ import { addDependenciesToPackageJson, generateFiles,
|
|
4
|
+
*/ import { addDependenciesToPackageJson, generateFiles, joinPathFragments, OverwriteStrategy, readProjectConfiguration, updateJson } from "@nx/devkit";
|
|
5
5
|
import path from "path";
|
|
6
6
|
import tsProjectGenerator, { getTsLibDetails } from "../../ts/lib/generator.js";
|
|
7
7
|
import { mergeTsReferences } from "../../ts/lib/ts-project-utils.js";
|
|
8
8
|
import { resolveContainers } from "../../utils/containers.js";
|
|
9
9
|
import { formatFilesInSubtree } from "../../utils/format.js";
|
|
10
|
+
import { installDependencies } from "../../utils/install.js";
|
|
10
11
|
import { addGeneratorMetricsIfApplicable } from "../../utils/metrics.js";
|
|
11
12
|
import { kebabCase } from "../../utils/names.js";
|
|
12
13
|
import { getNpmScopePrefix, toScopeAlias } from "../../utils/npm-scope.js";
|
|
@@ -23,7 +24,10 @@ export const INFRA_APP_GENERATOR_INFO = getGeneratorInfo(import.meta.filename);
|
|
|
23
24
|
export async function tsInfraGenerator(tree, schema) {
|
|
24
25
|
const lib = getTsLibDetails(tree, schema);
|
|
25
26
|
if (!projectExists(tree, lib.fullyQualifiedName)) {
|
|
26
|
-
await tsProjectGenerator(tree,
|
|
27
|
+
await tsProjectGenerator(tree, {
|
|
28
|
+
...schema,
|
|
29
|
+
preferInstallDependencies: false
|
|
30
|
+
});
|
|
27
31
|
}
|
|
28
32
|
// CDK shells out to a container engine to build image assets. Default
|
|
29
33
|
// (docker) needs no env override; finch is set via CDK_DOCKER per
|
|
@@ -126,7 +130,7 @@ export async function tsInfraGenerator(tree, schema) {
|
|
|
126
130
|
command: `tsx packages/common/scripts/src/infra/infra-deploy.ts ${libraryRoot}`
|
|
127
131
|
}) : withCdkEnv({
|
|
128
132
|
cwd: '{projectRoot}',
|
|
129
|
-
command: 'cdk deploy --require-approval=never'
|
|
133
|
+
command: 'cdk deploy --require-approval=never --express'
|
|
130
134
|
})
|
|
131
135
|
};
|
|
132
136
|
config.targets['deploy-ci'] = {
|
|
@@ -199,9 +203,11 @@ export async function tsInfraGenerator(tree, schema) {
|
|
|
199
203
|
INFRA_APP_GENERATOR_INFO
|
|
200
204
|
]);
|
|
201
205
|
await formatFilesInSubtree(tree);
|
|
202
|
-
return ()=>{
|
|
203
|
-
|
|
204
|
-
|
|
206
|
+
return ()=>installDependencies(tree, schema.preferInstallDependencies, {
|
|
207
|
+
languages: [
|
|
208
|
+
'typescript'
|
|
209
|
+
]
|
|
210
|
+
});
|
|
205
211
|
}
|
|
206
212
|
export default tsInfraGenerator;
|
|
207
213
|
|