@aws/nx-plugin 1.0.0-rc.3 → 1.0.0-rc.31
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 +6746 -6133
- package/README.md +7 -7
- package/executors.json +9 -0
- package/generators.json +100 -1
- package/package.json +35 -17
- package/src/agentcore-gateway/attach-upstream.d.ts +33 -0
- package/src/agentcore-gateway/attach-upstream.js +38 -0
- package/src/agentcore-gateway/attach-upstream.js.map +1 -0
- package/src/agentcore-gateway/files/cedar/policies/README.md +52 -0
- package/src/agentcore-gateway/files/cedar/policies/permit-all.cedar +11 -0
- package/src/agentcore-gateway/files/project/local-dev.ts.template +134 -0
- package/src/agentcore-gateway/gateway-connection/generator.d.ts +21 -0
- package/src/agentcore-gateway/gateway-connection/generator.js +101 -0
- package/src/agentcore-gateway/gateway-connection/generator.js.map +1 -0
- 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/gateway-connection/schema.d.ts +13 -0
- package/src/agentcore-gateway/gateway-connection/schema.json +31 -0
- package/src/agentcore-gateway/generator.d.ts +25 -0
- package/src/agentcore-gateway/generator.js +149 -0
- package/src/agentcore-gateway/generator.js.map +1 -0
- package/src/agentcore-gateway/mcp-connection/generator.d.ts +19 -0
- package/src/agentcore-gateway/mcp-connection/generator.js +59 -0
- package/src/agentcore-gateway/mcp-connection/generator.js.map +1 -0
- 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/mcp-connection/schema.d.ts +13 -0
- package/src/agentcore-gateway/mcp-connection/schema.json +31 -0
- package/src/agentcore-gateway/schema.d.js +6 -0
- package/src/agentcore-gateway/schema.d.js.map +1 -0
- package/src/agentcore-gateway/schema.d.ts +17 -0
- package/src/agentcore-gateway/schema.json +70 -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} +7 -7
- 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.d.ts +1 -1
- package/src/connection/agent-runtime-config.js +9 -14
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/generator.d.ts +7 -14
- package/src/connection/generator.js +158 -177
- package/src/connection/generator.js.map +1 -1
- package/src/connection/local-dev.d.ts +15 -0
- 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/connection/schema.d.ts +1 -0
- package/src/connection/schema.json +5 -0
- package/src/connection/supported-connections.d.ts +98 -0
- package/src/connection/supported-connections.js +138 -0
- package/src/connection/supported-connections.js.map +1 -0
- package/src/index.js +2 -5
- package/src/index.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +51 -81
- package/src/infra/app/generator.d.ts +3 -3
- package/src/infra/app/generator.js +141 -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/infra/app/schema.d.ts +1 -1
- package/src/infra/app/schema.json +5 -0
- package/src/license/__snapshots__/config.spec.ts.snap +23 -0
- package/src/license/config-types.d.ts +18 -1
- package/src/license/config-types.js +8 -2
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +65 -7
- package/src/license/config.js +442 -109
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/check.d.ts +16 -0
- package/src/license/dependency-check/check.js +116 -0
- package/src/license/dependency-check/check.js.map +1 -0
- package/src/license/dependency-check/collectors/collector.d.ts +21 -0
- package/src/license/dependency-check/collectors/collector.js +46 -0
- package/src/license/dependency-check/collectors/collector.js.map +1 -0
- package/src/license/dependency-check/collectors/npm-collector.d.ts +10 -0
- package/src/license/dependency-check/collectors/npm-collector.js +68 -0
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -0
- package/src/license/dependency-check/collectors/python-collector.d.ts +23 -0
- package/src/license/dependency-check/collectors/python-collector.js +114 -0
- package/src/license/dependency-check/collectors/python-collector.js.map +1 -0
- package/src/license/dependency-check/evaluator.d.ts +9 -0
- package/src/license/dependency-check/evaluator.js +94 -0
- package/src/license/dependency-check/evaluator.js.map +1 -0
- package/src/license/dependency-check/executor-schema.json +6 -0
- package/src/license/dependency-check/executor.d.ts +9 -0
- package/src/license/dependency-check/executor.js +51 -0
- package/src/license/dependency-check/executor.js.map +1 -0
- package/src/license/dependency-check/pre-approved.d.ts +6 -0
- package/src/license/dependency-check/pre-approved.js +1893 -0
- package/src/license/dependency-check/pre-approved.js.map +1 -0
- package/src/license/dependency-check/types.d.ts +45 -0
- package/src/license/dependency-check/types.js +6 -0
- package/src/license/dependency-check/types.js.map +1 -0
- package/src/license/generator.d.ts +3 -3
- package/src/license/generator.js +127 -30
- package/src/license/generator.js.map +1 -1
- package/src/license/index.d.ts +8 -0
- package/src/license/index.js +7 -0
- package/src/license/index.js.map +1 -0
- package/src/license/known-exceptions.d.ts +7 -0
- package/src/license/known-exceptions.js +39 -0
- package/src/license/known-exceptions.js.map +1 -0
- package/src/license/schema.d.js +6 -0
- package/src/license/schema.d.js.map +1 -0
- package/src/license/schema.d.ts +7 -0
- package/src/license/schema.json +11 -0
- package/src/license/sync/generator.d.ts +2 -2
- package/src/license/sync/generator.js +100 -125
- package/src/license/sync/generator.js.map +1 -1
- package/src/license/sync/project-file-sync.d.ts +3 -3
- package/src/license/sync/project-file-sync.js +28 -35
- package/src/license/sync/project-file-sync.js.map +1 -1
- package/src/mcp-server/generator-info.d.ts +5 -1
- package/src/mcp-server/generator-info.js +130 -160
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/guide-pipeline.d.ts +1 -1
- package/src/mcp-server/guide-pipeline.js +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 +42 -56
- 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.d.ts +9 -3
- package/src/mcp-server/schema-registry.js +41 -38
- 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.d.ts +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.d.ts +2 -2
- package/src/mcp-server/tools/general-guidance.js +46 -25
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.d.ts +2 -2
- package/src/mcp-server/tools/generator-guide.js +29 -37
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/mcp-server/tools/list-generators.d.ts +2 -2
- package/src/mcp-server/tools/list-generators.js +19 -25
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/open-api/ts-client/__snapshots__/generator.additional-properties.spec.ts.snap +147 -33
- package/src/open-api/ts-client/__snapshots__/generator.arrays.spec.ts.snap +308 -75
- package/src/open-api/ts-client/__snapshots__/generator.complex-types.spec.ts.snap +286 -62
- package/src/open-api/ts-client/__snapshots__/generator.composite-types.spec.ts.snap +674 -93
- package/src/open-api/ts-client/__snapshots__/generator.content-type.spec.ts.snap +147 -33
- package/src/open-api/ts-client/__snapshots__/generator.duplicate-types.spec.ts.snap +196 -44
- package/src/open-api/ts-client/__snapshots__/generator.edge-cases.spec.ts.snap +5507 -0
- package/src/open-api/ts-client/__snapshots__/generator.fast-api.spec.ts.snap +219 -60
- package/src/open-api/ts-client/__snapshots__/generator.primitive-types.spec.ts.snap +351 -80
- package/src/open-api/ts-client/__snapshots__/generator.request.spec.ts.snap +170 -49
- package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +99 -23
- package/src/open-api/ts-client/__snapshots__/generator.response.spec.ts.snap +147 -33
- package/src/open-api/ts-client/__snapshots__/generator.streaming.spec.ts.snap +392 -88
- package/src/open-api/ts-client/__snapshots__/generator.tags.spec.ts.snap +196 -44
- package/src/open-api/ts-client/files/client.gen.ts.template +130 -18
- package/src/open-api/ts-client/files/types.gen.ts.template +4 -4
- package/src/open-api/ts-client/generator.d.ts +3 -3
- 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/files/options-proxy.gen.ts.template +5 -0
- package/src/open-api/ts-hooks/generator.d.ts +3 -3
- 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/generator.spec.tsx +84 -14
- 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.d.ts +3 -3
- 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.d.ts +3 -5
- package/src/open-api/utils/codegen-data/languages.js +53 -66
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data/types.d.ts +240 -10
- package/src/open-api/utils/codegen-data/types.js +54 -30
- package/src/open-api/utils/codegen-data/types.js.map +1 -1
- package/src/open-api/utils/codegen-data.d.ts +8 -4
- package/src/open-api/utils/codegen-data.js +398 -674
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.d.ts +5 -1
- package/src/open-api/utils/normalise.js +386 -247
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parse.d.ts +2 -2
- package/src/open-api/utils/parse.js +11 -13
- package/src/open-api/utils/parse.js.map +1 -1
- package/src/open-api/utils/parser.d.ts +55 -0
- package/src/open-api/utils/parser.js +743 -0
- package/src/open-api/utils/parser.js.map +1 -0
- package/src/open-api/utils/refs.d.ts +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.d.ts +15 -0
- 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 +160 -17
- package/src/preset/generator.d.ts +4 -4
- package/src/preset/generator.js +140 -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 +4 -2
- package/src/preset/schema.json +10 -5
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +304 -0
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +734 -0
- package/src/py/agent/__snapshots__/{generator.spec.ts.snap → generator.protocols.spec.ts.snap} +80 -314
- package/src/py/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +189 -0
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client_strands.py.template +30 -0
- package/src/py/agent/a2a-connection/files/langchain/agent-connection/app/__targetAgentSnakeCase___client_langchain.py.template +28 -0
- package/src/py/agent/a2a-connection/generator.d.ts +3 -3
- package/src/py/agent/a2a-connection/generator.js +113 -85
- 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/a2a-connection/schema.d.ts +1 -0
- package/src/py/agent/a2a-connection/schema.json +5 -0
- package/src/py/agent/files/a2a-langchain/main.py.template +89 -0
- package/src/py/agent/files/ag-ui-langchain/main.py.template +83 -0
- package/src/py/agent/files/common/agent.py.template +2 -0
- package/src/py/agent/files/common-langchain/agent.py.template +30 -0
- package/src/py/agent/files/http/init.py.template +7 -25
- package/src/py/agent/files/http/main.py.template +2 -3
- package/src/py/agent/files/http-langchain/main.py.template +84 -0
- package/src/py/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +184 -0
- package/src/py/agent/gateway-connection/files/agent-connection/app/__gatewaySnakeCase___client_strands.py.template +35 -0
- package/src/py/agent/gateway-connection/files/langchain/agent-connection/app/__gatewaySnakeCase___client_langchain.py.template +34 -0
- package/src/py/agent/gateway-connection/generator.d.ts +10 -0
- package/src/py/agent/gateway-connection/generator.js +119 -0
- package/src/py/agent/gateway-connection/generator.js.map +1 -0
- 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/gateway-connection/schema.d.ts +13 -0
- package/src/py/agent/gateway-connection/schema.json +31 -0
- package/src/py/agent/generator.d.ts +3 -3
- package/src/py/agent/generator.js +280 -180
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +153 -89
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client_strands.py.template +30 -0
- package/src/py/agent/mcp-connection/files/langchain/agent-connection/app/__mcpServerSnakeCase___client_langchain.py.template +30 -0
- package/src/py/agent/mcp-connection/generator.d.ts +3 -3
- package/src/py/agent/mcp-connection/generator.js +65 -126
- 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/mcp-connection/schema.d.ts +1 -0
- package/src/py/agent/mcp-connection/schema.json +5 -0
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +11 -19
- package/src/py/agent/react-connection/generator.d.ts +4 -4
- package/src/py/agent/react-connection/generator.js +55 -59
- 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} +6 -6
- 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/react-connection/schema.d.ts +1 -0
- package/src/py/agent/react-connection/schema.json +5 -0
- package/src/py/agent/schema.d.js +6 -0
- package/src/py/agent/schema.d.js.map +1 -0
- package/src/py/agent/schema.d.ts +2 -1
- package/src/py/agent/schema.json +6 -1
- package/src/py/api/generator.d.ts +3 -3
- package/src/py/api/generator.js +12 -11
- 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/api/schema.d.ts +1 -0
- package/src/py/api/schema.json +5 -0
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +1526 -0
- package/src/py/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/py/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/agent-connection/generator.js +39 -0
- package/src/py/dynamodb/agent-connection/generator.js.map +1 -0
- 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/agent-connection/schema.d.ts +15 -0
- package/src/py/dynamodb/agent-connection/schema.json +27 -0
- package/src/py/dynamodb/fast-api-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/py/dynamodb/fast-api-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/fast-api-connection/generator.js +37 -0
- package/src/py/dynamodb/fast-api-connection/generator.js.map +1 -0
- 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/fast-api-connection/schema.d.ts +13 -0
- package/src/py/dynamodb/fast-api-connection/schema.json +23 -0
- package/src/py/dynamodb/files/__name__/__init__.py.template +6 -0
- package/src/py/dynamodb/files/__name__/client.py.template +39 -0
- package/src/py/dynamodb/files/__name__/entities/__init__.py.template +4 -0
- package/src/py/dynamodb/files/__name__/entities/base.py.template +63 -0
- package/src/py/dynamodb/files/__name__/entities/example.py.template +64 -0
- package/src/py/dynamodb/files/config.json.template +24 -0
- package/src/py/dynamodb/generator.d.ts +10 -0
- package/src/py/dynamodb/generator.js +110 -0
- package/src/py/dynamodb/generator.js.map +1 -0
- package/src/py/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/py/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/mcp-server-connection/generator.js +39 -0
- package/src/py/dynamodb/mcp-server-connection/generator.js.map +1 -0
- 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/mcp-server-connection/schema.d.ts +15 -0
- package/src/py/dynamodb/mcp-server-connection/schema.json +27 -0
- package/src/py/dynamodb/schema.d.js +6 -0
- package/src/py/dynamodb/schema.d.js.map +1 -0
- package/src/py/dynamodb/schema.d.ts +16 -0
- package/src/py/dynamodb/schema.json +75 -0
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +212 -4678
- package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +4833 -0
- package/src/py/fast-api/files/app/__name__/init.py.template +5 -22
- package/src/py/fast-api/files/app/__name__/main.py.template +4 -1
- package/src/py/fast-api/generator.d.ts +3 -3
- package/src/py/fast-api/generator.js +90 -87
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/__snapshots__/generator.spec.ts.snap +4 -3
- package/src/py/fast-api/react/generator.d.ts +4 -4
- package/src/py/fast-api/react/generator.js +25 -25
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/open-api.d.ts +1 -1
- package/src/py/fast-api/react/open-api.js +31 -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/react/schema.d.ts +1 -0
- package/src/py/fast-api/react/schema.json +5 -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/fast-api/schema.d.ts +1 -0
- package/src/py/fast-api/schema.json +5 -0
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/py/lambda-function/generator.d.ts +3 -3
- package/src/py/lambda-function/generator.js +60 -59
- 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/lambda-function/schema.d.ts +1 -0
- package/src/py/lambda-function/schema.json +5 -0
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +87 -17
- package/src/py/mcp-server/generator.d.ts +3 -3
- package/src/py/mcp-server/generator.js +152 -125
- 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/mcp-server/schema.d.ts +1 -0
- package/src/py/mcp-server/schema.json +5 -0
- package/src/py/project/generator.d.ts +17 -4
- package/src/py/project/generator.js +205 -127
- 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/py/project/schema.d.ts +1 -0
- package/src/py/project/schema.json +5 -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/src/sdk/license.d.ts +8 -0
- 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 +1 -2
- package/src/sdk/utils/ast.js +6 -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 +19 -24
- package/src/smithy/project/files/build.Dockerfile.template +1 -4
- package/src/smithy/project/files/src/operations/echo.smithy.template +1 -0
- package/src/smithy/project/generator.d.ts +3 -3
- package/src/smithy/project/generator.js +64 -57
- 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/project/schema.d.ts +1 -0
- package/src/smithy/project/schema.json +5 -0
- package/src/smithy/react-connection/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/smithy/react-connection/generator.d.ts +3 -3
- package/src/smithy/react-connection/generator.js +39 -47
- 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/react-connection/schema.d.ts +1 -0
- package/src/smithy/react-connection/schema.json +5 -0
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +409 -106
- package/src/smithy/ts/api/generator.d.ts +3 -3
- package/src/smithy/ts/api/generator.js +127 -106
- 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/smithy/ts/api/schema.d.ts +1 -0
- package/src/smithy/ts/api/schema.json +5 -0
- package/src/terraform/project/files/application/src/main.tf.template +6 -1
- package/src/terraform/project/files/application/src/providers.tf.template +1 -1
- package/src/terraform/project/generator.d.ts +3 -3
- package/src/terraform/project/generator.js +156 -104
- 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/terraform/project/schema.d.ts +1 -0
- package/src/terraform/project/schema.json +5 -0
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +499 -110
- package/src/trpc/backend/files/src/procedures/echo.ts.template +1 -1
- package/src/trpc/backend/files/src/schema/echo.ts.template +2 -2
- package/src/trpc/backend/generator.d.ts +4 -4
- package/src/trpc/backend/generator.js +97 -85
- 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/backend/schema.d.ts +3 -2
- package/src/trpc/backend/schema.json +5 -0
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/trpc/react/files/src/components/__apiNameClassName__ClientProvider.tsx.template +3 -3
- package/src/trpc/react/generator.d.ts +4 -4
- package/src/trpc/react/generator.js +63 -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/trpc/react/schema.d.ts +1 -0
- package/src/trpc/react/schema.json +5 -0
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +656 -18
- package/src/ts/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +256 -0
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client-strands.ts.template +23 -0
- package/src/ts/agent/a2a-connection/generator.d.ts +3 -3
- package/src/ts/agent/a2a-connection/generator.js +63 -56
- 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/a2a-connection/schema.d.ts +1 -0
- package/src/ts/agent/a2a-connection/schema.json +5 -0
- package/src/ts/agent/files/common/agent.ts.template +6 -2
- package/src/ts/agent/files/http/router.ts.template +1 -1
- package/src/ts/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +220 -0
- package/src/ts/agent/gateway-connection/files/agent-connection/app/__gatewayKebabCase__-client-strands.ts.template +30 -0
- package/src/ts/agent/gateway-connection/generator.d.ts +10 -0
- package/src/ts/agent/gateway-connection/generator.js +114 -0
- package/src/ts/agent/gateway-connection/generator.js.map +1 -0
- 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/gateway-connection/schema.d.ts +13 -0
- package/src/ts/agent/gateway-connection/schema.json +31 -0
- package/src/ts/agent/generator.d.ts +3 -3
- package/src/ts/agent/generator.js +188 -144
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +192 -111
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +22 -0
- package/src/ts/agent/mcp-connection/generator.d.ts +3 -3
- package/src/ts/agent/mcp-connection/generator.js +53 -60
- 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/mcp-connection/schema.d.ts +1 -0
- package/src/ts/agent/mcp-connection/schema.json +5 -0
- package/src/ts/agent/react-connection/generator.d.ts +4 -4
- package/src/ts/agent/react-connection/generator.js +86 -80
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/local-dev.d.ts +13 -0
- 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/react-connection/schema.d.ts +1 -0
- package/src/ts/agent/react-connection/schema.json +5 -0
- package/src/ts/agent/schema.d.js +6 -0
- package/src/ts/agent/schema.d.js.map +1 -0
- package/src/ts/agent/schema.d.ts +1 -0
- package/src/ts/agent/schema.json +5 -0
- package/src/ts/api/generator.d.ts +3 -3
- package/src/ts/api/generator.js +16 -16
- 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/api/schema.d.ts +3 -1
- package/src/ts/api/schema.json +5 -0
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +15 -16
- package/src/ts/astro-docs/generator.d.ts +3 -3
- package/src/ts/astro-docs/generator.js +69 -54
- 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/astro-docs/schema.d.ts +2 -2
- package/src/ts/astro-docs/schema.json +3 -3
- package/src/ts/docs/generator.d.ts +3 -3
- 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/docs/schema.d.ts +1 -4
- package/src/ts/docs/schema.json +3 -3
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +1390 -0
- package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/agent-connection/generator.js +30 -0
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -0
- 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/agent-connection/schema.d.ts +15 -0
- package/src/ts/dynamodb/agent-connection/schema.json +27 -0
- package/src/ts/dynamodb/files/config.json.template +24 -0
- package/src/ts/dynamodb/files/src/client.ts.template +61 -0
- package/src/ts/dynamodb/files/src/entities/example.ts.template +47 -0
- package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -0
- package/src/ts/dynamodb/files/src/index.ts.template +2 -0
- package/src/ts/dynamodb/generator.d.ts +10 -0
- package/src/ts/dynamodb/generator.js +116 -0
- package/src/ts/dynamodb/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js +30 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -0
- 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/mcp-server-connection/schema.d.ts +15 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.json +27 -0
- package/src/ts/dynamodb/schema.d.js +6 -0
- package/src/ts/dynamodb/schema.d.js.map +1 -0
- package/src/ts/dynamodb/schema.d.ts +16 -0
- package/src/ts/dynamodb/schema.json +75 -0
- package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/smithy-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/smithy-connection/generator.js +28 -0
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -0
- 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/smithy-connection/schema.d.ts +13 -0
- package/src/ts/dynamodb/smithy-connection/schema.json +23 -0
- package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/trpc-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/trpc-connection/generator.js +28 -0
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -0
- 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/dynamodb/trpc-connection/schema.d.ts +13 -0
- package/src/ts/dynamodb/trpc-connection/schema.json +23 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/lambda-function/generator.d.ts +3 -3
- package/src/ts/lambda-function/generator.js +59 -56
- 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/lambda-function/schema.d.ts +1 -0
- package/src/ts/lambda-function/schema.json +5 -0
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +53 -99
- package/src/ts/lib/__snapshots__/vitest.spec.ts.snap +24 -0
- package/src/ts/lib/biome.d.ts +7 -0
- package/src/ts/lib/biome.js +58 -0
- package/src/ts/lib/biome.js.map +1 -0
- package/src/ts/lib/generator.d.ts +3 -3
- package/src/ts/lib/generator.js +96 -96
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/grit/vitest-pass-with-no-tests.grit +1 -4
- package/src/ts/lib/schema.d.js +6 -0
- package/src/ts/lib/schema.d.js.map +1 -0
- package/src/ts/lib/schema.d.ts +1 -1
- package/src/ts/lib/schema.json +5 -0
- package/src/ts/lib/ts-project-utils.d.ts +12 -2
- package/src/ts/lib/ts-project-utils.js +80 -65
- 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.d.ts +2 -2
- 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 +83 -13
- package/src/ts/mcp-server/generator.d.ts +3 -3
- package/src/ts/mcp-server/generator.js +164 -120
- 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/mcp-server/schema.d.ts +1 -0
- package/src/ts/mcp-server/schema.json +5 -0
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +46 -26
- package/src/ts/nx-generator/files/common/schema.d.ts.template +1 -0
- package/src/ts/nx-generator/files/common/schema.json.template +5 -0
- package/src/ts/nx-generator/files/local/generator.ts.template +3 -3
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +6 -7
- package/src/ts/nx-generator/generator.d.ts +2 -2
- package/src/ts/nx-generator/generator.js +111 -74
- 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-generator/schema.d.ts +1 -0
- package/src/ts/nx-generator/schema.json +5 -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.d.ts +3 -3
- package/src/ts/nx-plugin/generator.js +60 -51
- 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/schema.json +5 -0
- package/src/ts/nx-plugin/utils.d.ts +1 -1
- package/src/ts/nx-plugin/utils.js +32 -38
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +312 -482
- package/src/ts/rdb/agent-connection/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/ts/rdb/agent-connection/generator.d.ts +3 -3
- 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/agent-connection/schema.d.ts +1 -0
- package/src/ts/rdb/agent-connection/schema.json +5 -0
- package/src/ts/rdb/files/config.json.template +14 -0
- package/src/ts/rdb/files/prisma.config.ts.template +6 -5
- package/src/ts/rdb/files/src/create-db-user-handler.ts.template +7 -9
- package/src/ts/rdb/files/src/index.ts.template +0 -1
- package/src/ts/rdb/files/src/migration-handler.ts.template +1 -28
- package/src/ts/rdb/files/src/prisma.ts.template +28 -23
- package/src/ts/rdb/files/src/utils.ts.template +3 -0
- package/src/ts/rdb/generator.d.ts +3 -7
- package/src/ts/rdb/generator.js +158 -130
- 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.d.ts +3 -3
- 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/mcp-server-connection/schema.d.ts +1 -0
- package/src/ts/rdb/mcp-server-connection/schema.json +5 -0
- package/src/ts/rdb/schema.d.js +6 -0
- package/src/ts/rdb/schema.d.js.map +1 -0
- package/src/ts/rdb/schema.d.ts +1 -0
- package/src/ts/rdb/schema.json +5 -0
- package/src/ts/rdb/smithy-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/rdb/smithy-connection/generator.d.ts +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/smithy-connection/schema.d.ts +1 -0
- package/src/ts/rdb/smithy-connection/schema.json +5 -0
- package/src/ts/rdb/trpc-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/rdb/trpc-connection/generator.d.ts +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/trpc-connection/schema.d.ts +1 -0
- package/src/ts/rdb/trpc-connection/schema.json +5 -0
- package/src/ts/rdb/utils.d.ts +1 -1
- package/src/ts/rdb/utils.js +9 -11
- package/src/ts/rdb/utils.js.map +1 -1
- package/src/ts/react-website/agui/files/common/src/hooks/useAgui__agentNameClassName__.tsx.template +1 -16
- package/src/ts/react-website/agui/generator.d.ts +1 -1
- package/src/ts/react-website/agui/generator.js +69 -62
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +626 -612
- package/src/ts/react-website/app/generator.d.ts +4 -4
- package/src/ts/react-website/app/generator.js +217 -192
- 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.d.ts +1 -1
- package/src/ts/react-website/app/schema.json +11 -6
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +129 -18
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +36 -10
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.ux-provider.spec.ts.snap +0 -20
- package/src/ts/react-website/cognito-auth/files/app/components/CognitoAuth/index.tsx.template +2 -2
- package/src/ts/react-website/cognito-auth/generator.d.ts +4 -4
- package/src/ts/react-website/cognito-auth/generator.js +64 -63
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/grit/cloudscape-auth-menu.grit +8 -6
- package/src/ts/react-website/cognito-auth/grit/cognito-auth-wrapper.grit +1 -1
- package/src/ts/react-website/cognito-auth/grit/none-auth-menu.grit +1 -0
- package/src/ts/react-website/cognito-auth/grit/shadcn-auth-menu.grit +3 -1
- package/src/ts/react-website/cognito-auth/grit/shadcn-state-declarations.grit +3 -1
- package/src/ts/react-website/cognito-auth/schema.d.js +6 -0
- package/src/ts/react-website/cognito-auth/schema.d.js.map +1 -0
- package/src/ts/react-website/cognito-auth/schema.d.ts +1 -0
- package/src/ts/react-website/cognito-auth/schema.json +5 -0
- package/src/ts/react-website/cognito-auth/utils.d.ts +1 -1
- 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.d.ts +3 -3
- 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/react-website/runtime-config/schema.d.ts +1 -0
- package/src/ts/react-website/runtime-config/schema.json +5 -0
- package/src/ts/sync/generator.d.ts +3 -3
- package/src/ts/sync/generator.js +60 -59
- package/src/ts/sync/generator.js.map +1 -1
- package/src/ts/website/app/generator.d.ts +3 -3
- package/src/ts/website/app/generator.js +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.d.ts +1 -1
- package/src/ts/website/app/schema.json +11 -6
- package/src/ts/website/auth/generator.d.ts +4 -4
- package/src/ts/website/auth/generator.js +11 -10
- 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/ts/website/auth/schema.d.ts +1 -0
- package/src/ts/website/auth/schema.json +5 -0
- package/src/utils/agent-chat/agent-chat.d.ts +31 -0
- package/src/utils/agent-chat/agent-chat.js +29 -0
- package/src/utils/agent-chat/agent-chat.js.map +1 -0
- package/src/utils/agent-chat/files/a2a/chat.ts.template +33 -0
- package/src/utils/agent-chat/files/ag-ui/chat.ts.template +17 -0
- package/src/utils/agent-chat/files/common/agentcore.ts.template +81 -0
- package/src/utils/agent-chat/files/http-py/chat.ts.template +43 -0
- package/src/utils/agent-chat/files/http-ts/chat.ts.template +54 -0
- package/src/utils/agent-connection/agent-connection.d.ts +117 -25
- package/src/utils/agent-connection/agent-connection.js +411 -103
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client-config.ts.template +93 -0
- package/src/utils/agent-connection/files/core-auth/agentcore-endpoints.ts.template +37 -0
- package/src/utils/agent-connection/files/core-auth/agentcore-fetch.ts.template +54 -0
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +41 -0
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-transport.ts.template +70 -0
- package/src/utils/agent-connection/files/core-runtime-config/runtime-config.ts.template +22 -32
- package/src/utils/agent-connection/files/core-shared/agentcore-transport.ts.template +39 -0
- package/src/utils/agent-connection/files/core-strands/a2a/agentcore-a2a-client-strands.ts.template +61 -0
- package/src/utils/agent-connection/files/core-strands/base/model-errors-strands.ts.template +36 -0
- package/src/utils/agent-connection/files/core-strands/gateway/agentcore-gateway-mcp-client-strands.ts.template +26 -0
- package/src/utils/agent-connection/files/core-strands/mcp/agentcore-mcp-client-strands.ts.template +27 -0
- package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client_config.py.template +43 -0
- package/src/utils/agent-connection/files/py-core-auth/agentcore_endpoints.py.template +47 -0
- package/src/utils/agent-connection/files/py-core-auth/auth/session.py.template +51 -0
- package/src/utils/agent-connection/files/py-core-gateway/agentcore_gateway_mcp_transport.py.template +28 -0
- package/src/utils/agent-connection/files/py-core-langchain/a2a/agentcore_a2a_client_langchain.py.template +99 -0
- package/src/utils/agent-connection/files/py-core-langchain/gateway/agentcore_gateway_mcp_client_langchain.py.template +57 -0
- package/src/utils/agent-connection/files/py-core-langchain/mcp/agentcore_mcp_client_langchain.py.template +64 -0
- package/src/utils/agent-connection/files/py-core-mcp/agentcore_mcp_transport.py.template +34 -0
- package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +5 -18
- package/src/utils/agent-connection/files/py-core-shared/agentcore_transport.py.template +40 -0
- package/src/utils/agent-connection/files/py-core-strands/a2a/agentcore_a2a_client_strands.py.template +66 -0
- package/src/utils/agent-connection/files/py-core-strands/base/model_errors_strands.py.template +40 -0
- package/src/utils/agent-connection/files/py-core-strands/gateway/agentcore_gateway_mcp_client_strands.py.template +22 -0
- package/src/utils/agent-connection/files/py-core-strands/mcp/agentcore_mcp_client_strands.py.template +30 -0
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +11 -3
- package/src/utils/agent-core-constructs/agent-core-constructs.js +86 -38
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +4 -0
- package/src/utils/agent-core-constructs/files/cdk/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.ts.template +50 -0
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +487 -0
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/readiness-probe/index.js.template +55 -0
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +449 -0
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/render-cedar.cjs.template +13 -0
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +80 -12
- package/src/utils/agent-core-constructs/files/terraform/core/agentcore-gateway/gateway.tf.template +14 -0
- package/src/utils/api-constructs/api-constructs.d.ts +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/app/apis/rest/__apiNameKebabCase__.ts.template +3 -0
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +23 -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 +51 -15
- package/src/utils/api-constructs/files/cdk/core/api/utils/utils.ts.template +61 -7
- 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 +94 -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.d.ts +2 -2
- 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.d.ts +5 -1
- package/src/utils/ast/website.js +18 -20
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.d.ts +33 -1
- package/src/utils/ast.js +130 -70
- package/src/utils/ast.js.map +1 -1
- package/src/utils/bundle/bundle.d.ts +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 +5 -5
- package/src/utils/config/index.js +5 -4
- package/src/utils/config/index.js.map +1 -1
- package/src/utils/config/utils.d.ts +13 -3
- package/src/utils/config/utils.js +65 -43
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +1 -1
- package/src/utils/connection/open-api/react.d.ts +6 -6
- 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.d.ts +1 -1
- package/src/utils/containers.js +22 -23
- package/src/utils/containers.js.map +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.d.ts +18 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +48 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -0
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +43 -0
- package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +105 -0
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +72 -0
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +155 -0
- package/src/utils/files/common/scripts/src/dynamodb/create-local-table.ts.template +195 -0
- package/src/utils/files/common/scripts/src/dynamodb/pull-image.ts.template +13 -0
- package/src/utils/files/common/scripts/src/dynamodb/start-container.ts.template +106 -0
- package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/cdk-command.ts.template +6 -3
- 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/shared/pull-image.ts.template +16 -0
- package/src/utils/files/common/scripts/src/rdb/shared/start-container.ts.template +117 -0
- 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 +12 -6
- 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 +9 -4
- package/src/utils/files/website/hooks/sigv4/useSigV4.tsx.template +1 -1
- package/src/utils/format.d.ts +45 -2
- package/src/utils/format.js +323 -81
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.d.ts +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.d.ts +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.d.ts +4 -0
- package/src/utils/generators.js +18 -20
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.d.ts +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.d.ts +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 +123 -14
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +28 -9
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +106 -6
- package/src/utils/identity-constructs/files/terraform/core/user-identity/main.tf.template +7 -0
- package/src/utils/identity-constructs/identity-constructs.d.ts +2 -2
- package/src/utils/identity-constructs/identity-constructs.js +24 -28
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/install.d.ts +32 -0
- package/src/utils/install.js +56 -0
- package/src/utils/install.js.map +1 -0
- package/src/utils/js.d.ts +4 -0
- package/src/utils/js.js +27 -20
- package/src/utils/js.js.map +1 -1
- package/src/utils/mcp.d.ts +25 -0
- package/src/utils/mcp.js +74 -0
- package/src/utils/mcp.js.map +1 -0
- package/src/utils/metrics.d.ts +9 -3
- package/src/utils/metrics.js +61 -46
- 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 +22 -0
- package/src/utils/names.js +44 -48
- package/src/utils/names.js.map +1 -1
- package/src/utils/npm-scope.d.ts +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 +25 -4
- package/src/utils/nx.js +144 -75
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.d.ts +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.d.ts +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.d.ts +1 -1
- package/src/utils/pnpm-workspace.js +22 -22
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.d.ts +31 -3
- package/src/utils/port.js +72 -12
- package/src/utils/port.js.map +1 -1
- package/src/utils/py.d.ts +16 -3
- package/src/utils/py.js +72 -47
- package/src/utils/py.js.map +1 -1
- package/src/utils/rdb-constructs/files/cdk/app/dbs/__nameKebabCase__.ts.template +12 -2
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +35 -16
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +42 -48
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +31 -16
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +5 -4
- package/src/utils/rdb-constructs/rdb-constructs.js +31 -41
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs-constants.d.ts +1 -0
- package/src/utils/shared-constructs-constants.js +16 -15
- package/src/utils/shared-constructs-constants.js.map +1 -1
- package/src/utils/shared-constructs.d.ts +2 -2
- package/src/utils/shared-constructs.js +57 -54
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-dynamodb-scripts.d.ts +11 -0
- package/src/utils/shared-dynamodb-scripts.js +25 -0
- package/src/utils/shared-dynamodb-scripts.js.map +1 -0
- package/src/utils/shared-infra-config.d.ts +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.d.ts +11 -0
- package/src/utils/shared-infra-scripts.js +40 -0
- package/src/utils/shared-infra-scripts.js.map +1 -0
- package/src/utils/shared-rdb-scripts.d.ts +16 -0
- package/src/utils/shared-rdb-scripts.js +28 -0
- package/src/utils/shared-rdb-scripts.js.map +1 -0
- package/src/utils/shared-scripts.d.ts +2 -5
- package/src/utils/shared-scripts.js +12 -38
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.d.ts +1 -1
- package/src/utils/shared-shadcn.js +64 -72
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +13 -1
- package/src/utils/test.js +35 -23
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.d.ts +1 -1
- package/src/utils/toml.js +10 -14
- package/src/utils/toml.js.map +1 -1
- package/src/utils/versions.d.ts +116 -84
- package/src/utils/versions.js +124 -102
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +73 -5
- 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 +68 -19
- package/src/utils/website-constructs/website-constructs.d.ts +2 -2
- 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/connection.d.ts +0 -6
- package/sdk/connection.js +0 -10
- package/sdk/connection.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 -29
- package/sdk/ts.js +0 -47
- 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.d.ts +0 -15
- package/src/connection/serve-local.js +0 -41
- package/src/connection/serve-local.js.map +0 -1
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client.py.template +0 -22
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client.py.template +0 -22
- package/src/py/agent/react-connection/serve-local.js +0 -30
- package/src/py/agent/react-connection/serve-local.js.map +0 -1
- package/src/py/agent/scripts/http/chat.ts.template +0 -38
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client.ts.template +0 -19
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client.ts.template +0 -19
- package/src/ts/agent/react-connection/serve-local.d.ts +0 -13
- 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/ts/agent/scripts/http/chat.ts.template +0 -35
- package/src/ts/lib/eslint.d.ts +0 -14
- package/src/ts/lib/eslint.js +0 -90
- package/src/ts/lib/eslint.js.map +0 -1
- package/src/ts/lib/grit/eslint-dependency-checks-warn.grit +0 -1
- package/src/ts/rdb/files/scripts/docker-pull.ts.template +0 -15
- package/src/ts/rdb/files/scripts/docker-start.ts.template +0 -84
- package/src/ts/rdb/files/scripts/wait-for-db.ts.template +0 -55
- package/src/ts/rdb/files/src/constants.ts.template +0 -8
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client.ts.template +0 -123
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-client.ts.template +0 -128
- package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client.py.template +0 -120
- package/src/utils/agent-connection/files/py-core-mcp/agentcore_mcp_client.py.template +0 -89
- /package/{bin → src/bin}/aws-nx-mcp.d.ts +0 -0
- /package/src/utils/agent-connection/files/{core-runtime-config/with-session-id.ts.template → core-strands/base/with-session-id-strands.ts.template} +0 -0
- /package/src/utils/agent-connection/files/{py-core-runtime-config/with_session_id.py.template → py-core-strands/base/with_session_id_strands.py.template} +0 -0
- /package/src/utils/files/common/scripts/src/{index.ts.template → infra/index.ts.template} +0 -0
- /package/src/utils/files/common/scripts/src/{infra-deploy.ts.template → infra/infra-deploy.ts.template} +0 -0
- /package/src/utils/files/common/scripts/src/{infra-destroy.ts.template → infra/infra-destroy.ts.template} +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/credentials.ts.template +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/run.ts.template +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/stage-parser.ts.template +0 -0
package/src/utils/ast.js
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const git_1 = require("./git");
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/ import { QueryBuilder } from "@getgrit/gritql";
|
|
5
|
+
import * as path from "path";
|
|
6
|
+
import { updateGitIgnore } from "./git.js";
|
|
8
7
|
const GRIT_DIR = '.grit';
|
|
9
8
|
// Pin the gritql native library's "global" stdlib directory to <workspace>/.grit so it doesn't try to write to /usr/local/.grit (or wherever node's grandparent resolves to).
|
|
10
|
-
const ensureGritDir = (tree)
|
|
9
|
+
const ensureGritDir = (tree)=>{
|
|
11
10
|
process.env.GRIT_GLOBAL_DIR ??= path.join(tree.root, GRIT_DIR);
|
|
12
|
-
|
|
11
|
+
updateGitIgnore(tree, '.', (patterns)=>[
|
|
12
|
+
...patterns,
|
|
13
|
+
GRIT_DIR
|
|
14
|
+
]);
|
|
13
15
|
};
|
|
14
|
-
const assertFilePath = (tree, filePath)
|
|
16
|
+
const assertFilePath = (tree, filePath)=>{
|
|
15
17
|
if (!tree.exists(filePath)) {
|
|
16
18
|
throw new Error(`No file located at ${filePath}`);
|
|
17
19
|
}
|
|
18
20
|
};
|
|
19
|
-
const addDestructuredImport = async (tree, filePath, variableNames, from)
|
|
21
|
+
export const addDestructuredImport = async (tree, filePath, variableNames, from)=>{
|
|
20
22
|
assertFilePath(tree, filePath);
|
|
21
23
|
// Check if there's an existing import from this module
|
|
22
|
-
const hasExistingImport = await
|
|
24
|
+
const hasExistingImport = await matchGritQL(tree, filePath, `\`import { $_ } from '${from}'\``);
|
|
23
25
|
if (hasExistingImport) {
|
|
24
26
|
// For each new variable, use GritQL rewrite to add it if not already present
|
|
25
|
-
for (const variableName of variableNames)
|
|
26
|
-
const localName = variableName.includes(' as ')
|
|
27
|
-
? variableName.split(' as ')[1]
|
|
28
|
-
: variableName;
|
|
27
|
+
for (const variableName of variableNames){
|
|
28
|
+
const localName = variableName.includes(' as ') ? variableName.split(' as ')[1] : variableName;
|
|
29
29
|
// Use rewrite (=>) which correctly handles comma-separated import specifier lists
|
|
30
|
-
await
|
|
30
|
+
await applyGritQL(tree, filePath, `\`import { $imports } from '${from}'\` => \`import { $imports, ${variableName} } from '${from}'\` where { $imports <: not contains \`${localName}\` }`);
|
|
31
31
|
}
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
32
|
+
} else {
|
|
34
33
|
// No existing import — prepend a new one (after shebang if present)
|
|
35
34
|
const specifiers = variableNames.join(', ');
|
|
36
35
|
const contents = tree.read(filePath).toString();
|
|
@@ -38,13 +37,11 @@ const addDestructuredImport = async (tree, filePath, variableNames, from) => {
|
|
|
38
37
|
if (contents.startsWith('#!')) {
|
|
39
38
|
const newlineIndex = contents.indexOf('\n');
|
|
40
39
|
tree.write(filePath, `${contents.substring(0, newlineIndex + 1)}${newImport}${contents.substring(newlineIndex + 1)}`);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
40
|
+
} else {
|
|
43
41
|
tree.write(filePath, `${newImport}${contents}`);
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
};
|
|
47
|
-
exports.addDestructuredImport = addDestructuredImport;
|
|
48
45
|
/**
|
|
49
46
|
* Ensure a Python `from <module> import <name1>, <name2>, ...` statement
|
|
50
47
|
* exists in the given file. If the module already has a `from <module> import`
|
|
@@ -57,17 +54,16 @@ exports.addDestructuredImport = addDestructuredImport;
|
|
|
57
54
|
* was rewritten after trying every requested name, we fall back to checking
|
|
58
55
|
* whether the module is imported at all; if not, we prepend a fresh
|
|
59
56
|
* `from <module> import ...` line.
|
|
60
|
-
*/
|
|
61
|
-
const addPythonDestructuredImport = async (tree, filePath, variableNames, from) => {
|
|
57
|
+
*/ export const addPythonDestructuredImport = async (tree, filePath, variableNames, from)=>{
|
|
62
58
|
assertFilePath(tree, filePath);
|
|
63
59
|
// Determine whether there's any `from <module> import ...` line in the file.
|
|
64
60
|
// We detect this by attempting a no-op transformation — the file is unchanged,
|
|
65
61
|
// but a successful match tells us the line exists.
|
|
66
62
|
const beforeContents = tree.read(filePath).toString();
|
|
67
63
|
let moduleAlreadyImported = false;
|
|
68
|
-
for (const variableName of variableNames)
|
|
64
|
+
for (const variableName of variableNames){
|
|
69
65
|
// Appends the name if the import-from exists and the name isn't already there.
|
|
70
|
-
const appended = await
|
|
66
|
+
const appended = await applyGritQL(tree, filePath, `language python\n\`from ${from} import $names\` where { $names <: not contains \`${variableName}\`, $names += \`, ${variableName}\` }`);
|
|
71
67
|
if (appended) {
|
|
72
68
|
moduleAlreadyImported = true;
|
|
73
69
|
}
|
|
@@ -79,9 +75,7 @@ const addPythonDestructuredImport = async (tree, filePath, variableNames, from)
|
|
|
79
75
|
if (moduleAlreadyImported) {
|
|
80
76
|
return;
|
|
81
77
|
}
|
|
82
|
-
const allAlreadyPresent = await
|
|
83
|
-
.map((n) => `$names <: contains \`${n}\``)
|
|
84
|
-
.join(', ')} }`);
|
|
78
|
+
const allAlreadyPresent = await matchGritQL(tree, filePath, `language python\n\`from ${from} import $names\` where { ${variableNames.map((n)=>`$names <: contains \`${n}\``).join(', ')} }`);
|
|
85
79
|
if (allAlreadyPresent) {
|
|
86
80
|
return;
|
|
87
81
|
}
|
|
@@ -90,88 +84,79 @@ const addPythonDestructuredImport = async (tree, filePath, variableNames, from)
|
|
|
90
84
|
const specifiers = variableNames.join(', ');
|
|
91
85
|
tree.write(filePath, `from ${from} import ${specifiers}\n${beforeContents}`);
|
|
92
86
|
};
|
|
93
|
-
exports.addPythonDestructuredImport = addPythonDestructuredImport;
|
|
94
87
|
/**
|
|
95
88
|
* Adds an `import <variableName> from '<from>'; statement to the beginning of the file,
|
|
96
89
|
* if it doesn't already exist
|
|
97
|
-
*/
|
|
98
|
-
const addSingleImport = async (tree, filePath, variableName, from) => {
|
|
90
|
+
*/ export const addSingleImport = async (tree, filePath, variableName, from)=>{
|
|
99
91
|
assertFilePath(tree, filePath);
|
|
100
92
|
// Check if default import already exists using GritQL
|
|
101
|
-
const alreadyImported = await
|
|
93
|
+
const alreadyImported = await matchGritQL(tree, filePath, `\`import ${variableName} from '${from}'\``);
|
|
102
94
|
if (alreadyImported) {
|
|
103
95
|
return;
|
|
104
96
|
}
|
|
105
97
|
// Prepend new import to file
|
|
106
98
|
const contents = tree.read(filePath).toString();
|
|
107
|
-
tree.write(filePath, `import ${variableName} from
|
|
99
|
+
tree.write(filePath, `import ${variableName} from '${from}';\n${contents}`);
|
|
108
100
|
};
|
|
109
|
-
exports.addSingleImport = addSingleImport;
|
|
110
101
|
/**
|
|
111
102
|
* Adds an `export * from '<from>'; statement to the given TypeScript file.
|
|
112
103
|
* Note that this will create the file if it does not exist in the tree.
|
|
113
|
-
*/
|
|
114
|
-
const addStarExport = async (tree, filePath, from) => {
|
|
104
|
+
*/ export const addStarExport = async (tree, filePath, from)=>{
|
|
115
105
|
const contents = tree.read(filePath)?.toString() ?? '';
|
|
116
106
|
// For empty/non-existent files, just write the export
|
|
117
107
|
if (!contents.trim()) {
|
|
118
|
-
tree.write(filePath, `export * from
|
|
108
|
+
tree.write(filePath, `export * from '${from}';\n`);
|
|
119
109
|
return;
|
|
120
110
|
}
|
|
121
111
|
// Check if already exported using GritQL
|
|
122
|
-
const alreadyExported = await
|
|
112
|
+
const alreadyExported = await matchGritQL(tree, filePath, `\`export * from '${from}'\``);
|
|
123
113
|
if (alreadyExported) {
|
|
124
114
|
return;
|
|
125
115
|
}
|
|
126
116
|
// Prepend new export to file
|
|
127
|
-
tree.write(filePath, `export * from
|
|
117
|
+
tree.write(filePath, `export * from '${from}';\n${contents}`);
|
|
128
118
|
};
|
|
129
|
-
exports.addStarExport = addStarExport;
|
|
130
119
|
/**
|
|
131
120
|
* Return whether or not the given identifier is exported in the source file.
|
|
132
121
|
* Checks for both `export { Identifier }` and `export type Identifier = ...`.
|
|
133
|
-
*/
|
|
134
|
-
const hasExportDeclaration = async (tree, source, identifierName) => {
|
|
122
|
+
*/ export const hasExportDeclaration = async (tree, source, identifierName)=>{
|
|
135
123
|
ensureGritDir(tree);
|
|
136
124
|
const patterns = [
|
|
137
125
|
`\`export type ${identifierName} = $_\``,
|
|
138
126
|
`\`export { ${identifierName} }\``,
|
|
139
|
-
`\`export type { ${identifierName} } from $_
|
|
127
|
+
`\`export type { ${identifierName} } from $_\``
|
|
140
128
|
];
|
|
141
|
-
for (const pattern of patterns)
|
|
129
|
+
for (const pattern of patterns){
|
|
142
130
|
try {
|
|
143
|
-
const q = new
|
|
131
|
+
const q = new QueryBuilder(`$p => $p where { $p <: ${pattern} }`);
|
|
144
132
|
const result = await q.applyToFile({
|
|
145
133
|
path: 'check.ts',
|
|
146
|
-
content: source
|
|
134
|
+
content: source
|
|
147
135
|
});
|
|
148
|
-
if (result !== null)
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
catch {
|
|
152
|
-
// Pattern didn't match, try next
|
|
136
|
+
if (result !== null) return true;
|
|
137
|
+
} catch {
|
|
138
|
+
// Pattern didn't match, try next
|
|
153
139
|
}
|
|
154
140
|
}
|
|
155
141
|
return false;
|
|
156
142
|
};
|
|
157
|
-
exports.hasExportDeclaration = hasExportDeclaration;
|
|
158
143
|
/**
|
|
159
144
|
* Apply a GritQL pattern to a file in the Nx tree.
|
|
160
|
-
*/
|
|
161
|
-
|
|
162
|
-
if (!tree.exists(filePath))
|
|
163
|
-
throw new Error(`No file at ${filePath}`);
|
|
145
|
+
*/ export const applyGritQL = async (tree, filePath, pattern)=>{
|
|
146
|
+
if (!tree.exists(filePath)) throw new Error(`No file at ${filePath}`);
|
|
164
147
|
ensureGritDir(tree);
|
|
165
148
|
const source = tree.read(filePath).toString();
|
|
166
|
-
const query = new
|
|
167
|
-
const result = await query.applyToFile({
|
|
149
|
+
const query = new QueryBuilder(pattern);
|
|
150
|
+
const result = await query.applyToFile({
|
|
151
|
+
path: filePath,
|
|
152
|
+
content: source
|
|
153
|
+
});
|
|
168
154
|
if (result && result.content !== source) {
|
|
169
155
|
tree.write(filePath, result.content);
|
|
170
156
|
return true;
|
|
171
157
|
}
|
|
172
158
|
return false;
|
|
173
159
|
};
|
|
174
|
-
exports.applyGritQL = applyGritQL;
|
|
175
160
|
/**
|
|
176
161
|
* Check whether a GritQL pattern matches anywhere in a file.
|
|
177
162
|
* Returns true if the pattern matches at least once.
|
|
@@ -179,25 +164,100 @@ exports.applyGritQL = applyGritQL;
|
|
|
179
164
|
* Accepts raw GritQL, including patterns that start with a `language <name>`
|
|
180
165
|
* header (e.g. `language python\n\`print($_)\``) — the pattern is passed
|
|
181
166
|
* straight through to QueryBuilder without any wrapping rewrite.
|
|
182
|
-
*/
|
|
183
|
-
|
|
184
|
-
if (!tree.exists(filePath))
|
|
185
|
-
return false;
|
|
167
|
+
*/ export const matchGritQL = async (tree, filePath, pattern)=>{
|
|
168
|
+
if (!tree.exists(filePath)) return false;
|
|
186
169
|
ensureGritDir(tree);
|
|
187
170
|
const source = tree.read(filePath).toString();
|
|
188
171
|
let matched = false;
|
|
189
172
|
try {
|
|
190
|
-
const query = new
|
|
191
|
-
query.filter(()
|
|
173
|
+
const query = new QueryBuilder(pattern);
|
|
174
|
+
query.filter(()=>{
|
|
192
175
|
matched = true;
|
|
193
176
|
return true;
|
|
194
177
|
});
|
|
195
|
-
await query.applyToFile({
|
|
196
|
-
|
|
197
|
-
|
|
178
|
+
await query.applyToFile({
|
|
179
|
+
path: filePath,
|
|
180
|
+
content: source
|
|
181
|
+
});
|
|
182
|
+
} catch {
|
|
198
183
|
return false;
|
|
199
184
|
}
|
|
200
185
|
return matched;
|
|
201
186
|
};
|
|
202
|
-
|
|
187
|
+
/**
|
|
188
|
+
* Capture the source text of the first match of a GritQL pattern.
|
|
189
|
+
*
|
|
190
|
+
* For example `` `dependencyCheck: $_` `` returns the whole
|
|
191
|
+
* `dependencyCheck: { ... }` property text. Returns undefined if nothing
|
|
192
|
+
* matches. The file is not modified.
|
|
193
|
+
*/ export const captureGritQL = async (tree, filePath, pattern)=>{
|
|
194
|
+
if (!tree.exists(filePath)) return undefined;
|
|
195
|
+
ensureGritDir(tree);
|
|
196
|
+
const source = tree.read(filePath).toString();
|
|
197
|
+
let captured;
|
|
198
|
+
try {
|
|
199
|
+
const query = new QueryBuilder(pattern);
|
|
200
|
+
query.filter((node)=>{
|
|
201
|
+
captured ??= node.text();
|
|
202
|
+
return true;
|
|
203
|
+
});
|
|
204
|
+
await query.applyToFile({
|
|
205
|
+
path: filePath,
|
|
206
|
+
content: source
|
|
207
|
+
});
|
|
208
|
+
} catch {
|
|
209
|
+
return undefined;
|
|
210
|
+
}
|
|
211
|
+
return captured;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Return the text of every node matching the GritQL pattern, in document order.
|
|
215
|
+
*/ export const captureAllGritQL = async (tree, filePath, pattern)=>{
|
|
216
|
+
if (!tree.exists(filePath)) return [];
|
|
217
|
+
ensureGritDir(tree);
|
|
218
|
+
const source = tree.read(filePath).toString();
|
|
219
|
+
const captured = [];
|
|
220
|
+
try {
|
|
221
|
+
const query = new QueryBuilder(pattern);
|
|
222
|
+
query.filter((node)=>{
|
|
223
|
+
captured.push(node.text());
|
|
224
|
+
return true;
|
|
225
|
+
});
|
|
226
|
+
await query.applyToFile({
|
|
227
|
+
path: filePath,
|
|
228
|
+
content: source
|
|
229
|
+
});
|
|
230
|
+
} catch {
|
|
231
|
+
return [];
|
|
232
|
+
}
|
|
233
|
+
return captured;
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* A unique token that is a valid identifier, so it can stand in for an array
|
|
237
|
+
* element or object property inside a GritQL rewrite.
|
|
238
|
+
*/ export const GRIT_INSERT_PLACEHOLDER = '__GRIT_INSERT_PLACEHOLDER__';
|
|
239
|
+
/**
|
|
240
|
+
* Apply a GritQL rewrite that inserts {@link GRIT_INSERT_PLACEHOLDER}, then
|
|
241
|
+
* replace the placeholder with `text`. Routing user-provided text through a
|
|
242
|
+
* placeholder keeps it out of the GritQL pattern, where quotes, backticks or
|
|
243
|
+
* `${...}` would otherwise break parsing.
|
|
244
|
+
*
|
|
245
|
+
* Any separator (e.g. a leading `, ` when appending to an array) must be part
|
|
246
|
+
* of the GritQL pattern, not `text`. The one adjustment made here: if the
|
|
247
|
+
* placeholder lands after a trailing line comment (`// ...`) — which would
|
|
248
|
+
* comment out the text — the text is moved to its own line.
|
|
249
|
+
*
|
|
250
|
+
* The caller formats afterwards. Returns true if the pattern matched and the
|
|
251
|
+
* file changed.
|
|
252
|
+
*/ export const insertViaGritQL = async (tree, filePath, pattern, text)=>{
|
|
253
|
+
if (!await applyGritQL(tree, filePath, pattern)) return false;
|
|
254
|
+
const content = tree.read(filePath).toString();
|
|
255
|
+
const at = content.indexOf(GRIT_INSERT_PLACEHOLDER);
|
|
256
|
+
const lineSoFar = content.slice(content.lastIndexOf('\n', at) + 1, at);
|
|
257
|
+
const replacement = lineSoFar.includes('//') ? `\n${text}` : text;
|
|
258
|
+
// Function replacer so `$` in `text` isn't treated as a replacement pattern.
|
|
259
|
+
tree.write(filePath, content.replace(GRIT_INSERT_PLACEHOLDER, ()=>replacement));
|
|
260
|
+
return true;
|
|
261
|
+
};
|
|
262
|
+
|
|
203
263
|
//# sourceMappingURL=ast.js.map
|
package/src/utils/ast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/ast.ts"],"names":[],"mapp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ACpB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC,aAAa,CAAC,IAAI,CAAC,CAAC;IACpB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAC,QAAQ,EAAE,CAAC;IAC/C,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,qBAAY,CAAC,OAAO,CAAC,CAAC;QACxC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE;YAChB,OAAO,GAAG,IAAI,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AApBW,QAAA,WAAW,eAoBtB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/ast.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { QueryBuilder } from '@getgrit/gritql';\nimport type { Tree } from '@nx/devkit';\nimport * as path from 'path';\nimport { updateGitIgnore } from './git';\n\nconst GRIT_DIR = '.grit';\n\n// Pin the gritql native library's \"global\" stdlib directory to <workspace>/.grit so it doesn't try to write to /usr/local/.grit (or wherever node's grandparent resolves to).\nconst ensureGritDir = (tree: Tree) => {\n process.env.GRIT_GLOBAL_DIR ??= path.join(tree.root, GRIT_DIR);\n updateGitIgnore(tree, '.', (patterns) => [...patterns, GRIT_DIR]);\n};\n\nconst assertFilePath = (tree: Tree, filePath: string) => {\n if (!tree.exists(filePath)) {\n throw new Error(`No file located at ${filePath}`);\n }\n};\n\nexport const addDestructuredImport = async (\n tree: Tree,\n filePath: string,\n variableNames: string[],\n from: string,\n) => {\n assertFilePath(tree, filePath);\n\n // Check if there's an existing import from this module\n const hasExistingImport = await matchGritQL(\n tree,\n filePath,\n `\\`import { $_ } from '${from}'\\``,\n );\n\n if (hasExistingImport) {\n // For each new variable, use GritQL rewrite to add it if not already present\n for (const variableName of variableNames) {\n const localName = variableName.includes(' as ')\n ? variableName.split(' as ')[1]\n : variableName;\n // Use rewrite (=>) which correctly handles comma-separated import specifier lists\n await applyGritQL(\n tree,\n filePath,\n `\\`import { $imports } from '${from}'\\` => \\`import { $imports, ${variableName} } from '${from}'\\` where { $imports <: not contains \\`${localName}\\` }`,\n );\n }\n } else {\n // No existing import — prepend a new one (after shebang if present)\n const specifiers = variableNames.join(', ');\n const contents = tree.read(filePath)!.toString();\n const newImport = `import { ${specifiers} } from '${from}';\\n`;\n if (contents.startsWith('#!')) {\n const newlineIndex = contents.indexOf('\\n');\n tree.write(\n filePath,\n `${contents.substring(0, newlineIndex + 1)}${newImport}${contents.substring(newlineIndex + 1)}`,\n );\n } else {\n tree.write(filePath, `${newImport}${contents}`);\n }\n }\n};\n\n/**\n * Ensure a Python `from <module> import <name1>, <name2>, ...` statement\n * exists in the given file. If the module already has a `from <module> import`\n * line, any missing names are appended; otherwise a fresh import statement is\n * prepended to the file (ruff's import sorter will reorder it into place on\n * the next format pass).\n *\n * We try to append first (which only succeeds if an import-from for the\n * module already exists AND the name isn't yet in the list). If nothing\n * was rewritten after trying every requested name, we fall back to checking\n * whether the module is imported at all; if not, we prepend a fresh\n * `from <module> import ...` line.\n */\nexport const addPythonDestructuredImport = async (\n tree: Tree,\n filePath: string,\n variableNames: string[],\n from: string,\n) => {\n assertFilePath(tree, filePath);\n\n // Determine whether there's any `from <module> import ...` line in the file.\n // We detect this by attempting a no-op transformation — the file is unchanged,\n // but a successful match tells us the line exists.\n const beforeContents = tree.read(filePath)!.toString();\n let moduleAlreadyImported = false;\n for (const variableName of variableNames) {\n // Appends the name if the import-from exists and the name isn't already there.\n const appended = await applyGritQL(\n tree,\n filePath,\n `language python\\n\\`from ${from} import $names\\` where { $names <: not contains \\`${variableName}\\`, $names += \\`, ${variableName}\\` }`,\n );\n if (appended) {\n moduleAlreadyImported = true;\n }\n }\n\n // If the append succeeded for at least one name, we know the module line\n // exists; we're done. If nothing was appended we need to distinguish\n // between \"module not imported\" (need to add a new line) and \"module\n // imported but all names already present\" (no-op).\n if (moduleAlreadyImported) {\n return;\n }\n\n const allAlreadyPresent = await matchGritQL(\n tree,\n filePath,\n `language python\\n\\`from ${from} import $names\\` where { ${variableNames\n .map((n) => `$names <: contains \\`${n}\\``)\n .join(', ')} }`,\n );\n if (allAlreadyPresent) {\n return;\n }\n\n // No existing `from <module> import` line — prepend one. Ruff's import\n // sorter will place it in the right group on the next formatter pass.\n const specifiers = variableNames.join(', ');\n tree.write(filePath, `from ${from} import ${specifiers}\\n${beforeContents}`);\n};\n\n/**\n * Adds an `import <variableName> from '<from>'; statement to the beginning of the file,\n * if it doesn't already exist\n */\nexport const addSingleImport = async (\n tree: Tree,\n filePath: string,\n variableName: string,\n from: string,\n) => {\n assertFilePath(tree, filePath);\n\n // Check if default import already exists using GritQL\n const alreadyImported = await matchGritQL(\n tree,\n filePath,\n `\\`import ${variableName} from '${from}'\\``,\n );\n if (alreadyImported) {\n return;\n }\n\n // Prepend new import to file\n const contents = tree.read(filePath)!.toString();\n tree.write(filePath, `import ${variableName} from '${from}';\\n${contents}`);\n};\n\n/**\n * Adds an `export * from '<from>'; statement to the given TypeScript file.\n * Note that this will create the file if it does not exist in the tree.\n */\nexport const addStarExport = async (\n tree: Tree,\n filePath: string,\n from: string,\n) => {\n const contents = tree.read(filePath)?.toString() ?? '';\n\n // For empty/non-existent files, just write the export\n if (!contents.trim()) {\n tree.write(filePath, `export * from '${from}';\\n`);\n return;\n }\n\n // Check if already exported using GritQL\n const alreadyExported = await matchGritQL(\n tree,\n filePath,\n `\\`export * from '${from}'\\``,\n );\n if (alreadyExported) {\n return;\n }\n\n // Prepend new export to file\n tree.write(filePath, `export * from '${from}';\\n${contents}`);\n};\n\n/**\n * Return whether or not the given identifier is exported in the source file.\n * Checks for both `export { Identifier }` and `export type Identifier = ...`.\n */\nexport const hasExportDeclaration = async (\n tree: Tree,\n source: string,\n identifierName: string,\n): Promise<boolean> => {\n ensureGritDir(tree);\n const patterns = [\n `\\`export type ${identifierName} = $_\\``,\n `\\`export { ${identifierName} }\\``,\n `\\`export type { ${identifierName} } from $_\\``,\n ];\n\n for (const pattern of patterns) {\n try {\n const q = new QueryBuilder(`$p => $p where { $p <: ${pattern} }`);\n const result = await q.applyToFile({\n path: 'check.ts',\n content: source,\n });\n if (result !== null) return true;\n } catch {\n // Pattern didn't match, try next\n }\n }\n\n return false;\n};\n\n/**\n * Apply a GritQL pattern to a file in the Nx tree.\n */\nexport const applyGritQL = async (\n tree: Tree,\n filePath: string,\n pattern: string,\n): Promise<boolean> => {\n if (!tree.exists(filePath)) throw new Error(`No file at ${filePath}`);\n ensureGritDir(tree);\n const source = tree.read(filePath)!.toString();\n const query = new QueryBuilder(pattern);\n const result = await query.applyToFile({ path: filePath, content: source });\n if (result && result.content !== source) {\n tree.write(filePath, result.content);\n return true;\n }\n return false;\n};\n\n/**\n * Check whether a GritQL pattern matches anywhere in a file.\n * Returns true if the pattern matches at least once.\n *\n * Accepts raw GritQL, including patterns that start with a `language <name>`\n * header (e.g. `language python\\n\\`print($_)\\``) — the pattern is passed\n * straight through to QueryBuilder without any wrapping rewrite.\n */\nexport const matchGritQL = async (\n tree: Tree,\n filePath: string,\n pattern: string,\n): Promise<boolean> => {\n if (!tree.exists(filePath)) return false;\n ensureGritDir(tree);\n const source = tree.read(filePath)!.toString();\n let matched = false;\n try {\n const query = new QueryBuilder(pattern);\n query.filter(() => {\n matched = true;\n return true;\n });\n await query.applyToFile({ path: filePath, content: source });\n } catch {\n return false;\n }\n return matched;\n};\n\n/**\n * Capture the source text of the first match of a GritQL pattern.\n *\n * For example `` `dependencyCheck: $_` `` returns the whole\n * `dependencyCheck: { ... }` property text. Returns undefined if nothing\n * matches. The file is not modified.\n */\nexport const captureGritQL = async (\n tree: Tree,\n filePath: string,\n pattern: string,\n): Promise<string | undefined> => {\n if (!tree.exists(filePath)) return undefined;\n ensureGritDir(tree);\n const source = tree.read(filePath)!.toString();\n let captured: string | undefined;\n try {\n const query = new QueryBuilder(pattern);\n query.filter((node) => {\n captured ??= node.text();\n return true;\n });\n await query.applyToFile({ path: filePath, content: source });\n } catch {\n return undefined;\n }\n return captured;\n};\n\n/**\n * Return the text of every node matching the GritQL pattern, in document order.\n */\nexport const captureAllGritQL = async (\n tree: Tree,\n filePath: string,\n pattern: string,\n): Promise<string[]> => {\n if (!tree.exists(filePath)) return [];\n ensureGritDir(tree);\n const source = tree.read(filePath)!.toString();\n const captured: string[] = [];\n try {\n const query = new QueryBuilder(pattern);\n query.filter((node) => {\n captured.push(node.text());\n return true;\n });\n await query.applyToFile({ path: filePath, content: source });\n } catch {\n return [];\n }\n return captured;\n};\n\n/**\n * A unique token that is a valid identifier, so it can stand in for an array\n * element or object property inside a GritQL rewrite.\n */\nexport const GRIT_INSERT_PLACEHOLDER = '__GRIT_INSERT_PLACEHOLDER__';\n\n/**\n * Apply a GritQL rewrite that inserts {@link GRIT_INSERT_PLACEHOLDER}, then\n * replace the placeholder with `text`. Routing user-provided text through a\n * placeholder keeps it out of the GritQL pattern, where quotes, backticks or\n * `${...}` would otherwise break parsing.\n *\n * Any separator (e.g. a leading `, ` when appending to an array) must be part\n * of the GritQL pattern, not `text`. The one adjustment made here: if the\n * placeholder lands after a trailing line comment (`// ...`) — which would\n * comment out the text — the text is moved to its own line.\n *\n * The caller formats afterwards. Returns true if the pattern matched and the\n * file changed.\n */\nexport const insertViaGritQL = async (\n tree: Tree,\n filePath: string,\n pattern: string,\n text: string,\n): Promise<boolean> => {\n if (!(await applyGritQL(tree, filePath, pattern))) return false;\n const content = tree.read(filePath)!.toString();\n const at = content.indexOf(GRIT_INSERT_PLACEHOLDER);\n const lineSoFar = content.slice(content.lastIndexOf('\\n', at) + 1, at);\n const replacement = lineSoFar.includes('//') ? `\\n${text}` : text;\n\n // Function replacer so `$` in `text` isn't treated as a replacement pattern.\n tree.write(\n filePath,\n content.replace(GRIT_INSERT_PLACEHOLDER, () => replacement),\n );\n return true;\n};\n"],"names":["QueryBuilder","path","updateGitIgnore","GRIT_DIR","ensureGritDir","tree","process","env","GRIT_GLOBAL_DIR","join","root","patterns","assertFilePath","filePath","exists","Error","addDestructuredImport","variableNames","from","hasExistingImport","matchGritQL","variableName","localName","includes","split","applyGritQL","specifiers","contents","read","toString","newImport","startsWith","newlineIndex","indexOf","write","substring","addPythonDestructuredImport","beforeContents","moduleAlreadyImported","appended","allAlreadyPresent","map","n","addSingleImport","alreadyImported","addStarExport","trim","alreadyExported","hasExportDeclaration","source","identifierName","pattern","q","result","applyToFile","content","query","matched","filter","captureGritQL","undefined","captured","node","text","captureAllGritQL","push","GRIT_INSERT_PLACEHOLDER","insertViaGritQL","at","lineSoFar","slice","lastIndexOf","replacement","replace"],"mappings":"AAAA;;;CAGC,GAED,SAASA,YAAY,QAAQ,kBAAkB;AAE/C,YAAYC,UAAU,OAAO;AAC7B,SAASC,eAAe,QAAQ,WAAQ;AAExC,MAAMC,WAAW;AAEjB,8KAA8K;AAC9K,MAAMC,gBAAgB,CAACC;IACrBC,QAAQC,GAAG,CAACC,eAAe,KAAKP,KAAKQ,IAAI,CAACJ,KAAKK,IAAI,EAAEP;IACrDD,gBAAgBG,MAAM,KAAK,CAACM,WAAa;eAAIA;YAAUR;SAAS;AAClE;AAEA,MAAMS,iBAAiB,CAACP,MAAYQ;IAClC,IAAI,CAACR,KAAKS,MAAM,CAACD,WAAW;QAC1B,MAAM,IAAIE,MAAM,CAAC,mBAAmB,EAAEF,UAAU;IAClD;AACF;AAEA,OAAO,MAAMG,wBAAwB,OACnCX,MACAQ,UACAI,eACAC;IAEAN,eAAeP,M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AAI,CAACf,UAAWgB,QAAQ;IAC5C,MAAMgC,WAAqB,EAAE;IAC7B,IAAI;QACF,MAAML,QAAQ,IAAIxD,aAAamD;QAC/BK,MAAME,MAAM,CAAC,CAACI;YACZD,SAASI,IAAI,CAACH,KAAKC,IAAI;YACvB,OAAO;QACT;QACA,MAAMP,MAAMF,WAAW,CAAC;YAAErD,MAAMY;YAAU0C,SAASN;QAAO;IAC5D,EAAE,OAAM;QACN,OAAO,EAAE;IACX;IACA,OAAOY;AACT,EAAE;AAEF;;;CAGC,GACD,OAAO,MAAMK,0BAA0B,8BAA8B;AAErE;;;;;;;;;;;;;CAaC,GACD,OAAO,MAAMC,kBAAkB,OAC7B9D,MACAQ,UACAsC,SACAY;IAEA,IAAI,CAAE,MAAMtC,YAAYpB,MAAMQ,UAAUsC,UAAW,OAAO;IAC1D,MAAMI,UAAUlD,KAAKuB,IAAI,CAACf,UAAWgB,QAAQ;IAC7C,MAAMuC,KAAKb,QAAQtB,OAAO,CAACiC;IAC3B,MAAMG,YAAYd,QAAQe,KAAK,CAACf,QAAQgB,WAAW,CAAC,MAAMH,MAAM,GAAGA;IACnE,MAAMI,cAAcH,UAAU9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAEwC,MAAM,GAAGA;IAE7D,6EAA6E;IAC7E1D,KAAK6B,KAAK,CACRrB,UACA0C,QAAQkB,OAAO,CAACP,yBAAyB,IAAMM;IAEjD,OAAO;AACT,EAAE"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
5
|
+
import { type ProjectConfiguration, type Tree } from '@nx/devkit';
|
|
6
6
|
export interface AddPythonBundleTargetOptions {
|
|
7
7
|
/**
|
|
8
8
|
* Python platform
|
|
@@ -1,90 +1,91 @@
|
|
|
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 ast_1 = require("../ast");
|
|
11
|
-
const paths_1 = require("../paths");
|
|
12
|
-
const nx_1 = require("../nx");
|
|
4
|
+
*/ import { addDependenciesToPackageJson, generateFiles, joinPathFragments, OverwriteStrategy } from "@nx/devkit";
|
|
5
|
+
import { applyGritQL } from "../ast.js";
|
|
6
|
+
import { addDependencyToTargetIfNotPresent, normalizeTargetKeyOrder } from "../nx.js";
|
|
7
|
+
import { getRelativePathToRoot } from "../paths.js";
|
|
8
|
+
import { withVersions } from "../versions.js";
|
|
13
9
|
/**
|
|
14
10
|
* Create a target for bundling a python project
|
|
15
|
-
*/
|
|
16
|
-
const createPythonBundleTarget = ({ packageName, pythonPlatform, bundleTargetName, }) => {
|
|
11
|
+
*/ const createPythonBundleTarget = ({ packageName, pythonPlatform, bundleTargetName })=>{
|
|
17
12
|
return {
|
|
18
13
|
cache: true,
|
|
19
|
-
inputs: [
|
|
14
|
+
inputs: [
|
|
15
|
+
'default',
|
|
16
|
+
'^production'
|
|
17
|
+
],
|
|
20
18
|
executor: 'nx:run-commands',
|
|
21
|
-
outputs: [
|
|
19
|
+
outputs: [
|
|
20
|
+
`{workspaceRoot}/dist/{projectRoot}/${bundleTargetName}`
|
|
21
|
+
],
|
|
22
22
|
options: {
|
|
23
23
|
commands: [
|
|
24
24
|
`uv export --frozen --no-dev --no-editable --project {projectRoot} --package ${packageName} -o dist/{projectRoot}/${bundleTargetName}/requirements.txt`,
|
|
25
|
-
`uv pip install -n --no-deps --no-installer-metadata --no-compile-bytecode --python-platform ${pythonPlatform} --target dist/{projectRoot}/${bundleTargetName} -r dist/{projectRoot}/${bundleTargetName}/requirements.txt
|
|
25
|
+
`uv pip install -n --no-deps --no-installer-metadata --no-compile-bytecode --python-platform ${pythonPlatform} --target dist/{projectRoot}/${bundleTargetName} -r dist/{projectRoot}/${bundleTargetName}/requirements.txt`
|
|
26
26
|
],
|
|
27
|
-
parallel: false
|
|
28
|
-
}
|
|
27
|
+
parallel: false
|
|
28
|
+
}
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
32
|
* Adds a bundle target to the given project if it does not exist, and updates the build target to depend on it
|
|
33
|
-
*/
|
|
34
|
-
const addPythonBundleTarget = (project, opts) => {
|
|
33
|
+
*/ export const addPythonBundleTarget = (project, opts)=>{
|
|
35
34
|
if (!project.targets) {
|
|
36
35
|
project.targets = {};
|
|
37
36
|
}
|
|
38
37
|
const pythonPlatform = opts?.pythonPlatform ?? 'x86_64-manylinux_2_28';
|
|
39
38
|
const bundleTargetName = pythonPlatform === 'aarch64-manylinux_2_28' ? 'bundle-arm' : 'bundle-x86';
|
|
40
39
|
if (!project.targets?.[bundleTargetName]) {
|
|
41
|
-
project.targets[bundleTargetName] = {
|
|
40
|
+
project.targets[bundleTargetName] = normalizeTargetKeyOrder({
|
|
42
41
|
...createPythonBundleTarget({
|
|
43
42
|
packageName: project.name,
|
|
44
43
|
pythonPlatform,
|
|
45
|
-
bundleTargetName
|
|
44
|
+
bundleTargetName
|
|
46
45
|
}),
|
|
47
|
-
dependsOn: [
|
|
48
|
-
|
|
46
|
+
dependsOn: [
|
|
47
|
+
'compile'
|
|
48
|
+
]
|
|
49
|
+
});
|
|
49
50
|
}
|
|
50
51
|
// Add a "bundle" target which depends on either bundle-arm or bundle-x86 (or both)
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
addDependencyToTargetIfNotPresent(project, 'bundle', bundleTargetName);
|
|
53
|
+
addDependencyToTargetIfNotPresent(project, 'build', 'bundle');
|
|
53
54
|
return {
|
|
54
55
|
bundleTargetName,
|
|
55
|
-
bundleOutputDir:
|
|
56
|
+
bundleOutputDir: joinPathFragments('dist', project.root, bundleTargetName)
|
|
56
57
|
};
|
|
57
58
|
};
|
|
58
|
-
exports.addPythonBundleTarget = addPythonBundleTarget;
|
|
59
59
|
/**
|
|
60
60
|
* Add a TypeScript bundle target using rolldown
|
|
61
|
-
*/
|
|
62
|
-
const addTypeScriptBundleTarget = async (tree, project, opts) => {
|
|
61
|
+
*/ export const addTypeScriptBundleTarget = async (tree, project, opts)=>{
|
|
63
62
|
project.targets ??= {};
|
|
64
63
|
// Generate empty rolldown config if it doesn't exist
|
|
65
|
-
|
|
64
|
+
generateFiles(tree, joinPathFragments(import.meta.dirname, 'files', 'ts'), project.root, {}, {
|
|
65
|
+
overwriteStrategy: OverwriteStrategy.KeepExisting
|
|
66
|
+
});
|
|
66
67
|
// Add the bundle target
|
|
67
68
|
if (!project.targets.bundle) {
|
|
68
|
-
project.targets.bundle = {
|
|
69
|
+
project.targets.bundle = normalizeTargetKeyOrder({
|
|
69
70
|
cache: true,
|
|
70
|
-
outputs: [
|
|
71
|
+
outputs: [
|
|
72
|
+
`{workspaceRoot}/dist/{projectRoot}/bundle`
|
|
73
|
+
],
|
|
71
74
|
executor: 'nx:run-commands',
|
|
72
75
|
options: {
|
|
73
76
|
command: 'rolldown -c rolldown.config.ts',
|
|
74
|
-
cwd: '{projectRoot}'
|
|
77
|
+
cwd: '{projectRoot}'
|
|
75
78
|
},
|
|
76
|
-
dependsOn: [
|
|
77
|
-
|
|
79
|
+
dependsOn: [
|
|
80
|
+
'compile'
|
|
81
|
+
]
|
|
82
|
+
});
|
|
78
83
|
}
|
|
79
84
|
// Add bundle to the build target
|
|
80
|
-
|
|
81
|
-
const rolldownConfigPath =
|
|
82
|
-
const outputFile =
|
|
83
|
-
const external = opts.external?.length
|
|
84
|
-
? opts.external
|
|
85
|
-
.map((ext) => typeof ext === 'string' ? `'${ext}'` : `/${ext.source}/`)
|
|
86
|
-
.join(', ')
|
|
87
|
-
: '';
|
|
85
|
+
addDependencyToTargetIfNotPresent(project, 'build', 'bundle');
|
|
86
|
+
const rolldownConfigPath = joinPathFragments(project.root, 'rolldown.config.ts');
|
|
87
|
+
const outputFile = joinPathFragments(getRelativePathToRoot(tree, project.name), 'dist', project.root, 'bundle', opts.bundleOutputDir ?? '.', 'index.js');
|
|
88
|
+
const external = opts.external?.length ? opts.external.map((ext)=>typeof ext === 'string' ? `'${ext}'` : `/${ext.source}/`).join(', ') : '';
|
|
88
89
|
const entry = `{
|
|
89
90
|
tsconfig: 'tsconfig.lib.json',
|
|
90
91
|
input: '${opts.targetFilePath}',
|
|
@@ -95,18 +96,20 @@ const addTypeScriptBundleTarget = async (tree, project, opts) => {
|
|
|
95
96
|
// Use GritQL to append the config entry to the defineConfig array.
|
|
96
97
|
// First try the non-empty array case using the accumulate (+=) operator,
|
|
97
98
|
// with an idempotency guard that checks the input path is not already present.
|
|
98
|
-
const appended = await
|
|
99
|
+
const appended = await applyGritQL(tree, rolldownConfigPath, `\`defineConfig([$items])\` where { $items <: not contains \`'${opts.targetFilePath}'\`, $items += ", ${entry}" }`);
|
|
99
100
|
if (!appended) {
|
|
100
101
|
// Empty array — GritQL's += cannot accumulate into an empty list, so we
|
|
101
102
|
// first insert a placeholder to make the array non-empty, then replace
|
|
102
103
|
// the placeholder with the real entry via += (which handles regex
|
|
103
104
|
// literals that are invalid inside GritQL backtick snippets).
|
|
104
|
-
const inserted = await
|
|
105
|
+
const inserted = await applyGritQL(tree, rolldownConfigPath, `\`defineConfig([])\` => \`defineConfig([__PLACEHOLDER__])\``);
|
|
105
106
|
if (inserted) {
|
|
106
|
-
await
|
|
107
|
+
await applyGritQL(tree, rolldownConfigPath, `\`defineConfig([$items])\` where { $items <: \`__PLACEHOLDER__\` => ., $items += "${entry}" }`);
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
|
-
|
|
110
|
+
addDependenciesToPackageJson(tree, {}, withVersions([
|
|
111
|
+
'rolldown'
|
|
112
|
+
]));
|
|
110
113
|
};
|
|
111
|
-
|
|
114
|
+
|
|
112
115
|
//# sourceMappingURL=bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/utils/bundle/bundle.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n addDependenciesToPackageJson,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type ProjectConfiguration,\n type TargetConfiguration,\n type Tree,\n} from '@nx/devkit';\nimport { applyGritQL } from '../ast';\nimport {\n addDependencyToTargetIfNotPresent,\n normalizeTargetKeyOrder,\n} from '../nx';\nimport { getRelativePathToRoot } from '../paths';\nimport { withVersions } from '../versions';\n\nexport interface AddPythonBundleTargetOptions {\n /**\n * Python platform\n * @default x86_64-manylinux_2_28\n */\n pythonPlatform?: 'x86_64-manylinux_2_28' | 'aarch64-manylinux_2_28';\n}\n\ninterface CreatePythonBundleTargetOptions\n extends Required<AddPythonBundleTargetOptions> {\n /**\n * Python package name\n */\n packageName: string;\n\n /**\n * Name of the bundle target, used for the outdir for the bundle\n */\n bundleTargetName: string;\n}\n\n/**\n * Create a target for bundling a python project\n */\nconst createPythonBundleTarget = ({\n packageName,\n pythonPlatform,\n bundleTargetName,\n}: CreatePythonBundleTargetOptions): TargetConfiguration => {\n return {\n cache: true,\n inputs: ['default', '^production'],\n executor: 'nx:run-commands',\n outputs: [`{workspaceRoot}/dist/{projectRoot}/${bundleTargetName}`],\n options: {\n commands: [\n `uv export --frozen --no-dev --no-editable --project {projectRoot} --package ${packageName} -o dist/{projectRoot}/${bundleTargetName}/requirements.txt`,\n `uv pip install -n --no-deps --no-installer-metadata --no-compile-bytecode --python-platform ${pythonPlatform} --target dist/{projectRoot}/${bundleTargetName} -r dist/{projectRoot}/${bundleTargetName}/requirements.txt`,\n ],\n parallel: false,\n },\n };\n};\n\n/**\n * Adds a bundle target to the given project if it does not exist, and updates the build target to depend on it\n */\nexport const addPythonBundleTarget = (\n project: ProjectConfiguration,\n opts?: AddPythonBundleTargetOptions,\n) => {\n if (!project.targets) {\n project.targets = {};\n }\n\n const pythonPlatform = opts?.pythonPlatform ?? 'x86_64-manylinux_2_28';\n const bundleTargetName =\n pythonPlatform === 'aarch64-manylinux_2_28' ? 'bundle-arm' : 'bundle-x86';\n\n if (!project.targets?.[bundleTargetName]) {\n project.targets[bundleTargetName] = normalizeTargetKeyOrder({\n ...createPythonBundleTarget({\n packageName: project.name,\n pythonPlatform,\n bundleTargetName,\n }),\n dependsOn: ['compile'],\n });\n }\n\n // Add a \"bundle\" target which depends on either bundle-arm or bundle-x86 (or both)\n addDependencyToTargetIfNotPresent(project, 'bundle', bundleTargetName);\n addDependencyToTargetIfNotPresent(project, 'build', 'bundle');\n\n return {\n bundleTargetName,\n bundleOutputDir: joinPathFragments('dist', project.root, bundleTargetName),\n };\n};\n\nexport interface AddTypeScriptBundleTargetOptions {\n /**\n * Path to the target file relative to the project dir\n */\n targetFilePath: string;\n\n /**\n * Sub directory to write bundled index.js file to (if any)\n * Outputs to dist/{projectRoot}/bundle/{bundleOutputDir}/index.js\n */\n bundleOutputDir?: string;\n\n /**\n * Modules to omit from the bundle and treat as external\n */\n external?: (string | RegExp)[];\n\n /**\n * Target platform for the bundle\n * @default 'node'\n */\n platform?: 'node' | 'browser' | 'neutral';\n}\n\n/**\n * Add a TypeScript bundle target using rolldown\n */\nexport const addTypeScriptBundleTarget = async (\n tree: Tree,\n project: ProjectConfiguration,\n opts: AddTypeScriptBundleTargetOptions,\n) => {\n project.targets ??= {};\n\n // Generate empty rolldown config if it doesn't exist\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'ts'),\n project.root,\n {},\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n\n // Add the bundle target\n if (!project.targets.bundle) {\n project.targets.bundle = normalizeTargetKeyOrder({\n cache: true,\n outputs: [`{workspaceRoot}/dist/{projectRoot}/bundle`],\n executor: 'nx:run-commands',\n options: {\n command: 'rolldown -c rolldown.config.ts',\n cwd: '{projectRoot}',\n },\n dependsOn: ['compile'],\n });\n }\n\n // Add bundle to the build target\n addDependencyToTargetIfNotPresent(project, 'build', 'bundle');\n\n const rolldownConfigPath = joinPathFragments(\n project.root,\n 'rolldown.config.ts',\n );\n\n const outputFile = joinPathFragments(\n getRelativePathToRoot(tree, project.name),\n 'dist',\n project.root,\n 'bundle',\n opts.bundleOutputDir ?? '.',\n 'index.js',\n );\n\n const external = opts.external?.length\n ? opts.external\n .map((ext) =>\n typeof ext === 'string' ? `'${ext}'` : `/${ext.source}/`,\n )\n .join(', ')\n : '';\n\n const entry = `{\n tsconfig: 'tsconfig.lib.json',\n input: '${opts.targetFilePath}',\n output: { file: '${outputFile}', format: 'cjs', inlineDynamicImports: true },\n platform: '${opts.platform ?? 'node'}',\n ${external ? `external: [${external}],` : ''}\n }`;\n\n // Use GritQL to append the config entry to the defineConfig array.\n // First try the non-empty array case using the accumulate (+=) operator,\n // with an idempotency guard that checks the input path is not already present.\n const appended = await applyGritQL(\n tree,\n rolldownConfigPath,\n `\\`defineConfig([$items])\\` where { $items <: not contains \\`'${opts.targetFilePath}'\\`, $items += \", ${entry}\" }`,\n );\n\n if (!appended) {\n // Empty array — GritQL's += cannot accumulate into an empty list, so we\n // first insert a placeholder to make the array non-empty, then replace\n // the placeholder with the real entry via += (which handles regex\n // literals that are invalid inside GritQL backtick snippets).\n const inserted = await applyGritQL(\n tree,\n rolldownConfigPath,\n `\\`defineConfig([])\\` => \\`defineConfig([__PLACEHOLDER__])\\``,\n );\n if (inserted) {\n await applyGritQL(\n tree,\n rolldownConfigPath,\n `\\`defineConfig([$items])\\` where { $items <: \\`__PLACEHOLDER__\\` => ., $items += \"${entry}\" }`,\n );\n }\n }\n\n addDependenciesToPackageJson(tree, {}, withVersions(['rolldown']));\n};\n"],"names":["addDependenciesToPackageJson","generateFiles","joinPathFragments","OverwriteStrategy","applyGritQL","addDependencyToTargetIfNotPresent","normalizeTargetKeyOrder","getRelativePathToRoot","withVersions","createPythonBundleTarget","packageName","pythonPlatform","bundleTargetName","cache","inputs","executor","outputs","options","commands","parallel","addPythonBundleTarget","project","opts","targets","name","dependsOn","bundleOutputDir","root","addTypeScriptBundleTarget","tree","dirname","overwriteStrategy","KeepExisting","bundle","command","cwd","rolldownConfigPath","outputFile","external","length","map","ext","source","join","entry","targetFilePath","platform","appended","inserted"],"mappings":"AAAA;;;CAGC,GAED,SACEA,4BAA4B,EAC5BC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,QAIZ,aAAa;AACpB,SAASC,WAAW,QAAQ,YAAS;AACrC,SACEC,iCAAiC,EACjCC,uBAAuB,QAClB,WAAQ;AACf,SAASC,qBAAqB,QAAQ,cAAW;AACjD,SAASC,YAAY,QAAQ,iBAAc;AAuB3C;;CAEC,GACD,MAAMC,2BAA2B,CAAC,EAChCC,WAAW,EACXC,cAAc,EACdC,gBAAgB,EACgB;IAChC,OAAO;QACLC,OAAO;QACPC,QAAQ;YAAC;YAAW;SAAc;QAClCC,UAAU;QACVC,SAAS;YAAC,CAAC,mCAAmC,EAAEJ,kBAAkB;SAAC;QACnEK,SAAS;YACPC,UAAU;gBACR,CAAC,4EAA4E,EAAER,YAAY,uBAAuB,EAAEE,iBAAiB,iBAAiB,CAAC;gBACvJ,CAAC,4FAA4F,EAAED,eAAe,6BAA6B,EAAEC,iBAAiB,uBAAuB,EAAEA,iBAAiB,iBAAiB,CAAC;aAC3N;YACDO,UAAU;QACZ;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CACnCC,SACAC;IAEA,IAAI,CAACD,QAAQE,OAAO,EAAE;QACpBF,QAAQE,OAAO,GAAG,CAAC;IACrB;IAEA,MAAMZ,iBAAiBW,MAAMX,kBAAkB;IAC/C,MAAMC,mBACJD,mBAAmB,2BAA2B,eAAe;IAE/D,IAAI,CAACU,QAAQE,OAAO,EAAE,CAACX,iBAAiB,EAAE;QACxCS,QAAQE,OAAO,CAACX,iBAAiB,GAAG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