@aws/nx-plugin 1.0.2 → 1.0.4

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 (59) hide show
  1. package/LICENSE-THIRD-PARTY +30 -14
  2. package/migrations.json +22 -17
  3. package/package.json +7 -7
  4. package/src/agentcore-gateway/__snapshots__/generator.spec.ts.snap +3 -3
  5. package/src/infra/app/__snapshots__/generator.spec.ts.snap +3 -3
  6. package/src/license/dependency-check/collectors/npm-collector.d.ts +14 -0
  7. package/src/license/dependency-check/collectors/npm-collector.js +35 -1
  8. package/src/license/dependency-check/collectors/npm-collector.js.map +1 -1
  9. package/src/migrations/v1.0.0-rc.98/0001-sandbox-pattern-nested-stacks/migration.js.map +1 -0
  10. package/src/migrations/v1.0.0-rc.98/0002-shadcn-cn-package/migration.js.map +1 -0
  11. package/src/migrations/v1.0.2/0001-terraform-harness-environment-variables/migration.js.map +1 -0
  12. package/src/migrations/v1.0.3/0001-terraform-init-target/metadata.json +3 -0
  13. package/src/migrations/v1.0.3/0001-terraform-init-target/migration.d.ts +6 -0
  14. package/src/migrations/v1.0.3/0001-terraform-init-target/migration.js +153 -0
  15. package/src/migrations/v1.0.3/0001-terraform-init-target/migration.js.map +1 -0
  16. package/src/preset/__snapshots__/generator.spec.ts.snap +2 -2
  17. package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +7 -7
  18. package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +9 -9
  19. package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +8 -8
  20. package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +3 -3
  21. package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +27 -27
  22. package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +6 -6
  23. package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +8 -8
  24. package/src/py/rdb/__snapshots__/generator.spec.ts.snap +10 -10
  25. package/src/sdk/open-api.d.ts +2 -2
  26. package/src/sdk/open-api.js +1 -1
  27. package/src/sdk/open-api.js.map +1 -1
  28. package/src/smithy/project/__snapshots__/generator.spec.ts.snap +16 -16
  29. package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +19 -19
  30. package/src/terraform/project/generator.js +52 -44
  31. package/src/terraform/project/generator.js.map +1 -1
  32. package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +27 -27
  33. package/src/ts/agent/__snapshots__/generator.spec.ts.snap +8 -8
  34. package/src/ts/dcr-proxy/__snapshots__/generator.spec.ts.snap +3 -3
  35. package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +3 -3
  36. package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +6 -6
  37. package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +4 -4
  38. package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +18 -18
  39. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +28 -28
  40. package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +3 -3
  41. package/src/utils/docker.d.ts +1 -1
  42. package/src/utils/test-migration.d.ts +20 -0
  43. package/src/utils/test-migration.js +32 -0
  44. package/src/utils/test-migration.js.map +1 -0
  45. package/src/utils/versions.d.ts +99 -99
  46. package/src/utils/versions.js +92 -92
  47. package/src/utils/versions.js.map +1 -1
  48. package/src/migrations/latest/sandbox-pattern-nested-stacks/migration.js.map +0 -1
  49. package/src/migrations/latest/shadcn-cn-package/migration.js.map +0 -1
  50. package/src/migrations/latest/terraform-harness-environment-variables/migration.js.map +0 -1
  51. /package/src/migrations/{latest/sandbox-pattern-nested-stacks → v1.0.0-rc.98/0001-sandbox-pattern-nested-stacks}/metadata.json +0 -0
  52. /package/src/migrations/{latest/sandbox-pattern-nested-stacks → v1.0.0-rc.98/0001-sandbox-pattern-nested-stacks}/migration.d.ts +0 -0
  53. /package/src/migrations/{latest/sandbox-pattern-nested-stacks → v1.0.0-rc.98/0001-sandbox-pattern-nested-stacks}/migration.js +0 -0
  54. /package/src/migrations/{latest/shadcn-cn-package → v1.0.0-rc.98/0002-shadcn-cn-package}/metadata.json +0 -0
  55. /package/src/migrations/{latest/shadcn-cn-package → v1.0.0-rc.98/0002-shadcn-cn-package}/migration.d.ts +0 -0
  56. /package/src/migrations/{latest/shadcn-cn-package → v1.0.0-rc.98/0002-shadcn-cn-package}/migration.js +0 -0
  57. /package/src/migrations/{latest/terraform-harness-environment-variables → v1.0.2/0001-terraform-harness-environment-variables}/metadata.json +0 -0
  58. /package/src/migrations/{latest/terraform-harness-environment-variables → v1.0.2/0001-terraform-harness-environment-variables}/migration.d.ts +0 -0
  59. /package/src/migrations/{latest/terraform-harness-environment-variables → v1.0.2/0001-terraform-harness-environment-variables}/migration.js +0 -0
@@ -579,15 +579,15 @@ terraform {
579
579
  required_providers {
580
580
  aws = {
581
581
  source = "hashicorp/aws"
582
- version = "6.63.0"
582
+ version = "6.66.0"
583
583
  }
584
584
  archive = {
585
585
  source = "hashicorp/archive"
586
- version = "2.8.0"
586
+ version = "2.8.1"
587
587
  }
588
588
  random = {
589
589
  source = "hashicorp/random"
590
- version = "3.9.0"
590
+ version = "3.9.1"
591
591
  }
592
592
  }
593
593
  }
@@ -35,7 +35,7 @@ exports[`ts#dynamodb generator > should generate terraform modules when iac is t
35
35
  required_providers {
36
36
  aws = {
37
37
  source = "hashicorp/aws"
38
- version = "6.63.0"
38
+ version = "6.66.0"
39
39
  }
40
40
  }
41
41
  }
@@ -232,11 +232,11 @@ exports[`ts#dynamodb generator > should generate terraform modules when iac is t
232
232
  required_providers {
233
233
  aws = {
234
234
  source = "hashicorp/aws"
235
- version = "6.63.0"
235
+ version = "6.66.0"
236
236
  }
237
237
  random = {
238
238
  source = "hashicorp/random"
239
- version = "3.9.0"
239
+ version = "3.9.1"
240
240
  }
241
241
  }
242
242
  }
@@ -141,15 +141,15 @@ exports[`ts-lambda-function generator > terraform iac > should generate terrafor
141
141
  required_providers {
142
142
  aws = {
143
143
  source = "hashicorp/aws"
144
- version = "6.63.0"
144
+ version = "6.66.0"
145
145
  }
146
146
  archive = {
147
147
  source = "hashicorp/archive"
148
- version = "2.8.0"
148
+ version = "2.8.1"
149
149
  }
150
150
  random = {
151
151
  source = "hashicorp/random"
152
- version = "3.9.0"
152
+ version = "3.9.1"
153
153
  }
154
154
  }
155
155
  }
@@ -326,15 +326,15 @@ exports[`ts-lambda-function generator > terraform iac > should match snapshot fo
326
326
  required_providers {
327
327
  aws = {
328
328
  source = "hashicorp/aws"
329
- version = "6.63.0"
329
+ version = "6.66.0"
330
330
  }
331
331
  archive = {
332
332
  source = "hashicorp/archive"
333
- version = "2.8.0"
333
+ version = "2.8.1"
334
334
  }
335
335
  random = {
336
336
  source = "hashicorp/random"
337
- version = "3.9.0"
337
+ version = "3.9.1"
338
338
  }
339
339
  }
340
340
  }
@@ -155,15 +155,15 @@ exports[`ts#mcp-server generator > should match snapshot for Terraform generated
155
155
  required_providers {
156
156
  aws = {
157
157
  source = "hashicorp/aws"
158
- version = "6.63.0"
158
+ version = "6.66.0"
159
159
  }
160
160
  null = {
161
161
  source = "hashicorp/null"
162
- version = "3.3.1"
162
+ version = "3.3.2"
163
163
  }
164
164
  random = {
165
165
  source = "hashicorp/random"
166
- version = "3.9.0"
166
+ version = "3.9.1"
167
167
  }
168
168
  }
169
169
  }
@@ -514,7 +514,7 @@ resource "null_resource" "runtime_ready" {
514
514
 
515
515
  provisioner "local-exec" {
516
516
  command = <<-EOT
517
- uv run --with boto3==1.43.89 python -c "
517
+ uv run --with boto3==1.43.103 python -c "
518
518
  import boto3
519
519
  import json
520
520
  import os
@@ -848,15 +848,15 @@ terraform {
848
848
  required_providers {
849
849
  aws = {
850
850
  source = "hashicorp/aws"
851
- version = "6.63.0"
851
+ version = "6.66.0"
852
852
  }
853
853
  null = {
854
854
  source = "hashicorp/null"
855
- version = "3.3.1"
855
+ version = "3.3.2"
856
856
  }
857
857
  random = {
858
858
  source = "hashicorp/random"
859
- version = "3.9.0"
859
+ version = "3.9.1"
860
860
  }
861
861
  }
862
862
  }
@@ -1515,23 +1515,23 @@ exports[`ts#rdb generator > should generate terraform modules when iac is Terraf
1515
1515
  required_providers {
1516
1516
  archive = {
1517
1517
  source = "hashicorp/archive"
1518
- version = "2.8.0"
1518
+ version = "2.8.1"
1519
1519
  }
1520
1520
  aws = {
1521
1521
  source = "hashicorp/aws"
1522
- version = "6.63.0"
1522
+ version = "6.66.0"
1523
1523
  }
1524
1524
  external = {
1525
1525
  source = "hashicorp/external"
1526
- version = "2.4.1"
1526
+ version = "2.4.2"
1527
1527
  }
1528
1528
  null = {
1529
1529
  source = "hashicorp/null"
1530
- version = "3.3.1"
1530
+ version = "3.3.2"
1531
1531
  }
1532
1532
  random = {
1533
1533
  source = "hashicorp/random"
1534
- version = "3.9.0"
1534
+ version = "3.9.1"
1535
1535
  }
1536
1536
  }
1537
1537
  }
@@ -2214,15 +2214,15 @@ terraform {
2214
2214
  required_providers {
2215
2215
  aws = {
2216
2216
  source = "hashicorp/aws"
2217
- version = "6.63.0"
2217
+ version = "6.66.0"
2218
2218
  }
2219
2219
  null = {
2220
2220
  source = "hashicorp/null"
2221
- version = "3.3.1"
2221
+ version = "3.3.2"
2222
2222
  }
2223
2223
  random = {
2224
2224
  source = "hashicorp/random"
2225
- version = "3.9.0"
2225
+ version = "3.9.1"
2226
2226
  }
2227
2227
  }
2228
2228
  }
@@ -2881,23 +2881,23 @@ exports[`ts#rdb generator > should generate terraform modules with MySQL engine
2881
2881
  required_providers {
2882
2882
  archive = {
2883
2883
  source = "hashicorp/archive"
2884
- version = "2.8.0"
2884
+ version = "2.8.1"
2885
2885
  }
2886
2886
  aws = {
2887
2887
  source = "hashicorp/aws"
2888
- version = "6.63.0"
2888
+ version = "6.66.0"
2889
2889
  }
2890
2890
  external = {
2891
2891
  source = "hashicorp/external"
2892
- version = "2.4.1"
2892
+ version = "2.4.2"
2893
2893
  }
2894
2894
  null = {
2895
2895
  source = "hashicorp/null"
2896
- version = "3.3.1"
2896
+ version = "3.3.2"
2897
2897
  }
2898
2898
  random = {
2899
2899
  source = "hashicorp/random"
2900
- version = "3.9.0"
2900
+ version = "3.9.1"
2901
2901
  }
2902
2902
  }
2903
2903
  }
@@ -4520,7 +4520,7 @@ exports[`ts#rdb generator > should generate the aurora shared construct 4`] = `
4520
4520
  "FROM public.ecr.aws/lambda/nodejs:24
4521
4521
 
4522
4522
  # Upgrade npm to a version free of known HIGH/CRITICAL vulnerabilities
4523
- RUN npm install -g npm@12.0.2
4523
+ RUN npm install -g npm@12.1.0
4524
4524
 
4525
4525
  # Patch OS packages beyond the base image's pinned release, and drop the
4526
4526
  # runtime's convenience copy of the AWS SDK (the handler bundle inlines its
@@ -4541,7 +4541,7 @@ WORKDIR \${LAMBDA_TASK_ROOT}
4541
4541
  RUN printf 'allow-scripts[]=prisma\\nallow-scripts[]=@prisma/engines\\n' > .npmrc \\
4542
4542
  && npm init -y \\
4543
4543
  && npm pkg set "overrides.deepmerge-ts=8.0.2" \\
4544
- && npm pkg set "overrides.mysql2=3.24.3" \\
4544
+ && npm pkg set "overrides.mysql2=3.24.4" \\
4545
4545
  && npm install prisma@7.10.0 \\
4546
4546
  && rm .npmrc \\
4547
4547
  && npm uninstall -g npm
@@ -131,16 +131,16 @@ exports[`react-website generator > TailwindCSS integration > terraform iac > sho
131
131
  required_providers {
132
132
  aws = {
133
133
  source = "hashicorp/aws"
134
- version = "6.63.0"
134
+ version = "6.66.0"
135
135
  configuration_aliases = [aws.us_east_1]
136
136
  }
137
137
  null = {
138
138
  source = "hashicorp/null"
139
- version = "3.3.1"
139
+ version = "3.3.2"
140
140
  }
141
141
  random = {
142
142
  source = "hashicorp/random"
143
- version = "3.9.0"
143
+ version = "3.9.1"
144
144
  }
145
145
  }
146
146
  }
@@ -745,7 +745,7 @@ resource "null_resource" "upload_website_files" {
745
745
  provisioner "local-exec" {
746
746
  command = <<-EOT
747
747
  cd "$ROOT_PATH"
748
- uv run --with boto3==1.43.89 python3 -c "
748
+ uv run --with boto3==1.43.103 python3 -c "
749
749
  import os
750
750
  import sys
751
751
  import boto3
@@ -868,7 +868,7 @@ resource "null_resource" "cloudfront_invalidation" {
868
868
 
869
869
  provisioner "local-exec" {
870
870
  command = <<-EOT
871
- uv run --with boto3==1.43.89 python3 -c "
871
+ uv run --with boto3==1.43.103 python3 -c "
872
872
  import boto3
873
873
  import os
874
874
  import sys
@@ -954,7 +954,7 @@ output "waf_web_acl_arn" {
954
954
  required_providers {
955
955
  aws = {
956
956
  source = "hashicorp/aws"
957
- version = "6.63.0"
957
+ version = "6.66.0"
958
958
  configuration_aliases = [aws.us_east_1]
959
959
  }
960
960
  }
@@ -1060,7 +1060,7 @@ runtime-config.json"
1060
1060
 
1061
1061
  exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > biome.json 1`] = `
1062
1062
  "{
1063
- "$schema": "https://biomejs.dev/schemas/2.5.12/schema.json",
1063
+ "$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
1064
1064
  "root": true,
1065
1065
  "formatter": {
1066
1066
  "enabled": true,
@@ -2325,19 +2325,19 @@ exports[`react-website generator > Tanstack router integration > should generate
2325
2325
  - test-app
2326
2326
  - packages/common/*
2327
2327
  catalog:
2328
- '@types/node': 26.4.1
2329
- vite: 8.2.2
2328
+ '@types/node': 26.6.3
2329
+ vite: 8.3.1
2330
2330
  vitest: 4.1.11
2331
2331
  '@vitest/coverage-v8': 4.1.11
2332
2332
  jsdom: 29.1.1
2333
2333
  '@nx/vitest': 23.2.1
2334
2334
  constructs: 10.8.1
2335
- aws-cdk-lib: 2.268.0
2336
- react: 19.2.8
2337
- react-dom: 19.2.8
2338
- '@cloudscape-design/components': 3.0.1359
2339
- '@cloudscape-design/board-components': 3.0.222
2340
- '@cloudscape-design/global-styles': 1.0.67
2335
+ aws-cdk-lib: 2.271.0
2336
+ react: 19.3.0
2337
+ react-dom: 19.3.0
2338
+ '@cloudscape-design/components': 3.0.1387
2339
+ '@cloudscape-design/board-components': 3.0.234
2340
+ '@cloudscape-design/global-styles': 1.0.70
2341
2341
  tailwindcss: 4.3.3
2342
2342
  '@nx/react': 23.2.1
2343
2343
  '@vitest/ui': 4.1.11
@@ -2936,7 +2936,7 @@ runtime-config.json"
2936
2936
 
2937
2937
  exports[`react-website generator > Tanstack router integration > should generate website with router correctly > biome.json 1`] = `
2938
2938
  "{
2939
- "$schema": "https://biomejs.dev/schemas/2.5.12/schema.json",
2939
+ "$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
2940
2940
  "root": true,
2941
2941
  "formatter": {
2942
2942
  "enabled": true,
@@ -4205,28 +4205,28 @@ exports[`react-website generator > Tanstack router integration > should generate
4205
4205
  - test-app
4206
4206
  - packages/common/*
4207
4207
  catalog:
4208
- '@types/node': 26.4.1
4209
- vite: 8.2.2
4208
+ '@types/node': 26.6.3
4209
+ vite: 8.3.1
4210
4210
  vitest: 4.1.11
4211
4211
  '@vitest/coverage-v8': 4.1.11
4212
4212
  jsdom: 29.1.1
4213
4213
  '@nx/vitest': 23.2.1
4214
4214
  constructs: 10.8.1
4215
- aws-cdk-lib: 2.268.0
4216
- react: 19.2.8
4217
- react-dom: 19.2.8
4218
- '@cloudscape-design/components': 3.0.1359
4219
- '@cloudscape-design/board-components': 3.0.222
4220
- '@cloudscape-design/global-styles': 1.0.67
4215
+ aws-cdk-lib: 2.271.0
4216
+ react: 19.3.0
4217
+ react-dom: 19.3.0
4218
+ '@cloudscape-design/components': 3.0.1387
4219
+ '@cloudscape-design/board-components': 3.0.234
4220
+ '@cloudscape-design/global-styles': 1.0.70
4221
4221
  tailwindcss: 4.3.3
4222
- '@tanstack/react-router': 1.170.32
4222
+ '@tanstack/react-router': 1.170.39
4223
4223
  '@nx/react': 23.2.1
4224
4224
  '@vitest/ui': 4.1.11
4225
4225
  '@tailwindcss/vite': 4.3.3
4226
- '@tanstack/router-plugin': 1.168.35
4227
- '@tanstack/router-generator': 1.167.33
4226
+ '@tanstack/router-plugin': 1.168.40
4227
+ '@tanstack/router-generator': 1.167.38
4228
4228
  '@tanstack/virtual-file-routes': 1.162.0
4229
- '@tanstack/router-utils': 1.162.2
4229
+ '@tanstack/router-utils': 1.162.3
4230
4230
  "
4231
4231
  `;
4232
4232
 
@@ -6,11 +6,11 @@ exports[`cognito-auth generator terraform iac > should generate terraform files
6
6
  required_providers {
7
7
  aws = {
8
8
  source = "hashicorp/aws"
9
- version = "6.63.0"
9
+ version = "6.66.0"
10
10
  }
11
11
  null = {
12
12
  source = "hashicorp/null"
13
- version = "3.3.1"
13
+ version = "3.3.2"
14
14
  }
15
15
  }
16
16
  }
@@ -67,7 +67,7 @@ resource "null_resource" "add_callback_url" {
67
67
 
68
68
  provisioner "local-exec" {
69
69
  command = <<-EOT
70
- uv run --with boto3==1.43.89 python -c "
70
+ uv run --with boto3==1.43.103 python -c "
71
71
  import boto3
72
72
  import os
73
73
  import sys
@@ -25,7 +25,7 @@ export declare const IMAGE_BUILD_CACHE = false;
25
25
  * version to install globally, and the versions its dependency overrides pin.
26
26
  */
27
27
  export declare const nodeImageVersions: () => {
28
- npmVersion: "12.0.2";
28
+ npmVersion: "12.1.0";
29
29
  minimatchVersion: "10.2.6";
30
30
  };
31
31
  /**
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import type { Tree } from '@nx/devkit';
6
+ /** Root of the plugin's migration folders, `src/migrations/<dir>/<name>/`. */
7
+ export declare const MIGRATIONS_DIR: string;
8
+ /**
9
+ * Locate a migration's folder by its name, wherever it currently lives.
10
+ *
11
+ * A migration is committed under `latest/<name>` and moved to
12
+ * `v<version>/<order>-<name>` by `scripts/backfill-migration-versions.ts` once
13
+ * the release that shipped it is known. A spec that needs another migration
14
+ * (for example to check that running every later migration converges on what
15
+ * the generator writes today) must not hardcode either path, since the weekly
16
+ * `update-versions` workflow moves the folder and would break the import.
17
+ */
18
+ export declare const migrationDir: (name: string) => string;
19
+ /** Load a migration's default export by name, wherever its folder currently lives. */
20
+ export declare const importMigration: (name: string) => Promise<(tree: Tree) => Promise<unknown>>;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { readdirSync } from "node:fs";
5
+ import { join } from "node:path";
6
+ /** Root of the plugin's migration folders, `src/migrations/<dir>/<name>/`. */ export const MIGRATIONS_DIR = join(__dirname, '..', 'migrations');
7
+ /**
8
+ * Locate a migration's folder by its name, wherever it currently lives.
9
+ *
10
+ * A migration is committed under `latest/<name>` and moved to
11
+ * `v<version>/<order>-<name>` by `scripts/backfill-migration-versions.ts` once
12
+ * the release that shipped it is known. A spec that needs another migration
13
+ * (for example to check that running every later migration converges on what
14
+ * the generator writes today) must not hardcode either path, since the weekly
15
+ * `update-versions` workflow moves the folder and would break the import.
16
+ */ export const migrationDir = (name)=>{
17
+ const folderName = new RegExp(`^(\\d+-)?${name}$`);
18
+ // `src/migrations` holds only `latest/` and `v<version>/` folders.
19
+ for (const group of readdirSync(MIGRATIONS_DIR)){
20
+ const match = readdirSync(join(MIGRATIONS_DIR, group)).find((entry)=>folderName.test(entry));
21
+ if (match) {
22
+ return join(MIGRATIONS_DIR, group, match);
23
+ }
24
+ }
25
+ throw new Error(`No migration named ${name} under ${MIGRATIONS_DIR}`);
26
+ };
27
+ /** Load a migration's default export by name, wherever its folder currently lives. */ export const importMigration = async (name)=>{
28
+ const module = await import(/* @vite-ignore */ join(migrationDir(name), 'migration.ts'));
29
+ return module.default;
30
+ };
31
+
32
+ //# sourceMappingURL=test-migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/test-migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { readdirSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { Tree } from '@nx/devkit';\n\n/** Root of the plugin's migration folders, `src/migrations/<dir>/<name>/`. */\nexport const MIGRATIONS_DIR = join(__dirname, '..', 'migrations');\n\n/**\n * Locate a migration's folder by its name, wherever it currently lives.\n *\n * A migration is committed under `latest/<name>` and moved to\n * `v<version>/<order>-<name>` by `scripts/backfill-migration-versions.ts` once\n * the release that shipped it is known. A spec that needs another migration\n * (for example to check that running every later migration converges on what\n * the generator writes today) must not hardcode either path, since the weekly\n * `update-versions` workflow moves the folder and would break the import.\n */\nexport const migrationDir = (name: string): string => {\n const folderName = new RegExp(`^(\\\\d+-)?${name}$`);\n // `src/migrations` holds only `latest/` and `v<version>/` folders.\n for (const group of readdirSync(MIGRATIONS_DIR)) {\n const match = readdirSync(join(MIGRATIONS_DIR, group)).find((entry) =>\n folderName.test(entry),\n );\n if (match) {\n return join(MIGRATIONS_DIR, group, match);\n }\n }\n throw new Error(`No migration named ${name} under ${MIGRATIONS_DIR}`);\n};\n\n/** Load a migration's default export by name, wherever its folder currently lives. */\nexport const importMigration = async (\n name: string,\n): Promise<(tree: Tree) => Promise<unknown>> => {\n const module = await import(\n /* @vite-ignore */ join(migrationDir(name), 'migration.ts')\n );\n return module.default;\n};\n"],"names":["readdirSync","join","MIGRATIONS_DIR","__dirname","migrationDir","name","folderName","RegExp","group","match","find","entry","test","Error","importMigration","module","default"],"mappings":"AAAA;;;CAGC,GAED,SAASA,WAAW,QAAQ,UAAU;AACtC,SAASC,IAAI,QAAQ,YAAY;AAGjC,4EAA4E,GAC5E,OAAO,MAAMC,iBAAiBD,KAAKE,WAAW,MAAM,cAAc;AAElE;;;;;;;;;CASC,GACD,OAAO,MAAMC,eAAe,CAACC;IAC3B,MAAMC,aAAa,IAAIC,OAAO,CAAC,SAAS,EAAEF,KAAK,CAAC,CAAC;IACjD,mEAAmE;IACnE,KAAK,MAAMG,SAASR,YAAYE,gBAAiB;QAC/C,MAAMO,QAAQT,YAAYC,KAAKC,gBAAgBM,QAAQE,IAAI,CAAC,CAACC,QAC3DL,WAAWM,IAAI,CAACD;QAElB,IAAIF,OAAO;YACT,OAAOR,KAAKC,gBAAgBM,OAAOC;QACrC;IACF;IACA,MAAM,IAAII,MAAM,CAAC,mBAAmB,EAAER,KAAK,OAAO,EAAEH,gBAAgB;AACtE,EAAE;AAEF,oFAAoF,GACpF,OAAO,MAAMY,kBAAkB,OAC7BT;IAEA,MAAMU,SAAS,MAAM,MAAM,CACzB,gBAAgB,GAAGd,KAAKG,aAAaC,OAAO;IAE9C,OAAOU,OAAOC,OAAO;AACvB,EAAE"}