@versu/plugin-node
v1.0.4
Published
Versu Node.js Plugin
Downloads
475
Maintainers
Readme

@versu/plugin-node - Node.js Adapter Plugin
Node.js adapter plugin for Versu. Provides support for detecting and updating versions in Node.js projects, including npm, yarn and pnpm workspace monorepos.
Installation
npm install @versu/core @versu/plugin-nodeUsage
Once installed, the plugin is discovered automatically from node_modules (or list it explicitly in the plugins array of your versu.config.js):
import { VersuRunner } from '@versu/core';
const runner = new VersuRunner({
repoRoot: '/path/to/repository',
adapter: 'node', // Optional - auto-detected
// ...other options as needed
});
const result = await runner.run();Auto-Detection
The plugin automatically activates when package.json is present in the repository root.
Workspace Support
Workspace members are discovered from:
- the
workspacesfield of the rootpackage.json(npm / yarn, array or{ packages: [] }form), or pnpm-workspace.yaml(packagesglobs) when the rootpackage.jsondeclares no workspaces.
Projects without workspaces are handled as a single root module.
Dependencies between workspace packages (dependencies, devDependencies, peerDependencies, optionalDependencies) are used to build the dependency cascade: bumping a package also affects the packages that depend on it.
Notes
- Module IDs follow Gradle-style notation (e.g.,
:for root,:packages:core). - The plugin updates:
- the
versionfield of a module'spackage.jsonwhen the module declares a version. - internal dependency ranges pointing at renumbered workspace packages, preserving the range operator and the
workspace:protocol (e.g.^1.2.3→^2.0.0,workspace:~1.2.3→workspace:~2.0.0).
- the
- Specs without a concrete version are left untouched:
*,workspace:*,workspace:^,workspace:~,file:,link:, git/url specs and compound ranges.
📄 License
MIT License - see LICENSE for details.
