@textmode/release
v0.2.1
Published
Shared release and Git-hook tooling for the textmode.js ecosystem (semantic-release, commitlint, lint-staged).
Downloads
500
Maintainers
Readme
@textmode/release
|
|
|
|
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
@textmode/release owns release automation and managed Git hooks for the textmode.js ecosystem. It bundles semantic-release, commitlint, and lint-staged behind one textmode-release command, so consumers no longer install or configure the engines themselves.
Use it to release every package the same way and install the same managed Git hooks without repeating dependencies or config files. Consumers compose whole-project workflows such as check, build, and prepack explicitly in their own package scripts.
Features
- One package, multiple engines - semantic-release and its plugins, commitlint, and lint-staged are implementation dependencies, not peer dependencies. Consumers install only
@textmode/release. - Managed Git hooks -
textmode-release hooksinstalls commitlint, lint-staged, and push-guard hooks directly into Git's hooks directory, invoking the engines from the package itself. - pnpm-safe staged formatting - The
pre-commithook formats staged files through an internalformat-stagedcommand, so it works withouttextmode-lintbeing exposed at the consumer root.
Installation
npm install -D @textmode/releaseNo engine dependencies are required.
Usage
Conventional projects delegate their release and hooks to the command:
{
"scripts": {
"prepare": "textmode-release hooks",
"release": "textmode-release release"
}
}hooksinstalls the managed Git hooks.releaseruns semantic-release with the shared release config.
Projects keep their domain scripts visible and compose them locally. A typical
library's check script runs formatting, linting, type checking, documentation,
tests, build, and declaration verification in the order required by that
repository. Its prepack script runs the local build and declaration
verification.
Commands
textmode-release release [args...]
textmode-release hooksEvery argument after release is forwarded to semantic-release, so
textmode-release release --dry-run works without special handling.
Every command accepts --cwd <directory>, --help, and --version. Exit
status 0 means success, 1 means an engine reported a problem, and 2 means
the invocation was invalid.
The managed pre-commit hook also invokes the internal format-staged command.
It is an implementation detail of the hook interface, not a project workflow.
Configuration
Release
textmode-release release runs semantic-release with the shared config, which:
- publishes stable releases on
mainand prereleases onbeta; - derives release types from Conventional Commits;
- updates package metadata, builds via the
buildscript, then publishes; - creates the GitHub release as a private draft by default and attaches
JavaScript bundle assets derived from the package
exports; - leaves publishing the drafted release to a maintainer in the GitHub UI.
Projects keep a build script that produces the publishable bundles (e.g.
textmode-build build).
GitHub release mode
The GitHub release is created as a private draft by default. A project that
wants the release published immediately opts out through a
textmodeRelease.githubRelease field in its own package.json:
{
"textmodeRelease": {
"githubRelease": "draft" // default; created as a private draft
}
}{
"textmodeRelease": {
"githubRelease": "direct" // published immediately
}
}The draft mode still uploads the bundle assets to the release, and drafts
created from the beta branch keep their prerelease flag when published.
Unknown values fall back to draft with a warning. The plugin's addChannel
step (promoting an already-released version to another channel) is unaffected
and publishes directly.
Git hooks
textmode-release hooks installs:
| Hook | Behavior |
| --- | --- |
| commit-msg | Validates the message with the shared commitlint config |
| pre-commit | Runs the shared lint-staged config (formats staged files with textmode-release format-staged) |
| pre-push | Blocks direct pushes to dev, beta, and main |
commitlint
The shared rules ship at @textmode/release/commitlint (a .cjs config file)
and extend @commitlint/config-conventional.
lint-staged
The shared config ships at @textmode/release/lint-staged (a .cjs config
file) and formats staged files through textmode-release format-staged, which
resolves the textmode-lint binary from this package's own dependency graph.
Related packages
@textmode/lint remains an implementation dependency because the managed
pre-commit hook formats staged files through it:
| Package | Relationship |
| ------------------------------------------------------------------- | -------------------------------------------------------- |
| @textmode/lint | Powers textmode-release format-staged for the lint-staged hook |
License
The @textmode/release package is licensed under the CC0 1.0 Universal.
Acknowledgements
- semantic-release
- The release engine behind
textmode-release release. - License: MIT.
- The release engine behind
- commitlint
- The commit message linter used by the
commit-msghook. - License: MIT.
- The commit message linter used by the
- lint-staged
- The staged-file runner used by the
pre-commithook. - License: MIT.
- The staged-file runner used by the
