-
feat(misc): convert prompt generator migrations to use prompt field (#35688)
发布于
2026-05-19 19:38:08 +00:00 Current Behavior
AI-instructions migrations in
@nx/next,@nx/expo,@nx/nuxt,
@nx/vite,@nx/vitest, and@nx/storybookare implemented as
generator wrappers whose only purpose is to copy a bundled.mdfile
into the workspace'stools/ai-migrations/directory.Expected Behavior
These migration entries declare a
promptfield pointing directly at
the.mdsource.nx migratecollects the prompt files into the
workspace and surfaces a review banner, replacing the per-package
generator wrappers. The@nx/storybookmigration becomes a hybrid
implementation + promptentry (the implementation still runssb upgrade).Implementation Details
@nx/next,@nx/expo,@nx/nuxt,@nx/vite(x2),@nx/vitest
(x2): 7 entries switched fromimplementation/factorytoprompt;
the 6 corresponding wrapper.tsfiles removed; the bundled.mdfiles
moved out of each migration'sfiles/subdirectory (a convention
required only by the deleted wrappers'__dirname/files/...reads).@nx/nuxt,@nx/vitest: added amigrations.spec.tsso their
migration entries are covered byassertValidMigrationPaths. Removed
stale orphans surfaced by the new nuxt spec:src/migrations/.gitkeep
andsrc/migrations/update-18-1-0/add-include-tsconfig.{ts,spec.ts}
(orphaned by an earlier pre-v19 migrations cleanup).@nx/storybook:update-22-1-0-migrate-storybook-v10becomes a
hybridimplementation + promptentry. Themigrate-10generator gains
askipAiInstructionsschema property; the migration wrapper passes
skipAiInstructions: trueto avoid duplicating the prompt write (the
framework now writes it to the managed
tools/ai-migrations/<scope>/<package>/<version>-<basename>.mdpath).
Standalonenx g @nx/storybook:migrate-10invocations are unaffected
and still write the legacytools/ai-migrations/MIGRATE_STORYBOOK_10.md
file.assertValidMigrationPaths(in
@nx/devkit/internal-testing-utils): updated to handleprompt-only
entries — per-entry validation asserts the referenced.mdexists, and
the "all folders" check collects known dirs from bothimpland
promptpaths.- Lint coverage parity:
@nx/nuxt,@nx/vite,@nx/vitesteslint
configs now include./migrations.jsonin the files block for
@nx/nx-plugin-checks, matching@nx/next/@nx/expo/
@nx/storybook.
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
下载附件