@aws/nx-plugin 1.0.0-rc.93 → 1.0.0-rc.95

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.
Files changed (150) hide show
  1. package/migrations.json +36 -1
  2. package/package.json +1 -1
  3. package/src/agentcore-harness/generator.d.ts +1 -1
  4. package/src/infra/app/__snapshots__/generator.spec.ts.snap +5 -5
  5. package/src/infra/app/generator.d.ts +1 -1
  6. package/src/infra/app/generator.js +5 -3
  7. package/src/infra/app/generator.js.map +1 -1
  8. package/src/init/generator.d.ts +1 -1
  9. package/src/migrations/latest/agent-connection-pin-strands-peers/metadata.json +3 -0
  10. package/src/migrations/latest/agent-connection-pin-strands-peers/migration.d.ts +18 -0
  11. package/src/migrations/latest/agent-connection-pin-strands-peers/migration.js +38 -0
  12. package/src/migrations/latest/agent-connection-pin-strands-peers/migration.js.map +1 -0
  13. package/src/migrations/latest/agent-core-vendor-target/metadata.json +3 -0
  14. package/src/migrations/latest/agent-core-vendor-target/migration.d.ts +6 -0
  15. package/src/migrations/latest/agent-core-vendor-target/migration.js +98 -0
  16. package/src/migrations/latest/agent-core-vendor-target/migration.js.map +1 -0
  17. package/src/migrations/latest/ignore-package-manager-temp-files/metadata.json +3 -0
  18. package/src/migrations/latest/ignore-package-manager-temp-files/migration.d.ts +12 -0
  19. package/src/migrations/latest/ignore-package-manager-temp-files/migration.js +25 -0
  20. package/src/migrations/latest/ignore-package-manager-temp-files/migration.js.map +1 -0
  21. package/src/migrations/latest/infra-deploy-express-mode/metadata.json +3 -0
  22. package/src/migrations/latest/infra-deploy-express-mode/migration.d.ts +6 -0
  23. package/src/migrations/latest/infra-deploy-express-mode/migration.js +83 -0
  24. package/src/migrations/latest/infra-deploy-express-mode/migration.js.map +1 -0
  25. package/src/migrations/latest/rolldown-config-bundle-transient/metadata.json +3 -0
  26. package/src/migrations/latest/rolldown-config-bundle-transient/migration.d.ts +6 -0
  27. package/src/migrations/latest/rolldown-config-bundle-transient/migration.js +80 -0
  28. package/src/migrations/latest/rolldown-config-bundle-transient/migration.js.map +1 -0
  29. package/src/migrations/latest/shadcn-package-imports-exports/metadata.json +3 -0
  30. package/src/migrations/latest/shadcn-package-imports-exports/migration.d.ts +6 -0
  31. package/src/migrations/latest/shadcn-package-imports-exports/migration.js +184 -0
  32. package/src/migrations/latest/shadcn-package-imports-exports/migration.js.map +1 -0
  33. package/src/migrations/latest/shx-fs-commands/metadata.json +3 -0
  34. package/src/migrations/latest/shx-fs-commands/migration.d.ts +6 -0
  35. package/src/migrations/latest/shx-fs-commands/migration.js +216 -0
  36. package/src/migrations/latest/shx-fs-commands/migration.js.map +1 -0
  37. package/src/open-api/ts-client/__snapshots__/generator.complex-types.spec.ts.snap +18 -12
  38. package/src/open-api/ts-client/__snapshots__/generator.edge-cases.spec.ts.snap +5 -2
  39. package/src/open-api/utils/codegen-data/types.d.ts +6 -0
  40. package/src/open-api/utils/codegen-data/types.js.map +1 -1
  41. package/src/open-api/utils/codegen-data.js +32 -7
  42. package/src/open-api/utils/codegen-data.js.map +1 -1
  43. package/src/open-api/utils/normalise.js +39 -14
  44. package/src/open-api/utils/normalise.js.map +1 -1
  45. package/src/open-api/utils/parser.js +51 -5
  46. package/src/open-api/utils/parser.js.map +1 -1
  47. package/src/preset/__snapshots__/generator.spec.ts.snap +5 -1
  48. package/src/preset/generator.d.ts +1 -1
  49. package/src/py/agent/a2a-connection/generator.d.ts +1 -1
  50. package/src/py/agent/gateway-connection/generator.d.ts +1 -1
  51. package/src/py/agent/generator.d.ts +2 -26
  52. package/src/py/agent/generator.js +2 -2
  53. package/src/py/agent/generator.js.map +1 -1
  54. package/src/py/agent/mcp-connection/generator.d.ts +1 -1
  55. package/src/py/agent/react-connection/generator.d.ts +1 -1
  56. package/src/py/fast-api/generator.d.ts +1 -13
  57. package/src/py/fast-api/generator.js +1 -1
  58. package/src/py/fast-api/generator.js.map +1 -1
  59. package/src/py/fast-api/react/generator.d.ts +1 -1
  60. package/src/py/mcp-server/generator.d.ts +2 -26
  61. package/src/py/mcp-server/generator.js +2 -2
  62. package/src/py/mcp-server/generator.js.map +1 -1
  63. package/src/py/rdb/generator.d.ts +2 -26
  64. package/src/py/rdb/generator.js +6 -6
  65. package/src/py/rdb/generator.js.map +1 -1
  66. package/src/smithy/project/__snapshots__/generator.spec.ts.snap +24 -20
  67. package/src/smithy/project/generator.d.ts +2 -14
  68. package/src/smithy/project/generator.js +2 -1
  69. package/src/smithy/project/generator.js.map +1 -1
  70. package/src/smithy/react-connection/generator.d.ts +1 -1
  71. package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +12 -8
  72. package/src/smithy/ts/api/generator.d.ts +1 -13
  73. package/src/smithy/ts/api/generator.js +1 -1
  74. package/src/smithy/ts/api/generator.js.map +1 -1
  75. package/src/terraform/project/generator.d.ts +2 -2
  76. package/src/terraform/project/generator.js +4 -4
  77. package/src/terraform/project/generator.js.map +1 -1
  78. package/src/trpc/react/generator.d.ts +1 -1
  79. package/src/ts/agent/a2a-connection/generator.d.ts +5 -1
  80. package/src/ts/agent/gateway-connection/generator.d.ts +5 -1
  81. package/src/ts/agent/generator.d.ts +5 -37
  82. package/src/ts/agent/generator.js +1 -1
  83. package/src/ts/agent/generator.js.map +1 -1
  84. package/src/ts/agent/mcp-connection/generator.d.ts +5 -1
  85. package/src/ts/agent/react-connection/generator.d.ts +1 -1
  86. package/src/ts/astro-docs/generator.d.ts +1 -1
  87. package/src/ts/dcr-proxy/generator.d.ts +1 -1
  88. package/src/ts/dynamodb/generator.d.ts +1 -1
  89. package/src/ts/lambda-function/generator.d.ts +1 -1
  90. package/src/ts/lib/generator.d.ts +1 -1
  91. package/src/ts/mcp-server/generator.d.ts +3 -39
  92. package/src/ts/mcp-server/generator.js +1 -1
  93. package/src/ts/mcp-server/generator.js.map +1 -1
  94. package/src/ts/nx-generator/generator.d.ts +1 -1
  95. package/src/ts/nx-migration/generator.d.ts +1 -1
  96. package/src/ts/nx-plugin/generator.d.ts +1 -1
  97. package/src/ts/rdb/generator.d.ts +3 -27
  98. package/src/ts/rdb/generator.js +3 -3
  99. package/src/ts/rdb/generator.js.map +1 -1
  100. package/src/ts/react-website/agui/generator.d.ts +1 -1
  101. package/src/ts/react-website/agui/generator.js +2 -1
  102. package/src/ts/react-website/agui/generator.js.map +1 -1
  103. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +2 -0
  104. package/src/ts/react-website/app/generator.js +2 -1
  105. package/src/ts/react-website/app/generator.js.map +1 -1
  106. package/src/utils/agent-connection/agent-connection.d.ts +2 -0
  107. package/src/utils/agent-connection/agent-connection.js +11 -4
  108. package/src/utils/agent-connection/agent-connection.js.map +1 -1
  109. package/src/utils/agent-core-packaging.d.ts +25 -12
  110. package/src/utils/agent-core-packaging.js +47 -11
  111. package/src/utils/agent-core-packaging.js.map +1 -1
  112. package/src/utils/bundle/bundle.js +10 -0
  113. package/src/utils/bundle/bundle.js.map +1 -1
  114. package/src/utils/docker.d.ts +1 -7
  115. package/src/utils/docker.js +1 -1
  116. package/src/utils/docker.js.map +1 -1
  117. package/src/utils/files/common/shadcn/src/components/ui/alert.tsx.template +1 -1
  118. package/src/utils/files/common/shadcn/src/components/ui/avatar.tsx.template +1 -1
  119. package/src/utils/files/common/shadcn/src/components/ui/breadcrumb.tsx.template +1 -1
  120. package/src/utils/files/common/shadcn/src/components/ui/button.tsx.template +1 -1
  121. package/src/utils/files/common/shadcn/src/components/ui/card.tsx.template +1 -1
  122. package/src/utils/files/common/shadcn/src/components/ui/input.tsx.template +1 -1
  123. package/src/utils/files/common/shadcn/src/components/ui/separator.tsx.template +1 -1
  124. package/src/utils/files/common/shadcn/src/components/ui/sheet.tsx.template +1 -1
  125. package/src/utils/files/common/shadcn/src/components/ui/sidebar.tsx.template +8 -8
  126. package/src/utils/files/common/shadcn/src/components/ui/skeleton.tsx.template +1 -1
  127. package/src/utils/files/common/shadcn/src/components/ui/spinner.tsx.template +1 -1
  128. package/src/utils/files/common/shadcn/src/components/ui/textarea.tsx.template +1 -1
  129. package/src/utils/files/common/shadcn/src/components/ui/tooltip.tsx.template +1 -1
  130. package/src/utils/files/shadcn/components.json.template +5 -5
  131. package/src/utils/format.d.ts +21 -0
  132. package/src/utils/format.js +20 -0
  133. package/src/utils/format.js.map +1 -1
  134. package/src/utils/fs.d.ts +21 -11
  135. package/src/utils/fs.js +30 -22
  136. package/src/utils/fs.js.map +1 -1
  137. package/src/utils/init.js +11 -4
  138. package/src/utils/init.js.map +1 -1
  139. package/src/utils/pnpm-workspace.d.ts +5 -5
  140. package/src/utils/pnpm-workspace.js +5 -5
  141. package/src/utils/pnpm-workspace.js.map +1 -1
  142. package/src/utils/shared-shadcn.d.ts +9 -0
  143. package/src/utils/shared-shadcn.js +36 -26
  144. package/src/utils/shared-shadcn.js.map +1 -1
  145. package/src/utils/version-lockstep/lockstep.d.ts +27 -0
  146. package/src/utils/version-lockstep/lockstep.js +46 -0
  147. package/src/utils/version-lockstep/lockstep.js.map +1 -0
  148. package/src/utils/versions.d.ts +9 -4
  149. package/src/utils/versions.js +24 -4
  150. package/src/utils/versions.js.map +1 -1
@@ -197,10 +197,10 @@ export const pyRdbGenerator = async (tree, options)=>{
197
197
  commands: [
198
198
  fs.rm(migrationBundleDir),
199
199
  fs.mkdir(migrationBundleDir),
200
- fs.cp(bundleOutputDir, migrationBundleDir),
201
- fs.cp(joinPathFragments(dir, 'migrations'), joinPathFragments(migrationBundleDir, 'migrations')),
202
- fs.cp(joinPathFragments(dir, 'alembic.ini'), joinPathFragments(migrationBundleDir, 'alembic.ini')),
203
- fs.cp(joinPathFragments(dir, 'Dockerfile.migration'), joinPathFragments(migrationBundleDir, 'Dockerfile'))
200
+ fs.cpDir(bundleOutputDir, migrationBundleDir),
201
+ fs.cpDir(joinPathFragments(dir, 'migrations'), joinPathFragments(migrationBundleDir, 'migrations')),
202
+ fs.cpFile(joinPathFragments(dir, 'alembic.ini'), joinPathFragments(migrationBundleDir, 'alembic.ini')),
203
+ fs.cpFile(joinPathFragments(dir, 'Dockerfile.migration'), joinPathFragments(migrationBundleDir, 'Dockerfile'))
204
204
  ],
205
205
  parallel: false
206
206
  },
@@ -221,8 +221,8 @@ export const pyRdbGenerator = async (tree, options)=>{
221
221
  commands: [
222
222
  fs.rm(createDbUserBundleDir),
223
223
  fs.mkdir(createDbUserBundleDir),
224
- fs.cp(bundleOutputDir, createDbUserBundleDir),
225
- fs.cp(joinPathFragments(dir, 'Dockerfile.create-db-user'), joinPathFragments(createDbUserBundleDir, 'Dockerfile'))
224
+ fs.cpDir(bundleOutputDir, createDbUserBundleDir),
225
+ fs.cpFile(joinPathFragments(dir, 'Dockerfile.create-db-user'), joinPathFragments(createDbUserBundleDir, 'Dockerfile'))
226
226
  ],
227
227
  parallel: false
228
228
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/nx-plugin/src/py/rdb/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { relative } from 'node:path';\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n readProjectConfiguration,\n type Tree,\n updateProjectConfiguration,\n writeJson,\n} from '@nx/devkit';\nimport {\n addPyDependencies,\n addTsDependencies,\n} from '../../utils/add-dependencies.js';\nimport { addPythonReExport } from '../../utils/agent-connection/agent-connection.js';\nimport { addPythonBundleTarget } from '../../utils/bundle/bundle.js';\nimport { resolveContainers } from '../../utils/containers.js';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../utils/declared-dependencies.js';\nimport {\n addDockerScanTarget,\n DOCKER_DEPENDENCIES,\n IMAGE_BUILD_CACHE,\n} from '../../utils/docker.js';\nimport { formatFilesInSubtree } from '../../utils/format.js';\nimport { FS_DEPENDENCIES, FsCommands } from '../../utils/fs.js';\nimport { resolveIac } from '../../utils/iac.js';\nimport { installDependencies } from '../../utils/install.js';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics.js';\nimport { kebabCase, snakeCase, toClassName } from '../../utils/names.js';\nimport { getNpmScope } from '../../utils/npm-scope.js';\nimport {\n addArtifactDependencyToTargets,\n addDependencyToTargetIfNotPresent,\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n projectExists,\n} from '../../utils/nx.js';\nimport { assignPort } from '../../utils/port.js';\nimport { addRdbInfra } from '../../utils/rdb-constructs/rdb-constructs.js';\nimport {\n SHARED_CONSTRUCTS_DEPENDENCIES,\n sharedConstructsGenerator,\n} from '../../utils/shared-constructs.js';\nimport {\n type IacMetadata,\n PACKAGES_DIR,\n SHARED_SCRIPTS_DIR,\n} from '../../utils/shared-constructs-constants.js';\nimport {\n SHARED_RDB_SCRIPTS_DEPENDENCIES,\n sharedRdbScriptsGenerator,\n} from '../../utils/shared-rdb-scripts.js';\nimport { PY_VERSIONS } from '../../utils/versions.js';\nimport pyProjectGenerator, {\n getPyProjectDetails,\n} from '../project/generator.js';\nimport type { PyRdbGeneratorSchema } from './schema';\n\n/** The metadata this generator records, which its predicates read. */\nexport interface PyRdbMetadata extends IacMetadata {\n readonly engine: PyRdbGeneratorSchema['engine'];\n}\n\n/** The Postgres engine, which MySQL takes none of. */\nconst isPostgres = (m: PyRdbMetadata) => m.engine !== 'mysql';\n\n// Each entry names the engine branch it belongs to, so the same declaration\n// drives both adding and the version sync.\nexport const DEPENDENCIES = declareDependencies<PyRdbMetadata>()({\n ts: [\n // The engine client the local dev script wait-for-*-db.ts imports.\n { name: 'mariadb', when: (m) => m.engine === 'mysql', root: true },\n { name: 'pg', when: isPostgres, root: true },\n { name: '@types/pg', when: isPostgres, dev: true, root: true },\n // Added by the helpers that own the projects they belong to.\n ...ownedElsewhere(FS_DEPENDENCIES),\n ...ownedElsewhere(DOCKER_DEPENDENCIES),\n ...ownedElsewhere(SHARED_CONSTRUCTS_DEPENDENCIES),\n ...ownedElsewhere(SHARED_RDB_SCRIPTS_DEPENDENCIES),\n ],\n py: [\n { name: 'sqlmodel' },\n { name: 'alembic' },\n // SQLAlchemy's async engine (used by connection.py for both engines)\n // requires greenlet at runtime. Vend it explicitly at a pinned version so\n // the dependency graph is fully determined and doesn't float to an\n // unpublished-wheel release at install time.\n { name: 'greenlet' },\n { name: 'aiomysql', when: (m) => m.engine === 'mysql' },\n { name: 'asyncpg', when: (m) => m.engine !== 'mysql' },\n { name: 'boto3' },\n { name: 'aws-lambda-powertools' },\n ],\n});\n\nexport const PY_RDB_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport const pyRdbGenerator = async (\n tree: Tree,\n options: PyRdbGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const nameClassName = toClassName(options.name);\n const databaseUser = options.databaseUser ?? 'dbadmin';\n const databaseName = snakeCase(options.databaseName ?? options.name);\n const containerEngine = await resolveContainers(tree, 'inherit');\n\n const { fullyQualifiedName, dir, normalizedModuleName } = getPyProjectDetails(\n tree,\n {\n name: options.name,\n directory: options.directory,\n subDirectory: options.subDirectory,\n },\n );\n\n if (!projectExists(tree, fullyQualifiedName)) {\n await pyProjectGenerator(tree, {\n name: options.name,\n directory: options.directory,\n subDirectory: options.subDirectory,\n type: 'library',\n });\n }\n\n const projectConfig = readProjectConfiguration(tree, fullyQualifiedName);\n\n const { engine } = options;\n // Recorded in the metadata below so the version sync can tell a CDK project\n // from a Terraform one; undefined when no infrastructure was generated.\n const iac =\n options.infra !== 'none' ? await resolveIac(tree, options.iac) : undefined;\n\n // Recorded below and read by the declaration's predicates, so the packages\n // added here are exactly the ones the version sync will own.\n const metadata: PyRdbMetadata = { engine, ...(iac ? { iac } : {}) };\n const localDbPort = assignPort(\n tree,\n projectConfig,\n engine === 'mysql' ? 3306 : 5432,\n );\n const localDbHost = 'localhost';\n const localDbUser = engine === 'mysql' ? 'root' : 'dbadmin';\n const localDbPassword = 'password';\n const containerName = `${getNpmScope(tree)}-${databaseName}`;\n const dockerImage =\n engine === 'mysql'\n ? 'public.ecr.aws/docker/library/mysql:8.0.44'\n : 'public.ecr.aws/docker/library/postgres:17.7';\n\n const templateOptions = {\n name: normalizedModuleName,\n runtimeConfigKey: nameClassName,\n engine,\n localDbPort,\n localDbHost,\n localDbName: databaseName,\n localDbUser,\n localDbPassword,\n containerEngine,\n containerName,\n dockerImage,\n sqlmodelVersion: PY_VERSIONS.sqlmodel,\n alembicVersion: PY_VERSIONS.alembic,\n aiomysqlVersion: PY_VERSIONS.aiomysql,\n asyncpgVersion: PY_VERSIONS.asyncpg,\n boto3Version: PY_VERSIONS.boto3,\n awsLambdaPowertoolsVersion: PY_VERSIONS['aws-lambda-powertools'],\n };\n\n // Models, the connection module, the Alembic config and the migration env are\n // user-editable, so a re-run (to add infrastructure, or after a failed run)\n // must not clobber the user's schema and edits.\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files'),\n dir,\n templateOptions,\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n\n // The package barrel re-exports connection.py. `pyProjectGenerator` writes a\n // stub __init__.py when it creates the project, so the re-exports are added to\n // whatever is there rather than replacing it — which also leaves a user's own\n // additions to the barrel alone on a re-run.\n const initFilePath = joinPathFragments(\n dir,\n normalizedModuleName,\n '__init__.py',\n );\n for (const importName of ['get_engine', 'is_local_dev', 'session_context']) {\n await addPythonReExport(tree, initFilePath, '.connection', importName);\n }\n\n // config.json is framework-owned: it carries values derived from the\n // generator's options, so it converges on a re-run with changed options.\n writeJson(tree, joinPathFragments(dir, 'config.json'), {\n runtimeConfigKey: nameClassName,\n localDev: {\n containerEngine,\n containerName,\n image: dockerImage,\n port: localDbPort,\n host: localDbHost,\n dbName: databaseName,\n dbUser: localDbUser,\n dbPassword: localDbPassword,\n dbEngine: engine,\n },\n });\n\n await sharedRdbScriptsGenerator(tree, engine, DEPENDENCIES);\n const scriptsDir = relative(\n dir,\n joinPathFragments(PACKAGES_DIR, SHARED_SCRIPTS_DIR, 'src', 'rdb'),\n );\n const fs = new FsCommands(tree, DEPENDENCIES);\n\n const migrationBundleDir = joinPathFragments(\n 'dist',\n projectConfig.root,\n 'docker',\n 'migration',\n );\n const createDbUserBundleDir = joinPathFragments(\n 'dist',\n projectConfig.root,\n 'docker',\n 'create-db-user',\n );\n const migrationDockerImageTag = `${getNpmScope(tree)}-${kebabCase(options.name)}-migration:latest`;\n const createDbUserDockerImageTag = `${getNpmScope(tree)}-${kebabCase(\n options.name,\n )}-create-db-user:latest`;\n\n if (options.infra !== 'none') {\n const { bundleTargetName, bundleOutputDir } = addPythonBundleTarget(\n projectConfig,\n { pythonPlatform: 'aarch64-manylinux_2_28' },\n );\n\n projectConfig.targets['bundle-migration'] = {\n cache: true,\n inputs: ['default'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/docker/migration'],\n executor: 'nx:run-commands',\n options: {\n commands: [\n fs.rm(migrationBundleDir),\n fs.mkdir(migrationBundleDir),\n fs.cp(bundleOutputDir, migrationBundleDir),\n fs.cp(\n joinPathFragments(dir, 'migrations'),\n joinPathFragments(migrationBundleDir, 'migrations'),\n ),\n fs.cp(\n joinPathFragments(dir, 'alembic.ini'),\n joinPathFragments(migrationBundleDir, 'alembic.ini'),\n ),\n fs.cp(\n joinPathFragments(dir, 'Dockerfile.migration'),\n joinPathFragments(migrationBundleDir, 'Dockerfile'),\n ),\n ],\n parallel: false,\n },\n dependsOn: [bundleTargetName],\n };\n projectConfig.targets['bundle-create-db-user'] = {\n cache: true,\n inputs: ['default'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/docker/create-db-user'],\n executor: 'nx:run-commands',\n options: {\n commands: [\n fs.rm(createDbUserBundleDir),\n fs.mkdir(createDbUserBundleDir),\n fs.cp(bundleOutputDir, createDbUserBundleDir),\n fs.cp(\n joinPathFragments(dir, 'Dockerfile.create-db-user'),\n joinPathFragments(createDbUserBundleDir, 'Dockerfile'),\n ),\n ],\n parallel: false,\n },\n dependsOn: [bundleTargetName],\n };\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'bundle',\n 'bundle-migration',\n );\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'bundle',\n 'bundle-create-db-user',\n );\n }\n\n projectConfig.targets['pull-image'] = {\n executor: 'nx:run-commands',\n options: {\n command: `tsx ${scriptsDir}/pull-image.ts`,\n cwd: '{projectRoot}',\n },\n };\n projectConfig.targets['dev'] = {\n executor: 'nx:run-commands',\n continuous: true,\n options: {\n command: `tsx ${scriptsDir}/start-container.ts`,\n cwd: '{projectRoot}',\n },\n dependsOn: ['pull-image'],\n };\n projectConfig.targets['wait-for-db'] = {\n executor: 'nx:run-commands',\n dependsOn: ['dev'],\n options: {\n command: `tsx ${scriptsDir}/wait-for-${engine}-db.ts`,\n cwd: '{projectRoot}',\n },\n };\n projectConfig.targets.migrate = {\n executor: 'nx:run-commands',\n dependsOn: ['dev', 'wait-for-db'],\n options: {\n command: 'uv run alembic upgrade head',\n cwd: '{projectRoot}',\n env: {\n LOCAL_DEV: 'true',\n },\n },\n };\n projectConfig.targets.alembic = {\n executor: 'nx:run-commands',\n dependsOn: ['dev', 'wait-for-db'],\n options: {\n command: 'uv run alembic',\n cwd: '{projectRoot}',\n env: {\n LOCAL_DEV: 'true',\n },\n },\n };\n\n if (options.infra !== 'none') {\n if (iac === 'terraform') {\n projectConfig.targets.docker = {\n cache: IMAGE_BUILD_CACHE,\n executor: 'nx:run-commands',\n options: {\n commands: [\n `${containerEngine} build --platform linux/arm64 --provenance=false -t ${migrationDockerImageTag} ${migrationBundleDir}`,\n `${containerEngine} build --platform linux/arm64 --provenance=false -t ${createDbUserDockerImageTag} ${createDbUserBundleDir}`,\n ],\n parallel: false,\n },\n dependsOn: ['bundle-migration', 'bundle-create-db-user'],\n };\n addArtifactDependencyToTargets(projectConfig, 'docker');\n\n addDockerScanTarget(\n tree,\n {\n project: projectConfig,\n containerEngine,\n trivyTargetName: 'trivy',\n dockerTargetName: 'docker',\n imageTags: [migrationDockerImageTag, createDbUserDockerImageTag],\n },\n DEPENDENCIES,\n );\n }\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'build',\n 'bundle-migration',\n );\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'build',\n 'bundle-create-db-user',\n );\n }\n\n updateProjectConfiguration(tree, fullyQualifiedName, projectConfig);\n addGeneratorMetadata(\n tree,\n fullyQualifiedName,\n PY_RDB_GENERATOR_INFO,\n metadata,\n );\n\n if (options.infra !== 'none') {\n await sharedConstructsGenerator(tree, { iac }, DEPENDENCIES);\n await addRdbInfra(tree, {\n iac,\n projectName: fullyQualifiedName,\n projectRoot: dir,\n nameClassName,\n nameKebabCase: kebabCase(options.name),\n databasePackageAlias: normalizedModuleName,\n databaseName,\n adminUser: databaseUser,\n engine,\n migrationBundleDir,\n createDbUserBundleDir,\n framework: 'sqlmodel',\n createDbUserDockerImageTag,\n migrationDockerImageTag,\n containerEngine,\n });\n }\n\n addPyDependencies(tree, DEPENDENCIES, { metadata, projectRoot: dir });\n addTsDependencies(tree, DEPENDENCIES, { metadata });\n\n await addGeneratorMetricsIfApplicable(tree, [PY_RDB_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript', 'python'],\n });\n};\n\nexport default pyRdbGenerator;\n"],"names":["relative","generateFiles","joinPathFragments","OverwriteStrategy","readProjectConfiguration","updateProjectConfiguration","writeJson","addPyDependencies","addTsDependencies","addPythonReExport","addPythonBundleTarget","resolveContainers","declareDependencies","ownedElsewhere","addDockerScanTarget","DOCKER_DEPENDENCIES","IMAGE_BUILD_CACHE","formatFilesInSubtree","FS_DEPENDENCIES","FsCommands","resolveIac","installDependencies","addGeneratorMetricsIfApplicable","kebabCase","snakeCase","toClassName","getNpmScope","addArtifactDependencyToTargets","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","projectExists","assignPort","addRdbInfra","SHARED_CONSTRUCTS_DEPENDENCIES","sharedConstructsGenerator","PACKAGES_DIR","SHARED_SCRIPTS_DIR","SHARED_RDB_SCRIPTS_DEPENDENCIES","sharedRdbScriptsGenerator","PY_VERSIONS","pyProjectGenerator","getPyProjectDetails","isPostgres","m","engine","DEPENDENCIES","ts","name","when","root","dev","py","PY_RDB_GENERATOR_INFO","filename","pyRdbGenerator","tree","options","nameClassName","databaseUser","databaseName","containerEngine","fullyQualifiedName","dir","normalizedModuleName","directory","subDirectory","type","projectConfig","iac","infra","undefined","metadata","localDbPort","localDbHost","localDbUser","localDbPassword","containerName","dockerImage","templateOptions","runtimeConfigKey","localDbName","sqlmodelVersion","sqlmodel","alembicVersion","alembic","aiomysqlVersion","aiomysql","asyncpgVersion","asyncpg","boto3Version","boto3","awsLambdaPowertoolsVersion","dirname","overwriteStrategy","KeepExisting","initFilePath","importName","localDev","image","port","host","dbName","dbUser","dbPassword","dbEngine","scriptsDir","fs","migrationBundleDir","createDbUserBundleDir","migrationDockerImageTag","createDbUserDockerImageTag","bundleTargetName","bundleOutputDir","pythonPlatform","targets","cache","inputs","outputs","executor","commands","rm","mkdir","cp","parallel","dependsOn","command","cwd","continuous","migrate","env","LOCAL_DEV","docker","project","trivyTargetName","dockerTargetName","imageTags","projectName","projectRoot","nameKebabCase","databasePackageAlias","adminUser","framework","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAEEC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EACjBC,wBAAwB,EAExBC,0BAA0B,EAC1BC,SAAS,QACJ,aAAa;AACpB,SACEC,iBAAiB,EACjBC,iBAAiB,QACZ,kCAAkC;AACzC,SAASC,iBAAiB,QAAQ,mDAAmD;AACrF,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,SACEC,mBAAmB,EACnBC,cAAc,QACT,uCAAuC;AAC9C,SACEC,mBAAmB,EACnBC,mBAAmB,EACnBC,iBAAiB,QACZ,wBAAwB;AAC/B,SAASC,oBAAoB,QAAQ,wBAAwB;AA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AezF,eAAe"}
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/py/rdb/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { relative } from 'node:path';\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n readProjectConfiguration,\n type Tree,\n updateProjectConfiguration,\n writeJson,\n} from '@nx/devkit';\nimport {\n addPyDependencies,\n addTsDependencies,\n} from '../../utils/add-dependencies.js';\nimport { addPythonReExport } from '../../utils/agent-connection/agent-connection.js';\nimport { addPythonBundleTarget } from '../../utils/bundle/bundle.js';\nimport { resolveContainers } from '../../utils/containers.js';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../utils/declared-dependencies.js';\nimport {\n addDockerScanTarget,\n DOCKER_DEPENDENCIES,\n IMAGE_BUILD_CACHE,\n} from '../../utils/docker.js';\nimport { formatFilesInSubtree } from '../../utils/format.js';\nimport { FS_DEPENDENCIES, FsCommands } from '../../utils/fs.js';\nimport { resolveIac } from '../../utils/iac.js';\nimport { installDependencies } from '../../utils/install.js';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics.js';\nimport { kebabCase, snakeCase, toClassName } from '../../utils/names.js';\nimport { getNpmScope } from '../../utils/npm-scope.js';\nimport {\n addArtifactDependencyToTargets,\n addDependencyToTargetIfNotPresent,\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n projectExists,\n} from '../../utils/nx.js';\nimport { assignPort } from '../../utils/port.js';\nimport { addRdbInfra } from '../../utils/rdb-constructs/rdb-constructs.js';\nimport {\n SHARED_CONSTRUCTS_DEPENDENCIES,\n sharedConstructsGenerator,\n} from '../../utils/shared-constructs.js';\nimport {\n type IacMetadata,\n PACKAGES_DIR,\n SHARED_SCRIPTS_DIR,\n} from '../../utils/shared-constructs-constants.js';\nimport {\n SHARED_RDB_SCRIPTS_DEPENDENCIES,\n sharedRdbScriptsGenerator,\n} from '../../utils/shared-rdb-scripts.js';\nimport { PY_VERSIONS } from '../../utils/versions.js';\nimport pyProjectGenerator, {\n getPyProjectDetails,\n} from '../project/generator.js';\nimport type { PyRdbGeneratorSchema } from './schema';\n\n/** The metadata this generator records, which its predicates read. */\nexport interface PyRdbMetadata extends IacMetadata {\n readonly engine: PyRdbGeneratorSchema['engine'];\n}\n\n/** The Postgres engine, which MySQL takes none of. */\nconst isPostgres = (m: PyRdbMetadata) => m.engine !== 'mysql';\n\n// Each entry names the engine branch it belongs to, so the same declaration\n// drives both adding and the version sync.\nexport const DEPENDENCIES = declareDependencies<PyRdbMetadata>()({\n ts: [\n // The engine client the local dev script wait-for-*-db.ts imports.\n { name: 'mariadb', when: (m) => m.engine === 'mysql', root: true },\n { name: 'pg', when: isPostgres, root: true },\n { name: '@types/pg', when: isPostgres, dev: true, root: true },\n // Added by the helpers that own the projects they belong to.\n ...ownedElsewhere(FS_DEPENDENCIES),\n ...ownedElsewhere(DOCKER_DEPENDENCIES),\n ...ownedElsewhere(SHARED_CONSTRUCTS_DEPENDENCIES),\n ...ownedElsewhere(SHARED_RDB_SCRIPTS_DEPENDENCIES),\n ],\n py: [\n { name: 'sqlmodel' },\n { name: 'alembic' },\n // SQLAlchemy's async engine (used by connection.py for both engines)\n // requires greenlet at runtime. Vend it explicitly at a pinned version so\n // the dependency graph is fully determined and doesn't float to an\n // unpublished-wheel release at install time.\n { name: 'greenlet' },\n { name: 'aiomysql', when: (m) => m.engine === 'mysql' },\n { name: 'asyncpg', when: (m) => m.engine !== 'mysql' },\n { name: 'boto3' },\n { name: 'aws-lambda-powertools' },\n ],\n});\n\nexport const PY_RDB_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport const pyRdbGenerator = async (\n tree: Tree,\n options: PyRdbGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const nameClassName = toClassName(options.name);\n const databaseUser = options.databaseUser ?? 'dbadmin';\n const databaseName = snakeCase(options.databaseName ?? options.name);\n const containerEngine = await resolveContainers(tree, 'inherit');\n\n const { fullyQualifiedName, dir, normalizedModuleName } = getPyProjectDetails(\n tree,\n {\n name: options.name,\n directory: options.directory,\n subDirectory: options.subDirectory,\n },\n );\n\n if (!projectExists(tree, fullyQualifiedName)) {\n await pyProjectGenerator(tree, {\n name: options.name,\n directory: options.directory,\n subDirectory: options.subDirectory,\n type: 'library',\n });\n }\n\n const projectConfig = readProjectConfiguration(tree, fullyQualifiedName);\n\n const { engine } = options;\n // Recorded in the metadata below so the version sync can tell a CDK project\n // from a Terraform one; undefined when no infrastructure was generated.\n const iac =\n options.infra !== 'none' ? await resolveIac(tree, options.iac) : undefined;\n\n // Recorded below and read by the declaration's predicates, so the packages\n // added here are exactly the ones the version sync will own.\n const metadata: PyRdbMetadata = { engine, ...(iac ? { iac } : {}) };\n const localDbPort = assignPort(\n tree,\n projectConfig,\n engine === 'mysql' ? 3306 : 5432,\n );\n const localDbHost = 'localhost';\n const localDbUser = engine === 'mysql' ? 'root' : 'dbadmin';\n const localDbPassword = 'password';\n const containerName = `${getNpmScope(tree)}-${databaseName}`;\n const dockerImage =\n engine === 'mysql'\n ? 'public.ecr.aws/docker/library/mysql:8.0.44'\n : 'public.ecr.aws/docker/library/postgres:17.7';\n\n const templateOptions = {\n name: normalizedModuleName,\n runtimeConfigKey: nameClassName,\n engine,\n localDbPort,\n localDbHost,\n localDbName: databaseName,\n localDbUser,\n localDbPassword,\n containerEngine,\n containerName,\n dockerImage,\n sqlmodelVersion: PY_VERSIONS.sqlmodel,\n alembicVersion: PY_VERSIONS.alembic,\n aiomysqlVersion: PY_VERSIONS.aiomysql,\n asyncpgVersion: PY_VERSIONS.asyncpg,\n boto3Version: PY_VERSIONS.boto3,\n awsLambdaPowertoolsVersion: PY_VERSIONS['aws-lambda-powertools'],\n };\n\n // Models, the connection module, the Alembic config and the migration env are\n // user-editable, so a re-run (to add infrastructure, or after a failed run)\n // must not clobber the user's schema and edits.\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files'),\n dir,\n templateOptions,\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n\n // The package barrel re-exports connection.py. `pyProjectGenerator` writes a\n // stub __init__.py when it creates the project, so the re-exports are added to\n // whatever is there rather than replacing it — which also leaves a user's own\n // additions to the barrel alone on a re-run.\n const initFilePath = joinPathFragments(\n dir,\n normalizedModuleName,\n '__init__.py',\n );\n for (const importName of ['get_engine', 'is_local_dev', 'session_context']) {\n await addPythonReExport(tree, initFilePath, '.connection', importName);\n }\n\n // config.json is framework-owned: it carries values derived from the\n // generator's options, so it converges on a re-run with changed options.\n writeJson(tree, joinPathFragments(dir, 'config.json'), {\n runtimeConfigKey: nameClassName,\n localDev: {\n containerEngine,\n containerName,\n image: dockerImage,\n port: localDbPort,\n host: localDbHost,\n dbName: databaseName,\n dbUser: localDbUser,\n dbPassword: localDbPassword,\n dbEngine: engine,\n },\n });\n\n await sharedRdbScriptsGenerator(tree, engine, DEPENDENCIES);\n const scriptsDir = relative(\n dir,\n joinPathFragments(PACKAGES_DIR, SHARED_SCRIPTS_DIR, 'src', 'rdb'),\n );\n const fs = new FsCommands(tree, DEPENDENCIES);\n\n const migrationBundleDir = joinPathFragments(\n 'dist',\n projectConfig.root,\n 'docker',\n 'migration',\n );\n const createDbUserBundleDir = joinPathFragments(\n 'dist',\n projectConfig.root,\n 'docker',\n 'create-db-user',\n );\n const migrationDockerImageTag = `${getNpmScope(tree)}-${kebabCase(options.name)}-migration:latest`;\n const createDbUserDockerImageTag = `${getNpmScope(tree)}-${kebabCase(\n options.name,\n )}-create-db-user:latest`;\n\n if (options.infra !== 'none') {\n const { bundleTargetName, bundleOutputDir } = addPythonBundleTarget(\n projectConfig,\n { pythonPlatform: 'aarch64-manylinux_2_28' },\n );\n\n projectConfig.targets['bundle-migration'] = {\n cache: true,\n inputs: ['default'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/docker/migration'],\n executor: 'nx:run-commands',\n options: {\n commands: [\n fs.rm(migrationBundleDir),\n fs.mkdir(migrationBundleDir),\n fs.cpDir(bundleOutputDir, migrationBundleDir),\n fs.cpDir(\n joinPathFragments(dir, 'migrations'),\n joinPathFragments(migrationBundleDir, 'migrations'),\n ),\n fs.cpFile(\n joinPathFragments(dir, 'alembic.ini'),\n joinPathFragments(migrationBundleDir, 'alembic.ini'),\n ),\n fs.cpFile(\n joinPathFragments(dir, 'Dockerfile.migration'),\n joinPathFragments(migrationBundleDir, 'Dockerfile'),\n ),\n ],\n parallel: false,\n },\n dependsOn: [bundleTargetName],\n };\n projectConfig.targets['bundle-create-db-user'] = {\n cache: true,\n inputs: ['default'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/docker/create-db-user'],\n executor: 'nx:run-commands',\n options: {\n commands: [\n fs.rm(createDbUserBundleDir),\n fs.mkdir(createDbUserBundleDir),\n fs.cpDir(bundleOutputDir, createDbUserBundleDir),\n fs.cpFile(\n joinPathFragments(dir, 'Dockerfile.create-db-user'),\n joinPathFragments(createDbUserBundleDir, 'Dockerfile'),\n ),\n ],\n parallel: false,\n },\n dependsOn: [bundleTargetName],\n };\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'bundle',\n 'bundle-migration',\n );\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'bundle',\n 'bundle-create-db-user',\n );\n }\n\n projectConfig.targets['pull-image'] = {\n executor: 'nx:run-commands',\n options: {\n command: `tsx ${scriptsDir}/pull-image.ts`,\n cwd: '{projectRoot}',\n },\n };\n projectConfig.targets['dev'] = {\n executor: 'nx:run-commands',\n continuous: true,\n options: {\n command: `tsx ${scriptsDir}/start-container.ts`,\n cwd: '{projectRoot}',\n },\n dependsOn: ['pull-image'],\n };\n projectConfig.targets['wait-for-db'] = {\n executor: 'nx:run-commands',\n dependsOn: ['dev'],\n options: {\n command: `tsx ${scriptsDir}/wait-for-${engine}-db.ts`,\n cwd: '{projectRoot}',\n },\n };\n projectConfig.targets.migrate = {\n executor: 'nx:run-commands',\n dependsOn: ['dev', 'wait-for-db'],\n options: {\n command: 'uv run alembic upgrade head',\n cwd: '{projectRoot}',\n env: {\n LOCAL_DEV: 'true',\n },\n },\n };\n projectConfig.targets.alembic = {\n executor: 'nx:run-commands',\n dependsOn: ['dev', 'wait-for-db'],\n options: {\n command: 'uv run alembic',\n cwd: '{projectRoot}',\n env: {\n LOCAL_DEV: 'true',\n },\n },\n };\n\n if (options.infra !== 'none') {\n if (iac === 'terraform') {\n projectConfig.targets.docker = {\n cache: IMAGE_BUILD_CACHE,\n executor: 'nx:run-commands',\n options: {\n commands: [\n `${containerEngine} build --platform linux/arm64 --provenance=false -t ${migrationDockerImageTag} ${migrationBundleDir}`,\n `${containerEngine} build --platform linux/arm64 --provenance=false -t ${createDbUserDockerImageTag} ${createDbUserBundleDir}`,\n ],\n parallel: false,\n },\n dependsOn: ['bundle-migration', 'bundle-create-db-user'],\n };\n addArtifactDependencyToTargets(projectConfig, 'docker');\n\n addDockerScanTarget(\n tree,\n {\n project: projectConfig,\n containerEngine,\n trivyTargetName: 'trivy',\n dockerTargetName: 'docker',\n imageTags: [migrationDockerImageTag, createDbUserDockerImageTag],\n },\n DEPENDENCIES,\n );\n }\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'build',\n 'bundle-migration',\n );\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'build',\n 'bundle-create-db-user',\n );\n }\n\n updateProjectConfiguration(tree, fullyQualifiedName, projectConfig);\n addGeneratorMetadata(\n tree,\n fullyQualifiedName,\n PY_RDB_GENERATOR_INFO,\n metadata,\n );\n\n if (options.infra !== 'none') {\n await sharedConstructsGenerator(tree, { iac }, DEPENDENCIES);\n await addRdbInfra(tree, {\n iac,\n projectName: fullyQualifiedName,\n projectRoot: dir,\n nameClassName,\n nameKebabCase: kebabCase(options.name),\n databasePackageAlias: normalizedModuleName,\n databaseName,\n adminUser: databaseUser,\n engine,\n migrationBundleDir,\n createDbUserBundleDir,\n framework: 'sqlmodel',\n createDbUserDockerImageTag,\n migrationDockerImageTag,\n containerEngine,\n });\n }\n\n addPyDependencies(tree, DEPENDENCIES, { metadata, projectRoot: dir });\n addTsDependencies(tree, DEPENDENCIES, { metadata });\n\n await addGeneratorMetricsIfApplicable(tree, [PY_RDB_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript', 'python'],\n });\n};\n\nexport default pyRdbGenerator;\n"],"names":["relative","generateFiles","joinPathFragments","OverwriteStrategy","readProjectConfiguration","updateProjectConfiguration","writeJson","addPyDependencies","addTsDependencies","addPythonReExport","addPythonBundleTarget","resolveContainers","declareDependencies","ownedElsewhere","addDockerScanTarget","DOCKER_DEPENDENCIES","IMAGE_BUILD_CACHE","formatFilesInSubtree","FS_DEPENDENCIES","FsCommands","resolveIac","installDependencies","addGeneratorMetricsIfApplicable","kebabCase","snakeCase","toClassName","getNpmScope","addArtifactDependencyToTargets","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","projectExists","assignPort","addRdbInfra","SHARED_CONSTRUCTS_DEPENDENCIES","sharedConstructsGenerator","PACKAGES_DIR","SHARED_SCRIPTS_DIR","SHARED_RDB_SCRIPTS_DEPENDENCIES","sharedRdbScriptsGenerator","PY_VERSIONS","pyProjectGenerator","getPyProjectDetails","isPostgres","m","engine","DEPENDENCIES","ts","name","when","root","dev","py","PY_RDB_GENERATOR_INFO","filename","pyRdbGenerator","tree","options","nameClassName","databaseUser","databaseName","containerEngine","fullyQualifiedName","dir","normalizedModuleName","directory","subDirectory","type","projectConfig","iac","infra","undefined","metadata","localDbPort","localDbHost","localDbUser","localDbPassword","containerName","dockerImage","templateOptions","runtimeConfigKey","localDbName","sqlmodelVersion","sqlmodel","alembicVersion","alembic","aiomysqlVersion","aiomysql","asyncpgVersion","asyncpg","boto3Version","boto3","awsLambdaPowertoolsVersion","dirname","overwriteStrategy","KeepExisting","initFilePath","importName","localDev","image","port","host","dbName","dbUser","dbPassword","dbEngine","scriptsDir","fs","migrationBundleDir","createDbUserBundleDir","migrationDockerImageTag","createDbUserDockerImageTag","bundleTargetName","bundleOutputDir","pythonPlatform","targets","cache","inputs","outputs","executor","commands","rm","mkdir","cpDir","cpFile","parallel","dependsOn","command","cwd","continuous","migrate","env","LOCAL_DEV","docker","project","trivyTargetName","dockerTargetName","imageTags","projectName","projectRoot","nameKebabCase","databasePackageAlias","adminUser","framework","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAEEC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EACjBC,wBAAwB,EAExBC,0BAA0B,EAC1BC,SAAS,QACJ,aAAa;AACpB,SACEC,iBAAiB,EACjBC,iBAAiB,QACZ,kCAAkC;AACzC,SAASC,iBAAiB,QAAQ,mDAAmD;AACrF,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,SACEC,mBAAmB,EACnBC,cAAc,QACT,uCAAuC;AAC9C,SACEC,mBAAmB,EACnBC,mBAAmB,EACnBC,iBAAiB,QACZ,wBAAwB;AAC/B,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,eAAe,EAAEC,UAAU,QAAQ,oBAAoB;AAChE,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,SAAS,EAAEC,SAAS,EAAEC,WAAW,QAAQ,uBAAuB;AACzE,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SACEC,8BAA8B,EAC9BC,iCAAiC,EACjCC,oBAAoB,EACpBC,gBAAgB,EAEhBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,WAAW,QAAQ,+CAA+C;AAC3E,SACEC,8BAA8B,EAC9BC,yBAAyB,QACpB,mCA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A2B;YAClE,GACAjE;QAEJ;QACAlB,kCACEwC,eACA,SACA;QAEFxC,kCACEwC,eACA,SACA;IAEJ;IAEA/D,2BAA2BmD,MAAMM,oBAAoBM;IACrDvC,qBACE2B,MACAM,oBACAT,uBACAmB;IAGF,IAAIf,QAAQa,KAAK,KAAK,QAAQ;QAC5B,MAAMnC,0BAA0BqB,MAAM;YAAEa;QAAI,GAAGvB;QAC/C,MAAMb,YAAYuB,MAAM;YACtBa;YACAqE,aAAa5E;YACb6E,aAAa5E;YACbL;YACAkF,eAAerH,UAAUkC,QAAQT,IAAI;YACrC6F,sBAAsB7E;YACtBJ;YACAkF,WAAWnF;YACXd;YACA+D;YACAC;YACAkC,WAAW;YACXhC;YACAD;YACAjD;QACF;IACF;IAEAtD,kBAAkBiD,MAAMV,cAAc;QAAE0B;QAAUmE,aAAa5E;IAAI;IACnEvD,kBAAkBgD,MAAMV,cAAc;QAAE0B;IAAS;IAEjD,MAAMlD,gCAAgCkC,MAAM;QAACH;KAAsB;IAEnE,MAAMpC,qBAAqBuC;IAC3B,OAAO,IACLnC,oBAAoBmC,MAAMC,QAAQuF,yBAAyB,EAAE;YAC3DC,WAAW;gBAAC;gBAAc;aAAS;QACrC;AACJ,EAAE;AAEF,eAAe1F,eAAe"}
@@ -42,11 +42,11 @@ exports[`smithyProjectGenerator > shape libraries > should generate a shape libr
42
42
  "executor": "nx:run-commands",
43
43
  "options": {
44
44
  "commands": [
45
- "rimraf dist/{projectRoot}/build",
46
- "rimraf dist/{projectRoot}/smithy",
47
- "make-dir dist/{projectRoot}/build",
45
+ "shx rm -rf dist/{projectRoot}/build",
46
+ "shx rm -rf dist/{projectRoot}/smithy",
47
+ "shx mkdir -p dist/{projectRoot}/build",
48
48
  "npx -y mise@2026.8.14 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
49
- "ncp dist/{projectRoot}/smithy/source/model/model.json dist/{projectRoot}/build/model.json"
49
+ "shx cp dist/{projectRoot}/smithy/source/model/model.json dist/{projectRoot}/build/model.json"
50
50
  ],
51
51
  "parallel": false,
52
52
  "cwd": "{workspaceRoot}"
@@ -119,11 +119,12 @@ exports[`smithyProjectGenerator > should generate smithy project with all custom
119
119
  "executor": "nx:run-commands",
120
120
  "options": {
121
121
  "commands": [
122
- "rimraf dist/{projectRoot}/build",
123
- "rimraf dist/{projectRoot}/smithy",
124
- "make-dir dist/{projectRoot}/build",
122
+ "shx rm -rf dist/{projectRoot}/build",
123
+ "shx rm -rf dist/{projectRoot}/smithy",
124
+ "shx mkdir -p dist/{projectRoot}/build",
125
125
  "npx -y mise@2026.8.14 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
126
- "cpy \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi --flat --rename=openapi.json"
126
+ "shx mkdir -p dist/{projectRoot}/build/openapi",
127
+ "shx cp \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi/openapi.json"
127
128
  ],
128
129
  "parallel": false,
129
130
  "cwd": "{workspaceRoot}"
@@ -176,11 +177,12 @@ exports[`smithyProjectGenerator > should generate smithy project with custom dir
176
177
  "executor": "nx:run-commands",
177
178
  "options": {
178
179
  "commands": [
179
- "rimraf dist/{projectRoot}/build",
180
- "rimraf dist/{projectRoot}/smithy",
181
- "make-dir dist/{projectRoot}/build",
180
+ "shx rm -rf dist/{projectRoot}/build",
181
+ "shx rm -rf dist/{projectRoot}/smithy",
182
+ "shx mkdir -p dist/{projectRoot}/build",
182
183
  "npx -y mise@2026.8.14 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
183
- "cpy \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi --flat --rename=openapi.json"
184
+ "shx mkdir -p dist/{projectRoot}/build/openapi",
185
+ "shx cp \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi/openapi.json"
184
186
  ],
185
187
  "parallel": false,
186
188
  "cwd": "{workspaceRoot}"
@@ -325,11 +327,12 @@ exports[`smithyProjectGenerator > should generate smithy project with default op
325
327
  "executor": "nx:run-commands",
326
328
  "options": {
327
329
  "commands": [
328
- "rimraf dist/{projectRoot}/build",
329
- "rimraf dist/{projectRoot}/smithy",
330
- "make-dir dist/{projectRoot}/build",
330
+ "shx rm -rf dist/{projectRoot}/build",
331
+ "shx rm -rf dist/{projectRoot}/smithy",
332
+ "shx mkdir -p dist/{projectRoot}/build",
331
333
  "npx -y mise@2026.8.14 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
332
- "cpy \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi --flat --rename=openapi.json"
334
+ "shx mkdir -p dist/{projectRoot}/build/openapi",
335
+ "shx cp \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi/openapi.json"
333
336
  ],
334
337
  "parallel": false,
335
338
  "cwd": "{workspaceRoot}"
@@ -468,11 +471,12 @@ exports[`smithyProjectGenerator > should generate smithy project with subdirecto
468
471
  "executor": "nx:run-commands",
469
472
  "options": {
470
473
  "commands": [
471
- "rimraf dist/{projectRoot}/build",
472
- "rimraf dist/{projectRoot}/smithy",
473
- "make-dir dist/{projectRoot}/build",
474
+ "shx rm -rf dist/{projectRoot}/build",
475
+ "shx rm -rf dist/{projectRoot}/smithy",
476
+ "shx mkdir -p dist/{projectRoot}/build",
474
477
  "npx -y mise@2026.8.14 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
475
- "cpy \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi --flat --rename=openapi.json"
478
+ "shx mkdir -p dist/{projectRoot}/build/openapi",
479
+ "shx cp \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi/openapi.json"
476
480
  ],
477
481
  "parallel": false,
478
482
  "cwd": "{workspaceRoot}"
@@ -20,19 +20,7 @@ export interface SmithyProjectMetadata {
20
20
  * `utils/smithy.ts`.
21
21
  */
22
22
  export declare const DEPENDENCIES: import("../../utils/declared-dependencies.js").DependencyDeclaration<readonly [{
23
- readonly name: "ncp";
24
- } & {
25
- versionOnly: true;
26
- }, {
27
- readonly name: "rimraf";
28
- } & {
29
- versionOnly: true;
30
- }, {
31
- readonly name: "make-dir-cli";
32
- } & {
33
- versionOnly: true;
34
- }, {
35
- readonly name: "cpy-cli";
23
+ readonly name: "shx";
36
24
  } & {
37
25
  versionOnly: true;
38
26
  }, {
@@ -50,7 +38,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies.js"
50
38
  readonly dev: true;
51
39
  readonly root: true;
52
40
  readonly when: (metadata: SmithyProjectMetadata) => boolean;
53
- }], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", SmithyProjectMetadata>[]>;
41
+ }], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", SmithyProjectMetadata>[]>;
54
42
  export declare const SMITHY_PROJECT_GENERATOR_INFO: NxGeneratorInfo;
55
43
  /**
56
44
  * The commands that build a Smithy project's model, run from the workspace root.
@@ -78,8 +78,9 @@ const BUILD_DIR = 'dist/{projectRoot}/build';
78
78
  // library is referenced by its path from the consuming project.
79
79
  `${smithyCliCommand()} build -c {projectRoot}/smithy-build.json --output ${SMITHY_OUT_DIR}`,
80
80
  ...type === 'shapes' ? [
81
- cmd.cp(`${SOURCE_PROJECTION}/model/model.json`, `${BUILD_DIR}/model.json`)
81
+ cmd.cpFile(`${SOURCE_PROJECTION}/model/model.json`, `${BUILD_DIR}/model.json`)
82
82
  ] : [
83
+ cmd.mkdir(`${BUILD_DIR}/openapi`),
83
84
  // Named after the service shape by the OpenAPI plugin, so it is matched
84
85
  // rather than named, and published under a stable name.
85
86
  cmd.cpGlobToFile(`${SOURCE_PROJECTION}/openapi/*.openapi.json`, `${BUILD_DIR}/openapi`, 'openapi.json')
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/nx-plugin/src/smithy/project/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n addProjectConfiguration,\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type Tree,\n} from '@nx/devkit';\nimport { getTsLibDetails } from '../../ts/lib/generator.js';\nimport { addTsDependencies } from '../../utils/add-dependencies.js';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../utils/declared-dependencies.js';\nimport { formatFilesInSubtree } from '../../utils/format.js';\nimport { FS_DEPENDENCIES, FsCommands } from '../../utils/fs.js';\nimport { installDependencies } from '../../utils/install.js';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics.js';\nimport { toClassName, toKebabCase } from '../../utils/names.js';\nimport { getNpmScope } from '../../utils/npm-scope.js';\nimport {\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n projectExists,\n} from '../../utils/nx.js';\nimport { getRelativePathToRootByDirectory } from '../../utils/paths.js';\nimport {\n smithyCliCommand,\n smithyMavenVersions,\n warnIfSmithyMissing,\n} from '../../utils/smithy.js';\nimport type { SmithyProjectGeneratorSchema } from './schema';\n\n/** The metadata this generator records, which its predicates read. */\nexport interface SmithyProjectMetadata {\n readonly smithyType: NonNullable<SmithyProjectGeneratorSchema['type']>;\n readonly namespace: string;\n}\n\n/**\n * Only a service project generates a Server SDK, so only a service needs the\n * bundler that turns it into the single module its backend imports. A shape\n * library assembles a model and stops.\n */\nconst isService = (metadata: SmithyProjectMetadata) =>\n metadata.smithyType === 'service';\n\n/**\n * Everything a Smithy build runs, all of it workspace tooling in the root\n * manifest rather than anything the model itself imports.\n *\n * Neither the Smithy CLI nor `mise` is among them: the compile target fetches mise\n * with `npx` and mise resolves the CLI, so neither is a workspace dependency — see\n * `utils/smithy.ts`.\n */\nexport const DEPENDENCIES = declareDependencies<SmithyProjectMetadata>()({\n ts: [\n // Added to the root by `FsCommands` as it builds each command.\n ...ownedElsewhere(FS_DEPENDENCIES),\n { name: 'rolldown', dev: true, root: true, when: isService },\n { name: 'rolldown-plugin-dts', dev: true, root: true, when: isService },\n // Resolved by `rolldown-plugin-dts` to emit the bundled declaration.\n { name: 'typescript', dev: true, root: true, when: isService },\n ],\n});\n\nexport const SMITHY_PROJECT_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\n/**\n * Where the Smithy CLI writes its artifacts, and where the build publishes the\n * ones consumers read. Both sit under `dist` so a build writes nothing into the\n * project, keeping the source tree clean and the target's outputs cacheable.\n *\n * The CLI's own output is kept beside the published tree rather than inside it:\n * it holds the generated SSDK package and its installed `node_modules`, which\n * must not be mistaken for a build artifact.\n */\nconst SMITHY_OUT_DIR = 'dist/{projectRoot}/smithy';\nconst BUILD_DIR = 'dist/{projectRoot}/build';\n\n/** The projection every generated `smithy-build.json` builds. */\nconst SOURCE_PROJECTION = `${SMITHY_OUT_DIR}/source`;\n\n/** Where the generated TypeScript Server SDK lands before it is bundled. */\nconst SSDK_CODEGEN_DIR = `${SOURCE_PROJECTION}/typescript-ssdk-codegen`;\n\n/**\n * The commands that build a Smithy project's model, run from the workspace root.\n *\n * This is the whole of a shape library's build. A service's Server SDK is built\n * separately by {@link smithyGenerateSsdkCommands}, from the codegen output this\n * leaves under {@link SMITHY_OUT_DIR}.\n */\nexport const smithyCompileCommands = (\n cmd: FsCommands<typeof DEPENDENCIES>,\n type: SmithyProjectGeneratorSchema['type'],\n): string[] => [\n cmd.rm(BUILD_DIR),\n cmd.rm(SMITHY_OUT_DIR),\n cmd.mkdir(BUILD_DIR),\n // `imports` in smithy-build.json resolve relative to that file, so a shape\n // library is referenced by its path from the consuming project.\n `${smithyCliCommand()} build -c {projectRoot}/smithy-build.json --output ${SMITHY_OUT_DIR}`,\n ...(type === 'shapes'\n ? [\n cmd.cp(\n `${SOURCE_PROJECTION}/model/model.json`,\n `${BUILD_DIR}/model.json`,\n ),\n ]\n : [\n // Named after the service shape by the OpenAPI plugin, so it is matched\n // rather than named, and published under a stable name.\n cmd.cpGlobToFile(\n `${SOURCE_PROJECTION}/openapi/*.openapi.json`,\n `${BUILD_DIR}/openapi`,\n 'openapi.json',\n ),\n ]),\n];\n\n/**\n * The commands that turn a service's generated TypeScript Server SDK into the\n * single module its consumer imports, run from the workspace root.\n *\n * Only a service has one, and it reads what the model build left behind, so this\n * runs after `compile`.\n */\nexport const smithyGenerateSsdkCommands = (): string[] => [\n // `npm` regardless of the workspace's package manager: this installs a generated\n // package under `dist` that is not a workspace member, and npm ships with Node so\n // it is always present. It reads the user's `.npmrc`, so a private registry still\n // applies. `--include=dev` because the bundler resolves types from the generated\n // package's devDependencies, which `NODE_ENV=production` would otherwise omit.\n `npm install --prefix ${SSDK_CODEGEN_DIR} --include=dev --ignore-scripts --no-audit --no-fund`,\n // Bundled straight from the generated TypeScript sources, emitting the module and\n // its declarations together — see ssdk.rolldown.config.mjs for why the sources\n // rather than a `tsc` pre-pass.\n `rolldown -c {projectRoot}/ssdk.rolldown.config.mjs`,\n];\n\n/**\n * What the model build publishes, listed per artifact rather than as the whole\n * `build` directory: a service's `generate-ssdk` writes into that directory too, and\n * restoring `compile` from cache would otherwise discard the Server SDK beside it.\n */\nexport const smithyCompileOutputs = (\n type: SmithyProjectGeneratorSchema['type'],\n): string[] => [\n `{workspaceRoot}/${SMITHY_OUT_DIR}`,\n type === 'shapes'\n ? `{workspaceRoot}/${BUILD_DIR}/model.json`\n : `{workspaceRoot}/${BUILD_DIR}/openapi`,\n];\n\n/**\n * The target that builds a service's Server SDK, shared with the migration moving\n * an existing project onto it.\n */\nexport const smithyGenerateSsdkTarget = () => ({\n cache: true,\n outputs: [`{workspaceRoot}/${BUILD_DIR}/ssdk`],\n executor: 'nx:run-commands',\n dependsOn: ['compile'],\n options: {\n commands: smithyGenerateSsdkCommands(),\n parallel: false,\n cwd: '{workspaceRoot}',\n },\n});\n\n/**\n * Write the rolldown config that bundles a service's generated Server SDK.\n *\n * Shared with the migration moving an existing project off the container build,\n * so a migrated project's config cannot drift from a freshly generated one.\n */\nexport const writeSsdkBundleConfig = (tree: Tree, projectRoot: string): void =>\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'ssdk-bundle'),\n projectRoot,\n // The config's paths are workspace-root relative, so it needs only the\n // project's root — the compile target runs from the workspace root.\n { projectRoot },\n // Generated configuration rather than anything the user edits, so a re-run\n // refreshes it — unlike the models beside it.\n { overwriteStrategy: OverwriteStrategy.Overwrite },\n );\n\nexport const smithyProjectGenerator = async (\n tree: Tree,\n options: SmithyProjectGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const cmd = new FsCommands(tree, DEPENDENCIES);\n const type = options.type ?? 'service';\n\n // Create project.json\n const { fullyQualifiedName, dir } = getTsLibDetails(tree, options);\n\n if (!projectExists(tree, fullyQualifiedName)) {\n addProjectConfiguration(tree, fullyQualifiedName, {\n name: fullyQualifiedName,\n root: dir,\n sourceRoot: joinPathFragments(dir, 'src'),\n projectType: 'library',\n targets: {\n build: {\n dependsOn:\n type === 'shapes' ? ['compile'] : ['compile', 'generate-ssdk'],\n },\n // Everything this project's build does is artifact production, so\n // `assemble` carries the same dependencies.\n assemble: {\n dependsOn:\n type === 'shapes' ? ['compile'] : ['compile', 'generate-ssdk'],\n },\n compile: {\n cache: true,\n outputs: smithyCompileOutputs(type),\n executor: 'nx:run-commands',\n options: {\n commands: smithyCompileCommands(cmd, type),\n parallel: false,\n cwd: '{workspaceRoot}',\n },\n },\n // Only a service generates a Server SDK, and it is built from what the\n // model build leaves behind.\n ...(type === 'shapes'\n ? {}\n : { 'generate-ssdk': smithyGenerateSsdkTarget() }),\n },\n });\n }\n\n const serviceName = options.serviceName ?? options.name;\n const serviceNameClassName = toClassName(serviceName);\n const serviceNameKebabCase = toKebabCase(serviceName);\n const scope = getNpmScope(tree);\n const namespace = options.namespace ?? toKebabCase(scope).replace(/-/g, '.');\n\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', type),\n dir,\n {\n namespace,\n serviceNameClassName,\n serviceNameKebabCase,\n scope,\n projectRoot: dir,\n relativePathToWorkspaceRoot: getRelativePathToRootByDirectory(dir),\n ...smithyMavenVersions(),\n },\n {\n // Smithy models are user-owned — a re-run must not discard edits\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n if (type === 'service') {\n writeSsdkBundleConfig(tree, dir);\n }\n\n // Recorded here and read by the declaration's predicates, so the packages\n // added below are exactly the ones the version sync will own.\n const metadata: SmithyProjectMetadata = { smithyType: type, namespace };\n\n addGeneratorMetadata(\n tree,\n fullyQualifiedName,\n SMITHY_PROJECT_GENERATOR_INFO,\n {\n ...metadata,\n ...(type === 'service' ? { apiName: options.name } : {}),\n },\n );\n\n // No projectRoot: a Smithy model project has no manifest of its own, and every\n // dependency here is workspace tooling the build runs rather than anything the\n // model imports.\n addTsDependencies(tree, DEPENDENCIES, { metadata });\n\n await addGeneratorMetricsIfApplicable(tree, [SMITHY_PROJECT_GENERATOR_INFO]);\n\n // On Windows the build runs the Smithy CLI from the PATH rather than through\n // mise, so flag a missing prerequisite while the project is still being set up.\n warnIfSmithyMissing();\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\nexport default smithyProjectGenerator;\n"],"names":["addProjectConfiguration","generateFiles","joinPathFragments","OverwriteStrategy","getTsLibDetails","addTsDependencies","declareDependencies","ownedElsewhere","formatFilesInSubtree","FS_DEPENDENCIES","FsCommands","installDependencies","addGeneratorMetricsIfApplicable","toClassName","toKebabCase","getNpmScope","addGeneratorMetadata","getGeneratorInfo","projectExists","getRelativePathToRootByDirectory","smithyCliCommand","smithyMavenVersions","warnIfSmithyMissing","isService","metadata","smithyType","DEPENDENCIES","ts","name","dev","root","when","SMITHY_PROJECT_GENERATOR_INFO","filename","SMITHY_OUT_DIR","BUILD_DIR","SOURCE_PROJECTION","SSDK_CODEGEN_DIR","smithyCompileCommands","cmd","type","rm","mkdir","cp","cpGlobToFile","smithyGenerateSsdkCommands","smithyCompileOutputs","smithyGenerateSsdkTarget","cache","outputs","executor","dependsOn","options","commands","parallel","cwd","writeSsdkBundleConfig","tree","projectRoot","dirname","overwriteStrategy","Overwrite","smithyProjectGenerator","fullyQualifiedName","dir","sourceRoot","projectType","targets","build","assemble","compile","serviceName","serviceNameClassName","serviceNameKebabCase","scope","namespace","replace","relativePathToWorkspaceRoot","KeepExisting","apiName","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SACEA,uBAAuB,EAEvBC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,QAEZ,aAAa;AACpB,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,SACEC,mBAAmB,EACnBC,cAAc,QACT,uCAAuC;AAC9C,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,eAAe,EAAEC,UAAU,QAAQ,oBAAoB;AAChE,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,WAAW,EAAEC,WAAW,QAAQ,uBAAuB;AAChE,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SACEC,oBAAoB,EACpBC,gBAAgB,EAEhBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,gCAAgC,QAAQ,uBAAuB;AACxE,SACEC,gBAAgB,EAChBC,mBAAmB,EACnBC,mBAAmB,QACd,wBAAwB;AAS/B;;;;CAIC,GACD,MAAMC,YAAY,CAACC,WACjBA,SAASC,UAAU,KAAK;AAE1B;;;;;;;CAOC,GACD,OAAO,MAAMC,eAAepB,sBAA6C;IACvEqB,IAAI;QACF,+DAA+D;WAC5DpB,eAAeE;QAClB;YAAEmB,MAAM;YAAYC,KAAK;YAAMC,MAAM;YAAMC,MAAMR;QAAU;QAC3D;YAAEK,MAAM;YAAuBC,KAAK;YAAMC,MAAM;YAAMC,MAAMR;QAAU;QACtE,qEAAqE;QACrE;YAAEK,MAAM;YAAcC,KAAK;YAAMC,MAAM;YAAMC,MAAMR;QAAU;KAC9D;AACH,GAAG;AAEH,OAAO,MAAMS,gCAAiDf,iBAC5D,YAAYgB,QAAQ,EACpB;AAEF;;;;;;;;CAQC,GACD,MAAMC,iBAAiB;AACvB,MAAMC,YAAY;AA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B,QAAQxB,IAAI;IACvD,MAAM4C,uBAAuB3D,YAAY0D;IACzC,MAAME,uBAAuB3D,YAAYyD;IACzC,MAAMG,QAAQ3D,YAAY0C;IAC1B,MAAMkB,YAAYvB,QAAQuB,SAAS,IAAI7D,YAAY4D,OAAOE,OAAO,CAAC,MAAM;IAExE3E,cACEwD,MACAvD,kBAAkB,YAAYyD,OAAO,EAAE,SAASnB,OAChDwB,KACA;QACEW;QACAH;QACAC;QACAC;QACAhB,aAAaM;QACba,6BAA6B1D,iCAAiC6C;QAC9D,GAAG3C,qBAAqB;IAC1B,GACA;QACE,iEAAiE;QACjEuC,mBAAmBzD,kBAAkB2E,YAAY;IACnD;IAGF,IAAItC,SAAS,WAAW;QACtBgB,sBAAsBC,MAAMO;IAC9B;IAEA,0EAA0E;IAC1E,8DAA8D;IAC9D,MAAMxC,WAAkC;QAAEC,YAAYe;QAAMmC;IAAU;IAEtE3D,qBACEyC,MACAM,oBACA/B,+BACA;QACE,GAAGR,QAAQ;QACX,GAAIgB,SAAS,YAAY;YAAEuC,SAAS3B,QAAQxB,IAAI;QAAC,IAAI,CAAC,CAAC;IACzD;IAGF,+EAA+E;IAC/E,+EAA+E;IAC/E,iBAAiB;IACjBvB,kBAAkBoD,MAAM/B,cAAc;QAAEF;IAAS;IAEjD,MAAMZ,gCAAgC6C,MAAM;QAACzB;KAA8B;IAE3E,6EAA6E;IAC7E,gFAAgF;IAChFV;IAEA,MAAMd,qBAAqBiD;IAC3B,OAAO,IACL9C,oBAAoB8C,MAAML,QAAQ4B,yBAAyB,EAAE;YAC3DC,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;AAEF,eAAenB,uBAAuB"}
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/smithy/project/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n addProjectConfiguration,\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type Tree,\n} from '@nx/devkit';\nimport { getTsLibDetails } from '../../ts/lib/generator.js';\nimport { addTsDependencies } from '../../utils/add-dependencies.js';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../utils/declared-dependencies.js';\nimport { formatFilesInSubtree } from '../../utils/format.js';\nimport { FS_DEPENDENCIES, FsCommands } from '../../utils/fs.js';\nimport { installDependencies } from '../../utils/install.js';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics.js';\nimport { toClassName, toKebabCase } from '../../utils/names.js';\nimport { getNpmScope } from '../../utils/npm-scope.js';\nimport {\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n projectExists,\n} from '../../utils/nx.js';\nimport { getRelativePathToRootByDirectory } from '../../utils/paths.js';\nimport {\n smithyCliCommand,\n smithyMavenVersions,\n warnIfSmithyMissing,\n} from '../../utils/smithy.js';\nimport type { SmithyProjectGeneratorSchema } from './schema';\n\n/** The metadata this generator records, which its predicates read. */\nexport interface SmithyProjectMetadata {\n readonly smithyType: NonNullable<SmithyProjectGeneratorSchema['type']>;\n readonly namespace: string;\n}\n\n/**\n * Only a service project generates a Server SDK, so only a service needs the\n * bundler that turns it into the single module its backend imports. A shape\n * library assembles a model and stops.\n */\nconst isService = (metadata: SmithyProjectMetadata) =>\n metadata.smithyType === 'service';\n\n/**\n * Everything a Smithy build runs, all of it workspace tooling in the root\n * manifest rather than anything the model itself imports.\n *\n * Neither the Smithy CLI nor `mise` is among them: the compile target fetches mise\n * with `npx` and mise resolves the CLI, so neither is a workspace dependency — see\n * `utils/smithy.ts`.\n */\nexport const DEPENDENCIES = declareDependencies<SmithyProjectMetadata>()({\n ts: [\n // Added to the root by `FsCommands` as it builds each command.\n ...ownedElsewhere(FS_DEPENDENCIES),\n { name: 'rolldown', dev: true, root: true, when: isService },\n { name: 'rolldown-plugin-dts', dev: true, root: true, when: isService },\n // Resolved by `rolldown-plugin-dts` to emit the bundled declaration.\n { name: 'typescript', dev: true, root: true, when: isService },\n ],\n});\n\nexport const SMITHY_PROJECT_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\n/**\n * Where the Smithy CLI writes its artifacts, and where the build publishes the\n * ones consumers read. Both sit under `dist` so a build writes nothing into the\n * project, keeping the source tree clean and the target's outputs cacheable.\n *\n * The CLI's own output is kept beside the published tree rather than inside it:\n * it holds the generated SSDK package and its installed `node_modules`, which\n * must not be mistaken for a build artifact.\n */\nconst SMITHY_OUT_DIR = 'dist/{projectRoot}/smithy';\nconst BUILD_DIR = 'dist/{projectRoot}/build';\n\n/** The projection every generated `smithy-build.json` builds. */\nconst SOURCE_PROJECTION = `${SMITHY_OUT_DIR}/source`;\n\n/** Where the generated TypeScript Server SDK lands before it is bundled. */\nconst SSDK_CODEGEN_DIR = `${SOURCE_PROJECTION}/typescript-ssdk-codegen`;\n\n/**\n * The commands that build a Smithy project's model, run from the workspace root.\n *\n * This is the whole of a shape library's build. A service's Server SDK is built\n * separately by {@link smithyGenerateSsdkCommands}, from the codegen output this\n * leaves under {@link SMITHY_OUT_DIR}.\n */\nexport const smithyCompileCommands = (\n cmd: FsCommands<typeof DEPENDENCIES>,\n type: SmithyProjectGeneratorSchema['type'],\n): string[] => [\n cmd.rm(BUILD_DIR),\n cmd.rm(SMITHY_OUT_DIR),\n cmd.mkdir(BUILD_DIR),\n // `imports` in smithy-build.json resolve relative to that file, so a shape\n // library is referenced by its path from the consuming project.\n `${smithyCliCommand()} build -c {projectRoot}/smithy-build.json --output ${SMITHY_OUT_DIR}`,\n ...(type === 'shapes'\n ? [\n cmd.cpFile(\n `${SOURCE_PROJECTION}/model/model.json`,\n `${BUILD_DIR}/model.json`,\n ),\n ]\n : [\n cmd.mkdir(`${BUILD_DIR}/openapi`),\n // Named after the service shape by the OpenAPI plugin, so it is matched\n // rather than named, and published under a stable name.\n cmd.cpGlobToFile(\n `${SOURCE_PROJECTION}/openapi/*.openapi.json`,\n `${BUILD_DIR}/openapi`,\n 'openapi.json',\n ),\n ]),\n];\n\n/**\n * The commands that turn a service's generated TypeScript Server SDK into the\n * single module its consumer imports, run from the workspace root.\n *\n * Only a service has one, and it reads what the model build left behind, so this\n * runs after `compile`.\n */\nexport const smithyGenerateSsdkCommands = (): string[] => [\n // `npm` regardless of the workspace's package manager: this installs a generated\n // package under `dist` that is not a workspace member, and npm ships with Node so\n // it is always present. It reads the user's `.npmrc`, so a private registry still\n // applies. `--include=dev` because the bundler resolves types from the generated\n // package's devDependencies, which `NODE_ENV=production` would otherwise omit.\n `npm install --prefix ${SSDK_CODEGEN_DIR} --include=dev --ignore-scripts --no-audit --no-fund`,\n // Bundled straight from the generated TypeScript sources, emitting the module and\n // its declarations together — see ssdk.rolldown.config.mjs for why the sources\n // rather than a `tsc` pre-pass.\n `rolldown -c {projectRoot}/ssdk.rolldown.config.mjs`,\n];\n\n/**\n * What the model build publishes, listed per artifact rather than as the whole\n * `build` directory: a service's `generate-ssdk` writes into that directory too, and\n * restoring `compile` from cache would otherwise discard the Server SDK beside it.\n */\nexport const smithyCompileOutputs = (\n type: SmithyProjectGeneratorSchema['type'],\n): string[] => [\n `{workspaceRoot}/${SMITHY_OUT_DIR}`,\n type === 'shapes'\n ? `{workspaceRoot}/${BUILD_DIR}/model.json`\n : `{workspaceRoot}/${BUILD_DIR}/openapi`,\n];\n\n/**\n * The target that builds a service's Server SDK, shared with the migration moving\n * an existing project onto it.\n */\nexport const smithyGenerateSsdkTarget = () => ({\n cache: true,\n outputs: [`{workspaceRoot}/${BUILD_DIR}/ssdk`],\n executor: 'nx:run-commands',\n dependsOn: ['compile'],\n options: {\n commands: smithyGenerateSsdkCommands(),\n parallel: false,\n cwd: '{workspaceRoot}',\n },\n});\n\n/**\n * Write the rolldown config that bundles a service's generated Server SDK.\n *\n * Shared with the migration moving an existing project off the container build,\n * so a migrated project's config cannot drift from a freshly generated one.\n */\nexport const writeSsdkBundleConfig = (tree: Tree, projectRoot: string): void =>\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'ssdk-bundle'),\n projectRoot,\n // The config's paths are workspace-root relative, so it needs only the\n // project's root — the compile target runs from the workspace root.\n { projectRoot },\n // Generated configuration rather than anything the user edits, so a re-run\n // refreshes it — unlike the models beside it.\n { overwriteStrategy: OverwriteStrategy.Overwrite },\n );\n\nexport const smithyProjectGenerator = async (\n tree: Tree,\n options: SmithyProjectGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const cmd = new FsCommands(tree, DEPENDENCIES);\n const type = options.type ?? 'service';\n\n // Create project.json\n const { fullyQualifiedName, dir } = getTsLibDetails(tree, options);\n\n if (!projectExists(tree, fullyQualifiedName)) {\n addProjectConfiguration(tree, fullyQualifiedName, {\n name: fullyQualifiedName,\n root: dir,\n sourceRoot: joinPathFragments(dir, 'src'),\n projectType: 'library',\n targets: {\n build: {\n dependsOn:\n type === 'shapes' ? ['compile'] : ['compile', 'generate-ssdk'],\n },\n // Everything this project's build does is artifact production, so\n // `assemble` carries the same dependencies.\n assemble: {\n dependsOn:\n type === 'shapes' ? ['compile'] : ['compile', 'generate-ssdk'],\n },\n compile: {\n cache: true,\n outputs: smithyCompileOutputs(type),\n executor: 'nx:run-commands',\n options: {\n commands: smithyCompileCommands(cmd, type),\n parallel: false,\n cwd: '{workspaceRoot}',\n },\n },\n // Only a service generates a Server SDK, and it is built from what the\n // model build leaves behind.\n ...(type === 'shapes'\n ? {}\n : { 'generate-ssdk': smithyGenerateSsdkTarget() }),\n },\n });\n }\n\n const serviceName = options.serviceName ?? options.name;\n const serviceNameClassName = toClassName(serviceName);\n const serviceNameKebabCase = toKebabCase(serviceName);\n const scope = getNpmScope(tree);\n const namespace = options.namespace ?? toKebabCase(scope).replace(/-/g, '.');\n\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', type),\n dir,\n {\n namespace,\n serviceNameClassName,\n serviceNameKebabCase,\n scope,\n projectRoot: dir,\n relativePathToWorkspaceRoot: getRelativePathToRootByDirectory(dir),\n ...smithyMavenVersions(),\n },\n {\n // Smithy models are user-owned — a re-run must not discard edits\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n if (type === 'service') {\n writeSsdkBundleConfig(tree, dir);\n }\n\n // Recorded here and read by the declaration's predicates, so the packages\n // added below are exactly the ones the version sync will own.\n const metadata: SmithyProjectMetadata = { smithyType: type, namespace };\n\n addGeneratorMetadata(\n tree,\n fullyQualifiedName,\n SMITHY_PROJECT_GENERATOR_INFO,\n {\n ...metadata,\n ...(type === 'service' ? { apiName: options.name } : {}),\n },\n );\n\n // No projectRoot: a Smithy model project has no manifest of its own, and every\n // dependency here is workspace tooling the build runs rather than anything the\n // model imports.\n addTsDependencies(tree, DEPENDENCIES, { metadata });\n\n await addGeneratorMetricsIfApplicable(tree, [SMITHY_PROJECT_GENERATOR_INFO]);\n\n // On Windows the build runs the Smithy CLI from the PATH rather than through\n // mise, so flag a missing prerequisite while the project is still being set up.\n warnIfSmithyMissing();\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\nexport default smithyProjectGenerator;\n"],"names":["addProjectConfiguration","generateFiles","joinPathFragments","OverwriteStrategy","getTsLibDetails","addTsDependencies","declareDependencies","ownedElsewhere","formatFilesInSubtree","FS_DEPENDENCIES","FsCommands","installDependencies","addGeneratorMetricsIfApplicable","toClassName","toKebabCase","getNpmScope","addGeneratorMetadata","getGeneratorInfo","projectExists","getRelativePathToRootByDirectory","smithyCliCommand","smithyMavenVersions","warnIfSmithyMissing","isService","metadata","smithyType","DEPENDENCIES","ts","name","dev","root","when","SMITHY_PROJECT_GENERATOR_INFO","filename","SMITHY_OUT_DIR","BUILD_DIR","SOURCE_PROJECTION","SSDK_CODEGEN_DIR","smithyCompileCommands","cmd","type","rm","mkdir","cpFile","cpGlobToFile","smithyGenerateSsdkCommands","smithyCompileOutputs","smithyGenerateSsdkTarget","cache","outputs","executor","dependsOn","options","commands","parallel","cwd","writeSsdkBundleConfig","tree","projectRoot","dirname","overwriteStrategy","Overwrite","smithyProjectGenerator","fullyQualifiedName","dir","sourceRoot","projectType","targets","build","assemble","compile","serviceName","serviceNameClassName","serviceNameKebabCase","scope","namespace","replace","relativePathToWorkspaceRoot","KeepExisting","apiName","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SACEA,uBAAuB,EAEvBC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,QAEZ,aAAa;AACpB,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,SACEC,mBAAmB,EACnBC,cAAc,QACT,uCAAuC;AAC9C,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,eAAe,EAAEC,UAAU,QAAQ,oBAAoB;AAChE,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,WAAW,EAAEC,WAAW,QAAQ,uBAAuB;AAChE,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SACEC,oBAAoB,EACpBC,gBAAgB,EAEhBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,gCAAgC,QAAQ,uBAAuB;AACxE,SACEC,gBAAgB,EAChBC,mBAAmB,EACnBC,mBAAmB,QACd,wBAAwB;AAS/B;;;;CAIC,GACD,MAAMC,YAAY,CAACC,WACjBA,SAASC,UAAU,KAAK;AAE1B;;;;;;;CAOC,GACD,OAAO,MAAMC,eAAepB,sBAA6C;IACvEqB,IAAI;QACF,+DAA+D;WAC5DpB,eAAeE;QAClB;YAAEmB,MAAM;YAAYC,KAAK;YAAMC,MAAM;YAAMC,MAAMR;QAAU;QAC3D;YAAEK,MAAM;YAAuBC,KAAK;YAAMC,MAAM;YAAMC,MAAMR;QAAU;QACtE,qEAAqE;QACrE;YAAEK,MAAM;YAAcC,KAAK;YAAMC,MAAM;YAAMC,MAAMR;QAAU;KAC9D;AACH,GAAG;AAEH,OAA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ENDENCIES: import("../../utils/declared-dependencies.js"
19
19
  readonly name: "@tanstack/react-query-devtools";
20
20
  }, {
21
21
  readonly name: "@smithy/types";
22
- }], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
22
+ }], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
23
23
  export declare const SMITHY_REACT_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
24
24
  export declare const smithyReactConnectionGenerator: (tree: Tree, options: SmithyReactConnectionGeneratorSchema) => Promise<GeneratorCallback>;
25
25
  export default smithyReactConnectionGenerator;
@@ -1,6 +1,9 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`tsSmithyApiGenerator > should configure git ignores for generated code > gitignore 1`] = `"src/generated"`;
3
+ exports[`tsSmithyApiGenerator > should configure git ignores for generated code > gitignore 1`] = `
4
+ "**/rolldown.config.*.*js
5
+ src/generated"
6
+ `;
4
7
 
5
8
  exports[`tsSmithyApiGenerator > should generate smithy ts api with Cognito auth > cognito-auth-infra.ts 1`] = `
6
9
  "import { Construct } from 'constructs';
@@ -1897,9 +1900,9 @@ exports[`tsSmithyApiGenerator > should generate smithy ts api with default optio
1897
1900
  "executor": "nx:run-commands",
1898
1901
  "options": {
1899
1902
  "commands": [
1900
- "rimraf {projectRoot}/src/generated",
1901
- "make-dir {projectRoot}/src/generated",
1902
- "ncp dist/test-api/model/build/ssdk {projectRoot}/src/generated/ssdk"
1903
+ "shx rm -rf {projectRoot}/src/generated",
1904
+ "shx mkdir -p {projectRoot}/src/generated",
1905
+ "shx cp -R dist/test-api/model/build/ssdk/. {projectRoot}/src/generated/ssdk"
1903
1906
  ],
1904
1907
  "parallel": false
1905
1908
  },
@@ -2107,11 +2110,12 @@ exports[`tsSmithyApiGenerator > should generate smithy ts api with default optio
2107
2110
  "executor": "nx:run-commands",
2108
2111
  "options": {
2109
2112
  "commands": [
2110
- "rimraf dist/{projectRoot}/build",
2111
- "rimraf dist/{projectRoot}/smithy",
2112
- "make-dir dist/{projectRoot}/build",
2113
+ "shx rm -rf dist/{projectRoot}/build",
2114
+ "shx rm -rf dist/{projectRoot}/smithy",
2115
+ "shx mkdir -p dist/{projectRoot}/build",
2113
2116
  "npx -y mise@2026.8.14 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
2114
- "cpy \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi --flat --rename=openapi.json"
2117
+ "shx mkdir -p dist/{projectRoot}/build/openapi",
2118
+ "shx cp \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi/openapi.json"
2115
2119
  ],
2116
2120
  "parallel": false,
2117
2121
  "cwd": "{workspaceRoot}"
@@ -39,19 +39,7 @@ export declare const DEPENDENCIES: import("../../../utils/declared-dependencies.
39
39
  readonly dev: true;
40
40
  readonly root: true;
41
41
  }, {
42
- readonly name: "ncp";
43
- } & {
44
- versionOnly: true;
45
- }, {
46
- readonly name: "rimraf";
47
- } & {
48
- versionOnly: true;
49
- }, {
50
- readonly name: "make-dir-cli";
51
- } & {
52
- versionOnly: true;
53
- }, {
54
- readonly name: "cpy-cli";
42
+ readonly name: "shx";
55
43
  } & {
56
44
  versionOnly: true;
57
45
  }, {
@@ -203,7 +203,7 @@ export const tsSmithyApiGenerator = async (tree, options)=>{
203
203
  commands: [
204
204
  cmd.rm(generatedSrcDirFromRoot),
205
205
  cmd.mkdir(generatedSrcDirFromRoot),
206
- cmd.cp(joinPathFragments('dist', modelProjectConfig.root, 'build', 'ssdk'), joinPathFragments(generatedSrcDirFromRoot, 'ssdk'))
206
+ cmd.cpDir(joinPathFragments('dist', modelProjectConfig.root, 'build', 'ssdk'), joinPathFragments(generatedSrcDirFromRoot, 'ssdk'))
207
207
  ],
208
208
  parallel: false
209
209
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/smithy/ts/api/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport tsProjectGenerator, {\n getTsLibDetails,\n} from '../../../ts/lib/generator.js';\nimport { addTsDependencies } from '../../../utils/add-dependencies.js';\nimport {\n API_CONSTRUCTS_DEPENDENCIES,\n API_CONSTRUCTS_PY_DEPENDENCIES,\n addApiGatewayInfra,\n} from '../../../utils/api-constructs/api-constructs.js';\nimport { addSharedConstructsOpenApiMetadataGenerateTarget } from '../../../utils/api-constructs/open-api-metadata.js';\nimport {\n addTypeScriptBundleTarget,\n BUNDLE_DEPENDENCIES,\n} from '../../../utils/bundle/bundle.js';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../../utils/declared-dependencies.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { FS_DEPENDENCIES, FsCommands } from '../../../utils/fs.js';\nimport { updateGitIgnore } from '../../../utils/git.js';\nimport { resolveIac } from '../../../utils/iac.js';\nimport { installDependencies } from '../../../utils/install.js';\nimport { addGeneratorMetricsIfApplicable } from '../../../utils/metrics.js';\nimport { esmVars } from '../../../utils/module-format.js';\nimport { toClassName, toKebabCase } from '../../../utils/names.js';\nimport {\n addDependencyToTargetIfNotPresent,\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n normalizeTargetKeyOrder,\n readProjectConfigurationUnqualified,\n} from '../../../utils/nx.js';\nimport { assignPort } from '../../../utils/port.js';\nimport {\n SHARED_CONSTRUCTS_DEPENDENCIES,\n sharedConstructsGenerator,\n} from '../../../utils/shared-constructs.js';\nimport type { IacMetadata } from '../../../utils/shared-constructs-constants.js';\nimport smithyProjectGenerator from '../../project/generator.js';\nimport type { TsSmithyApiGeneratorSchema } from './schema';\n\n/** The metadata this generator records, which its predicates read. */\nexport interface TsSmithyApiMetadata extends IacMetadata {\n readonly apiName: string;\n readonly auth: TsSmithyApiGeneratorSchema['auth'];\n readonly modelProject: string;\n}\n\n// Each entry names the branch it belongs to, so the same declaration drives both\n// adding and the version sync.\nexport const DEPENDENCIES = declareDependencies<TsSmithyApiMetadata>()({\n ts: [\n { name: '@smithy/server-apigateway' },\n { name: '@smithy/server-node' },\n { name: '@middy/core' },\n { name: '@aws-lambda-powertools/logger' },\n { name: '@aws-lambda-powertools/parameters' },\n { name: '@aws-lambda-powertools/tracer' },\n { name: '@aws-lambda-powertools/metrics' },\n { name: '@aws-sdk/client-appconfigdata' },\n // The custom authorizer handler parses its event.\n { name: '@aws-lambda-powertools/parser', when: (m) => m.auth === 'custom' },\n { name: '@types/aws-lambda', dev: true },\n // tsx runs the local server from the workspace root.\n { name: 'tsx', dev: true, root: true },\n ...ownedElsewhere(FS_DEPENDENCIES),\n ...ownedElsewhere(API_CONSTRUCTS_DEPENDENCIES),\n ...ownedElsewhere(BUNDLE_DEPENDENCIES),\n ...ownedElsewhere(SHARED_CONSTRUCTS_DEPENDENCIES),\n ],\n py: ownedElsewhere(API_CONSTRUCTS_PY_DEPENDENCIES),\n});\n\nexport const TS_SMITHY_API_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport const tsSmithyApiGenerator = async (\n tree: Tree,\n options: TsSmithyApiGeneratorSchema,\n): Promise<GeneratorCallback> => {\n if (\n (options.infra as string) !== 'rest-lambda' &&\n (options.infra as string) !== 'none'\n ) {\n throw new Error(\n `Unsupported infra '${options.infra}' for Smithy TypeScript API. ` +\n `Only 'rest-lambda' (API Gateway REST API) is supported.`,\n );\n }\n\n const integrationPattern = getIntegrationPattern(options);\n const apiNameClassName = toClassName(options.name);\n const apiNameKebabCase = toKebabCase(options.name);\n const { fullyQualifiedName: backendFullyQualifiedName, dir } =\n getTsLibDetails(tree, options);\n const modelProjectName = `${apiNameKebabCase}-model`;\n\n let projectExists: boolean;\n try {\n readProjectConfigurationUnqualified(tree, backendFullyQualifiedName);\n projectExists = true;\n } catch {\n projectExists = false;\n }\n\n if (!projectExists) {\n // Generate the model project\n await smithyProjectGenerator(tree, {\n name: modelProjectName,\n serviceName: apiNameClassName,\n namespace: options.namespace,\n directory: dir,\n subDirectory: 'model',\n preferInstallDependencies: false,\n });\n\n // Generate the backend project\n await tsProjectGenerator(tree, {\n name: options.name,\n directory: dir,\n subDirectory: 'backend',\n preferInstallDependencies: false,\n });\n }\n\n // Add metadata to associate backend project with model project\n const modelProjectConfig = readProjectConfigurationUnqualified(\n tree,\n modelProjectName,\n );\n updateProjectConfiguration(tree, modelProjectConfig.name, {\n ...modelProjectConfig,\n metadata: {\n ...modelProjectConfig.metadata,\n backendProject: backendFullyQualifiedName,\n } as any,\n });\n\n // Recorded in the metadata below so the version sync can tell a CDK\n // project from a Terraform one; undefined when no infrastructure was\n // generated, in which case neither provider's packages were added.\n const iac =\n options.infra !== 'none' ? await resolveIac(tree, options.iac) : undefined;\n\n // Recorded here and read by the declaration's predicates, so the packages\n // added below are exactly the ones the version sync will own.\n const metadata: TsSmithyApiMetadata = {\n apiName: options.name,\n auth: options.auth,\n modelProject: modelProjectConfig.name,\n ...(iac ? { iac } : {}),\n };\n\n addGeneratorMetadata(\n tree,\n backendFullyQualifiedName,\n TS_SMITHY_API_GENERATOR_INFO,\n metadata,\n );\n\n const backendProjectConfig = readProjectConfigurationUnqualified(\n tree,\n backendFullyQualifiedName,\n );\n const port = assignPort(tree, backendProjectConfig, 3001);\n\n // Delete default index.ts with \"hello\" function\n tree.delete(joinPathFragments(backendProjectConfig.sourceRoot, 'index.ts'));\n\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files'),\n backendProjectConfig.sourceRoot,\n {\n apiNameClassName,\n port,\n ...esmVars(tree),\n },\n );\n\n if (options.infra !== 'none') {\n if (options.auth === 'custom') {\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n '..',\n '..',\n '..',\n 'utils',\n 'api-constructs',\n 'files',\n 'cdk',\n 'authorizer',\n 'rest',\n ),\n backendProjectConfig.sourceRoot,\n {},\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n }\n\n // Add infrastructure\n await sharedConstructsGenerator(\n tree,\n {\n iac,\n },\n DEPENDENCIES,\n );\n await addApiGatewayInfra(\n tree,\n {\n iac,\n apiProjectName: backendFullyQualifiedName,\n apiNameClassName,\n apiNameKebabCase,\n auth: options.auth,\n constructType: 'rest',\n backend: {\n type: 'smithy',\n bundleOutputDir: joinPathFragments(\n 'dist',\n backendProjectConfig.root,\n 'bundle',\n ),\n integrationPattern,\n ...(options.auth === 'custom' && {\n authorizerBundleOutputDir: joinPathFragments(\n 'dist',\n backendProjectConfig.root,\n 'bundle',\n 'authorizer',\n ),\n }),\n },\n },\n DEPENDENCIES,\n );\n addSharedConstructsOpenApiMetadataGenerateTarget(tree, {\n iac,\n apiNameKebabCase,\n specPath: joinPathFragments(\n 'dist',\n modelProjectConfig.root,\n 'build',\n 'openapi',\n 'openapi.json',\n ),\n specBuildTargetName: `${modelProjectConfig.name}:build`,\n integrationPattern,\n });\n\n // Add bundle target using rolldown\n await addTypeScriptBundleTarget(\n tree,\n backendProjectConfig,\n {\n targetFilePath: 'src/handler.ts',\n external: [/@aws-sdk\\/.*/], // lambda runtime provides aws sdk\n },\n DEPENDENCIES,\n );\n\n if (options.auth === 'custom') {\n await addTypeScriptBundleTarget(\n tree,\n backendProjectConfig,\n {\n targetFilePath: 'src/authorizer.ts',\n bundleOutputDir: 'authorizer',\n external: [/@aws-sdk\\/.*/],\n },\n DEPENDENCIES,\n );\n }\n }\n\n const cmd = new FsCommands(tree, DEPENDENCIES);\n const generatedSrcDirFromRoot = '{projectRoot}/src/generated';\n\n // Target for copying the ssdk built by the model\n backendProjectConfig.targets['copy-ssdk'] = {\n cache: true,\n inputs: [\n {\n dependentTasksOutputFiles: '**/*',\n },\n ],\n executor: 'nx:run-commands',\n options: {\n commands: [\n cmd.rm(generatedSrcDirFromRoot),\n cmd.mkdir(generatedSrcDirFromRoot),\n cmd.cp(\n joinPathFragments('dist', modelProjectConfig.root, 'build', 'ssdk'),\n joinPathFragments(generatedSrcDirFromRoot, 'ssdk'),\n ),\n ],\n parallel: false,\n },\n outputs: ['{projectRoot}/src/generated'],\n dependsOn: [`${modelProjectConfig.name}:build`],\n };\n addDependencyToTargetIfNotPresent(\n backendProjectConfig,\n 'compile',\n 'copy-ssdk',\n );\n\n // Add a project which continuously copies based on changes to the model project\n // This allows the \"serve\" target to hot reload when the smithy model is changed\n backendProjectConfig.targets['watch-copy-ssdk'] = {\n executor: 'nx:run-commands',\n continuous: true,\n options: {\n command: `nx watch --projects=${modelProjectConfig.name} --includeDependencies -- nx run ${backendFullyQualifiedName}:copy-ssdk`,\n },\n };\n\n // Add serve target for running the server locally\n backendProjectConfig.targets.serve = normalizeTargetKeyOrder({\n executor: 'nx:run-commands',\n continuous: true,\n dependsOn: ['copy-ssdk', 'watch-copy-ssdk'],\n options: {\n command: 'tsx --watch src/local-server.ts',\n cwd: '{projectRoot}',\n },\n });\n\n const existingDevDependsOn =\n backendProjectConfig.targets['dev']?.dependsOn ?? [];\n\n backendProjectConfig.targets['dev'] = normalizeTargetKeyOrder({\n ...backendProjectConfig.targets.serve,\n // Own copy of dependsOn so adding dev dependencies below doesn't\n // mutate the shared array referenced by the serve target.\n dependsOn: [...(backendProjectConfig.targets.serve.dependsOn ?? [])],\n options: {\n ...backendProjectConfig.targets.serve.options,\n env: {\n LOCAL_DEV: 'true',\n },\n },\n });\n\n // Preserve any dependencies added to dev by connection generators\n for (const dependency of existingDevDependsOn) {\n addDependencyToTargetIfNotPresent(backendProjectConfig, 'dev', dependency);\n }\n\n // Ignore generated code\n updateGitIgnore(tree, backendProjectConfig.root, (patterns) => [\n ...patterns,\n 'src/generated',\n ]);\n\n updateProjectConfiguration(\n tree,\n backendFullyQualifiedName,\n backendProjectConfig,\n );\n\n addTsDependencies(tree, DEPENDENCIES, {\n metadata,\n projectRoot: backendProjectConfig.root,\n });\n\n await addGeneratorMetricsIfApplicable(tree, [TS_SMITHY_API_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\nconst getIntegrationPattern = (\n options: TsSmithyApiGeneratorSchema,\n): 'isolated' | 'shared' => options.integrationPattern ?? 'isolated';\n\nexport default tsSmithyApiGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","tsProjectGenerator","getTsLibDetails","addTsDependencies","API_CONSTRUCTS_DEPENDENCIES","API_CONSTRUCTS_PY_DEPENDENCIES","addApiGatewayInfra","addSharedConstructsOpenApiMetadataGenerateTarget","addTypeScriptBundleTarget","BUNDLE_DEPENDENCIES","declareDependencies","ownedElsewhere","formatFilesInSubtree","FS_DEPENDENCIES","FsCommands","updateGitIgnore","resolveIac","installDependencies","addGeneratorMetricsIfApplicable","esmVars","toClassName","toKebabCase","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","normalizeTargetKeyOrder","readProjectConfigurationUnqualified","assignPort","SHARED_CONSTRUCTS_DEPENDENCIES","sharedConstructsGenerator","smithyProjectGenerator","DEPENDENCIES","ts","name","when","m","auth","dev","root","py","TS_SMITHY_API_GENERATOR_INFO","filename","tsSmithyApiGenerator","tree","options","infra","Error","integrationPattern","getIntegrationPattern","apiNameClassName","apiNameKebabCase","fullyQualifiedName","backendFullyQualifiedName","dir","modelProjectName","projectExists","serviceName","namespace","directory","subDirectory","preferInstallDependencies","modelProjectConfig","metadata","backendProject","iac","undefined","apiName","modelProject","backendProjectConfig","port","delete","sourceRoot","dirname","overwriteStrategy","KeepExisting","apiProjectName","constructType","backend","type","bundleOutputDir","authorizerBundleOutputDir","specPath","specBuildTargetName","targetFilePath","external","cmd","generatedSrcDirFromRoot","targets","cache","inputs","dependentTasksOutputFiles","executor","commands","rm","mkdir","cp","parallel","outputs","dependsOn","continuous","command","serve","cwd","existingDevDependsOn","env","LOCAL_DEV","dependency","patterns","projectRoot","languages"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAEjBC,0BAA0B,QACrB,aAAa;AACpB,OAAOC,sBACLC,eAAe,QACV,+BAA+B;AACtC,SAASC,iBAAiB,QAAQ,qCAAqC;AACvE,SACEC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,kBAAkB,QACb,kDAAkD;AACzD,SAASC,gDAAgD,QAAQ,qD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,CAACc,KAAK,GAAG5E,wBAAwB;QAC3DkE,UAAU;QACVQ,YAAY;QACZD,WAAW;YAAC;YAAa;SAAkB;QAC3CtD,SAAS;YACPwD,SAAS;YACTE,KAAK;QACP;IACF;IAEA,MAAMC,uBACJnC,qBAAqBmB,OAAO,CAAC,MAAM,EAAEW,aAAa,EAAE;IAEtD9B,qBAAqBmB,OAAO,CAAC,MAAM,GAAG9D,wBAAwB;QAC5D,GAAG2C,qBAAqBmB,OAAO,CAACc,KAAK;QACrC,iEAAiE;QACjE,0DAA0D;QAC1DH,WAAW;eAAK9B,qBAAqBmB,OAAO,CAACc,KAAK,CAACH,SAAS,IAAI,EAAE;SAAE;QACpEtD,SAAS;YACP,GAAGwB,qBAAqBmB,OAAO,CAACc,KAAK,CAACzD,OAAO;YAC7C4D,KAAK;gBACHC,WAAW;YACb;QACF;IACF;IAEA,kEAAkE;IAClE,KAAK,MAAMC,cAAcH,qBAAsB;QAC7CjF,kCAAkC8C,sBAAsB,OAAOsC;IACjE;IAEA,wBAAwB;IACxB3F,gBAAgB4B,MAAMyB,qBAAqB9B,IAAI,EAAE,CAACqE,WAAa;eAC1DA;YACH;SACD;IAED3G,2BACE2C,MACAS,2BACAgB;IAGFjE,kBAAkBwC,MAAMZ,cAAc;QACpC+B;QACA8C,aAAaxC,qBAAqB9B,IAAI;IACxC;IAEA,MAAMpB,gCAAgCyB,MAAM;QAACH;KAA6B;IAE1E,MAAM5B,qBAAqB+B;IAC3B,OAAO,IACL1B,oBAAoB0B,MAAMC,QAAQgB,yBAAyB,EAAE;YAC3DiD,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;AAEF,MAAM7D,wBAAwB,CAC5BJ,UAC0BA,QAAQG,kBAAkB,IAAI;AAE1D,eAAeL,qBAAqB"}
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/smithy/ts/api/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport tsProjectGenerator, {\n getTsLibDetails,\n} from '../../../ts/lib/generator.js';\nimport { addTsDependencies } from '../../../utils/add-dependencies.js';\nimport {\n API_CONSTRUCTS_DEPENDENCIES,\n API_CONSTRUCTS_PY_DEPENDENCIES,\n addApiGatewayInfra,\n} from '../../../utils/api-constructs/api-constructs.js';\nimport { addSharedConstructsOpenApiMetadataGenerateTarget } from '../../../utils/api-constructs/open-api-metadata.js';\nimport {\n addTypeScriptBundleTarget,\n BUNDLE_DEPENDENCIES,\n} from '../../../utils/bundle/bundle.js';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../../utils/declared-dependencies.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { FS_DEPENDENCIES, FsCommands } from '../../../utils/fs.js';\nimport { updateGitIgnore } from '../../../utils/git.js';\nimport { resolveIac } from '../../../utils/iac.js';\nimport { installDependencies } from '../../../utils/install.js';\nimport { addGeneratorMetricsIfApplicable } from '../../../utils/metrics.js';\nimport { esmVars } from '../../../utils/module-format.js';\nimport { toClassName, toKebabCase } from '../../../utils/names.js';\nimport {\n addDependencyToTargetIfNotPresent,\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n normalizeTargetKeyOrder,\n readProjectConfigurationUnqualified,\n} from '../../../utils/nx.js';\nimport { assignPort } from '../../../utils/port.js';\nimport {\n SHARED_CONSTRUCTS_DEPENDENCIES,\n sharedConstructsGenerator,\n} from '../../../utils/shared-constructs.js';\nimport type { IacMetadata } from '../../../utils/shared-constructs-constants.js';\nimport smithyProjectGenerator from '../../project/generator.js';\nimport type { TsSmithyApiGeneratorSchema } from './schema';\n\n/** The metadata this generator records, which its predicates read. */\nexport interface TsSmithyApiMetadata extends IacMetadata {\n readonly apiName: string;\n readonly auth: TsSmithyApiGeneratorSchema['auth'];\n readonly modelProject: string;\n}\n\n// Each entry names the branch it belongs to, so the same declaration drives both\n// adding and the version sync.\nexport const DEPENDENCIES = declareDependencies<TsSmithyApiMetadata>()({\n ts: [\n { name: '@smithy/server-apigateway' },\n { name: '@smithy/server-node' },\n { name: '@middy/core' },\n { name: '@aws-lambda-powertools/logger' },\n { name: '@aws-lambda-powertools/parameters' },\n { name: '@aws-lambda-powertools/tracer' },\n { name: '@aws-lambda-powertools/metrics' },\n { name: '@aws-sdk/client-appconfigdata' },\n // The custom authorizer handler parses its event.\n { name: '@aws-lambda-powertools/parser', when: (m) => m.auth === 'custom' },\n { name: '@types/aws-lambda', dev: true },\n // tsx runs the local server from the workspace root.\n { name: 'tsx', dev: true, root: true },\n ...ownedElsewhere(FS_DEPENDENCIES),\n ...ownedElsewhere(API_CONSTRUCTS_DEPENDENCIES),\n ...ownedElsewhere(BUNDLE_DEPENDENCIES),\n ...ownedElsewhere(SHARED_CONSTRUCTS_DEPENDENCIES),\n ],\n py: ownedElsewhere(API_CONSTRUCTS_PY_DEPENDENCIES),\n});\n\nexport const TS_SMITHY_API_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport const tsSmithyApiGenerator = async (\n tree: Tree,\n options: TsSmithyApiGeneratorSchema,\n): Promise<GeneratorCallback> => {\n if (\n (options.infra as string) !== 'rest-lambda' &&\n (options.infra as string) !== 'none'\n ) {\n throw new Error(\n `Unsupported infra '${options.infra}' for Smithy TypeScript API. ` +\n `Only 'rest-lambda' (API Gateway REST API) is supported.`,\n );\n }\n\n const integrationPattern = getIntegrationPattern(options);\n const apiNameClassName = toClassName(options.name);\n const apiNameKebabCase = toKebabCase(options.name);\n const { fullyQualifiedName: backendFullyQualifiedName, dir } =\n getTsLibDetails(tree, options);\n const modelProjectName = `${apiNameKebabCase}-model`;\n\n let projectExists: boolean;\n try {\n readProjectConfigurationUnqualified(tree, backendFullyQualifiedName);\n projectExists = true;\n } catch {\n projectExists = false;\n }\n\n if (!projectExists) {\n // Generate the model project\n await smithyProjectGenerator(tree, {\n name: modelProjectName,\n serviceName: apiNameClassName,\n namespace: options.namespace,\n directory: dir,\n subDirectory: 'model',\n preferInstallDependencies: false,\n });\n\n // Generate the backend project\n await tsProjectGenerator(tree, {\n name: options.name,\n directory: dir,\n subDirectory: 'backend',\n preferInstallDependencies: false,\n });\n }\n\n // Add metadata to associate backend project with model project\n const modelProjectConfig = readProjectConfigurationUnqualified(\n tree,\n modelProjectName,\n );\n updateProjectConfiguration(tree, modelProjectConfig.name, {\n ...modelProjectConfig,\n metadata: {\n ...modelProjectConfig.metadata,\n backendProject: backendFullyQualifiedName,\n } as any,\n });\n\n // Recorded in the metadata below so the version sync can tell a CDK\n // project from a Terraform one; undefined when no infrastructure was\n // generated, in which case neither provider's packages were added.\n const iac =\n options.infra !== 'none' ? await resolveIac(tree, options.iac) : undefined;\n\n // Recorded here and read by the declaration's predicates, so the packages\n // added below are exactly the ones the version sync will own.\n const metadata: TsSmithyApiMetadata = {\n apiName: options.name,\n auth: options.auth,\n modelProject: modelProjectConfig.name,\n ...(iac ? { iac } : {}),\n };\n\n addGeneratorMetadata(\n tree,\n backendFullyQualifiedName,\n TS_SMITHY_API_GENERATOR_INFO,\n metadata,\n );\n\n const backendProjectConfig = readProjectConfigurationUnqualified(\n tree,\n backendFullyQualifiedName,\n );\n const port = assignPort(tree, backendProjectConfig, 3001);\n\n // Delete default index.ts with \"hello\" function\n tree.delete(joinPathFragments(backendProjectConfig.sourceRoot, 'index.ts'));\n\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files'),\n backendProjectConfig.sourceRoot,\n {\n apiNameClassName,\n port,\n ...esmVars(tree),\n },\n );\n\n if (options.infra !== 'none') {\n if (options.auth === 'custom') {\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n '..',\n '..',\n '..',\n 'utils',\n 'api-constructs',\n 'files',\n 'cdk',\n 'authorizer',\n 'rest',\n ),\n backendProjectConfig.sourceRoot,\n {},\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n }\n\n // Add infrastructure\n await sharedConstructsGenerator(\n tree,\n {\n iac,\n },\n DEPENDENCIES,\n );\n await addApiGatewayInfra(\n tree,\n {\n iac,\n apiProjectName: backendFullyQualifiedName,\n apiNameClassName,\n apiNameKebabCase,\n auth: options.auth,\n constructType: 'rest',\n backend: {\n type: 'smithy',\n bundleOutputDir: joinPathFragments(\n 'dist',\n backendProjectConfig.root,\n 'bundle',\n ),\n integrationPattern,\n ...(options.auth === 'custom' && {\n authorizerBundleOutputDir: joinPathFragments(\n 'dist',\n backendProjectConfig.root,\n 'bundle',\n 'authorizer',\n ),\n }),\n },\n },\n DEPENDENCIES,\n );\n addSharedConstructsOpenApiMetadataGenerateTarget(tree, {\n iac,\n apiNameKebabCase,\n specPath: joinPathFragments(\n 'dist',\n modelProjectConfig.root,\n 'build',\n 'openapi',\n 'openapi.json',\n ),\n specBuildTargetName: `${modelProjectConfig.name}:build`,\n integrationPattern,\n });\n\n // Add bundle target using rolldown\n await addTypeScriptBundleTarget(\n tree,\n backendProjectConfig,\n {\n targetFilePath: 'src/handler.ts',\n external: [/@aws-sdk\\/.*/], // lambda runtime provides aws sdk\n },\n DEPENDENCIES,\n );\n\n if (options.auth === 'custom') {\n await addTypeScriptBundleTarget(\n tree,\n backendProjectConfig,\n {\n targetFilePath: 'src/authorizer.ts',\n bundleOutputDir: 'authorizer',\n external: [/@aws-sdk\\/.*/],\n },\n DEPENDENCIES,\n );\n }\n }\n\n const cmd = new FsCommands(tree, DEPENDENCIES);\n const generatedSrcDirFromRoot = '{projectRoot}/src/generated';\n\n // Target for copying the ssdk built by the model\n backendProjectConfig.targets['copy-ssdk'] = {\n cache: true,\n inputs: [\n {\n dependentTasksOutputFiles: '**/*',\n },\n ],\n executor: 'nx:run-commands',\n options: {\n commands: [\n cmd.rm(generatedSrcDirFromRoot),\n cmd.mkdir(generatedSrcDirFromRoot),\n cmd.cpDir(\n joinPathFragments('dist', modelProjectConfig.root, 'build', 'ssdk'),\n joinPathFragments(generatedSrcDirFromRoot, 'ssdk'),\n ),\n ],\n parallel: false,\n },\n outputs: ['{projectRoot}/src/generated'],\n dependsOn: [`${modelProjectConfig.name}:build`],\n };\n addDependencyToTargetIfNotPresent(\n backendProjectConfig,\n 'compile',\n 'copy-ssdk',\n );\n\n // Add a project which continuously copies based on changes to the model project\n // This allows the \"serve\" target to hot reload when the smithy model is changed\n backendProjectConfig.targets['watch-copy-ssdk'] = {\n executor: 'nx:run-commands',\n continuous: true,\n options: {\n command: `nx watch --projects=${modelProjectConfig.name} --includeDependencies -- nx run ${backendFullyQualifiedName}:copy-ssdk`,\n },\n };\n\n // Add serve target for running the server locally\n backendProjectConfig.targets.serve = normalizeTargetKeyOrder({\n executor: 'nx:run-commands',\n continuous: true,\n dependsOn: ['copy-ssdk', 'watch-copy-ssdk'],\n options: {\n command: 'tsx --watch src/local-server.ts',\n cwd: '{projectRoot}',\n },\n });\n\n const existingDevDependsOn =\n backendProjectConfig.targets['dev']?.dependsOn ?? [];\n\n backendProjectConfig.targets['dev'] = normalizeTargetKeyOrder({\n ...backendProjectConfig.targets.serve,\n // Own copy of dependsOn so adding dev dependencies below doesn't\n // mutate the shared array referenced by the serve target.\n dependsOn: [...(backendProjectConfig.targets.serve.dependsOn ?? [])],\n options: {\n ...backendProjectConfig.targets.serve.options,\n env: {\n LOCAL_DEV: 'true',\n },\n },\n });\n\n // Preserve any dependencies added to dev by connection generators\n for (const dependency of existingDevDependsOn) {\n addDependencyToTargetIfNotPresent(backendProjectConfig, 'dev', dependency);\n }\n\n // Ignore generated code\n updateGitIgnore(tree, backendProjectConfig.root, (patterns) => [\n ...patterns,\n 'src/generated',\n ]);\n\n updateProjectConfiguration(\n tree,\n backendFullyQualifiedName,\n backendProjectConfig,\n );\n\n addTsDependencies(tree, DEPENDENCIES, {\n metadata,\n projectRoot: backendProjectConfig.root,\n });\n\n await addGeneratorMetricsIfApplicable(tree, [TS_SMITHY_API_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\nconst getIntegrationPattern = (\n options: TsSmithyApiGeneratorSchema,\n): 'isolated' | 'shared' => options.integrationPattern ?? 'isolated';\n\nexport default tsSmithyApiGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","tsProjectGenerator","getTsLibDetails","addTsDependencies","API_CONSTRUCTS_DEPENDENCIES","API_CONSTRUCTS_PY_DEPENDENCIES","addApiGatewayInfra","addSharedConstructsOpenApiMetadataGenerateTarget","addTypeScriptBundleTarget","BUNDLE_DEPENDENCIES","declareDependencies","ownedElsewhere","formatFilesInSubtree","FS_DEPENDENCIES","FsCommands","updateGitIgnore","resolveIac","installDependencies","addGeneratorMetricsIfApplicable","esmVars","toClassName","toKebabCase","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","normalizeTargetKeyOrder","readProjectConfigurationUnqualified","assignPort","SHARED_CONSTRUCTS_DEPENDENCIES","sharedConstructsGenerator","smithyProjectGenerator","DEPENDENCIES","ts","name","when","m","auth","dev","root","py","TS_SMITHY_API_GENERATOR_INFO","filename","tsSmithyApiGenerator","tree","options","infra","Error","integrationPattern","getIntegrationPattern","apiNameClassName","apiNameKebabCase","fullyQualifiedName","backendFullyQualifiedName","dir","modelProjectName","projectExists","serviceName","namespace","directory","subDirectory","preferInstallDependencies","modelProjectConfig","metadata","backendProject","iac","undefined","apiName","modelProject","backendProjectConfig","port","delete","sourceRoot","dirname","overwriteStrategy","KeepExisting","apiProjectName","constructType","backend","type","bundleOutputDir","authorizerBundleOutputDir","specPath","specBuildTargetName","targetFilePath","external","cmd","generatedSrcDirFromRoot","targets","cache","inputs","dependentTasksOutputFiles","executor","commands","rm","mkdir","cpDir","parallel","outputs","dependsOn","continuous","command","serve","cwd","existingDevDependsOn","env","LOCAL_DEV","dependency","patterns","projectRoot","langu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yB,EAAE;YAC3DiD,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;AAEF,MAAM7D,wBAAwB,CAC5BJ,UAC0BA,QAAQG,kBAAkB,IAAI;AAE1D,eAAeL,qBAAqB"}
@@ -10,7 +10,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies.js"
10
10
  readonly dev: true;
11
11
  readonly root: true;
12
12
  }, {
13
- readonly name: "make-dir-cli";
13
+ readonly name: "shx";
14
14
  readonly dev: true;
15
15
  readonly root: true;
16
16
  }, {
@@ -54,7 +54,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies.js"
54
54
  readonly name: "@types/node";
55
55
  } & {
56
56
  versionOnly: true;
57
- }], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
57
+ }], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
58
58
  export declare const TERRAFORM_PROJECT_GENERATOR_INFO: NxGeneratorInfo;
59
59
  /**
60
60
  * Checks formatting, mirroring the TypeScript and Python `format` targets: the