@aws/nx-plugin 1.0.0-rc.0 → 1.0.0-rc.10
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 +3399 -4104
- package/README.md +8 -8
- package/executors.json +9 -0
- package/generators.json +44 -5
- package/package.json +16 -12
- package/sdk/license.d.ts +8 -0
- package/sdk/license.js +13 -0
- package/sdk/license.js.map +1 -0
- package/src/connection/agent-runtime-config.d.ts +1 -1
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/agent-serve-local.d.ts +2 -2
- package/src/connection/agent-serve-local.js +1 -1
- package/src/connection/agent-serve-local.js.map +1 -1
- package/src/connection/generator.d.ts +5 -5
- package/src/connection/generator.js +58 -39
- package/src/connection/generator.js.map +1 -1
- package/src/connection/serve-local.d.ts +1 -1
- package/src/connection/serve-local.js +1 -1
- package/src/connection/serve-local.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +49 -60
- package/src/infra/app/files/app/src/main.ts.template +2 -2
- package/src/infra/app/generator.d.ts +3 -3
- package/src/infra/app/generator.js +25 -23
- package/src/infra/app/generator.js.map +1 -1
- package/src/infra/app/schema.d.ts +1 -1
- package/src/infra/app/schema.json +1 -1
- package/src/license/__snapshots__/config.spec.ts.snap +23 -0
- package/src/license/config-types.d.ts +18 -1
- package/src/license/config-types.js +4 -0
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +65 -7
- package/src/license/config.js +315 -7
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/check.d.ts +16 -0
- package/src/license/dependency-check/check.js +111 -0
- package/src/license/dependency-check/check.js.map +1 -0
- package/src/license/dependency-check/collectors/collector.d.ts +21 -0
- package/src/license/dependency-check/collectors/collector.js +76 -0
- package/src/license/dependency-check/collectors/collector.js.map +1 -0
- package/src/license/dependency-check/collectors/npm-collector.d.ts +10 -0
- package/src/license/dependency-check/collectors/npm-collector.js +75 -0
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -0
- package/src/license/dependency-check/collectors/python-collector.d.ts +23 -0
- package/src/license/dependency-check/collectors/python-collector.js +121 -0
- package/src/license/dependency-check/collectors/python-collector.js.map +1 -0
- package/src/license/dependency-check/evaluator.d.ts +9 -0
- package/src/license/dependency-check/evaluator.js +122 -0
- package/src/license/dependency-check/evaluator.js.map +1 -0
- package/src/license/dependency-check/executor-schema.json +6 -0
- package/src/license/dependency-check/executor.d.ts +9 -0
- package/src/license/dependency-check/executor.js +43 -0
- package/src/license/dependency-check/executor.js.map +1 -0
- package/src/license/dependency-check/pre-approved.d.ts +6 -0
- package/src/license/dependency-check/pre-approved.js +1280 -0
- package/src/license/dependency-check/pre-approved.js.map +1 -0
- package/src/license/dependency-check/types.d.ts +45 -0
- package/src/license/dependency-check/types.js +7 -0
- package/src/license/dependency-check/types.js.map +1 -0
- package/src/license/generator.d.ts +3 -3
- package/src/license/generator.js +113 -14
- package/src/license/generator.js.map +1 -1
- package/src/license/index.d.ts +8 -0
- package/src/license/index.js +13 -0
- package/src/license/index.js.map +1 -0
- package/src/license/known-exceptions.d.ts +7 -0
- package/src/license/known-exceptions.js +33 -0
- package/src/license/known-exceptions.js.map +1 -0
- package/src/license/schema.d.ts +5 -0
- package/src/license/schema.json +6 -0
- package/src/license/sync/generator.d.ts +2 -2
- package/src/license/sync/generator.js +15 -15
- package/src/license/sync/generator.js.map +1 -1
- package/src/license/sync/project-file-sync.d.ts +3 -3
- package/src/license/sync/project-file-sync.js.map +1 -1
- package/src/mcp-server/generator-info.d.ts +5 -1
- package/src/mcp-server/generator-info.js +7 -7
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/guide-pipeline.d.ts +1 -1
- package/src/mcp-server/guide-pipeline.js +10 -12
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/mdx-ast.js +4 -0
- package/src/mcp-server/mdx-ast.js.map +1 -1
- package/src/mcp-server/server.js +3 -3
- package/src/mcp-server/server.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.d.ts +1 -1
- package/src/mcp-server/tools/create-workspace-command.js +5 -5
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/general-guidance.d.ts +2 -2
- package/src/mcp-server/tools/general-guidance.js +2 -2
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.d.ts +2 -2
- package/src/mcp-server/tools/generator-guide.js +2 -2
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/mcp-server/tools/list-generators.d.ts +2 -2
- package/src/mcp-server/tools/list-generators.js +1 -1
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +1 -1
- package/src/open-api/ts-client/generator.d.ts +3 -3
- package/src/open-api/ts-client/generator.js +2 -2
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.d.ts +3 -3
- package/src/open-api/ts-hooks/generator.js +2 -2
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.spec.tsx +14 -14
- package/src/open-api/ts-metadata/generator.d.ts +3 -3
- package/src/open-api/ts-metadata/generator.js +1 -1
- package/src/open-api/ts-metadata/generator.js.map +1 -1
- package/src/open-api/utils/codegen-data/languages.d.ts +5 -1
- package/src/open-api/utils/codegen-data/languages.js +4 -4
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data.d.ts +6 -2
- package/src/open-api/utils/codegen-data.js +6 -6
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.d.ts +5 -1
- package/src/open-api/utils/normalise.js +5 -5
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parse.d.ts +2 -2
- package/src/open-api/utils/parse.js +4 -0
- package/src/open-api/utils/parse.js.map +1 -1
- package/src/open-api/utils/refs.d.ts +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +128 -14
- package/src/preset/generator.d.ts +4 -4
- package/src/preset/generator.js +24 -19
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.ts +7 -5
- package/src/preset/schema.json +9 -4
- package/src/py/agent/__snapshots__/generator.spec.ts.snap +10 -9
- package/src/py/agent/a2a-connection/generator.d.ts +3 -3
- package/src/py/agent/a2a-connection/generator.js +8 -7
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/files/common/agent.py.template +2 -0
- package/src/py/agent/files/deploy/Dockerfile.template +3 -3
- package/src/py/agent/files/http/init.py.template +2 -2
- package/src/py/agent/files/http/main.py.template +0 -1
- package/src/py/agent/generator.d.ts +3 -3
- package/src/py/agent/generator.js +45 -39
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +4 -0
- package/src/py/agent/mcp-connection/generator.d.ts +3 -3
- package/src/py/agent/mcp-connection/generator.js +5 -5
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/agent/react-connection/generator.d.ts +3 -3
- package/src/py/agent/react-connection/generator.js +8 -8
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/serve-local.d.ts +2 -2
- package/src/py/agent/react-connection/serve-local.js.map +1 -1
- package/src/py/agent/schema.d.ts +8 -8
- package/src/py/agent/schema.json +18 -18
- package/src/py/api/generator.d.ts +3 -3
- package/src/py/api/generator.js +2 -2
- package/src/py/api/generator.js.map +1 -1
- package/src/py/api/schema.d.ts +4 -6
- package/src/py/api/schema.json +15 -15
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/py/fast-api/generator.d.ts +3 -3
- package/src/py/fast-api/generator.js +73 -55
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/generator.d.ts +3 -3
- package/src/py/fast-api/react/generator.js +3 -3
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/open-api.d.ts +1 -1
- package/src/py/fast-api/react/open-api.js +5 -2
- package/src/py/fast-api/react/open-api.js.map +1 -1
- package/src/py/fast-api/schema.d.ts +4 -6
- package/src/py/fast-api/schema.json +15 -15
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/lambda-function/files/handler/__lambdaFunctionSnakeCase__.py.template +6 -6
- package/src/py/lambda-function/generator.d.ts +3 -3
- package/src/py/lambda-function/generator.js +34 -31
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.ts +7 -4
- package/src/py/lambda-function/schema.json +15 -7
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/mcp-server/generator.d.ts +3 -3
- package/src/py/mcp-server/generator.js +44 -37
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/mcp-server/schema.d.ts +5 -9
- package/src/py/mcp-server/schema.json +15 -15
- package/src/py/project/generator.d.ts +3 -3
- package/src/py/project/generator.js +88 -69
- package/src/py/project/generator.js.map +1 -1
- package/src/py/project/schema.d.ts +1 -1
- package/src/py/project/schema.json +2 -2
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +18 -16
- package/src/smithy/project/files/build.Dockerfile.template +1 -0
- package/src/smithy/project/generator.d.ts +3 -3
- package/src/smithy/project/generator.js +31 -29
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/react-connection/generator.d.ts +3 -3
- package/src/smithy/react-connection/generator.js +4 -4
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +12 -38
- package/src/smithy/ts/api/generator.d.ts +3 -3
- package/src/smithy/ts/api/generator.js +89 -66
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/smithy/ts/api/schema.d.ts +4 -6
- package/src/smithy/ts/api/schema.json +15 -15
- package/src/terraform/project/generator.d.ts +3 -3
- package/src/terraform/project/generator.js +14 -9
- package/src/terraform/project/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/trpc/backend/files/src/client/index.ts.template +5 -5
- package/src/trpc/backend/files/src/handler.ts.template +2 -2
- package/src/trpc/backend/generator.d.ts +3 -3
- package/src/trpc/backend/generator.js +80 -61
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +5 -5
- package/src/trpc/backend/schema.json +15 -15
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/trpc/react/files/src/components/__apiNameClassName__ClientProvider.tsx.template +14 -14
- package/src/trpc/react/generator.d.ts +3 -3
- package/src/trpc/react/generator.js +11 -10
- package/src/trpc/react/generator.js.map +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +11 -5
- package/src/ts/agent/a2a-connection/generator.d.ts +3 -3
- package/src/ts/agent/a2a-connection/generator.js +9 -8
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/common/agent.ts.template +6 -2
- package/src/ts/agent/files/deploy/Dockerfile.template +1 -1
- package/src/ts/agent/generator.d.ts +3 -3
- package/src/ts/agent/generator.js +40 -35
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +5 -2
- package/src/ts/agent/mcp-connection/generator.d.ts +3 -3
- package/src/ts/agent/mcp-connection/generator.js +6 -6
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/files/src/components/__agentNameClassName__AgentClientProvider.tsx.template +8 -8
- package/src/ts/agent/react-connection/generator.d.ts +3 -3
- package/src/ts/agent/react-connection/generator.js +15 -15
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/serve-local.d.ts +2 -2
- package/src/ts/agent/react-connection/serve-local.js +2 -2
- package/src/ts/agent/schema.d.ts +8 -8
- package/src/ts/agent/schema.json +18 -18
- package/src/ts/api/generator.d.ts +3 -3
- package/src/ts/api/generator.js +10 -8
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.ts +5 -4
- package/src/ts/api/schema.json +15 -15
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +7 -8
- package/src/ts/astro-docs/generator.d.ts +3 -3
- package/src/ts/astro-docs/generator.js +14 -11
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/docs/generator.d.ts +3 -3
- package/src/ts/docs/generator.js.map +1 -1
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +1502 -0
- package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/agent-connection/generator.js +32 -0
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/agent-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/agent-connection/schema.json +22 -0
- package/src/ts/dynamodb/files/scripts/create-local-table.ts.template +161 -0
- package/src/ts/dynamodb/files/scripts/start-container.ts.template +81 -0
- package/src/ts/dynamodb/files/src/client.ts.template +45 -0
- package/src/ts/dynamodb/files/src/constants.ts.template +9 -0
- package/src/ts/dynamodb/files/src/entities/example.ts.template +47 -0
- package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -0
- package/src/ts/dynamodb/files/src/gsi.ts.template +14 -0
- package/src/ts/dynamodb/files/src/index.ts.template +11 -0
- package/src/ts/dynamodb/generator.d.ts +10 -0
- package/src/ts/dynamodb/generator.js +106 -0
- package/src/ts/dynamodb/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js +32 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.json +22 -0
- package/src/ts/dynamodb/schema.d.ts +14 -0
- package/src/ts/dynamodb/schema.json +52 -0
- package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/smithy-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/smithy-connection/generator.js +30 -0
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/smithy-connection/schema.json +18 -0
- package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/trpc-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/trpc-connection/generator.js +30 -0
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/trpc-connection/schema.json +18 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/lambda-function/files/handler/__lambdaFunctionKebabCase__.ts.template +10 -10
- package/src/ts/lambda-function/generator.d.ts +3 -3
- package/src/ts/lambda-function/generator.js +41 -36
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/schema.d.ts +7 -4
- package/src/ts/lambda-function/schema.json +15 -7
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +32 -65
- package/src/ts/lib/__snapshots__/vitest.spec.ts.snap +24 -0
- package/src/ts/lib/biome.d.ts +7 -0
- package/src/ts/lib/biome.js +58 -0
- package/src/ts/lib/biome.js.map +1 -0
- package/src/ts/lib/generator.d.ts +3 -3
- package/src/ts/lib/generator.js +27 -29
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/grit/vitest-pass-with-no-tests.grit +1 -1
- package/src/ts/lib/ts-project-utils.d.ts +12 -2
- package/src/ts/lib/ts-project-utils.js +30 -10
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/vitest.d.ts +2 -2
- package/src/ts/lib/vitest.js +1 -1
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/mcp-server/generator.d.ts +3 -3
- package/src/ts/mcp-server/generator.js +46 -24
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/mcp-server/schema.d.ts +5 -9
- package/src/ts/mcp-server/schema.json +15 -15
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +20 -15
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.spec.ts.template +1 -1
- package/src/ts/nx-generator/generator.d.ts +2 -2
- package/src/ts/nx-generator/generator.js +23 -19
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-plugin/generator.d.ts +3 -3
- package/src/ts/nx-plugin/generator.js +12 -11
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/utils.d.ts +1 -1
- package/src/ts/nx-plugin/utils.js +10 -4
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +120 -60
- package/src/ts/rdb/agent-connection/generator.d.ts +3 -3
- package/src/ts/rdb/agent-connection/generator.js +4 -4
- package/src/ts/rdb/agent-connection/generator.js.map +1 -1
- package/src/ts/rdb/files/prisma.config.ts.template +1 -1
- package/src/ts/rdb/files/scripts/pull-image.ts.template +15 -0
- package/src/ts/rdb/files/scripts/{docker-start.ts.template → start-container.ts.template} +24 -24
- package/src/ts/rdb/files/scripts/wait-for-db.ts.template +3 -3
- package/src/ts/rdb/files/src/create-db-user-handler.ts.template +2 -2
- package/src/ts/rdb/files/src/migration-handler.ts.template +2 -2
- package/src/ts/rdb/files/src/prisma.ts.template +2 -2
- package/src/ts/rdb/generator.d.ts +3 -3
- package/src/ts/rdb/generator.js +103 -82
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/generator.d.ts +3 -3
- package/src/ts/rdb/mcp-server-connection/generator.js +4 -4
- package/src/ts/rdb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/rdb/schema.d.ts +5 -5
- package/src/ts/rdb/schema.json +13 -13
- package/src/ts/rdb/smithy-connection/generator.d.ts +3 -3
- package/src/ts/rdb/smithy-connection/generator.js +4 -4
- package/src/ts/rdb/smithy-connection/generator.js.map +1 -1
- package/src/ts/rdb/trpc-connection/files/src/middleware/__rdbNameKebab__.ts.template +1 -1
- package/src/ts/rdb/trpc-connection/generator.d.ts +3 -3
- package/src/ts/rdb/trpc-connection/generator.js +3 -3
- package/src/ts/rdb/trpc-connection/generator.js.map +1 -1
- package/src/ts/rdb/utils.d.ts +1 -1
- package/src/ts/react-website/agui/files/common/src/hooks/useAgui__agentNameClassName__.tsx.template +9 -9
- package/src/ts/react-website/agui/generator.d.ts +3 -3
- package/src/ts/react-website/agui/generator.js +13 -13
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +423 -386
- package/src/ts/react-website/app/files/app/cloudscape/src/components/AppLayout/index.tsx.template +5 -5
- package/src/ts/react-website/app/files/app/cloudscape/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/files/app/cloudscape/src/styles.css.template +1 -1
- package/src/ts/react-website/app/files/app/none/src/components/AppLayout/index.tsx.template +5 -5
- package/src/ts/react-website/app/files/app/none/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/files/app/none/src/styles.css.template +2 -2
- package/src/ts/react-website/app/files/app/shadcn/src/components/AppLayout/index.tsx.template +6 -6
- package/src/ts/react-website/app/files/app/shadcn/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/generator.d.ts +6 -6
- package/src/ts/react-website/app/generator.js +124 -114
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.ts +9 -6
- package/src/ts/react-website/app/schema.json +13 -13
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +1 -7
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +3 -3
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.ux-provider.spec.ts.snap +3 -23
- package/src/ts/react-website/cognito-auth/generator.d.ts +3 -3
- package/src/ts/react-website/cognito-auth/generator.js +19 -22
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/grit/cloudscape-auth-menu.grit +8 -6
- package/src/ts/react-website/cognito-auth/grit/cognito-auth-wrapper.grit +1 -1
- package/src/ts/react-website/cognito-auth/grit/none-auth-menu.grit +1 -0
- package/src/ts/react-website/cognito-auth/grit/shadcn-auth-menu.grit +3 -1
- package/src/ts/react-website/cognito-auth/grit/shadcn-state-declarations.grit +3 -1
- package/src/ts/react-website/cognito-auth/schema.d.ts +2 -2
- package/src/ts/react-website/cognito-auth/schema.json +4 -4
- package/src/ts/react-website/cognito-auth/utils.d.ts +1 -1
- package/src/ts/react-website/cognito-auth/utils.js +1 -1
- package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
- package/src/ts/react-website/runtime-config/generator.d.ts +3 -3
- package/src/ts/react-website/runtime-config/generator.js +4 -4
- package/src/ts/react-website/runtime-config/generator.js.map +1 -1
- package/src/ts/sync/generator.d.ts +3 -3
- package/src/ts/sync/generator.js +2 -2
- package/src/ts/sync/generator.js.map +1 -1
- package/src/ts/website/app/generator.d.ts +3 -3
- package/src/ts/website/app/generator.js +1 -1
- package/src/ts/website/app/generator.js.map +1 -1
- package/src/ts/website/app/schema.d.ts +8 -6
- package/src/ts/website/app/schema.json +21 -13
- package/src/ts/website/auth/generator.d.ts +3 -3
- package/src/ts/website/auth/generator.js +2 -2
- package/src/ts/website/auth/generator.js.map +1 -1
- package/src/ts/website/auth/schema.d.ts +2 -2
- package/src/ts/website/auth/schema.json +4 -4
- package/src/utils/agent-connection/agent-connection.d.ts +1 -1
- package/src/utils/agent-connection/agent-connection.js +17 -11
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-runtime-config/model-errors.ts.template +36 -0
- package/src/utils/agent-connection/files/py-core-runtime-config/model_errors.py.template +40 -0
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +10 -10
- package/src/utils/agent-core-constructs/agent-core-constructs.js +14 -24
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +13 -13
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +5 -5
- package/src/utils/api-constructs/api-constructs.d.ts +4 -4
- package/src/utils/api-constructs/api-constructs.js +5 -7
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +12 -12
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +12 -12
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +7 -7
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +10 -10
- package/src/utils/api-constructs/open-api-metadata.d.ts +4 -4
- package/src/utils/api-constructs/open-api-metadata.js +2 -2
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
- package/src/utils/ast/website.d.ts +5 -1
- package/src/utils/ast/website.js +3 -3
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.d.ts +33 -1
- package/src/utils/ast.js +89 -4
- package/src/utils/ast.js.map +1 -1
- package/src/utils/bundle/bundle.d.ts +1 -1
- package/src/utils/bundle/bundle.js +2 -2
- package/src/utils/bundle/bundle.js.map +1 -1
- package/src/utils/commands.d.ts +1 -1
- package/src/utils/commands.js +2 -2
- package/src/utils/commands.js.map +1 -1
- package/src/utils/config/__snapshots__/utils.spec.ts.snap +6 -6
- package/src/utils/config/index.d.ts +5 -5
- package/src/utils/config/utils.d.ts +13 -3
- package/src/utils/config/utils.js +37 -5
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +7 -7
- package/src/utils/connection/open-api/react.d.ts +2 -2
- package/src/utils/connection/open-api/react.js +7 -7
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/containers.d.ts +6 -6
- package/src/utils/containers.js +6 -6
- package/src/utils/containers.js.map +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.d.ts +18 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +49 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -0
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +30 -0
- package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +105 -0
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +65 -0
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +155 -0
- package/src/utils/format.d.ts +45 -2
- package/src/utils/format.js +167 -46
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.d.ts +1 -1
- package/src/utils/fs.js.map +1 -1
- package/src/utils/function-constructs/files/cdk/app/lambda-functions/{__functionNameKebabCase__.ts.template → __nameKebabCase__.ts.template} +1 -1
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/{__functionNameKebabCase__/__functionNameKebabCase__.tf.template → __nameKebabCase__/__nameKebabCase__.tf.template} +7 -7
- package/src/utils/function-constructs/function-constructs.d.ts +5 -5
- package/src/utils/function-constructs/function-constructs.js +6 -8
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.d.ts +4 -0
- package/src/utils/generators.js +4 -4
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.d.ts +1 -1
- package/src/utils/git.js.map +1 -1
- package/src/utils/iac-providers.d.ts +3 -3
- package/src/utils/iac-providers.js +1 -1
- package/src/utils/iac.d.ts +3 -3
- package/src/utils/iac.js +6 -6
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +1 -5
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +2 -4
- package/src/utils/identity-constructs/identity-constructs.d.ts +3 -3
- package/src/utils/identity-constructs/identity-constructs.js +4 -4
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/js.d.ts +4 -0
- package/src/utils/js.js +4 -4
- package/src/utils/js.js.map +1 -1
- package/src/utils/mcp.d.ts +25 -0
- package/src/utils/mcp.js +81 -0
- package/src/utils/mcp.js.map +1 -0
- package/src/utils/metrics.d.ts +9 -3
- package/src/utils/metrics.js +58 -28
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/npm-scope.d.ts +1 -1
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +7 -2
- package/src/utils/nx.js +46 -14
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.d.ts +1 -1
- package/src/utils/paths.d.ts +1 -1
- package/src/utils/pnpm-workspace.d.ts +1 -1
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.d.ts +30 -3
- package/src/utils/port.js +72 -4
- package/src/utils/port.js.map +1 -1
- package/src/utils/py.d.ts +2 -2
- package/src/utils/py.js +13 -6
- package/src/utils/py.js.map +1 -1
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +30 -1
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +18 -9
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +5 -5
- package/src/utils/rdb-constructs/rdb-constructs.js +7 -17
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs.d.ts +3 -3
- package/src/utils/shared-constructs.js +10 -10
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-infra-config.d.ts +1 -1
- package/src/utils/shared-infra-config.js +1 -1
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-scripts.d.ts +1 -1
- package/src/utils/shared-scripts.js +2 -2
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.d.ts +1 -1
- package/src/utils/shared-shadcn.js +1 -13
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +5 -1
- package/src/utils/test.js +9 -5
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.d.ts +1 -1
- package/src/utils/toml.js +4 -0
- package/src/utils/toml.js.map +1 -1
- package/src/utils/versions.d.ts +68 -72
- package/src/utils/versions.js +67 -71
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +52 -5
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +38 -11
- package/src/utils/website-constructs/website-constructs.d.ts +3 -3
- package/src/utils/website-constructs/website-constructs.js +5 -7
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- package/src/ts/lib/eslint.d.ts +0 -14
- package/src/ts/lib/eslint.js +0 -90
- package/src/ts/lib/eslint.js.map +0 -1
- package/src/ts/lib/grit/eslint-dependency-checks-warn.grit +0 -1
- /package/src/ts/{rdb/files/scripts/docker-pull.ts.template → dynamodb/files/scripts/pull-image.ts.template} +0 -0
package/src/ts/lib/vitest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/lib/vitest.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAKoB;AACpB,+BAA4B;
|
|
1
|
+
{"version":3,"file":"vitest.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/lib/vitest.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AAC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AAC,MAAM,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CACxD,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,eAAe,mBAyC1B"}
|
|
@@ -162,7 +162,7 @@ variable "server_protocol" {
|
|
|
162
162
|
default = "HTTP"
|
|
163
163
|
validation {
|
|
164
164
|
condition = contains(["MCP", "HTTP", "A2A"], var.server_protocol)
|
|
165
|
-
error_message = "Protocol type must be either '
|
|
165
|
+
error_message = "Protocol type must be either 'mcp', 'http', or 'a2a'."
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -726,8 +726,8 @@ exports[`ts#mcp-server generator > should match snapshot for generated files > u
|
|
|
726
726
|
"snapshot-server": "./src/snapshot-server/stdio.js"
|
|
727
727
|
},
|
|
728
728
|
"dependencies": {
|
|
729
|
-
"@aws-lambda-powertools/parameters": "2.33.
|
|
730
|
-
"@aws-sdk/client-appconfigdata": "3.
|
|
729
|
+
"@aws-lambda-powertools/parameters": "2.33.1",
|
|
730
|
+
"@aws-sdk/client-appconfigdata": "3.1063.0",
|
|
731
731
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
732
732
|
"express": "5.2.1",
|
|
733
733
|
"zod": "4.4.3"
|
|
@@ -735,7 +735,7 @@ exports[`ts#mcp-server generator > should match snapshot for generated files > u
|
|
|
735
735
|
"devDependencies": {
|
|
736
736
|
"@modelcontextprotocol/inspector": "0.19.0",
|
|
737
737
|
"@types/express": "5.0.6",
|
|
738
|
-
"tsx": "4.22.
|
|
738
|
+
"tsx": "4.22.4"
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
"
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { type GeneratorCallback, type Tree } from '@nx/devkit';
|
|
6
|
+
import { type NxGeneratorInfo } from '../../utils/nx';
|
|
7
|
+
import type { TsMcpServerGeneratorSchema } from './schema';
|
|
8
8
|
export declare const TS_MCP_SERVER_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
9
|
export declare const tsMcpServerGenerator: (tree: Tree, options: TsMcpServerGeneratorSchema) => Promise<GeneratorCallback>;
|
|
10
10
|
export default tsMcpServerGenerator;
|
|
@@ -6,19 +6,22 @@ exports.tsMcpServerGenerator = exports.TS_MCP_SERVER_GENERATOR_INFO = void 0;
|
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
*/
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const config_1 = require("../../license/config");
|
|
10
|
+
const known_exceptions_1 = require("../../license/known-exceptions");
|
|
11
|
+
const agent_core_constructs_1 = require("../../utils/agent-core-constructs/agent-core-constructs");
|
|
12
|
+
const bundle_1 = require("../../utils/bundle/bundle");
|
|
13
|
+
const containers_1 = require("../../utils/containers");
|
|
11
14
|
const format_1 = require("../../utils/format");
|
|
12
|
-
const
|
|
15
|
+
const fs_1 = require("../../utils/fs");
|
|
16
|
+
const iac_1 = require("../../utils/iac");
|
|
17
|
+
const metrics_1 = require("../../utils/metrics");
|
|
13
18
|
const names_1 = require("../../utils/names");
|
|
14
|
-
const shared_constructs_1 = require("../../utils/shared-constructs");
|
|
15
|
-
const agent_core_constructs_1 = require("../../utils/agent-core-constructs/agent-core-constructs");
|
|
16
19
|
const npm_scope_1 = require("../../utils/npm-scope");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const bundle_1 = require("../../utils/bundle/bundle");
|
|
20
|
+
const nx_1 = require("../../utils/nx");
|
|
21
|
+
const object_1 = require("../../utils/object");
|
|
20
22
|
const port_1 = require("../../utils/port");
|
|
21
|
-
const
|
|
23
|
+
const shared_constructs_1 = require("../../utils/shared-constructs");
|
|
24
|
+
const versions_1 = require("../../utils/versions");
|
|
22
25
|
exports.TS_MCP_SERVER_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
23
26
|
const tsMcpServerGenerator = async (tree, options) => {
|
|
24
27
|
const project = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.project);
|
|
@@ -33,11 +36,11 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
33
36
|
const targetSourceDir = (0, devkit_1.joinPathFragments)(project.root, targetSourceDirRelativeToProjectRoot);
|
|
34
37
|
const relativeSourceDir = targetSourceDir.replace(project.root + '/', './');
|
|
35
38
|
const distDir = (0, devkit_1.joinPathFragments)('dist', project.root);
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
console.warn('Warning: auth is ignored when no
|
|
39
|
+
const infra = options.infra ?? 'agentcore';
|
|
40
|
+
if (infra === 'none' && options.auth && options.auth !== 'iam') {
|
|
41
|
+
console.warn('Warning: auth is ignored when no infrastructure is configured (no infrastructure is generated)');
|
|
39
42
|
}
|
|
40
|
-
const auth = options.auth ?? '
|
|
43
|
+
const auth = options.auth ?? 'iam';
|
|
41
44
|
// Create a package.json if one doesn't exist, since we want to add the server as a bin target
|
|
42
45
|
const projectPackageJsonPath = (0, devkit_1.joinPathFragments)(project.root, 'package.json');
|
|
43
46
|
if (!tree.exists(projectPackageJsonPath)) {
|
|
@@ -79,9 +82,9 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
79
82
|
'@types/express',
|
|
80
83
|
'@modelcontextprotocol/inspector',
|
|
81
84
|
]);
|
|
82
|
-
// Add hosting based on
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
85
|
+
// Add hosting based on infra
|
|
86
|
+
if (infra === 'agentcore') {
|
|
87
|
+
const containers = await (0, containers_1.resolveContainers)(tree, 'inherit');
|
|
85
88
|
const dockerImageTag = `${(0, npm_scope_1.getNpmScope)(tree)}-${name}:latest`;
|
|
86
89
|
// Add bundle target
|
|
87
90
|
await (0, bundle_1.addTypeScriptBundleTarget)(tree, project, {
|
|
@@ -98,7 +101,7 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
98
101
|
options: {
|
|
99
102
|
commands: [
|
|
100
103
|
fs.cp(`${targetSourceDir}/Dockerfile`, `${dockerOutputDir}/Dockerfile`),
|
|
101
|
-
`${
|
|
104
|
+
`${containers} build --platform linux/arm64 -t ${dockerImageTag} ${dockerOutputDir}`,
|
|
102
105
|
],
|
|
103
106
|
parallel: false,
|
|
104
107
|
},
|
|
@@ -107,8 +110,8 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
107
110
|
(0, nx_1.addDependencyToTargetIfNotPresent)(project, 'docker', dockerTargetName);
|
|
108
111
|
(0, nx_1.addDependencyToTargetIfNotPresent)(project, 'build', 'docker');
|
|
109
112
|
// Add shared constructs
|
|
110
|
-
const
|
|
111
|
-
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
113
|
+
const iac = await (0, iac_1.resolveIac)(tree, options.iac);
|
|
114
|
+
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, { iac });
|
|
112
115
|
// Add the construct to deploy the mcp server
|
|
113
116
|
await (0, agent_core_constructs_1.addMcpServerInfra)(tree, {
|
|
114
117
|
mcpServerNameKebabCase: name,
|
|
@@ -116,9 +119,9 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
116
119
|
projectName: project.name,
|
|
117
120
|
dockerImageTag,
|
|
118
121
|
dockerOutputDir,
|
|
119
|
-
|
|
122
|
+
iac,
|
|
120
123
|
auth,
|
|
121
|
-
|
|
124
|
+
containers,
|
|
122
125
|
});
|
|
123
126
|
}
|
|
124
127
|
else {
|
|
@@ -142,10 +145,14 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
142
145
|
return packageJson;
|
|
143
146
|
});
|
|
144
147
|
}
|
|
145
|
-
const localDevPort = (0, port_1.assignPort)(tree, project, 8000
|
|
148
|
+
const localDevPort = (0, port_1.assignPort)(tree, project, 8000, {
|
|
149
|
+
component: { info: exports.TS_MCP_SERVER_GENERATOR_INFO, name: mcpTargetPrefix },
|
|
150
|
+
});
|
|
146
151
|
(0, devkit_1.updateProjectConfiguration)(tree, project.name, {
|
|
147
152
|
...project,
|
|
148
|
-
targets
|
|
153
|
+
// Sort targets so their order is stable regardless of insertion order on
|
|
154
|
+
// first run vs re-run.
|
|
155
|
+
targets: (0, object_1.sortObjectKeys)({
|
|
149
156
|
...project.targets,
|
|
150
157
|
// Add targets for running the MCP server
|
|
151
158
|
[`${mcpTargetPrefix}-serve-stdio`]: {
|
|
@@ -180,6 +187,20 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
180
187
|
continuous: true,
|
|
181
188
|
},
|
|
182
189
|
[`${mcpTargetPrefix}-inspect`]: {
|
|
190
|
+
executor: 'nx:run-commands',
|
|
191
|
+
// Launch the inspector against the locally served (serve-local) HTTP
|
|
192
|
+
// server. serve-local starts the server and any connected dependencies
|
|
193
|
+
// (e.g. a local database).
|
|
194
|
+
dependsOn: [`${mcpTargetPrefix}-serve-local`],
|
|
195
|
+
options: {
|
|
196
|
+
commands: [
|
|
197
|
+
`mcp-inspector --transport http --server-url http://localhost:${localDevPort}/mcp`,
|
|
198
|
+
],
|
|
199
|
+
cwd: '{projectRoot}',
|
|
200
|
+
},
|
|
201
|
+
continuous: true,
|
|
202
|
+
},
|
|
203
|
+
[`${mcpTargetPrefix}-inspect-stdio`]: {
|
|
183
204
|
executor: 'nx:run-commands',
|
|
184
205
|
options: {
|
|
185
206
|
commands: [
|
|
@@ -189,7 +210,7 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
189
210
|
},
|
|
190
211
|
continuous: true,
|
|
191
212
|
},
|
|
192
|
-
},
|
|
213
|
+
}),
|
|
193
214
|
});
|
|
194
215
|
(0, nx_1.addComponentGeneratorMetadata)(tree, project.name, exports.TS_MCP_SERVER_GENERATOR_INFO, targetSourceDirRelativeToProjectRoot, mcpTargetPrefix, {
|
|
195
216
|
port: localDevPort,
|
|
@@ -197,6 +218,7 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
197
218
|
auth,
|
|
198
219
|
});
|
|
199
220
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [exports.TS_MCP_SERVER_GENERATOR_INFO]);
|
|
221
|
+
await (0, config_1.ensureLicenseExceptions)(tree, known_exceptions_1.MCP_INSPECTOR_EXCEPTIONS);
|
|
200
222
|
await (0, format_1.formatFilesInSubtree)(tree);
|
|
201
223
|
return () => {
|
|
202
224
|
(0, devkit_1.installPackagesTask)(tree);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/mcp-server/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAaoB;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/mcp-server/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAaoB;AACpB,iDAA+D;AAC/D,qEAA0E;AAC1E,mGAA4F;AAC5F,sDAAsE;AACtE,uDAA2D;AAC3D,+CAA0D;AAC1D,uCAA4C;AAC5C,yCAA6C;AAC7C,iDAAsE;AACtE,6CAA2D;AAC3D,qDAAoD;AACpD,uCAMwB;AACxB,+CAAoD;AACpD,2CAA8C;AAC9C,qEAA0E;AAC1E,mDAAiE;AAGpD,QAAA,4BAA4B,GACvC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,oBAAoB,GAAG,KAAK,EACvC,IAAU,EACV,OAAmC,EACP,EAAE;IAC9B,MAAM,OAAO,GAAG,IAAA,wCAAmC,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAE3E,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC;QACnE,MA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AO,EAAE;oBACP,QAAQ,EAAE;wBACR,gCAAgC,iBAAiB,WAAW;qBAC7D;oBACD,GAAG,EAAE,eAAe;iBACrB;gBACD,UAAU,EAAE,IAAI;aACjB;SACF,CAAC;KACH,CAAC,CAAC;IAEH,IAAA,kCAA6B,EAC3B,IAAI,EACJ,OAAO,CAAC,IAAI,EACZ,oCAA4B,EAC5B,oCAAoC,EACpC,eAAe,EACf;QACE,IAAI,EAAE,YAAY;QAClB,EAAE,EAAE,sBAAsB;QAC1B,IAAI;KACL,CACF,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,oCAA4B,CAAC,CAAC,CAAC;IAE5E,MAAM,IAAA,gCAAuB,EAAC,IAAI,EAAE,2CAAwB,CAAC,CAAC;IAE9D,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAvQW,QAAA,oBAAoB,wBAuQ/B;AAEF,kBAAe,4BAAoB,CAAC"}
|
|
@@ -3,20 +3,16 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IacOption } from '../../utils/iac';
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type TsMcpServerInfra = 'none' | 'agentcore';
|
|
9
9
|
|
|
10
|
-
export type TsMcpServerAuth = '
|
|
10
|
+
export type TsMcpServerAuth = 'iam' | 'cognito';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* TypeScript types for options defined in schema.json
|
|
14
|
-
* Update this to match schema.json if you make changes.
|
|
15
|
-
*/
|
|
16
12
|
export interface TsMcpServerGeneratorSchema {
|
|
17
13
|
project: string;
|
|
18
14
|
name?: string;
|
|
19
|
-
|
|
15
|
+
infra?: TsMcpServerInfra;
|
|
20
16
|
auth?: TsMcpServerAuth;
|
|
21
|
-
|
|
17
|
+
iac: IacOption;
|
|
22
18
|
}
|
|
@@ -15,14 +15,6 @@
|
|
|
15
15
|
"x-prompt": "Select the TypeScript project to add the MCP server to",
|
|
16
16
|
"x-dropdown": "projects"
|
|
17
17
|
},
|
|
18
|
-
"computeType": {
|
|
19
|
-
"type": "string",
|
|
20
|
-
"description": "The type of compute to host your MCP server. Select None for no hosting.",
|
|
21
|
-
"x-prompt": "How would you like to host your MCP server?",
|
|
22
|
-
"enum": ["BedrockAgentCoreRuntime", "None"],
|
|
23
|
-
"default": "BedrockAgentCoreRuntime",
|
|
24
|
-
"x-priority": "important"
|
|
25
|
-
},
|
|
26
18
|
"name": {
|
|
27
19
|
"type": "string",
|
|
28
20
|
"description": "The name of your MCP server (default: mcp-server)",
|
|
@@ -30,19 +22,27 @@
|
|
|
30
22
|
},
|
|
31
23
|
"auth": {
|
|
32
24
|
"type": "string",
|
|
33
|
-
"description": "The method used to authenticate with your MCP server. Only applicable when
|
|
34
|
-
"default": "
|
|
35
|
-
"enum": ["
|
|
25
|
+
"description": "The method used to authenticate with your MCP server. Only applicable when infra is set (ignored when infra is none).",
|
|
26
|
+
"default": "iam",
|
|
27
|
+
"enum": ["iam", "cognito"],
|
|
36
28
|
"x-prompt": "How would you like to authenticate with your MCP server?",
|
|
37
29
|
"x-priority": "important"
|
|
38
30
|
},
|
|
39
|
-
"
|
|
31
|
+
"iac": {
|
|
40
32
|
"type": "string",
|
|
41
33
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
42
|
-
"enum": ["
|
|
34
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
43
35
|
"x-priority": "important",
|
|
44
|
-
"default": "
|
|
45
|
-
"x-prompt": "Which provider would you like to manage your infrastructure? (default:
|
|
36
|
+
"default": "inherit",
|
|
37
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
38
|
+
},
|
|
39
|
+
"infra": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "The type of infrastructure to host your MCP server. Select none for no hosting.",
|
|
42
|
+
"x-prompt": "How would you like to host your MCP server?",
|
|
43
|
+
"enum": ["agentcore", "none"],
|
|
44
|
+
"default": "agentcore",
|
|
45
|
+
"x-priority": "important"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"required": ["project"]
|
|
@@ -33,7 +33,7 @@ You can generate a foo#bar in two ways:
|
|
|
33
33
|
The generator will create the following project files:
|
|
34
34
|
|
|
35
35
|
<FileTree>
|
|
36
|
-
|
|
36
|
+
- todo.txt Update this section with what your generator generates!
|
|
37
37
|
</FileTree>
|
|
38
38
|
|
|
39
39
|
### Infrastructure
|
|
@@ -41,19 +41,24 @@ The generator will create the following project files:
|
|
|
41
41
|
<Snippet name="shared-constructs" />
|
|
42
42
|
|
|
43
43
|
<Infrastructure>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
any
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
<Fragment slot="cdk">
|
|
45
|
+
<FileTree>
|
|
46
|
+
- packages/common/constructs/src
|
|
47
|
+
- app
|
|
48
|
+
- todo.txt document app specific cdk constructs if any
|
|
49
|
+
- core
|
|
50
|
+
- todo.txt document core cdk constructs if any
|
|
51
|
+
</FileTree>
|
|
52
|
+
</Fragment>
|
|
53
|
+
<Fragment slot="terraform">
|
|
54
|
+
<FileTree>
|
|
55
|
+
- packages/common/terraform/src
|
|
56
|
+
- app
|
|
57
|
+
- todo.txt document app specific tf modules if any
|
|
58
|
+
- core
|
|
59
|
+
- todo.txt document core tf modules if any
|
|
60
|
+
</FileTree>
|
|
61
|
+
</Fragment>
|
|
57
62
|
</Infrastructure>
|
|
58
63
|
|
|
59
64
|
:::danger
|
|
@@ -93,7 +98,7 @@ describe('foo#bar generator', () => {
|
|
|
93
98
|
});
|
|
94
99
|
|
|
95
100
|
it('should add generator metric to app.ts', async () => {
|
|
96
|
-
await sharedConstructsGenerator(tree, {
|
|
101
|
+
await sharedConstructsGenerator(tree, { iac: 'cdk' });
|
|
97
102
|
|
|
98
103
|
await fooBarGenerator(tree, { exampleOption: 'example' });
|
|
99
104
|
|
|
@@ -18,7 +18,7 @@ describe('<%- name %> generator', () => {
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
it('should add generator metric to app.ts', async () => {
|
|
21
|
-
await sharedConstructsGenerator(tree, {
|
|
21
|
+
await sharedConstructsGenerator(tree, { iac: 'cdk' });
|
|
22
22
|
|
|
23
23
|
await <%- nameCamelCase %>Generator(tree, { exampleOption: 'example' });
|
|
24
24
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
6
|
-
import { TsNxGeneratorGeneratorSchema } from './schema';
|
|
5
|
+
import { type GeneratorCallback, type Tree } from '@nx/devkit';
|
|
6
|
+
import type { TsNxGeneratorGeneratorSchema } from './schema';
|
|
7
7
|
export declare const NX_GENERATOR_GENERATOR_INFO: import("../../utils/generators").GeneratorInfo;
|
|
8
8
|
export declare const tsNxGeneratorGenerator: (tree: Tree, options: TsNxGeneratorGeneratorSchema) => Promise<GeneratorCallback | void>;
|
|
9
9
|
export default tsNxGeneratorGenerator;
|
|
@@ -7,16 +7,16 @@ const tslib_1 = require("tslib");
|
|
|
7
7
|
* SPDX-License-Identifier: Apache-2.0
|
|
8
8
|
*/
|
|
9
9
|
const devkit_1 = require("@nx/devkit");
|
|
10
|
-
const names_1 = require("../../utils/names");
|
|
11
10
|
const lodash_camelcase_1 = tslib_1.__importDefault(require("lodash.camelcase"));
|
|
12
|
-
const
|
|
11
|
+
const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
|
|
13
12
|
const ast_1 = require("../../utils/ast");
|
|
14
|
-
const nx_1 = require("../../utils/nx");
|
|
15
|
-
const metrics_1 = require("../../utils/metrics");
|
|
16
13
|
const format_1 = require("../../utils/format");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
14
|
+
const metrics_1 = require("../../utils/metrics");
|
|
15
|
+
const names_1 = require("../../utils/names");
|
|
16
|
+
const nx_1 = require("../../utils/nx");
|
|
19
17
|
const object_1 = require("../../utils/object");
|
|
18
|
+
const paths_1 = require("../../utils/paths");
|
|
19
|
+
const utils_1 = require("../nx-plugin/utils");
|
|
20
20
|
exports.NX_GENERATOR_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
21
21
|
const tsNxGeneratorGenerator = async (tree, options) => {
|
|
22
22
|
const { name, directory, project: pluginProject, description } = options;
|
|
@@ -44,10 +44,10 @@ const tsNxGeneratorGenerator = async (tree, options) => {
|
|
|
44
44
|
generatorDir,
|
|
45
45
|
generatorSubDir,
|
|
46
46
|
};
|
|
47
|
-
// Add the common files
|
|
47
|
+
// Add the common files, preserving any the user has already implemented
|
|
48
48
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'common'), generatorDir, {
|
|
49
49
|
...enhancedOptions,
|
|
50
|
-
});
|
|
50
|
+
}, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
51
51
|
// Add the files specific to this repo vs a local generator in another project
|
|
52
52
|
if (isNxPluginForAws) {
|
|
53
53
|
// Generators should be in the @aws/nx-plugin project
|
|
@@ -57,11 +57,11 @@ const tsNxGeneratorGenerator = async (tree, options) => {
|
|
|
57
57
|
// Add the generator
|
|
58
58
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'nx-plugin-for-aws', 'generator'), generatorDir, {
|
|
59
59
|
...enhancedOptions,
|
|
60
|
-
});
|
|
60
|
+
}, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
61
61
|
// Generate guide page in docs
|
|
62
62
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'nx-plugin-for-aws', 'docs'), (0, devkit_1.joinPathFragments)('docs', 'src', 'content', 'docs', 'en', 'guides'), {
|
|
63
63
|
...enhancedOptions,
|
|
64
|
-
});
|
|
64
|
+
}, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
65
65
|
// Update the docs config to add the page entry to the Generator guides sidebar section
|
|
66
66
|
await (0, ast_1.applyGritQL)(tree, (0, devkit_1.joinPathFragments)('docs', 'astro.config.mjs'), `\`items: [$items]\` where { $items <: within \`sidebar: [$_]\`, $items <: contains \`'ts#project'\`, $items <: not contains \`'/guides/${enhancedOptions.nameKebabCase}'\`, $items += \`, { label: '${name}', link: '/guides/${enhancedOptions.nameKebabCase}' }\` }`);
|
|
67
67
|
}
|
|
@@ -69,7 +69,7 @@ const tsNxGeneratorGenerator = async (tree, options) => {
|
|
|
69
69
|
// Local generator in a project other than nx-plugin-for-aws
|
|
70
70
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'local'), generatorDir, {
|
|
71
71
|
...enhancedOptions,
|
|
72
|
-
});
|
|
72
|
+
}, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
73
73
|
const indexPath = (0, devkit_1.joinPathFragments)(sourceRoot, 'index.ts');
|
|
74
74
|
if (tree.exists(indexPath)) {
|
|
75
75
|
await (0, ast_1.addStarExport)(tree, indexPath, `./${generatorSubDir}/generator`);
|
|
@@ -82,7 +82,17 @@ const tsNxGeneratorGenerator = async (tree, options) => {
|
|
|
82
82
|
const generatorsJson = tree.exists(generatorsJsonPath)
|
|
83
83
|
? (0, devkit_1.readJson)(tree, generatorsJsonPath)
|
|
84
84
|
: { generators: {} };
|
|
85
|
-
|
|
85
|
+
// Metrics are only tracked within the @aws/nx-plugin repo. Reuse the existing
|
|
86
|
+
// metric for a same-name re-run, otherwise allocate a new one.
|
|
87
|
+
let metric;
|
|
88
|
+
if (isNxPluginForAws) {
|
|
89
|
+
const existingMetrics = Object.values(generatorsJson?.generators ?? {})
|
|
90
|
+
.map((g) => g.metric)
|
|
91
|
+
.filter((m) => typeof m === 'string');
|
|
92
|
+
metric =
|
|
93
|
+
generatorsJson?.generators?.[name]?.metric ??
|
|
94
|
+
(existingMetrics.length > 0 ? incrementMetric(existingMetrics) : 'g1');
|
|
95
|
+
}
|
|
86
96
|
(0, devkit_1.writeJson)(tree, generatorsJsonPath, {
|
|
87
97
|
...generatorsJson,
|
|
88
98
|
generators: (0, object_1.sortObjectKeys)({
|
|
@@ -91,13 +101,7 @@ const tsNxGeneratorGenerator = async (tree, options) => {
|
|
|
91
101
|
factory: `${factoryBasePath}/generator`,
|
|
92
102
|
schema: `${factoryBasePath}/schema.json`,
|
|
93
103
|
description: description ?? 'TODO: Add short description of the generator',
|
|
94
|
-
...(isNxPluginForAws
|
|
95
|
-
? {
|
|
96
|
-
metric: existingGenerators.length > 0
|
|
97
|
-
? incrementMetric(Object.values(existingGenerators).map((g) => g.metric))
|
|
98
|
-
: 'g1',
|
|
99
|
-
}
|
|
100
|
-
: {}),
|
|
104
|
+
...(isNxPluginForAws ? { metric } : {}),
|
|
101
105
|
},
|
|
102
106
|
}),
|
|
103
107
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/nx-generator/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/nx-generator/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCASoB;AACpB,gFAAyC;AACzC,iFAAgD;AAChD,yCAA6D;AAC7D,+CAA0D;AAC1D,iDAAsE;AACtE,6CAAqE;AACrE,uCAIwB;AACxB,+C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CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,OAAO,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;AAC7B,CAAC,CAAC;AAEF,kBAAe,8BAAsB,CAAC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { type GeneratorCallback, type Tree } from '@nx/devkit';
|
|
6
|
+
import { type NxGeneratorInfo } from '../../utils/nx';
|
|
7
|
+
import type { TsNxPluginGeneratorSchema } from './schema';
|
|
8
8
|
export declare const TS_NX_PLUGIN_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
9
|
export declare const tsNxPluginGenerator: (tree: Tree, options: TsNxPluginGeneratorSchema) => Promise<GeneratorCallback>;
|
|
10
10
|
export default tsNxPluginGenerator;
|
|
@@ -7,12 +7,13 @@ const tslib_1 = require("tslib");
|
|
|
7
7
|
* SPDX-License-Identifier: Apache-2.0
|
|
8
8
|
*/
|
|
9
9
|
const devkit_1 = require("@nx/devkit");
|
|
10
|
-
const nx_1 = require("../../utils/nx");
|
|
11
|
-
const metrics_1 = require("../../utils/metrics");
|
|
12
10
|
const format_1 = require("../../utils/format");
|
|
11
|
+
const metrics_1 = require("../../utils/metrics");
|
|
12
|
+
const nx_1 = require("../../utils/nx");
|
|
13
|
+
const object_1 = require("../../utils/object");
|
|
13
14
|
const generator_1 = tslib_1.__importStar(require("../lib/generator"));
|
|
14
|
-
const utils_1 = require("./utils");
|
|
15
15
|
const generator_2 = tslib_1.__importDefault(require("../mcp-server/generator"));
|
|
16
|
+
const utils_1 = require("./utils");
|
|
16
17
|
exports.TS_NX_PLUGIN_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
17
18
|
const tsNxPluginGenerator = async (tree, options) => {
|
|
18
19
|
// Generate a TypeScript project as the base
|
|
@@ -59,20 +60,20 @@ const tsNxPluginGenerator = async (tree, options) => {
|
|
|
59
60
|
},
|
|
60
61
|
},
|
|
61
62
|
build: {
|
|
62
|
-
|
|
63
|
-
...(project.targets?.build?.dependsOn ?? []).filter((d) => typeof d !== 'string' || d !== 'package'),
|
|
64
|
-
'package',
|
|
65
|
-
],
|
|
63
|
+
...project.targets?.build,
|
|
66
64
|
},
|
|
67
65
|
};
|
|
66
|
+
// Append the package dependency without moving an existing entry, so re-runs
|
|
67
|
+
// do not reorder the build dependencies.
|
|
68
|
+
(0, nx_1.addDependencyToTargetIfNotPresent)(project, 'build', 'package');
|
|
69
|
+
// Sort targets so their order is stable regardless of insertion order.
|
|
70
|
+
project.targets = (0, object_1.sortObjectKeys)(project.targets);
|
|
68
71
|
(0, devkit_1.updateProjectConfiguration)(tree, fullyQualifiedName, project);
|
|
69
|
-
// Remove the hello world example from index.ts
|
|
70
|
-
tree.write((0, devkit_1.joinPathFragments)(project.sourceRoot, 'index.ts'), '');
|
|
71
72
|
// Add an MCP Server
|
|
72
73
|
await (0, generator_2.default)(tree, {
|
|
73
74
|
project: fullyQualifiedName,
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
infra: 'none',
|
|
76
|
+
iac: 'cdk', // not used
|
|
76
77
|
});
|
|
77
78
|
const mcpPath = (0, devkit_1.joinPathFragments)(project.sourceRoot, 'mcp-server');
|
|
78
79
|
const mcpServerPath = (0, devkit_1.joinPathFragments)(mcpPath, 'server.ts');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/nx-plugin/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCASoB;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/nx-plugin/generator.ts"],"names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tD,CAAC;IAEF,IAAA,yBAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,mCAA2B,CAAC,CAAC;IAEtE,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,mCAA2B,CAAC,CAAC,CAAC;IAE3E,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AA9FW,QAAA,mBAAmB,uBA8F9B;AAEF,kBAAe,2BAAmB,CAAC"}
|
|
@@ -7,9 +7,9 @@ const tslib_1 = require("tslib");
|
|
|
7
7
|
* SPDX-License-Identifier: Apache-2.0
|
|
8
8
|
*/
|
|
9
9
|
const devkit_1 = require("@nx/devkit");
|
|
10
|
+
const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
|
|
10
11
|
const nx_1 = require("../../utils/nx");
|
|
11
12
|
const versions_1 = require("../../utils/versions");
|
|
12
|
-
const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
|
|
13
13
|
/**
|
|
14
14
|
* Configures a TypeScript project as an Nx Plugin
|
|
15
15
|
*/
|
|
@@ -22,10 +22,16 @@ const configureTsProjectAsNxPlugin = (tree, projectName) => {
|
|
|
22
22
|
// Nx Plugins must use commonjs as a limitation of nx
|
|
23
23
|
// https://github.com/nrwl/nx/issues/15682
|
|
24
24
|
(0, devkit_1.updateJson)(tree, tsConfigPath, (tsConfig) => {
|
|
25
|
-
tsConfig.compilerOptions
|
|
26
|
-
|
|
25
|
+
const { module, moduleResolution, ...rest } = tsConfig.compilerOptions ?? {};
|
|
26
|
+
// Reassign module/moduleResolution last in a fixed order so re-running
|
|
27
|
+
// produces a stable key order regardless of whether a prior step removed
|
|
28
|
+
// `module` (eg configureTsProject drops a conflicting commonjs module).
|
|
27
29
|
// TypeScript 6 allows bundler + commonjs together, avoiding deprecated node/node10
|
|
28
|
-
tsConfig.compilerOptions
|
|
30
|
+
tsConfig.compilerOptions = {
|
|
31
|
+
...rest,
|
|
32
|
+
module: module ?? 'commonjs',
|
|
33
|
+
moduleResolution: moduleResolution ?? 'bundler',
|
|
34
|
+
};
|
|
29
35
|
return tsConfig;
|
|
30
36
|
});
|
|
31
37
|
// Create an empty generators.json if one dosn't exist
|