diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index bd72e7dd404794..b981554228d6c8 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -65,6 +65,7 @@ env: PYTHON_VERSION: '3.14' FLAKY_TESTS: keep_retrying CLANG_VERSION: '19' + NODE_VERSION: lts/* permissions: contents: read @@ -82,6 +83,12 @@ jobs: with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Environment Information + run: npx envinfo@7.21.0 - name: Make tarball run: | export DISTTYPE=nightly diff --git a/Makefile b/Makefile index 961682e607272c..efd4ade1b06653 100644 --- a/Makefile +++ b/Makefile @@ -856,7 +856,7 @@ VERSION=v$(RAWVER) .PHONY: doc-only .NOTPARALLEL: doc-only -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. +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. .PHONY: doc 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 mkdir -p $@ cp -r doc/api out/doc -# Generate all doc files (individual and all.html/all.json) in a single doc-kit call -# Using grouped targets (&:) so Make knows one command produces all outputs -ifeq ($(OSTYPE),aix) -# TODO(@nodejs/web-infra): AIX is currently hanging during HTML minification -$(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json: - @echo "Skipping $@ (not currently supported by $(OSTYPE) machines)" -else ifeq ($(OSTYPE),os400) -# TODO(@nodejs/web-infra): IBMi is currently hanging during HTML minification -$(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json: - @echo "Skipping $@ (not currently supported by $(OSTYPE) machines)" -else -$(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json &: $(apidoc_sources) tools/doc/node_modules | out/doc/api +$(apidocs_html) $(apidocs_json) out/doc/api/all.json &: $(apidoc_sources) tools/doc/node_modules | out/doc/api @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 legacy-html-all \ - -t legacy-json-all \ - -i doc/api/*.md \ - --ignore $(skip_apidoc_files) \ - -o out/doc/api \ - -c ./CHANGELOG.md \ + --log-level debug \ + --config-file tools/doc/web.doc-kit.config.mjs \ -v $(VERSION) \ - --index doc/api/index.md \ - --type-map doc/type-map.json \ - ) \ - fi -endif - -out/doc/llms.txt: $(apidoc_sources) 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 llms-txt \ - -i doc/api/*.md \ - --ignore $(skip_apidoc_files) \ - -o $(@D) \ - -c ./CHANGELOG.md \ - -v $(VERSION) \ - --type-map doc/type-map.json \ + $(if $(JOBS),-p $(JOBS)) \ ) \ fi diff --git a/test/doctool/test-make-doc.mjs b/test/doctool/test-make-doc.mjs deleted file mode 100644 index 59e681707dd473..00000000000000 --- a/test/doctool/test-make-doc.mjs +++ /dev/null @@ -1,74 +0,0 @@ -import * as common from '../common/index.mjs'; - -import assert from 'assert'; -import fs from 'fs'; -import path from 'path'; - -if (common.isWindows) { - common.skip('`make doc` does not run on Windows'); -} - -// This tests that `make doc` generates the documentation properly. -// Note that for this test to pass, `make doc` must be run first. - -const apiURL = new URL('../../out/doc/api/', import.meta.url); -const mdURL = new URL('../../doc/api/', import.meta.url); -const allMD = fs.readdirSync(mdURL); -const allDocs = fs.readdirSync(apiURL); -assert.ok(allDocs.includes('index.html')); - -const actualDocs = allDocs.filter( - (name) => { - const extension = path.extname(name); - return extension === '.html' || extension === '.json'; - }, -); - -for (const name of actualDocs) { - if (name.startsWith('all.') || name === 'apilinks.json') continue; - - assert.ok( - allMD.includes(name.replace(/\.\w+$/, '.md')), - `Unexpected output: out/doc/api/${name}, remove and rerun.`, - ); -} - -const toc = fs.readFileSync(new URL('./index.html', apiURL), 'utf8'); -const re = /href=("([^/]+\.html)"|([^/]+\.html))/; -const globalRe = new RegExp(re, 'g'); -const links = toc.match(globalRe); -assert.notStrictEqual(links, null); - -// Filter out duplicate links, leave just filenames, add expected JSON files. -const linkedHtmls = [...new Set(links)].map((link) => link.match(re)[1]) - .concat(['index.html']); -const expectedJsons = linkedHtmls - .map((name) => name.replace('.html', '.json')); -const expectedDocs = linkedHtmls.concat(expectedJsons); -const renamedDocs = ['policy.json', 'policy.html']; -const skipedDocs = ['dtls.json', 'dtls.html', 'quic.json', 'quic.html']; - -// Test that all the relative links in the TOC match to the actual documents. -for (const expectedDoc of expectedDocs) { - if (skipedDocs.includes(expectedDoc)) continue; - assert.ok(actualDocs.includes(expectedDoc), `${expectedDoc} does not exist`); -} - -// Test that all the actual documents match to the relative links in the TOC -// and that they are not empty files. -for (const actualDoc of actualDocs) { - // When renaming the documentation, the old url is lost - // Unless the old file is still available pointing to the correct location - // 301 redirects are not yet automated. So keeping the old URL is a - // reasonable workaround. - if (renamedDocs.includes(actualDoc) || skipedDocs.includes(actualDoc) || - actualDoc === 'apilinks.json') continue; - assert.ok( - expectedDocs.includes(actualDoc), `${actualDoc} does not match TOC`); - - assert.notStrictEqual( - fs.statSync(new URL(`./${actualDoc}`, apiURL)).size, - 0, - `${actualDoc} is empty`, - ); -} diff --git a/tools/doc/package-lock.json b/tools/doc/package-lock.json index 9b4595ee182d68..a63b70a7d3c3f3 100644 --- a/tools/doc/package-lock.json +++ b/tools/doc/package-lock.json @@ -10,9 +10,9 @@ } }, "node_modules/@actions/core": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-3.0.0.tgz", - "integrity": "sha512-zYt6cz+ivnTmiT/ksRVriMBOiuoUpDCJJlZ5KPl2/FRdvwU3f7MPh9qftvbkXJThragzUZieit2nyHUyw53Seg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-3.0.1.tgz", + "integrity": "sha512-a6d/Nwahm9fliVGRhdhofo40HjHQasUPusmc7vBfyky+7Z+P2A1J68zyFVaNcEclc/Se+eO595oAr5nwEIoIUA==", "license": "MIT", "dependencies": { "@actions/exec": "^3.0.0", @@ -29,9 +29,9 @@ } }, "node_modules/@actions/http-client": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-4.0.0.tgz", - "integrity": "sha512-QuwPsgVMsD6qaPD57GLZi9sqzAZCtiJT8kVBCDpLtxhL5MydQ4gS+DrejtZZPdIYyB1e95uCK9Luyds7ybHI3g==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-4.0.1.tgz", + "integrity": "sha512-+Nvd1ImaOZBSoPbsUtEhv+1z99H12xzncCkz0a3RuehINE81FZSe2QTj3uvAPTcJX/SCzUQHQ0D1GrPMbrPitg==", "license": "MIT", "dependencies": { "tunnel": "^0.0.6", @@ -264,6 +264,9 @@ "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -280,6 +283,9 @@ "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -296,6 +302,9 @@ "cpu": [ "ppc64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -312,6 +321,9 @@ "cpu": [ "riscv64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -328,6 +340,9 @@ "cpu": [ "s390x" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -344,6 +359,9 @@ "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -360,6 +378,9 @@ "cpu": [ "x64" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -519,30 +540,18 @@ "doc-kit": "bin/cli.mjs" } }, - "node_modules/@node-core/doc-kit/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/@node-core/rehype-shiki": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@node-core/rehype-shiki/-/rehype-shiki-1.4.1.tgz", - "integrity": "sha512-Ku63bR4wOq6MuZPRSNwj5NcVEU1zmQ+YtXRmwjIMm/Fdp8sZQVAhzyVJLjeYXDKTeYLRPYhtWu8jEu2+G9tumg==", - "dependencies": { - "@shikijs/core": "^3.22.0", - "@shikijs/engine-javascript": "^3.22.0", - "@shikijs/engine-oniguruma": "^3.22.0", - "@shikijs/twoslash": "^3.22.0", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@node-core/rehype-shiki/-/rehype-shiki-1.4.2.tgz", + "integrity": "sha512-H2T4bi9EZg0s0HLlcdANXzozrxeCfXzhZvbqUEygkggrv5pzJX9MVFU5K0/zGJfiqhzUu6TXMrNgpLqX1pylyw==", + "dependencies": { + "@shikijs/core": "^4.0.2", + "@shikijs/engine-javascript": "^4.0.2", + "@shikijs/engine-oniguruma": "^4.0.2", + "@shikijs/twoslash": "^4.0.2", "classnames": "~2.5.1", "hast-util-to-string": "^3.0.1", - "shiki": "~3.22.0", + "shiki": "~4.0.2", "typescript": "5.9.3", "unist-util-visit": "^5.1.0" }, @@ -551,80 +560,116 @@ } }, "node_modules/@node-core/rehype-shiki/node_modules/@shikijs/core": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.22.0.tgz", - "integrity": "sha512-iAlTtSDDbJiRpvgL5ugKEATDtHdUVkqgHDm/gbD2ZS9c88mx7G1zSYjjOxp5Qa0eaW0MAQosFRmJSk354PRoQA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.0.2.tgz", + "integrity": "sha512-hxT0YF4ExEqB8G/qFdtJvpmHXBYJ2lWW7qTHDarVkIudPFE6iCIrqdgWxGn5s+ppkGXI0aEGlibI0PAyzP3zlw==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.22.0", + "@shikijs/primitive": "4.0.2", + "@shikijs/types": "4.0.2", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" + }, + "engines": { + "node": ">=20" } }, "node_modules/@node-core/rehype-shiki/node_modules/@shikijs/engine-javascript": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-3.22.0.tgz", - "integrity": "sha512-jdKhfgW9CRtj3Tor0L7+yPwdG3CgP7W+ZEqSsojrMzCjD1e0IxIbwUMDDpYlVBlC08TACg4puwFGkZfLS+56Tw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.0.2.tgz", + "integrity": "sha512-7PW0Nm49DcoUIQEXlJhNNBHyoGMjalRETTCcjMqEaMoJRLljy1Bi/EGV3/qLBgLKQejdspiiYuHGQW6dX94Nag==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.22.0", + "@shikijs/types": "4.0.2", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.4" + }, + "engines": { + "node": ">=20" } }, "node_modules/@node-core/rehype-shiki/node_modules/@shikijs/engine-oniguruma": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.22.0.tgz", - "integrity": "sha512-DyXsOG0vGtNtl7ygvabHd7Mt5EY8gCNqR9Y7Lpbbd/PbJvgWrqaKzH1JW6H6qFkuUa8aCxoiYVv8/YfFljiQxA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.0.2.tgz", + "integrity": "sha512-UpCB9Y2sUKlS9z8juFSKz7ZtysmeXCgnRF0dlhXBkmQnek7lAToPte8DkxmEYGNTMii72zU/lyXiCB6StuZeJg==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.22.0", + "@shikijs/types": "4.0.2", "@shikijs/vscode-textmate": "^10.0.2" + }, + "engines": { + "node": ">=20" } }, "node_modules/@node-core/rehype-shiki/node_modules/@shikijs/langs": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.22.0.tgz", - "integrity": "sha512-x/42TfhWmp6H00T6uwVrdTJGKgNdFbrEdhaDwSR5fd5zhQ1Q46bHq9EO61SCEWJR0HY7z2HNDMaBZp8JRmKiIA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.0.2.tgz", + "integrity": "sha512-KaXby5dvoeuZzN0rYQiPMjFoUrz4hgwIE+D6Du9owcHcl6/g16/yT5BQxSW5cGt2MZBz6Hl0YuRqf12omRfUUg==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.22.0" + "@shikijs/types": "4.0.2" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@node-core/rehype-shiki/node_modules/@shikijs/primitive": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.0.2.tgz", + "integrity": "sha512-M6UMPrSa3fN5ayeJwFVl9qWofl273wtK1VG8ySDZ1mQBfhCpdd8nEx7nPZ/tk7k+TYcpqBZzj/AnwxT9lO+HJw==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.0.2", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" } }, "node_modules/@node-core/rehype-shiki/node_modules/@shikijs/themes": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.22.0.tgz", - "integrity": "sha512-o+tlOKqsr6FE4+mYJG08tfCFDS+3CG20HbldXeVoyP+cYSUxDhrFf3GPjE60U55iOkkjbpY2uC3It/eeja35/g==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.0.2.tgz", + "integrity": "sha512-mjCafwt8lJJaVSsQvNVrJumbnnj1RI8jbUKrPKgE6E3OvQKxnuRoBaYC51H4IGHePsGN/QtALglWBU7DoKDFnA==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.22.0" + "@shikijs/types": "4.0.2" + }, + "engines": { + "node": ">=20" } }, "node_modules/@node-core/rehype-shiki/node_modules/@shikijs/types": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.22.0.tgz", - "integrity": "sha512-491iAekgKDBFE67z70Ok5a8KBMsQ2IJwOWw3us/7ffQkIBCyOQfm/aNwVMBUriP02QshIfgHCBSIYAl3u2eWjg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.0.2.tgz", + "integrity": "sha512-qzbeRooUTPnLE+sHD/Z8DStmaDgnbbc/pMrU203950aRqjX/6AFHeDYT+j00y2lPdz0ywJKx7o/7qnqTivtlXg==", "license": "MIT", "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" } }, "node_modules/@node-core/rehype-shiki/node_modules/shiki": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-3.22.0.tgz", - "integrity": "sha512-LBnhsoYEe0Eou4e1VgJACes+O6S6QC0w71fCSp5Oya79inkwkm15gQ1UF6VtQ8j/taMDh79hAB49WUk8ALQW3g==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.0.2.tgz", + "integrity": "sha512-eAVKTMedR5ckPo4xne/PjYQYrU3qx78gtJZ+sHlXEg5IHhhoQhMfZVzetTYuaJS0L2Ef3AcCRzCHV8T0WI6nIQ==", "license": "MIT", "dependencies": { - "@shikijs/core": "3.22.0", - "@shikijs/engine-javascript": "3.22.0", - "@shikijs/engine-oniguruma": "3.22.0", - "@shikijs/langs": "3.22.0", - "@shikijs/themes": "3.22.0", - "@shikijs/types": "3.22.0", + "@shikijs/core": "4.0.2", + "@shikijs/engine-javascript": "4.0.2", + "@shikijs/engine-oniguruma": "4.0.2", + "@shikijs/langs": "4.0.2", + "@shikijs/themes": "4.0.2", + "@shikijs/types": "4.0.2", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" } }, "node_modules/@node-core/ui-components": { @@ -1796,115 +1841,67 @@ } }, "node_modules/@shikijs/core": { - "version": "3.23.0", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.23.0.tgz", - "integrity": "sha512-NSWQz0riNb67xthdm5br6lAkvpDJRTgB36fxlo37ZzM2yq0PQFFzbd8psqC2XMPgCzo1fW6cVi18+ArJ44wqgA==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.3.1.tgz", + "integrity": "sha512-ANMDxuaPsNMdDC1m4vfvhlDmJweMwkE5XitTwrq2rWHx5jM+dlm4MmHt2PP6t0uejfR77SuhrhJ0zEijIF/uhA==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.23.0", + "@shikijs/primitive": "4.3.1", + "@shikijs/types": "4.3.1", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" - } - }, - "node_modules/@shikijs/engine-javascript": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.3.0.tgz", - "integrity": "sha512-hTv/KiFf2tpiqlACPiztGGurEARWIutB8YUhcrA1pUC7VzzwKO+g5crUocrLztrZ5ro5Z4hbXg7bYclETn3gSQ==", - "license": "MIT", - "dependencies": { - "@shikijs/types": "4.3.0", - "@shikijs/vscode-textmate": "^10.0.2", - "oniguruma-to-es": "^4.3.6" }, "engines": { "node": ">=20" } }, - "node_modules/@shikijs/engine-javascript/node_modules/@shikijs/types": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.3.0.tgz", - "integrity": "sha512-oc8b9U2SYvofKZk8e/737nIX0qwf6eV2vHFATeObAu7r+mUVpLs8Re0BmVkIjAWAYgkmG/CzLNo7rzuBzRu/wQ==", + "node_modules/@shikijs/engine-javascript": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.3.1.tgz", + "integrity": "sha512-JBItcnPuYq7jVJdZo/vMj94r+szT7XEjHFX+mvFDGSEIbVAXAGyHAHzhbWzpGOwYidCZrErJLLgn2PVeiokHnQ==", "license": "MIT", "dependencies": { + "@shikijs/types": "4.3.1", "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4" + "oniguruma-to-es": "^4.3.6" }, "engines": { "node": ">=20" } }, "node_modules/@shikijs/engine-oniguruma": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.3.0.tgz", - "integrity": "sha512-1vMdN3gHfnKfLYwecUI2ITJI4RhHt96xEaJumVn7Heb0IlJ8WQMIH0Voak+2j22BpSNKdnOfB/pCTPnPm2gq7A==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.3.1.tgz", + "integrity": "sha512-OXyNMzg0pews+msMj4cHeqT4xiYKKvbnn6VbdAXxfoFl3SSx4fJTc8FadECuc5/H9p3BzhNAoAUXKwAu9rWYhg==", "license": "MIT", "dependencies": { - "@shikijs/types": "4.3.0", + "@shikijs/types": "4.3.1", "@shikijs/vscode-textmate": "^10.0.2" }, "engines": { "node": ">=20" } }, - "node_modules/@shikijs/engine-oniguruma/node_modules/@shikijs/types": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.3.0.tgz", - "integrity": "sha512-oc8b9U2SYvofKZk8e/737nIX0qwf6eV2vHFATeObAu7r+mUVpLs8Re0BmVkIjAWAYgkmG/CzLNo7rzuBzRu/wQ==", - "license": "MIT", - "dependencies": { - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4" - }, - "engines": { - "node": ">=20" - } - }, "node_modules/@shikijs/langs": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.3.0.tgz", - "integrity": "sha512-rnlqFbBRSys9bT4gl/5rw9RnS0W/I84ZldXPkO7cvlEMoV85TyF/aU01N7/NbSR776RNLjrJKjfFUXJR6wN1Cg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.3.1.tgz", + "integrity": "sha512-m0l9nsDqgBHvbZbk7A0/kXz/impK3uB/c6rAn6Gpg/uPtdZRQ+alsN/17MU5thb68XTj/4DxkZAotrM0GGSpDQ==", "license": "MIT", "dependencies": { - "@shikijs/types": "4.3.0" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@shikijs/langs/node_modules/@shikijs/types": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.3.0.tgz", - "integrity": "sha512-oc8b9U2SYvofKZk8e/737nIX0qwf6eV2vHFATeObAu7r+mUVpLs8Re0BmVkIjAWAYgkmG/CzLNo7rzuBzRu/wQ==", - "license": "MIT", - "dependencies": { - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4" + "@shikijs/types": "4.3.1" }, "engines": { "node": ">=20" } }, "node_modules/@shikijs/primitive": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.3.0.tgz", - "integrity": "sha512-CPkz64PTa5diRW1ggzMZH9VM/du4RNChYgVtgqrFcgruvIybmCvySv8GkiHSczUHXYuuR8TdKEwFx+UnZMpgdg==", - "license": "MIT", - "dependencies": { - "@shikijs/types": "4.3.0", - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@shikijs/primitive/node_modules/@shikijs/types": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.3.0.tgz", - "integrity": "sha512-oc8b9U2SYvofKZk8e/737nIX0qwf6eV2vHFATeObAu7r+mUVpLs8Re0BmVkIjAWAYgkmG/CzLNo7rzuBzRu/wQ==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.3.1.tgz", + "integrity": "sha512-CXQRQOYy1leqQ8ceTeJdmXv/bsUY++6QyLpXJ94LZAAYj5X2SKRdc5ipguv4NPyGVKItB2PPwUpRNe0Sjh5S1A==", "license": "MIT", "dependencies": { + "@shikijs/types": "4.3.1", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" }, @@ -1913,52 +1910,45 @@ } }, "node_modules/@shikijs/themes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.3.0.tgz", - "integrity": "sha512-Avgt05YiT+Y3prjIc9lmQxhJzHBcCfR6cjiFW4OyaMBbt2A6trX5rfjUzx+Vj/mE9qpArYjatnqo9XPjQNW/AQ==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.3.1.tgz", + "integrity": "sha512-dgpoJ4WqNi2yTmizQHBJ5zcX6j2lE6icN/0yt4l1kkf16jrY/pwPLoTb1ETsWMz0OBLf9ZNvwmxft+cH+N9qSA==", "license": "MIT", "dependencies": { - "@shikijs/types": "4.3.0" + "@shikijs/types": "4.3.1" }, "engines": { "node": ">=20" } }, - "node_modules/@shikijs/themes/node_modules/@shikijs/types": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.3.0.tgz", - "integrity": "sha512-oc8b9U2SYvofKZk8e/737nIX0qwf6eV2vHFATeObAu7r+mUVpLs8Re0BmVkIjAWAYgkmG/CzLNo7rzuBzRu/wQ==", + "node_modules/@shikijs/twoslash": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/twoslash/-/twoslash-4.3.1.tgz", + "integrity": "sha512-xK8inH/gK++1V4rTxrwCwjvaNwkkJ7oDjOIpdqONVxIpAFnVC3gzqjH5KiXGTelUcxpUJ3PtOKWct1YQ0kAloA==", "license": "MIT", "dependencies": { - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4" + "@shikijs/core": "4.3.1", + "@shikijs/types": "4.3.1", + "twoslash": "^0.3.9" }, "engines": { "node": ">=20" - } - }, - "node_modules/@shikijs/twoslash": { - "version": "3.23.0", - "resolved": "https://registry.npmjs.org/@shikijs/twoslash/-/twoslash-3.23.0.tgz", - "integrity": "sha512-pNaLJWMA3LU7PhT8tm9OQBZ1epy0jmdgeJzntBtr1EVXLbHxGzTj3mnf9vOdcl84l96qnlJXkJ/NGXZYBpXl5g==", - "license": "MIT", - "dependencies": { - "@shikijs/core": "3.23.0", - "@shikijs/types": "3.23.0", - "twoslash": "^0.3.6" }, "peerDependencies": { "typescript": ">=5.5.0" } }, "node_modules/@shikijs/types": { - "version": "3.23.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.23.0.tgz", - "integrity": "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.3.1.tgz", + "integrity": "sha512-CHFxE0jztBIZRHH6gxXE7DXUCFXjReEGxZ/j0rfSLGKZuwp2xBYycEP14875DSa9KLL/6700oxIq6oO6ef9K2g==", "license": "MIT", "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" } }, "node_modules/@shikijs/vscode-textmate": { @@ -1968,9 +1958,9 @@ "license": "MIT" }, "node_modules/@swc/html-wasm": { - "version": "1.15.40", - "resolved": "https://registry.npmjs.org/@swc/html-wasm/-/html-wasm-1.15.40.tgz", - "integrity": "sha512-WbRp7vSPK9bAGwpP1U8+RDE/xw1yj6P8ZYVqzA/64nlnFuB4MrW92EdkHiKvTPdlFDUZUno8yJKRKcRkE/UK6Q==", + "version": "1.15.43", + "resolved": "https://registry.npmjs.org/@swc/html-wasm/-/html-wasm-1.15.43.tgz", + "integrity": "sha512-tw1DpLmh54BDNPDBY/tHLDFcLnxzji242Fu/8Y8nrbSBdDndO0Lv56g869mRgrsmZBvsoS31JqgDkf6YYtvi3g==", "license": "Apache-2.0" }, "node_modules/@tybys/wasm-util": { @@ -1984,18 +1974,18 @@ } }, "node_modules/@types/debug": { - "version": "4.1.12", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", - "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", + "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", "license": "MIT", "dependencies": { "@types/ms": "*" } }, "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", "license": "MIT" }, "node_modules/@types/estree-jsx": { @@ -2060,9 +2050,9 @@ } }, "node_modules/@ungap/structured-clone": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", - "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.2.tgz", + "integrity": "sha512-5jsZFwgR5rTdKwidH9Qmat75RKwqfpKlWWB1frDkljN127mwqBu8K0PYo7/hFpF03IEJpfVPpCQDY/eDx3iHvA==", "license": "ISC" }, "node_modules/@vcarl/remark-headings": { @@ -2124,9 +2114,9 @@ } }, "node_modules/acorn": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", - "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -2497,6 +2487,18 @@ "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==", "license": "ISC" }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/hast-util-from-parse5": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.3.tgz", @@ -3966,9 +3968,9 @@ } }, "node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "license": "MIT", "engines": { "node": ">=12" @@ -3990,9 +3992,9 @@ } }, "node_modules/preact": { - "version": "10.29.3", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.29.3.tgz", - "integrity": "sha512-D9NL1GAnJZhc3RndVs4gDdxEeU9TcHgywMrhhOsnpdlvFjdbx0gAsLUnH6JEhlJH5giL7Tx5biWPUSEXE/HPzw==", + "version": "10.29.4", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.29.4.tgz", + "integrity": "sha512-GMpwh9+NJ8tSmqwIaVyFRQkiKfBEzQ+k7r7tle4W+kaJ+7wJiB9hFz9BixAomMtenPPSBfM4bZhXozGxhf0uFQ==", "license": "MIT", "funding": { "type": "opencollective", @@ -4018,9 +4020,9 @@ } }, "node_modules/property-information": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz", - "integrity": "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.2.0.tgz", + "integrity": "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==", "license": "MIT", "funding": { "type": "github", @@ -4393,9 +4395,9 @@ "peer": true }, "node_modules/semver": { - "version": "7.8.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz", - "integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==", + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -4405,46 +4407,17 @@ } }, "node_modules/shiki": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.3.0.tgz", - "integrity": "sha512-NKKjWzR6LIGL3sXBrWDw9sDS9cxx42/DkysaNqJEeOWE8Kix5gpak0bc00OfDVEO4oyXSyz8+aRaqKoBD1yo7A==", - "license": "MIT", - "dependencies": { - "@shikijs/core": "4.3.0", - "@shikijs/engine-javascript": "4.3.0", - "@shikijs/engine-oniguruma": "4.3.0", - "@shikijs/langs": "4.3.0", - "@shikijs/themes": "4.3.0", - "@shikijs/types": "4.3.0", - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/shiki/node_modules/@shikijs/core": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.3.0.tgz", - "integrity": "sha512-EooU3i9F6IAE8kEu+AnGf9DFZWkQBZ+hJn3tLVbsH+61mtQiva5biai66fAA6nvFPXkLgvrh7BrR7YcJU83xQQ==", - "license": "MIT", - "dependencies": { - "@shikijs/primitive": "4.3.0", - "@shikijs/types": "4.3.0", - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4", - "hast-util-to-html": "^9.0.5" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/shiki/node_modules/@shikijs/types": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.3.0.tgz", - "integrity": "sha512-oc8b9U2SYvofKZk8e/737nIX0qwf6eV2vHFATeObAu7r+mUVpLs8Re0BmVkIjAWAYgkmG/CzLNo7rzuBzRu/wQ==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.3.1.tgz", + "integrity": "sha512-oR+qDVi2OjX1tmDpyv+3KviX01KzO6Af+0NNnKnsp9491UEGz2YpxTuJboS/6VhYpTdqzmuJBuiTlrAWWJAssw==", "license": "MIT", "dependencies": { + "@shikijs/core": "4.3.1", + "@shikijs/engine-javascript": "4.3.1", + "@shikijs/engine-oniguruma": "4.3.1", + "@shikijs/langs": "4.3.1", + "@shikijs/themes": "4.3.1", + "@shikijs/types": "4.3.1", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" }, @@ -4567,22 +4540,22 @@ } }, "node_modules/twoslash": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/twoslash/-/twoslash-0.3.6.tgz", - "integrity": "sha512-VuI5OKl+MaUO9UIW3rXKoPgHI3X40ZgB/j12VY6h98Ae1mCBihjPvhOPeJWlxCYcmSbmeZt5ZKkK0dsVtp+6pA==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/twoslash/-/twoslash-0.3.9.tgz", + "integrity": "sha512-rDclk+OtzuTX+tnea7DYLCkqGQ3eP0IyfD+kzUJ7t46X/NzlaxwrhecmEBNuSCuEn3V+n1PhcjUUQQ7gUJzX5Q==", "license": "MIT", "dependencies": { - "@typescript/vfs": "^1.6.2", - "twoslash-protocol": "0.3.6" + "@typescript/vfs": "^1.6.4", + "twoslash-protocol": "0.3.9" }, "peerDependencies": { - "typescript": "^5.5.0" + "typescript": "^5.5.0 || ^6.0.0" } }, "node_modules/twoslash-protocol": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/twoslash-protocol/-/twoslash-protocol-0.3.6.tgz", - "integrity": "sha512-FHGsJ9Q+EsNr5bEbgG3hnbkvEBdW5STgPU824AHUjB4kw0Dn4p8tABT7Ncg1Ie6V0+mDg3Qpy41VafZXcQhWMA==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/twoslash-protocol/-/twoslash-protocol-0.3.9.tgz", + "integrity": "sha512-9/iwp+CXOnjFMPQuPL5PkuRbZnDoNpBvtJCLs9t8kDYkL3YHujbvnHfZA1i5fApDftVEdBw+T/4F+dH5kIzpYQ==", "license": "MIT" }, "node_modules/typescript": { diff --git a/tools/doc/web.doc-kit.config.mjs b/tools/doc/web.doc-kit.config.mjs new file mode 100644 index 00000000000000..7240b6690185c5 --- /dev/null +++ b/tools/doc/web.doc-kit.config.mjs @@ -0,0 +1,28 @@ +import { totalmem } from 'node:os'; +import { join } from 'node:path'; +import { pathToFileURL } from 'node:url'; + +const ALL_PAGE_MEMORY_THRESHOLD = 4 * 1024 ** 3; // 4 GiB + +const fromRoot = (path) => + pathToFileURL(join(import.meta.dirname, '..', '..', path)).href; + +export default { + 'target': ['web', 'legacy-json-all'], + + 'global': { + input: ['doc/api/*.md'], + ignore: ['doc/api/quic.md'], + output: 'out/doc/api', + + changelog: fromRoot('CHANGELOG.md'), + }, + + 'metadata': { + typeMap: fromRoot('doc/type-map.json'), + }, + + 'jsx-ast': { + generateAllPage: totalmem() > ALL_PAGE_MEMORY_THRESHOLD, + }, +}; diff --git a/vcbuild.bat b/vcbuild.bat index 28494815df1d64..bd556acbc438f6 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -703,8 +703,13 @@ robocopy /e doc\api %config%\doc\api %doc_kit_exe% ^ generate ^ - -t legacy-html-all legacy-json-all api-links ^ - -i doc/api/*.md ^ + --config-file "file://%~dp0tools\doc\web.doc-kit.config.mjs" ^ + -o %config%/doc/api/ ^ + -v %NODE_VERSION% + +%doc_kit_exe% ^ + generate ^ + -t api-links ^ -i lib/*.js ^ -o %config%/doc/api/ ^ -c file://%~dp0\CHANGELOG.md ^