Skip to content

Build: upgrade to gulp 5 and Antora 3.1.15 - #1729

Draft
ammachado wants to merge 2 commits into
apache:mainfrom
ammachado:build/gulp-5-and-antora-3.1.15
Draft

Build: upgrade to gulp 5 and Antora 3.1.15#1729
ammachado wants to merge 2 commits into
apache:mainfrom
ammachado:build/gulp-5-and-antora-3.1.15

Conversation

@ammachado

@ammachado ammachado commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What this does

Upgrades both gulp pipelines to gulp 5 and Antora to 3.1.15, and fixes a silent bug found along the way.

The UI bundle was being built empty

antora-ui-camel/gulp.d/tasks/build.js is an async function that returned a stream. gulp settles an async task on its promise, and a stream is not a thenable, so bundle:pack zipped a directory that had not been written yet.

Finished 'build' ui-bundle.zip
before 26 ms 22 bytes, 0 files
after 1.92 s 697689 bytes, 124 files

This did not affect the published site: antora-playbook-production.yml consumes the staged antora-ui-camel/public/_ directory, not the zip. It did affect anything using the --ui-bundle-url that the gulp task prints.

Theme to gulp 5

Moved to gulp 5, vinyl-fs 4, undertaker 2, through2 5 and fs-extra 11. Three things needed more than a version bump:

  • merge-stream had to go. vinyl-fs 4 is built on streamx, and merge-stream is a node-core PassThrough that silently drops streamx sources. Reproduced standalone: 93 files in, 3 out. Replaced with ordered-read-streams, the streamx-native merge from the same org as gulp. This is the only added dependency.
  • Binary assets need encoding: false, since gulp 5 decodes contents as UTF-8 by default. All 58 fonts and images were checked byte-for-byte against the gulp 4 output and are identical.
  • Removed the font/*.{ttf,woff*(2)} glob. src/font has never existed in this repo's history; fonts are copied into dest/font by the postcssUrl handler. vinyl-fs 3 ignored the missing directory, vinyl-fs 4 raises ENOENT.

PostCSS 7 plugin API to PostCSS 8

cssnano@8 returns a plugin object rather than a callable, and the bare (css, result) => ... plugins were PostCSS 7 style and were no longer being invoked at all. Rewritten as visitor plugins. 97 transitive packages pruned.

postcss-custom-properties@15 keeps the :root block after substitution where v9 removed it, so resolved custom properties are now dropped explicitly. Net result is 94 bytes smaller than the previous stack (11982 vs 12007 gzipped), with -webkit-, -moz-, -ms- and @media counts unchanged.

Note for reviewers: browserslist: last 2 versions resolves to include ie 11, ie 10, ie_mob and op_mini all, none of which support CSS custom properties. Dropping postcss-custom-properties entirely is therefore not an option; it would be both larger and broken on those targets.

Root gulpfile to gulp 5

Replaced del with native fs.rm (del 7+ is ESM only) and dropped the dependency. Fixed generate-markdown signalling completion twice, by both calling done() and returning a promise.

Antora 3.1.15

Antora 3.1.9 added a heuristic that warns when an extension's register function names its first parameter registry:

const ASCIIDOCTOR_REGISTER_FUNCTION_RX = /^(?:(?:function(?: +register)? *)?\( *registry *[,)])/

@djencks/asciidoctor-jsonpath and @djencks/asciidoctor-antora-indexer both do. Antora still registers them, the warning is advisory, but this playbook sets runtime.log.failure_level: warn, so the warning alone failed the build. Both packages were last published in 2022 and cannot be fixed upstream, so they are now required through thin wrappers in extensions/, matching the three local extensions already there.

Worth knowing if anyone pins differently: 3.1.11 skips these extensions entirely rather than warning. 3.1.12 through 3.1.15 restored warn-and-register.

Unrelated CSS fix

Removed max-width: var(--static-max-width) from .blog. That variable was never declared, only --static-max-width--desktop is, so the declaration was invalid at computed-value time and max-width already resolved to none. Removing it is a no-op and matches .static, which constrains width only inside the desktop media query.

Verification

  • Theme build: ui-bundle.zip at 697689 bytes / 124 files, and the CSS hash is reproducible across runs
  • All 58 binary assets byte-identical to the gulp 4 baseline
  • yarn build:antora: exit 0 with no output at all, 4569 HTML files, indexer output intact (camel-kafka-connector 218 pages, camel-kamelets 505)
  • sitemap, htaccess and generate-markdown (4579 files) all pass under gulp 5

Draft until apache/camel#25494 is merged.

🤖 Generated with Claude Code

ammachado and others added 2 commits August 13, 2026 10:36
Fixes a silent build bug and modernises both gulp pipelines.

The UI bundle was being produced empty (22 bytes, 0 files). The build task
in antora-ui-camel is an async function that returned a stream, and gulp
settles an async task on its promise; a stream is not a thenable, so
bundle:pack ran against a dest that had not been written yet. The pipeline
is now awaited explicitly. This only affected consumers of ui-bundle.zip,
since the production playbook reads the staged directory instead.

Theme moved to gulp 5, vinyl-fs 4, undertaker 2, through2 5 and fs-extra 11:

- vinyl-fs 4 is built on streamx, and merge-stream is a node-core
  PassThrough that silently drops files from streamx sources (93 files in,
  3 out). Replaced with ordered-read-streams, the streamx-native merge.
- gulp 5 decodes contents as UTF-8 by default, so binary sources now pass
  encoding: false. All 58 fonts and images verified byte-identical to the
  gulp 4 output.
- Removed the font glob in build.js. src/font has never existed; the fonts
  are copied into dest/font by the postcssUrl handler. vinyl-fs 3 ignored
  the missing directory, vinyl-fs 4 raises ENOENT.

PostCSS plugins updated to the PostCSS 8 API. cssnano 8 returns a plugin
object rather than a callable, and the bare (css, result) plugins were
PostCSS 7 style and were no longer being invoked. postcss-custom-properties
15 keeps the :root block after substitution, so resolved custom properties
are now dropped explicitly; the generated CSS is 94 bytes smaller than
before with prefixes and media queries unchanged.

Root gulpfile moved to gulp 5. Replaced del with fs.rm, as del 7+ is ESM
only, and fixed generate-markdown signalling completion twice by both
calling done() and returning a promise.

Antora 3.1.9 added a warning that fires when an extension's register
function names its first parameter 'registry'. Two of the @djencks
extensions do, and runtime.log.failure_level is set to warn, so the
advisory warning failed the build. Those packages were last published in
2022 and cannot be fixed upstream, so they are required via thin local
wrappers in extensions/. Antora now completes with no output at all.

Also removes max-width: var(--static-max-width) from .blog. The variable
was never declared, so the declaration was invalid at computed-value time
and max-width already resolved to none. This matches .static, which
constrains width only in the desktop media query.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The `checks` CI job runs `yarn check:dependencies`, which failed because
21 transitive packages could be deduped using the highest strategy. The
drift is unrelated to the gulp/Antora upgrade; the lockfile simply went
stale as newer versions of caniuse-lite, nanoid, end-of-stream, fastq,
fs-extra, postcss, streamx, resolve, readable-stream and svgo published.

Ran `yarn update:dedupe`. Both `check:cache` and `check:dedupe` now exit 0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant