@aws/nx-plugin 1.0.0-rc.94 → 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 (59) hide show
  1. package/migrations.json +21 -1
  2. package/package.json +1 -1
  3. package/src/migrations/latest/agent-connection-pin-strands-peers/metadata.json +3 -0
  4. package/src/migrations/latest/agent-connection-pin-strands-peers/migration.d.ts +18 -0
  5. package/src/migrations/latest/agent-connection-pin-strands-peers/migration.js +38 -0
  6. package/src/migrations/latest/agent-connection-pin-strands-peers/migration.js.map +1 -0
  7. package/src/migrations/latest/ignore-package-manager-temp-files/metadata.json +3 -0
  8. package/src/migrations/latest/ignore-package-manager-temp-files/migration.d.ts +12 -0
  9. package/src/migrations/latest/ignore-package-manager-temp-files/migration.js +25 -0
  10. package/src/migrations/latest/ignore-package-manager-temp-files/migration.js.map +1 -0
  11. package/src/migrations/latest/rolldown-config-bundle-transient/metadata.json +3 -0
  12. package/src/migrations/latest/rolldown-config-bundle-transient/migration.d.ts +6 -0
  13. package/src/migrations/latest/rolldown-config-bundle-transient/migration.js +80 -0
  14. package/src/migrations/latest/rolldown-config-bundle-transient/migration.js.map +1 -0
  15. package/src/migrations/latest/shadcn-package-imports-exports/metadata.json +3 -0
  16. package/src/migrations/latest/shadcn-package-imports-exports/migration.d.ts +6 -0
  17. package/src/migrations/latest/shadcn-package-imports-exports/migration.js +184 -0
  18. package/src/migrations/latest/shadcn-package-imports-exports/migration.js.map +1 -0
  19. package/src/preset/__snapshots__/generator.spec.ts.snap +5 -1
  20. package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +4 -1
  21. package/src/ts/agent/a2a-connection/generator.d.ts +4 -0
  22. package/src/ts/agent/gateway-connection/generator.d.ts +4 -0
  23. package/src/ts/agent/generator.d.ts +4 -0
  24. package/src/ts/agent/mcp-connection/generator.d.ts +4 -0
  25. package/src/ts/react-website/agui/generator.js +2 -1
  26. package/src/ts/react-website/agui/generator.js.map +1 -1
  27. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +2 -0
  28. package/src/ts/react-website/app/generator.js +2 -1
  29. package/src/ts/react-website/app/generator.js.map +1 -1
  30. package/src/utils/agent-connection/agent-connection.d.ts +2 -0
  31. package/src/utils/agent-connection/agent-connection.js +11 -4
  32. package/src/utils/agent-connection/agent-connection.js.map +1 -1
  33. package/src/utils/bundle/bundle.js +10 -0
  34. package/src/utils/bundle/bundle.js.map +1 -1
  35. package/src/utils/files/common/shadcn/src/components/ui/alert.tsx.template +1 -1
  36. package/src/utils/files/common/shadcn/src/components/ui/avatar.tsx.template +1 -1
  37. package/src/utils/files/common/shadcn/src/components/ui/breadcrumb.tsx.template +1 -1
  38. package/src/utils/files/common/shadcn/src/components/ui/button.tsx.template +1 -1
  39. package/src/utils/files/common/shadcn/src/components/ui/card.tsx.template +1 -1
  40. package/src/utils/files/common/shadcn/src/components/ui/input.tsx.template +1 -1
  41. package/src/utils/files/common/shadcn/src/components/ui/separator.tsx.template +1 -1
  42. package/src/utils/files/common/shadcn/src/components/ui/sheet.tsx.template +1 -1
  43. package/src/utils/files/common/shadcn/src/components/ui/sidebar.tsx.template +8 -8
  44. package/src/utils/files/common/shadcn/src/components/ui/skeleton.tsx.template +1 -1
  45. package/src/utils/files/common/shadcn/src/components/ui/spinner.tsx.template +1 -1
  46. package/src/utils/files/common/shadcn/src/components/ui/textarea.tsx.template +1 -1
  47. package/src/utils/files/common/shadcn/src/components/ui/tooltip.tsx.template +1 -1
  48. package/src/utils/files/shadcn/components.json.template +5 -5
  49. package/src/utils/format.d.ts +16 -0
  50. package/src/utils/format.js +15 -0
  51. package/src/utils/format.js.map +1 -1
  52. package/src/utils/init.js +11 -4
  53. package/src/utils/init.js.map +1 -1
  54. package/src/utils/pnpm-workspace.d.ts +5 -5
  55. package/src/utils/pnpm-workspace.js +5 -5
  56. package/src/utils/pnpm-workspace.js.map +1 -1
  57. package/src/utils/shared-shadcn.d.ts +9 -0
  58. package/src/utils/shared-shadcn.js +36 -26
  59. package/src/utils/shared-shadcn.js.map +1 -1
package/migrations.json CHANGED
@@ -67,6 +67,26 @@
67
67
  "description": "Cache the AgentCore ADOT install in its own target so editing an agent no longer re-runs it",
68
68
  "implementation": "./src/migrations/latest/agent-core-vendor-target/migration"
69
69
  },
70
+ "latest-rolldown-config-bundle-transient": {
71
+ "version": "1.0.0-rc.95",
72
+ "description": "Exclude the transient bundle rolldown writes while loading a TypeScript config from Biome and from git, so a concurrent format or lint target cannot fail on it",
73
+ "implementation": "./src/migrations/latest/rolldown-config-bundle-transient/migration"
74
+ },
75
+ "latest-agent-connection-pin-strands-peers": {
76
+ "version": "1.0.0-rc.95",
77
+ "description": "Declare @aws-sdk/client-s3 in the shared agent-connection project so @strands-agents/sdk resolves to a single peer-suffixed instance",
78
+ "implementation": "./src/migrations/latest/agent-connection-pin-strands-peers/migration"
79
+ },
80
+ "latest-ignore-package-manager-temp-files": {
81
+ "version": "1.0.0-rc.95",
82
+ "description": "Ignore the temporary files pnpm writes at the workspace root while materialising packages, which otherwise invalidate the Nx project graph",
83
+ "implementation": "./src/migrations/latest/ignore-package-manager-temp-files/migration"
84
+ },
85
+ "latest-shadcn-package-imports-exports": {
86
+ "version": "1.0.0-rc.95",
87
+ "description": "Move the shared shadcn package from a tsconfig paths alias to package.json imports/exports, matching the shadcn CLI's own monorepo resolution",
88
+ "implementation": "./src/migrations/latest/shadcn-package-imports-exports/migration"
89
+ },
70
90
  "v1.0.0-rc.50-0001-modernize-function-props-cast": {
71
91
  "version": "1.0.0-rc.50",
72
92
  "description": "Replace the legacy angle-bracket FunctionProps type assertion with the modern as syntax in generated API constructs",
@@ -308,7 +328,7 @@
308
328
  "implementation": "./src/migrations/v1.0.0-rc.89/0001-nx-parallel-default/migration"
309
329
  },
310
330
  "sync-vended-versions": {
311
- "version": "1.0.0-rc.94",
331
+ "version": "1.0.0-rc.95",
312
332
  "description": "Sync vended dependency versions and the tracked plugin version to those vended by this release",
313
333
  "implementation": "./src/utils/version-upgrade-migration/migration"
314
334
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin",
3
- "version": "1.0.0-rc.94",
3
+ "version": "1.0.0-rc.95",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",
@@ -0,0 +1,3 @@
1
+ {
2
+ "description": "Declare @aws-sdk/client-s3 in the shared agent-connection project so @strands-agents/sdk resolves to a single peer-suffixed instance"
3
+ }
@@ -0,0 +1,18 @@
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
+ /**
7
+ * `@aws-sdk/client-s3` is an optional peer of `@strands-agents/sdk` that the
8
+ * shared agent-connection project never imports, so it went undeclared. pnpm
9
+ * then auto-installs its own copy there while a project that does declare it
10
+ * gets the catalog's, and those two resolutions give `@strands-agents/sdk` two
11
+ * peer-suffixed instances of the same version.
12
+ *
13
+ * Anything importing both projects then sees two nominal identities of every SDK
14
+ * type — `Agent`, `McpClient`, `Plugin` — and fails to compile with "Types have
15
+ * separate declarations of a private property". Declaring it keeps the version
16
+ * on the catalog, collapsing both to one instance.
17
+ */
18
+ export default function migration(tree: Tree): Promise<void>;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { joinPathFragments } from "@nx/devkit";
5
+ import { AGENT_CONNECTION_PROJECT_DIR } from "../../../utils/agent-connection/agent-connection.js";
6
+ import { addDependenciesToPackageJson } from "../../../utils/dependencies.js";
7
+ import { formatFilesInSubtree } from "../../../utils/format.js";
8
+ import { TS_VERSIONS } from "../../../utils/versions.js";
9
+ const CLIENT_S3 = '@aws-sdk/client-s3';
10
+ const STRANDS_SDK = '@strands-agents/sdk';
11
+ /**
12
+ * `@aws-sdk/client-s3` is an optional peer of `@strands-agents/sdk` that the
13
+ * shared agent-connection project never imports, so it went undeclared. pnpm
14
+ * then auto-installs its own copy there while a project that does declare it
15
+ * gets the catalog's, and those two resolutions give `@strands-agents/sdk` two
16
+ * peer-suffixed instances of the same version.
17
+ *
18
+ * Anything importing both projects then sees two nominal identities of every SDK
19
+ * type — `Agent`, `McpClient`, `Plugin` — and fails to compile with "Types have
20
+ * separate declarations of a private property". Declaring it keeps the version
21
+ * on the catalog, collapsing both to one instance.
22
+ */ export default async function migration(tree) {
23
+ const packageJsonPath = joinPathFragments(AGENT_CONNECTION_PROJECT_DIR, 'package.json');
24
+ if (!tree.exists(packageJsonPath)) {
25
+ return;
26
+ }
27
+ // Only where a strands client is actually present — that is what pulls the peer.
28
+ const packageJson = JSON.parse(tree.read(packageJsonPath, 'utf-8') ?? '{}');
29
+ if (!packageJson.dependencies?.[STRANDS_SDK]) {
30
+ return;
31
+ }
32
+ addDependenciesToPackageJson(tree, {
33
+ [CLIENT_S3]: TS_VERSIONS[CLIENT_S3]
34
+ }, {}, packageJsonPath);
35
+ await formatFilesInSubtree(tree);
36
+ }
37
+
38
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/agent-connection-pin-strands-peers/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { joinPathFragments, type Tree } from '@nx/devkit';\nimport { AGENT_CONNECTION_PROJECT_DIR } from '../../../utils/agent-connection/agent-connection.js';\nimport { addDependenciesToPackageJson } from '../../../utils/dependencies.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { TS_VERSIONS } from '../../../utils/versions.js';\n\nconst CLIENT_S3 = '@aws-sdk/client-s3';\nconst STRANDS_SDK = '@strands-agents/sdk';\n\n/**\n * `@aws-sdk/client-s3` is an optional peer of `@strands-agents/sdk` that the\n * shared agent-connection project never imports, so it went undeclared. pnpm\n * then auto-installs its own copy there while a project that does declare it\n * gets the catalog's, and those two resolutions give `@strands-agents/sdk` two\n * peer-suffixed instances of the same version.\n *\n * Anything importing both projects then sees two nominal identities of every SDK\n * type — `Agent`, `McpClient`, `Plugin` — and fails to compile with \"Types have\n * separate declarations of a private property\". Declaring it keeps the version\n * on the catalog, collapsing both to one instance.\n */\nexport default async function migration(tree: Tree): Promise<void> {\n const packageJsonPath = joinPathFragments(\n AGENT_CONNECTION_PROJECT_DIR,\n 'package.json',\n );\n if (!tree.exists(packageJsonPath)) {\n return;\n }\n\n // Only where a strands client is actually present — that is what pulls the peer.\n const packageJson = JSON.parse(tree.read(packageJsonPath, 'utf-8') ?? '{}');\n if (!packageJson.dependencies?.[STRANDS_SDK]) {\n return;\n }\n\n addDependenciesToPackageJson(\n tree,\n { [CLIENT_S3]: TS_VERSIONS[CLIENT_S3] },\n {},\n packageJsonPath,\n );\n\n await formatFilesInSubtree(tree);\n}\n"],"names":["joinPathFragments","AGENT_CONNECTION_PROJECT_DIR","addDependenciesToPackageJson","formatFilesInSubtree","TS_VERSIONS","CLIENT_S3","STRANDS_SDK","migration","tree","packageJsonPath","exists","packageJson","JSON","parse","read","dependencies"],"mappings":"AAAA;;;CAGC,GACD,SAASA,iBAAiB,QAAmB,aAAa;AAC1D,SAASC,4BAA4B,QAAQ,sDAAsD;AACnG,SAASC,4BAA4B,QAAQ,iCAAiC;AAC9E,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,WAAW,QAAQ,6BAA6B;AAEzD,MAAMC,YAAY;AAClB,MAAMC,cAAc;AAEpB;;;;;;;;;;;CAWC,GACD,eAAe,eAAeC,UAAUC,IAAU;IAChD,MAAMC,kBAAkBT,kBACtBC,8BACA;IAEF,IAAI,CAACO,KAAKE,MAAM,CAACD,kBAAkB;QACjC;IACF;IAEA,iFAAiF;IACjF,MAAME,cAAcC,KAAKC,KAAK,CAACL,KAAKM,IAAI,CAACL,iBAAiB,YAAY;IACtE,IAAI,CAACE,YAAYI,YAAY,EAAE,CAACT,YAAY,EAAE;QAC5C;IACF;IAEAJ,6BACEM,MACA;QAAE,CAACH,UAAU,EAAED,WAAW,CAACC,UAAU;IAAC,GACtC,CAAC,GACDI;IAGF,MAAMN,qBAAqBK;AAC7B"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "description": "Ignore the temporary files pnpm writes at the workspace root while materialising packages, which otherwise invalidate the Nx project graph"
3
+ }
@@ -0,0 +1,12 @@
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
+ /**
7
+ * pnpm creates `_tmp_<pid>_<hash>` files at the workspace root while it
8
+ * materialises packages. Left unignored, Nx's watcher invalidates the project
9
+ * graph on every install, so a watch-mode `dev` target running at the time
10
+ * rebuilds the graph continuously and never starts the command it wraps.
11
+ */
12
+ export default function migration(tree: Tree): Promise<void>;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { formatFilesInSubtree } from "../../../utils/format.js";
5
+ import { updateGitIgnore } from "../../../utils/git.js";
6
+ /** The temporary files pnpm writes while materialising packages. */ const TEMP_FILE_PATTERN = '_tmp_*';
7
+ /**
8
+ * pnpm creates `_tmp_<pid>_<hash>` files at the workspace root while it
9
+ * materialises packages. Left unignored, Nx's watcher invalidates the project
10
+ * graph on every install, so a watch-mode `dev` target running at the time
11
+ * rebuilds the graph continuously and never starts the command it wraps.
12
+ */ export default async function migration(tree) {
13
+ // Only pnpm writes these, so key off its lockfile rather than the workspace
14
+ // file — a workspace on another package manager may still carry one.
15
+ if (!tree.exists('pnpm-lock.yaml')) {
16
+ return;
17
+ }
18
+ updateGitIgnore(tree, '.', (patterns)=>patterns.includes(TEMP_FILE_PATTERN) ? patterns : [
19
+ ...patterns,
20
+ TEMP_FILE_PATTERN
21
+ ]);
22
+ await formatFilesInSubtree(tree);
23
+ }
24
+
25
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/ignore-package-manager-temp-files/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { Tree } from '@nx/devkit';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { updateGitIgnore } from '../../../utils/git.js';\n\n/** The temporary files pnpm writes while materialising packages. */\nconst TEMP_FILE_PATTERN = '_tmp_*';\n\n/**\n * pnpm creates `_tmp_<pid>_<hash>` files at the workspace root while it\n * materialises packages. Left unignored, Nx's watcher invalidates the project\n * graph on every install, so a watch-mode `dev` target running at the time\n * rebuilds the graph continuously and never starts the command it wraps.\n */\nexport default async function migration(tree: Tree): Promise<void> {\n // Only pnpm writes these, so key off its lockfile rather than the workspace\n // file — a workspace on another package manager may still carry one.\n if (!tree.exists('pnpm-lock.yaml')) {\n return;\n }\n\n updateGitIgnore(tree, '.', (patterns) =>\n patterns.includes(TEMP_FILE_PATTERN)\n ? patterns\n : [...patterns, TEMP_FILE_PATTERN],\n );\n\n await formatFilesInSubtree(tree);\n}\n"],"names":["formatFilesInSubtree","updateGitIgnore","TEMP_FILE_PATTERN","migration","tree","exists","patterns","includes"],"mappings":"AAAA;;;CAGC,GAED,SAASA,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,eAAe,QAAQ,wBAAwB;AAExD,kEAAkE,GAClE,MAAMC,oBAAoB;AAE1B;;;;;CAKC,GACD,eAAe,eAAeC,UAAUC,IAAU;IAChD,4EAA4E;IAC5E,qEAAqE;IACrE,IAAI,CAACA,KAAKC,MAAM,CAAC,mBAAmB;QAClC;IACF;IAEAJ,gBAAgBG,MAAM,KAAK,CAACE,WAC1BA,SAASC,QAAQ,CAACL,qBACdI,WACA;eAAIA;YAAUJ;SAAkB;IAGtC,MAAMF,qBAAqBI;AAC7B"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "description": "Exclude the transient bundle rolldown writes while loading a TypeScript config from Biome and from git, so a concurrent format or lint target cannot fail on 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,80 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { getProjects, joinPathFragments, updateJson } from "@nx/devkit";
5
+ import { BIOME_ROLLDOWN_CONFIG_BUNDLE_EXCLUDE, formatFilesInSubtree, ROLLDOWN_CONFIG_BUNDLE_GLOB } from "../../../utils/format.js";
6
+ import { updateGitIgnore } from "../../../utils/git.js";
7
+ /**
8
+ * Keep rolldown's transient config bundle out of Biome's and git's reach.
9
+ *
10
+ * Loading a `rolldown.config.ts` bundles it to `rolldown.config.<hash>.js` in the
11
+ * config's own directory, imports it, then unlinks it. The `bundle`, `format` and
12
+ * `lint` targets of a project all run concurrently, so a `format` sweeping the
13
+ * project mid-bundle sees a machine-generated file and reports it unformatted —
14
+ * failing the target for no fault of the source. Being git-visible, the file
15
+ * could also be committed, or picked up by `license#sync`, which builds its
16
+ * candidate set from git-visible files rather than from `biome.json`.
17
+ *
18
+ * Guardrails:
19
+ * - The Biome exclude is anchored to the excludes we vend. A workspace whose
20
+ * `files.includes` has diverged keeps its own list, and is reported via
21
+ * `nextSteps` instead.
22
+ * - Only projects carrying a `rolldown.config.ts` get the git ignore, matching
23
+ * where the generator writes it.
24
+ * - Idempotent: both edits are guarded on the pattern already being present.
25
+ */ /** The config filename whose loading produces the transient bundle. */ const ROLLDOWN_CONFIG = 'rolldown.config.ts';
26
+ /**
27
+ * Exclude the transient bundle from Biome. Anchored to `!**\/out-tsc`, the
28
+ * build-output exclude the vended list places these next to — without it the list
29
+ * has diverged from the one we vend, so leave it to the user.
30
+ */ const excludeFromBiome = (tree)=>{
31
+ if (!tree.exists('biome.json')) {
32
+ return [];
33
+ }
34
+ let unrecognised = false;
35
+ updateJson(tree, 'biome.json', (biome)=>{
36
+ const includes = biome?.files?.includes;
37
+ if (!Array.isArray(includes) || includes.includes(BIOME_ROLLDOWN_CONFIG_BUNDLE_EXCLUDE)) {
38
+ return biome;
39
+ }
40
+ if (!includes.includes('!**/out-tsc')) {
41
+ unrecognised = true;
42
+ return biome;
43
+ }
44
+ return {
45
+ ...biome,
46
+ files: {
47
+ ...biome.files,
48
+ includes: includes.flatMap((include)=>include === '!**/out-tsc' ? [
49
+ include,
50
+ BIOME_ROLLDOWN_CONFIG_BUNDLE_EXCLUDE
51
+ ] : [
52
+ include
53
+ ])
54
+ }
55
+ };
56
+ });
57
+ return unrecognised ? [
58
+ `\`biome.json\`: add \`"${BIOME_ROLLDOWN_CONFIG_BUNDLE_EXCLUDE}"\` to \`files.includes\` so the transient bundle rolldown writes while loading a TypeScript config is never formatted or linted. Its \`files.includes\` has diverged from the vended list, so it was left as it is.`
59
+ ] : [];
60
+ };
61
+ export default async function migration(tree) {
62
+ const nextSteps = [
63
+ ...excludeFromBiome(tree)
64
+ ];
65
+ for (const [, project] of getProjects(tree)){
66
+ if (!tree.exists(joinPathFragments(project.root, ROLLDOWN_CONFIG))) {
67
+ continue;
68
+ }
69
+ updateGitIgnore(tree, project.root, (patterns)=>patterns.includes(ROLLDOWN_CONFIG_BUNDLE_GLOB) ? patterns : [
70
+ ...patterns,
71
+ ROLLDOWN_CONFIG_BUNDLE_GLOB
72
+ ]);
73
+ }
74
+ await formatFilesInSubtree(tree);
75
+ return {
76
+ nextSteps
77
+ };
78
+ }
79
+
80
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/rolldown-config-bundle-transient/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 Tree,\n updateJson,\n} from '@nx/devkit';\nimport {\n BIOME_ROLLDOWN_CONFIG_BUNDLE_EXCLUDE,\n formatFilesInSubtree,\n ROLLDOWN_CONFIG_BUNDLE_GLOB,\n} from '../../../utils/format.js';\nimport { updateGitIgnore } from '../../../utils/git.js';\n\n/**\n * Keep rolldown's transient config bundle out of Biome's and git's reach.\n *\n * Loading a `rolldown.config.ts` bundles it to `rolldown.config.<hash>.js` in the\n * config's own directory, imports it, then unlinks it. The `bundle`, `format` and\n * `lint` targets of a project all run concurrently, so a `format` sweeping the\n * project mid-bundle sees a machine-generated file and reports it unformatted —\n * failing the target for no fault of the source. Being git-visible, the file\n * could also be committed, or picked up by `license#sync`, which builds its\n * candidate set from git-visible files rather than from `biome.json`.\n *\n * Guardrails:\n * - The Biome exclude is anchored to the excludes we vend. A workspace whose\n * `files.includes` has diverged keeps its own list, and is reported via\n * `nextSteps` instead.\n * - Only projects carrying a `rolldown.config.ts` get the git ignore, matching\n * where the generator writes it.\n * - Idempotent: both edits are guarded on the pattern already being present.\n */\n\n/** The config filename whose loading produces the transient bundle. */\nconst ROLLDOWN_CONFIG = 'rolldown.config.ts';\n\n/**\n * Exclude the transient bundle from Biome. Anchored to `!**\\/out-tsc`, the\n * build-output exclude the vended list places these next to — without it the list\n * has diverged from the one we vend, so leave it to the user.\n */\nconst excludeFromBiome = (tree: Tree): string[] => {\n if (!tree.exists('biome.json')) {\n return [];\n }\n let unrecognised = false;\n updateJson(tree, 'biome.json', (biome) => {\n const includes: unknown = biome?.files?.includes;\n if (\n !Array.isArray(includes) ||\n includes.includes(BIOME_ROLLDOWN_CONFIG_BUNDLE_EXCLUDE)\n ) {\n return biome;\n }\n if (!includes.includes('!**/out-tsc')) {\n unrecognised = true;\n return biome;\n }\n return {\n ...biome,\n files: {\n ...biome.files,\n includes: includes.flatMap((include) =>\n include === '!**/out-tsc'\n ? [include, BIOME_ROLLDOWN_CONFIG_BUNDLE_EXCLUDE]\n : [include],\n ),\n },\n };\n });\n return unrecognised\n ? [\n `\\`biome.json\\`: add \\`\"${BIOME_ROLLDOWN_CONFIG_BUNDLE_EXCLUDE}\"\\` to \\`files.includes\\` so the transient bundle rolldown writes while loading a TypeScript config is never formatted or linted. Its \\`files.includes\\` has diverged from the vended list, so it was left as it is.`,\n ]\n : [];\n};\n\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [...excludeFromBiome(tree)];\n\n for (const [, project] of getProjects(tree)) {\n if (!tree.exists(joinPathFragments(project.root, ROLLDOWN_CONFIG))) {\n continue;\n }\n updateGitIgnore(tree, project.root, (patterns) =>\n patterns.includes(ROLLDOWN_CONFIG_BUNDLE_GLOB)\n ? patterns\n : [...patterns, ROLLDOWN_CONFIG_BUNDLE_GLOB],\n );\n }\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","joinPathFragments","updateJson","BIOME_ROLLDOWN_CONFIG_BUNDLE_EXCLUDE","formatFilesInSubtree","ROLLDOWN_CONFIG_BUNDLE_GLOB","updateGitIgnore","ROLLDOWN_CONFIG","excludeFromBiome","tree","exists","unrecognised","biome","includes","files","Array","isArray","flatMap","include","migration","nextSteps","project","root","patterns"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EACXC,iBAAiB,EAGjBC,UAAU,QACL,aAAa;AACpB,SACEC,oCAAoC,EACpCC,oBAAoB,EACpBC,2BAA2B,QACtB,2BAA2B;AAClC,SAASC,eAAe,QAAQ,wBAAwB;AAExD;;;;;;;;;;;;;;;;;;CAkBC,GAED,qEAAqE,GACrE,MAAMC,kBAAkB;AAExB;;;;CAIC,GACD,MAAMC,mBAAmB,CAACC;IACxB,IAAI,CAACA,KAAKC,MAAM,CAAC,eAAe;QAC9B,OAAO,EAAE;IACX;IACA,IAAIC,eAAe;IACnBT,WAAWO,MAAM,cAAc,CAACG;QAC9B,MAAMC,WAAoBD,OAAOE,OAAOD;QACxC,IACE,CAACE,MAAMC,OAAO,CAACH,aACfA,SAASA,QAAQ,CAACV,uCAClB;YACA,OAAOS;QACT;QACA,IAAI,CAACC,SAASA,QAAQ,CAAC,gBAAgB;YACrCF,eAAe;YACf,OAAOC;QACT;QACA,OAAO;YACL,GAAGA,KAAK;YACRE,OAAO;gBACL,GAAGF,MAAME,KAAK;gBACdD,UAAUA,SAASI,OAAO,CAAC,CAACC,UAC1BA,YAAY,gBACR;wBAACA;wBAASf;qBAAqC,GAC/C;wBAACe;qBAAQ;YAEjB;QACF;IACF;IACA,OAAOP,eACH;QACE,CAAC,uBAAuB,EAAER,qCAAqC,oNAAoN,CAAC;KACrR,GACD,EAAE;AACR;AAEA,eAAe,eAAegB,UAC5BV,IAAU;IAEV,MAAMW,YAAsB;WAAIZ,iBAAiBC;KAAM;IAEvD,KAAK,MAAM,GAAGY,QAAQ,IAAIrB,YAAYS,MAAO;QAC3C,IAAI,CAACA,KAAKC,MAAM,CAACT,kBAAkBoB,QAAQC,IAAI,EAAEf,mBAAmB;YAClE;QACF;QACAD,gBAAgBG,MAAMY,QAAQC,IAAI,EAAE,CAACC,WACnCA,SAASV,QAAQ,CAACR,+BACdkB,WACA;mBAAIA;gBAAUlB;aAA4B;IAElD;IAEA,MAAMD,qBAAqBK;IAE3B,OAAO;QAAEW;IAAU;AACrB"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "description": "Move the shared shadcn package from a tsconfig paths alias to package.json imports/exports, matching the shadcn CLI's own monorepo resolution"
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,184 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { getProjects, joinPathFragments, readJson, updateJson } from "@nx/devkit";
5
+ import { REACT_WEBSITE_APP_GENERATOR_INFO } from "../../../ts/react-website/app/generator.js";
6
+ import { applyGritQL, matchGritQL } from "../../../utils/ast.js";
7
+ import { addDependenciesToPackageJson, getLocalDependencySpecifier } from "../../../utils/dependencies.js";
8
+ import { formatFilesInSubtree } from "../../../utils/format.js";
9
+ import { PACKAGES_DIR, SHARED_SHADCN_DIR } from "../../../utils/shared-constructs-constants.js";
10
+ import { getSharedShadcnFullyQualifiedName } from "../../../utils/shared-shadcn.js";
11
+ /**
12
+ * Move the shared shadcn package off a `tsconfig.base.json` `paths` alias onto
13
+ * `package.json` `imports`/`exports`.
14
+ *
15
+ * shadcn 4.x's CLI resolves `components.json`'s aliases via Node's package
16
+ * resolution (`imports`/`exports`), not tsconfig `paths` - its own resolver
17
+ * naively joins a tsconfig-declared alias against whichever directory it's
18
+ * invoked from, so the repo-root-relative `paths` mapping this plugin used to
19
+ * vend breaks the moment `shadcn add` is run with `-c packages/common/shadcn`
20
+ * (as its own monorepo-root preflight now tells the user to). This migration
21
+ * carries an existing workspace onto the shape today's generators produce:
22
+ * local `#...` imports for the package's own internal component references,
23
+ * a public `exports` map for every other consumer, and a real `workspace:*`
24
+ * dependency on each consumer so that map actually resolves.
25
+ *
26
+ * How to write a migration:
27
+ * - https://nx.dev/docs/kb/migration-generators
28
+ * - What `nextSteps` means: https://nx.dev/docs/reference/devkit/MigrationReturnObject
29
+ *
30
+ * Guardrails:
31
+ * - Only touches a `packages/common/shadcn` this plugin's generators produced
32
+ * (guarded by `components.json`'s aliases still matching the old shape).
33
+ * - Internal imports are rewritten by exact module specifier per file found
34
+ * under `src/{components/ui,lib,hooks}`, so a component a user added by hand
35
+ * after the original generation is covered too, and a specifier the
36
+ * migration doesn't recognise is left alone and reported.
37
+ * - Idempotent: every write is guarded by the old shape still being present.
38
+ */ const libraryRoot = joinPathFragments(PACKAGES_DIR, SHARED_SHADCN_DIR);
39
+ const componentsJsonPath = joinPathFragments(libraryRoot, 'components.json');
40
+ const packageJsonPath = joinPathFragments(libraryRoot, 'package.json');
41
+ const oldAliases = (fqn)=>({
42
+ components: `${fqn}/components`,
43
+ utils: `${fqn}/lib/utils`,
44
+ hooks: `${fqn}/hooks`,
45
+ lib: `${fqn}/lib`,
46
+ ui: `${fqn}/components/ui`
47
+ });
48
+ const newAliases = {
49
+ components: '#components',
50
+ utils: '#lib/utils',
51
+ hooks: '#hooks',
52
+ lib: '#lib',
53
+ ui: '#components/ui'
54
+ };
55
+ const newPackageManifestFields = {
56
+ imports: {
57
+ '#components/*': './src/components/*.tsx',
58
+ '#lib/*': './src/lib/*.ts',
59
+ '#hooks/*': './src/hooks/*.ts'
60
+ },
61
+ exports: {
62
+ '.': './src/index.ts',
63
+ './styles/*': './src/styles/*',
64
+ './components/*': './src/components/*.tsx',
65
+ './lib/*': './src/lib/*.ts',
66
+ './hooks/*': './src/hooks/*.ts'
67
+ }
68
+ };
69
+ /**
70
+ * Rewrite an import's module specifier, keeping its bindings - `$bindings`
71
+ * holds whatever the file imports, so a binding a user added survives.
72
+ */ const importPattern = (from, to)=>`\`import { $bindings } from '${from}'\` => \`import { $bindings } from '${to}'\``;
73
+ /** Whether the file still imports the old specifier under any other form. */ const hasRemainingImport = (from)=>`\`import $_ from '${from}'\``;
74
+ export default async function migration(tree) {
75
+ const nextSteps = [];
76
+ if (!tree.exists(componentsJsonPath) || !tree.exists(packageJsonPath)) {
77
+ return {
78
+ nextSteps
79
+ };
80
+ }
81
+ const fullyQualifiedName = getSharedShadcnFullyQualifiedName(tree);
82
+ const currentAliases = readJson(tree, componentsJsonPath).aliases ?? {};
83
+ const expectedOldAliases = oldAliases(fullyQualifiedName);
84
+ const onOldShape = Object.keys(newAliases).every((key)=>currentAliases[key] === expectedOldAliases[key]);
85
+ if (!onOldShape) {
86
+ if (Object.keys(newAliases).some((key)=>currentAliases[key] !== newAliases[key])) {
87
+ nextSteps.push(`${componentsJsonPath}: aliases have diverged from both the old and current generated shape - left untouched. Migrate them to the shadcn CLI's imports/exports monorepo pattern by hand: https://ui.shadcn.com/docs/monorepo`);
88
+ }
89
+ await formatFilesInSubtree(tree);
90
+ return {
91
+ nextSteps
92
+ };
93
+ }
94
+ // Rewrite every source file's internal references to this package's own
95
+ // components/lib/hooks, keyed off the files actually present so a
96
+ // hand-added component is covered too.
97
+ const internalDirs = [
98
+ {
99
+ dir: joinPathFragments(libraryRoot, 'src', 'components', 'ui'),
100
+ extension: '.tsx',
101
+ oldSubpath: 'components/ui',
102
+ newPrefix: '#components/ui'
103
+ },
104
+ {
105
+ dir: joinPathFragments(libraryRoot, 'src', 'lib'),
106
+ extension: '.ts',
107
+ oldSubpath: 'lib',
108
+ newPrefix: '#lib'
109
+ },
110
+ {
111
+ dir: joinPathFragments(libraryRoot, 'src', 'hooks'),
112
+ extension: '.ts',
113
+ oldSubpath: 'hooks',
114
+ newPrefix: '#hooks'
115
+ }
116
+ ];
117
+ const renames = [];
118
+ const sourceFiles = [];
119
+ for (const { dir, extension, oldSubpath, newPrefix } of internalDirs){
120
+ if (!tree.exists(dir)) {
121
+ continue;
122
+ }
123
+ for (const entry of tree.children(dir)){
124
+ if (!entry.endsWith(extension)) {
125
+ continue;
126
+ }
127
+ const baseName = entry.slice(0, -extension.length);
128
+ renames.push({
129
+ old: `${fullyQualifiedName}/${oldSubpath}/${baseName}`,
130
+ renamed: `${newPrefix}/${baseName}`
131
+ });
132
+ sourceFiles.push(joinPathFragments(dir, entry));
133
+ }
134
+ }
135
+ for (const sourceFile of sourceFiles){
136
+ for (const { old, renamed } of renames){
137
+ await applyGritQL(tree, sourceFile, importPattern(old, renamed));
138
+ // A namespace or default import of the same specifier is left as it
139
+ // is - reported rather than rewritten, so a diverged file is never
140
+ // clobbered.
141
+ if (await matchGritQL(tree, sourceFile, hasRemainingImport(old))) {
142
+ nextSteps.push(`${sourceFile}: still imports '${old}' in a form this migration does not rewrite - update it to '${renamed}' by hand.`);
143
+ }
144
+ }
145
+ }
146
+ updateJson(tree, componentsJsonPath, (json)=>({
147
+ ...json,
148
+ aliases: newAliases
149
+ }));
150
+ updateJson(tree, packageJsonPath, (json)=>({
151
+ ...json,
152
+ ...newPackageManifestFields
153
+ }));
154
+ updateJson(tree, 'tsconfig.base.json', (json)=>{
155
+ const paths = {
156
+ ...json.compilerOptions?.paths ?? {}
157
+ };
158
+ delete paths[`${fullyQualifiedName}/*`];
159
+ return {
160
+ ...json,
161
+ compilerOptions: {
162
+ ...json.compilerOptions,
163
+ paths
164
+ }
165
+ };
166
+ });
167
+ // Every website generated with ux=shadcn needs a real dependency on the
168
+ // shared package now that it resolves through `exports`, not `paths`.
169
+ for (const project of getProjects(tree).values()){
170
+ const metadata = project.metadata;
171
+ if (metadata?.generator !== REACT_WEBSITE_APP_GENERATOR_INFO.id || metadata.ux !== 'shadcn') {
172
+ continue;
173
+ }
174
+ addDependenciesToPackageJson(tree, {
175
+ [fullyQualifiedName]: getLocalDependencySpecifier(tree)
176
+ }, {}, joinPathFragments(project.root, 'package.json'));
177
+ }
178
+ await formatFilesInSubtree(tree);
179
+ return {
180
+ nextSteps
181
+ };
182
+ }
183
+
184
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/shadcn-package-imports-exports/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 readJson,\n type Tree,\n updateJson,\n} from '@nx/devkit';\nimport { REACT_WEBSITE_APP_GENERATOR_INFO } from '../../../ts/react-website/app/generator.js';\nimport { applyGritQL, matchGritQL } from '../../../utils/ast.js';\nimport {\n addDependenciesToPackageJson,\n getLocalDependencySpecifier,\n} from '../../../utils/dependencies.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport {\n PACKAGES_DIR,\n SHARED_SHADCN_DIR,\n} from '../../../utils/shared-constructs-constants.js';\nimport { getSharedShadcnFullyQualifiedName } from '../../../utils/shared-shadcn.js';\n\n/**\n * Move the shared shadcn package off a `tsconfig.base.json` `paths` alias onto\n * `package.json` `imports`/`exports`.\n *\n * shadcn 4.x's CLI resolves `components.json`'s aliases via Node's package\n * resolution (`imports`/`exports`), not tsconfig `paths` - its own resolver\n * naively joins a tsconfig-declared alias against whichever directory it's\n * invoked from, so the repo-root-relative `paths` mapping this plugin used to\n * vend breaks the moment `shadcn add` is run with `-c packages/common/shadcn`\n * (as its own monorepo-root preflight now tells the user to). This migration\n * carries an existing workspace onto the shape today's generators produce:\n * local `#...` imports for the package's own internal component references,\n * a public `exports` map for every other consumer, and a real `workspace:*`\n * dependency on each consumer so that map actually resolves.\n *\n * How to write a migration:\n * - https://nx.dev/docs/kb/migration-generators\n * - What `nextSteps` means: https://nx.dev/docs/reference/devkit/MigrationReturnObject\n *\n * Guardrails:\n * - Only touches a `packages/common/shadcn` this plugin's generators produced\n * (guarded by `components.json`'s aliases still matching the old shape).\n * - Internal imports are rewritten by exact module specifier per file found\n * under `src/{components/ui,lib,hooks}`, so a component a user added by hand\n * after the original generation is covered too, and a specifier the\n * migration doesn't recognise is left alone and reported.\n * - Idempotent: every write is guarded by the old shape still being present.\n */\n\nconst libraryRoot = joinPathFragments(PACKAGES_DIR, SHARED_SHADCN_DIR);\nconst componentsJsonPath = joinPathFragments(libraryRoot, 'components.json');\nconst packageJsonPath = joinPathFragments(libraryRoot, 'package.json');\n\ninterface ComponentsJsonAliases {\n readonly components?: string;\n readonly utils?: string;\n readonly hooks?: string;\n readonly lib?: string;\n readonly ui?: string;\n}\n\nconst oldAliases = (fqn: string): ComponentsJsonAliases => ({\n components: `${fqn}/components`,\n utils: `${fqn}/lib/utils`,\n hooks: `${fqn}/hooks`,\n lib: `${fqn}/lib`,\n ui: `${fqn}/components/ui`,\n});\n\nconst newAliases: Required<ComponentsJsonAliases> = {\n components: '#components',\n utils: '#lib/utils',\n hooks: '#hooks',\n lib: '#lib',\n ui: '#components/ui',\n};\n\nconst newPackageManifestFields = {\n imports: {\n '#components/*': './src/components/*.tsx',\n '#lib/*': './src/lib/*.ts',\n '#hooks/*': './src/hooks/*.ts',\n },\n exports: {\n '.': './src/index.ts',\n './styles/*': './src/styles/*',\n './components/*': './src/components/*.tsx',\n './lib/*': './src/lib/*.ts',\n './hooks/*': './src/hooks/*.ts',\n },\n};\n\n/**\n * Rewrite an import's module specifier, keeping its bindings - `$bindings`\n * holds whatever the file imports, so a binding a user added survives.\n */\nconst importPattern = (from: string, to: string): string =>\n `\\`import { $bindings } from '${from}'\\` => \\`import { $bindings } from '${to}'\\``;\n\n/** Whether the file still imports the old specifier under any other form. */\nconst hasRemainingImport = (from: string): string =>\n `\\`import $_ from '${from}'\\``;\n\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [];\n\n if (!tree.exists(componentsJsonPath) || !tree.exists(packageJsonPath)) {\n return { nextSteps };\n }\n\n const fullyQualifiedName = getSharedShadcnFullyQualifiedName(tree);\n const currentAliases =\n readJson<{ aliases?: ComponentsJsonAliases }>(tree, componentsJsonPath)\n .aliases ?? {};\n const expectedOldAliases = oldAliases(fullyQualifiedName);\n const onOldShape = (\n Object.keys(newAliases) as (keyof ComponentsJsonAliases)[]\n ).every((key) => currentAliases[key] === expectedOldAliases[key]);\n\n if (!onOldShape) {\n if (\n (Object.keys(newAliases) as (keyof ComponentsJsonAliases)[]).some(\n (key) => currentAliases[key] !== newAliases[key],\n )\n ) {\n nextSteps.push(\n `${componentsJsonPath}: aliases have diverged from both the old and current generated shape - left untouched. Migrate them to the shadcn CLI's imports/exports monorepo pattern by hand: https://ui.shadcn.com/docs/monorepo`,\n );\n }\n await formatFilesInSubtree(tree);\n return { nextSteps };\n }\n\n // Rewrite every source file's internal references to this package's own\n // components/lib/hooks, keyed off the files actually present so a\n // hand-added component is covered too.\n const internalDirs: Array<{\n dir: string;\n extension: string;\n oldSubpath: string;\n newPrefix: string;\n }> = [\n {\n dir: joinPathFragments(libraryRoot, 'src', 'components', 'ui'),\n extension: '.tsx',\n oldSubpath: 'components/ui',\n newPrefix: '#components/ui',\n },\n {\n dir: joinPathFragments(libraryRoot, 'src', 'lib'),\n extension: '.ts',\n oldSubpath: 'lib',\n newPrefix: '#lib',\n },\n {\n dir: joinPathFragments(libraryRoot, 'src', 'hooks'),\n extension: '.ts',\n oldSubpath: 'hooks',\n newPrefix: '#hooks',\n },\n ];\n\n const renames: Array<{ old: string; renamed: string }> = [];\n const sourceFiles: string[] = [];\n for (const { dir, extension, oldSubpath, newPrefix } of internalDirs) {\n if (!tree.exists(dir)) {\n continue;\n }\n for (const entry of tree.children(dir)) {\n if (!entry.endsWith(extension)) {\n continue;\n }\n const baseName = entry.slice(0, -extension.length);\n renames.push({\n old: `${fullyQualifiedName}/${oldSubpath}/${baseName}`,\n renamed: `${newPrefix}/${baseName}`,\n });\n sourceFiles.push(joinPathFragments(dir, entry));\n }\n }\n\n for (const sourceFile of sourceFiles) {\n for (const { old, renamed } of renames) {\n await applyGritQL(tree, sourceFile, importPattern(old, renamed));\n // A namespace or default import of the same specifier is left as it\n // is - reported rather than rewritten, so a diverged file is never\n // clobbered.\n if (await matchGritQL(tree, sourceFile, hasRemainingImport(old))) {\n nextSteps.push(\n `${sourceFile}: still imports '${old}' in a form this migration does not rewrite - update it to '${renamed}' by hand.`,\n );\n }\n }\n }\n\n updateJson(tree, componentsJsonPath, (json) => ({\n ...json,\n aliases: newAliases,\n }));\n\n updateJson(tree, packageJsonPath, (json) => ({\n ...json,\n ...newPackageManifestFields,\n }));\n\n updateJson(tree, 'tsconfig.base.json', (json) => {\n const paths = { ...(json.compilerOptions?.paths ?? {}) };\n delete paths[`${fullyQualifiedName}/*`];\n return {\n ...json,\n compilerOptions: {\n ...json.compilerOptions,\n paths,\n },\n };\n });\n\n // Every website generated with ux=shadcn needs a real dependency on the\n // shared package now that it resolves through `exports`, not `paths`.\n for (const project of getProjects(tree).values()) {\n const metadata = project.metadata as\n | { generator?: string; ux?: string }\n | undefined;\n if (\n metadata?.generator !== REACT_WEBSITE_APP_GENERATOR_INFO.id ||\n metadata.ux !== 'shadcn'\n ) {\n continue;\n }\n addDependenciesToPackageJson(\n tree,\n { [fullyQualifiedName]: getLocalDependencySpecifier(tree) },\n {},\n joinPathFragments(project.root, 'package.json'),\n );\n }\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","joinPathFragments","readJson","updateJson","REACT_WEBSITE_APP_GENERATOR_INFO","applyGritQL","matchGritQL","addDependenciesToPackageJson","getLocalDependencySpecifier","formatFilesInSubtree","PACKAGES_DIR","SHARED_SHADCN_DIR","getSharedShadcnFullyQualifiedName","libraryRoot","componentsJsonPath","packageJsonPath","oldAliases","fqn","components","utils","hooks","lib","ui","newAliases","newPackageManifestFields","imports","exports","importPattern","from","to","hasRemainingImport","migration","tree","nextSteps","exists","fullyQualifiedName","currentAliases","aliases","expectedOldAliases","onOldShape","Object","keys","every","key","some","push","internalDirs","dir","extension","oldSubpath","newPrefix","renames","sourceFiles","entry","children","endsWith","baseName","slice","length","old","renamed","sourceFile","json","paths","compilerOptions","project","values","metadata","generator","id","ux","root"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EACXC,iBAAiB,EAEjBC,QAAQ,EAERC,UAAU,QACL,aAAa;AACpB,SAASC,gCAAgC,QAAQ,6CAA6C;AAC9F,SAASC,WAAW,EAAEC,WAAW,QAAQ,wBAAwB;AACjE,SACEC,4BAA4B,EAC5BC,2BAA2B,QACtB,iCAAiC;AACxC,SAASC,oBAAoB,QAAQ,2BAA2B;AA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kBgE,QAAQM,IAAI,EAAE;IAEpC;IAEA,MAAM9D,qBAAqBuB;IAE3B,OAAO;QAAEC;IAAU;AACrB"}
@@ -31,7 +31,10 @@ exports[`preset generator > should run successfully > .gemini/settings.json 1`]
31
31
  "
32
32
  `;
33
33
 
34
- exports[`preset generator > should run successfully > .gitignore 1`] = `".grit"`;
34
+ exports[`preset generator > should run successfully > .gitignore 1`] = `
35
+ ".grit
36
+ _tmp_*"
37
+ `;
35
38
 
36
39
  exports[`preset generator > should run successfully > .kiro/settings/mcp.json 1`] = `
37
40
  "{
@@ -299,6 +302,7 @@ exports[`preset generator > should run successfully > biome.json 1`] = `
299
302
  "!**/dist",
300
303
  "!**/out-tsc",
301
304
  "!**/test-output",
305
+ "!**/rolldown.config.*.*js",
302
306
  "!**/node_modules",
303
307
  "!**/.nx",
304
308
  "!**/.venv",
@@ -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';
@@ -50,6 +50,10 @@ export declare const DEPENDENCIES: import("../../../utils/declared-dependencies.
50
50
  readonly name: "@strands-agents/sdk";
51
51
  } & {
52
52
  versionOnly: true;
53
+ }, {
54
+ readonly name: "@aws-sdk/client-s3";
55
+ } & {
56
+ versionOnly: true;
53
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>>[]>;
54
58
  export declare const TS_AGENT_A2A_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
55
59
  export declare const tsAgentA2aConnectionGenerator: (tree: Tree, options: TsAgentA2aConnectionGeneratorSchema) => Promise<GeneratorCallback>;
@@ -41,6 +41,10 @@ export declare const DEPENDENCIES: import("../../../utils/declared-dependencies.
41
41
  readonly name: "@strands-agents/sdk";
42
42
  } & {
43
43
  versionOnly: true;
44
+ }, {
45
+ readonly name: "@aws-sdk/client-s3";
46
+ } & {
47
+ versionOnly: true;
44
48
  }], 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>>[]>;
45
49
  export declare const TS_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
46
50
  export declare const tsAgentGatewayConnectionGenerator: (tree: Tree, options: TsAgentGatewayConnectionGeneratorSchema) => Promise<GeneratorCallback>;
@@ -133,6 +133,10 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies.js"
133
133
  readonly name: "@strands-agents/sdk";
134
134
  } & {
135
135
  versionOnly: true;
136
+ }, {
137
+ readonly name: "@aws-sdk/client-s3";
138
+ } & {
139
+ versionOnly: true;
136
140
  }, {
137
141
  readonly name: "rolldown";
138
142
  } & {
@@ -41,6 +41,10 @@ export declare const DEPENDENCIES: import("../../../utils/declared-dependencies.
41
41
  readonly name: "@strands-agents/sdk";
42
42
  } & {
43
43
  versionOnly: true;
44
+ }, {
45
+ readonly name: "@aws-sdk/client-s3";
46
+ } & {
47
+ versionOnly: true;
44
48
  }], 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>>[]>;
45
49
  export declare const TS_AGENT_MCP_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
46
50
  export declare const tsAgentMcpConnectionGenerator: (tree: Tree, options: TsAgentMcpConnectionGeneratorSchema) => Promise<GeneratorCallback>;
@@ -9,7 +9,7 @@ import { declareDependencies, ownedElsewhere } from "../../../utils/declared-dep
9
9
  import { kebabCase } from "../../../utils/names.js";
10
10
  import { getNpmScopePrefix } from "../../../utils/npm-scope.js";
11
11
  import { registerPnpmBuiltDependencies } from "../../../utils/pnpm-workspace.js";
12
- import { SHADCN_DEPENDENCIES, sharedShadcnGenerator } from "../../../utils/shared-shadcn.js";
12
+ import { addSharedShadcnDependency, SHADCN_DEPENDENCIES, sharedShadcnGenerator } from "../../../utils/shared-shadcn.js";
13
13
  import { runtimeConfigGenerator } from "../runtime-config/generator.js";
14
14
  // Each entry names the theme or auth branch it belongs to, so the same
15
15
  // declaration drives both adding and the version sync.
@@ -90,6 +90,7 @@ export const DEPENDENCIES = declareDependencies()({
90
90
  // Shadcn theme imports from the shared shadcn library, so it must exist.
91
91
  if (theme === 'shadcn') {
92
92
  await sharedShadcnGenerator(tree, DEPENDENCIES);
93
+ addSharedShadcnDependency(tree, frontendProjectConfig.root);
93
94
  }
94
95
  generateFiles(tree, joinPathFragments(import.meta.dirname, 'files', theme), frontendProjectConfig.root, {
95
96
  scopeAlias