@@ -412,7 +412,12 @@ ifeq ($(OSTYPE),os400)
412412DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS ) out/$(BUILDTYPE ) /node.exp
413413endif
414414
415- DOC_KIT ?= tools/doc/node_modules/@node-core/doc-kit/bin/cli.mjs
415+ DOC_KIT ?= tools/doc/node_modules/@doc-kit/cli/bin/cli.mjs
416+ ifeq ($(V ) ,1)
417+ DOC_KIT_LOG_LEVEL ?= debug
418+ else
419+ DOC_KIT_LOG_LEVEL ?= info
420+ endif
416421
417422node_use_openssl_and_icu = $(call available-node,"-p" \
418423 "process.versions.openssl != undefined && process.versions.icu != undefined")
@@ -904,69 +909,56 @@ out/doc/api: doc/api
904909 mkdir -p $@
905910 cp -r doc/api out/doc
906911
907- # Generate all doc files (individual and all.html/all.json) in a single doc-kit call
908- # Using grouped targets (&:) so Make knows one command produces all outputs
912+ # A single doc-kit call produces every file in apidoc_outputs. They depend on a
913+ # stamp file that the call touches, so Make runs it once rather than once per
914+ # file. (A grouped target, `&:`, would do the same but needs GNU Make 4.3, and
915+ # RHEL 8 ships 4.2.1.)
916+ apidoc_outputs = $(apidocs_html ) $(apidocs_json ) out/doc/api/all.html \
917+ out/doc/api/all.json out/doc/llms.txt
918+
909919ifeq ($(OSTYPE ) ,aix)
910920# TODO(@nodejs/web-infra): AIX is currently hanging during HTML minification
911- $(apidocs_html ) $( apidocs_json ) out/doc/api/all.html out/doc/api/all.json :
921+ $(apidoc_outputs ) :
912922 @echo " Skipping $@ (not currently supported by $( OSTYPE) machines)"
913923else ifeq ($(OSTYPE),os400)
914924# TODO(@nodejs/web-infra): IBMi is currently hanging during HTML minification
915- $(apidocs_html ) $( apidocs_json ) out/doc/api/all.html out/doc/api/all.json :
925+ $(apidoc_outputs ) :
916926 @echo " Skipping $@ (not currently supported by $( OSTYPE) machines)"
917927else ifeq ($(ARCHTYPE),riscv64)
918928# Many riscv64 environments (except qemu) fail on the wasm steps here
919929# https://github.com/nodejs/build/issues/4099#issuecomment-4038743335
920- $(apidocs_html ) $( apidocs_json ) out/doc/api/all.html out/doc/api/all.json :
930+ $(apidoc_outputs ) :
921931 @echo " Skipping $@ (not currently supported by $( DESTCPU) machines)"
922932else
923- $( apidocs_html ) $( apidocs_json ) out/doc/api/all.html out/doc/api/all.json & : $(apidoc_sources ) tools/doc/node_modules | out/doc/api
933+ out/doc/.docbuildstamp : $(apidoc_sources ) tools/doc/node_modules | out/doc/api
924934 @if [ " $( shell $( node_use_openssl_and_icu) ) " != " true" ]; then \
925935 echo " Skipping $@ (no crypto and/or no ICU)" ; \
926936 else \
927937 $(call available-node, \
928938 $(DOC_KIT ) generate \
929- -t legacy-html-all \
930- -t legacy-json-all \
931- -i doc/api/* .md \
939+ --log-level $(DOC_KIT_LOG_LEVEL ) \
940+ --config-file tools/doc/web.doc-kit.config.mjs \
932941 --ignore $(skip_apidoc_files ) \
933942 -o out/doc/api \
934- -c ./CHANGELOG.md \
935943 -v $(VERSION ) \
936- --index doc/api/index.md \
937- --type-map doc/type-map.json \
944+ $(if $(JOBS ) ,-p $(JOBS ) ) \
938945 ) \
939946 fi
940- endif
947+ @touch $@
941948
942- out/doc/llms.txt : $(apidoc_sources ) tools/doc/node_modules | out/doc
943- @if [ " $( shell $( node_use_openssl_and_icu) ) " != " true" ]; then \
944- echo " Skipping $@ (no crypto and/or no ICU)" ; \
945- else \
946- $(call available-node, \
947- $(DOC_KIT ) generate \
948- -t llms-txt \
949- -i doc/api/* .md \
950- --ignore $(skip_apidoc_files ) \
951- -o $(@D ) \
952- -c ./CHANGELOG.md \
953- -v $(VERSION ) \
954- --type-map doc/type-map.json \
955- ) \
956- fi
949+ $(apidoc_outputs ) : out/doc/.docbuildstamp
950+ endif
957951
958952out/doc/apilinks.json : $(wildcard lib/* .js) tools/doc/node_modules | out/doc
959953 @if [ " $( shell $( node_use_openssl_and_icu) ) " != " true" ]; then \
960954 echo " Skipping $@ (no crypto and/or no ICU)" ; \
961955 else \
962956 $(call available-node, \
963957 $(DOC_KIT ) generate \
964- -t api-links \
965- -i lib/ * .js \
958+ --log-level $( DOC_KIT_LOG_LEVEL ) \
959+ --config-file tools/doc/api-links.doc-kit.config.mjs \
966960 -o $(@D ) \
967- -c ./CHANGELOG.md \
968961 -v $(VERSION ) \
969- --type-map doc/type-map.json \
970962 ) \
971963 fi
972964
@@ -980,6 +972,7 @@ node.1: doc/api/cli.md tools/doc/node_modules
980972 else \
981973 $(call available-node, \
982974 $(DOC_KIT ) generate \
975+ --log-level $(DOC_KIT_LOG_LEVEL ) \
983976 -v $(VERSION ) \
984977 --config-file tools/doc/man-page.doc-kit.config.mjs \
985978 -o doc \
@@ -1525,6 +1518,7 @@ tools/.manpagelintstamp: doc/node.1 doc/api/cli.md tools/doc/node_modules
15251518 $(RM ) -r tools/doc/.manpagecheck && \
15261519 $(call available-node, \
15271520 $(DOC_KIT ) generate \
1521+ --log-level $(DOC_KIT_LOG_LEVEL ) \
15281522 -v $(VERSION ) \
15291523 --config-file tools/doc/man-page.doc-kit.config.mjs \
15301524 ) \
0 commit comments