@aws/nx-plugin 1.0.0-rc.22 → 1.0.0-rc.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-THIRD-PARTY +2088 -971
- package/package.json +25 -10
- package/src/agentcore-gateway/attach-upstream.d.ts +7 -7
- package/src/agentcore-gateway/attach-upstream.js +19 -22
- package/src/agentcore-gateway/attach-upstream.js.map +1 -1
- package/src/agentcore-gateway/gateway-connection/generator.d.ts +3 -3
- package/src/agentcore-gateway/gateway-connection/generator.js +42 -45
- package/src/agentcore-gateway/gateway-connection/generator.js.map +1 -1
- package/src/agentcore-gateway/gateway-connection/schema.d.js +6 -0
- package/src/agentcore-gateway/gateway-connection/schema.d.js.map +1 -0
- package/src/agentcore-gateway/generator.js +89 -72
- package/src/agentcore-gateway/generator.js.map +1 -1
- package/src/agentcore-gateway/mcp-connection/generator.d.ts +2 -2
- package/src/agentcore-gateway/mcp-connection/generator.js +24 -30
- package/src/agentcore-gateway/mcp-connection/generator.js.map +1 -1
- package/src/agentcore-gateway/mcp-connection/schema.d.js +6 -0
- package/src/agentcore-gateway/mcp-connection/schema.d.js.map +1 -0
- package/src/agentcore-gateway/schema.d.js +6 -0
- package/src/agentcore-gateway/schema.d.js.map +1 -0
- package/src/bin/aws-nx-mcp.js +14 -0
- package/src/bin/aws-nx-mcp.js.map +1 -0
- package/src/connection/{agent-serve-local.d.ts → agent-local-dev.d.ts} +5 -5
- package/src/connection/agent-local-dev.js +42 -0
- package/src/connection/agent-local-dev.js.map +1 -0
- package/src/connection/agent-runtime-config.js +9 -14
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/generator.js +262 -207
- package/src/connection/generator.js.map +1 -1
- package/src/connection/{serve-local.d.ts → local-dev.d.ts} +3 -3
- package/src/connection/local-dev.js +37 -0
- package/src/connection/local-dev.js.map +1 -0
- package/src/connection/schema.d.js +6 -0
- package/src/connection/schema.d.js.map +1 -0
- package/src/index.js +2 -5
- package/src/index.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +4 -26
- package/src/infra/app/generator.js +133 -123
- package/src/infra/app/generator.js.map +1 -1
- package/src/infra/app/schema.d.js +6 -0
- package/src/infra/app/schema.d.js.map +1 -0
- package/src/license/config-types.js +5 -3
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +1 -1
- package/src/license/config.js +267 -242
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/check.js +51 -46
- package/src/license/dependency-check/check.js.map +1 -1
- package/src/license/dependency-check/collectors/collector.js +41 -71
- package/src/license/dependency-check/collectors/collector.js.map +1 -1
- package/src/license/dependency-check/collectors/npm-collector.js +34 -41
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -1
- package/src/license/dependency-check/collectors/python-collector.js +55 -62
- package/src/license/dependency-check/collectors/python-collector.js.map +1 -1
- package/src/license/dependency-check/evaluator.js +40 -68
- package/src/license/dependency-check/evaluator.js.map +1 -1
- package/src/license/dependency-check/executor.js +30 -22
- package/src/license/dependency-check/executor.js.map +1 -1
- package/src/license/dependency-check/pre-approved.js +949 -336
- package/src/license/dependency-check/pre-approved.js.map +1 -1
- package/src/license/dependency-check/types.js +2 -3
- package/src/license/dependency-check/types.js.map +1 -1
- package/src/license/generator.js +55 -60
- package/src/license/generator.js.map +1 -1
- package/src/license/index.js +3 -9
- package/src/license/index.js.map +1 -1
- package/src/license/known-exceptions.js +14 -13
- package/src/license/known-exceptions.js.map +1 -1
- package/src/license/schema.d.js +6 -0
- package/src/license/schema.d.js.map +1 -0
- package/src/license/sync/generator.js +94 -119
- package/src/license/sync/generator.js.map +1 -1
- package/src/license/sync/project-file-sync.js +28 -35
- package/src/license/sync/project-file-sync.js.map +1 -1
- package/src/mcp-server/generator-info.js +130 -160
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/guide-pipeline.js +184 -206
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/guide-render.js +10 -25
- package/src/mcp-server/guide-render.js.map +1 -1
- package/src/mcp-server/index.js +6 -10
- package/src/mcp-server/index.js.map +1 -1
- package/src/mcp-server/mdx-ast.js +39 -57
- package/src/mcp-server/mdx-ast.js.map +1 -1
- package/src/mcp-server/option-filter.js +33 -47
- package/src/mcp-server/option-filter.js.map +1 -1
- package/src/mcp-server/schema-registry.js +27 -40
- package/src/mcp-server/schema-registry.js.map +1 -1
- package/src/mcp-server/schema.js +9 -7
- package/src/mcp-server/schema.js.map +1 -1
- package/src/mcp-server/server.js +20 -24
- package/src/mcp-server/server.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.js +23 -24
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/general-guidance.js +28 -25
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.js +29 -37
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/mcp-server/tools/list-generators.js +19 -25
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/open-api/ts-client/generator.js +16 -26
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-client/schema.d.js +6 -0
- package/src/open-api/ts-client/schema.d.js.map +1 -0
- package/src/open-api/ts-hooks/generator.js +13 -21
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/ts-hooks/schema.d.js +6 -0
- package/src/open-api/ts-hooks/schema.d.js.map +1 -0
- package/src/open-api/ts-metadata/generator.js +12 -20
- package/src/open-api/ts-metadata/generator.js.map +1 -1
- package/src/open-api/ts-metadata/schema.d.js +6 -0
- package/src/open-api/ts-metadata/schema.d.js.map +1 -0
- package/src/open-api/utils/codegen-data/languages.js +42 -60
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data/types.js +31 -30
- package/src/open-api/utils/codegen-data/types.js.map +1 -1
- package/src/open-api/utils/codegen-data.js +253 -269
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.js +242 -241
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parse.js +8 -14
- package/src/open-api/utils/parse.js.map +1 -1
- package/src/open-api/utils/refs.js +12 -22
- package/src/open-api/utils/refs.js.map +1 -1
- package/src/open-api/utils/types.js +5 -2
- package/src/open-api/utils/types.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +31 -6
- package/src/preset/generator.d.ts +1 -1
- package/src/preset/generator.js +130 -112
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.js +6 -0
- package/src/preset/schema.d.js.map +1 -0
- package/src/preset/schema.d.ts +0 -1
- package/src/preset/schema.json +0 -5
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +304 -0
- package/src/py/agent/__snapshots__/{generator.spec.ts.snap → generator.frameworks.spec.ts.snap} +18 -845
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +535 -0
- package/src/py/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +1 -2
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client_strands.py.template +1 -1
- package/src/py/agent/a2a-connection/files/langchain/agent-connection/app/__targetAgentSnakeCase___client_langchain.py.template +1 -1
- package/src/py/agent/a2a-connection/generator.js +70 -75
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/a2a-connection/schema.d.js +8 -0
- package/src/py/agent/a2a-connection/schema.d.js.map +1 -0
- package/src/py/agent/files/ag-ui-langchain/main.py.template +10 -0
- package/src/py/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +6 -8
- package/src/py/agent/gateway-connection/files/agent-connection/app/__gatewaySnakeCase___client_strands.py.template +3 -3
- package/src/py/agent/gateway-connection/files/langchain/agent-connection/app/__gatewaySnakeCase___client_langchain.py.template +3 -3
- package/src/py/agent/gateway-connection/generator.js +61 -58
- package/src/py/agent/gateway-connection/generator.js.map +1 -1
- package/src/py/agent/gateway-connection/schema.d.js +6 -0
- package/src/py/agent/gateway-connection/schema.d.js.map +1 -0
- package/src/py/agent/generator.js +227 -194
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +5 -12
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client_strands.py.template +1 -1
- package/src/py/agent/mcp-connection/files/langchain/agent-connection/app/__mcpServerSnakeCase___client_langchain.py.template +1 -1
- package/src/py/agent/mcp-connection/generator.js +53 -52
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/schema.d.js +8 -0
- package/src/py/agent/mcp-connection/schema.d.js.map +1 -0
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +3 -2
- package/src/py/agent/react-connection/generator.js +51 -58
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/{serve-local.d.ts → local-dev.d.ts} +4 -4
- package/src/py/agent/react-connection/local-dev.js +36 -0
- package/src/py/agent/react-connection/local-dev.js.map +1 -0
- package/src/py/agent/react-connection/schema.d.js +8 -0
- package/src/py/agent/react-connection/schema.d.js.map +1 -0
- package/src/py/agent/schema.d.js +6 -0
- package/src/py/agent/schema.d.js.map +1 -0
- package/src/py/api/generator.js +12 -12
- package/src/py/api/generator.js.map +1 -1
- package/src/py/api/schema.d.js +6 -0
- package/src/py/api/schema.d.js.map +1 -0
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +68 -28
- package/src/py/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/dynamodb/agent-connection/generator.js +27 -29
- package/src/py/dynamodb/agent-connection/generator.js.map +1 -1
- package/src/py/dynamodb/agent-connection/schema.d.js +8 -0
- package/src/py/dynamodb/agent-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/fast-api-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/dynamodb/fast-api-connection/generator.js +26 -28
- package/src/py/dynamodb/fast-api-connection/generator.js.map +1 -1
- package/src/py/dynamodb/fast-api-connection/schema.d.js +8 -0
- package/src/py/dynamodb/fast-api-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/files/__name__/client.py.template +5 -5
- package/src/py/dynamodb/files/__name__/entities/base.py.template +2 -2
- package/src/py/dynamodb/files/config.json.template +1 -1
- package/src/py/dynamodb/generator.js +63 -62
- package/src/py/dynamodb/generator.js.map +1 -1
- package/src/py/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/dynamodb/mcp-server-connection/generator.js +27 -29
- package/src/py/dynamodb/mcp-server-connection/generator.js.map +1 -1
- package/src/py/dynamodb/mcp-server-connection/schema.d.js +8 -0
- package/src/py/dynamodb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/schema.d.js +6 -0
- package/src/py/dynamodb/schema.d.js.map +1 -0
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +45 -4632
- package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +4833 -0
- package/src/py/fast-api/generator.js +79 -85
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/__snapshots__/generator.spec.ts.snap +3 -2
- package/src/py/fast-api/react/generator.js +22 -24
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/open-api.js +28 -29
- package/src/py/fast-api/react/open-api.js.map +1 -1
- package/src/py/fast-api/react/schema.d.js +6 -0
- package/src/py/fast-api/react/schema.d.js.map +1 -0
- package/src/py/fast-api/schema.d.js +6 -0
- package/src/py/fast-api/schema.d.js.map +1 -0
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/py/lambda-function/generator.js +57 -58
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.js +6 -0
- package/src/py/lambda-function/schema.d.js.map +1 -0
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/mcp-server/generator.js +149 -131
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/mcp-server/schema.d.js +6 -0
- package/src/py/mcp-server/schema.d.js.map +1 -0
- package/src/py/project/generator.d.ts +14 -1
- package/src/py/project/generator.js +137 -88
- package/src/py/project/generator.js.map +1 -1
- package/src/py/project/schema.d.js +6 -0
- package/src/py/project/schema.d.js.map +1 -0
- package/src/sdk/agentcore-gateway.d.ts +6 -0
- package/src/sdk/agentcore-gateway.js +7 -0
- package/src/sdk/agentcore-gateway.js.map +1 -0
- package/src/sdk/connection.d.ts +6 -0
- package/src/sdk/connection.js +6 -0
- package/src/sdk/connection.js.map +1 -0
- package/{sdk → src/sdk}/license.d.ts +4 -4
- package/src/sdk/license.js +7 -0
- package/src/sdk/license.js.map +1 -0
- package/src/sdk/open-api.d.ts +10 -0
- package/src/sdk/open-api.js +8 -0
- package/src/sdk/open-api.js.map +1 -0
- package/src/sdk/py.d.ts +14 -0
- package/src/sdk/py.js +10 -0
- package/src/sdk/py.js.map +1 -0
- package/src/sdk/terraform.d.ts +6 -0
- package/src/sdk/terraform.js +7 -0
- package/src/sdk/terraform.js.map +1 -0
- package/src/sdk/ts.d.ts +33 -0
- package/src/sdk/ts.js +35 -0
- package/src/sdk/ts.js.map +1 -0
- package/{sdk → src/sdk}/utils/ast.d.ts +2 -2
- package/src/sdk/utils/ast.js +7 -0
- package/src/sdk/utils/ast.js.map +1 -0
- package/{sdk → src/sdk}/utils/format.d.ts +1 -1
- package/src/sdk/utils/format.js +6 -0
- package/src/sdk/utils/format.js.map +1 -0
- package/{sdk → src/sdk}/utils/test.d.ts +1 -1
- package/src/sdk/utils/test.js +6 -0
- package/src/sdk/utils/test.js.map +1 -0
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +2 -8
- package/src/smithy/project/files/build.Dockerfile.template +1 -4
- package/src/smithy/project/generator.js +44 -42
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/project/schema.d.js +6 -0
- package/src/smithy/project/schema.d.js.map +1 -0
- package/src/smithy/react-connection/generator.js +35 -46
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/react-connection/schema.d.js +6 -0
- package/src/smithy/react-connection/schema.d.js.map +1 -0
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +395 -72
- package/src/smithy/ts/api/generator.js +121 -111
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/smithy/ts/api/schema.d.js +6 -0
- package/src/smithy/ts/api/schema.d.js.map +1 -0
- package/src/terraform/project/files/application/src/providers.tf.template +1 -1
- package/src/terraform/project/generator.js +141 -103
- package/src/terraform/project/generator.js.map +1 -1
- package/src/terraform/project/schema.d.js +9 -0
- package/src/terraform/project/schema.d.js.map +1 -0
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +336 -92
- package/src/trpc/backend/generator.js +93 -86
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.js +6 -0
- package/src/trpc/backend/schema.d.js.map +1 -0
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/trpc/react/generator.js +59 -58
- package/src/trpc/react/generator.js.map +1 -1
- package/src/trpc/react/schema.d.js +6 -0
- package/src/trpc/react/schema.d.js.map +1 -0
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +11 -11
- package/src/ts/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client-strands.ts.template +1 -1
- package/src/ts/agent/a2a-connection/generator.js +58 -54
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/a2a-connection/schema.d.js +8 -0
- package/src/ts/agent/a2a-connection/schema.d.js.map +1 -0
- package/src/ts/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/agent/gateway-connection/files/agent-connection/app/__gatewayKebabCase__-client-strands.ts.template +3 -3
- package/src/ts/agent/gateway-connection/generator.js +57 -52
- package/src/ts/agent/gateway-connection/generator.js.map +1 -1
- package/src/ts/agent/gateway-connection/schema.d.js +6 -0
- package/src/ts/agent/gateway-connection/schema.d.js.map +1 -0
- package/src/ts/agent/generator.js +165 -136
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +1 -1
- package/src/ts/agent/mcp-connection/generator.js +48 -46
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/schema.d.js +8 -0
- package/src/ts/agent/mcp-connection/schema.d.js.map +1 -0
- package/src/ts/agent/react-connection/generator.js +79 -79
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/{serve-local.d.ts → local-dev.d.ts} +2 -2
- package/src/ts/agent/react-connection/local-dev.js +17 -0
- package/src/ts/agent/react-connection/local-dev.js.map +1 -0
- package/src/ts/agent/react-connection/schema.d.js +8 -0
- package/src/ts/agent/react-connection/schema.d.js.map +1 -0
- package/src/ts/agent/schema.d.js +6 -0
- package/src/ts/agent/schema.d.js.map +1 -0
- package/src/ts/api/generator.js +16 -18
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.js +6 -0
- package/src/ts/api/schema.d.js.map +1 -0
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +8 -8
- package/src/ts/astro-docs/generator.js +59 -48
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/astro-docs/schema.d.js +6 -0
- package/src/ts/astro-docs/schema.d.js.map +1 -0
- package/src/ts/docs/generator.js +10 -10
- package/src/ts/docs/generator.js.map +1 -1
- package/src/ts/docs/schema.d.js +6 -0
- package/src/ts/docs/schema.d.js.map +1 -0
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +68 -30
- package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/dynamodb/agent-connection/generator.js +21 -23
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/agent-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/agent-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/files/config.json.template +1 -1
- package/src/ts/dynamodb/files/src/client.ts.template +7 -7
- package/src/ts/dynamodb/generator.js +64 -63
- package/src/ts/dynamodb/generator.js.map +1 -1
- package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/dynamodb/mcp-server-connection/generator.js +21 -23
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/mcp-server-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/schema.d.js +6 -0
- package/src/ts/dynamodb/schema.d.js.map +1 -0
- package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/dynamodb/smithy-connection/generator.js +20 -22
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/smithy-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/dynamodb/trpc-connection/generator.js +20 -22
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/trpc-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.js.map +1 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/lambda-function/generator.js +55 -55
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/io.js +83 -52
- package/src/ts/lambda-function/io.js.map +1 -1
- package/src/ts/lambda-function/schema.d.js +6 -0
- package/src/ts/lambda-function/schema.d.js.map +1 -0
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +23 -36
- package/src/ts/lib/biome.js +37 -37
- package/src/ts/lib/biome.js.map +1 -1
- package/src/ts/lib/generator.js +75 -77
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/schema.d.js +6 -0
- package/src/ts/lib/schema.d.js.map +1 -0
- package/src/ts/lib/ts-project-utils.js +65 -70
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/types.js +5 -2
- package/src/ts/lib/types.js.map +1 -1
- package/src/ts/lib/vitest.js +29 -26
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/mcp-server/generator.js +157 -138
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/mcp-server/schema.d.js +6 -0
- package/src/ts/mcp-server/schema.d.js.map +1 -0
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +14 -9
- package/src/ts/nx-generator/files/local/generator.ts.template +3 -3
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +4 -4
- package/src/ts/nx-generator/generator.js +84 -83
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-generator/schema.d.js +6 -0
- package/src/ts/nx-generator/schema.d.js.map +1 -0
- package/src/ts/nx-plugin/__snapshots__/generator.spec.ts.snap +30 -18
- package/src/ts/nx-plugin/files/mcp-server/server.ts.template +5 -5
- package/src/ts/nx-plugin/files/mcp-server/tools/create-workspace-command.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/general-guidance.ts.template +1 -1
- package/src/ts/nx-plugin/files/mcp-server/tools/generator-guide.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/list-generators.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/utils.ts.template +3 -3
- package/src/ts/nx-plugin/generator.js +49 -48
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/schema.d.js +9 -0
- package/src/ts/nx-plugin/schema.d.js.map +1 -0
- package/src/ts/nx-plugin/utils.js +32 -44
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +34 -30
- package/src/ts/rdb/agent-connection/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/ts/rdb/agent-connection/generator.js +38 -39
- package/src/ts/rdb/agent-connection/generator.js.map +1 -1
- package/src/ts/rdb/agent-connection/schema.d.js +8 -0
- package/src/ts/rdb/agent-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/files/config.json.template +1 -1
- package/src/ts/rdb/files/prisma.config.ts.template +2 -2
- package/src/ts/rdb/files/src/prisma.ts.template +7 -7
- package/src/ts/rdb/files/src/utils.ts.template +3 -0
- package/src/ts/rdb/generator.js +130 -117
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/ts/rdb/mcp-server-connection/generator.js +36 -37
- package/src/ts/rdb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/schema.d.js +8 -0
- package/src/ts/rdb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/schema.d.js +6 -0
- package/src/ts/rdb/schema.d.js.map +1 -0
- package/src/ts/rdb/smithy-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/rdb/smithy-connection/generator.js +46 -43
- package/src/ts/rdb/smithy-connection/generator.js.map +1 -1
- package/src/ts/rdb/smithy-connection/schema.d.js +8 -0
- package/src/ts/rdb/smithy-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/trpc-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/rdb/trpc-connection/generator.js +36 -31
- package/src/ts/rdb/trpc-connection/generator.js.map +1 -1
- package/src/ts/rdb/trpc-connection/schema.d.js +8 -0
- package/src/ts/rdb/trpc-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/utils.js +9 -11
- package/src/ts/rdb/utils.js.map +1 -1
- package/src/ts/react-website/agui/generator.js +69 -61
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +179 -332
- package/src/ts/react-website/app/generator.js +197 -188
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.js +6 -0
- package/src/ts/react-website/app/schema.d.js.map +1 -0
- package/src/ts/react-website/app/schema.json +6 -6
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +118 -4
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +27 -7
- package/src/ts/react-website/cognito-auth/files/app/components/CognitoAuth/index.tsx.template +2 -2
- package/src/ts/react-website/cognito-auth/generator.js +60 -60
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/schema.d.js +6 -0
- package/src/ts/react-website/cognito-auth/schema.d.js.map +1 -0
- package/src/ts/react-website/cognito-auth/utils.js +34 -32
- package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
- package/src/ts/react-website/runtime-config/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/react-website/runtime-config/files/app/components/RuntimeConfig/index.tsx.template +2 -2
- package/src/ts/react-website/runtime-config/generator.js +29 -31
- package/src/ts/react-website/runtime-config/generator.js.map +1 -1
- package/src/ts/react-website/runtime-config/schema.d.js +6 -0
- package/src/ts/react-website/runtime-config/schema.d.js.map +1 -0
- package/src/ts/sync/generator.js +60 -59
- package/src/ts/sync/generator.js.map +1 -1
- package/src/ts/website/app/generator.js +10 -10
- package/src/ts/website/app/generator.js.map +1 -1
- package/src/ts/website/app/schema.d.js +6 -0
- package/src/ts/website/app/schema.d.js.map +1 -0
- package/src/ts/website/app/schema.json +6 -6
- package/src/ts/website/auth/generator.js +11 -11
- package/src/ts/website/auth/generator.js.map +1 -1
- package/src/ts/website/auth/schema.d.js +6 -0
- package/src/ts/website/auth/schema.d.js.map +1 -0
- package/src/utils/agent-chat/agent-chat.d.ts +1 -1
- package/src/utils/agent-chat/agent-chat.js +11 -12
- package/src/utils/agent-chat/agent-chat.js.map +1 -1
- package/src/utils/agent-chat/files/a2a/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/ag-ui/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/http-py/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/http-ts/chat.ts.template +1 -1
- package/src/utils/agent-connection/agent-connection.d.ts +9 -3
- package/src/utils/agent-connection/agent-connection.js +133 -147
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/gateway/agentcore-gateway-mcp-client-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/py-core-gateway/agentcore_gateway_mcp_transport.py.template +1 -1
- package/src/utils/agent-connection/files/py-core-langchain/gateway/agentcore_gateway_mcp_client_langchain.py.template +1 -1
- package/src/utils/agent-connection/files/py-core-strands/gateway/agentcore_gateway_mcp_client_strands.py.template +1 -1
- package/src/utils/agent-core-constructs/agent-core-constructs.js +53 -50
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +5 -5
- package/src/utils/agent-core-constructs/files/terraform/core/agentcore-gateway/gateway.tf.template +2 -2
- package/src/utils/api-constructs/api-constructs.js +30 -31
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +14 -6
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account/index.js.template +58 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account.ts.template +82 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +28 -14
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +1 -8
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +91 -4
- package/src/utils/api-constructs/files/terraform/core/api/http/http-api/http-api.tf.template +1 -1
- package/src/utils/api-constructs/files/terraform/core/api/rest/api-gateway-account/api-gateway-account.tf.template +83 -0
- package/src/utils/api-constructs/files/terraform/core/api/rest/rest-api/rest-api.tf.template +5 -11
- package/src/utils/api-constructs/open-api-metadata.js +22 -22
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
- package/src/utils/ast/website.js +17 -19
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.js +72 -97
- package/src/utils/ast.js.map +1 -1
- package/src/utils/bundle/bundle.js +50 -47
- package/src/utils/bundle/bundle.js.map +1 -1
- package/src/utils/commands.js +47 -26
- package/src/utils/commands.js.map +1 -1
- package/src/utils/config/index.d.ts +2 -2
- package/src/utils/config/index.js +5 -4
- package/src/utils/config/index.js.map +1 -1
- package/src/utils/config/utils.js +48 -58
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/connection/open-api/react.d.ts +5 -5
- package/src/utils/connection/open-api/react.js +81 -77
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/containers.js +22 -23
- package/src/utils/containers.js.map +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +32 -33
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -1
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +12 -2
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +1 -1
- package/src/utils/files/common/scripts/src/dynamodb/create-local-table.ts.template +2 -2
- package/src/utils/files/common/scripts/src/dynamodb/pull-image.ts.template +1 -1
- package/src/utils/files/common/scripts/src/dynamodb/start-container.ts.template +17 -2
- package/src/utils/files/common/scripts/src/rdb/mysql/wait-for-mysql-db.ts.template +32 -0
- package/src/utils/files/common/scripts/src/rdb/postgres/wait-for-postgres-db.ts.template +32 -0
- package/src/utils/files/common/scripts/src/rdb/{pull-image.ts.template → shared/pull-image.ts.template} +1 -1
- package/src/utils/files/common/scripts/src/rdb/{start-container.ts.template → shared/start-container.ts.template} +16 -1
- package/src/utils/files/terraform/src/core/asset-bucket/asset-bucket.tf.template +2 -2
- package/src/utils/files/terraform/src/core/runtime-config/appconfig/appconfig.tf.template +1 -1
- package/src/utils/files/terraform/src/core/runtime-config/appconfig-deployment/appconfig-deployment.tf.template +3 -3
- package/src/utils/files/terraform/src/core/runtime-config/entry/entry.tf.template +1 -1
- package/src/utils/files/terraform/src/core/runtime-config/read/read.tf.template +2 -2
- package/src/utils/files/website/hooks/sigv4/useSigV4.tsx.template +1 -1
- package/src/utils/format.js +153 -99
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.js +14 -13
- package/src/utils/fs.js.map +1 -1
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/__nameKebabCase__/__nameKebabCase__.tf.template +2 -2
- package/src/utils/function-constructs/function-constructs.js +21 -26
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.js +18 -20
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.js +19 -34
- package/src/utils/git.js.map +1 -1
- package/src/utils/iac-providers.js +5 -5
- package/src/utils/iac-providers.js.map +1 -1
- package/src/utils/iac.js +12 -14
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +112 -2
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +19 -6
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +104 -2
- package/src/utils/identity-constructs/files/terraform/core/user-identity/main.tf.template +7 -0
- package/src/utils/identity-constructs/identity-constructs.js +24 -28
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/js.js +27 -20
- package/src/utils/js.js.map +1 -1
- package/src/utils/mcp.js +34 -41
- package/src/utils/mcp.js.map +1 -1
- package/src/utils/metrics.js +30 -45
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/mock-project-graph.js +8 -12
- package/src/utils/mock-project-graph.js.map +1 -1
- package/src/utils/names.d.ts +16 -0
- package/src/utils/names.js +39 -48
- package/src/utils/names.js.map +1 -1
- package/src/utils/npm-scope.js +9 -17
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +18 -2
- package/src/utils/nx.js +111 -74
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.js +27 -15
- package/src/utils/nxlv-python.js.map +1 -1
- package/src/utils/object.js +5 -11
- package/src/utils/object.js.map +1 -1
- package/src/utils/paths.js +11 -15
- package/src/utils/paths.js.map +1 -1
- package/src/utils/pkg-manager.js +4 -9
- package/src/utils/pkg-manager.js.map +1 -1
- package/src/utils/pnpm-workspace.js +22 -22
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.js +26 -36
- package/src/utils/port.js.map +1 -1
- package/src/utils/py.d.ts +14 -1
- package/src/utils/py.js +63 -45
- package/src/utils/py.js.map +1 -1
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +3 -3
- package/src/utils/rdb-constructs/rdb-constructs.js +31 -33
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs-constants.js +16 -16
- package/src/utils/shared-constructs-constants.js.map +1 -1
- package/src/utils/shared-constructs.js +57 -54
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-dynamodb-scripts.js +16 -14
- package/src/utils/shared-dynamodb-scripts.js.map +1 -1
- package/src/utils/shared-infra-config.js +30 -31
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-infra-scripts.js +30 -25
- package/src/utils/shared-infra-scripts.js.map +1 -1
- package/src/utils/shared-rdb-scripts.d.ts +8 -3
- package/src/utils/shared-rdb-scripts.js +21 -13
- package/src/utils/shared-rdb-scripts.js.map +1 -1
- package/src/utils/shared-scripts.js +12 -17
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.js +64 -60
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +8 -0
- package/src/utils/test.js +33 -25
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.js +7 -15
- package/src/utils/toml.js.map +1 -1
- package/src/utils/versions.d.ts +31 -4
- package/src/utils/versions.js +40 -23
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/terraform/app/static-websites/__websiteNameKebabCase__/__websiteNameKebabCase__.tf.template +1 -1
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +4 -4
- package/src/utils/website-constructs/website-constructs.js +31 -30
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- package/bin/aws-nx-mcp.js +0 -17
- package/bin/aws-nx-mcp.js.map +0 -1
- package/sdk/agentcore-gateway.d.ts +0 -6
- package/sdk/agentcore-gateway.js +0 -11
- package/sdk/agentcore-gateway.js.map +0 -1
- package/sdk/connection.d.ts +0 -6
- package/sdk/connection.js +0 -10
- package/sdk/connection.js.map +0 -1
- package/sdk/license.js +0 -14
- package/sdk/license.js.map +0 -1
- package/sdk/open-api.d.ts +0 -10
- package/sdk/open-api.js +0 -15
- package/sdk/open-api.js.map +0 -1
- package/sdk/py.d.ts +0 -14
- package/sdk/py.js +0 -18
- package/sdk/py.js.map +0 -1
- package/sdk/terraform.d.ts +0 -6
- package/sdk/terraform.js +0 -11
- package/sdk/terraform.js.map +0 -1
- package/sdk/ts.d.ts +0 -33
- package/sdk/ts.js +0 -53
- package/sdk/ts.js.map +0 -1
- package/sdk/utils/ast.js +0 -12
- package/sdk/utils/ast.js.map +0 -1
- package/sdk/utils/format.js +0 -10
- package/sdk/utils/format.js.map +0 -1
- package/sdk/utils/test.js +0 -10
- package/sdk/utils/test.js.map +0 -1
- package/src/connection/agent-serve-local.js +0 -48
- package/src/connection/agent-serve-local.js.map +0 -1
- package/src/connection/serve-local.js +0 -41
- package/src/connection/serve-local.js.map +0 -1
- package/src/py/agent/react-connection/serve-local.js +0 -38
- package/src/py/agent/react-connection/serve-local.js.map +0 -1
- package/src/ts/agent/react-connection/serve-local.js +0 -19
- package/src/ts/agent/react-connection/serve-local.js.map +0 -1
- package/src/utils/files/common/scripts/src/rdb/wait-for-db.ts.template +0 -59
- /package/src/agentcore-gateway/files/project/{serve-local.ts.template → local-dev.ts.template} +0 -0
- /package/{bin → src/bin}/aws-nx-mcp.d.ts +0 -0
package/src/license/config.js
CHANGED
|
@@ -1,50 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.readLicenseConfig = exports.writeLicenseConfig = exports.defaultLicenseConfig = exports.ensurePythonLicenseCollector = exports.ensureLicenseExceptions = exports.ensureDependencyCheckBlock = exports.addLicenseCheckToAllLintTargets = exports.addLicenseCheckToLintTarget = exports.updateLicenseCheckTargetInputs = exports.LANGUAGE_COMMENT_SYNTAX = void 0;
|
|
37
|
-
const utils_1 = require("../utils/config/utils");
|
|
38
|
-
const format_1 = require("../utils/format");
|
|
39
|
-
const nx_1 = require("../utils/nx");
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/ import { getProjects, readProjectConfiguration, updateProjectConfiguration } from "@nx/devkit";
|
|
5
|
+
import { AWS_NX_PLUGIN_CONFIG_FILE_NAME, readAwsNxPluginConfig, updateAwsNxPluginConfig } from "../utils/config/utils.js";
|
|
6
|
+
import { formatFilesInSubtree } from "../utils/format.js";
|
|
7
|
+
import { addDependencyToTargetIfNotPresent } from "../utils/nx.js";
|
|
40
8
|
/**
|
|
41
9
|
* Licenses containing a placeholder for the copyright year.
|
|
42
|
-
*/
|
|
43
|
-
|
|
10
|
+
*/ const LICENSES_WITH_YEAR = new Set([
|
|
11
|
+
'MIT'
|
|
12
|
+
]);
|
|
44
13
|
/**
|
|
45
14
|
* Defines the comment syntax for popular programming languages
|
|
46
|
-
*/
|
|
47
|
-
exports.LANGUAGE_COMMENT_SYNTAX = {
|
|
15
|
+
*/ export const LANGUAGE_COMMENT_SYNTAX = {
|
|
48
16
|
// C++ style comments
|
|
49
17
|
...Object.fromEntries([
|
|
50
18
|
// Node
|
|
@@ -85,8 +53,17 @@ exports.LANGUAGE_COMMENT_SYNTAX = {
|
|
|
85
53
|
// Kotlin
|
|
86
54
|
'kt',
|
|
87
55
|
// Swift
|
|
88
|
-
'swift'
|
|
89
|
-
].map((ext)
|
|
56
|
+
'swift'
|
|
57
|
+
].map((ext)=>[
|
|
58
|
+
ext,
|
|
59
|
+
{
|
|
60
|
+
line: '//',
|
|
61
|
+
block: {
|
|
62
|
+
start: '/*',
|
|
63
|
+
end: '*/'
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
])),
|
|
90
67
|
// Bash style comments
|
|
91
68
|
...Object.fromEntries([
|
|
92
69
|
// Bash
|
|
@@ -97,48 +74,119 @@ exports.LANGUAGE_COMMENT_SYNTAX = {
|
|
|
97
74
|
'yaml',
|
|
98
75
|
'yml',
|
|
99
76
|
// R
|
|
100
|
-
'r'
|
|
101
|
-
].map((ext)
|
|
77
|
+
'r'
|
|
78
|
+
].map((ext)=>[
|
|
79
|
+
ext,
|
|
80
|
+
{
|
|
81
|
+
line: '#'
|
|
82
|
+
}
|
|
83
|
+
])),
|
|
102
84
|
// Docker
|
|
103
|
-
Dockerfile: {
|
|
85
|
+
Dockerfile: {
|
|
86
|
+
line: '#'
|
|
87
|
+
},
|
|
104
88
|
// Python
|
|
105
|
-
py: {
|
|
89
|
+
py: {
|
|
90
|
+
line: '#',
|
|
91
|
+
block: {
|
|
92
|
+
start: '"""',
|
|
93
|
+
end: '"""'
|
|
94
|
+
}
|
|
95
|
+
},
|
|
106
96
|
// Web
|
|
107
|
-
html: {
|
|
108
|
-
|
|
97
|
+
html: {
|
|
98
|
+
block: {
|
|
99
|
+
start: '<!--',
|
|
100
|
+
end: '-->'
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
css: {
|
|
104
|
+
block: {
|
|
105
|
+
start: '/*',
|
|
106
|
+
end: '*/'
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
109
|
// Ruby
|
|
110
|
-
rb: {
|
|
110
|
+
rb: {
|
|
111
|
+
line: '#',
|
|
112
|
+
block: {
|
|
113
|
+
start: '=begin',
|
|
114
|
+
end: '=end'
|
|
115
|
+
}
|
|
116
|
+
},
|
|
111
117
|
// F#
|
|
112
|
-
...Object.fromEntries([
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
])
|
|
118
|
+
...Object.fromEntries([
|
|
119
|
+
'fs',
|
|
120
|
+
'fsx'
|
|
121
|
+
].map((ext)=>[
|
|
122
|
+
ext,
|
|
123
|
+
{
|
|
124
|
+
line: '//',
|
|
125
|
+
block: {
|
|
126
|
+
start: '(*',
|
|
127
|
+
end: '*)'
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
])),
|
|
116
131
|
// Visual Basic
|
|
117
|
-
vb: {
|
|
132
|
+
vb: {
|
|
133
|
+
line: "' "
|
|
134
|
+
},
|
|
118
135
|
// Lua
|
|
119
|
-
lua: {
|
|
136
|
+
lua: {
|
|
137
|
+
line: '--',
|
|
138
|
+
block: {
|
|
139
|
+
start: '--[[',
|
|
140
|
+
end: ']]'
|
|
141
|
+
}
|
|
142
|
+
},
|
|
120
143
|
// PowerShell
|
|
121
|
-
ps1: {
|
|
122
|
-
|
|
144
|
+
ps1: {
|
|
145
|
+
line: '#',
|
|
146
|
+
block: {
|
|
147
|
+
start: '<#',
|
|
148
|
+
end: '#>'
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
psm1: {
|
|
152
|
+
line: '#',
|
|
153
|
+
block: {
|
|
154
|
+
start: '<#',
|
|
155
|
+
end: '#>'
|
|
156
|
+
}
|
|
157
|
+
},
|
|
123
158
|
// Markdown
|
|
124
|
-
md: {
|
|
159
|
+
md: {
|
|
160
|
+
block: {
|
|
161
|
+
start: '<!--',
|
|
162
|
+
end: '-->'
|
|
163
|
+
}
|
|
164
|
+
},
|
|
125
165
|
// Terraform
|
|
126
|
-
tf: {
|
|
166
|
+
tf: {
|
|
167
|
+
line: '#',
|
|
168
|
+
block: {
|
|
169
|
+
start: '/*',
|
|
170
|
+
end: '*/'
|
|
171
|
+
}
|
|
172
|
+
},
|
|
127
173
|
// Smithy
|
|
128
|
-
smithy: {
|
|
174
|
+
smithy: {
|
|
175
|
+
line: '//'
|
|
176
|
+
}
|
|
129
177
|
};
|
|
130
178
|
/**
|
|
131
179
|
* Module specifier for the license helpers exported by this package, used by
|
|
132
180
|
* imports written into the user's config file.
|
|
133
|
-
*/
|
|
134
|
-
const LICENSE_SDK_MODULE = '@aws/nx-plugin/sdk/license';
|
|
181
|
+
*/ const LICENSE_SDK_MODULE = '@aws/nx-plugin/sdk/license';
|
|
135
182
|
/**
|
|
136
183
|
* Build the object literal source for a dependency check exception.
|
|
137
184
|
* `JSON.stringify` produces valid string literals for arbitrary text (quotes,
|
|
138
185
|
* backslashes, newlines all escaped); prettier later normalises quote style.
|
|
139
|
-
*/
|
|
140
|
-
const
|
|
141
|
-
|
|
186
|
+
*/ const exceptionLiteral = (exception)=>{
|
|
187
|
+
const parts = [
|
|
188
|
+
`package: ${JSON.stringify(exception.package)}`
|
|
189
|
+
];
|
|
142
190
|
if (exception.version !== undefined) {
|
|
143
191
|
parts.push(`version: ${JSON.stringify(exception.version)}`);
|
|
144
192
|
}
|
|
@@ -156,8 +204,7 @@ const exceptionLiteral = (exception) => {
|
|
|
156
204
|
* - otherwise → list-append `+=` of `, $ins`; the leading comma is the
|
|
157
205
|
* element separator and `+=` places it correctly for single inline,
|
|
158
206
|
* single-with-trailing-comma and multi-element arrays alike
|
|
159
|
-
*/
|
|
160
|
-
const appendToArray = (key, ins) => `or {
|
|
207
|
+
*/ const appendToArray = (key, ins)=>`or {
|
|
161
208
|
$scope <: contains \`${key}: []\` => \`${key}: [${ins}]\`,
|
|
162
209
|
$scope <: contains \`${key}: [$items]\` where { $items += \`, ${ins}\` }
|
|
163
210
|
}`;
|
|
@@ -170,38 +217,33 @@ const appendToArray = (key, ins) => `or {
|
|
|
170
217
|
* is an object/array literal (e.g. `source: { ... }`), corrupting the file. The
|
|
171
218
|
* property text is routed through a placeholder so its content never enters the
|
|
172
219
|
* GritQL pattern. Returns true if the file changed (a `license` object existed).
|
|
173
|
-
*/
|
|
174
|
-
const
|
|
175
|
-
const { insertViaGritQL, GRIT_INSERT_PLACEHOLDER } = await Promise.resolve().then(() => __importStar(require('../utils/ast')));
|
|
220
|
+
*/ const prependLicenseProperty = async (tree, property)=>{
|
|
221
|
+
const { insertViaGritQL, GRIT_INSERT_PLACEHOLDER } = await import("../utils/ast.js");
|
|
176
222
|
// Non-empty license object: insert before the first existing property.
|
|
177
|
-
const intoNonEmpty = await insertViaGritQL(tree,
|
|
178
|
-
if (intoNonEmpty)
|
|
179
|
-
return true;
|
|
223
|
+
const intoNonEmpty = await insertViaGritQL(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME, `\`license: { $props }\` where { $props => \`${GRIT_INSERT_PLACEHOLDER}, $props\` }`, property);
|
|
224
|
+
if (intoNonEmpty) return true;
|
|
180
225
|
// Empty license object: `{ $props }` doesn't match `{}`, so fill it directly.
|
|
181
|
-
return insertViaGritQL(tree,
|
|
226
|
+
return insertViaGritQL(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME, `\`license: {}\` => \`license: { ${GRIT_INSERT_PLACEHOLDER} }\``, property);
|
|
182
227
|
};
|
|
183
228
|
/**
|
|
184
229
|
* Whether `license.dependencies` (the dependency-check block) is configured.
|
|
185
230
|
* Scoped within `license` so a `dependencies`-shaped object elsewhere in the
|
|
186
231
|
* file isn't mistaken for it.
|
|
187
|
-
*/
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
const { matchGritQL } = await Promise.resolve().then(() => __importStar(require('../utils/ast')));
|
|
192
|
-
return matchGritQL(tree, utils_1.AWS_NX_PLUGIN_CONFIG_FILE_NAME, '`license: { $l }` where { $l <: contains `dependencies: $_` }');
|
|
232
|
+
*/ const hasDependenciesBlock = async (tree)=>{
|
|
233
|
+
if (!tree.exists(AWS_NX_PLUGIN_CONFIG_FILE_NAME)) return false;
|
|
234
|
+
const { matchGritQL } = await import("../utils/ast.js");
|
|
235
|
+
return matchGritQL(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME, '`license: { $l }` where { $l <: contains `dependencies: $_` }');
|
|
193
236
|
};
|
|
194
237
|
/**
|
|
195
238
|
* Workspace-root npm-ecosystem lockfiles. Each is added to the license-check
|
|
196
239
|
* cache inputs only when present, so the cache invalidates on dependency
|
|
197
240
|
* changes without listing lockfiles for package managers the workspace doesn't
|
|
198
241
|
* use.
|
|
199
|
-
*/
|
|
200
|
-
const NPM_LOCKFILES = [
|
|
242
|
+
*/ const NPM_LOCKFILES = [
|
|
201
243
|
'pnpm-lock.yaml',
|
|
202
244
|
'yarn.lock',
|
|
203
245
|
'package-lock.json',
|
|
204
|
-
'bun.lockb'
|
|
246
|
+
'bun.lockb'
|
|
205
247
|
];
|
|
206
248
|
/**
|
|
207
249
|
* Recompute the `inputs` of the root `license-check` target from what's
|
|
@@ -213,16 +255,13 @@ const NPM_LOCKFILES = [
|
|
|
213
255
|
* a uv workspace. Callers run this whenever they change the relevant state, so
|
|
214
256
|
* the inputs stay correct regardless of generator order. No-op if the
|
|
215
257
|
* license-check target doesn't exist yet.
|
|
216
|
-
*/
|
|
217
|
-
const updateLicenseCheckTargetInputs = async (tree) => {
|
|
258
|
+
*/ export const updateLicenseCheckTargetInputs = async (tree)=>{
|
|
218
259
|
const rootProjectJsonPath = 'project.json';
|
|
219
|
-
if (!tree.exists(rootProjectJsonPath))
|
|
220
|
-
return;
|
|
260
|
+
if (!tree.exists(rootProjectJsonPath)) return;
|
|
221
261
|
const rootProject = JSON.parse(tree.read(rootProjectJsonPath, 'utf-8'));
|
|
222
262
|
const target = rootProject.targets?.['license-check'];
|
|
223
|
-
if (!target)
|
|
224
|
-
|
|
225
|
-
const inputs = NPM_LOCKFILES.filter((f) => tree.exists(f)).map((f) => `{workspaceRoot}/${f}`);
|
|
263
|
+
if (!target) return;
|
|
264
|
+
const inputs = NPM_LOCKFILES.filter((f)=>tree.exists(f)).map((f)=>`{workspaceRoot}/${f}`);
|
|
226
265
|
if (await hasPythonCollector(tree)) {
|
|
227
266
|
inputs.push('{workspaceRoot}/**/uv.lock');
|
|
228
267
|
}
|
|
@@ -230,25 +269,19 @@ const updateLicenseCheckTargetInputs = async (tree) => {
|
|
|
230
269
|
target.inputs = inputs;
|
|
231
270
|
tree.write(rootProjectJsonPath, JSON.stringify(rootProject, null, 2));
|
|
232
271
|
};
|
|
233
|
-
exports.updateLicenseCheckTargetInputs = updateLicenseCheckTargetInputs;
|
|
234
272
|
/**
|
|
235
273
|
* Whether the dependency check config has a `pythonCollector` configured.
|
|
236
|
-
*/
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const { matchGritQL } = await Promise.resolve().then(() => __importStar(require('../utils/ast')));
|
|
241
|
-
return matchGritQL(tree, utils_1.AWS_NX_PLUGIN_CONFIG_FILE_NAME, '`pythonCollector`');
|
|
274
|
+
*/ const hasPythonCollector = async (tree)=>{
|
|
275
|
+
if (!tree.exists(AWS_NX_PLUGIN_CONFIG_FILE_NAME)) return false;
|
|
276
|
+
const { matchGritQL } = await import("../utils/ast.js");
|
|
277
|
+
return matchGritQL(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME, '`pythonCollector`');
|
|
242
278
|
};
|
|
243
279
|
/**
|
|
244
280
|
* The name of the project that owns the root `license-check` target, or
|
|
245
281
|
* undefined if no project defines it.
|
|
246
|
-
*/
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
for (const [name, config] of getProjects(tree)) {
|
|
250
|
-
if (config.targets?.['license-check'])
|
|
251
|
-
return name;
|
|
282
|
+
*/ const findLicenseCheckProjectName = (tree)=>{
|
|
283
|
+
for (const [name, config] of getProjects(tree)){
|
|
284
|
+
if (config.targets?.['license-check']) return name;
|
|
252
285
|
}
|
|
253
286
|
return undefined;
|
|
254
287
|
};
|
|
@@ -259,58 +292,47 @@ const findLicenseCheckProjectName = (tree) => {
|
|
|
259
292
|
*
|
|
260
293
|
* Callers format afterwards (generators call `formatFilesInSubtree` at the end),
|
|
261
294
|
* so the rewritten project.json matches prettier.
|
|
262
|
-
*/
|
|
263
|
-
const addLicenseCheckToLintTarget = (tree, projectName) => {
|
|
264
|
-
const { readProjectConfiguration, updateProjectConfiguration, } = require('@nx/devkit');
|
|
295
|
+
*/ export const addLicenseCheckToLintTarget = (tree, projectName)=>{
|
|
265
296
|
const licenseCheckProject = findLicenseCheckProjectName(tree);
|
|
266
|
-
if (!licenseCheckProject)
|
|
267
|
-
return;
|
|
297
|
+
if (!licenseCheckProject) return;
|
|
268
298
|
let project;
|
|
269
299
|
try {
|
|
270
300
|
project = readProjectConfiguration(tree, projectName);
|
|
271
|
-
}
|
|
272
|
-
catch {
|
|
301
|
+
} catch {
|
|
273
302
|
return;
|
|
274
303
|
}
|
|
275
304
|
// Only wire projects that actually lint, and never the license-check project
|
|
276
305
|
// itself (a target can't depend on its own project's target).
|
|
277
|
-
if (!project.targets?.lint || projectName === licenseCheckProject)
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
306
|
+
if (!project.targets?.lint || projectName === licenseCheckProject) return;
|
|
307
|
+
addDependencyToTargetIfNotPresent(project, 'lint', {
|
|
308
|
+
projects: [
|
|
309
|
+
licenseCheckProject
|
|
310
|
+
],
|
|
311
|
+
target: 'license-check'
|
|
282
312
|
});
|
|
283
313
|
updateProjectConfiguration(tree, projectName, project);
|
|
284
314
|
};
|
|
285
|
-
exports.addLicenseCheckToLintTarget = addLicenseCheckToLintTarget;
|
|
286
315
|
/**
|
|
287
316
|
* Wire every project's `lint` target to the root `license-check` target.
|
|
288
317
|
* Called by the license generator so existing projects pick up the dependency
|
|
289
318
|
* regardless of the order generators ran in.
|
|
290
|
-
*/
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
for (const [name] of getProjects(tree)) {
|
|
294
|
-
(0, exports.addLicenseCheckToLintTarget)(tree, name);
|
|
319
|
+
*/ export const addLicenseCheckToAllLintTargets = (tree)=>{
|
|
320
|
+
for (const [name] of getProjects(tree)){
|
|
321
|
+
addLicenseCheckToLintTarget(tree, name);
|
|
295
322
|
}
|
|
296
323
|
};
|
|
297
|
-
exports.addLicenseCheckToAllLintTargets = addLicenseCheckToAllLintTargets;
|
|
298
324
|
/**
|
|
299
325
|
* Ensure the `dependencies` block (dependency license checking) exists within
|
|
300
326
|
* the `license` config. If one already exists it is left untouched, so user
|
|
301
327
|
* customizations survive.
|
|
302
|
-
*/
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
return;
|
|
306
|
-
const { addDestructuredImport } = await Promise.resolve().then(() => __importStar(require('../utils/ast')));
|
|
328
|
+
*/ export const ensureDependencyCheckBlock = async (tree, options)=>{
|
|
329
|
+
if (!tree.exists(AWS_NX_PLUGIN_CONFIG_FILE_NAME)) return;
|
|
330
|
+
const { addDestructuredImport } = await import("../utils/ast.js");
|
|
307
331
|
if (await hasDependenciesBlock(tree)) {
|
|
308
332
|
return;
|
|
309
333
|
}
|
|
310
334
|
const withPython = options?.includeCollectors === 'npm+python';
|
|
311
|
-
const collectors = withPython
|
|
312
|
-
? 'collectors: [npmCollector(), pythonCollector()]'
|
|
313
|
-
: 'collectors: [npmCollector()]';
|
|
335
|
+
const collectors = withPython ? 'collectors: [npmCollector(), pythonCollector()]' : 'collectors: [npmCollector()]';
|
|
314
336
|
const block = `dependencies: { allow: DEFAULT_LICENSE_ALLOWLIST, ${collectors}, exceptions: [] }`;
|
|
315
337
|
// Prepend the block as the first property of the license object. Prepending
|
|
316
338
|
// (rather than `+=` appending) is comma-safe for every shape: GritQL's `+=`
|
|
@@ -320,13 +342,17 @@ const ensureDependencyCheckBlock = async (tree, options) => {
|
|
|
320
342
|
// Only add the imports if the block was actually written (i.e. a license
|
|
321
343
|
// object literal existed to attach it to).
|
|
322
344
|
if (added) {
|
|
323
|
-
await addDestructuredImport(tree,
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
345
|
+
await addDestructuredImport(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME, withPython ? [
|
|
346
|
+
'DEFAULT_LICENSE_ALLOWLIST',
|
|
347
|
+
'npmCollector',
|
|
348
|
+
'pythonCollector'
|
|
349
|
+
] : [
|
|
350
|
+
'DEFAULT_LICENSE_ALLOWLIST',
|
|
351
|
+
'npmCollector'
|
|
352
|
+
], LICENSE_SDK_MODULE);
|
|
353
|
+
await formatFilesInSubtree(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME);
|
|
327
354
|
}
|
|
328
355
|
};
|
|
329
|
-
exports.ensureDependencyCheckBlock = ensureDependencyCheckBlock;
|
|
330
356
|
/**
|
|
331
357
|
* Ensure license exceptions are present in `license.dependencies.exceptions`.
|
|
332
358
|
* An exception whose package is already listed is skipped (so existing reasons
|
|
@@ -335,132 +361,132 @@ exports.ensureDependencyCheckBlock = ensureDependencyCheckBlock;
|
|
|
335
361
|
*
|
|
336
362
|
* The `dependencies: { $scope }` scope keeps edits within the dependency-check
|
|
337
363
|
* block, so an `exceptions` array elsewhere in the file isn't matched.
|
|
338
|
-
*/
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
const { insertViaGritQL, GRIT_INSERT_PLACEHOLDER } = await Promise.resolve().then(() => __importStar(require('../utils/ast')));
|
|
343
|
-
if (!(await hasDependenciesBlock(tree))) {
|
|
364
|
+
*/ export const ensureLicenseExceptions = async (tree, exceptions)=>{
|
|
365
|
+
if (!tree.exists(AWS_NX_PLUGIN_CONFIG_FILE_NAME)) return;
|
|
366
|
+
const { insertViaGritQL, GRIT_INSERT_PLACEHOLDER } = await import("../utils/ast.js");
|
|
367
|
+
if (!await hasDependenciesBlock(tree)) {
|
|
344
368
|
return;
|
|
345
369
|
}
|
|
346
370
|
let modified = false;
|
|
347
|
-
for (const exception of exceptions)
|
|
371
|
+
for (const exception of exceptions){
|
|
348
372
|
const pkg = JSON.stringify(exception.package);
|
|
349
|
-
const inserted = await insertViaGritQL(tree,
|
|
373
|
+
const inserted = await insertViaGritQL(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME, `\`dependencies: { $scope }\` where {
|
|
350
374
|
$scope <: not contains \`package: ${pkg}\`,
|
|
351
375
|
${appendToArray('exceptions', GRIT_INSERT_PLACEHOLDER)}
|
|
352
376
|
}`, exceptionLiteral(exception));
|
|
353
377
|
modified ||= inserted;
|
|
354
378
|
}
|
|
355
379
|
if (modified) {
|
|
356
|
-
await
|
|
380
|
+
await formatFilesInSubtree(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME);
|
|
357
381
|
}
|
|
358
382
|
};
|
|
359
|
-
exports.ensureLicenseExceptions = ensureLicenseExceptions;
|
|
360
383
|
/**
|
|
361
384
|
* Add `pythonCollector()` to `license.dependencies.collectors`, unless one is
|
|
362
385
|
* already configured.
|
|
363
|
-
*/
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
const { addDestructuredImport, insertViaGritQL, GRIT_INSERT_PLACEHOLDER } = await Promise.resolve().then(() => __importStar(require('../utils/ast')));
|
|
368
|
-
if (!(await hasDependenciesBlock(tree))) {
|
|
386
|
+
*/ export const ensurePythonLicenseCollector = async (tree)=>{
|
|
387
|
+
if (!tree.exists(AWS_NX_PLUGIN_CONFIG_FILE_NAME)) return;
|
|
388
|
+
const { addDestructuredImport, insertViaGritQL, GRIT_INSERT_PLACEHOLDER } = await import("../utils/ast.js");
|
|
389
|
+
if (!await hasDependenciesBlock(tree)) {
|
|
369
390
|
return;
|
|
370
391
|
}
|
|
371
|
-
const added = await insertViaGritQL(tree,
|
|
392
|
+
const added = await insertViaGritQL(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME, `\`dependencies: { $scope }\` where {
|
|
372
393
|
$scope <: not contains \`pythonCollector\`,
|
|
373
394
|
${appendToArray('collectors', GRIT_INSERT_PLACEHOLDER)}
|
|
374
395
|
}`, 'pythonCollector()');
|
|
375
396
|
if (added) {
|
|
376
|
-
await addDestructuredImport(tree,
|
|
377
|
-
|
|
397
|
+
await addDestructuredImport(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME, [
|
|
398
|
+
'pythonCollector'
|
|
399
|
+
], LICENSE_SDK_MODULE);
|
|
400
|
+
await formatFilesInSubtree(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME);
|
|
378
401
|
// Now that a Python collector is configured, ensure uv.lock is a cache
|
|
379
402
|
// input. Runs here (not only in the license generator) so it's added
|
|
380
403
|
// whenever the collector is — e.g. when py#project runs after license.
|
|
381
|
-
await
|
|
404
|
+
await updateLicenseCheckTargetInputs(tree);
|
|
382
405
|
}
|
|
383
406
|
};
|
|
384
|
-
exports.ensurePythonLicenseCollector = ensurePythonLicenseCollector;
|
|
385
407
|
/**
|
|
386
408
|
* Build the default `license.source` config for a given license
|
|
387
|
-
*/
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
'**/*.{js,ts,jsx,tsx,mjs,mts}': {
|
|
413
|
-
blockStart: `/***${'*'.repeat(maxLen)}**`,
|
|
414
|
-
lineStart: ' * ',
|
|
415
|
-
lineEnd: ' *',
|
|
416
|
-
blockEnd: ` ***${'*'.repeat(maxLen)}**/`,
|
|
409
|
+
*/ export const defaultLicenseConfig = (spdx, copyrightHolder)=>{
|
|
410
|
+
switch(spdx){
|
|
411
|
+
case 'ASL':
|
|
412
|
+
{
|
|
413
|
+
// For ASL, we use a "box" style license header
|
|
414
|
+
const rawContent = [
|
|
415
|
+
`Copyright ${copyrightHolder}. All Rights Reserved.`,
|
|
416
|
+
'',
|
|
417
|
+
'Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance',
|
|
418
|
+
'with the License. A copy of the License is located at',
|
|
419
|
+
'',
|
|
420
|
+
' https://aws.amazon.com/asl/',
|
|
421
|
+
'',
|
|
422
|
+
'or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES',
|
|
423
|
+
'OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions',
|
|
424
|
+
'and limitations under the License.'
|
|
425
|
+
];
|
|
426
|
+
const maxLen = Math.max(...rawContent.map((line)=>line.length));
|
|
427
|
+
const lines = rawContent.map((line)=>`${line}${' '.repeat(maxLen - line.length)}`);
|
|
428
|
+
return {
|
|
429
|
+
spdx,
|
|
430
|
+
copyrightHolder,
|
|
431
|
+
header: {
|
|
432
|
+
content: {
|
|
433
|
+
lines
|
|
417
434
|
},
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
435
|
+
format: {
|
|
436
|
+
'**/*.{js,ts,jsx,tsx,mjs,mts}': {
|
|
437
|
+
blockStart: `/***${'*'.repeat(maxLen)}**`,
|
|
438
|
+
lineStart: ' * ',
|
|
439
|
+
lineEnd: ' *',
|
|
440
|
+
blockEnd: ` ***${'*'.repeat(maxLen)}**/`
|
|
441
|
+
},
|
|
442
|
+
'**/*.{py,sh,tf}': {
|
|
443
|
+
blockStart: `###${'#'.repeat(maxLen)}##`,
|
|
444
|
+
lineStart: '# ',
|
|
445
|
+
lineEnd: ' #',
|
|
446
|
+
blockEnd: `###${'#'.repeat(maxLen)}##`
|
|
447
|
+
}
|
|
423
448
|
},
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
default: {
|
|
430
|
-
return {
|
|
431
|
-
spdx,
|
|
432
|
-
copyrightHolder,
|
|
433
|
-
...(LICENSES_WITH_YEAR.has(spdx)
|
|
434
|
-
? {
|
|
435
|
-
copyrightYear: new Date().getFullYear(),
|
|
449
|
+
exclude: [
|
|
450
|
+
'**/*.gen.*'
|
|
451
|
+
]
|
|
436
452
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
default:
|
|
456
|
+
{
|
|
457
|
+
return {
|
|
458
|
+
spdx,
|
|
459
|
+
copyrightHolder,
|
|
460
|
+
...LICENSES_WITH_YEAR.has(spdx) ? {
|
|
461
|
+
copyrightYear: new Date().getFullYear()
|
|
462
|
+
} : {},
|
|
463
|
+
header: {
|
|
464
|
+
content: {
|
|
465
|
+
lines: [
|
|
466
|
+
`Copyright ${copyrightHolder}. All Rights Reserved.`,
|
|
467
|
+
`SPDX-License-Identifier: ${spdx}`
|
|
468
|
+
]
|
|
450
469
|
},
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
470
|
+
format: {
|
|
471
|
+
'**/*.{js,ts,jsx,tsx,mjs,mts}': {
|
|
472
|
+
blockStart: '/**',
|
|
473
|
+
lineStart: ' * ',
|
|
474
|
+
blockEnd: ' */'
|
|
475
|
+
},
|
|
476
|
+
'**/*.{py,sh,tf}': {
|
|
477
|
+
blockStart: '#',
|
|
478
|
+
lineStart: '# ',
|
|
479
|
+
blockEnd: '#'
|
|
480
|
+
}
|
|
455
481
|
},
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
482
|
+
exclude: [
|
|
483
|
+
'**/*.gen.*'
|
|
484
|
+
]
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
}
|
|
461
488
|
}
|
|
462
489
|
};
|
|
463
|
-
exports.defaultLicenseConfig = defaultLicenseConfig;
|
|
464
490
|
/**
|
|
465
491
|
* Write the `license.source` config (headers + LICENSE files) to the aws nx
|
|
466
492
|
* plugin config.
|
|
@@ -469,30 +495,29 @@ exports.defaultLicenseConfig = defaultLicenseConfig;
|
|
|
469
495
|
* block — a user-customized allowlist, collectors and exceptions — is
|
|
470
496
|
* preserved, so re-running the license generator (e.g. to change the copyright
|
|
471
497
|
* holder) never clobbers dependency-check customizations.
|
|
472
|
-
*/
|
|
473
|
-
const
|
|
474
|
-
const { captureGritQL } = await Promise.resolve().then(() => __importStar(require('../utils/ast')));
|
|
498
|
+
*/ export const writeLicenseConfig = async (tree, source)=>{
|
|
499
|
+
const { captureGritQL } = await import("../utils/ast.js");
|
|
475
500
|
// Capture the existing `dependencies: { ... }` block before overwriting the
|
|
476
501
|
// license value, so we can re-attach it afterwards. It's managed by the
|
|
477
502
|
// ensure* helpers, never written from here.
|
|
478
|
-
const preserved = tree.exists(
|
|
479
|
-
|
|
480
|
-
:
|
|
481
|
-
|
|
503
|
+
const preserved = tree.exists(AWS_NX_PLUGIN_CONFIG_FILE_NAME) ? await captureGritQL(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME, '`dependencies: $_`') : undefined;
|
|
504
|
+
await updateAwsNxPluginConfig(tree, {
|
|
505
|
+
license: {
|
|
506
|
+
source
|
|
507
|
+
}
|
|
508
|
+
});
|
|
482
509
|
// Re-attach the preserved block. The captured text may contain backticks,
|
|
483
510
|
// `${...}` or quotes — prependLicenseProperty routes it through a placeholder
|
|
484
511
|
// so it never enters the GritQL pattern.
|
|
485
512
|
if (preserved) {
|
|
486
513
|
await prependLicenseProperty(tree, preserved);
|
|
487
|
-
await
|
|
514
|
+
await formatFilesInSubtree(tree, AWS_NX_PLUGIN_CONFIG_FILE_NAME);
|
|
488
515
|
}
|
|
489
516
|
};
|
|
490
|
-
exports.writeLicenseConfig = writeLicenseConfig;
|
|
491
517
|
/**
|
|
492
518
|
* Read license configuration
|
|
493
|
-
*/
|
|
494
|
-
|
|
495
|
-
return (await (0, utils_1.readAwsNxPluginConfig)(tree))?.license;
|
|
519
|
+
*/ export const readLicenseConfig = async (tree)=>{
|
|
520
|
+
return (await readAwsNxPluginConfig(tree))?.license;
|
|
496
521
|
};
|
|
497
|
-
|
|
522
|
+
|
|
498
523
|
//# sourceMappingURL=config.js.map
|