@wtf/semantic-release-npm
v2.0.4
Published
The plugin of semantic-release that publishes every npm package of a release train, as @semantic-release/npm does its one, by @wtf/release-npm: each manifest resolved as it publishes and packed in prepare, of the version of the release, and each published
Maintainers
Readme
@wtf/semantic-release-npm
Every npm package of a release train published, in the order of their dependencies, as the stock
@semantic-release/npm publishes its one, by @wtf/release-npm. It writes no file of the repo: the version of a release
is its tag's, and each package.json in git keeps a placeholder, as 0.0.0-development.
prepareresolves each manifest as it publishes, its version the release's, eachworkspace:range of the train the release's and of another train the last release of that train, by its tags, and packs each package from a copy in a temporary folder, and each private package ofpackbeside them, never published: a range that no release satisfies fails before the tag. Ofsmoke, it tries each package as a consumer installs it, before the tag.publishpublishes the tarballs, in order, each version the registry has skipped, under the dist-tag of the channel, or ofdistTag, with provenance when the CI gives an ID token. It records each package for the links of the GitLab release of the tag, which['@wtf/semantic-release-trains', { wrap: '@semantic-release/gitlab' }]makes: a package on npm's registry links to its page there, one of a package registry of GitLab, ofpublishConfig.registryorregistry, to its page on GitLab, and a package ofpack, never published, to its tarball, which atarballDirkeeps and the link uploads to the generic package registry of the project.addChannelmoves a release published already to the dist-tag of its new channel.failremoves whatpreparepacked, of a run that fails beforepublish.
The publisher is pluggable: npm by default, pnpm, a module of your own, or a Publisher. It
reads trains and ecosystems of the root of the config, and the train of the run of
RELEASE_TRAIN of its environment, or of train of the root, which wins: it publishes the packages
of npm, whichever ecosystems the root names, and the trains read those of each one it names, as
['@wtf/release-npm'].
// release.config.mjs
import { trainTagFormat } from '@wtf/semantic-release-trains/config'
const trains = { trains: { paths: ['packages/release-trains', 'packages/release-trains-*'] } }
const train = process.env.RELEASE_TRAIN
export default {
trains,
ecosystems: ['@wtf/release-npm'],
tagFormat: trainTagFormat(trains, train),
plugins: [
['@wtf/semantic-release-trains', { wrap: '@semantic-release/commit-analyzer' }],
['@wtf/semantic-release-trains', { wrap: '@semantic-release/release-notes-generator' }],
['@wtf/semantic-release-npm', { publisher: 'npm' }],
['@wtf/semantic-release-trains', { wrap: '@semantic-release/gitlab' }]
]
}A publish that fails after the tag leaves the release commit and the tag pushed: delete the tag, on
the remote and in the clone that runs again, and run the release again at the release commit, the tip of the branch, which skips
what the registry has (see Publishing). The
release of the host is @semantic-release/gitlab or
@semantic-release/github, after this plugin.
| Export | What it is |
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| @wtf/semantic-release-npm | The plugin: verifyConditions, verifyRelease, prepare, publish, addChannel, fail, and loadPublisher |
| @wtf/semantic-release-npm/schema | The validators of its options, and of its part of a config; jsonSchema, its schema.json |
| @wtf/semantic-release-npm/smoke | smokeTrains, every train of the config packed and tried as a consumer installs it; its bin |
Every option is JSON, so a config of literals writes each, as one a global install of
semantic-release reads: publisher, access, provenance, registry, first, last,
conditions, check, aside, tarballDir, pack, distTag and smoke. See
Publishing.
The smoke of a merge request
semantic-release-npm-smoke [--train <name>]...Every train of the config, or each named, packed at 0.0.0-smoke.0 of what the build wrote, of its
options of this plugin as the config gives them the run of its tag, each private package of its
pack beside its packages, and each package installed of the tarballs of all and imported, as
smoke does in prepare. It exits 1 of a fault. See
Smoke-test packages before the tag.
As a library
The plugin is a thin adapter over @wtf/release-npm, which knows no
release tool and no train: it maps each step of semantic-release onto a step of that ecosystem, of the
contract of @wtf/release, verifyRelease onto verify, once the version
is known, prepare onto prepare and smoke, publish onto publish, and addChannel onto
move; verifyConditions checks the packages as they are, of no version. What it says of a step
of the release, and each error of it, names the train, as [train core] …. What
is semantic-release's alone stays here: the plan of the train of the run, by planOf of
@wtf/release-trains/plan; the dist-tag of a channel, release-1.x of one npm takes for a range,
and the dist-tag of a major's line of a package of aside; and the record of what it published,
for the links. The plugin makes Node's platform of the folder and the environment of the run, by
runOf of @wtf/semantic-release, with nothing laid over it.
See Publishing.
Schema
@wtf/semantic-release-npm/schema.json is the JSON Schema of its part of a config of
semantic-release, the entries of plugins of the plugin, for an editor;
@wtf/semantic-release-npm/schema has the same as a validator, a Standard
Schema, for code, with the validator of the options the plugin is
given, as it checks them. Compose the schemas of the packages a repo installs in a
release.schema.json, by allOf: see Validating a config.
License
MIT
