Skip to content

Commit 18a9ba5

Browse files
committed
build, doc: move to redesign
Signed-off-by: Aviv Keller <me@aviv.sh> PR-URL: #62045 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com>
1 parent 5c5bd22 commit 18a9ba5

10 files changed

Lines changed: 1393 additions & 779 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ updates:
5353
semver-minor-days: 5
5454
semver-patch-days: 5
5555
exclude:
56-
- '@node-core/doc-kit'
56+
- '@doc-kit/*'
57+
- '@node-core/*'
5758
commit-message:
5859
prefix: tools
5960
open-pull-requests-limit: 10

.github/workflows/build-tarball.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ env:
6767
PYTHON_VERSION: '3.14'
6868
FLAKY_TESTS: keep_retrying
6969
CLANG_VERSION: '19'
70+
NODE_VERSION: lts/*
7071

7172
permissions:
7273
contents: read
@@ -84,6 +85,10 @@ jobs:
8485
with:
8586
python-version: ${{ env.PYTHON_VERSION }}
8687
allow-prereleases: true
88+
- name: Use Node.js ${{ env.NODE_VERSION }}
89+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
90+
with:
91+
node-version: ${{ env.NODE_VERSION }}
8792
- name: Make tarball
8893
run: |
8994
export DISTTYPE=nightly

Makefile

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ ifeq ($(OSTYPE),os400)
389389
DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp
390390
endif
391391

392-
DOC_KIT ?= tools/doc/node_modules/@node-core/doc-kit/bin/cli.mjs
392+
DOC_KIT ?= tools/doc/node_modules/@doc-kit/cli/bin/cli.mjs
393393

394394
node_use_openssl_and_icu = $(call available-node,"-p" \
395395
"process.versions.openssl != undefined && process.versions.icu != undefined")
@@ -858,7 +858,7 @@ VERSION=v$(RAWVER)
858858

859859
.PHONY: doc-only
860860
.NOTPARALLEL: doc-only
861-
doc-only: $(apidoc_dirs) $(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json out/doc/llms.txt out/doc/apilinks.json ## Builds the docs with the local or the global Node.js binary.
861+
doc-only: $(apidoc_dirs) $(apidocs_html) $(apidocs_json) out/doc/api/all.json out/doc/llms.txt out/doc/apilinks.json ## Builds the docs with the local or the global Node.js binary.
862862

863863
.PHONY: doc
864864
doc: $(NODE_EXE) doc-only ## Build Node.js, and then build the documentation with the new binary.
@@ -895,15 +895,10 @@ $(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json &: $(a
895895
else \
896896
$(call available-node, \
897897
$(DOC_KIT) generate \
898-
-t legacy-html-all \
899-
-t legacy-json-all \
900-
-i doc/api/*.md \
901-
--ignore $(skip_apidoc_files) \
902-
-o out/doc/api \
903-
-c ./CHANGELOG.md \
898+
--log-level debug \
899+
--config-file tools/doc/web.doc-kit.config.mjs \
904900
-v $(VERSION) \
905-
--index doc/api/index.md \
906-
--type-map doc/type-map.json \
901+
$(if $(JOBS),-p $(JOBS)) \
907902
) \
908903
fi
909904
endif
@@ -914,13 +909,10 @@ out/doc/llms.txt: $(apidoc_sources) tools/doc/node_modules | out/doc
914909
else \
915910
$(call available-node, \
916911
$(DOC_KIT) generate \
912+
--config-file tools/doc/web.doc-kit.config.mjs \
917913
-t llms-txt \
918-
-i doc/api/*.md \
919-
--ignore $(skip_apidoc_files) \
920914
-o $(@D) \
921-
-c ./CHANGELOG.md \
922915
-v $(VERSION) \
923-
--type-map doc/type-map.json \
924916
) \
925917
fi
926918

@@ -930,12 +922,9 @@ out/doc/apilinks.json: $(wildcard lib/*.js) tools/doc/node_modules | out/doc
930922
else \
931923
$(call available-node, \
932924
$(DOC_KIT) generate \
933-
-t api-links \
934-
-i lib/*.js \
925+
--config-file tools/doc/api-links.doc-kit.config.mjs \
935926
-o $(@D) \
936-
-c ./CHANGELOG.md \
937927
-v $(VERSION) \
938-
--type-map doc/type-map.json \
939928
) \
940929
fi
941930

doc/node.1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.\"
2-
.\" This file was generated automatically by the @node-core/doc-kit tool.
2+
.\" This file was generated automatically by Node.js's doc-kit tool.
33
.\" Please do not edit this file manually. Make any updates to cli.md
44
.\" and regenerate the file afterward.
55
.\"
6-
.\" To regenerate this file, run `make doc/node.1`.
6+
.\" To regenerate this file, run `make node.1`.
77
.\"
88
.\"======================================================================
99
.Dd $Mdocdate$
@@ -236,7 +236,7 @@ Error: connect ERR_ACCESS_DENIED Access to this API has been restricted. Use --a
236236
.It Fl -allow-openssl-store
237237
When using the Permission Model, the process will not be able to use
238238
OpenSSL STORE loaders by default, for example to load a private key from a
239-
\fB<URL>\fR passed to \fBcrypto.createPrivateKey()\fR. Attempts to do so will throw
239+
\fB{URL}\fR passed to \fBcrypto.createPrivateKey()\fR. Attempts to do so will throw
240240
an \fBERR_ACCESS_DENIED\fR unless the user explicitly passes the
241241
\fB--allow-openssl-store\fR flag. This permission can be dropped at runtime via
242242
\fBpermission.drop()\fR.
@@ -408,11 +408,11 @@ creation behavior.
408408
The following options are currently supported:
409409
.Bl -bullet
410410
.It
411-
\fBbuilder\fR \fB<string>\fR Required. Provides the name to the script that is executed
412-
before building the snapshot, as if \fB--build-snapshot\fR had been passed
411+
\fBbuilder\fR \fB{string}\fR Required. Provides the name to the script that is executed
412+
before building the snapshot, as if \fB--build-snapshot\fR had been passed
413413
with \fBbuilder\fR as the main script name.
414414
.It
415-
\fBwithoutCodeCache\fR \fB<boolean>\fR Optional. Including the code cache reduces the
415+
\fBwithoutCodeCache\fR \fB{boolean}\fR Optional. Including the code cache reduces the
416416
time spent on compiling functions included in the snapshot at the expense
417417
of a bigger snapshot size and potentially breaking portability of the
418418
snapshot.

test/doctool/test-make-doc.mjs

Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { join } from 'node:path';
2+
import { pathToFileURL } from 'node:url';
3+
4+
const fromRoot = (path) =>
5+
pathToFileURL(join(import.meta.dirname, '..', '..', path)).href;
6+
7+
export default {
8+
extends: '@node-core/doc-kit/config',
9+
10+
target: ['api-links'],
11+
12+
global: {
13+
input: ['lib/*.js'],
14+
15+
changelog: fromRoot('CHANGELOG.md'),
16+
},
17+
};

0 commit comments

Comments
 (0)