@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
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import { createConnection } from 'mariadb';
|
|
3
|
+
|
|
4
|
+
const { port, dbName, dbUser, dbPassword, dbEngine } =
|
|
5
|
+
JSON.parse(readFileSync('config.json', 'utf-8')).localDev;
|
|
6
|
+
|
|
7
|
+
const noop = () => undefined;
|
|
8
|
+
const timeoutAt = Date.now() + 60000;
|
|
9
|
+
|
|
10
|
+
while (Date.now() < timeoutAt) {
|
|
11
|
+
let conn: Awaited<ReturnType<typeof createConnection>> | undefined;
|
|
12
|
+
try {
|
|
13
|
+
conn = await createConnection({
|
|
14
|
+
host: 'localhost',
|
|
15
|
+
port: parseInt(port),
|
|
16
|
+
user: dbUser,
|
|
17
|
+
password: dbPassword,
|
|
18
|
+
database: dbName,
|
|
19
|
+
connectTimeout: 500,
|
|
20
|
+
allowPublicKeyRetrieval: true,
|
|
21
|
+
});
|
|
22
|
+
await conn.end();
|
|
23
|
+
console.log('Database is ready.');
|
|
24
|
+
process.exit(0);
|
|
25
|
+
} catch {
|
|
26
|
+
console.log('Database is not ready.');
|
|
27
|
+
await conn?.end().catch(noop);
|
|
28
|
+
}
|
|
29
|
+
await new Promise((r) => setTimeout(r, 200));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
throw new Error(`Timed out waiting for ${dbEngine} on port ${port}`);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import { Client } from 'pg';
|
|
3
|
+
|
|
4
|
+
const { port, dbName, dbUser, dbPassword, dbEngine } =
|
|
5
|
+
JSON.parse(readFileSync('config.json', 'utf-8')).localDev;
|
|
6
|
+
|
|
7
|
+
const noop = () => undefined;
|
|
8
|
+
const timeoutAt = Date.now() + 60000;
|
|
9
|
+
|
|
10
|
+
while (Date.now() < timeoutAt) {
|
|
11
|
+
const client = new Client({
|
|
12
|
+
host: 'localhost',
|
|
13
|
+
port: parseInt(port),
|
|
14
|
+
user: dbUser,
|
|
15
|
+
password: dbPassword,
|
|
16
|
+
database: dbName,
|
|
17
|
+
connectionTimeoutMillis: 500,
|
|
18
|
+
});
|
|
19
|
+
client.on('error', noop);
|
|
20
|
+
try {
|
|
21
|
+
await client.connect();
|
|
22
|
+
await client.end();
|
|
23
|
+
console.log('Database is ready.');
|
|
24
|
+
process.exit(0);
|
|
25
|
+
} catch {
|
|
26
|
+
console.log('Database is not ready.');
|
|
27
|
+
await client.end().catch(noop);
|
|
28
|
+
}
|
|
29
|
+
await new Promise((r) => setTimeout(r, 200));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
throw new Error(`Timed out waiting for ${dbEngine} on port ${port}`);
|
|
@@ -2,7 +2,7 @@ import { spawnSync } from 'child_process';
|
|
|
2
2
|
import { readFileSync } from 'fs';
|
|
3
3
|
|
|
4
4
|
const { containerEngine, image } =
|
|
5
|
-
JSON.parse(readFileSync('config.json', 'utf-8')).
|
|
5
|
+
JSON.parse(readFileSync('config.json', 'utf-8')).localDev;
|
|
6
6
|
|
|
7
7
|
const inspect = spawnSync(containerEngine, ['image', 'inspect', image], {
|
|
8
8
|
stdio: 'ignore',
|
|
@@ -10,7 +10,7 @@ const {
|
|
|
10
10
|
dbUser,
|
|
11
11
|
dbPassword,
|
|
12
12
|
dbEngine,
|
|
13
|
-
} = JSON.parse(readFileSync("config.json", "utf-8")).
|
|
13
|
+
} = JSON.parse(readFileSync("config.json", "utf-8")).localDev;
|
|
14
14
|
|
|
15
15
|
const containerExists = (): boolean =>
|
|
16
16
|
spawnSync(containerEngine, ["container", "inspect", containerName], {
|
|
@@ -26,6 +26,21 @@ const isRunning = (): boolean => {
|
|
|
26
26
|
return result.status === 0 && result.stdout.trim() === "true";
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
// Ensure the image is available locally before starting the container.
|
|
30
|
+
const ensureImage = (): void => {
|
|
31
|
+
const inspect = spawnSync(containerEngine, ["image", "inspect", image], {
|
|
32
|
+
stdio: "ignore",
|
|
33
|
+
});
|
|
34
|
+
if (inspect.status !== 0) {
|
|
35
|
+
const pull = spawnSync(containerEngine, ["pull", image], {
|
|
36
|
+
stdio: "inherit",
|
|
37
|
+
});
|
|
38
|
+
if (pull.status !== 0) process.exit(pull.status ?? 1);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
ensureImage();
|
|
43
|
+
|
|
29
44
|
if (containerExists()) {
|
|
30
45
|
if (!isRunning()) {
|
|
31
46
|
const start = spawnSync(containerEngine, ["start", containerName], {
|
|
@@ -4,11 +4,11 @@ terraform {
|
|
|
4
4
|
required_providers {
|
|
5
5
|
aws = {
|
|
6
6
|
source = "hashicorp/aws"
|
|
7
|
-
version = "
|
|
7
|
+
version = "<%- awsProviderVersion %>"
|
|
8
8
|
}
|
|
9
9
|
random = {
|
|
10
10
|
source = "hashicorp/random"
|
|
11
|
-
version = "
|
|
11
|
+
version = "<%- randomProviderVersion %>"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -4,15 +4,15 @@ terraform {
|
|
|
4
4
|
required_providers {
|
|
5
5
|
aws = {
|
|
6
6
|
source = "hashicorp/aws"
|
|
7
|
-
version = "
|
|
7
|
+
version = "<%- awsProviderVersion %>"
|
|
8
8
|
}
|
|
9
9
|
local = {
|
|
10
10
|
source = "hashicorp/local"
|
|
11
|
-
version = "
|
|
11
|
+
version = "<%- localProviderVersion %>"
|
|
12
12
|
}
|
|
13
13
|
null = {
|
|
14
14
|
source = "hashicorp/null"
|
|
15
|
-
version = "
|
|
15
|
+
version = "<%- nullProviderVersion %>"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -2,11 +2,11 @@ terraform {
|
|
|
2
2
|
required_providers {
|
|
3
3
|
local = {
|
|
4
4
|
source = "hashicorp/local"
|
|
5
|
-
version = "
|
|
5
|
+
version = "<%- localProviderVersion %>"
|
|
6
6
|
}
|
|
7
7
|
null = {
|
|
8
8
|
source = "hashicorp/null"
|
|
9
|
-
version = "
|
|
9
|
+
version = "<%- nullProviderVersion %>"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -33,7 +33,7 @@ export const useSigV4 = (): SigV4Client => {
|
|
|
33
33
|
{},
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
-
const skipSigning = !cognitoProps && import.meta.env.MODE === '
|
|
36
|
+
const skipSigning = !cognitoProps && import.meta.env.MODE === 'local-dev';
|
|
37
37
|
|
|
38
38
|
const withCachedCredentials = useCallback(
|
|
39
39
|
async (
|
package/src/utils/format.js
CHANGED
|
@@ -1,54 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const fs_1 = require("fs");
|
|
13
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
14
|
-
exports.DEFAULT_BIOME_CONFIG = {
|
|
4
|
+
*/ import { Biome } from "@biomejs/js-api/nodejs";
|
|
5
|
+
import { execFileSync, execSync } from "child_process";
|
|
6
|
+
import { existsSync, readFileSync } from "fs";
|
|
7
|
+
import { createRequire } from "module";
|
|
8
|
+
import path from "path";
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
export const DEFAULT_BIOME_CONFIG = {
|
|
15
11
|
$schema: 'https://biomejs.dev/schemas/2.4.16/schema.json',
|
|
16
12
|
root: true,
|
|
17
13
|
formatter: {
|
|
18
14
|
enabled: true,
|
|
19
15
|
indentStyle: 'space',
|
|
20
16
|
indentWidth: 2,
|
|
21
|
-
lineWidth: 80
|
|
17
|
+
lineWidth: 80
|
|
22
18
|
},
|
|
23
19
|
javascript: {
|
|
24
20
|
formatter: {
|
|
25
21
|
quoteStyle: 'single',
|
|
26
|
-
trailingCommas: 'all'
|
|
27
|
-
}
|
|
22
|
+
trailingCommas: 'all'
|
|
23
|
+
}
|
|
28
24
|
},
|
|
29
25
|
css: {
|
|
30
26
|
formatter: {
|
|
31
|
-
quoteStyle: 'single'
|
|
27
|
+
quoteStyle: 'single'
|
|
32
28
|
},
|
|
33
29
|
linter: {
|
|
34
|
-
enabled: false
|
|
35
|
-
}
|
|
30
|
+
enabled: false
|
|
31
|
+
}
|
|
36
32
|
},
|
|
37
33
|
linter: {
|
|
38
34
|
enabled: true,
|
|
39
35
|
rules: {
|
|
40
36
|
recommended: false,
|
|
41
37
|
correctness: {
|
|
42
|
-
noUndeclaredDependencies: 'warn'
|
|
43
|
-
}
|
|
44
|
-
}
|
|
38
|
+
noUndeclaredDependencies: 'warn'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
45
41
|
},
|
|
46
42
|
assist: {
|
|
47
43
|
actions: {
|
|
48
44
|
source: {
|
|
49
|
-
organizeImports: 'on'
|
|
50
|
-
}
|
|
51
|
-
}
|
|
45
|
+
organizeImports: 'on'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
52
48
|
},
|
|
53
49
|
files: {
|
|
54
50
|
includes: [
|
|
@@ -58,9 +54,9 @@ exports.DEFAULT_BIOME_CONFIG = {
|
|
|
58
54
|
'!**/node_modules',
|
|
59
55
|
'!**/.nx',
|
|
60
56
|
'!**/.venv',
|
|
61
|
-
'!**/*.css'
|
|
62
|
-
]
|
|
63
|
-
}
|
|
57
|
+
'!**/*.css'
|
|
58
|
+
]
|
|
59
|
+
}
|
|
64
60
|
};
|
|
65
61
|
const BIOME_FORMATTABLE_EXTENSIONS = new Set([
|
|
66
62
|
'.ts',
|
|
@@ -73,98 +69,95 @@ const BIOME_FORMATTABLE_EXTENSIONS = new Set([
|
|
|
73
69
|
'.cts',
|
|
74
70
|
'.json',
|
|
75
71
|
'.jsonc',
|
|
76
|
-
'.css'
|
|
72
|
+
'.css'
|
|
77
73
|
]);
|
|
78
74
|
/**
|
|
79
75
|
* Format files in the given directory within the tree.
|
|
80
76
|
* Handles both TypeScript/JavaScript/JSON (via biome) and Python (via ruff) files.
|
|
81
77
|
* See https://github.com/nrwl/nx/blob/4cd640a9187954505d12de5b6d76a90d8ce4c2eb/packages/devkit/src/generators/format-files.ts#L11
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
.filter((file) => file.type !== 'DELETE')
|
|
87
|
-
.filter((file) => (dir ? file.path.startsWith(dir) : true));
|
|
88
|
-
const pyFiles = changedFiles.filter((file) => file.path.endsWith('.py'));
|
|
89
|
-
const otherFiles = changedFiles.filter((file) => BIOME_FORMATTABLE_EXTENSIONS.has(path_1.default.extname(file.path)));
|
|
78
|
+
*/ export async function formatFilesInSubtree(tree, dir) {
|
|
79
|
+
const changedFiles = tree.listChanges().filter((file)=>file.type !== 'DELETE').filter((file)=>dir ? file.path.startsWith(dir) : true);
|
|
80
|
+
const pyFiles = changedFiles.filter((file)=>file.path.endsWith('.py'));
|
|
81
|
+
const otherFiles = changedFiles.filter((file)=>BIOME_FORMATTABLE_EXTENSIONS.has(path.extname(file.path)));
|
|
90
82
|
// Format Python files with ruff (lint fixes + formatting)
|
|
91
|
-
for (const file of pyFiles)
|
|
83
|
+
for (const file of pyFiles){
|
|
92
84
|
try {
|
|
93
|
-
const content = ruffFixAndFormat(file.content.toString('utf-8'), file.path);
|
|
85
|
+
const content = ruffFixAndFormat(file.content.toString('utf-8'), file.path, hasRuffConfigOnDisk(tree, file.path));
|
|
94
86
|
tree.write(file.path, content);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Silently skip ruff formatting failures
|
|
87
|
+
} catch {
|
|
88
|
+
// Silently skip ruff formatting failures
|
|
98
89
|
}
|
|
99
90
|
}
|
|
100
|
-
if (otherFiles.length === 0)
|
|
101
|
-
return;
|
|
91
|
+
if (otherFiles.length === 0) return;
|
|
102
92
|
// Use the workspace's own Biome CLI (its version and config) when biome.json
|
|
103
93
|
// exists on disk; otherwise format via the bundled library API with the
|
|
104
94
|
// in-memory tree config. The CLI path does not see in-tree config changes.
|
|
105
|
-
if (
|
|
95
|
+
if (existsSync(path.join(tree.root, 'biome.json'))) {
|
|
106
96
|
formatWithBiomeCli(tree, otherFiles);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
97
|
+
} else {
|
|
109
98
|
formatWithBiomeApi(tree, otherFiles);
|
|
110
99
|
}
|
|
111
100
|
}
|
|
112
101
|
/**
|
|
113
102
|
* Format files via the workspace's Biome CLI, run from the workspace root so it
|
|
114
103
|
* discovers the on-disk biome.json.
|
|
115
|
-
*/
|
|
116
|
-
function formatWithBiomeCli(tree, files) {
|
|
104
|
+
*/ function formatWithBiomeCli(tree, files) {
|
|
117
105
|
const biome = getBiomeCommand(tree.root);
|
|
118
106
|
if (!biome) {
|
|
119
107
|
// Fall back to the library API if the CLI cannot be resolved
|
|
120
108
|
formatWithBiomeApi(tree, files);
|
|
121
109
|
return;
|
|
122
110
|
}
|
|
123
|
-
for (const file of files)
|
|
111
|
+
for (const file of files){
|
|
124
112
|
try {
|
|
125
|
-
const content =
|
|
113
|
+
const content = execFileSync(biome.command, [
|
|
114
|
+
...biome.args,
|
|
115
|
+
'format',
|
|
116
|
+
`--stdin-file-path=${file.path}`
|
|
117
|
+
], {
|
|
126
118
|
input: file.content?.toString('utf-8') ?? '',
|
|
127
119
|
encoding: 'utf-8',
|
|
128
120
|
cwd: tree.root,
|
|
129
|
-
stdio: [
|
|
121
|
+
stdio: [
|
|
122
|
+
'pipe',
|
|
123
|
+
'pipe',
|
|
124
|
+
'pipe'
|
|
125
|
+
]
|
|
130
126
|
});
|
|
131
127
|
tree.write(file.path, content);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Leave individual files that fail to format untouched
|
|
128
|
+
} catch {
|
|
129
|
+
// Leave individual files that fail to format untouched
|
|
135
130
|
}
|
|
136
131
|
}
|
|
137
132
|
}
|
|
138
133
|
/**
|
|
139
134
|
* Format files via the bundled Biome library API, applying the in-memory tree
|
|
140
135
|
* config.
|
|
141
|
-
*/
|
|
142
|
-
function formatWithBiomeApi(tree, files) {
|
|
136
|
+
*/ function formatWithBiomeApi(tree, files) {
|
|
143
137
|
try {
|
|
144
|
-
const biome = new
|
|
138
|
+
const biome = new Biome();
|
|
145
139
|
const { projectKey } = biome.openProject();
|
|
146
140
|
// Apply the workspace biome.json if it exists in the tree, otherwise the defaults.
|
|
147
141
|
const treeConfig = tree.read('biome.json', 'utf-8');
|
|
148
|
-
biome.applyConfiguration(projectKey, treeConfig ? JSON.parse(treeConfig) :
|
|
149
|
-
for (const file of files)
|
|
142
|
+
biome.applyConfiguration(projectKey, treeConfig ? JSON.parse(treeConfig) : DEFAULT_BIOME_CONFIG);
|
|
143
|
+
for (const file of files){
|
|
150
144
|
try {
|
|
151
|
-
const { content } = biome.formatContent(projectKey, file.content?.toString('utf-8') ?? '', {
|
|
145
|
+
const { content } = biome.formatContent(projectKey, file.content?.toString('utf-8') ?? '', {
|
|
146
|
+
filePath: file.path
|
|
147
|
+
});
|
|
152
148
|
tree.write(file.path, content);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// Leave individual files that fail to format untouched
|
|
149
|
+
} catch {
|
|
150
|
+
// Leave individual files that fail to format untouched
|
|
156
151
|
}
|
|
157
152
|
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Silently skip formatting failures
|
|
153
|
+
} catch {
|
|
154
|
+
// Silently skip formatting failures
|
|
161
155
|
}
|
|
162
156
|
}
|
|
163
157
|
/**
|
|
164
158
|
* Resolve the `@biomejs/biome` CLI from the user's workspace, falling back to a
|
|
165
159
|
* `biome` binary on the PATH.
|
|
166
|
-
*/
|
|
167
|
-
const _biomeCommands = new Map();
|
|
160
|
+
*/ const _biomeCommands = new Map();
|
|
168
161
|
function getBiomeCommand(root) {
|
|
169
162
|
if (_biomeCommands.has(root)) {
|
|
170
163
|
return _biomeCommands.get(root) ?? undefined;
|
|
@@ -172,30 +165,43 @@ function getBiomeCommand(root) {
|
|
|
172
165
|
// Run via node for cross-platform execution of the bin shim.
|
|
173
166
|
try {
|
|
174
167
|
const pkgJsonPath = require.resolve('@biomejs/biome/package.json', {
|
|
175
|
-
paths: [
|
|
168
|
+
paths: [
|
|
169
|
+
root,
|
|
170
|
+
import.meta.dirname
|
|
171
|
+
]
|
|
176
172
|
});
|
|
177
|
-
const pkgJson =
|
|
173
|
+
const pkgJson = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'));
|
|
178
174
|
const binRelative = typeof pkgJson.bin === 'string' ? pkgJson.bin : pkgJson.bin?.biome;
|
|
179
175
|
if (binRelative) {
|
|
180
|
-
const binPath =
|
|
181
|
-
const command = {
|
|
176
|
+
const binPath = path.join(path.dirname(pkgJsonPath), binRelative);
|
|
177
|
+
const command = {
|
|
178
|
+
command: process.execPath,
|
|
179
|
+
args: [
|
|
180
|
+
binPath
|
|
181
|
+
]
|
|
182
|
+
};
|
|
182
183
|
_biomeCommands.set(root, command);
|
|
183
184
|
return command;
|
|
184
185
|
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Fall back to a biome binary on the PATH
|
|
186
|
+
} catch {
|
|
187
|
+
// Fall back to a biome binary on the PATH
|
|
188
188
|
}
|
|
189
189
|
try {
|
|
190
|
-
|
|
190
|
+
execSync('biome --version', {
|
|
191
191
|
encoding: 'utf-8',
|
|
192
|
-
stdio: [
|
|
192
|
+
stdio: [
|
|
193
|
+
'pipe',
|
|
194
|
+
'pipe',
|
|
195
|
+
'pipe'
|
|
196
|
+
]
|
|
193
197
|
});
|
|
194
|
-
const command = {
|
|
198
|
+
const command = {
|
|
199
|
+
command: 'biome',
|
|
200
|
+
args: []
|
|
201
|
+
};
|
|
195
202
|
_biomeCommands.set(root, command);
|
|
196
203
|
return command;
|
|
197
|
-
}
|
|
198
|
-
catch {
|
|
204
|
+
} catch {
|
|
199
205
|
_biomeCommands.set(root, null);
|
|
200
206
|
return undefined;
|
|
201
207
|
}
|
|
@@ -203,42 +209,86 @@ function getBiomeCommand(root) {
|
|
|
203
209
|
/**
|
|
204
210
|
* Find the ruff command. Tries 'uv run ruff', then 'uvx ruff'.
|
|
205
211
|
* Matches how @nxlv/python runs ruff via the UV provider.
|
|
206
|
-
*/
|
|
207
|
-
let _ruffCommand;
|
|
212
|
+
*/ let _ruffCommand;
|
|
208
213
|
function getRuffCommand() {
|
|
209
214
|
if (_ruffCommand !== undefined) {
|
|
210
215
|
return _ruffCommand || undefined;
|
|
211
216
|
}
|
|
212
|
-
for (const cmd of [
|
|
217
|
+
for (const cmd of [
|
|
218
|
+
'uv run ruff',
|
|
219
|
+
'uvx ruff'
|
|
220
|
+
]){
|
|
213
221
|
try {
|
|
214
|
-
|
|
222
|
+
execSync(`${cmd} --version`, {
|
|
215
223
|
encoding: 'utf-8',
|
|
216
|
-
stdio: [
|
|
224
|
+
stdio: [
|
|
225
|
+
'pipe',
|
|
226
|
+
'pipe',
|
|
227
|
+
'pipe'
|
|
228
|
+
]
|
|
217
229
|
});
|
|
218
230
|
_ruffCommand = cmd;
|
|
219
231
|
return cmd;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// Try next command
|
|
232
|
+
} catch {
|
|
233
|
+
// Try next command
|
|
223
234
|
}
|
|
224
235
|
}
|
|
225
236
|
_ruffCommand = '';
|
|
226
237
|
return undefined;
|
|
227
238
|
}
|
|
239
|
+
/**
|
|
240
|
+
* Whether ruff would discover a config on disk for a file, by walking from its
|
|
241
|
+
* directory up to the workspace root looking for `.ruff.toml`, `ruff.toml`, or a
|
|
242
|
+
* `pyproject.toml` with a `[tool.ruff]` section — the same files ruff itself
|
|
243
|
+
* resolves. The walk stops at `tree.root` so a stray config in a parent of the
|
|
244
|
+
* workspace (or the home directory) is never treated as the project's. Used to
|
|
245
|
+
* decide whether to nudge ruff towards import sorting (see
|
|
246
|
+
* {@link ruffFixAndFormat}).
|
|
247
|
+
*/ function hasRuffConfigOnDisk(tree, filePath) {
|
|
248
|
+
const root = path.resolve(tree.root);
|
|
249
|
+
let dir = path.resolve(root, path.dirname(filePath));
|
|
250
|
+
while(true){
|
|
251
|
+
if (existsSync(path.join(dir, '.ruff.toml')) || existsSync(path.join(dir, 'ruff.toml'))) {
|
|
252
|
+
return true;
|
|
253
|
+
}
|
|
254
|
+
const pyproject = path.join(dir, 'pyproject.toml');
|
|
255
|
+
if (existsSync(pyproject) && readFileSync(pyproject, 'utf-8').includes('[tool.ruff')) {
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
const parent = path.dirname(dir);
|
|
259
|
+
// Stop once the workspace root has been checked (or we hit the FS root).
|
|
260
|
+
if (dir === root || parent === dir) {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
dir = parent;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
228
266
|
/**
|
|
229
267
|
* Run ruff check --fix and ruff format on Python file content via stdin.
|
|
230
268
|
* Applies all configured lint fixes (including import sorting) and formatting.
|
|
231
|
-
|
|
232
|
-
|
|
269
|
+
*
|
|
270
|
+
* When no ruff config exists on disk (`hasConfig` false) ruff falls back to its
|
|
271
|
+
* defaults, which omit isort — but generated projects enable rule `I` and their
|
|
272
|
+
* build fails on unsorted imports (I001). In that case we add `--extend-select
|
|
273
|
+
* I` so import sorting matches what the build enforces. When a config does
|
|
274
|
+
* exist we defer to it entirely, honouring the user's rule selection.
|
|
275
|
+
*/ function ruffFixAndFormat(content, filePath, hasConfig) {
|
|
233
276
|
const ruff = getRuffCommand();
|
|
234
|
-
if (!ruff)
|
|
235
|
-
|
|
277
|
+
if (!ruff) return content;
|
|
278
|
+
const extendSelect = hasConfig ? '' : ' --extend-select I';
|
|
236
279
|
// First apply lint fixes (import sorting, unused imports, etc.)
|
|
237
280
|
try {
|
|
238
|
-
const result =
|
|
281
|
+
const result = execSync(`${ruff} check --fix${extendSelect} --stdin-filename ${filePath} -`, {
|
|
282
|
+
input: content,
|
|
283
|
+
encoding: 'utf-8',
|
|
284
|
+
stdio: [
|
|
285
|
+
'pipe',
|
|
286
|
+
'pipe',
|
|
287
|
+
'pipe'
|
|
288
|
+
]
|
|
289
|
+
});
|
|
239
290
|
content = result;
|
|
240
|
-
}
|
|
241
|
-
catch (e) {
|
|
291
|
+
} catch (e) {
|
|
242
292
|
// ruff check exits non-zero when it finds unfixable issues,
|
|
243
293
|
// but stdout still contains the fixed content
|
|
244
294
|
if (e.stdout) {
|
|
@@ -247,15 +297,19 @@ function ruffFixAndFormat(content, filePath) {
|
|
|
247
297
|
}
|
|
248
298
|
// Then apply formatting
|
|
249
299
|
try {
|
|
250
|
-
content =
|
|
300
|
+
content = execSync(`${ruff} format --stdin-filename ${filePath} -`, {
|
|
251
301
|
input: content,
|
|
252
302
|
encoding: 'utf-8',
|
|
253
|
-
stdio: [
|
|
303
|
+
stdio: [
|
|
304
|
+
'pipe',
|
|
305
|
+
'pipe',
|
|
306
|
+
'pipe'
|
|
307
|
+
]
|
|
254
308
|
});
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// Fall through with whatever content we have
|
|
309
|
+
} catch {
|
|
310
|
+
// Fall through with whatever content we have
|
|
258
311
|
}
|
|
259
312
|
return content;
|
|
260
313
|
}
|
|
314
|
+
|
|
261
315
|
//# sourceMappingURL=format.js.map
|
package/src/utils/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/format.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA+EH,oDAqCC;;AAlHD,mDAA+C;AAE/C,iDAAuD;AACvD,2BAAgC;AAChC,wDAAwB;AAEX,QAAA,oBAAoB,GAAG;IAClC,OAAO,EAAE,gDAAgD;IACzD,IAAI,EAAE,IAAI;IACV,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,CAAC;QACd,SAAS,EAAE,EAAE;KACd;IACD,UAAU,EAAE;QACV,SAAS,EAAE;YACT,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,KAAK;SACtB;KACF;IACD,GAAG,EAAE;QACH,SAAS,EAAE;YACT,UAAU,EAAE,QAAQ;SACrB;QACD,MAAM,EAAE;YACN,OAAO,EAAE,KAAK;SACf;KACF;IACD,MAAM,EAAE;QACN,OAAO,EAAE,IAAI;QACb,KAAK,EAAE;YACL,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE;gBACX,wBAAwB,EAAE,MAAM;aACjC;SACF;KACF;IACD,MAAM,EAAE;QACN,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,eAAe,EAAE,IAAI;aACtB;SACF;KACF;IACD,KAAK,EAAE;QACL,QAAQ,EAAE;YACR,IAAI;YACJ,UAAU;YACV,aAAa;YACb,kBAAkB;YAClB,SAAS;YACT,WAAW;YACX,WAAW;SACZ;KACF;CACF,CAAC;AAEF,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC;IAC3C,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;IACR,MAAM;CACP,CAAC,CAAC;AAEH;;;;GAIG;AACI,KAAK,UAAU,oBAAoB,CACxC,IAAU,EACV,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AAG,GAAG,CAAC;YACnB,OAAO,GAAG,CAAC;QACb,CAAC;QAAC,MAAM,CAAC;YACP,mBAAmB;QACrB,CAAC;IACH,CAAC;IACD,YAAY,GAAG,EAAE,CAAC;IAClB,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,SAAS,gBAAgB,CAAC,OAAe,EAAE,QAAgB;IACzD,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,IAAI,CAAC,IAAI;QAAE,OAAO,OAAO,CAAC;IAE1B,gEAAgE;IAChE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,wBAAQ,EACrB,GAAG,IAAI,iCAAiC,QAAQ,IAAI,EACpD,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CACvE,CAAC;QACF,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,4DAA4D;QAC5D,8CAA8C;QAC9C,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;YACb,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,CAAC;IACH,CAAC;IAED,wBAAwB;IACxB,IAAI,CAAC;QACH,OAAO,GAAG,IAAA,wBAAQ,EAAC,GAAG,IAAI,4BAA4B,QAAQ,IAAI,EAAE;YAClE,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;SAChC,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,6CAA6C;IAC/C,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/format.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Biome } from '@biomejs/js-api/nodejs';\nimport type { Tree } from '@nx/devkit';\nimport { execFileSync, execSync } from 'child_process';\nimport { existsSync, readFileSync } from 'fs';\nimport { createRequire } from 'module';\nimport path from 'path';\n\nconst require = createRequire(import.meta.url);\n\nexport const DEFAULT_BIOME_CONFIG = {\n $schema: 'https://biomejs.dev/schemas/2.4.16/schema.json',\n root: true,\n formatter: {\n enabled: true,\n indentStyle: 'space',\n indentWidth: 2,\n lineWidth: 80,\n },\n javascript: {\n formatter: {\n quoteStyle: 'single',\n trailingCommas: 'all',\n },\n },\n css: {\n formatter: {\n quoteStyle: 'single',\n },\n linter: {\n enabled: false,\n },\n },\n linter: {\n enabled: true,\n rules: {\n recommended: false,\n correctness: {\n noUndeclaredDependencies: 'warn',\n },\n },\n },\n assist: {\n actions: {\n source: {\n organizeImports: 'on',\n },\n },\n },\n files: {\n includes: [\n '**',\n '!**/dist',\n '!**/out-tsc',\n '!**/node_modules',\n '!**/.nx',\n '!**/.venv',\n '!**/*.css',\n ],\n },\n};\n\nconst BIOME_FORMATTABLE_EXTENSIONS = new Set([\n '.ts',\n '.tsx',\n '.js',\n '.jsx',\n '.mjs',\n '.cjs',\n '.mts',\n '.cts',\n '.json',\n '.jsonc',\n '.css',\n]);\n\n/**\n * Format files in the given directory within the tree.\n * Handles both TypeScript/JavaScript/JSON (via biome) and Python (via ruff) files.\n * See https://github.com/nrwl/nx/blob/4cd640a9187954505d12de5b6d76a90d8ce4c2eb/packages/devkit/src/generators/format-files.ts#L11\n */\nexport async function formatFilesInSubtree(\n tree: Tree,\n dir?: string,\n): Promise<void> {\n const changedFiles = tree\n .listChanges()\n .filter((file) => file.type !== 'DELETE')\n .filter((file) => (dir ? file.path.startsWith(dir) : true));\n\n const pyFiles = changedFiles.filter((file) => file.path.endsWith('.py'));\n const otherFiles = changedFiles.filter((file) =>\n BIOME_FORMATTABLE_EXTENSIONS.has(path.extname(file.path)),\n );\n\n // Format Python files with ruff (lint fixes + formatting)\n for (const file of pyFiles) {\n try {\n const content = ruffFixAndFormat(\n file.content.toString('utf-8'),\n file.path,\n hasRuffConfigOnDisk(tree, file.path),\n );\n tree.write(file.path, content);\n } catch {\n // Silently skip ruff formatting failures\n }\n }\n\n if (otherFiles.length === 0) return;\n\n // Use the workspace's own Biome CLI (its version and config) when biome.json\n // exists on disk; otherwise format via the bundled library API with the\n // in-memory tree config. The CLI path does not see in-tree config changes.\n if (existsSync(path.join(tree.root, 'biome.json'))) {\n formatWithBiomeCli(tree, otherFiles);\n } else {\n formatWithBiomeApi(tree, otherFiles);\n }\n}\n\n/**\n * Format files via the workspace's Biome CLI, run from the workspace root so it\n * discovers the on-disk biome.json.\n */\nfunction formatWithBiomeCli(\n tree: Tree,\n files: { path: string; content: Buffer | null }[],\n): void {\n const biome = getBiomeCommand(tree.root);\n if (!biome) {\n // Fall back to the library API if the CLI cannot be resolved\n formatWithBiomeApi(tree, files);\n return;\n }\n\n for (const file of files) {\n try {\n const content = execFileSync(\n biome.command,\n [...biome.args, 'format', `--stdin-file-path=${file.path}`],\n {\n input: file.content?.toString('utf-8') ?? '',\n encoding: 'utf-8',\n cwd: tree.root,\n stdio: ['pipe', 'pipe', 'pipe'],\n },\n );\n tree.write(file.path, content);\n } catch {\n // Leave individual files that fail to format untouched\n }\n }\n}\n\n/**\n * Format files via the bundled Biome library API, applying the in-memory tree\n * config.\n */\nfunction formatWithBiomeApi(\n tree: Tree,\n files: { path: string; content: Buffer | null }[],\n): void {\n try {\n const biome = new Biome();\n const { projectKey } = biome.openProject();\n // Apply the workspace biome.json if it exists in the tree, otherwise the defaults.\n const treeConfig = tree.read('biome.json', 'utf-8');\n biome.applyConfiguration(\n projectKey,\n treeConfig ? JSON.parse(treeConfig) : DEFAULT_BIOME_CONFIG,\n );\n\n for (const file of files) {\n try {\n const { content } = biome.formatContent(\n projectKey,\n file.content?.toString('utf-8') ?? '',\n { filePath: file.path },\n );\n tree.write(file.path, content);\n } catch {\n // Leave individual files that fail to format untouched\n }\n }\n } catch {\n // Silently skip formatting failures\n }\n}\n\ninterface BiomeCommand {\n command: string;\n args: string[];\n}\n\n/**\n * Resolve the `@biomejs/biome` CLI from the user's workspace, falling back to a\n * `biome` binary on the PATH.\n */\nconst _biomeCommands = new Map<string, BiomeCommand | null>();\nfunction getBiomeCommand(root: string): BiomeCommand | undefined {\n if (_biomeCommands.has(root)) {\n return _biomeCommands.get(root) ?? undefined;\n }\n\n // Run via node for cross-platform execution of the bin shim.\n try {\n const pkgJsonPath = require.resolve('@biomejs/biome/package.json', {\n paths: [root, import.meta.dirname],\n });\n const pkgJson = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'));\n const binRelative =\n typeof pkgJson.bin === 'string' ? pkgJson.bin : pkgJson.bin?.biome;\n if (binRelative) {\n const binPath = path.join(path.dirname(pkgJsonPath), binRelative);\n const command = { command: process.execPath, args: [binPath] };\n _biomeCommands.set(root, command);\n return command;\n }\n } catch {\n // Fall back to a biome binary on the PATH\n }\n\n try {\n execSync('biome --version', {\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n });\n const command = { command: 'biome', args: [] };\n _biomeCommands.set(root, command);\n return command;\n } catch {\n _biomeCommands.set(root, null);\n return undefined;\n }\n}\n\n/**\n * Find the ruff command. Tries 'uv run ruff', then 'uvx ruff'.\n * Matches how @nxlv/python runs ruff via the UV provider.\n */\nlet _ruffCommand: string | undefined;\nfunction getRuffCommand(): string | undefined {\n if (_ruffCommand !== undefined) {\n return _ruffCommand || undefined;\n }\n for (const cmd of ['uv run ruff', 'uvx ruff']) {\n try {\n execSync(`${cmd} --version`, {\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n });\n _ruffCommand = cmd;\n return cmd;\n } catch {\n // Try next command\n }\n }\n _ruffCommand = '';\n return undefined;\n}\n\n/**\n * Whether ruff would discover a config on disk for a file, by walking from its\n * directory up to the workspace root looking for `.ruff.toml`, `ruff.toml`, or a\n * `pyproject.toml` with a `[tool.ruff]` section — the same files ruff itself\n * resolves. The walk stops at `tree.root` so a stray config in a parent of the\n * workspace (or the home directory) is never treated as the project's. Used to\n * decide whether to nudge ruff towards import sorting (see\n * {@link ruffFixAndFormat}).\n */\nfunction hasRuffConfigOnDisk(tree: Tree, filePath: string): boolean {\n const root = path.resolve(tree.root);\n let dir = path.resolve(root, path.dirname(filePath));\n while (true) {\n if (\n existsSync(path.join(dir, '.ruff.toml')) ||\n existsSync(path.join(dir, 'ruff.toml'))\n ) {\n return true;\n }\n const pyproject = path.join(dir, 'pyproject.toml');\n if (\n existsSync(pyproject) &&\n readFileSync(pyproject, 'utf-8').includes('[tool.ruff')\n ) {\n return true;\n }\n const parent = path.dirname(dir);\n // Stop once the workspace root has been checked (or we hit the FS root).\n if (dir === root || parent === dir) {\n return false;\n }\n dir = parent;\n }\n}\n\n/**\n * Run ruff check --fix and ruff format on Python file content via stdin.\n * Applies all configured lint fixes (including import sorting) and formatting.\n *\n * When no ruff config exists on disk (`hasConfig` false) ruff falls back to its\n * defaults, which omit isort — but generated projects enable rule `I` and their\n * build fails on unsorted imports (I001). In that case we add `--extend-select\n * I` so import sorting matches what the build enforces. When a config does\n * exist we defer to it entirely, honouring the user's rule selection.\n */\nfunction ruffFixAndFormat(\n content: string,\n filePath: string,\n hasConfig: boolean,\n): string {\n const ruff = getRuffCommand();\n if (!ruff) return content;\n\n const extendSelect = hasConfig ? '' : ' --extend-select I';\n\n // First apply lint fixes (import sorting, unused imports, etc.)\n try {\n const result = execSync(\n `${ruff} check --fix${extendSelect} --stdin-filename ${filePath} -`,\n { input: content, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] },\n );\n content = result;\n } catch (e: any) {\n // ruff check exits non-zero when it finds unfixable issues,\n // but stdout still contains the fixed content\n if (e.stdout) {\n content = e.stdout;\n }\n }\n\n // Then apply formatting\n try {\n content = execSync(`${ruff} format --stdin-filename ${filePath} -`, {\n input: content,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n });\n } catch {\n // Fall through with whatever content we have\n }\n\n return content;\n}\n"],"names":["Biome","execFileSync","execSync","existsSync","readFileSync","createRequire","path","require","url","DEFAULT_BIOME_CONFIG","$schema","root","formatter","enabled","indentStyle","indentWidth","lineWidth","javascript","quoteStyle","trailingCommas","css","linter","rules","recommended","correctness","noUndeclaredDependencies","assist","actions","source","organizeImports","files","includes","BIOME_FORMATTABLE_EXTENSIONS","Set","formatFilesInSubtree","tree","dir","changedFiles","listChanges","filter","file","type","startsWith","pyFiles","endsWith","otherFiles","has","extname","content","ruffFixAndFormat","toString","hasRuffConfigOnDisk","write","length","join","formatWithBiomeCli","formatWithBiomeApi","biome","getBiomeCommand","command","args","input","encoding","cwd","stdio","projectKey","openProject","treeConfig","read","applyConfiguration","JSON","parse","formatContent","filePath","_biomeCommands","Map","get","undefined","pkgJsonPath","resolve","paths","dirname","pkgJson","binRelative","bin","binPath","process","execPath","set","_ruffCommand","getRuffCommand","cmd","pyproject","parent","hasConfig","ruff","extendSelect","result","e","stdout"],"mappings":"AAAA;;;CAGC,GAED,SAASA,KAAK,QAAQ,yBAAyB;AAE/C,SAASC,YAAY,EAAEC,QAAQ,QAAQ,gBAAgB;AACvD,SAASC,UAAU,EAAEC,YAAY,QAAQ,KAAK;AAC9C,SAASC,aAAa,QAAQ,SAAS;AACvC,OAAOC,UAAU,OAAO;AAExB,MAAMC,UAAUF,cAAc,YAAYG,GAAG;AAE7C,OAAO,MAAMC,uBAAuB;IAClCC,SAAS;IACTC,MAAM;IACNC,WAAW;QACTC,SAAS;QACTC,aAAa;QACbC,aAAa;QACbC,WAAW;IACb;IACAC,YAAY;QACVL,WAAW;YACTM,YAAY;YACZC,gBAAgB;QAClB;IACF;IACAC,KAAK;QACHR,WAAW;YACTM,YAAY;QACd;QACAG,QAAQ;YACNR,SAAS;QACX;IACF;IACAQ,QAAQ;QACNR,SAAS;QACTS,OAAO;YACLC,aAAa;YACbC,aAAa;gBACXC,0BAA0B;YAC5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