ammachado opened a new pull request, #1729:
URL: https://github.com/apache/camel-website/pull/1729
## 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`:
```js
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
## Not verified
- **`build:minify`** was not exercised. It is gated on
`CAMEL_ENV=production`, so a normal build never runs it.
- **`build:hugo`** was run but failed on GitHub API rate limits with no
`GITHUB_TOKEN` set. Unrelated to these changes, but it means the full pipeline
has not been run end to end locally. Netlify and Jenkins have tokens, so CI
should cover it.
- The `clean` task was not run.
Draft until CI confirms the Hugo stage.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]