Skip to content

Commit a13d19f

Browse files
committed
build, doc: move to redesign
Signed-off-by: Aviv Keller <me@aviv.sh>
1 parent 7aaf9b4 commit a13d19f

10 files changed

Lines changed: 1361 additions & 736 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@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
90+
with:
91+
node-version: ${{ env.NODE_VERSION }}
8792
- name: Make tarball
8893
run: |
8994
export DISTTYPE=nightly

Makefile

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

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

392392
node_use_openssl_and_icu = $(call available-node,"-p" \
393393
"process.versions.openssl != undefined && process.versions.icu != undefined")
@@ -856,7 +856,7 @@ VERSION=v$(RAWVER)
856856

857857
.PHONY: doc-only
858858
.NOTPARALLEL: doc-only
859-
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.
859+
doc-only: $(apidoc_dirs) $(apidocs_html) $(apidocs_json) out/doc/api/all.json out/doc/apilinks.json ## Builds the docs with the local or the global Node.js binary.
860860

861861
.PHONY: doc
862862
doc: $(NODE_EXE) doc-only ## Build Node.js, and then build the documentation with the new binary.
@@ -871,49 +871,16 @@ out/doc/api: doc/api
871871
mkdir -p $@
872872
cp -r doc/api out/doc
873873

874-
# Generate all doc files (individual and all.html/all.json) in a single doc-kit call
875-
# Using grouped targets (&:) so Make knows one command produces all outputs
876-
ifeq ($(OSTYPE),aix)
877-
# TODO(@nodejs/web-infra): AIX is currently hanging during HTML minification
878-
$(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json:
879-
@echo "Skipping $@ (not currently supported by $(OSTYPE) machines)"
880-
else ifeq ($(OSTYPE),os400)
881-
# TODO(@nodejs/web-infra): IBMi is currently hanging during HTML minification
882-
$(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json:
883-
@echo "Skipping $@ (not currently supported by $(OSTYPE) machines)"
884-
else
885-
$(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json &: $(apidoc_sources) tools/doc/node_modules | out/doc/api
874+
$(apidocs_html) $(apidocs_json) out/doc/api/all.json &: $(apidoc_sources) tools/doc/node_modules | out/doc/api
886875
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
887876
echo "Skipping $@ (no crypto and/or no ICU)"; \
888877
else \
889878
$(call available-node, \
890879
$(DOC_KIT) generate \
891-
-t legacy-html-all \
892-
-t legacy-json-all \
893-
-i doc/api/*.md \
894-
--ignore $(skip_apidoc_files) \
895-
-o out/doc/api \
896-
-c ./CHANGELOG.md \
897-
-v $(VERSION) \
898-
--index doc/api/index.md \
899-
--type-map doc/type-map.json \
900-
) \
901-
fi
902-
endif
903-
904-
out/doc/llms.txt: $(apidoc_sources) tools/doc/node_modules | out/doc
905-
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
906-
echo "Skipping $@ (no crypto and/or no ICU)"; \
907-
else \
908-
$(call available-node, \
909-
$(DOC_KIT) generate \
910-
-t llms-txt \
911-
-i doc/api/*.md \
912-
--ignore $(skip_apidoc_files) \
913-
-o $(@D) \
914-
-c ./CHANGELOG.md \
880+
--log-level debug \
881+
--config-file tools/doc/web.doc-kit.config.mjs \
915882
-v $(VERSION) \
916-
--type-map doc/type-map.json \
883+
$(if $(JOBS),-p $(JOBS)) \
917884
) \
918885
fi
919886

@@ -923,12 +890,9 @@ out/doc/apilinks.json: $(wildcard lib/*.js) tools/doc/node_modules | out/doc
923890
else \
924891
$(call available-node, \
925892
$(DOC_KIT) generate \
926-
-t api-links \
927-
-i lib/*.js \
893+
--config-file tools/doc/api-links.doc-kit.config.mjs \
928894
-o $(@D) \
929-
-c ./CHANGELOG.md \
930895
-v $(VERSION) \
931-
--type-map doc/type-map.json \
932896
) \
933897
fi
934898

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$
@@ -225,7 +225,7 @@ Error: connect ERR_ACCESS_DENIED Access to this API has been restricted. Use --a
225225
.It Fl -allow-openssl-store
226226
When using the Permission Model, the process will not be able to use
227227
OpenSSL STORE loaders by default, for example to load a private key from a
228-
\fB<URL>\fR passed to \fBcrypto.createPrivateKey()\fR. Attempts to do so will throw
228+
\fB{URL}\fR passed to \fBcrypto.createPrivateKey()\fR. Attempts to do so will throw
229229
an \fBERR_ACCESS_DENIED\fR unless the user explicitly passes the
230230
\fB--allow-openssl-store\fR flag. This permission can be dropped at runtime via
231231
\fBpermission.drop()\fR.
@@ -344,11 +344,11 @@ creation behavior.
344344
The following options are currently supported:
345345
.Bl -bullet
346346
.It
347-
\fBbuilder\fR \fB<string>\fR Required. Provides the name to the script that is executed
348-
before building the snapshot, as if \fB--build-snapshot\fR had been passed
347+
\fBbuilder\fR \fB{string}\fR Required. Provides the name to the script that is executed
348+
before building the snapshot, as if \fB--build-snapshot\fR had been passed
349349
with \fBbuilder\fR as the main script name.
350350
.It
351-
\fBwithoutCodeCache\fR \fB<boolean>\fR Optional. Including the code cache reduces the
351+
\fBwithoutCodeCache\fR \fB{boolean}\fR Optional. Including the code cache reduces the
352352
time spent on compiling functions included in the snapshot at the expense
353353
of a bigger snapshot size and potentially breaking portability of the
354354
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)