build, doc: generate node.1 with doc-kit#62044
build, doc: generate node.1 with doc-kit#62044avivkeller wants to merge 5 commits intonodejs:mainfrom
Conversation
|
Review requested:
|
I disagree, I think there's value in having tests on this repo so we can confidently approve updates or even that PR. |
Noted. I'll move the tests into the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62044 +/- ##
==========================================
+ Coverage 89.58% 89.64% +0.06%
==========================================
Files 674 676 +2
Lines 205159 206240 +1081
Branches 39352 39510 +158
==========================================
+ Hits 183792 184894 +1102
+ Misses 13583 13465 -118
- Partials 7784 7881 +97
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR migrates the Node.js man page (node.1) generation to doc-kit and updates build/test/install paths accordingly, removing the previously checked-in doc/node.1 source.
Changes:
- Generate
out/doc/node.1viadoc-kit(make doc-only) and use it for packaging/install. - Update doctool tests to read the man page from
out/doc/node.1. - Remove
doc/node.1from the repository and adjust related references.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/install.py | Installs the man page from out/doc/node.1 instead of doc/node.1. |
| test/parallel/test-cli-node-options-docs.js | Removes man-page-based option/envvar cross-checking. |
| test/doctool/test-manpage-options.mjs | Updates manpage path to out/doc/node.1 and adds Windows skip. |
| test/doctool/test-manpage-envvars.mjs | Updates manpage path to out/doc/node.1 and adds Windows skip. |
| src/node_options.cc | Updates guidance comment to only mention doc/api/cli.md. |
| doc/node.1 | Deletes the checked-in man page file. |
| Makefile | Adds out/doc/node.1 generation rule and wires it into doc-only, install, and tarball creation. |
| BUILDING.md | Updates instructions to read the generated man page from out/doc/node.1. |
Comments suppressed due to low confidence (4)
test/doctool/test-manpage-options.mjs:9
commonis referenced but never imported/bound in this module.import '../common/index.mjs'only has side effects and does not define acommonidentifier, so this will throw aReferenceErrorbefore the test can skip on Windows. Import it as a namespace (e.g.,import * as common from '../common/index.mjs';) or otherwise ensurecommonis defined.
test/doctool/test-manpage-envvars.mjs:9commonis referenced but never imported/bound in this module.import '../common/index.mjs'does not create acommonidentifier, so this will throw aReferenceErrorbefore the test can skip on Windows. Import it as a namespace (e.g.,import * as common from '../common/index.mjs';).
test/doctool/test-manpage-options.mjs:58- The test now reads from
out/doc/node.1, but the failure message still refers todoc/node.1, which will be confusing when this fails. Update the message to referenceout/doc/node.1(or interpolate the actualmanPagePath).
test/doctool/test-manpage-envvars.mjs:26 - This test now reads the man page from
out/doc/node.1, but the assertion message still says it scanneddoc/node.1. Update the message to match the actual path (ideally by including the computedmanPagePath) so failures are actionable.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // XXX: If you add an option here, please also add it to doc/node.1 and | ||
| // doc/api/cli.md | ||
| // XXX: If you add an option here, please also add it to doc/api/cli.md | ||
| // TODO(addaleax): Make that unnecessary. |
There was a problem hiding this comment.
The TODO can be considered resolved IMO, we already have test/parallel/test-cli-node-options-docs.js that validates both are in sync, so node.1 was the only remaining thing IIUC
| // TODO(addaleax): Make that unnecessary. |
|
|
||
| ```bash | ||
| man doc/node.1 | ||
| man out/doc/node.1 |
There was a problem hiding this comment.
| man out/doc/node.1 | |
| make out/doc/node.1 | |
| man out/doc/node.1 |
| out/doc/node.1: tools/doc/node_modules | out/doc | ||
| @if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \ | ||
| echo "Skipping $@ (no crypto and/or no ICU)"; \ | ||
| else \ | ||
| $(call available-node, \ | ||
| $(DOC_KIT) generate \ | ||
| -t man-page \ | ||
| -i doc/api/cli.md \ | ||
| -o $(@D) \ | ||
| -c ./CHANGELOG.md \ | ||
| -v $(VERSION) \ | ||
| --type-map doc/type-map.json \ |
There was a problem hiding this comment.
We need to list the dependencies, otherwise make won't regenerate the man page. Why do we need to pass the CHANGELOG and the type-map? That seems out of place
| out/doc/node.1: tools/doc/node_modules | out/doc | |
| @if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \ | |
| echo "Skipping $@ (no crypto and/or no ICU)"; \ | |
| else \ | |
| $(call available-node, \ | |
| $(DOC_KIT) generate \ | |
| -t man-page \ | |
| -i doc/api/cli.md \ | |
| -o $(@D) \ | |
| -c ./CHANGELOG.md \ | |
| -v $(VERSION) \ | |
| --type-map doc/type-map.json \ | |
| out/doc/node.1: doc/api/cli.md CHANGELOG.md doc/type-map.json tools/doc/node_modules | out/doc | |
| @if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \ | |
| echo "Skipping $@ (no crypto and/or no ICU)"; \ | |
| else \ | |
| $(call available-node, \ | |
| $(DOC_KIT) generate \ | |
| -t man-page \ | |
| -i $< \ | |
| -o $(@D) \ | |
| -c ./CHANGELOG.md \ | |
| -v $(VERSION) \ | |
| --type-map doc/type-map.json \ |
There was a problem hiding this comment.
We don't need to pass them, I suppose
| cp out/doc/node.1 $(TARNAME)/doc/node.1 | ||
| cp -r out/doc/api/* $(TARNAME)/doc/api/ |
There was a problem hiding this comment.
Could we simply copy the whole out/doc?
| cp out/doc/node.1 $(TARNAME)/doc/node.1 | |
| cp -r out/doc/api/* $(TARNAME)/doc/api/ | |
| cp -r out/doc $(TARNAME) |
There was a problem hiding this comment.
I was thinking that, however, out/doc also contains apilinks.json, which we don't want to copy
We recently moved node to build with
doc-kit, the new tooling for documentation.doc-kitalso provides aman-pagegenerator, which PR changes core to use.The tests for this generator are here, and as such, do not need to exist in this repository.cc @nodejs/web-infra