Build: upgrade to gulp 5 and Antora 3.1.15 - #1729
Draft
ammachado wants to merge 2 commits into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsis anasyncfunction that returned a stream. gulp settles an async task on its promise, and a stream is not a thenable, sobundle:packzipped a directory that had not been written yet.Finished 'build'ui-bundle.zipThis did not affect the published site:
antora-playbook-production.ymlconsumes the stagedantora-ui-camel/public/_directory, not the zip. It did affect anything using the--ui-bundle-urlthat 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-streamhad to go. vinyl-fs 4 is built onstreamx, andmerge-streamis a node-corePassThroughthat silently drops streamx sources. Reproduced standalone: 93 files in, 3 out. Replaced withordered-read-streams, the streamx-native merge from the same org as gulp. This is the only added dependency.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.font/*.{ttf,woff*(2)}glob.src/fonthas never existed in this repo's history; fonts are copied intodest/fontby thepostcssUrlhandler. vinyl-fs 3 ignored the missing directory, vinyl-fs 4 raises ENOENT.PostCSS 7 plugin API to PostCSS 8
cssnano@8returns 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@15keeps the:rootblock 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@mediacounts unchanged.Note for reviewers:
browserslist: last 2 versionsresolves to includeie 11,ie 10,ie_mobandop_mini all, none of which support CSS custom properties. Droppingpostcss-custom-propertiesentirely is therefore not an option; it would be both larger and broken on those targets.Root gulpfile to gulp 5
Replaced
delwith nativefs.rm(del 7+ is ESM only) and dropped the dependency. Fixedgenerate-markdownsignalling completion twice, by both callingdone()and returning a promise.Antora 3.1.15
Antora 3.1.9 added a heuristic that warns when an extension's
registerfunction names its first parameterregistry:@djencks/asciidoctor-jsonpathand@djencks/asciidoctor-antora-indexerboth do. Antora still registers them, the warning is advisory, but this playbook setsruntime.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 inextensions/, 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--desktopis, so the declaration was invalid at computed-value time andmax-widthalready resolved tonone. Removing it is a no-op and matches.static, which constrains width only inside the desktop media query.Verification
ui-bundle.zipat 697689 bytes / 124 files, and the CSS hash is reproducible across runsyarn build:antora: exit 0 with no output at all, 4569 HTML files, indexer output intact (camel-kafka-connector 218 pages, camel-kamelets 505)sitemap,htaccessandgenerate-markdown(4579 files) all pass under gulp 5Draft until apache/camel#25494 is merged.
🤖 Generated with Claude Code