@aws/nx-plugin 1.0.0-rc.0 → 1.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-THIRD-PARTY +3399 -4104
- package/README.md +8 -8
- package/executors.json +9 -0
- package/generators.json +44 -5
- package/package.json +16 -12
- package/sdk/license.d.ts +8 -0
- package/sdk/license.js +13 -0
- package/sdk/license.js.map +1 -0
- package/src/connection/agent-runtime-config.d.ts +1 -1
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/agent-serve-local.d.ts +2 -2
- package/src/connection/agent-serve-local.js +1 -1
- package/src/connection/agent-serve-local.js.map +1 -1
- package/src/connection/generator.d.ts +5 -5
- package/src/connection/generator.js +58 -39
- package/src/connection/generator.js.map +1 -1
- package/src/connection/serve-local.d.ts +1 -1
- package/src/connection/serve-local.js +1 -1
- package/src/connection/serve-local.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +49 -60
- package/src/infra/app/files/app/src/main.ts.template +2 -2
- package/src/infra/app/generator.d.ts +3 -3
- package/src/infra/app/generator.js +25 -23
- package/src/infra/app/generator.js.map +1 -1
- package/src/infra/app/schema.d.ts +1 -1
- package/src/infra/app/schema.json +1 -1
- package/src/license/__snapshots__/config.spec.ts.snap +23 -0
- package/src/license/config-types.d.ts +18 -1
- package/src/license/config-types.js +4 -0
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +65 -7
- package/src/license/config.js +315 -7
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/check.d.ts +16 -0
- package/src/license/dependency-check/check.js +111 -0
- package/src/license/dependency-check/check.js.map +1 -0
- package/src/license/dependency-check/collectors/collector.d.ts +21 -0
- package/src/license/dependency-check/collectors/collector.js +76 -0
- package/src/license/dependency-check/collectors/collector.js.map +1 -0
- package/src/license/dependency-check/collectors/npm-collector.d.ts +10 -0
- package/src/license/dependency-check/collectors/npm-collector.js +75 -0
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -0
- package/src/license/dependency-check/collectors/python-collector.d.ts +23 -0
- package/src/license/dependency-check/collectors/python-collector.js +121 -0
- package/src/license/dependency-check/collectors/python-collector.js.map +1 -0
- package/src/license/dependency-check/evaluator.d.ts +9 -0
- package/src/license/dependency-check/evaluator.js +122 -0
- package/src/license/dependency-check/evaluator.js.map +1 -0
- package/src/license/dependency-check/executor-schema.json +6 -0
- package/src/license/dependency-check/executor.d.ts +9 -0
- package/src/license/dependency-check/executor.js +43 -0
- package/src/license/dependency-check/executor.js.map +1 -0
- package/src/license/dependency-check/pre-approved.d.ts +6 -0
- package/src/license/dependency-check/pre-approved.js +1280 -0
- package/src/license/dependency-check/pre-approved.js.map +1 -0
- package/src/license/dependency-check/types.d.ts +45 -0
- package/src/license/dependency-check/types.js +7 -0
- package/src/license/dependency-check/types.js.map +1 -0
- package/src/license/generator.d.ts +3 -3
- package/src/license/generator.js +113 -14
- package/src/license/generator.js.map +1 -1
- package/src/license/index.d.ts +8 -0
- package/src/license/index.js +13 -0
- package/src/license/index.js.map +1 -0
- package/src/license/known-exceptions.d.ts +7 -0
- package/src/license/known-exceptions.js +33 -0
- package/src/license/known-exceptions.js.map +1 -0
- package/src/license/schema.d.ts +5 -0
- package/src/license/schema.json +6 -0
- package/src/license/sync/generator.d.ts +2 -2
- package/src/license/sync/generator.js +15 -15
- package/src/license/sync/generator.js.map +1 -1
- package/src/license/sync/project-file-sync.d.ts +3 -3
- package/src/license/sync/project-file-sync.js.map +1 -1
- package/src/mcp-server/generator-info.d.ts +5 -1
- package/src/mcp-server/generator-info.js +7 -7
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/guide-pipeline.d.ts +1 -1
- package/src/mcp-server/guide-pipeline.js +10 -12
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/mdx-ast.js +4 -0
- package/src/mcp-server/mdx-ast.js.map +1 -1
- package/src/mcp-server/server.js +3 -3
- package/src/mcp-server/server.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.d.ts +1 -1
- package/src/mcp-server/tools/create-workspace-command.js +5 -5
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/general-guidance.d.ts +2 -2
- package/src/mcp-server/tools/general-guidance.js +2 -2
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.d.ts +2 -2
- package/src/mcp-server/tools/generator-guide.js +2 -2
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/mcp-server/tools/list-generators.d.ts +2 -2
- package/src/mcp-server/tools/list-generators.js +1 -1
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +1 -1
- package/src/open-api/ts-client/generator.d.ts +3 -3
- package/src/open-api/ts-client/generator.js +2 -2
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.d.ts +3 -3
- package/src/open-api/ts-hooks/generator.js +2 -2
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.spec.tsx +14 -14
- package/src/open-api/ts-metadata/generator.d.ts +3 -3
- package/src/open-api/ts-metadata/generator.js +1 -1
- package/src/open-api/ts-metadata/generator.js.map +1 -1
- package/src/open-api/utils/codegen-data/languages.d.ts +5 -1
- package/src/open-api/utils/codegen-data/languages.js +4 -4
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data.d.ts +6 -2
- package/src/open-api/utils/codegen-data.js +6 -6
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.d.ts +5 -1
- package/src/open-api/utils/normalise.js +5 -5
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parse.d.ts +2 -2
- package/src/open-api/utils/parse.js +4 -0
- package/src/open-api/utils/parse.js.map +1 -1
- package/src/open-api/utils/refs.d.ts +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +128 -14
- package/src/preset/generator.d.ts +4 -4
- package/src/preset/generator.js +24 -19
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.ts +7 -5
- package/src/preset/schema.json +9 -4
- package/src/py/agent/__snapshots__/generator.spec.ts.snap +10 -9
- package/src/py/agent/a2a-connection/generator.d.ts +3 -3
- package/src/py/agent/a2a-connection/generator.js +8 -7
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/files/common/agent.py.template +2 -0
- package/src/py/agent/files/deploy/Dockerfile.template +3 -3
- package/src/py/agent/files/http/init.py.template +2 -2
- package/src/py/agent/files/http/main.py.template +0 -1
- package/src/py/agent/generator.d.ts +3 -3
- package/src/py/agent/generator.js +45 -39
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +4 -0
- package/src/py/agent/mcp-connection/generator.d.ts +3 -3
- package/src/py/agent/mcp-connection/generator.js +5 -5
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/agent/react-connection/generator.d.ts +3 -3
- package/src/py/agent/react-connection/generator.js +8 -8
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/serve-local.d.ts +2 -2
- package/src/py/agent/react-connection/serve-local.js.map +1 -1
- package/src/py/agent/schema.d.ts +8 -8
- package/src/py/agent/schema.json +18 -18
- package/src/py/api/generator.d.ts +3 -3
- package/src/py/api/generator.js +2 -2
- package/src/py/api/generator.js.map +1 -1
- package/src/py/api/schema.d.ts +4 -6
- package/src/py/api/schema.json +15 -15
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/py/fast-api/generator.d.ts +3 -3
- package/src/py/fast-api/generator.js +73 -55
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/generator.d.ts +3 -3
- package/src/py/fast-api/react/generator.js +3 -3
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/open-api.d.ts +1 -1
- package/src/py/fast-api/react/open-api.js +5 -2
- package/src/py/fast-api/react/open-api.js.map +1 -1
- package/src/py/fast-api/schema.d.ts +4 -6
- package/src/py/fast-api/schema.json +15 -15
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/lambda-function/files/handler/__lambdaFunctionSnakeCase__.py.template +6 -6
- package/src/py/lambda-function/generator.d.ts +3 -3
- package/src/py/lambda-function/generator.js +34 -31
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.ts +7 -4
- package/src/py/lambda-function/schema.json +15 -7
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/mcp-server/generator.d.ts +3 -3
- package/src/py/mcp-server/generator.js +44 -37
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/mcp-server/schema.d.ts +5 -9
- package/src/py/mcp-server/schema.json +15 -15
- package/src/py/project/generator.d.ts +3 -3
- package/src/py/project/generator.js +88 -69
- package/src/py/project/generator.js.map +1 -1
- package/src/py/project/schema.d.ts +1 -1
- package/src/py/project/schema.json +2 -2
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +18 -16
- package/src/smithy/project/files/build.Dockerfile.template +1 -0
- package/src/smithy/project/generator.d.ts +3 -3
- package/src/smithy/project/generator.js +31 -29
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/react-connection/generator.d.ts +3 -3
- package/src/smithy/react-connection/generator.js +4 -4
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +12 -38
- package/src/smithy/ts/api/generator.d.ts +3 -3
- package/src/smithy/ts/api/generator.js +89 -66
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/smithy/ts/api/schema.d.ts +4 -6
- package/src/smithy/ts/api/schema.json +15 -15
- package/src/terraform/project/generator.d.ts +3 -3
- package/src/terraform/project/generator.js +14 -9
- package/src/terraform/project/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/trpc/backend/files/src/client/index.ts.template +5 -5
- package/src/trpc/backend/files/src/handler.ts.template +2 -2
- package/src/trpc/backend/generator.d.ts +3 -3
- package/src/trpc/backend/generator.js +80 -61
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +5 -5
- package/src/trpc/backend/schema.json +15 -15
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/trpc/react/files/src/components/__apiNameClassName__ClientProvider.tsx.template +14 -14
- package/src/trpc/react/generator.d.ts +3 -3
- package/src/trpc/react/generator.js +11 -10
- package/src/trpc/react/generator.js.map +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +11 -5
- package/src/ts/agent/a2a-connection/generator.d.ts +3 -3
- package/src/ts/agent/a2a-connection/generator.js +9 -8
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/common/agent.ts.template +6 -2
- package/src/ts/agent/files/deploy/Dockerfile.template +1 -1
- package/src/ts/agent/generator.d.ts +3 -3
- package/src/ts/agent/generator.js +40 -35
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +5 -2
- package/src/ts/agent/mcp-connection/generator.d.ts +3 -3
- package/src/ts/agent/mcp-connection/generator.js +6 -6
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/files/src/components/__agentNameClassName__AgentClientProvider.tsx.template +8 -8
- package/src/ts/agent/react-connection/generator.d.ts +3 -3
- package/src/ts/agent/react-connection/generator.js +15 -15
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/serve-local.d.ts +2 -2
- package/src/ts/agent/react-connection/serve-local.js +2 -2
- package/src/ts/agent/schema.d.ts +8 -8
- package/src/ts/agent/schema.json +18 -18
- package/src/ts/api/generator.d.ts +3 -3
- package/src/ts/api/generator.js +10 -8
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.ts +5 -4
- package/src/ts/api/schema.json +15 -15
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +7 -8
- package/src/ts/astro-docs/generator.d.ts +3 -3
- package/src/ts/astro-docs/generator.js +14 -11
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/docs/generator.d.ts +3 -3
- package/src/ts/docs/generator.js.map +1 -1
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +1502 -0
- package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/agent-connection/generator.js +32 -0
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/agent-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/agent-connection/schema.json +22 -0
- package/src/ts/dynamodb/files/scripts/create-local-table.ts.template +161 -0
- package/src/ts/dynamodb/files/scripts/start-container.ts.template +81 -0
- package/src/ts/dynamodb/files/src/client.ts.template +45 -0
- package/src/ts/dynamodb/files/src/constants.ts.template +9 -0
- package/src/ts/dynamodb/files/src/entities/example.ts.template +47 -0
- package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -0
- package/src/ts/dynamodb/files/src/gsi.ts.template +14 -0
- package/src/ts/dynamodb/files/src/index.ts.template +11 -0
- package/src/ts/dynamodb/generator.d.ts +10 -0
- package/src/ts/dynamodb/generator.js +106 -0
- package/src/ts/dynamodb/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js +32 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.json +22 -0
- package/src/ts/dynamodb/schema.d.ts +14 -0
- package/src/ts/dynamodb/schema.json +52 -0
- package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/smithy-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/smithy-connection/generator.js +30 -0
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/smithy-connection/schema.json +18 -0
- package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/trpc-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/trpc-connection/generator.js +30 -0
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/trpc-connection/schema.json +18 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/lambda-function/files/handler/__lambdaFunctionKebabCase__.ts.template +10 -10
- package/src/ts/lambda-function/generator.d.ts +3 -3
- package/src/ts/lambda-function/generator.js +41 -36
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/schema.d.ts +7 -4
- package/src/ts/lambda-function/schema.json +15 -7
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +32 -65
- package/src/ts/lib/__snapshots__/vitest.spec.ts.snap +24 -0
- package/src/ts/lib/biome.d.ts +7 -0
- package/src/ts/lib/biome.js +58 -0
- package/src/ts/lib/biome.js.map +1 -0
- package/src/ts/lib/generator.d.ts +3 -3
- package/src/ts/lib/generator.js +27 -29
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/grit/vitest-pass-with-no-tests.grit +1 -1
- package/src/ts/lib/ts-project-utils.d.ts +12 -2
- package/src/ts/lib/ts-project-utils.js +30 -10
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/vitest.d.ts +2 -2
- package/src/ts/lib/vitest.js +1 -1
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/mcp-server/generator.d.ts +3 -3
- package/src/ts/mcp-server/generator.js +46 -24
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/mcp-server/schema.d.ts +5 -9
- package/src/ts/mcp-server/schema.json +15 -15
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +20 -15
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.spec.ts.template +1 -1
- package/src/ts/nx-generator/generator.d.ts +2 -2
- package/src/ts/nx-generator/generator.js +23 -19
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-plugin/generator.d.ts +3 -3
- package/src/ts/nx-plugin/generator.js +12 -11
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/utils.d.ts +1 -1
- package/src/ts/nx-plugin/utils.js +10 -4
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +120 -60
- package/src/ts/rdb/agent-connection/generator.d.ts +3 -3
- package/src/ts/rdb/agent-connection/generator.js +4 -4
- package/src/ts/rdb/agent-connection/generator.js.map +1 -1
- package/src/ts/rdb/files/prisma.config.ts.template +1 -1
- package/src/ts/rdb/files/scripts/pull-image.ts.template +15 -0
- package/src/ts/rdb/files/scripts/{docker-start.ts.template → start-container.ts.template} +24 -24
- package/src/ts/rdb/files/scripts/wait-for-db.ts.template +3 -3
- package/src/ts/rdb/files/src/create-db-user-handler.ts.template +2 -2
- package/src/ts/rdb/files/src/migration-handler.ts.template +2 -2
- package/src/ts/rdb/files/src/prisma.ts.template +2 -2
- package/src/ts/rdb/generator.d.ts +3 -3
- package/src/ts/rdb/generator.js +103 -82
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/generator.d.ts +3 -3
- package/src/ts/rdb/mcp-server-connection/generator.js +4 -4
- package/src/ts/rdb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/rdb/schema.d.ts +5 -5
- package/src/ts/rdb/schema.json +13 -13
- package/src/ts/rdb/smithy-connection/generator.d.ts +3 -3
- package/src/ts/rdb/smithy-connection/generator.js +4 -4
- package/src/ts/rdb/smithy-connection/generator.js.map +1 -1
- package/src/ts/rdb/trpc-connection/files/src/middleware/__rdbNameKebab__.ts.template +1 -1
- package/src/ts/rdb/trpc-connection/generator.d.ts +3 -3
- package/src/ts/rdb/trpc-connection/generator.js +3 -3
- package/src/ts/rdb/trpc-connection/generator.js.map +1 -1
- package/src/ts/rdb/utils.d.ts +1 -1
- package/src/ts/react-website/agui/files/common/src/hooks/useAgui__agentNameClassName__.tsx.template +9 -9
- package/src/ts/react-website/agui/generator.d.ts +3 -3
- package/src/ts/react-website/agui/generator.js +13 -13
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +423 -386
- package/src/ts/react-website/app/files/app/cloudscape/src/components/AppLayout/index.tsx.template +5 -5
- package/src/ts/react-website/app/files/app/cloudscape/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/files/app/cloudscape/src/styles.css.template +1 -1
- package/src/ts/react-website/app/files/app/none/src/components/AppLayout/index.tsx.template +5 -5
- package/src/ts/react-website/app/files/app/none/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/files/app/none/src/styles.css.template +2 -2
- package/src/ts/react-website/app/files/app/shadcn/src/components/AppLayout/index.tsx.template +6 -6
- package/src/ts/react-website/app/files/app/shadcn/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/generator.d.ts +6 -6
- package/src/ts/react-website/app/generator.js +124 -114
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.ts +9 -6
- package/src/ts/react-website/app/schema.json +13 -13
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +1 -7
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +3 -3
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.ux-provider.spec.ts.snap +3 -23
- package/src/ts/react-website/cognito-auth/generator.d.ts +3 -3
- package/src/ts/react-website/cognito-auth/generator.js +19 -22
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/grit/cloudscape-auth-menu.grit +8 -6
- package/src/ts/react-website/cognito-auth/grit/cognito-auth-wrapper.grit +1 -1
- package/src/ts/react-website/cognito-auth/grit/none-auth-menu.grit +1 -0
- package/src/ts/react-website/cognito-auth/grit/shadcn-auth-menu.grit +3 -1
- package/src/ts/react-website/cognito-auth/grit/shadcn-state-declarations.grit +3 -1
- package/src/ts/react-website/cognito-auth/schema.d.ts +2 -2
- package/src/ts/react-website/cognito-auth/schema.json +4 -4
- package/src/ts/react-website/cognito-auth/utils.d.ts +1 -1
- package/src/ts/react-website/cognito-auth/utils.js +1 -1
- package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
- package/src/ts/react-website/runtime-config/generator.d.ts +3 -3
- package/src/ts/react-website/runtime-config/generator.js +4 -4
- package/src/ts/react-website/runtime-config/generator.js.map +1 -1
- package/src/ts/sync/generator.d.ts +3 -3
- package/src/ts/sync/generator.js +2 -2
- package/src/ts/sync/generator.js.map +1 -1
- package/src/ts/website/app/generator.d.ts +3 -3
- package/src/ts/website/app/generator.js +1 -1
- package/src/ts/website/app/generator.js.map +1 -1
- package/src/ts/website/app/schema.d.ts +8 -6
- package/src/ts/website/app/schema.json +21 -13
- package/src/ts/website/auth/generator.d.ts +3 -3
- package/src/ts/website/auth/generator.js +2 -2
- package/src/ts/website/auth/generator.js.map +1 -1
- package/src/ts/website/auth/schema.d.ts +2 -2
- package/src/ts/website/auth/schema.json +4 -4
- package/src/utils/agent-connection/agent-connection.d.ts +1 -1
- package/src/utils/agent-connection/agent-connection.js +17 -11
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-runtime-config/model-errors.ts.template +36 -0
- package/src/utils/agent-connection/files/py-core-runtime-config/model_errors.py.template +40 -0
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +10 -10
- package/src/utils/agent-core-constructs/agent-core-constructs.js +14 -24
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +13 -13
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +5 -5
- package/src/utils/api-constructs/api-constructs.d.ts +4 -4
- package/src/utils/api-constructs/api-constructs.js +5 -7
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +12 -12
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +12 -12
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +7 -7
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +10 -10
- package/src/utils/api-constructs/open-api-metadata.d.ts +4 -4
- package/src/utils/api-constructs/open-api-metadata.js +2 -2
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
- package/src/utils/ast/website.d.ts +5 -1
- package/src/utils/ast/website.js +3 -3
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.d.ts +33 -1
- package/src/utils/ast.js +89 -4
- package/src/utils/ast.js.map +1 -1
- package/src/utils/bundle/bundle.d.ts +1 -1
- package/src/utils/bundle/bundle.js +2 -2
- package/src/utils/bundle/bundle.js.map +1 -1
- package/src/utils/commands.d.ts +1 -1
- package/src/utils/commands.js +2 -2
- package/src/utils/commands.js.map +1 -1
- package/src/utils/config/__snapshots__/utils.spec.ts.snap +6 -6
- package/src/utils/config/index.d.ts +5 -5
- package/src/utils/config/utils.d.ts +13 -3
- package/src/utils/config/utils.js +37 -5
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +7 -7
- package/src/utils/connection/open-api/react.d.ts +2 -2
- package/src/utils/connection/open-api/react.js +7 -7
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/containers.d.ts +6 -6
- package/src/utils/containers.js +6 -6
- package/src/utils/containers.js.map +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.d.ts +18 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +49 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -0
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +30 -0
- package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +105 -0
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +65 -0
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +155 -0
- package/src/utils/format.d.ts +45 -2
- package/src/utils/format.js +167 -46
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.d.ts +1 -1
- package/src/utils/fs.js.map +1 -1
- package/src/utils/function-constructs/files/cdk/app/lambda-functions/{__functionNameKebabCase__.ts.template → __nameKebabCase__.ts.template} +1 -1
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/{__functionNameKebabCase__/__functionNameKebabCase__.tf.template → __nameKebabCase__/__nameKebabCase__.tf.template} +7 -7
- package/src/utils/function-constructs/function-constructs.d.ts +5 -5
- package/src/utils/function-constructs/function-constructs.js +6 -8
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.d.ts +4 -0
- package/src/utils/generators.js +4 -4
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.d.ts +1 -1
- package/src/utils/git.js.map +1 -1
- package/src/utils/iac-providers.d.ts +3 -3
- package/src/utils/iac-providers.js +1 -1
- package/src/utils/iac.d.ts +3 -3
- package/src/utils/iac.js +6 -6
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +1 -5
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +2 -4
- package/src/utils/identity-constructs/identity-constructs.d.ts +3 -3
- package/src/utils/identity-constructs/identity-constructs.js +4 -4
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/js.d.ts +4 -0
- package/src/utils/js.js +4 -4
- package/src/utils/js.js.map +1 -1
- package/src/utils/mcp.d.ts +25 -0
- package/src/utils/mcp.js +81 -0
- package/src/utils/mcp.js.map +1 -0
- package/src/utils/metrics.d.ts +9 -3
- package/src/utils/metrics.js +58 -28
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/npm-scope.d.ts +1 -1
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +7 -2
- package/src/utils/nx.js +46 -14
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.d.ts +1 -1
- package/src/utils/paths.d.ts +1 -1
- package/src/utils/pnpm-workspace.d.ts +1 -1
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.d.ts +30 -3
- package/src/utils/port.js +72 -4
- package/src/utils/port.js.map +1 -1
- package/src/utils/py.d.ts +2 -2
- package/src/utils/py.js +13 -6
- package/src/utils/py.js.map +1 -1
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +30 -1
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +18 -9
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +5 -5
- package/src/utils/rdb-constructs/rdb-constructs.js +7 -17
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs.d.ts +3 -3
- package/src/utils/shared-constructs.js +10 -10
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-infra-config.d.ts +1 -1
- package/src/utils/shared-infra-config.js +1 -1
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-scripts.d.ts +1 -1
- package/src/utils/shared-scripts.js +2 -2
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.d.ts +1 -1
- package/src/utils/shared-shadcn.js +1 -13
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +5 -1
- package/src/utils/test.js +9 -5
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.d.ts +1 -1
- package/src/utils/toml.js +4 -0
- package/src/utils/toml.js.map +1 -1
- package/src/utils/versions.d.ts +68 -72
- package/src/utils/versions.js +67 -71
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +52 -5
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +38 -11
- package/src/utils/website-constructs/website-constructs.d.ts +3 -3
- package/src/utils/website-constructs/website-constructs.js +5 -7
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- package/src/ts/lib/eslint.d.ts +0 -14
- package/src/ts/lib/eslint.js +0 -90
- package/src/ts/lib/eslint.js.map +0 -1
- package/src/ts/lib/grit/eslint-dependency-checks-warn.grit +0 -1
- /package/src/ts/{rdb/files/scripts/docker-pull.ts.template → dynamodb/files/scripts/pull-image.ts.template} +0 -0
|
@@ -7,32 +7,28 @@ const tslib_1 = require("tslib");
|
|
|
7
7
|
* SPDX-License-Identifier: Apache-2.0
|
|
8
8
|
*/
|
|
9
9
|
const devkit_1 = require("@nx/devkit");
|
|
10
|
-
const nxlv_python_1 = require("../../utils/nxlv-python");
|
|
11
|
-
const generator_1 = tslib_1.__importStar(require("../project/generator"));
|
|
12
|
-
const shared_constructs_1 = require("../../utils/shared-constructs");
|
|
13
|
-
const names_1 = require("../../utils/names");
|
|
14
|
-
const format_1 = require("../../utils/format");
|
|
15
|
-
const object_1 = require("../../utils/object");
|
|
16
|
-
const nx_1 = require("../../utils/nx");
|
|
17
|
-
const metrics_1 = require("../../utils/metrics");
|
|
18
10
|
const api_constructs_1 = require("../../utils/api-constructs/api-constructs");
|
|
11
|
+
const open_api_metadata_1 = require("../../utils/api-constructs/open-api-metadata");
|
|
12
|
+
const bundle_1 = require("../../utils/bundle/bundle");
|
|
13
|
+
const format_1 = require("../../utils/format");
|
|
19
14
|
const fs_1 = require("../../utils/fs");
|
|
20
|
-
const
|
|
15
|
+
const iac_1 = require("../../utils/iac");
|
|
16
|
+
const metrics_1 = require("../../utils/metrics");
|
|
17
|
+
const names_1 = require("../../utils/names");
|
|
18
|
+
const nx_1 = require("../../utils/nx");
|
|
19
|
+
const nxlv_python_1 = require("../../utils/nxlv-python");
|
|
20
|
+
const object_1 = require("../../utils/object");
|
|
21
21
|
const port_1 = require("../../utils/port");
|
|
22
|
-
const bundle_1 = require("../../utils/bundle/bundle");
|
|
23
22
|
const py_1 = require("../../utils/py");
|
|
24
|
-
const
|
|
25
|
-
const
|
|
23
|
+
const shared_constructs_1 = require("../../utils/shared-constructs");
|
|
24
|
+
const generator_1 = tslib_1.__importStar(require("../project/generator"));
|
|
25
|
+
const open_api_1 = require("./react/open-api");
|
|
26
26
|
exports.FAST_API_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
27
27
|
/**
|
|
28
28
|
* Generates a Python FastAPI project
|
|
29
29
|
*/
|
|
30
30
|
const pyFastApiProjectGenerator = async (tree, schema) => {
|
|
31
31
|
const integrationPattern = getIntegrationPattern(schema);
|
|
32
|
-
const iacProvider = await (0, iac_1.resolveIacProvider)(tree, schema.iacProvider);
|
|
33
|
-
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
34
|
-
iacProvider,
|
|
35
|
-
});
|
|
36
32
|
const { dir, normalizedModuleName, fullyQualifiedName } = (0, generator_1.getPyProjectDetails)(tree, {
|
|
37
33
|
name: schema.name,
|
|
38
34
|
directory: schema.directory,
|
|
@@ -41,23 +37,36 @@ const pyFastApiProjectGenerator = async (tree, schema) => {
|
|
|
41
37
|
});
|
|
42
38
|
const apiNameKebabCase = (0, names_1.toKebabCase)(schema.name);
|
|
43
39
|
const apiNameClassName = (0, names_1.toClassName)(schema.name);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
let projectExists;
|
|
41
|
+
try {
|
|
42
|
+
(0, devkit_1.readProjectConfiguration)(tree, fullyQualifiedName);
|
|
43
|
+
projectExists = true;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
projectExists = false;
|
|
47
|
+
}
|
|
48
|
+
if (!projectExists) {
|
|
49
|
+
await (0, generator_1.default)(tree, {
|
|
50
|
+
name: schema.name,
|
|
51
|
+
directory: schema.directory,
|
|
52
|
+
subDirectory: schema.subDirectory,
|
|
53
|
+
moduleName: normalizedModuleName,
|
|
54
|
+
type: 'application',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
51
57
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, fullyQualifiedName);
|
|
52
58
|
const port = (0, port_1.assignPort)(tree, projectConfig, 8000);
|
|
53
59
|
const { bundleOutputDir, bundleTargetName } = (0, bundle_1.addPythonBundleTarget)(projectConfig);
|
|
54
60
|
// Add a command to copy run.sh to the bundle output for Lambda Web Adapter
|
|
55
61
|
const fs = new fs_1.FsCommands(tree);
|
|
56
62
|
const bundleTarget = projectConfig.targets[bundleTargetName];
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
const copyRunShCommand = fs.cp(`{projectRoot}/run.sh`, `dist/{projectRoot}/${bundleTargetName}/run.sh`);
|
|
64
|
+
if (!bundleTarget.options.commands.includes(copyRunShCommand)) {
|
|
65
|
+
bundleTarget.options.commands = [
|
|
66
|
+
...bundleTarget.options.commands,
|
|
67
|
+
copyRunShCommand,
|
|
68
|
+
];
|
|
69
|
+
}
|
|
61
70
|
projectConfig.targets.serve = {
|
|
62
71
|
executor: '@nxlv/python:run-commands',
|
|
63
72
|
options: {
|
|
@@ -67,6 +76,7 @@ const pyFastApiProjectGenerator = async (tree, schema) => {
|
|
|
67
76
|
continuous: true,
|
|
68
77
|
};
|
|
69
78
|
projectConfig.targets['serve-local'] = {
|
|
79
|
+
...projectConfig.targets['serve-local'],
|
|
70
80
|
...projectConfig.targets.serve,
|
|
71
81
|
options: {
|
|
72
82
|
...projectConfig.targets.serve.options,
|
|
@@ -89,49 +99,57 @@ const pyFastApiProjectGenerator = async (tree, schema) => {
|
|
|
89
99
|
(0, devkit_1.joinPathFragments)(dir, normalizedModuleName, 'hello.py'),
|
|
90
100
|
(0, devkit_1.joinPathFragments)(dir, 'tests', 'test_hello.py'),
|
|
91
101
|
].forEach((f) => tree.delete(f));
|
|
102
|
+
// User-owned source files: preserve any existing copies so re-running does
|
|
103
|
+
// not clobber user edits (and does not reformat them nondeterministically).
|
|
92
104
|
(0, devkit_1.generateFiles)(tree, // the virtual file system
|
|
93
105
|
(0, devkit_1.joinPathFragments)(__dirname, 'files', 'app'), // path to the file templates
|
|
94
106
|
dir, // destination path of the files
|
|
95
107
|
{
|
|
96
108
|
name: normalizedModuleName,
|
|
97
109
|
apiNameClassName,
|
|
98
|
-
|
|
110
|
+
infra: schema.infra,
|
|
99
111
|
}, {
|
|
100
|
-
overwriteStrategy: devkit_1.OverwriteStrategy.
|
|
112
|
+
overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting,
|
|
101
113
|
});
|
|
102
|
-
if (schema.
|
|
103
|
-
const
|
|
104
|
-
(0,
|
|
105
|
-
|
|
114
|
+
if (schema.infra !== 'none') {
|
|
115
|
+
const iac = await (0, iac_1.resolveIac)(tree, schema.iac);
|
|
116
|
+
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
117
|
+
iac,
|
|
118
|
+
});
|
|
119
|
+
if (schema.auth === 'custom') {
|
|
120
|
+
const authorizerType = schema.infra === 'http-lambda' ? 'http' : 'rest';
|
|
121
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', '..', 'utils', 'api-constructs', 'files', 'py-authorizer', authorizerType), (0, devkit_1.joinPathFragments)(dir, normalizedModuleName), {}, {
|
|
122
|
+
overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
// Add the CDK construct to deploy the FastAPI to shared constructs
|
|
126
|
+
await (0, api_constructs_1.addApiGatewayInfra)(tree, {
|
|
127
|
+
apiProjectName: projectConfig.name,
|
|
128
|
+
apiNameClassName,
|
|
129
|
+
apiNameKebabCase,
|
|
130
|
+
constructType: schema.infra === 'http-lambda' ? 'http' : 'rest',
|
|
131
|
+
backend: {
|
|
132
|
+
type: 'fastapi',
|
|
133
|
+
moduleName: normalizedModuleName,
|
|
134
|
+
bundleOutputDir,
|
|
135
|
+
integrationPattern,
|
|
136
|
+
},
|
|
137
|
+
auth: schema.auth,
|
|
138
|
+
iac,
|
|
139
|
+
});
|
|
140
|
+
(0, open_api_metadata_1.addSharedConstructsOpenApiMetadataGenerateTarget)(tree, {
|
|
141
|
+
iac,
|
|
142
|
+
apiNameKebabCase,
|
|
143
|
+
specPath,
|
|
144
|
+
specBuildTargetName: `${projectConfig.name}:openapi`,
|
|
106
145
|
});
|
|
107
146
|
}
|
|
108
|
-
// Add the CDK construct to deploy the FastAPI to shared constructs
|
|
109
|
-
await (0, api_constructs_1.addApiGatewayInfra)(tree, {
|
|
110
|
-
apiProjectName: projectConfig.name,
|
|
111
|
-
apiNameClassName,
|
|
112
|
-
apiNameKebabCase,
|
|
113
|
-
constructType: schema.computeType === 'ServerlessApiGatewayHttpApi' ? 'http' : 'rest',
|
|
114
|
-
backend: {
|
|
115
|
-
type: 'fastapi',
|
|
116
|
-
moduleName: normalizedModuleName,
|
|
117
|
-
bundleOutputDir,
|
|
118
|
-
integrationPattern,
|
|
119
|
-
},
|
|
120
|
-
auth: schema.auth,
|
|
121
|
-
iacProvider,
|
|
122
|
-
});
|
|
123
|
-
(0, open_api_metadata_1.addSharedConstructsOpenApiMetadataGenerateTarget)(tree, {
|
|
124
|
-
iacProvider,
|
|
125
|
-
apiNameKebabCase,
|
|
126
|
-
specPath,
|
|
127
|
-
specBuildTargetName: `${projectConfig.name}:openapi`,
|
|
128
|
-
});
|
|
129
147
|
(0, py_1.addDependenciesToPyProjectToml)(tree, dir, [
|
|
130
148
|
'fastapi',
|
|
131
149
|
'uvicorn',
|
|
132
150
|
'aws-lambda-powertools',
|
|
133
151
|
'aws-lambda-powertools[tracer]',
|
|
134
|
-
...(schema.auth === '
|
|
152
|
+
...(schema.auth === 'custom'
|
|
135
153
|
? ['aws-lambda-powertools[parser]']
|
|
136
154
|
: []),
|
|
137
155
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/fast-api/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAUoB;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/fast-api/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAUoB;AACpB,8EAA+E;AAC/E,oFAAgH;AAChH,sDAAkE;AAClE,+CAA0D;AAC1D,uCAA4C;AAC5C,yCAA6C;AAC7C,iDAAsE;AACtE,6CAA6D;AAC7D,uCAIwB;AACxB,yDAA6D;AAC7D,+CAAoD;AACpD,2CAA8C;AAC9C,uCAGwB;AACxB,qEAA0E;AAC1E,0EAA+E;AAC/E,+CAAwD;AAG3C,QAAA,uBAAuB,GAClC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAE/B;;GAEG;AACI,MAAM,yBAAyB,GAAG,KAAK,EAC5C,IAAU,EACV,MAAuC,EACX,EAAE;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O,KAAK,IAAI,EAAE;QAChB,MAAM,IAAI,wBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,oBAAM,EAAE,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAC9D,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AA1LW,QAAA,yBAAyB,6BA0LpC;AAEF,MAAM,qBAAqB,GAAG,CAC5B,MAAuC,EAChB,EAAE,CAAC,MAAM,CAAC,kBAAkB,IAAI,UAAU,CAAC;AAEpE,kBAAe,iCAAyB,CAAC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { Tree } from '@nx/devkit';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { type Tree } from '@nx/devkit';
|
|
6
|
+
import { type NxGeneratorInfo } from '../../../utils/nx';
|
|
7
|
+
import type { FastApiReactGeneratorSchema } from './schema';
|
|
8
8
|
export declare const FAST_API_REACT_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
9
|
export declare const fastApiReactGenerator: (tree: Tree, options: FastApiReactGeneratorSchema) => Promise<() => void>;
|
|
10
10
|
export default fastApiReactGenerator;
|
|
@@ -6,11 +6,11 @@ exports.fastApiReactGenerator = exports.FAST_API_REACT_GENERATOR_INFO = void 0;
|
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
*/
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
|
+
const react_1 = require("../../../utils/connection/open-api/react");
|
|
9
10
|
const format_1 = require("../../../utils/format");
|
|
10
|
-
const nx_1 = require("../../../utils/nx");
|
|
11
11
|
const metrics_1 = require("../../../utils/metrics");
|
|
12
|
+
const nx_1 = require("../../../utils/nx");
|
|
12
13
|
const open_api_1 = require("./open-api");
|
|
13
|
-
const react_1 = require("../../../utils/connection/open-api/react");
|
|
14
14
|
exports.FAST_API_REACT_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
15
15
|
const fastApiReactGenerator = async (tree, options) => {
|
|
16
16
|
const frontendProjectConfig = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.frontendProjectName);
|
|
@@ -21,7 +21,7 @@ const fastApiReactGenerator = async (tree, options) => {
|
|
|
21
21
|
});
|
|
22
22
|
const metadata = fastApiProjectConfig.metadata;
|
|
23
23
|
const apiName = metadata?.apiName;
|
|
24
|
-
const auth = metadata?.auth ?? '
|
|
24
|
+
const auth = (metadata?.auth ?? 'iam').toLowerCase();
|
|
25
25
|
const port = metadata?.port ?? metadata?.ports?.[0] ?? 8000;
|
|
26
26
|
await (0, react_1.addOpenApiReactClient)(tree, {
|
|
27
27
|
apiName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/py/fast-api/react/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/py/fast-api/react/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAA4D;AAC5D,oEAAiF;AACjF,kDAA6D;AAC7D,oDAAyE;AACzE,0CAI2B;AAC3B,yCAAkD;AAGrC,QAAA,6BAA6B,GACxC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,qBAAqB,GAAG,KAAK,EACxC,IAAU,EACV,OAAoC,EACpC,EAAE;IACF,MAAM,qBAAqB,GAAG,IAAA,wCAAmC,EAC/D,IAAI,EACJ,OAAO,CAAC,mBAAmB,CAC5B,CAAC;IACF,MAAM,oBAAoB,GAAG,IAAA,wCAAmC,EAC9D,IAAI,EACJ,OAAO,CAAC,kBAAkB,CAC3B,CAAC;IAEF,mEAAmE;IACnE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,+BAAoB,EAAC,IAAI,EAAE;QAC9C,OAAO,EAAE,oBAAoB;KAC9B,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,oBAAoB,CAAC,QAAe,CAAC;IACtD,MAAM,OAAO,GAAG,QAAQ,EAAE,OAAO,CAAC;IAClC,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,IAAI,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IACrD,MAAM,IAAI,GAAG,QAAQ,EAAE,IAAI,IAAI,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAE5D,MAAM,IAAA,6BAAqB,EAAC,IAAI,EAAE;QAChC,OAAO;QACP,qBAAqB;QACrB,oBAAoB,EAAE,oBAAoB;QAC1C,gBAAgB,EAAE,oBAAoB;QACtC,QAAQ;QACR,mBAAmB,EAAE,GAAG,oBAAoB,CAAC,IAAI,UAAU;QAC3D,IAAI;QACJ,IAAI;KACL,CAAC,CAAC;IAEH,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,qCAA6B,CAAC,CAAC,CAAC;IAE7E,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAxCW,QAAA,qBAAqB,yBAwChC;AAEF,kBAAe,6BAAqB,CAAC"}
|
|
@@ -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 AddOpenApiGenerationOptions {
|
|
7
7
|
project: ProjectConfiguration;
|
|
8
8
|
}
|
|
@@ -6,16 +6,19 @@ exports.addOpenApiGeneration = void 0;
|
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
*/
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
|
-
const object_1 = require("../../../utils/object");
|
|
10
9
|
const names_1 = require("../../../utils/names");
|
|
10
|
+
const object_1 = require("../../../utils/object");
|
|
11
11
|
/**
|
|
12
12
|
* Adds FastAPI -> OpenApi spec generation as part of the FastAPI project build
|
|
13
13
|
*/
|
|
14
14
|
const addOpenApiGeneration = (tree, { project }) => {
|
|
15
15
|
const moduleName = getFastApiModuleName(project);
|
|
16
|
-
// Add OpenAPI spec generation script to FastAPI spec
|
|
16
|
+
// Add OpenAPI spec generation script to FastAPI spec, preserving an existing
|
|
17
|
+
// copy so re-running does not reformat it nondeterministically
|
|
17
18
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files/fast-api'), project.root, {
|
|
18
19
|
moduleName,
|
|
20
|
+
}, {
|
|
21
|
+
overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting,
|
|
19
22
|
});
|
|
20
23
|
// Instrument the script as part of the fastapi project build
|
|
21
24
|
const fastApiOpenApiDist = (0, devkit_1.joinPathFragments)('dist', project.root, 'openapi');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-api.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/py/fast-api/react/open-api.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"open-api.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/py/fast-api/react/open-api.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAOoB;AACpB,gDAAiD;AACjD,kDAAuD;AAMvD;;GAEG;AACI,MAAM,oBAAoB,GAAG,CAClC,IAAU,EACV,EAAE,OAAO,EAA+B,EAClB,EAAE;IACxB,MAAM,UAAU,GAA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,EAAE,CAAC;QAC7B,MAAM,eAAe,GAAG,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5D,OAAO,eAAe,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,OAAO,GAAI,aAAa,CAAC,QAAgB,EAAE,OAAO,CAAC;IACzD,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,IAAA,iBAAS,EAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,KAAK,CAAC,8CAA8C,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC,CAAC"}
|
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IacOption } from '../../utils/iac';
|
|
7
7
|
|
|
8
8
|
export interface PyFastApiProjectGeneratorSchema {
|
|
9
9
|
readonly name: string;
|
|
10
|
-
readonly
|
|
11
|
-
| 'ServerlessApiGatewayRestApi'
|
|
12
|
-
| 'ServerlessApiGatewayHttpApi';
|
|
10
|
+
readonly infra: 'rest-lambda' | 'http-lambda' | 'none';
|
|
13
11
|
readonly integrationPattern?: 'isolated' | 'shared';
|
|
14
|
-
readonly auth: '
|
|
12
|
+
readonly auth: 'iam' | 'cognito' | 'custom';
|
|
15
13
|
readonly directory?: string;
|
|
16
14
|
readonly subDirectory?: string;
|
|
17
15
|
readonly moduleName?: string;
|
|
18
|
-
readonly
|
|
16
|
+
readonly iac: IacOption;
|
|
19
17
|
}
|
|
@@ -15,14 +15,6 @@
|
|
|
15
15
|
},
|
|
16
16
|
"x-prompt": "What name would you like your API to have? i.e: MyApi"
|
|
17
17
|
},
|
|
18
|
-
"computeType": {
|
|
19
|
-
"type": "string",
|
|
20
|
-
"description": "The type of compute to use to deploy this API. Choose between ServerlessApiGatewayRestApi (default) or ServerlessApiGatewayHttpApi.",
|
|
21
|
-
"default": "ServerlessApiGatewayRestApi",
|
|
22
|
-
"enum": ["ServerlessApiGatewayRestApi", "ServerlessApiGatewayHttpApi"],
|
|
23
|
-
"x-prompt": "What compute type would you like to deploy your API with?",
|
|
24
|
-
"x-priority": "important"
|
|
25
|
-
},
|
|
26
18
|
"integrationPattern": {
|
|
27
19
|
"type": "string",
|
|
28
20
|
"description": "How API Gateway integrations are generated for the API. Choose between isolated (default) and shared.",
|
|
@@ -47,9 +39,9 @@
|
|
|
47
39
|
},
|
|
48
40
|
"auth": {
|
|
49
41
|
"type": "string",
|
|
50
|
-
"description": "The method used to authenticate with your API. Choose between
|
|
51
|
-
"default": "
|
|
52
|
-
"enum": ["
|
|
42
|
+
"description": "The method used to authenticate with your API. Choose between iam (default), cognito or custom.",
|
|
43
|
+
"default": "iam",
|
|
44
|
+
"enum": ["iam", "cognito", "custom"],
|
|
53
45
|
"x-prompt": "How would you like users to authenticate with your API?",
|
|
54
46
|
"x-priority": "important"
|
|
55
47
|
},
|
|
@@ -65,17 +57,25 @@
|
|
|
65
57
|
"description": "The sub directory the project is placed in. By default this is the project name.",
|
|
66
58
|
"x-prompt": "Which sub directory do you want to create the project in? (By default this is the project name)"
|
|
67
59
|
},
|
|
68
|
-
"
|
|
60
|
+
"iac": {
|
|
69
61
|
"type": "string",
|
|
70
62
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
71
|
-
"enum": ["
|
|
63
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
72
64
|
"x-priority": "important",
|
|
73
|
-
"default": "
|
|
74
|
-
"x-prompt": "Which provider would you like to manage your infrastructure? (default:
|
|
65
|
+
"default": "inherit",
|
|
66
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
75
67
|
},
|
|
76
68
|
"moduleName": {
|
|
77
69
|
"type": "string",
|
|
78
70
|
"description": "Python module name"
|
|
71
|
+
},
|
|
72
|
+
"infra": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"description": "The type of infrastructure to use to deploy this API.",
|
|
75
|
+
"default": "rest-lambda",
|
|
76
|
+
"enum": ["rest-lambda", "http-lambda", "none"],
|
|
77
|
+
"x-prompt": "What infrastructure would you like to deploy your API with?",
|
|
78
|
+
"x-priority": "important"
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
"required": ["name"]
|
|
@@ -64,7 +64,7 @@ export class TestProjectTestFunction extends Function {
|
|
|
64
64
|
}
|
|
65
65
|
`;
|
|
66
66
|
|
|
67
|
-
exports[`lambda-handler project generator > terraform
|
|
67
|
+
exports[`lambda-handler project generator > terraform iac > should generate terraform files for python lambda function and snapshot them > terraform-python-lambda-files 1`] = `
|
|
68
68
|
{
|
|
69
69
|
"test-project-test-function.tf": "terraform {
|
|
70
70
|
required_providers {
|
|
@@ -246,7 +246,7 @@ output "role_name" {
|
|
|
246
246
|
}
|
|
247
247
|
`;
|
|
248
248
|
|
|
249
|
-
exports[`lambda-handler project generator > terraform
|
|
249
|
+
exports[`lambda-handler project generator > terraform iac > should match snapshot for terraform generated files with different configurations > terraform-python-lambda-snapshot-function.tf 1`] = `
|
|
250
250
|
"terraform {
|
|
251
251
|
required_providers {
|
|
252
252
|
aws = {
|
|
@@ -2,9 +2,9 @@ import os
|
|
|
2
2
|
|
|
3
3
|
from aws_lambda_powertools import Logger, Metrics, Tracer
|
|
4
4
|
from aws_lambda_powertools.metrics import MetricUnit
|
|
5
|
-
<%_ if (
|
|
5
|
+
<%_ if (event !== 'Any') { _%>
|
|
6
6
|
from aws_lambda_powertools.utilities.parser import event_parser
|
|
7
|
-
from aws_lambda_powertools.utilities.parser.models import <%=
|
|
7
|
+
from aws_lambda_powertools.utilities.parser.models import <%= event %>
|
|
8
8
|
<%_ } _%>
|
|
9
9
|
from aws_lambda_powertools.utilities.typing import LambdaContext
|
|
10
10
|
|
|
@@ -17,11 +17,11 @@ tracer: Tracer = Tracer()
|
|
|
17
17
|
|
|
18
18
|
@tracer.capture_lambda_handler
|
|
19
19
|
@metrics.log_metrics
|
|
20
|
-
<%_ if (
|
|
21
|
-
@event_parser(model=<%=
|
|
20
|
+
<%_ if (event !== 'Any') { _%>
|
|
21
|
+
@event_parser(model=<%= event %>)
|
|
22
22
|
<%_ } _%>
|
|
23
|
-
def lambda_handler(event: <%=
|
|
24
|
-
logger.info("Received event", extra={"event": event<%=
|
|
23
|
+
def lambda_handler(event: <%= event === 'Any' ? 'dict' : event %>, context: LambdaContext):
|
|
24
|
+
logger.info("Received event", extra={"event": event<%= event === 'Any' ? '' : '.model_dump()' %> })
|
|
25
25
|
metrics.add_metric(name="InvocationCount", unit=MetricUnit.Count, value=1)
|
|
26
26
|
|
|
27
27
|
try:
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { type GeneratorCallback, type Tree } from '@nx/devkit';
|
|
6
|
+
import { type NxGeneratorInfo } from '../../utils/nx';
|
|
7
|
+
import type { PyLambdaFunctionGeneratorSchema } from './schema';
|
|
8
8
|
export declare const LAMBDA_FUNCTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
9
|
export interface LambdaFunctionDetails {
|
|
10
10
|
/**
|
|
@@ -6,23 +6,23 @@ exports.pyLambdaFunctionGenerator = exports.LAMBDA_FUNCTION_GENERATOR_INFO = voi
|
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
*/
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
|
-
const
|
|
10
|
-
const shared_constructs_1 = require("../../utils/shared-constructs");
|
|
11
|
-
const names_1 = require("../../utils/names");
|
|
9
|
+
const bundle_1 = require("../../utils/bundle/bundle");
|
|
12
10
|
const format_1 = require("../../utils/format");
|
|
11
|
+
const function_constructs_1 = require("../../utils/function-constructs/function-constructs");
|
|
12
|
+
const iac_1 = require("../../utils/iac");
|
|
13
|
+
const metrics_1 = require("../../utils/metrics");
|
|
14
|
+
const names_1 = require("../../utils/names");
|
|
13
15
|
const npm_scope_1 = require("../../utils/npm-scope");
|
|
14
|
-
const object_1 = require("../../utils/object");
|
|
15
16
|
const nx_1 = require("../../utils/nx");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const py_1 = require("../../utils/py");
|
|
19
|
-
const function_constructs_1 = require("../../utils/function-constructs/function-constructs");
|
|
17
|
+
const nxlv_python_1 = require("../../utils/nxlv-python");
|
|
18
|
+
const object_1 = require("../../utils/object");
|
|
20
19
|
const paths_1 = require("../../utils/paths");
|
|
21
|
-
const
|
|
20
|
+
const py_1 = require("../../utils/py");
|
|
21
|
+
const shared_constructs_1 = require("../../utils/shared-constructs");
|
|
22
22
|
exports.LAMBDA_FUNCTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
23
23
|
const getLambdaFunctionDetails = (tree, schema) => {
|
|
24
24
|
const scope = (0, names_1.toSnakeCase)((0, npm_scope_1.getNpmScope)(tree));
|
|
25
|
-
const normalizedFunctionName = (0, names_1.toSnakeCase)(schema.
|
|
25
|
+
const normalizedFunctionName = (0, names_1.toSnakeCase)(schema.name);
|
|
26
26
|
const fullyQualifiedFunctionName = `${scope}.${normalizedFunctionName}`;
|
|
27
27
|
const normalizedFunctionPath = `${schema.moduleName}.${schema.functionPath ? `${(0, names_1.toDotNotation)(schema.functionPath)}.` : ''}${normalizedFunctionName}.lambda_handler`;
|
|
28
28
|
return {
|
|
@@ -52,34 +52,37 @@ const pyLambdaFunctionGenerator = async (tree, schema) => {
|
|
|
52
52
|
const moduleName = sourceParts[sourceParts.length - 1];
|
|
53
53
|
const { normalizedFunctionName, normalizedFunctionPath } = getLambdaFunctionDetails(tree, {
|
|
54
54
|
moduleName,
|
|
55
|
-
|
|
55
|
+
name: schema.name,
|
|
56
56
|
functionPath: schema.functionPath,
|
|
57
57
|
});
|
|
58
58
|
const constructFunctionName = `${normalizedProjectName}_${normalizedFunctionName}`;
|
|
59
59
|
const constructFunctionClassName = (0, names_1.toClassName)(constructFunctionName);
|
|
60
60
|
const constructFunctionKebabCase = (0, names_1.toKebabCase)(constructFunctionName);
|
|
61
|
-
const lambdaFunctionClassName = (0, names_1.toClassName)(schema.
|
|
62
|
-
const lambdaFunctionKebabCase = (0, names_1.toKebabCase)(schema.
|
|
61
|
+
const lambdaFunctionClassName = (0, names_1.toClassName)(schema.name);
|
|
62
|
+
const lambdaFunctionKebabCase = (0, names_1.toKebabCase)(schema.name);
|
|
63
63
|
const functionPath = (0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, schema.functionPath ?? '', `${normalizedFunctionName}.py`);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
const infra = schema.infra ?? 'lambda';
|
|
65
|
+
const handlerAlreadyExists = tree.exists(functionPath);
|
|
66
|
+
if (handlerAlreadyExists && infra === 'none') {
|
|
67
|
+
throw new Error(`This project already has a lambda function with the name ${normalizedFunctionName}. Please remove the lambda function before running this generator or use a different name.`);
|
|
67
68
|
}
|
|
68
|
-
const iacProvider = await (0, iac_1.resolveIacProvider)(tree, schema.iacProvider);
|
|
69
|
-
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
70
|
-
iacProvider,
|
|
71
|
-
});
|
|
72
69
|
// Check if the project has a bundle target and if not add it
|
|
73
70
|
const { bundleOutputDir } = (0, bundle_1.addPythonBundleTarget)(projectConfig);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
if (infra !== 'none') {
|
|
72
|
+
const iac = await (0, iac_1.resolveIac)(tree, schema.iac);
|
|
73
|
+
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
74
|
+
iac,
|
|
75
|
+
});
|
|
76
|
+
await (0, function_constructs_1.addLambdaFunctionInfra)(tree, {
|
|
77
|
+
functionProjectName: projectConfig.name,
|
|
78
|
+
nameClassName: constructFunctionClassName,
|
|
79
|
+
nameKebabCase: constructFunctionKebabCase,
|
|
80
|
+
handler: normalizedFunctionPath,
|
|
81
|
+
bundlePathFromRoot: bundleOutputDir,
|
|
82
|
+
runtime: 'python',
|
|
83
|
+
iac,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
83
86
|
const enhancedOptions = {
|
|
84
87
|
...schema,
|
|
85
88
|
dir,
|
|
@@ -91,9 +94,9 @@ const pyLambdaFunctionGenerator = async (tree, schema) => {
|
|
|
91
94
|
// Generate the lambda handler file
|
|
92
95
|
(0, devkit_1.generateFiles)(tree, // the virtual file system
|
|
93
96
|
(0, devkit_1.joinPathFragments)(__dirname, 'files', 'handler'), // path to the file templates
|
|
94
|
-
(0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, schema.functionPath ?? ''), enhancedOptions, { overwriteStrategy: devkit_1.OverwriteStrategy.
|
|
97
|
+
(0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, schema.functionPath ?? ''), enhancedOptions, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
95
98
|
// Generate the lambda handler test file
|
|
96
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'tests'), (0, devkit_1.joinPathFragments)(dir, 'tests'), enhancedOptions, { overwriteStrategy: devkit_1.OverwriteStrategy.
|
|
99
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'tests'), (0, devkit_1.joinPathFragments)(dir, 'tests'), enhancedOptions, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
97
100
|
(0, py_1.addDependenciesToPyProjectToml)(tree, dir, [
|
|
98
101
|
'aws-lambda-powertools',
|
|
99
102
|
'aws-lambda-powertools[tracer]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/lambda-function/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAQoB;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/lambda-function/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAQoB;AACpB,sDAAkE;AAClE,+CAA0D;AAC1D,6FAA6F;AAC7F,yCAA6C;AAC7C,iDAAsE;AACtE,6CAK2B;AAC3B,qDAAoD;AACpD,uCAKwB;AACxB,yDAA6D;AAC7D,+CAAoD;AACpD,6CAA0D;AAC1D,uCAAgE;AAChE,qEAA0E;AAG7D,QAAA,8BAA8B,GACzC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAiB/B,MAAM,wBAAwB,GAAG,CAC/B,IAAU,EACV,MAAmE,EAC5C,EAAE;IACzB,MAAM,KAAK,GAAG,IAAA,mBAAW,EAAC,IAAA,uBAAW,EAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,MAAM,sBAAsB,GAAG,IAAA,mBAAW,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,0BAA0B,GAAG,GAAG,KAAK,IAAI,sBAAsB,EAAE,CAAC;IACxE,MAAM,sBAAsB,GAAG,GAAG,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAA,qBAAa,EAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,sBAAsB,iBAAiB,CAAC;IAErK,OAAO;QACL,0BAA0B;QAC1B,sBAAsB;QACtB,sBAAsB;KACvB,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACI,MAAM,yBAAyB,GAAG,KAAK,EAC5C,IAAU,EACV,MAAuC,EACX,EAAE;IAC9B,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI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BAAyB,6BAmIpC;AACF,kBAAe,iCAAyB,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IacOption } from '../../utils/iac';
|
|
7
7
|
|
|
8
8
|
type EventSource =
|
|
9
9
|
| 'Any'
|
|
@@ -47,10 +47,13 @@ type EventSource =
|
|
|
47
47
|
| 'VpcLatticeModel'
|
|
48
48
|
| 'VpcLatticeV2Model';
|
|
49
49
|
|
|
50
|
+
export type LambdaInfraOption = 'lambda' | 'none';
|
|
51
|
+
|
|
50
52
|
export interface PyLambdaFunctionGeneratorSchema {
|
|
51
53
|
readonly project: string;
|
|
52
|
-
readonly
|
|
54
|
+
readonly name: string;
|
|
53
55
|
readonly functionPath?: string;
|
|
54
|
-
readonly
|
|
55
|
-
readonly
|
|
56
|
+
readonly event?: EventSource;
|
|
57
|
+
readonly infra?: LambdaInfraOption;
|
|
58
|
+
readonly iac: IacOption;
|
|
56
59
|
}
|