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

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 (101) hide show
  1. package/migrations.json +16 -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-core-vendor-target/metadata.json +3 -0
  10. package/src/migrations/latest/agent-core-vendor-target/migration.d.ts +6 -0
  11. package/src/migrations/latest/agent-core-vendor-target/migration.js +98 -0
  12. package/src/migrations/latest/agent-core-vendor-target/migration.js.map +1 -0
  13. package/src/migrations/latest/infra-deploy-express-mode/metadata.json +3 -0
  14. package/src/migrations/latest/infra-deploy-express-mode/migration.d.ts +6 -0
  15. package/src/migrations/latest/infra-deploy-express-mode/migration.js +83 -0
  16. package/src/migrations/latest/infra-deploy-express-mode/migration.js.map +1 -0
  17. package/src/migrations/latest/shx-fs-commands/metadata.json +3 -0
  18. package/src/migrations/latest/shx-fs-commands/migration.d.ts +6 -0
  19. package/src/migrations/latest/shx-fs-commands/migration.js +216 -0
  20. package/src/migrations/latest/shx-fs-commands/migration.js.map +1 -0
  21. package/src/open-api/ts-client/__snapshots__/generator.complex-types.spec.ts.snap +18 -12
  22. package/src/open-api/ts-client/__snapshots__/generator.edge-cases.spec.ts.snap +5 -2
  23. package/src/open-api/utils/codegen-data/types.d.ts +6 -0
  24. package/src/open-api/utils/codegen-data/types.js.map +1 -1
  25. package/src/open-api/utils/codegen-data.js +32 -7
  26. package/src/open-api/utils/codegen-data.js.map +1 -1
  27. package/src/open-api/utils/normalise.js +39 -14
  28. package/src/open-api/utils/normalise.js.map +1 -1
  29. package/src/open-api/utils/parser.js +51 -5
  30. package/src/open-api/utils/parser.js.map +1 -1
  31. package/src/preset/generator.d.ts +1 -1
  32. package/src/py/agent/a2a-connection/generator.d.ts +1 -1
  33. package/src/py/agent/gateway-connection/generator.d.ts +1 -1
  34. package/src/py/agent/generator.d.ts +2 -26
  35. package/src/py/agent/generator.js +2 -2
  36. package/src/py/agent/generator.js.map +1 -1
  37. package/src/py/agent/mcp-connection/generator.d.ts +1 -1
  38. package/src/py/agent/react-connection/generator.d.ts +1 -1
  39. package/src/py/fast-api/generator.d.ts +1 -13
  40. package/src/py/fast-api/generator.js +1 -1
  41. package/src/py/fast-api/generator.js.map +1 -1
  42. package/src/py/fast-api/react/generator.d.ts +1 -1
  43. package/src/py/mcp-server/generator.d.ts +2 -26
  44. package/src/py/mcp-server/generator.js +2 -2
  45. package/src/py/mcp-server/generator.js.map +1 -1
  46. package/src/py/rdb/generator.d.ts +2 -26
  47. package/src/py/rdb/generator.js +6 -6
  48. package/src/py/rdb/generator.js.map +1 -1
  49. package/src/smithy/project/__snapshots__/generator.spec.ts.snap +24 -20
  50. package/src/smithy/project/generator.d.ts +2 -14
  51. package/src/smithy/project/generator.js +2 -1
  52. package/src/smithy/project/generator.js.map +1 -1
  53. package/src/smithy/react-connection/generator.d.ts +1 -1
  54. package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +8 -7
  55. package/src/smithy/ts/api/generator.d.ts +1 -13
  56. package/src/smithy/ts/api/generator.js +1 -1
  57. package/src/smithy/ts/api/generator.js.map +1 -1
  58. package/src/terraform/project/generator.d.ts +2 -2
  59. package/src/terraform/project/generator.js +4 -4
  60. package/src/terraform/project/generator.js.map +1 -1
  61. package/src/trpc/react/generator.d.ts +1 -1
  62. package/src/ts/agent/a2a-connection/generator.d.ts +1 -1
  63. package/src/ts/agent/gateway-connection/generator.d.ts +1 -1
  64. package/src/ts/agent/generator.d.ts +3 -39
  65. package/src/ts/agent/generator.js +1 -1
  66. package/src/ts/agent/generator.js.map +1 -1
  67. package/src/ts/agent/mcp-connection/generator.d.ts +1 -1
  68. package/src/ts/agent/react-connection/generator.d.ts +1 -1
  69. package/src/ts/astro-docs/generator.d.ts +1 -1
  70. package/src/ts/dcr-proxy/generator.d.ts +1 -1
  71. package/src/ts/dynamodb/generator.d.ts +1 -1
  72. package/src/ts/lambda-function/generator.d.ts +1 -1
  73. package/src/ts/lib/generator.d.ts +1 -1
  74. package/src/ts/mcp-server/generator.d.ts +3 -39
  75. package/src/ts/mcp-server/generator.js +1 -1
  76. package/src/ts/mcp-server/generator.js.map +1 -1
  77. package/src/ts/nx-generator/generator.d.ts +1 -1
  78. package/src/ts/nx-migration/generator.d.ts +1 -1
  79. package/src/ts/nx-plugin/generator.d.ts +1 -1
  80. package/src/ts/rdb/generator.d.ts +3 -27
  81. package/src/ts/rdb/generator.js +3 -3
  82. package/src/ts/rdb/generator.js.map +1 -1
  83. package/src/ts/react-website/agui/generator.d.ts +1 -1
  84. package/src/utils/agent-core-packaging.d.ts +25 -12
  85. package/src/utils/agent-core-packaging.js +47 -11
  86. package/src/utils/agent-core-packaging.js.map +1 -1
  87. package/src/utils/docker.d.ts +1 -7
  88. package/src/utils/docker.js +1 -1
  89. package/src/utils/docker.js.map +1 -1
  90. package/src/utils/format.d.ts +5 -0
  91. package/src/utils/format.js +5 -0
  92. package/src/utils/format.js.map +1 -1
  93. package/src/utils/fs.d.ts +21 -11
  94. package/src/utils/fs.js +30 -22
  95. package/src/utils/fs.js.map +1 -1
  96. package/src/utils/version-lockstep/lockstep.d.ts +27 -0
  97. package/src/utils/version-lockstep/lockstep.js +46 -0
  98. package/src/utils/version-lockstep/lockstep.js.map +1 -0
  99. package/src/utils/versions.d.ts +9 -4
  100. package/src/utils/versions.js +24 -4
  101. package/src/utils/versions.js.map +1 -1
package/migrations.json CHANGED
@@ -52,6 +52,21 @@
52
52
  "description": "Assign each react-website project its own dev-server and preview port, and allow-list them for any connected Cognito auth",
53
53
  "implementation": "./src/migrations/latest/react-website-unique-dev-ports/migration"
54
54
  },
55
+ "latest-infra-deploy-express-mode": {
56
+ "version": "1.0.0-rc.94",
57
+ "description": "Deploy using CloudFormation express mode from the deploy and deploy-sandbox targets of ts#infra projects",
58
+ "implementation": "./src/migrations/latest/infra-deploy-express-mode/migration"
59
+ },
60
+ "latest-shx-fs-commands": {
61
+ "version": "1.0.0-rc.94",
62
+ "description": "Replace the ncp, rimraf, make-dir-cli and cpy-cli filesystem CLIs with shx",
63
+ "implementation": "./src/migrations/latest/shx-fs-commands/migration"
64
+ },
65
+ "latest-agent-core-vendor-target": {
66
+ "version": "1.0.0-rc.94",
67
+ "description": "Cache the AgentCore ADOT install in its own target so editing an agent no longer re-runs it",
68
+ "implementation": "./src/migrations/latest/agent-core-vendor-target/migration"
69
+ },
55
70
  "v1.0.0-rc.50-0001-modernize-function-props-cast": {
56
71
  "version": "1.0.0-rc.50",
57
72
  "description": "Replace the legacy angle-bracket FunctionProps type assertion with the modern as syntax in generated API constructs",
@@ -293,7 +308,7 @@
293
308
  "implementation": "./src/migrations/v1.0.0-rc.89/0001-nx-parallel-default/migration"
294
309
  },
295
310
  "sync-vended-versions": {
296
- "version": "1.0.0-rc.93",
311
+ "version": "1.0.0-rc.94",
297
312
  "description": "Sync vended dependency versions and the tracked plugin version to those vended by this release",
298
313
  "implementation": "./src/utils/version-upgrade-migration/migration"
299
314
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin",
3
- "version": "1.0.0-rc.93",
3
+ "version": "1.0.0-rc.94",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",
@@ -40,7 +40,7 @@ export declare const DEPENDENCIES: import("../utils/declared-dependencies.js").D
40
40
  readonly name: "@types/node";
41
41
  } & {
42
42
  versionOnly: true;
43
- }], 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", AgentCoreHarnessMetadata>[]>;
43
+ }], 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", AgentCoreHarnessMetadata>[]>;
44
44
  export declare const AGENTCORE_HARNESS_GENERATOR_INFO: NxGeneratorInfo;
45
45
  export declare const agentcoreHarnessGenerator: (tree: Tree, options: AgentcoreHarnessGeneratorSchema) => Promise<GeneratorCallback>;
46
46
  /**
@@ -84,7 +84,7 @@ exports[`infra generator > should configure project.json with correct targets >
84
84
  ],
85
85
  "executor": "nx:run-commands",
86
86
  "options": {
87
- "command": "cdk deploy --require-approval=never",
87
+ "command": "cdk deploy --require-approval=never --express",
88
88
  "cwd": "{projectRoot}",
89
89
  },
90
90
  }
@@ -179,7 +179,7 @@ exports[`infra generator > should configure project.json with correct targets >
179
179
  ],
180
180
  "executor": "nx:run-commands",
181
181
  "options": {
182
- "command": "cdk deploy --require-approval=never",
182
+ "command": "cdk deploy --require-approval=never --express",
183
183
  "cwd": "{projectRoot}",
184
184
  },
185
185
  },
@@ -197,7 +197,7 @@ exports[`infra generator > should configure project.json with correct targets >
197
197
  ],
198
198
  "executor": "nx:run-commands",
199
199
  "options": {
200
- "command": "cdk deploy --require-approval=never "proj-test-sandbox/*"",
200
+ "command": "cdk deploy --require-approval=never "proj-test-sandbox/*" --express",
201
201
  "cwd": "{projectRoot}",
202
202
  },
203
203
  },
@@ -791,7 +791,7 @@ exports[`infra generator > should handle custom project names correctly > custom
791
791
  ],
792
792
  "executor": "nx:run-commands",
793
793
  "options": {
794
- "command": "cdk deploy --require-approval=never",
794
+ "command": "cdk deploy --require-approval=never --express",
795
795
  "cwd": "{projectRoot}",
796
796
  },
797
797
  },
@@ -809,7 +809,7 @@ exports[`infra generator > should handle custom project names correctly > custom
809
809
  ],
810
810
  "executor": "nx:run-commands",
811
811
  "options": {
812
- "command": "cdk deploy --require-approval=never "proj-custom-infra-sandbox/*"",
812
+ "command": "cdk deploy --require-approval=never "proj-custom-infra-sandbox/*" --express",
813
813
  "cwd": "{projectRoot}",
814
814
  },
815
815
  },
@@ -47,7 +47,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies.js"
47
47
  readonly when: (m: import("../../utils/shared-constructs-constants.js").IacMetadata) => boolean;
48
48
  } & {
49
49
  versionOnly: true;
50
- }], 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>>[]>;
50
+ }], 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>>[]>;
51
51
  export declare const INFRA_APP_GENERATOR_INFO: NxGeneratorInfo;
52
52
  export declare function tsInfraGenerator(tree: Tree, schema: TsInfraGeneratorSchema): Promise<GeneratorCallback>;
53
53
  export default tsInfraGenerator;
@@ -171,11 +171,13 @@ export async function tsInfraGenerator(tree, schema) {
171
171
  '^assemble',
172
172
  'compile'
173
173
  ],
174
+ // No --express here when stages are configured: this target deploys
175
+ // whichever stage is named, including beta and prod.
174
176
  options: stageConfig ? withCdkEnv({
175
177
  command: `tsx packages/common/scripts/src/infra/infra-deploy.ts ${libraryRoot}`
176
178
  }) : withCdkEnv({
177
179
  cwd: '{projectRoot}',
178
- command: 'cdk deploy --require-approval=never'
180
+ command: 'cdk deploy --require-approval=never --express'
179
181
  })
180
182
  };
181
183
  config.targets['deploy-sandbox'] = {
@@ -185,10 +187,10 @@ export async function tsInfraGenerator(tree, schema) {
185
187
  'compile'
186
188
  ],
187
189
  options: stageConfig ? withCdkEnv({
188
- command: `tsx packages/common/scripts/src/infra/infra-deploy.ts ${libraryRoot} ${sandboxStagePattern}`
190
+ command: `tsx packages/common/scripts/src/infra/infra-deploy.ts ${libraryRoot} ${sandboxStagePattern} --express`
189
191
  }) : withCdkEnv({
190
192
  cwd: '{projectRoot}',
191
- command: `cdk deploy --require-approval=never ${sandboxStagePattern}`
193
+ command: `cdk deploy --require-approval=never ${sandboxStagePattern} --express`
192
194
  })
193
195
  };
194
196
  config.targets['deploy-ci'] = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/nx-plugin/src/infra/app/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 ProjectConfiguration,\n readProjectConfiguration,\n type Tree,\n updateJson,\n} from '@nx/devkit';\nimport path from 'path';\nimport tsProjectGenerator, { getTsLibDetails } from '../../ts/lib/generator.js';\nimport { mergeTsReferences } from '../../ts/lib/ts-project-utils.js';\nimport { addTsDependencies } from '../../utils/add-dependencies.js';\nimport { resolveContainers } from '../../utils/containers.js';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../utils/declared-dependencies.js';\nimport { formatFilesInSubtree } from '../../utils/format.js';\nimport { installDependencies } from '../../utils/install.js';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics.js';\nimport { esmVars } from '../../utils/module-format.js';\nimport { kebabCase } from '../../utils/names.js';\nimport { getNpmScopePrefix } 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 { sortObjectKeys } from '../../utils/object.js';\nimport { getPackageManagerDisplayCommands } from '../../utils/pkg-manager.js';\nimport { uvxCommand } from '../../utils/py.js';\nimport {\n SHARED_CONSTRUCTS_DEPENDENCIES,\n sharedConstructsGenerator,\n} from '../../utils/shared-constructs.js';\nimport {\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n SHARED_INFRA_CONFIG_DIR,\n} from '../../utils/shared-constructs-constants.js';\nimport { sharedInfraConfigGenerator } from '../../utils/shared-infra-config.js';\nimport {\n SHARED_INFRA_SCRIPTS_DEPENDENCIES,\n sharedInfraScriptsGenerator,\n} from '../../utils/shared-infra-scripts.js';\nimport type { TsInfraGeneratorSchema } from './schema';\n\n// This generator records no metadata, so nothing a predicate could read: the\n// CDK app always needs the app libraries, and the CLI, bundler and tsx are\n// shared tooling.\nexport const DEPENDENCIES = declareDependencies()({\n ts: [\n { name: 'aws-cdk-lib' },\n { name: 'constructs' },\n { name: 'source-map-support' },\n // The `aws-cdk` CLI, esbuild (CDK bundling) and tsx are shared tooling.\n { name: 'aws-cdk', dev: true, root: true },\n { name: 'esbuild', dev: true, root: true },\n { name: 'tsx', dev: true, root: true },\n ...ownedElsewhere(SHARED_CONSTRUCTS_DEPENDENCIES),\n ...ownedElsewhere(SHARED_INFRA_SCRIPTS_DEPENDENCIES),\n ],\n});\n\nexport const INFRA_APP_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport async function tsInfraGenerator(\n tree: Tree,\n schema: TsInfraGeneratorSchema,\n): Promise<GeneratorCallback> {\n const lib = getTsLibDetails(tree, schema);\n\n if (!projectExists(tree, lib.fullyQualifiedName)) {\n await tsProjectGenerator(tree, {\n ...schema,\n preferInstallDependencies: false,\n });\n }\n\n // CDK shells out to a container engine to build image assets. Default\n // (docker) needs no env override; finch is set via CDK_DOCKER per\n // https://docs.aws.amazon.com/cdk/v2/guide/build-containers.html#build-container-replace.\n const containers = await resolveContainers(tree, 'inherit');\n const cdkEnv: Record<string, string> | undefined =\n containers === 'docker' ? undefined : { CDK_DOCKER: containers };\n const withCdkEnv = <T extends Record<string, unknown>>(opts: T): T => {\n if (!cdkEnv) return opts;\n const existingEnv = (opts.env as Record<string, string> | undefined) ?? {};\n return { ...opts, env: { ...existingEnv, ...cdkEnv } } as T;\n };\n\n // This generator IS the CDK infrastructure project, so the provider is fixed.\n addGeneratorMetadata(tree, lib.fullyQualifiedName, INFRA_APP_GENERATOR_INFO, {\n iac: 'cdk',\n });\n\n // Shared constructs always in CDK for typescript infra generator\n await sharedConstructsGenerator(\n tree,\n {\n iac: 'cdk',\n },\n DEPENDENCIES,\n );\n\n // Shared infra-config and infra-scripts packages (lazy creation, only when enabled)\n const stageConfig = schema.stageConfig ?? false;\n if (stageConfig) {\n await sharedInfraConfigGenerator(tree);\n await sharedInfraScriptsGenerator(tree, DEPENDENCIES);\n }\n\n const synthDirFromRoot = `/dist/${lib.dir}/cdk.out`;\n const synthDirFromProject =\n lib.dir\n .split('/')\n .map(() => '..')\n .join('/') + `/dist/${lib.dir}/cdk.out`;\n const distDirFromProjectRoot =\n lib.dir\n .split('/')\n .map(() => '..')\n .join('/') + '/dist/{projectRoot}/cdk.out';\n const projectConfig = readProjectConfiguration(tree, lib.fullyQualifiedName);\n const libraryRoot = projectConfig.root;\n const npmScopePrefix = getNpmScopePrefix(tree);\n const scopeAlias = npmScopePrefix;\n const fullyQualifiedName = `${npmScopePrefix}${schema.name}`;\n const namespace = kebabCase(fullyQualifiedName);\n // The stage instantiated in main.ts. Quoted so the shell does not glob `*`.\n const sandboxStagePattern = `\"${namespace}-sandbox/*\"`;\n tree.delete(joinPathFragments(libraryRoot, 'src'));\n\n generateFiles(\n tree, // the virtual file system\n joinPathFragments(import.meta.dirname, './files/app'), // path to the file templates\n libraryRoot, // destination path of the files\n {\n synthDir: synthDirFromProject,\n scopeAlias: scopeAlias,\n namespace,\n fullyQualifiedName,\n pkgMgrCmd: getPackageManagerDisplayCommands().exec,\n dir: lib.dir,\n stageConfig,\n ...schema,\n ...esmVars(tree),\n },\n {\n overwriteStrategy: OverwriteStrategy.Overwrite,\n },\n );\n\n updateJson(\n tree,\n `${libraryRoot}/project.json`,\n (config: ProjectConfiguration) => {\n config.projectType = 'application';\n // `synth` is the CDK artifact, so it belongs on `assemble` too; `checkov`\n // is a quality gate, so it stays on `build` alone.\n addArtifactDependencyToTargets(config, 'synth');\n addDependencyToTargetIfNotPresent(config, 'build', 'checkov');\n config.targets.compile.outputs = [\n '{workspaceRoot}/dist/{projectRoot}/tsc',\n ];\n config.targets.synth = {\n cache: true,\n executor: 'nx:run-commands',\n inputs: ['default'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/cdk.out'],\n dependsOn: ['^assemble', 'compile'], // compile clobbers dist directory, so ensure synth runs afterwards\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk synth',\n }),\n };\n config.targets.checkov = {\n cache: true,\n executor: 'nx:run-commands',\n inputs: ['{workspaceRoot}/dist/{projectRoot}/cdk.out'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/checkov'],\n dependsOn: ['synth'],\n options: {\n command: uvxCommand(\n 'checkov',\n '--config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation',\n ),\n },\n };\n config.targets.deploy = {\n executor: 'nx:run-commands',\n dependsOn: ['^assemble', 'compile'],\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-deploy.ts ${libraryRoot}`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk deploy --require-approval=never',\n }),\n };\n config.targets['deploy-sandbox'] = {\n executor: 'nx:run-commands',\n dependsOn: ['^assemble', 'compile'],\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-deploy.ts ${libraryRoot} ${sandboxStagePattern}`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk deploy --require-approval=never ${sandboxStagePattern}`,\n }),\n };\n config.targets['deploy-ci'] = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk deploy --require-approval=never --app ${distDirFromProjectRoot}`,\n }),\n };\n config.targets.destroy = {\n executor: 'nx:run-commands',\n dependsOn: ['^assemble', 'compile'],\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-destroy.ts ${libraryRoot}`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk destroy',\n }),\n };\n config.targets['destroy-sandbox'] = {\n executor: 'nx:run-commands',\n dependsOn: ['^assemble', 'compile'],\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-destroy.ts ${libraryRoot} ${sandboxStagePattern}`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk destroy ${sandboxStagePattern}`,\n }),\n };\n config.targets['destroy-ci'] = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk destroy --app ${distDirFromProjectRoot}`,\n }),\n };\n config.targets.cdk = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk',\n }),\n };\n config.targets.bootstrap = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk bootstrap',\n }),\n };\n config.targets = sortObjectKeys(config.targets);\n return config;\n },\n );\n\n addTsDependencies(tree, DEPENDENCIES, { projectRoot: libraryRoot });\n\n updateJson(tree, `${libraryRoot}/tsconfig.lib.json`, (tsConfig) => ({\n ...tsConfig,\n references: mergeTsReferences(tsConfig.references, [\n {\n path: `${path.relative(\n libraryRoot,\n `${tree.root}/${PACKAGES_DIR}`,\n )}/${SHARED_CONSTRUCTS_DIR}/tsconfig.lib.json`,\n },\n ...(stageConfig\n ? [\n {\n path: `${path.relative(\n libraryRoot,\n `${tree.root}/${PACKAGES_DIR}`,\n )}/${SHARED_INFRA_CONFIG_DIR}/tsconfig.json`,\n },\n ]\n : []),\n ]),\n }));\n\n await addGeneratorMetricsIfApplicable(tree, [INFRA_APP_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, schema.preferInstallDependencies, {\n languages: ['typescript'],\n });\n}\nexport default tsInfraGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","readProjectConfiguration","updateJson","path","tsProjectGenerator","getTsLibDetails","mergeTsReferences","addTsDependencies","resolveContainers","declareDependencies","ownedElsewhere","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","esmVars","kebabCase","getNpmScopePrefix","addArtifactDependencyToTargets","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","projectExists","sortObjectKeys","getPackageManagerDisplayCommands","uvxCommand","SHARED_CONSTRUCTS_DEPENDENCIES","sharedConstructsGenerator","PACKAGES_DIR","SHARED_CONSTRUCTS_DIR","SHARED_INFRA_CONFIG_DIR","sharedInfraConfigGenerator","SHARED_INFRA_SCRIPTS_DEPENDENCIES","sharedInfraScriptsGenerator","DEPENDENCIES","ts","name","dev","root","INFRA_APP_GENERATOR_INFO","filename","tsInfraGenerator","tree","schema","lib","fullyQualifiedName","preferInstallDependencies","containers","cdkEnv","undefined","CDK_DOCKER","withCdkEnv","opts","existingEnv","env","iac","stageConfig","synthDirFromRoot","dir","synthDirFromProject","split","map","join","distDirFromProjectRoot","projectConfig","libraryRoot","npmScopePrefix","scopeAlias","namespace","sandboxStagePattern","delete","dirname","synthDir","pkgMgrCmd","exec","overwriteStrategy","Overwrite","config","projectType","targets","compile","outputs","synth","cache","executor","inputs","dependsOn","options","cwd","command","checkov","deploy","destroy","cdk","bootstrap","projectRoot","tsConfig","references","relative","languages"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAEjBC,wBAAwB,EAExBC,UAAU,QACL,aAAa;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,sBAAsBC,eAAe,QAAQ,4BAA4B;AAChF,SAASC,iBAAiB,QAAQ,mCAAmC;AACrE,SAAS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AACc,GAAG,GAAG;YACnBT,UAAU;YACVG,SAASpC,WAAW;gBAClBqC,KAAK;gBACLC,SAAS;YACX;QACF;QACAZ,OAAOE,OAAO,CAACe,SAAS,GAAG;YACzBV,UAAU;YACVG,SAASpC,WAAW;gBAClBqC,KAAK;gBACLC,SAAS;YACX;QACF;QACAZ,OAAOE,OAAO,GAAGxD,eAAesD,OAAOE,OAAO;QAC9C,OAAOF;IACT;IAGFrE,kBAAkBkC,MAAMR,cAAc;QAAE6D,aAAa9B;IAAY;IAEjE9D,WAAWuC,MAAM,GAAGuB,YAAY,kBAAkB,CAAC,EAAE,CAAC+B,WAAc,CAAA;YAClE,GAAGA,QAAQ;YACXC,YAAY1F,kBAAkByF,SAASC,UAAU,EAAE;gBACjD;oBACE7F,MAAM,GAAGA,KAAK8F,QAAQ,CACpBjC,aACA,GAAGvB,KAAKJ,IAAI,CAAC,CAAC,EAAEV,cAAc,EAC9B,CAAC,EAAEC,sBAAsB,kBAAkB,CAAC;gBAChD;mBACI2B,cACA;oBACE;wBACEpD,MAAM,GAAGA,KAAK8F,QAAQ,CACpBjC,aACA,GAAGvB,KAAKJ,IAAI,CAAC,CAAC,EAAEV,cAAc,EAC9B,CAAC,EAAEE,wBAAwB,cAAc,CAAC;oBAC9C;iBACD,GACD,EAAE;aACP;QACH,CAAA;IAEA,MAAMhB,gCAAgC4B,MAAM;QAACH;KAAyB;IAEtE,MAAM3B,qBAAqB8B;IAC3B,OAAO,IACL7B,oBAAoB6B,MAAMC,OAAOG,yBAAyB,EAAE;YAC1DqD,WAAW;gBAAC;aAAa;QAC3B;AACJ;AACA,eAAe1D,iBAAiB"}
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/infra/app/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 ProjectConfiguration,\n readProjectConfiguration,\n type Tree,\n updateJson,\n} from '@nx/devkit';\nimport path from 'path';\nimport tsProjectGenerator, { getTsLibDetails } from '../../ts/lib/generator.js';\nimport { mergeTsReferences } from '../../ts/lib/ts-project-utils.js';\nimport { addTsDependencies } from '../../utils/add-dependencies.js';\nimport { resolveContainers } from '../../utils/containers.js';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../utils/declared-dependencies.js';\nimport { formatFilesInSubtree } from '../../utils/format.js';\nimport { installDependencies } from '../../utils/install.js';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics.js';\nimport { esmVars } from '../../utils/module-format.js';\nimport { kebabCase } from '../../utils/names.js';\nimport { getNpmScopePrefix } 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 { sortObjectKeys } from '../../utils/object.js';\nimport { getPackageManagerDisplayCommands } from '../../utils/pkg-manager.js';\nimport { uvxCommand } from '../../utils/py.js';\nimport {\n SHARED_CONSTRUCTS_DEPENDENCIES,\n sharedConstructsGenerator,\n} from '../../utils/shared-constructs.js';\nimport {\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n SHARED_INFRA_CONFIG_DIR,\n} from '../../utils/shared-constructs-constants.js';\nimport { sharedInfraConfigGenerator } from '../../utils/shared-infra-config.js';\nimport {\n SHARED_INFRA_SCRIPTS_DEPENDENCIES,\n sharedInfraScriptsGenerator,\n} from '../../utils/shared-infra-scripts.js';\nimport type { TsInfraGeneratorSchema } from './schema';\n\n// This generator records no metadata, so nothing a predicate could read: the\n// CDK app always needs the app libraries, and the CLI, bundler and tsx are\n// shared tooling.\nexport const DEPENDENCIES = declareDependencies()({\n ts: [\n { name: 'aws-cdk-lib' },\n { name: 'constructs' },\n { name: 'source-map-support' },\n // The `aws-cdk` CLI, esbuild (CDK bundling) and tsx are shared tooling.\n { name: 'aws-cdk', dev: true, root: true },\n { name: 'esbuild', dev: true, root: true },\n { name: 'tsx', dev: true, root: true },\n ...ownedElsewhere(SHARED_CONSTRUCTS_DEPENDENCIES),\n ...ownedElsewhere(SHARED_INFRA_SCRIPTS_DEPENDENCIES),\n ],\n});\n\nexport const INFRA_APP_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport async function tsInfraGenerator(\n tree: Tree,\n schema: TsInfraGeneratorSchema,\n): Promise<GeneratorCallback> {\n const lib = getTsLibDetails(tree, schema);\n\n if (!projectExists(tree, lib.fullyQualifiedName)) {\n await tsProjectGenerator(tree, {\n ...schema,\n preferInstallDependencies: false,\n });\n }\n\n // CDK shells out to a container engine to build image assets. Default\n // (docker) needs no env override; finch is set via CDK_DOCKER per\n // https://docs.aws.amazon.com/cdk/v2/guide/build-containers.html#build-container-replace.\n const containers = await resolveContainers(tree, 'inherit');\n const cdkEnv: Record<string, string> | undefined =\n containers === 'docker' ? undefined : { CDK_DOCKER: containers };\n const withCdkEnv = <T extends Record<string, unknown>>(opts: T): T => {\n if (!cdkEnv) return opts;\n const existingEnv = (opts.env as Record<string, string> | undefined) ?? {};\n return { ...opts, env: { ...existingEnv, ...cdkEnv } } as T;\n };\n\n // This generator IS the CDK infrastructure project, so the provider is fixed.\n addGeneratorMetadata(tree, lib.fullyQualifiedName, INFRA_APP_GENERATOR_INFO, {\n iac: 'cdk',\n });\n\n // Shared constructs always in CDK for typescript infra generator\n await sharedConstructsGenerator(\n tree,\n {\n iac: 'cdk',\n },\n DEPENDENCIES,\n );\n\n // Shared infra-config and infra-scripts packages (lazy creation, only when enabled)\n const stageConfig = schema.stageConfig ?? false;\n if (stageConfig) {\n await sharedInfraConfigGenerator(tree);\n await sharedInfraScriptsGenerator(tree, DEPENDENCIES);\n }\n\n const synthDirFromRoot = `/dist/${lib.dir}/cdk.out`;\n const synthDirFromProject =\n lib.dir\n .split('/')\n .map(() => '..')\n .join('/') + `/dist/${lib.dir}/cdk.out`;\n const distDirFromProjectRoot =\n lib.dir\n .split('/')\n .map(() => '..')\n .join('/') + '/dist/{projectRoot}/cdk.out';\n const projectConfig = readProjectConfiguration(tree, lib.fullyQualifiedName);\n const libraryRoot = projectConfig.root;\n const npmScopePrefix = getNpmScopePrefix(tree);\n const scopeAlias = npmScopePrefix;\n const fullyQualifiedName = `${npmScopePrefix}${schema.name}`;\n const namespace = kebabCase(fullyQualifiedName);\n // The stage instantiated in main.ts. Quoted so the shell does not glob `*`.\n const sandboxStagePattern = `\"${namespace}-sandbox/*\"`;\n tree.delete(joinPathFragments(libraryRoot, 'src'));\n\n generateFiles(\n tree, // the virtual file system\n joinPathFragments(import.meta.dirname, './files/app'), // path to the file templates\n libraryRoot, // destination path of the files\n {\n synthDir: synthDirFromProject,\n scopeAlias: scopeAlias,\n namespace,\n fullyQualifiedName,\n pkgMgrCmd: getPackageManagerDisplayCommands().exec,\n dir: lib.dir,\n stageConfig,\n ...schema,\n ...esmVars(tree),\n },\n {\n overwriteStrategy: OverwriteStrategy.Overwrite,\n },\n );\n\n updateJson(\n tree,\n `${libraryRoot}/project.json`,\n (config: ProjectConfiguration) => {\n config.projectType = 'application';\n // `synth` is the CDK artifact, so it belongs on `assemble` too; `checkov`\n // is a quality gate, so it stays on `build` alone.\n addArtifactDependencyToTargets(config, 'synth');\n addDependencyToTargetIfNotPresent(config, 'build', 'checkov');\n config.targets.compile.outputs = [\n '{workspaceRoot}/dist/{projectRoot}/tsc',\n ];\n config.targets.synth = {\n cache: true,\n executor: 'nx:run-commands',\n inputs: ['default'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/cdk.out'],\n dependsOn: ['^assemble', 'compile'], // compile clobbers dist directory, so ensure synth runs afterwards\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk synth',\n }),\n };\n config.targets.checkov = {\n cache: true,\n executor: 'nx:run-commands',\n inputs: ['{workspaceRoot}/dist/{projectRoot}/cdk.out'],\n outputs: ['{workspaceRoot}/dist/{projectRoot}/checkov'],\n dependsOn: ['synth'],\n options: {\n command: uvxCommand(\n 'checkov',\n '--config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation',\n ),\n },\n };\n config.targets.deploy = {\n executor: 'nx:run-commands',\n dependsOn: ['^assemble', 'compile'],\n // No --express here when stages are configured: this target deploys\n // whichever stage is named, including beta and prod.\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-deploy.ts ${libraryRoot}`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk deploy --require-approval=never --express',\n }),\n };\n config.targets['deploy-sandbox'] = {\n executor: 'nx:run-commands',\n dependsOn: ['^assemble', 'compile'],\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-deploy.ts ${libraryRoot} ${sandboxStagePattern} --express`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk deploy --require-approval=never ${sandboxStagePattern} --express`,\n }),\n };\n config.targets['deploy-ci'] = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk deploy --require-approval=never --app ${distDirFromProjectRoot}`,\n }),\n };\n config.targets.destroy = {\n executor: 'nx:run-commands',\n dependsOn: ['^assemble', 'compile'],\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-destroy.ts ${libraryRoot}`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk destroy',\n }),\n };\n config.targets['destroy-sandbox'] = {\n executor: 'nx:run-commands',\n dependsOn: ['^assemble', 'compile'],\n options: stageConfig\n ? withCdkEnv({\n command: `tsx packages/common/scripts/src/infra/infra-destroy.ts ${libraryRoot} ${sandboxStagePattern}`,\n })\n : withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk destroy ${sandboxStagePattern}`,\n }),\n };\n config.targets['destroy-ci'] = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: `cdk destroy --app ${distDirFromProjectRoot}`,\n }),\n };\n config.targets.cdk = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk',\n }),\n };\n config.targets.bootstrap = {\n executor: 'nx:run-commands',\n options: withCdkEnv({\n cwd: '{projectRoot}',\n command: 'cdk bootstrap',\n }),\n };\n config.targets = sortObjectKeys(config.targets);\n return config;\n },\n );\n\n addTsDependencies(tree, DEPENDENCIES, { projectRoot: libraryRoot });\n\n updateJson(tree, `${libraryRoot}/tsconfig.lib.json`, (tsConfig) => ({\n ...tsConfig,\n references: mergeTsReferences(tsConfig.references, [\n {\n path: `${path.relative(\n libraryRoot,\n `${tree.root}/${PACKAGES_DIR}`,\n )}/${SHARED_CONSTRUCTS_DIR}/tsconfig.lib.json`,\n },\n ...(stageConfig\n ? [\n {\n path: `${path.relative(\n libraryRoot,\n `${tree.root}/${PACKAGES_DIR}`,\n )}/${SHARED_INFRA_CONFIG_DIR}/tsconfig.json`,\n },\n ]\n : []),\n ]),\n }));\n\n await addGeneratorMetricsIfApplicable(tree, [INFRA_APP_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, schema.preferInstallDependencies, {\n languages: ['typescript'],\n });\n}\nexport default tsInfraGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","readProjectConfiguration","updateJson","path","tsProjectGenerator","getTsLibDetails","mergeTsReferences","addTsDependencies","resolveContainers","declareDependencies","ownedElsewhere","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","esmVars","kebabCase","getNpmScopePrefix","addArtifactDependencyToTargets","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","projectExists","sortObjectKeys","getPackageManagerDisplayCommands","uvxCommand","SHARED_CONSTRUCTS_DEPENDENCIES","sharedConstructsGenerator","PACKAGES_DIR","SHARED_CONSTRUCTS_DIR","SHARED_INFRA_CONFIG_DIR","sharedInfraConfigGenerator","SHARED_INFRA_SCRIPTS_DEPENDENCIES","sharedInfraScriptsGenerator","DEPENDENCIES","ts","name","dev","root","INFRA_APP_GENERATOR_INFO","filename","tsInfraGenerator","tree","schema","lib","fullyQualifiedName","preferInstallDependencies","containers","cdkEnv","undefined","CDK_DOCKER","withCdkEnv","opts","existingEnv","env","iac","stageConfig","synthDirFromRoot","dir","synthDirFromProject","split","map","join","distDirFromProjectRoot","projectConfig","libraryRoot","npmScopePrefix","scopeAlias","namespace","sandboxStagePattern","delete","dirname","synthDir","pkgMgrCmd","exec","overwriteStrategy","Overwrite","config","projectType","targets","compile","outputs","synth","cache","executor","inputs","dependsOn","options","cwd","command","checkov","deploy","destroy","cdk","bootstrap","projectRoot","tsConfig","references","relative","languages"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAEjBC,wBAAwB,EAExBC,UAAU,QACL,aAAa;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,sBAAsBC,eAAe,QAAQ,4BAA4B;AAChF,SAASC,iBAAiB,QAAQ,mCAAmC;AACrE,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,SACEC,mBAAmB,EACnBC,cAAc,QACT,uCAAuC;AAC9C,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,OAAO,QAAQ,+BAA+B;AACvD,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SACEC,8BAA8B,EAC9BC,iCAAiC,EACjCC,oBAAoB,EACpBC,gBAAgB,EAEhBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,gCAAgC,QAAQ,6BAA6B;AAC9E,SAASC,UAAU,QAAQ,oBAA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ACE7F,MAAM,GAAGA,KAAK8F,QAAQ,CACpBjC,aACA,GAAGvB,KAAKJ,IAAI,CAAC,CAAC,EAAEV,cAAc,EAC9B,CAAC,EAAEC,sBAAsB,kBAAkB,CAAC;gBAChD;mBACI2B,cACA;oBACE;wBACEpD,MAAM,GAAGA,KAAK8F,QAAQ,CACpBjC,aACA,GAAGvB,KAAKJ,IAAI,CAAC,CAAC,EAAEV,cAAc,EAC9B,CAAC,EAAEE,wBAAwB,cAAc,CAAC;oBAC9C;iBACD,GACD,EAAE;aACP;QACH,CAAA;IAEA,MAAMhB,gCAAgC4B,MAAM;QAACH;KAAyB;IAEtE,MAAM3B,qBAAqB8B;IAC3B,OAAO,IACL7B,oBAAoB6B,MAAMC,OAAOG,yBAAyB,EAAE;YAC1DqD,WAAW;gBAAC;aAAa;QAC3B;AACJ;AACA,eAAe1D,iBAAiB"}
@@ -17,7 +17,7 @@ export declare const DEPENDENCIES: import("../utils/declared-dependencies.js").D
17
17
  readonly name: "typescript";
18
18
  }, {
19
19
  readonly name: "@biomejs/biome";
20
- }], 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>>[]>;
20
+ }], 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>>[]>;
21
21
  export declare const INIT_GENERATOR_INFO: NxGeneratorInfo;
22
22
  /**
23
23
  * Configure an existing Nx workspace to use the @aws/nx-plugin.
@@ -0,0 +1,3 @@
1
+ {
2
+ "description": "Cache the AgentCore ADOT install in its own target so editing an agent no longer re-runs it"
3
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { type MigrationReturnObject, type Tree } from '@nx/devkit';
6
+ export default function migration(tree: Tree): Promise<MigrationReturnObject>;
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { getProjects, joinPathFragments, updateProjectConfiguration } from "@nx/devkit";
5
+ import { ADOT_VENDOR_TARGET_NAME, adotVendorDir } from "../../../utils/agent-core-packaging.js";
6
+ import { formatFilesInSubtree } from "../../../utils/format.js";
7
+ /**
8
+ * A TypeScript AgentCore code package installed the AWS Distro for OpenTelemetry
9
+ * into the package directory as its last packaging step. That target's `inputs`
10
+ * are the project's source, so editing an agent re-ran the install — several
11
+ * seconds of npm work whose result depends only on the pinned ADOT version.
12
+ *
13
+ * The install moves to its own target Nx caches independently. It declares no
14
+ * `inputs`, since the version it pins is part of the command and Nx hashes a
15
+ * target's configuration, so a version bump still invalidates it while a source
16
+ * edit no longer does. Packaging copies the vendored tree instead.
17
+ *
18
+ * The vendor directory is a sibling of the package directory, not a path inside
19
+ * it: Nx replaces a cached target's whole declared output directory on restore,
20
+ * so nesting one target's output inside another's makes each wipe the other's
21
+ * work on a cache hit.
22
+ *
23
+ * A packaging target that no longer matches the shape the generator vended has
24
+ * been reworked by the user, so it is left untouched and reported.
25
+ *
26
+ * The filesystem commands are spelled with `shx`: the migration that replaced the
27
+ * single purpose CLIs was committed first, and `latest` migrations run in the
28
+ * order their folders were committed, so it has already run by the time this one
29
+ * does.
30
+ */ /** The ADOT install as the packaging target ran it, capturing its `--prefix`. */ const ADOT_INSTALL = /^npm install --prefix (\S+) .*@aws\/aws-distro-opentelemetry-node-autoinstrumentation@(\S+)\s*$/;
31
+ const divergedStep = (projectName, targetName)=>`${projectName}:${targetName}: installs the OpenTelemetry distro but no longer matches the shape the generator produced - left untouched. To stop the install re-running whenever the project's source changes, move it to its own target with no \`inputs\` and an \`outputs\` directory outside this target's, and copy that directory in here instead.`;
32
+ /** Commands a target runs, as plain strings. */ const commandsOf = (target)=>{
33
+ const { commands } = target.options ?? {};
34
+ return Array.isArray(commands) ? commands.filter((c)=>typeof c === 'string') : [];
35
+ };
36
+ /**
37
+ * Copy the vendored `node_modules` into the package. `-R` and the trailing `/.`
38
+ * merge the directory's contents rather than nesting it inside the destination.
39
+ */ const copyCommand = (vendorDir, packageDir)=>`shx cp -R ${joinPathFragments(vendorDir, 'node_modules')}/. ${joinPathFragments(packageDir, 'node_modules')}`;
40
+ export default async function migration(tree) {
41
+ const nextSteps = [];
42
+ for (const [projectName, project] of getProjects(tree)){
43
+ let changed = false;
44
+ const vendorDir = adotVendorDir(project.root);
45
+ for (const [targetName, target] of Object.entries(project.targets ?? {})){
46
+ if (targetName === ADOT_VENDOR_TARGET_NAME) continue;
47
+ const commands = commandsOf(target);
48
+ const installIndex = commands.findIndex((c)=>ADOT_INSTALL.test(c));
49
+ if (installIndex < 0) continue;
50
+ const install = commands[installIndex];
51
+ const [, prefix] = ADOT_INSTALL.exec(install);
52
+ // The install targets the directory this target packages into, and it
53
+ // copies the bundle in with shx. Anything else has been reworked.
54
+ const packageDir = prefix;
55
+ const copiesBundle = commands.some((c)=>c !== install && c.startsWith('shx cp '));
56
+ const declaresPackageOutput = (target.outputs ?? []).some((o)=>o.endsWith(packageDir));
57
+ if (!copiesBundle || !declaresPackageOutput) {
58
+ nextSteps.push(divergedStep(projectName, targetName));
59
+ continue;
60
+ }
61
+ project.targets[ADOT_VENDOR_TARGET_NAME] ??= {
62
+ cache: true,
63
+ inputs: [],
64
+ outputs: [
65
+ `{workspaceRoot}/${vendorDir}`
66
+ ],
67
+ executor: 'nx:run-commands',
68
+ options: {
69
+ commands: [
70
+ `shx rm -rf ${vendorDir}`,
71
+ `shx mkdir -p ${vendorDir}`,
72
+ install.replace(prefix, vendorDir)
73
+ ],
74
+ parallel: false
75
+ }
76
+ };
77
+ const updated = [
78
+ ...commands
79
+ ];
80
+ updated[installIndex] = copyCommand(vendorDir, packageDir);
81
+ target.options.commands = updated;
82
+ target.dependsOn = [
83
+ ...target.dependsOn ?? [],
84
+ ADOT_VENDOR_TARGET_NAME
85
+ ].filter((d, i, all)=>all.indexOf(d) === i);
86
+ changed = true;
87
+ }
88
+ if (changed) {
89
+ updateProjectConfiguration(tree, projectName, project);
90
+ }
91
+ }
92
+ await formatFilesInSubtree(tree);
93
+ return {
94
+ nextSteps
95
+ };
96
+ }
97
+
98
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/agent-core-vendor-target/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getProjects,\n joinPathFragments,\n type MigrationReturnObject,\n type ProjectConfiguration,\n type TargetConfiguration,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport {\n ADOT_VENDOR_TARGET_NAME,\n adotVendorDir,\n} from '../../../utils/agent-core-packaging.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\n\n/**\n * A TypeScript AgentCore code package installed the AWS Distro for OpenTelemetry\n * into the package directory as its last packaging step. That target's `inputs`\n * are the project's source, so editing an agent re-ran the install — several\n * seconds of npm work whose result depends only on the pinned ADOT version.\n *\n * The install moves to its own target Nx caches independently. It declares no\n * `inputs`, since the version it pins is part of the command and Nx hashes a\n * target's configuration, so a version bump still invalidates it while a source\n * edit no longer does. Packaging copies the vendored tree instead.\n *\n * The vendor directory is a sibling of the package directory, not a path inside\n * it: Nx replaces a cached target's whole declared output directory on restore,\n * so nesting one target's output inside another's makes each wipe the other's\n * work on a cache hit.\n *\n * A packaging target that no longer matches the shape the generator vended has\n * been reworked by the user, so it is left untouched and reported.\n *\n * The filesystem commands are spelled with `shx`: the migration that replaced the\n * single purpose CLIs was committed first, and `latest` migrations run in the\n * order their folders were committed, so it has already run by the time this one\n * does.\n */\n\n/** The ADOT install as the packaging target ran it, capturing its `--prefix`. */\nconst ADOT_INSTALL =\n /^npm install --prefix (\\S+) .*@aws\\/aws-distro-opentelemetry-node-autoinstrumentation@(\\S+)\\s*$/;\n\nconst divergedStep = (projectName: string, targetName: string) =>\n `${projectName}:${targetName}: installs the OpenTelemetry distro but no longer matches the shape the generator produced - left untouched. To stop the install re-running whenever the project's source changes, move it to its own target with no \\`inputs\\` and an \\`outputs\\` directory outside this target's, and copy that directory in here instead.`;\n\n/** Commands a target runs, as plain strings. */\nconst commandsOf = (target: TargetConfiguration): string[] => {\n const { commands } = (target.options ?? {}) as { commands?: unknown };\n return Array.isArray(commands)\n ? commands.filter((c): c is string => typeof c === 'string')\n : [];\n};\n\n/**\n * Copy the vendored `node_modules` into the package. `-R` and the trailing `/.`\n * merge the directory's contents rather than nesting it inside the destination.\n */\nconst copyCommand = (vendorDir: string, packageDir: string): string =>\n `shx cp -R ${joinPathFragments(vendorDir, 'node_modules')}/. ${joinPathFragments(packageDir, 'node_modules')}`;\n\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [];\n\n for (const [projectName, project] of getProjects(tree)) {\n let changed = false;\n const vendorDir = adotVendorDir(project.root);\n\n for (const [targetName, target] of Object.entries(project.targets ?? {})) {\n if (targetName === ADOT_VENDOR_TARGET_NAME) continue;\n\n const commands = commandsOf(target);\n const installIndex = commands.findIndex((c) => ADOT_INSTALL.test(c));\n if (installIndex < 0) continue;\n\n const install = commands[installIndex];\n const [, prefix] = ADOT_INSTALL.exec(install)!;\n\n // The install targets the directory this target packages into, and it\n // copies the bundle in with shx. Anything else has been reworked.\n const packageDir = prefix;\n const copiesBundle = commands.some(\n (c) => c !== install && c.startsWith('shx cp '),\n );\n const declaresPackageOutput = (target.outputs ?? []).some((o) =>\n o.endsWith(packageDir),\n );\n if (!copiesBundle || !declaresPackageOutput) {\n nextSteps.push(divergedStep(projectName, targetName));\n continue;\n }\n\n project.targets![ADOT_VENDOR_TARGET_NAME] ??= {\n cache: true,\n inputs: [],\n outputs: [`{workspaceRoot}/${vendorDir}`],\n executor: 'nx:run-commands',\n options: {\n commands: [\n `shx rm -rf ${vendorDir}`,\n `shx mkdir -p ${vendorDir}`,\n install.replace(prefix, vendorDir),\n ],\n parallel: false,\n },\n };\n\n const updated = [...commands];\n updated[installIndex] = copyCommand(vendorDir, packageDir);\n target.options!.commands = updated;\n target.dependsOn = [\n ...(target.dependsOn ?? []),\n ADOT_VENDOR_TARGET_NAME,\n ].filter((d, i, all) => all.indexOf(d) === i);\n\n changed = true;\n }\n\n if (changed) {\n updateProjectConfiguration(\n tree,\n projectName,\n project as ProjectConfiguration,\n );\n }\n }\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","joinPathFragments","updateProjectConfiguration","ADOT_VENDOR_TARGET_NAME","adotVendorDir","formatFilesInSubtree","ADOT_INSTALL","divergedStep","projectName","targetName","commandsOf","target","commands","options","Array","isArray","filter","c","copyCommand","vendorDir","packageDir","migration","tree","nextSteps","project","changed","root","Object","entries","targets","installIndex","findIndex","test","install","prefix","exec","copiesBundle","some","startsWith","declaresPackageOutput","outputs","o","endsWith","push","cache","inputs","executor","replace","parallel","updated","dependsOn","d","i","all","indexOf"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EACXC,iBAAiB,EAKjBC,0BAA0B,QACrB,aAAa;AACpB,SACEC,uBAAuB,EACvBC,aAAa,QACR,yCAAyC;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GAED,+EAA+E,GAC/E,MAAMC,eACJ;AAEF,MAAMC,eAAe,CAACC,aAAqBC,aACzC,GAAGD,YAAY,CAAC,EAAEC,WAAW,4TAA4T,CAAC;AAE5V,8CAA8C,GAC9C,MAAMC,aAAa,CAACC;IAClB,MAAM,EAAEC,QAAQ,EAAE,GAAID,OAAOE,OAAO,IAAI,CAAC;IACzC,OAAOC,MAAMC,OAAO,CAACH,YACjBA,SAASI,MAAM,CAAC,CAACC,IAAmB,OAAOA,MAAM,YACjD,EAAE;AACR;AAEA;;;CAGC,GACD,MAAMC,cAAc,CAACC,WAAmBC,aACtC,CAAC,UAAU,EAAEnB,kBAAkBkB,WAAW,gBAAgB,GAAG,EAAElB,kBAAkBmB,YAAY,iBAAiB;AAEhH,eAAe,eAAeC,UAC5BC,IAAU;IAEV,MAAMC,YAAsB,EAAE;IAE9B,KAAK,MAAM,CAACf,aAAagB,QAAQ,IAAIxB,YAAYsB,MAAO;QACtD,IAAIG,UAAU;QACd,MAAMN,YAAYf,cAAcoB,QAAQE,IAAI;QAE5C,KAAK,MAAM,CAACjB,YAAYE,OAAO,IAAIgB,OAAOC,OAAO,CAACJ,QAAQK,OAAO,IAAI,CAAC,GAAI;YACxE,IAAIpB,eAAeN,yBAAyB;YAE5C,MAAMS,WAAW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,MACAd,aACAgB;QAEJ;IACF;IAEA,MAAMnB,qBAAqBiB;IAE3B,OAAO;QAAEC;IAAU;AACrB"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "description": "Deploy using CloudFormation express mode from the deploy and deploy-sandbox targets of ts#infra projects"
3
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { type MigrationReturnObject, type Tree } from '@nx/devkit';
6
+ export default function migration(tree: Tree): Promise<MigrationReturnObject>;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { getProjects, updateProjectConfiguration } from "@nx/devkit";
5
+ import { INFRA_APP_GENERATOR_INFO } from "../../../infra/app/generator.js";
6
+ import { formatFilesInSubtree } from "../../../utils/format.js";
7
+ /**
8
+ * Deploy using CloudFormation express mode from the deploy and deploy-sandbox
9
+ * targets of ts#infra projects
10
+ *
11
+ * Express mode completes each resource operation as soon as its configuration
12
+ * is applied rather than waiting for full stabilization, which is a much faster
13
+ * iteration cycle for development deploys.
14
+ *
15
+ * Two targets keep waiting for full stabilization: `deploy-ci`, since pipeline
16
+ * deployments should never skip it, and - when stages are configured - `deploy`,
17
+ * which deploys whichever stage is named, including beta and prod.
18
+ */ const DEPLOY_TARGETS = [
19
+ 'deploy',
20
+ 'deploy-sandbox'
21
+ ];
22
+ const EXPRESS_FLAG = '--express';
23
+ /**
24
+ * Whether the command is one of the deploy commands this migration vends -
25
+ * either a direct `cdk deploy`, or the stage-config `infra-deploy.ts` script
26
+ * that wraps it. Anything else has been hand-written and is reported rather
27
+ * than rewritten.
28
+ */ const isGeneratedDeployCommand = (command)=>/(^|\s)cdk\s+deploy(\s|$)/.test(command) || command.includes('infra-deploy.ts');
29
+ /** Whether the command runs the stage-config deploy script. */ const isStageConfigDeploy = (command)=>command.includes('infra-deploy.ts');
30
+ const divergedNextStep = (projectName, target)=>`${projectName}: its ${target} target has been customised, so it was left as it is. Add "${EXPRESS_FLAG}" to the target's command to deploy using CloudFormation express mode.`;
31
+ export default async function migration(tree) {
32
+ const nextSteps = [];
33
+ let migrated = false;
34
+ for (const [name, project] of getProjects(tree)){
35
+ if (project.metadata?.generator !== INFRA_APP_GENERATOR_INFO.id) {
36
+ continue;
37
+ }
38
+ let projectChanged = false;
39
+ for (const targetName of DEPLOY_TARGETS){
40
+ const target = project.targets?.[targetName];
41
+ const command = target?.options?.command;
42
+ if (!target || typeof command !== 'string') {
43
+ continue;
44
+ }
45
+ // Already migrated (or generated by a version that already passes it) -
46
+ // skip so re-running is a no-op.
47
+ if (command.split(/\s+/).includes(EXPRESS_FLAG)) {
48
+ continue;
49
+ }
50
+ // `--no-express` is a deliberate opt-out, so honour it rather than
51
+ // flipping the user back to express mode.
52
+ if (command.split(/\s+/).includes('--no-express')) {
53
+ continue;
54
+ }
55
+ if (!isGeneratedDeployCommand(command)) {
56
+ nextSteps.push(divergedNextStep(name, targetName));
57
+ continue;
58
+ }
59
+ // When stages are configured, `deploy` deploys whichever stage is named,
60
+ // including beta and prod, so it stays on full stabilization. Only its
61
+ // sandbox counterpart opts into express mode.
62
+ if (targetName === 'deploy' && isStageConfigDeploy(command)) {
63
+ continue;
64
+ }
65
+ // Appended last so it stays clear of the stage pattern, which the
66
+ // stage-config deploy script reads from the first positional argument.
67
+ target.options.command = `${command} ${EXPRESS_FLAG}`;
68
+ projectChanged = true;
69
+ }
70
+ if (projectChanged) {
71
+ updateProjectConfiguration(tree, name, project);
72
+ migrated = true;
73
+ }
74
+ }
75
+ if (migrated) {
76
+ await formatFilesInSubtree(tree);
77
+ }
78
+ return {
79
+ nextSteps
80
+ };
81
+ }
82
+
83
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/infra-deploy-express-mode/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getProjects,\n type MigrationReturnObject,\n type TargetConfiguration,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { INFRA_APP_GENERATOR_INFO } from '../../../infra/app/generator.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\n\n/**\n * Deploy using CloudFormation express mode from the deploy and deploy-sandbox\n * targets of ts#infra projects\n *\n * Express mode completes each resource operation as soon as its configuration\n * is applied rather than waiting for full stabilization, which is a much faster\n * iteration cycle for development deploys.\n *\n * Two targets keep waiting for full stabilization: `deploy-ci`, since pipeline\n * deployments should never skip it, and - when stages are configured - `deploy`,\n * which deploys whichever stage is named, including beta and prod.\n */\n\nconst DEPLOY_TARGETS = ['deploy', 'deploy-sandbox'];\n\nconst EXPRESS_FLAG = '--express';\n\n/**\n * Whether the command is one of the deploy commands this migration vends -\n * either a direct `cdk deploy`, or the stage-config `infra-deploy.ts` script\n * that wraps it. Anything else has been hand-written and is reported rather\n * than rewritten.\n */\nconst isGeneratedDeployCommand = (command: string): boolean =>\n /(^|\\s)cdk\\s+deploy(\\s|$)/.test(command) ||\n command.includes('infra-deploy.ts');\n\n/** Whether the command runs the stage-config deploy script. */\nconst isStageConfigDeploy = (command: string): boolean =>\n command.includes('infra-deploy.ts');\n\nconst divergedNextStep = (projectName: string, target: string): string =>\n `${projectName}: its ${target} target has been customised, so it was left as it is. Add \"${EXPRESS_FLAG}\" to the target's command to deploy using CloudFormation express mode.`;\n\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [];\n let migrated = false;\n\n for (const [name, project] of getProjects(tree)) {\n if (\n (project.metadata as { generator?: string } | undefined)?.generator !==\n INFRA_APP_GENERATOR_INFO.id\n ) {\n continue;\n }\n\n let projectChanged = false;\n\n for (const targetName of DEPLOY_TARGETS) {\n const target: TargetConfiguration | undefined =\n project.targets?.[targetName];\n const command = target?.options?.command;\n if (!target || typeof command !== 'string') {\n continue;\n }\n\n // Already migrated (or generated by a version that already passes it) -\n // skip so re-running is a no-op.\n if (command.split(/\\s+/).includes(EXPRESS_FLAG)) {\n continue;\n }\n\n // `--no-express` is a deliberate opt-out, so honour it rather than\n // flipping the user back to express mode.\n if (command.split(/\\s+/).includes('--no-express')) {\n continue;\n }\n\n if (!isGeneratedDeployCommand(command)) {\n nextSteps.push(divergedNextStep(name, targetName));\n continue;\n }\n\n // When stages are configured, `deploy` deploys whichever stage is named,\n // including beta and prod, so it stays on full stabilization. Only its\n // sandbox counterpart opts into express mode.\n if (targetName === 'deploy' && isStageConfigDeploy(command)) {\n continue;\n }\n\n // Appended last so it stays clear of the stage pattern, which the\n // stage-config deploy script reads from the first positional argument.\n target.options.command = `${command} ${EXPRESS_FLAG}`;\n projectChanged = true;\n }\n\n if (projectChanged) {\n updateProjectConfiguration(tree, name, project);\n migrated = true;\n }\n }\n\n if (migrated) {\n await formatFilesInSubtree(tree);\n }\n\n return { nextSteps };\n}\n"],"names":["getProjects","updateProjectConfiguration","INFRA_APP_GENERATOR_INFO","formatFilesInSubtree","DEPLOY_TARGETS","EXPRESS_FLAG","isGeneratedDeployCommand","command","test","includes","isStageConfigDeploy","divergedNextStep","projectName","target","migration","tree","nextSteps","migrated","name","project","metadata","generator","id","projectChanged","targetName","targets","options","split","push"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EAIXC,0BAA0B,QACrB,aAAa;AACpB,SAASC,wBAAwB,QAAQ,kCAAkC;AAC3E,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE;;;;;;;;;;;CAWC,GAED,MAAMC,iBAAiB;IAAC;IAAU;CAAiB;AAEnD,MAAMC,eAAe;AAErB;;;;;CAKC,GACD,MAAMC,2BAA2B,CAACC,UAChC,2BAA2BC,IAAI,CAACD,YAChCA,QAAQE,QAAQ,CAAC;AAEnB,6DAA6D,GAC7D,MAAMC,sBAA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A,OAAO;QAAEC;IAAU;AACrB"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "description": "Replace the ncp, rimraf, make-dir-cli and cpy-cli filesystem CLIs with shx"
3
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { type MigrationReturnObject, type Tree } from '@nx/devkit';
6
+ export default function migration(tree: Tree): Promise<MigrationReturnObject>;