@aws/nx-plugin 1.0.0-rc.32 → 1.0.0-rc.34
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 +75 -86
- package/generators.json +27 -0
- package/package.json +10 -10
- package/src/connection/generator.js +12 -1
- package/src/connection/generator.js.map +1 -1
- package/src/connection/supported-connections.d.ts +10 -1
- package/src/connection/supported-connections.js +13 -0
- package/src/connection/supported-connections.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +21 -21
- package/src/infra/app/files/app/src/main.ts.template +1 -1
- package/src/infra/app/files/app/src/stages/application-stage.ts.template +1 -1
- package/src/infra/app/generator.js +3 -1
- package/src/infra/app/generator.js.map +1 -1
- package/src/open-api/ts-client/__snapshots__/generator.complex-types.spec.ts.snap +12 -12
- package/src/open-api/ts-client/__snapshots__/generator.composite-types.spec.ts.snap +74 -10
- package/src/open-api/ts-client/__snapshots__/generator.content-type.spec.ts.snap +22 -4
- package/src/open-api/ts-client/__snapshots__/generator.duplicate-types.spec.ts.snap +53 -8
- package/src/open-api/ts-client/__snapshots__/generator.edge-cases.spec.ts.snap +32 -4
- package/src/open-api/ts-client/__snapshots__/generator.fast-api-gaps.spec.ts.snap +736 -0
- package/src/open-api/ts-client/__snapshots__/generator.fast-api.spec.ts.snap +86 -11
- package/src/open-api/ts-client/__snapshots__/generator.multipart.spec.ts.snap +21 -3
- package/src/open-api/ts-client/__snapshots__/generator.primitive-types.spec.ts.snap +2 -2
- package/src/open-api/ts-client/__snapshots__/generator.request.spec.ts.snap +6 -6
- package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +2 -2
- package/src/open-api/ts-client/__snapshots__/generator.spec-compliance.spec.ts.snap +1883 -0
- package/src/open-api/ts-client/__snapshots__/generator.tags.spec.ts.snap +4 -4
- package/src/open-api/ts-client/files/client.gen.ts.template +196 -13
- package/src/open-api/ts-client/files/types.gen.ts.template +2 -0
- package/src/open-api/ts-client/generator.js +27 -2
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-hooks/files/options-proxy.gen.ts.template +2 -2
- package/src/open-api/ts-hooks/generator.js +5 -1
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/utils/codegen-data/languages.js +6 -0
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data/types.d.ts +16 -1
- package/src/open-api/utils/codegen-data/types.js.map +1 -1
- package/src/open-api/utils/codegen-data.js +71 -0
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.js +53 -8
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parser.js +48 -15
- package/src/open-api/utils/parser.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +5 -3
- package/src/preset/generator.d.ts +1 -1
- package/src/preset/generator.js +5 -2
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.js.map +1 -1
- package/src/preset/schema.d.ts +2 -0
- package/src/preset/schema.json +6 -0
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +7 -7
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +8 -8
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +89 -3
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +12 -12
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +91 -5
- package/src/py/rdb/__snapshots__/generator.spec.ts.snap +2038 -0
- package/src/py/rdb/agent-connection/__snapshots__/generator.spec.ts.snap +104 -0
- package/src/py/rdb/agent-connection/generator.d.ts +10 -0
- package/src/py/rdb/agent-connection/generator.js +46 -0
- package/src/py/rdb/agent-connection/generator.js.map +1 -0
- package/src/py/rdb/agent-connection/schema.d.js +8 -0
- package/src/py/rdb/agent-connection/schema.d.js.map +1 -0
- package/src/py/rdb/agent-connection/schema.d.ts +15 -0
- package/src/py/rdb/agent-connection/schema.json +27 -0
- package/src/py/rdb/fast-api-connection/__snapshots__/generator.spec.ts.snap +44 -0
- package/src/py/rdb/fast-api-connection/files/__apiModuleName__/dependencies/__rdbNameSnake__.py.template +14 -0
- package/src/py/rdb/fast-api-connection/generator.d.ts +10 -0
- package/src/py/rdb/fast-api-connection/generator.js +54 -0
- package/src/py/rdb/fast-api-connection/generator.js.map +1 -0
- package/src/py/rdb/fast-api-connection/schema.d.js +8 -0
- package/src/py/rdb/fast-api-connection/schema.d.js.map +1 -0
- package/src/py/rdb/fast-api-connection/schema.d.ts +13 -0
- package/src/py/rdb/fast-api-connection/schema.json +23 -0
- package/src/py/rdb/files/Dockerfile.create-db-user.template +10 -0
- package/src/py/rdb/files/Dockerfile.migration.template +10 -0
- package/src/py/rdb/files/__name__/__init__.py.template +3 -0
- package/src/py/rdb/files/__name__/connection.py.template +55 -0
- package/src/py/rdb/files/__name__/create_db_user_handler.py.template +97 -0
- package/src/py/rdb/files/__name__/migration_handler.py.template +36 -0
- package/src/py/rdb/files/__name__/models/__init__.py.template +3 -0
- package/src/py/rdb/files/__name__/models/example.py.template +8 -0
- package/src/py/rdb/files/__name__/utils.py.template +104 -0
- package/src/py/rdb/files/alembic.ini.template +38 -0
- package/src/py/rdb/files/config.json.template +14 -0
- package/src/py/rdb/files/migrations/env.py.template +80 -0
- package/src/py/rdb/files/migrations/script.py.mako.template +28 -0
- package/src/py/rdb/generator.d.ts +6 -0
- package/src/py/rdb/generator.js +263 -0
- package/src/py/rdb/generator.js.map +1 -0
- package/src/py/rdb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +101 -0
- package/src/py/rdb/mcp-server-connection/generator.d.ts +10 -0
- package/src/py/rdb/mcp-server-connection/generator.js +46 -0
- package/src/py/rdb/mcp-server-connection/generator.js.map +1 -0
- package/src/py/rdb/mcp-server-connection/schema.d.js +8 -0
- package/src/py/rdb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/py/rdb/mcp-server-connection/schema.d.ts +15 -0
- package/src/py/rdb/mcp-server-connection/schema.json +27 -0
- package/src/py/rdb/schema.d.js +6 -0
- package/src/py/rdb/schema.d.js.map +1 -0
- package/src/py/rdb/schema.d.ts +16 -0
- package/src/py/rdb/schema.json +77 -0
- package/src/py/rdb/utils.d.ts +6 -0
- package/src/py/rdb/utils.js +16 -0
- package/src/py/rdb/utils.js.map +1 -0
- package/src/sdk/py.d.ts +2 -0
- package/src/sdk/py.js +1 -0
- package/src/sdk/py.js.map +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +7 -7
- package/src/smithy/ts/api/files/handler.ts.template +2 -2
- package/src/smithy/ts/api/files/local-server.ts.template +2 -2
- package/src/smithy/ts/api/files/operations/echo.ts.template +2 -2
- package/src/smithy/ts/api/files/service.ts.template +3 -3
- package/src/smithy/ts/api/generator.js +3 -1
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +12 -12
- package/src/trpc/backend/files/src/client/index.ts.template +1 -1
- package/src/trpc/backend/files/src/handler.ts.template +1 -1
- package/src/trpc/backend/files/src/index.ts.template +5 -5
- package/src/trpc/backend/files/src/init.ts.template +1 -1
- package/src/trpc/backend/files/src/local-server.ts.template +1 -1
- package/src/trpc/backend/files/src/middleware/index.ts.template +7 -7
- package/src/trpc/backend/files/src/procedures/echo.ts.template +2 -2
- package/src/trpc/backend/files/src/router.ts.template +2 -2
- package/src/trpc/backend/files/src/schema/index.ts.template +1 -1
- package/src/trpc/backend/generator.js +3 -1
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +89 -3
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client-strands.ts.template +2 -2
- package/src/ts/agent/a2a-connection/generator.js +3 -1
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/a2a/index.ts.template +1 -1
- package/src/ts/agent/files/ag-ui/index.ts.template +1 -1
- package/src/ts/agent/files/http/client.ts.template +2 -2
- package/src/ts/agent/files/http/index.ts.template +2 -2
- package/src/ts/agent/files/http/router.ts.template +3 -3
- package/src/ts/agent/gateway-connection/files/agent-connection/app/__gatewayKebabCase__-client-strands.ts.template +2 -2
- package/src/ts/agent/gateway-connection/generator.js +3 -1
- package/src/ts/agent/gateway-connection/generator.js.map +1 -1
- package/src/ts/agent/generator.js +5 -2
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +2 -2
- package/src/ts/agent/mcp-connection/generator.js +3 -1
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/astro-docs/files/translation/scripts/translate.ts.template +3 -2
- package/src/ts/astro-docs/generator.js +2 -0
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/dynamodb/files/src/client.ts.template +5 -2
- package/src/ts/dynamodb/files/src/entities/example.ts.template +1 -1
- package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -1
- package/src/ts/dynamodb/files/src/index.ts.template +2 -2
- package/src/ts/dynamodb/generator.js +3 -1
- package/src/ts/dynamodb/generator.js.map +1 -1
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/lib/generator.js +7 -1
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/ts-project-utils.js +19 -4
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/types.d.ts +6 -0
- package/src/ts/lib/types.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +94 -8
- package/src/ts/mcp-server/generator.js +3 -2
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/nx-generator/files/local/generator.ts.template +2 -2
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +2 -2
- package/src/ts/nx-generator/generator.js +5 -2
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-plugin/files/mcp-server/server.ts.template +5 -5
- package/src/ts/nx-plugin/files/mcp-server/tools/create-workspace-command.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/general-guidance.ts.template +1 -1
- package/src/ts/nx-plugin/files/mcp-server/tools/generator-guide.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/list-generators.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/utils.ts.template +3 -3
- package/src/ts/nx-plugin/generator.js +3 -1
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/utils.js +7 -4
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +149 -177
- package/src/ts/rdb/files/src/create-db-user-handler.ts.template +2 -2
- package/src/ts/rdb/files/src/index.ts.template +1 -1
- package/src/ts/rdb/files/src/migration-handler.ts.template +1 -1
- package/src/ts/rdb/files/src/prisma.ts.template +7 -4
- package/src/ts/rdb/generator.js +7 -4
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/schema.json +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +45 -45
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +2 -2
- package/src/utils/agent-chat/agent-chat.js +3 -1
- package/src/utils/agent-chat/agent-chat.js.map +1 -1
- package/src/utils/agent-chat/files/a2a/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/ag-ui/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/http-py/chat.ts.template +2 -2
- package/src/utils/agent-chat/files/http-ts/chat.ts.template +1 -1
- package/src/utils/agent-connection/agent-connection.js +4 -1
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client-config.ts.template +2 -2
- package/src/utils/agent-connection/files/core-auth/agentcore-fetch.ts.template +1 -1
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +2 -2
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-transport.ts.template +2 -2
- package/src/utils/agent-connection/files/core-shared/agentcore-transport.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/a2a/agentcore-a2a-client-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/base/with-session-id-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/gateway/agentcore-gateway-mcp-client-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/mcp/agentcore-mcp-client-strands.ts.template +1 -1
- package/src/utils/agent-core-constructs/agent-core-constructs.js +10 -3
- 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 +3 -3
- package/src/utils/agent-core-constructs/files/cdk/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.ts.template +4 -4
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +1 -1
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +27 -0
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +60 -1
- package/src/utils/api-constructs/api-constructs.js +8 -2
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +8 -8
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +8 -8
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +3 -3
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account/index.js.template +32 -20
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account.ts.template +1 -1
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +4 -4
- package/src/utils/api-constructs/files/cdk/core/api/trpc/trpc-utils.ts.template +1 -1
- package/src/utils/ast.js +16 -0
- package/src/utils/ast.js.map +1 -1
- package/src/utils/commands.d.ts +1 -1
- package/src/utils/commands.js +4 -1
- package/src/utils/commands.js.map +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +9 -2
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -1
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +3 -3
- package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +1 -1
- package/src/utils/files/common/constructs/src/core/index.ts.template +4 -4
- package/src/utils/files/common/constructs/src/index.ts.template +2 -2
- package/src/utils/files/common/infra-config/src/index.ts.template +3 -3
- package/src/utils/files/common/infra-config/src/resolve-stage.ts.template +2 -2
- package/src/utils/files/common/infra-config/src/stages.config.ts.template +1 -1
- package/src/utils/files/common/scripts/src/infra/infra-deploy.ts.template +1 -1
- package/src/utils/files/common/scripts/src/infra/infra-destroy.ts.template +1 -1
- package/src/utils/files/common/scripts/src/infra/stage-credentials/run.ts.template +3 -3
- package/src/utils/files/common/shadcn/src/index.ts.template +2 -2
- package/src/utils/function-constructs/files/cdk/app/lambda-functions/__nameKebabCase__.ts.template +1 -1
- package/src/utils/function-constructs/function-constructs.js +3 -1
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +2 -2
- package/src/utils/identity-constructs/identity-constructs.js +5 -1
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/module-format.d.ts +28 -0
- package/src/utils/module-format.js +28 -0
- package/src/utils/module-format.js.map +1 -0
- package/src/utils/rdb-constructs/files/cdk/app/dbs/__nameKebabCase__.ts.template +61 -17
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +68 -78
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +88 -8
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +5 -32
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +11 -1
- package/src/utils/rdb-constructs/rdb-constructs.js +9 -2
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs.js +12 -22
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-infra-config.js +3 -1
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-infra-scripts.js +3 -1
- package/src/utils/shared-infra-scripts.js.map +1 -1
- package/src/utils/shared-rdb-scripts.js +5 -1
- package/src/utils/shared-rdb-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.js +3 -1
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +2 -0
- package/src/utils/test.js +7 -1
- package/src/utils/test.js.map +1 -1
- package/src/utils/versions.d.ts +73 -69
- package/src/utils/versions.js +71 -67
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/app/static-websites/__websiteNameKebabCase__.ts.template +2 -2
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +2 -2
- package/src/utils/website-constructs/website-constructs.js +9 -2
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- package/src/utils/files/terraform/scripts/reset-runtime-config.ts.template +0 -25
|
@@ -9,20 +9,20 @@ export interface NxGeneratorInfo {
|
|
|
9
9
|
|
|
10
10
|
export const getPackageName = (): string =>
|
|
11
11
|
JSON.parse(
|
|
12
|
-
fs.readFileSync(path.resolve(import.meta.dirname
|
|
12
|
+
fs.readFileSync(path.resolve(<% if (esm) { %>import.meta.dirname<% } else { %>__dirname<% } %>, '../../package.json'), 'utf-8'),
|
|
13
13
|
).name;
|
|
14
14
|
|
|
15
15
|
export const listGenerators = (): NxGeneratorInfo[] =>
|
|
16
16
|
Object.entries(
|
|
17
17
|
JSON.parse(
|
|
18
18
|
fs.readFileSync(
|
|
19
|
-
path.resolve(import.meta.dirname
|
|
19
|
+
path.resolve(<% if (esm) { %>import.meta.dirname<% } else { %>__dirname<% } %>, '../../generators.json'),
|
|
20
20
|
'utf-8',
|
|
21
21
|
),
|
|
22
22
|
).generators,
|
|
23
23
|
).map(([id, info]: any) => ({
|
|
24
24
|
id,
|
|
25
|
-
resolvedPath: path.resolve(import.meta.dirname
|
|
25
|
+
resolvedPath: path.resolve(<% if (esm) { %>import.meta.dirname<% } else { %>__dirname<% } %>, '..', '..', info.factory, '..'),
|
|
26
26
|
description: info.description,
|
|
27
27
|
}));
|
|
28
28
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { formatFilesInSubtree } from "../../utils/format.js";
|
|
6
6
|
import { installDependencies } from "../../utils/install.js";
|
|
7
7
|
import { addGeneratorMetricsIfApplicable } from "../../utils/metrics.js";
|
|
8
|
+
import { esmVars } from "../../utils/module-format.js";
|
|
8
9
|
import { addDependencyToTargetIfNotPresent, addGeneratorMetadata, getGeneratorInfo, readProjectConfigurationUnqualified } from "../../utils/nx.js";
|
|
9
10
|
import { sortObjectKeys } from "../../utils/object.js";
|
|
10
11
|
import tsProjectGenerator, { getTsLibDetails } from "../lib/generator.js";
|
|
@@ -85,7 +86,8 @@ export const tsNxPluginGenerator = async (tree, options)=>{
|
|
|
85
86
|
tree.delete(joinPathFragments(mcpPath, 'resources', 'sample-guidance.ts'));
|
|
86
87
|
// Add generator MCP server
|
|
87
88
|
generateFiles(tree, joinPathFragments(import.meta.dirname, 'files', 'mcp-server'), mcpPath, {
|
|
88
|
-
name: fullyQualifiedName
|
|
89
|
+
name: fullyQualifiedName,
|
|
90
|
+
...esmVars(tree)
|
|
89
91
|
}, {
|
|
90
92
|
overwriteStrategy: OverwriteStrategy.KeepExisting
|
|
91
93
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/ts/nx-plugin/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type Tree,\n updateJson,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { installDependencies } from '../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport {\n addDependencyToTargetIfNotPresent,\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../utils/nx';\nimport { sortObjectKeys } from '../../utils/object';\nimport tsProjectGenerator, { getTsLibDetails } from '../lib/generator';\nimport tsMcpServerGenerator from '../mcp-server/generator';\nimport type { TsNxPluginGeneratorSchema } from './schema';\nimport { configureTsProjectAsNxPlugin } from './utils';\n\nexport const TS_NX_PLUGIN_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport const tsNxPluginGenerator = async (\n tree: Tree,\n options: TsNxPluginGeneratorSchema,\n): Promise<GeneratorCallback> => {\n // Generate a TypeScript project as the base\n const { fullyQualifiedName, dir } = getTsLibDetails(tree, options);\n await tsProjectGenerator(tree, {\n ...options,\n preferInstallDependencies: false,\n });\n\n // Configure the typescript project as an Nx Plugin\n configureTsProjectAsNxPlugin(tree, fullyQualifiedName);\n\n // Add a \"package\" target which creates a package which can be published to NPM\n const project = readProjectConfigurationUnqualified(tree, fullyQualifiedName);\n project.targets = {\n ...project.targets,\n package: {\n executor: '@nx/js:tsc',\n outputs: ['{options.outputPath}'],\n options: {\n outputPath: `dist/{projectRoot}/package`,\n main: `{projectRoot}/src/index.ts`,\n tsConfig: `{projectRoot}/tsconfig.lib.json`,\n assets: [\n `{projectRoot}/*.md`,\n `{projectRoot}/LICENSE*`,\n `{projectRoot}/NOTICE`,\n {\n input: './{projectRoot}/src',\n glob: '**/!(*.ts)',\n output: './src',\n },\n {\n input: './{projectRoot}/src',\n glob: '**/*.d.ts',\n output: './src',\n },\n {\n input: './{projectRoot}',\n glob: 'generators.json',\n output: '.',\n },\n {\n input: './{projectRoot}',\n glob: 'executors.json',\n output: '.',\n },\n ],\n },\n },\n build: {\n ...project.targets?.build,\n },\n };\n // Append the package dependency without moving an existing entry, so re-runs\n // do not reorder the build dependencies.\n addDependencyToTargetIfNotPresent(project, 'build', 'package');\n // Sort targets so their order is stable regardless of insertion order.\n project.targets = sortObjectKeys(project.targets);\n updateProjectConfiguration(tree, fullyQualifiedName, project);\n\n // Add an MCP Server\n await tsMcpServerGenerator(tree, {\n project: fullyQualifiedName,\n infra: 'none',\n iac: 'cdk', // not used\n preferInstallDependencies: false,\n });\n\n const mcpPath = joinPathFragments(project.sourceRoot, 'mcp-server');\n const mcpServerPath = joinPathFragments(mcpPath, 'server.ts');\n\n // Remove the sample server and tools\n tree.delete(mcpServerPath);\n tree.delete(joinPathFragments(mcpPath, 'tools', 'add.ts'));\n tree.delete(joinPathFragments(mcpPath, 'resources', 'sample-guidance.ts'));\n\n // Add generator MCP server\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'mcp-server'),\n mcpPath,\n {\n name: fullyQualifiedName,\n },\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n\n addGeneratorMetadata(tree, project.name, TS_NX_PLUGIN_GENERATOR_INFO);\n\n await addGeneratorMetricsIfApplicable(tree, [TS_NX_PLUGIN_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\nexport default tsNxPluginGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","readProjectConfigurationUnqualified","sortObjectKeys","tsProjectGenerator","getTsLibDetails","tsMcpServerGenerator","configureTsProjectAsNxPlugin","TS_NX_PLUGIN_GENERATOR_INFO","filename","tsNxPluginGenerator","tree","options","fullyQualifiedName","dir","preferInstallDependencies","project","targets","package","executor","outputs","outputPath","main","tsConfig","assets","input","glob","output","build","infra","iac","mcpPath","sourceRoot","mcpServerPath","delete","dirname","name","overwriteStrategy","KeepExisting","languages"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAGjBC,0BAA0B,QACrB,aAAa;AACpB,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,mBAAmB,QAAQ,yBAAsB;AAC1D,SAASC,+BAA+B,QAAQ,yBAAsB;AACtE,SACEC,iCAAiC,EACjCC,oBAAoB,EACpBC,gBAAgB,EAEhBC,mCAAmC,QAC9B,oBAAiB;AACxB,SAASC,cAAc,QAAQ,wBAAqB;AACpD,OAAOC,sBAAsBC,eAAe,QAAQ,sBAAmB;AACvE,OAAOC,0BAA0B,6BAA0B;AAE3D,SAASC,4BAA4B,QAAQ,aAAU;AAEvD,OAAO,MAAMC,8BAA+CP,iBAC1D,YAAYQ,QAAQ,EACpB;AAEF,OAAO,MAAMC,sBAAsB,OACjCC,MACAC;IAEA,4CAA4C;IAC5C,MAAM,EAAEC,kBAAkB,EAAEC,GAAG,EAAE,GAAGT,gBAAgBM,MAAMC;IAC1D,MAAMR,mBAAmBO,MAAM;QAC7B,GAAGC,OAAO;QACVG,2BAA2B;IAC7B;IAEA,mDAAmD;IACnDR,6BAA6BI,MAAME;IAEnC,+EAA+E;IAC/E,MAAMG,UAAUd,oCAAoCS,MAAME;IAC1DG,QAAQC,OAAO,GAAG;QAChB,GAAGD,QAAQC,OAAO;QAClBC,SAAS;YACPC,UAAU;YACVC,SAAS;gBAAC;aAAuB;YACjCR,SAAS;gBACPS,YAAY,CAAC,0BAA0B,CAAC;gBACxCC,MAAM,CAAC,0BAA0B,CAAC;gBAClCC,UAAU,CAAC,+BAA+B,CAAC;gBAC3CC,QAAQ;oBACN,CAAC,kBAAkB,CAAC;oBACpB,CAAC,sBAAsB,CAAC;oBACxB,CAAC,oBAAoB,CAAC;oBACtB;wBACEC,OAAO;wBACPC,MAAM;wBACNC,QAAQ;oBACV;oBACA;wBACEF,OAAO;wBACPC,MAAM;wBACNC,QAAQ;oBACV;oBACA;wBACEF,OAAO;wBACPC,MAAM;wBACNC,QAAQ;oBACV;oBACA;wBACEF,OAAO;wBACPC,MAAM;wBACNC,QAAQ;oBACV;iBACD;YACH;QACF;QACAC,OAAO;YACL,GAAGZ,QAAQC,OAAO,EAAEW,KAAK;QAC3B;IACF;IACA,6EAA6E;IAC7E,yCAAyC;IACzC7B,kCAAkCiB,SAAS,SAAS;IACpD,uEAAuE;IACvEA,QAAQC,OAAO,GAAGd,eAAea,QAAQC,OAAO;
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/ts/nx-plugin/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type Tree,\n updateJson,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { installDependencies } from '../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { esmVars } from '../../utils/module-format';\nimport {\n addDependencyToTargetIfNotPresent,\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../utils/nx';\nimport { sortObjectKeys } from '../../utils/object';\nimport tsProjectGenerator, { getTsLibDetails } from '../lib/generator';\nimport tsMcpServerGenerator from '../mcp-server/generator';\nimport type { TsNxPluginGeneratorSchema } from './schema';\nimport { configureTsProjectAsNxPlugin } from './utils';\n\nexport const TS_NX_PLUGIN_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport const tsNxPluginGenerator = async (\n tree: Tree,\n options: TsNxPluginGeneratorSchema,\n): Promise<GeneratorCallback> => {\n // Generate a TypeScript project as the base\n const { fullyQualifiedName, dir } = getTsLibDetails(tree, options);\n await tsProjectGenerator(tree, {\n ...options,\n preferInstallDependencies: false,\n });\n\n // Configure the typescript project as an Nx Plugin\n configureTsProjectAsNxPlugin(tree, fullyQualifiedName);\n\n // Add a \"package\" target which creates a package which can be published to NPM\n const project = readProjectConfigurationUnqualified(tree, fullyQualifiedName);\n project.targets = {\n ...project.targets,\n package: {\n executor: '@nx/js:tsc',\n outputs: ['{options.outputPath}'],\n options: {\n outputPath: `dist/{projectRoot}/package`,\n main: `{projectRoot}/src/index.ts`,\n tsConfig: `{projectRoot}/tsconfig.lib.json`,\n assets: [\n `{projectRoot}/*.md`,\n `{projectRoot}/LICENSE*`,\n `{projectRoot}/NOTICE`,\n {\n input: './{projectRoot}/src',\n glob: '**/!(*.ts)',\n output: './src',\n },\n {\n input: './{projectRoot}/src',\n glob: '**/*.d.ts',\n output: './src',\n },\n {\n input: './{projectRoot}',\n glob: 'generators.json',\n output: '.',\n },\n {\n input: './{projectRoot}',\n glob: 'executors.json',\n output: '.',\n },\n ],\n },\n },\n build: {\n ...project.targets?.build,\n },\n };\n // Append the package dependency without moving an existing entry, so re-runs\n // do not reorder the build dependencies.\n addDependencyToTargetIfNotPresent(project, 'build', 'package');\n // Sort targets so their order is stable regardless of insertion order.\n project.targets = sortObjectKeys(project.targets);\n updateProjectConfiguration(tree, fullyQualifiedName, project);\n\n // Add an MCP Server\n await tsMcpServerGenerator(tree, {\n project: fullyQualifiedName,\n infra: 'none',\n iac: 'cdk', // not used\n preferInstallDependencies: false,\n });\n\n const mcpPath = joinPathFragments(project.sourceRoot, 'mcp-server');\n const mcpServerPath = joinPathFragments(mcpPath, 'server.ts');\n\n // Remove the sample server and tools\n tree.delete(mcpServerPath);\n tree.delete(joinPathFragments(mcpPath, 'tools', 'add.ts'));\n tree.delete(joinPathFragments(mcpPath, 'resources', 'sample-guidance.ts'));\n\n // Add generator MCP server\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'mcp-server'),\n mcpPath,\n {\n name: fullyQualifiedName,\n ...esmVars(tree),\n },\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n\n addGeneratorMetadata(tree, project.name, TS_NX_PLUGIN_GENERATOR_INFO);\n\n await addGeneratorMetricsIfApplicable(tree, [TS_NX_PLUGIN_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\nexport default tsNxPluginGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","esmVars","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","readProjectConfigurationUnqualified","sortObjectKeys","tsProjectGenerator","getTsLibDetails","tsMcpServerGenerator","configureTsProjectAsNxPlugin","TS_NX_PLUGIN_GENERATOR_INFO","filename","tsNxPluginGenerator","tree","options","fullyQualifiedName","dir","preferInstallDependencies","project","targets","package","executor","outputs","outputPath","main","tsConfig","assets","input","glob","output","build","infra","iac","mcpPath","sourceRoot","mcpServerPath","delete","dirname","name","overwriteStrategy","KeepExisting","languages"],"mappings":"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"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import PackageJson from "../../../package.json" with {
|
|
6
6
|
type: 'json'
|
|
7
7
|
};
|
|
8
|
+
import { isEsmWorkspace } from "../../utils/module-format.js";
|
|
8
9
|
import { readProjectConfigurationUnqualified } from "../../utils/nx.js";
|
|
9
10
|
import { withVersions } from "../../utils/versions.js";
|
|
10
11
|
/**
|
|
@@ -30,11 +31,13 @@ import { withVersions } from "../../utils/versions.js";
|
|
|
30
31
|
name: project.name
|
|
31
32
|
});
|
|
32
33
|
}
|
|
34
|
+
const esm = isEsmWorkspace(tree);
|
|
33
35
|
updateJson(tree, pluginPackageJsonPath, (pkg)=>{
|
|
34
|
-
//
|
|
35
|
-
// Node's native type stripping (
|
|
36
|
-
|
|
37
|
-
pkg.
|
|
36
|
+
// Match the plugin's module system to the workspace. Nx loads `.ts`
|
|
37
|
+
// generators via Node's native type stripping, as ESM (workspace root is
|
|
38
|
+
// `type: module`) or CommonJS accordingly.
|
|
39
|
+
pkg.type ??= esm ? 'module' : 'commonjs';
|
|
40
|
+
pkg.main ??= esm ? './src/index.js' : './src/index';
|
|
38
41
|
pkg.generators ??= './generators.json';
|
|
39
42
|
return pkg;
|
|
40
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/ts/nx-plugin/utils.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n addDependenciesToPackageJson,\n joinPathFragments,\n readJson,\n type Tree,\n updateJson,\n writeJson,\n} from '@nx/devkit';\nimport PackageJson from '../../../package.json' with { type: 'json' };\nimport { readProjectConfigurationUnqualified } from '../../utils/nx';\nimport { withVersions } from '../../utils/versions';\n\n/**\n * Configures a TypeScript project as an Nx Plugin\n */\nexport const configureTsProjectAsNxPlugin = (\n tree: Tree,\n projectName: string,\n) => {\n const project = readProjectConfigurationUnqualified(tree, projectName);\n\n const tsConfigPath = joinPathFragments(project.root, 'tsconfig.json');\n if (!tree.exists(tsConfigPath)) {\n throw new Error(\n `Selected plugin project ${projectName} is not a TypeScript project`,\n );\n }\n\n // Create an empty generators.json if one dosn't exist\n const generatorsJsonPath = joinPathFragments(project.root, 'generators.json');\n if (!tree.exists(generatorsJsonPath)) {\n writeJson(tree, generatorsJsonPath, {\n generators: {},\n });\n }\n\n // Create a package.json if one doesn't exist, and configure \"type\", \"main\"\n // and \"generators\"\n const pluginPackageJsonPath = joinPathFragments(project.root, 'package.json');\n if (!tree.exists(pluginPackageJsonPath)) {\n writeJson(tree, pluginPackageJsonPath, {\n name: project.name,\n });\n }\n updateJson(tree, pluginPackageJsonPath, (pkg) => {\n //
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/ts/nx-plugin/utils.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n addDependenciesToPackageJson,\n joinPathFragments,\n readJson,\n type Tree,\n updateJson,\n writeJson,\n} from '@nx/devkit';\nimport PackageJson from '../../../package.json' with { type: 'json' };\nimport { isEsmWorkspace } from '../../utils/module-format';\nimport { readProjectConfigurationUnqualified } from '../../utils/nx';\nimport { withVersions } from '../../utils/versions';\n\n/**\n * Configures a TypeScript project as an Nx Plugin\n */\nexport const configureTsProjectAsNxPlugin = (\n tree: Tree,\n projectName: string,\n) => {\n const project = readProjectConfigurationUnqualified(tree, projectName);\n\n const tsConfigPath = joinPathFragments(project.root, 'tsconfig.json');\n if (!tree.exists(tsConfigPath)) {\n throw new Error(\n `Selected plugin project ${projectName} is not a TypeScript project`,\n );\n }\n\n // Create an empty generators.json if one dosn't exist\n const generatorsJsonPath = joinPathFragments(project.root, 'generators.json');\n if (!tree.exists(generatorsJsonPath)) {\n writeJson(tree, generatorsJsonPath, {\n generators: {},\n });\n }\n\n // Create a package.json if one doesn't exist, and configure \"type\", \"main\"\n // and \"generators\"\n const pluginPackageJsonPath = joinPathFragments(project.root, 'package.json');\n if (!tree.exists(pluginPackageJsonPath)) {\n writeJson(tree, pluginPackageJsonPath, {\n name: project.name,\n });\n }\n const esm = isEsmWorkspace(tree);\n updateJson(tree, pluginPackageJsonPath, (pkg) => {\n // Match the plugin's module system to the workspace. Nx loads `.ts`\n // generators via Node's native type stripping, as ESM (workspace root is\n // `type: module`) or CommonJS accordingly.\n pkg.type ??= esm ? 'module' : 'commonjs';\n pkg.main ??= esm ? './src/index.js' : './src/index';\n pkg.generators ??= './generators.json';\n return pkg;\n });\n\n const rootPackageJson = tree.exists('package.json')\n ? readJson(tree, 'package.json')\n : undefined;\n const isNxPluginForAws = rootPackageJson?.name === '@aws/nx-plugin-source';\n\n if (!isNxPluginForAws) {\n // Add the required dependencies to the root package.json, and project's package.json\n const deps = {\n ...withVersions(['@nx/devkit']),\n // Include dependency on @aws/nx-plugin\n [PackageJson.name]: `^${PackageJson.version}`,\n };\n // Generated workspaces are `\"type\": \"module\"`, so Nx loads the plugin's\n // `.ts` generators as ESM via Node's native type stripping — no swc/ts-node\n // transpiler is required.\n addDependenciesToPackageJson(tree, {}, deps);\n addDependenciesToPackageJson(tree, deps, {}, pluginPackageJsonPath);\n }\n};\n"],"names":["addDependenciesToPackageJson","joinPathFragments","readJson","updateJson","writeJson","PackageJson","type","isEsmWorkspace","readProjectConfigurationUnqualified","withVersions","configureTsProjectAsNxPlugin","tree","projectName","project","tsConfigPath","root","exists","Error","generatorsJsonPath","generators","pluginPackageJsonPath","name","esm","pkg","main","rootPackageJson","undefined","isNxPluginForAws","deps","version"],"mappings":"AAAA;;;CAGC,GACD,SACEA,4BAA4B,EAC5BC,iBAAiB,EACjBC,QAAQ,EAERC,UAAU,EACVC,SAAS,QACJ,aAAa;AACpB,OAAOC,iBAAiB,6BAA6B;IAAEC,MAAM;AAAO,EAAE;AACtE,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,mCAAmC,QAAQ,oBAAiB;AACrE,SAASC,YAAY,QAAQ,0BAAuB;AAEpD;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAC1CC,MACAC;IAEA,MAAMC,UAAUL,oCAAoCG,MAAMC;IAE1D,MAAME,eAAeb,kBAAkBY,QAAQE,IAAI,EAAE;IACrD,IAAI,CAACJ,KAAKK,MAAM,CAACF,eAAe;QAC9B,MAAM,IAAIG,MACR,CAAC,wBAAwB,EAAEL,YAAY,4BAA4B,CAAC;IAExE;IAEA,sDAAsD;IACtD,MAAMM,qBAAqBjB,kBAAkBY,QAAQE,IAAI,EAAE;IAC3D,IAAI,CAACJ,KAAKK,MAAM,CAACE,qBAAqB;QACpCd,UAAUO,MAAMO,oBAAoB;YAClCC,YAAY,CAAC;QACf;IACF;IAEA,2EAA2E;IAC3E,mBAAmB;IACnB,MAAMC,wBAAwBnB,kBAAkBY,QAAQE,IAAI,EAAE;IAC9D,IAAI,CAACJ,KAAKK,MAAM,CAACI,wBAAwB;QACvChB,UAAUO,MAAMS,uBAAuB;YACrCC,MAAMR,QAAQQ,IAAI;QACpB;IACF;IACA,MAAMC,MAAMf,eAAeI;IAC3BR,WAAWQ,MAAMS,uBAAuB,CAACG;QACvC,oEAAoE;QACpE,yEAAyE;QACzE,2CAA2C;QAC3CA,IAAIjB,IAAI,KAAKgB,MAAM,WAAW;QAC9BC,IAAIC,IAAI,KAAKF,MAAM,mBAAmB;QACtCC,IAAIJ,UAAU,KAAK;QACnB,OAAOI;IACT;IAEA,MAAME,kBAAkBd,KAAKK,MAAM,CAAC,kBAChCd,SAASS,MAAM,kBACfe;IACJ,MAAMC,mBAAmBF,iBAAiBJ,SAAS;IAEnD,IAAI,CAACM,kBAAkB;QACrB,qFAAqF;QACrF,MAAMC,OAAO;YACX,GAAGnB,aAAa;gBAAC;aAAa,CAAC;YAC/B,uCAAuC;YACvC,CAACJ,YAAYgB,IAAI,CAAC,EAAE,CAAC,CAAC,EAAEhB,YAAYwB,OAAO,EAAE;QAC/C;QACA,wEAAwE;QACxE,4EAA4E;QAC5E,0BAA0B;QAC1B7B,6BAA6BW,MAAM,CAAC,GAAGiB;QACvC5B,6BAA6BW,MAAMiB,MAAM,CAAC,GAAGR;IAC/C;AACF,EAAE"}
|