Skip to content

feat(rust)!: drop createNodes v1 and migrate to Nx 22#88

Open
AgentEnder wants to merge 5 commits intoCammisuli:mainfrom
AgentEnder:feat/drop-create-nodes-v1-migrate-nx
Open

feat(rust)!: drop createNodes v1 and migrate to Nx 22#88
AgentEnder wants to merge 5 commits intoCammisuli:mainfrom
AgentEnder:feat/drop-create-nodes-v1-migrate-nx

Conversation

@AgentEnder
Copy link
Copy Markdown
Contributor

Summary

  • Migrate the workspace from Nx 20.0.1 to Nx 22.6.5 via nx migrate latest, including the v21/v22 release-config migrations.
  • Drop the createNodes v1 export from @monodon/rust; the plugin now registers only createNodesV2, which Nx 22 requires.
  • Replace the @monodon/rust:release-version generator with a VersionActions implementation at @monodon/rust/src/release/version-actions, matching the new API Nx 22 introduced when it retired release.version.generator. Cargo-specific read/write logic now lives in small per-manifest methods; cargo update + Cargo.lock reporting moved to the afterAllProjectsVersioned hook.
  • Bump the plugin's @nx/devkit dependency to ^22.0.0.

BREAKING CHANGE

@monodon/rust now 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 test passes across the workspace.
  • nx build rust produces a clean TypeScript build with the new release/ output.
  • Exercise nx release version against a local rust workspace to validate the new versionActions implementation end-to-end (recommend a follow-up manual smoke test before cutting a release).

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.
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 23, 2026

View your CI Pipeline Execution ↗ for commit a6cc15b

Command Status Duration Result
nx run-many --target=e2e --exclude monodon --pa... ✅ Succeeded 1m 26s View ↗
nx run-many --target=build,test,lint --exclude ... ✅ Succeeded 18s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-23 03:50:34 UTC

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant