v4.0.4
Summary
Release meta
Released on: 2026-07-15
Released by: ggrossetie
Published by: GitHub
Logs: full diff
Changelog
Improvements
- Declare the instance form ("style 3") of the
Registryextension registration methods in the TypeScript typings. The runtime has always accepted an already-constructed processor (registry.includeProcessor(new MyIncludeProcessor())) in addition to the class and registration-function forms, but the 4.0 typings only declared the latter two, forcing consumers such as the VS Code AsciiDoc extension to augment the module by hand.preprocessor,treeProcessor,postprocessor,includeProcessor,docinfoProcessor,block,blockMacroandinlineMacronow expose an overload accepting a processor instance (the syntax processor methods also accept the optional explicit name), and the compile-only type tests cover the instance form - Type the filter callback accepted by
AbstractBlock#findBy(and itsqueryalias) as(node: AbstractBlock) => boolean | stringinstead of the bareFunction, so the candidate node passed to the callback resolves as anAbstractBlockwithout casts — both in the two-argument form and in thefindBy(callback)shorthand - Type the reader received by preprocessor and include processor callbacks as
PreprocessorReaderinstead ofReader, and exportPreprocessorReaderfrom the package root.Preprocessor#process,IncludeProcessor#processand the matching DSLprocess(fn)callbacks actually receive aPreprocessorReaderat runtime, so its members (pushInclude,getIncludeDepth, …) now resolve without casts or manual module augmentation
Infrastructure
- Display the package version number in the generated TypeDoc API documentation (
includeVersionoption), so both the@asciidoctor/coreAPI docs and theasciidoctorCLI docs show which release they document (e.g.@asciidoctor/core - v4.0.3) - Publish a
major.minoralias of the TypeDoc API documentation on each stable release — e.g. releasing v4.0.4 (re)deploys the docs to both4.0.4/and4.0/on GitHub Pages, so the4.0URL always points to the documentation of the latest 4.0.x release - Simplify the release workflow: the intermediate "Bump version for release" workflow (
release-bump.yml) is gone — the Release workflow is now dispatched directly with the version to release and performs the whole chain (bump + tag, build, npm publish, GitHub release, docs) in a single run, frommainor from a maintenance branch (e.g.4.0.xorv4.0.x). The git commands (commit, tag, push) live in the workflow itself; the release scripts are reduced to three focused tools:tasks/version.js <version>(sets both package versions and keeps theasciidoctor→@asciidoctor/coredependency in sync),tasks/changelog.js release <version>(rolls the Unreleased section into a dated release section) /tasks/changelog.js notes <version>(prints the Markdown release notes of a version to stdout), andtasks/publish.js(publishes both packages to npmjs).tasks/release.js,scripts/publish.sh, thenpm run releasescript and theskip_publishinput are gone (use GitHub’s "Re-run failed jobs" to resume a partially failed release). The reusable build and native-image workflows accept arefinput so the release builds the tagged commit (with the bumped version) rather than the pre-bump branch head - Publishing a maintenance release no longer steals the npm
latestdist-tag: when the version being published is older than the currently publishedlatest(e.g. releasing 4.0.5 while 4.1.0 is out), the packages are published under alatest-<major>.<minor>dist-tag (e.g.latest-4.0, following thelatest-2convention already used for the 2.x line) instead