@hyperfrontend/workspace/executors/version-batchversion-batch
Versions every library a change between two refs makes due a release, in dependency order, and records the bumps in one commit. It stands down on the base branch itself, so a pre-push hook can run it on every branch.
{
"version:all": {
"executor": "@hyperfrontend/workspace:version-batch",
"options": { "base": "origin/main" }
}
}
| Option | What it does |
|---|---|
--base | The ref the change is measured from; defaults to origin/main. The batch fails when git cannot compare it with --head |
--head | The ref it is measured to; defaults to the head of the checkout |
--dryRun | Prints the libraries and bumps and writes nothing |
--releaseAs | Forces this bump on the libraries named with --libraries, for a change in the artifact rather than the code |
--libraries | The projects to version instead of the affected set; only with --releaseAs |
--maxCommitFallback | How many commits the flow reads at most; defaults to what the project's version target declares |
--scopeFiltering | Which commit scopes count for a project; defaults to the project's version target's |
--verbose | Prints each library's decision |
The commit subject names every bumped library. A failed run restores the working tree to what it was.
API Reference§
ƒ Functions
The branch names a base revision may be read as: the revision as written, without a
refs/heads/ or refs/remotes/ prefix, and the branch behind a remote-tracking name such as origin/main for each remote the repository knows.Parameters
Returns
string[ ]The branch names, each once
Example
The branch behind a remote-tracking base
baseBranches('origin/main', ['origin']) // ['origin/main', 'main']§functionversionBatchExecutor(
versionBatchExecutor( options: VersionBatchExecutorOptions, context: ExecutorContext): Promise< ExecutorResult>
Versions every library a change makes due a release and records the bumps in one commit.
This executor:
This executor:
- Detects affected libraries programmatically
- Runs versioning for each affected library
- Creates a single batch commit
Parameters
| Name | Type | Description |
|---|---|---|
§options | VersionBatchExecutorOptions | Executor options from schema |
§context | ExecutorContext | The workspace, the project and the target the task runs on |
Returns
Promise< ExecutorResult>Executor result with success status
Examples
A root project's `version-batch` target
{
"name": "workspace",
"root": ".",
"targets": {
"version-batch": {
"executor": "@hyperfrontend/workspace:version-batch",
"options": { "base": "origin/main" }
}
}
}
```
`npx hf run workspace:version-batch` versions every library the change since `origin/main` makes due a release and commits the bumps as `chore: update versions for lib-core, lib-utils`; on `main` itself it stands down.Forcing a bump the commits would not have made
npx hf run workspace:version-batch --releaseAs=patch --libraries=lib-core,lib-utils◈ Interfaces
Options of the version-batch executor.
The executor detects affected libraries, versions each one, and creates a single batch commit.
The executor detects affected libraries, versions each one, and creates a single batch commit.
Properties
§
Defaults to whatever the
scopeFiltering?:ScopeFilteringConfigCommit scope filtering applied when attributing commits to a project. Defaults to whatever the
version target declares, so the batch that writes versions attributes commits exactly as the single-project run and version-check do.§
maxCommitFallback?:numberUpper bound on the commit window the flow analyzes for bumps and changelogs.§
releaseAs?:"major" | "minor" | "patch"Force this bump on the libraries named by libraries, calculated from each one's published version, for a release whose change is in the package artifact rather than its code.§
libraries?:string[ ]Project names to version instead of the affected set. Required with releaseAs, and only meaningful with it.§
followUps?:unknownCalled after each bump and before the batch commit, each answering the files the commit must also carry. No configuration sets this; an executor that wraps this one passes it.Result of version-batch executor.