@wtf/semantic-release-validate
v4.0.4
Published
The plugin of semantic-release that validates the config of a run by a Standard Schema of your own, before it releases, by @wtf/release-validate; and the schema of its options and of its part of a config (./schema, schema.json).
Maintainers
Readme
@wtf/semantic-release-validate
The config of a run of semantic-release validated by a Standard Schema
of your own, before it releases. The semantic-release plugin, in verifyConditions, validates the
options of the config by its option schema, and fails the run with an error ECONFIG of each
issue, where it is, all at once. List it once for each schema, as of the rules of a house:
// release.config.mjs
export default {
branches: ['main'],
plugins: [
['@wtf/semantic-release-validate', { schema: './release/house-rules.mjs' }],
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator'
]
}schema is a Standard Schema, of Zod, Valibot, ArkType, or fromJsonSchema of
@wtf/release-validate/json-schema; or, as a JSON config writes
it, a module whose default export is one, by its path from the root of the repo or the name of a
package. A schema it cannot load, or that is none, fails the run with ESCHEMA.
The schema gets the config of the run as it was written, plugins too, so a rule may hold the
entries of plugins as well as the root, as trains, branches or tagFormat. configOf gives
it so, of the options semantic-release gives a plugin: without what the parser of its command line
leaves (_, $0, the options of one letter, as b, and the kebab-case twins, as dry-run) and
what it adds (originalRepositoryURL, whose URL repositoryUrl is again, as the config gave it,
and noCi of ci: false). The defaults semantic-release gives branches, repositoryUrl,
tagFormat and plugins stay, and dryRun, which a run outside of a CI sets: a schema that
allows no key but its own allows those too.
| Export | What it is |
| --------------------------------------- | ------------------------------------------------------------------------------------------- |
| @wtf/semantic-release-validate | The plugin: verifyConditions, loadSchema, and configOf |
| @wtf/semantic-release-validate/schema | The validators of its options, and of its part of a config; jsonSchema, its schema.json |
As a library
The plugin is a thin adapter over @wtf/release-validate, of no
release tool: validateConfig and configErrors of its ./validate.
Schema
@wtf/semantic-release-validate/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; ./schema has the same as
a validator, a Standard Schema, for code. Compose the schemas of the packages a repo installs in a
release.schema.json, by allOf: see Validating a config.
License
MIT
