feat(rust)!: drop createNodes v1 and migrate to Nx 22#88
Open
AgentEnder wants to merge 5 commits intoCammisuli:mainfrom
Open
feat(rust)!: drop createNodes v1 and migrate to Nx 22#88AgentEnder wants to merge 5 commits intoCammisuli:mainfrom
AgentEnder wants to merge 5 commits intoCammisuli:mainfrom
Conversation
Bump Nx and related packages from 20.0.1 to 22.6.5 via `nx migrate latest`. - Run release-config migrations (generator options → manifestRootsToUpdate, releaseTagPattern → releaseTag.pattern). - Apply project.json field ordering updates from the migrator. - Add .claude/worktrees and .claude/settings.local.json to .gitignore. - Remove stale workspace-level migrations.json left over from a prior run.
Nx 22 dropped the `CreateNodes` v1 API and the legacy `release.version.generator` field. Align the plugin with the new surface. Plugin graph: - Remove the `createNodes` v1 export and its imports; only `createNodesV2` is registered. - Point project-level release config at the new `versionActions` path. Release versioning: - Replace the `@monodon/rust:release-version` generator with a `VersionActions` implementation (`@monodon/rust/src/release/version-actions`) that reads/writes Cargo.toml per project. - Move `cargo update` + Cargo.lock reporting into the `afterAllProjectsVersioned` hook so Nx owns orchestration while the plugin only handles Cargo specifics. - Delete the old generator, its schema, spec, and test utils. Package: - Bump `@nx/devkit` dependency to `^22.0.0`. BREAKING CHANGE: `@monodon/rust` now requires Nx 22. Workspaces on Nx 19-21 should stay on the previous plugin version or run `nx migrate latest` first.
|
View your CI Pipeline Execution ↗ for commit a6cc15b
☁️ Nx Cloud last updated this comment at |
Port the per-method behavior that the deleted release-version generator spec exercised to the new VersionActions API. The Nx release engine now owns specifier resolution and git-tag lookups, so these tests target the Cargo-specific surface the plugin still owns: - Reading [package].version from Cargo.toml, including error paths. - Resolving dependency versions across [dependencies] and [dev-dependencies], in both string and object form. - Writing new versions back to Cargo.toml. - Preserving existing version prefixes (^ ~ =) and leaving implicit-prefix declarations prefix-less when dependents are updated. - afterAllProjectsVersioned no-op paths (dryRun and skipLockFileUpdate).
@napi-rs/cli v3 is ESM-only and ships a .d.ts with ESM syntax; under TS 5.9
with moduleResolution=node16 and a CJS build context, the published types
resolve to `any` and the dynamic `await import('@napi-rs/cli')` fails the
strict implicit-any check (TS7016). This was flaky locally and deterministic
on CI once the compilation cache was cold.
Add a minimal module shim covering the two methods the plugin actually uses
(NapiCli#build, NapiCli#createNpmDirs) so the import type-checks without
pulling in the upstream ESM declarations.
napi-build@2.3.1 (pulled in by the @napi-rs/cli v3 generator under e2e) now requires rustc 1.88, and unicode-segmentation@1.13.2 requires 1.85. The workspace was pinned at 1.80 both in rust-toolchain.toml and in the dtolnay/rust-toolchain@1.79.0 step of the CI setup action, so the rust-e2e napi test fails on fresh cargo resolutions. Bump both pins together so they stay in sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nx migrate latest, including the v21/v22 release-config migrations.createNodesv1 export from@monodon/rust; the plugin now registers onlycreateNodesV2, which Nx 22 requires.@monodon/rust:release-versiongenerator with aVersionActionsimplementation at@monodon/rust/src/release/version-actions, matching the new API Nx 22 introduced when it retiredrelease.version.generator. Cargo-specific read/write logic now lives in small per-manifest methods;cargo update+ Cargo.lock reporting moved to theafterAllProjectsVersionedhook.@nx/devkitdependency to^22.0.0.BREAKING CHANGE
@monodon/rustnow targets Nx 22. Workspaces on older Nx versions should stay on the previous plugin release (or migrate their workspace first).Test plan
nx run-many -t lint build testpasses across the workspace.nx build rustproduces a clean TypeScript build with the newrelease/output.nx release versionagainst a local rust workspace to validate the newversionActionsimplementation end-to-end (recommend a follow-up manual smoke test before cutting a release).