From 7c4b2d9ccd1f4aaebe98e746cef702572e65268c Mon Sep 17 00:00:00 2001 From: avivkeller Date: Fri, 26 Jun 2026 14:52:29 -0400 Subject: [PATCH 1/6] build: allow linting node.1 Signed-off-by: avivkeller --- Makefile | 36 +++++++++++++++++++++++++++++++++++- doc/node.1 | 3 ++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 961682e607272c..1cf8e499e1e743 100644 --- a/Makefile +++ b/Makefile @@ -932,6 +932,19 @@ out/doc/apilinks.json: $(wildcard lib/*.js) tools/doc/node_modules | out/doc ) \ fi +doc/node.1: doc/api/cli.md tools/doc/node_modules + @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) \ + -v $(VERSION) \ + ) \ + fi + .PHONY: docopen docopen: doc-only ## Open the documentation in a web browser. @$(PYTHON) -mwebbrowser file://$(abspath $<) @@ -1480,8 +1493,29 @@ tools/.mdlintstamp: tools/lint-md/node_modules/remark-parse/package.json $(LINT_ @$(call available-node,$(run-lint-md)) @touch $@ +tools/.manpagelintstamp: doc/api/cli.md tools/doc/node_modules + $(info Verifying that doc/node.1 is up to date...) + @if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \ + echo "Skipping doc/node.1 verification (no crypto and/or no ICU)"; \ + else \ + $(RM) -r out/doc/.manpagecheck && \ + mkdir -p out/doc/.manpagecheck && \ + $(call available-node, \ + $(DOC_KIT) generate \ + -t man-page \ + -i doc/api/cli.md \ + -o out/doc/.manpagecheck \ + -v $(VERSION) \ + ) \ + if ! diff -u doc/node.1 out/doc/.manpagecheck/node.1; then \ + echo 'doc/node.1 is out of date; run `make doc/node.1` to regenerate it.'; \ + exit 1; \ + fi; \ + fi + @touch $@ + .PHONY: lint-md -lint-md: lint-js-doc | tools/.mdlintstamp ## Lint the markdown documents maintained by us in the codebase. +lint-md: lint-js-doc | tools/.mdlintstamp tools/.manpagelintstamp ## Lint the markdown documents maintained by us in the codebase. run-format-md = tools/lint-md/lint-md.mjs --format $(LINT_MD_FILES) .PHONY: format-md diff --git a/doc/node.1 b/doc/node.1 index 2801d2b3f130ba..9a9016f024026a 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -746,7 +746,8 @@ passing a second \fBparentURL\fR argument for contextual resolution. Previously gated the entire \fBimport.meta.resolve\fR feature. . .It Fl -experimental-import-text -Enable experimental support for importing modules with \fBwith { type: 'text' }\fR. +Enable experimental support for importing modules with +\fBwith { type: 'text' }\fR. . .It Fl -experimental-inspector-network-resource Enable experimental support for inspector network resources. From ddf0cbe901d2dbd4b83005542d7a5723a96f9f5c Mon Sep 17 00:00:00 2001 From: avivkeller Date: Wed, 1 Jul 2026 13:16:27 -0700 Subject: [PATCH 2/6] fixup! --- Makefile | 11 ++++------- tools/doc/man-page.doc-kit.config.mjs | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 tools/doc/man-page.doc-kit.config.mjs diff --git a/Makefile b/Makefile index 1cf8e499e1e743..963d0456fb0b62 100644 --- a/Makefile +++ b/Makefile @@ -932,16 +932,16 @@ out/doc/apilinks.json: $(wildcard lib/*.js) tools/doc/node_modules | out/doc ) \ fi +.PHONY: doc/node.1 doc/node.1: doc/api/cli.md tools/doc/node_modules @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) \ -v $(VERSION) \ + --config-file tools/doc/man-page.doc-kit.config.mjs \ + -o $(@D) \ ) \ fi @@ -1499,13 +1499,10 @@ tools/.manpagelintstamp: doc/api/cli.md tools/doc/node_modules echo "Skipping doc/node.1 verification (no crypto and/or no ICU)"; \ else \ $(RM) -r out/doc/.manpagecheck && \ - mkdir -p out/doc/.manpagecheck && \ $(call available-node, \ $(DOC_KIT) generate \ - -t man-page \ - -i doc/api/cli.md \ - -o out/doc/.manpagecheck \ -v $(VERSION) \ + --config-file tools/doc/man-page.doc-kit.config.mjs \ ) \ if ! diff -u doc/node.1 out/doc/.manpagecheck/node.1; then \ echo 'doc/node.1 is out of date; run `make doc/node.1` to regenerate it.'; \ diff --git a/tools/doc/man-page.doc-kit.config.mjs b/tools/doc/man-page.doc-kit.config.mjs new file mode 100644 index 00000000000000..f639b9dca0a0ec --- /dev/null +++ b/tools/doc/man-page.doc-kit.config.mjs @@ -0,0 +1,22 @@ +// @node-core/doc-kit configuration for generating and linting the Node.js +// man-page (doc/node.1). + +import { readFileSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; + +const root = new URL('../../', import.meta.url); + +const fromRoot = path => fileURLToPath(new URL(path, root)); + +export default { + target: ['man-page'], + + global: { + input: [fromRoot('doc/api/cli.md')], + output: fromRoot('out/doc/.manpagecheck'), + + // Point every loadable URL at its local file so no network request is made. + changelog: fromRoot('CHANGELOG.md'), + index: fromRoot('doc/api/index.md'), + }, +}; From 9bd07b3cae3d12aaaf01c644b96546553cdc4039 Mon Sep 17 00:00:00 2001 From: avivkeller Date: Wed, 1 Jul 2026 13:24:53 -0700 Subject: [PATCH 3/6] fixup! --- tools/doc/man-page.doc-kit.config.mjs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/doc/man-page.doc-kit.config.mjs b/tools/doc/man-page.doc-kit.config.mjs index f639b9dca0a0ec..a83f2ca911d34d 100644 --- a/tools/doc/man-page.doc-kit.config.mjs +++ b/tools/doc/man-page.doc-kit.config.mjs @@ -1,12 +1,11 @@ // @node-core/doc-kit configuration for generating and linting the Node.js // man-page (doc/node.1). -import { readFileSync } from 'node:fs'; import { fileURLToPath } from 'node:url'; const root = new URL('../../', import.meta.url); -const fromRoot = path => fileURLToPath(new URL(path, root)); +const fromRoot = (path) => fileURLToPath(new URL(path, root)); export default { target: ['man-page'], From 5c33cde2b5d3ccff474233a030313842b06b5548 Mon Sep 17 00:00:00 2001 From: avivkeller Date: Wed, 1 Jul 2026 14:26:10 -0700 Subject: [PATCH 4/6] fixup!\nCo-Authored-By: aduh95 --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 963d0456fb0b62..e1f8bb5155e6c1 100644 --- a/Makefile +++ b/Makefile @@ -932,8 +932,8 @@ out/doc/apilinks.json: $(wildcard lib/*.js) tools/doc/node_modules | out/doc ) \ fi -.PHONY: doc/node.1 -doc/node.1: doc/api/cli.md tools/doc/node_modules +.PHONY: node.1 +node.1: doc/api/cli.md tools/doc/node_modules @if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \ echo "Skipping $@ (no crypto and/or no ICU)"; \ else \ @@ -941,7 +941,7 @@ doc/node.1: doc/api/cli.md tools/doc/node_modules $(DOC_KIT) generate \ -v $(VERSION) \ --config-file tools/doc/man-page.doc-kit.config.mjs \ - -o $(@D) \ + -o doc \ ) \ fi @@ -1493,7 +1493,7 @@ tools/.mdlintstamp: tools/lint-md/node_modules/remark-parse/package.json $(LINT_ @$(call available-node,$(run-lint-md)) @touch $@ -tools/.manpagelintstamp: doc/api/cli.md tools/doc/node_modules +tools/.manpagelintstamp: doc/api/cli.md tools/doc/node_modules doc/node.1 $(info Verifying that doc/node.1 is up to date...) @if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \ echo "Skipping doc/node.1 verification (no crypto and/or no ICU)"; \ @@ -1505,7 +1505,7 @@ tools/.manpagelintstamp: doc/api/cli.md tools/doc/node_modules --config-file tools/doc/man-page.doc-kit.config.mjs \ ) \ if ! diff -u doc/node.1 out/doc/.manpagecheck/node.1; then \ - echo 'doc/node.1 is out of date; run `make doc/node.1` to regenerate it.'; \ + echo 'doc/node.1 is out of date; run `make node.1` to regenerate it.'; \ exit 1; \ fi; \ fi From 98c38c054e580b63fbd9486d0f36587cd37f269a Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Wed, 1 Jul 2026 14:46:07 -0700 Subject: [PATCH 5/6] Update Makefile Co-authored-by: Antoine du Hamel --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e1f8bb5155e6c1..8ffa58054a9018 100644 --- a/Makefile +++ b/Makefile @@ -1493,10 +1493,10 @@ tools/.mdlintstamp: tools/lint-md/node_modules/remark-parse/package.json $(LINT_ @$(call available-node,$(run-lint-md)) @touch $@ -tools/.manpagelintstamp: doc/api/cli.md tools/doc/node_modules doc/node.1 - $(info Verifying that doc/node.1 is up to date...) +tools/.manpagelintstamp: doc/node.1 doc/api/cli.md tools/doc/node_modules + $(info Verifying that $< is up to date...) @if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \ - echo "Skipping doc/node.1 verification (no crypto and/or no ICU)"; \ + echo "Skipping $< verification (no crypto and/or no ICU)"; \ else \ $(RM) -r out/doc/.manpagecheck && \ $(call available-node, \ @@ -1504,8 +1504,8 @@ tools/.manpagelintstamp: doc/api/cli.md tools/doc/node_modules doc/node.1 -v $(VERSION) \ --config-file tools/doc/man-page.doc-kit.config.mjs \ ) \ - if ! diff -u doc/node.1 out/doc/.manpagecheck/node.1; then \ - echo 'doc/node.1 is out of date; run `make node.1` to regenerate it.'; \ + if ! diff -u $< out/doc/.manpagecheck/node.1; then \ + echo '$< is out of date; run `make node.1` to regenerate it.' >&2; \ exit 1; \ fi; \ fi From 1048fbce61f84cb48088fb0488a2c323e829644d Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Wed, 1 Jul 2026 15:22:16 -0700 Subject: [PATCH 6/6] Update Makefile Co-authored-by: Antoine du Hamel --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 8ffa58054a9018..4b47a65d154370 100644 --- a/Makefile +++ b/Makefile @@ -932,6 +932,9 @@ out/doc/apilinks.json: $(wildcard lib/*.js) tools/doc/node_modules | out/doc ) \ fi +doc/node.1: + $(error Please use 'make node.1' instead of 'make $@'.) + .PHONY: node.1 node.1: doc/api/cli.md tools/doc/node_modules @if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \