tools: update doctool dependencies, migrate to ESM

- Migrated to ESM because some dependencies now require it.
- Did not update `highlight.js` to v11 because it has many breaking
  changes.
- Used non-deprecated `highlight.js` API.

Refs: https://github.com/highlightjs/highlight.js/issues/2277
Fixes: https://github.com/nodejs/node/issues/38938
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/38966
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Michaël Zasso 2021-06-08 12:44:33 +02:00 committed by Richard Lau
parent dcfb182546
commit 54a250e79c
No known key found for this signature in database
GPG Key ID: C43CEC45C17AB93C
26 changed files with 650 additions and 419 deletions

View File

@ -336,7 +336,7 @@ test-valgrind: all
test-check-deopts: all test-check-deopts: all
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) --check-deopts parallel sequential $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) --check-deopts parallel sequential
DOCBUILDSTAMP_PREREQS = tools/doc/addon-verify.js doc/api/addons.md DOCBUILDSTAMP_PREREQS = tools/doc/addon-verify.mjs doc/api/addons.md
ifeq ($(OSTYPE),aix) ifeq ($(OSTYPE),aix)
DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp
@ -587,12 +587,12 @@ test-doc: doc-only lint-md ## Builds, lints, and verifies the docs.
else \ else \
$(PYTHON) tools/test.py $(PARALLEL_ARGS) doctool; \ $(PYTHON) tools/test.py $(PARALLEL_ARGS) doctool; \
fi fi
$(NODE) tools/doc/checkLinks.js . $(NODE) tools/doc/checkLinks.mjs .
.PHONY: test-doc-ci .PHONY: test-doc-ci
test-doc-ci: doc-only test-doc-ci: doc-only
$(PYTHON) tools/test.py --shell $(NODE) $(TEST_CI_ARGS) $(PARALLEL_ARGS) doctool $(PYTHON) tools/test.py --shell $(NODE) $(TEST_CI_ARGS) $(PARALLEL_ARGS) doctool
$(NODE) tools/doc/checkLinks.js . $(NODE) tools/doc/checkLinks.mjs .
test-known-issues: all test-known-issues: all
$(PYTHON) tools/test.py $(PARALLEL_ARGS) known_issues $(PYTHON) tools/test.py $(PARALLEL_ARGS) known_issues
@ -734,33 +734,33 @@ run-npm-ci = $(PWD)/$(NPM) ci
LINK_DATA = out/doc/apilinks.json LINK_DATA = out/doc/apilinks.json
VERSIONS_DATA = out/previous-doc-versions.json VERSIONS_DATA = out/previous-doc-versions.json
gen-api = tools/doc/generate.js --node-version=$(FULLVERSION) \ gen-api = tools/doc/generate.mjs --node-version=$(FULLVERSION) \
--apilinks=$(LINK_DATA) $< --output-directory=out/doc/api \ --apilinks=$(LINK_DATA) $< --output-directory=out/doc/api \
--versions-file=$(VERSIONS_DATA) --versions-file=$(VERSIONS_DATA)
gen-apilink = tools/doc/apilinks.js $(LINK_DATA) $(wildcard lib/*.js) gen-apilink = tools/doc/apilinks.mjs $(LINK_DATA) $(wildcard lib/*.js)
$(LINK_DATA): $(wildcard lib/*.js) tools/doc/apilinks.js | out/doc $(LINK_DATA): $(wildcard lib/*.js) tools/doc/apilinks.mjs | out/doc
$(call available-node, $(gen-apilink)) $(call available-node, $(gen-apilink))
# Regenerate previous versions data if the current version changes # Regenerate previous versions data if the current version changes
$(VERSIONS_DATA): CHANGELOG.md src/node_version.h tools/doc/versions.js $(VERSIONS_DATA): CHANGELOG.md src/node_version.h tools/doc/versions.mjs
$(call available-node, tools/doc/versions.js $@) $(call available-node, tools/doc/versions.mjs $@)
out/doc/api/%.json out/doc/api/%.html: doc/api/%.md tools/doc/generate.js \ out/doc/api/%.json out/doc/api/%.html: doc/api/%.md tools/doc/generate.mjs \
tools/doc/markdown.js tools/doc/html.js tools/doc/json.js \ tools/doc/markdown.mjs tools/doc/html.mjs tools/doc/json.mjs \
tools/doc/apilinks.js $(VERSIONS_DATA) | $(LINK_DATA) out/doc/api tools/doc/apilinks.mjs $(VERSIONS_DATA) | $(LINK_DATA) out/doc/api
$(call available-node, $(gen-api)) $(call available-node, $(gen-api))
out/doc/api/all.html: $(apidocs_html) tools/doc/allhtml.js \ out/doc/api/all.html: $(apidocs_html) tools/doc/allhtml.mjs \
tools/doc/apilinks.js | out/doc/api tools/doc/apilinks.mjs | out/doc/api
$(call available-node, tools/doc/allhtml.js) $(call available-node, tools/doc/allhtml.mjs)
out/doc/api/all.json: $(apidocs_json) tools/doc/alljson.js | out/doc/api out/doc/api/all.json: $(apidocs_json) tools/doc/alljson.mjs | out/doc/api
$(call available-node, tools/doc/alljson.js) $(call available-node, tools/doc/alljson.mjs)
.PHONY: out/doc/api/stability .PHONY: out/doc/api/stability
out/doc/api/stability: out/doc/api/all.json tools/doc/stability.js | out/doc/api out/doc/api/stability: out/doc/api/all.json tools/doc/stability.mjs | out/doc/api
$(call available-node, tools/doc/stability.js) $(call available-node, tools/doc/stability.mjs)
.PHONY: docopen .PHONY: docopen
docopen: out/doc/api/all.html docopen: out/doc/api/all.html

View File

@ -1,6 +1,6 @@
<!-- <!--
NB(chrisdickinson): if you move this file, be sure to update NB(chrisdickinson): if you move this file, be sure to update
tools/doc/html.js to point at the new location. tools/doc/html.mjs to point at the new location.
--> -->
<!--introduced_in=v0.10.0--> <!--introduced_in=v0.10.0-->

View File

@ -30,6 +30,7 @@ const {
allowGlobals, allowGlobals,
mustCall, mustCall,
mustCallAtLeast, mustCallAtLeast,
mustSucceed,
hasMultiLocalhost, hasMultiLocalhost,
skipIfDumbTerminal, skipIfDumbTerminal,
skipIfEslintMissing, skipIfEslintMissing,
@ -76,6 +77,7 @@ export {
allowGlobals, allowGlobals,
mustCall, mustCall,
mustCallAtLeast, mustCallAtLeast,
mustSucceed,
hasMultiLocalhost, hasMultiLocalhost,
skipIfDumbTerminal, skipIfDumbTerminal,
skipIfEslintMissing, skipIfEslintMissing,

View File

@ -1,14 +1,15 @@
'use strict'; import '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import tmpdir from '../common/tmpdir.js';
require('../common'); import assert from 'assert';
const fixtures = require('../common/fixtures'); import { execFileSync } from 'child_process';
const tmpdir = require('../common/tmpdir'); import fs from 'fs';
const fs = require('fs'); import path from 'path';
const assert = require('assert'); import { fileURLToPath } from 'url';
const path = require('path');
const { execFileSync } = require('child_process');
const script = path.join(__dirname, '..', '..', 'tools', 'doc', 'apilinks.js'); const script = fileURLToPath(
new URL('../../tools/doc/apilinks.mjs', import.meta.url));
const apilinks = fixtures.path('apilinks'); const apilinks = fixtures.path('apilinks');
tmpdir.refresh(); tmpdir.refresh();

View File

@ -1,22 +1,14 @@
'use strict'; import '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
const common = require('../common'); import assert from 'assert';
// The doctool currently uses js-yaml from the tool/node_modules/eslint/ tree. import { readFileSync } from 'fs';
try { import { createRequire } from 'module';
require('../../tools/node_modules/eslint/node_modules/js-yaml');
} catch {
common.skip('missing js-yaml (eslint not present)');
}
const assert = require('assert'); import * as html from '../../tools/doc/html.mjs';
const { readFileSync } = require('fs'); import { replaceLinks } from '../../tools/doc/markdown.mjs';
const fixtures = require('../common/fixtures');
const { replaceLinks } = require('../../tools/doc/markdown.js');
const html = require('../../tools/doc/html.js');
const path = require('path');
module.paths.unshift( const require = createRequire(new URL('../../tools/doc/', import.meta.url));
path.join(__dirname, '..', '..', 'tools', 'doc', 'node_modules'));
const unified = require('unified'); const unified = require('unified');
const markdown = require('remark-parse'); const markdown = require('remark-parse');
const remark2rehype = require('remark-rehype'); const remark2rehype = require('remark-rehype');

View File

@ -1,21 +1,13 @@
'use strict'; import * as common from '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
const common = require('../common'); import assert from 'assert';
// The doctool currently uses js-yaml from the tool/node_modules/eslint/ tree. import fs from 'fs';
try { import { createRequire } from 'module';
require('../../tools/node_modules/eslint/node_modules/js-yaml');
} catch {
common.skip('missing js-yaml (eslint not present)');
}
const assert = require('assert'); import * as json from '../../tools/doc/json.mjs';
const fs = require('fs');
const path = require('path');
const fixtures = require('../common/fixtures');
const json = require('../../tools/doc/json.js');
module.paths.unshift( const require = createRequire(new URL('../../tools/doc/', import.meta.url));
path.join(__dirname, '..', '..', 'tools', 'doc', 'node_modules'));
const unified = require('unified'); const unified = require('unified');
const markdown = require('remark-parse'); const markdown = require('remark-parse');

View File

@ -1,15 +1,16 @@
'use strict'; import '../common/index.mjs';
import tmpdir from '../common/tmpdir.js';
require('../common'); import assert from 'assert';
const assert = require('assert'); import { spawnSync } from 'child_process';
const { spawnSync } = require('child_process'); import fs from 'fs';
const fs = require('fs'); import path from 'path';
const path = require('path'); import { fileURLToPath } from 'url';
const tmpdir = require('../common/tmpdir'); import util from 'util';
const util = require('util');
const debuglog = util.debuglog('test'); const debuglog = util.debuglog('test');
const versionsTool = path.resolve(__dirname, '../../tools/doc/versions.js'); const versionsTool = fileURLToPath(
new URL('../../tools/doc/versions.mjs', import.meta.url));
// At the time of writing these are the minimum expected versions. // At the time of writing these are the minimum expected versions.
// New versions of Node.js do not have to be explicitly added here. // New versions of Node.js do not have to be explicitly added here.

View File

@ -1,9 +1,8 @@
'use strict'; import '../common/index.mjs';
require('../common'); import assert from 'assert';
const assert = require('assert');
const { referenceToLocalMdFile } = require('../../tools/doc/markdown.js'); import { referenceToLocalMdFile } from '../../tools/doc/markdown.mjs';
{ {
const shouldBeSpotted = [ const shouldBeSpotted = [

View File

@ -1,5 +1,9 @@
'use strict'; import * as common from '../common/index.mjs';
const common = require('../common');
import assert from 'assert';
import fs from 'fs';
import path from 'path';
if (common.isWindows) { if (common.isWindows) {
common.skip('`make doc` does not run on Windows'); common.skip('`make doc` does not run on Windows');
} }
@ -7,14 +11,10 @@ if (common.isWindows) {
// This tests that `make doc` generates the documentation properly. // This tests that `make doc` generates the documentation properly.
// Note that for this test to pass, `make doc` must be run first. // Note that for this test to pass, `make doc` must be run first.
const assert = require('assert'); const apiURL = new URL('../../out/doc/api/', import.meta.url);
const fs = require('fs'); const mdURL = new URL('../../doc/api/', import.meta.url);
const path = require('path'); const allMD = fs.readdirSync(mdURL);
const allDocs = fs.readdirSync(apiURL);
const apiPath = path.resolve(__dirname, '..', '..', 'out', 'doc', 'api');
const mdPath = path.resolve(__dirname, '..', '..', 'doc', 'api');
const allMD = fs.readdirSync(mdPath);
const allDocs = fs.readdirSync(apiPath);
assert.ok(allDocs.includes('index.html')); assert.ok(allDocs.includes('index.html'));
const actualDocs = allDocs.filter( const actualDocs = allDocs.filter(
@ -33,7 +33,7 @@ for (const name of actualDocs) {
); );
} }
const toc = fs.readFileSync(path.resolve(apiPath, 'index.html'), 'utf8'); const toc = fs.readFileSync(new URL('./index.html', apiURL), 'utf8');
const re = /href="([^/]+\.html)"/; const re = /href="([^/]+\.html)"/;
const globalRe = new RegExp(re, 'g'); const globalRe = new RegExp(re, 'g');
const links = toc.match(globalRe); const links = toc.match(globalRe);
@ -56,8 +56,9 @@ for (const actualDoc of actualDocs) {
assert.ok( assert.ok(
expectedDocs.includes(actualDoc), `${actualDoc} does not match TOC`); expectedDocs.includes(actualDoc), `${actualDoc} does not match TOC`);
assert.ok( assert.notStrictEqual(
fs.statSync(path.join(apiPath, actualDoc)).size !== 0, fs.statSync(new URL(`./${actualDoc}`, apiURL)).size,
0,
`${actualDoc} is empty` `${actualDoc} is empty`
); );
} }

View File

@ -78,7 +78,7 @@ added: v0.10.0
* Returns: {SomeClass | null} The next `SomeClass` in line. * Returns: {SomeClass | null} The next `SomeClass` in line.
`SomeClass` must be registered in `tools/doc/type-parser.js` `SomeClass` must be registered in `tools/doc/type-parser.mjs`
to be properly parsed in `{type}` fields. to be properly parsed in `{type}` fields.
### SomeClass.someProperty ### SomeClass.someProperty

View File

@ -1,23 +1,21 @@
'use strict';
// doc/api/addons.md has a bunch of code. Extract it for verification // doc/api/addons.md has a bunch of code. Extract it for verification
// that the C++ code compiles and the js code runs. // that the C++ code compiles and the js code runs.
// Add .gyp files which will be used to compile the C++ code. // Add .gyp files which will be used to compile the C++ code.
// Modify the require paths in the js code to pull from the build tree. // Modify the require paths in the js code to pull from the build tree.
// Triggered from the build-addons target in the Makefile and vcbuild.bat. // Triggered from the build-addons target in the Makefile and vcbuild.bat.
const { mkdir, writeFile } = require('fs'); import { mkdir, writeFile } from 'fs/promises';
const { resolve } = require('path');
const vfile = require('to-vfile');
const unified = require('unified');
const remarkParse = require('remark-parse');
const gfm = require('remark-gfm');
const rootDir = resolve(__dirname, '..', '..'); import gfm from 'remark-gfm';
const doc = resolve(rootDir, 'doc', 'api', 'addons.md'); import remarkParse from 'remark-parse';
const verifyDir = resolve(rootDir, 'test', 'addons'); import { toVFile } from 'to-vfile';
import unified from 'unified';
const file = vfile.readSync(doc, 'utf8'); const rootDir = new URL('../../', import.meta.url);
const doc = new URL('./doc/api/addons.md', rootDir);
const verifyDir = new URL('./test/addons/', rootDir);
const file = toVFile.readSync(doc, 'utf8');
const tree = unified().use(remarkParse).use(gfm).parse(file); const tree = unified().use(remarkParse).use(gfm).parse(file);
const addons = {}; const addons = {};
let id = 0; let id = 0;
@ -26,7 +24,7 @@ let currentHeader;
const validNames = /^\/\/\s+(.*\.(?:cc|h|js))[\r\n]/; const validNames = /^\/\/\s+(.*\.(?:cc|h|js))[\r\n]/;
tree.children.forEach((node) => { tree.children.forEach((node) => {
if (node.type === 'heading') { if (node.type === 'heading') {
currentHeader = file.contents.slice( currentHeader = file.value.slice(
node.children[0].position.start.offset, node.children[0].position.start.offset,
node.position.end.offset); node.position.end.offset);
addons[currentHeader] = { files: {} }; addons[currentHeader] = { files: {} };
@ -38,9 +36,10 @@ tree.children.forEach((node) => {
} }
}); });
Object.keys(addons).forEach((header) => { await Promise.all(
verifyFiles(addons[header].files, header); Object.keys(addons).flatMap(
}); (header) => verifyFiles(addons[header].files, header)
));
function verifyFiles(files, blockName) { function verifyFiles(files, blockName) {
const fileNames = Object.keys(files); const fileNames = Object.keys(files);
@ -48,13 +47,13 @@ function verifyFiles(files, blockName) {
// Must have a .cc and a .js to be a valid test. // Must have a .cc and a .js to be a valid test.
if (!fileNames.some((name) => name.endsWith('.cc')) || if (!fileNames.some((name) => name.endsWith('.cc')) ||
!fileNames.some((name) => name.endsWith('.js'))) { !fileNames.some((name) => name.endsWith('.js'))) {
return; return [];
} }
blockName = blockName.toLowerCase().replace(/\s/g, '_').replace(/\W/g, ''); blockName = blockName.toLowerCase().replace(/\s/g, '_').replace(/\W/g, '');
const dir = resolve( const dir = new URL(
`./${String(++id).padStart(2, '0')}_${blockName}/`,
verifyDir, verifyDir,
`${String(++id).padStart(2, '0')}_${blockName}`
); );
files = fileNames.map((name) => { files = fileNames.map((name) => {
@ -68,14 +67,14 @@ ${files[name].replace(
`; `;
} }
return { return {
path: resolve(dir, name), content: files[name],
name: name, name,
content: files[name] url: new URL(`./${name}`, dir),
}; };
}); });
files.push({ files.push({
path: resolve(dir, 'binding.gyp'), url: new URL('./binding.gyp', dir),
content: JSON.stringify({ content: JSON.stringify({
targets: [ targets: [
{ {
@ -87,16 +86,8 @@ ${files[name].replace(
}) })
}); });
mkdir(dir, () => { const dirCreation = mkdir(dir);
// Ignore errors.
files.forEach(({ path, content }) => { return files.map(({ url, content }) =>
writeFile(path, content, (err) => { dirCreation.then(() => writeFile(url, content)));
if (err)
throw err;
console.log(`Wrote ${path}`);
});
});
});
} }

View File

@ -1,18 +1,16 @@
'use strict';
// Build all.html by combining the generated toc and apicontent from each // Build all.html by combining the generated toc and apicontent from each
// of the generated html files. // of the generated html files.
const fs = require('fs'); import fs from 'fs';
const source = `${__dirname}/../../out/doc/api`; const source = new URL('../../out/doc/api/', import.meta.url);
// Get a list of generated API documents. // Get a list of generated API documents.
const htmlFiles = fs.readdirSync(source, 'utf8') const htmlFiles = fs.readdirSync(source, 'utf8')
.filter((name) => name.includes('.html') && name !== 'all.html'); .filter((name) => name.includes('.html') && name !== 'all.html');
// Read the table of contents. // Read the table of contents.
const toc = fs.readFileSync(source + '/index.html', 'utf8'); const toc = fs.readFileSync(new URL('./index.html', source), 'utf8');
// Extract (and concatenate) the toc and apicontent from each document. // Extract (and concatenate) the toc and apicontent from each document.
let contents = ''; let contents = '';
@ -28,7 +26,7 @@ const seen = {
for (const link of toc.match(/<a.*?>/g)) { for (const link of toc.match(/<a.*?>/g)) {
const href = /href="(.*?)"/.exec(link)[1]; const href = /href="(.*?)"/.exec(link)[1];
if (!htmlFiles.includes(href) || seen[href]) continue; if (!htmlFiles.includes(href) || seen[href]) continue;
const data = fs.readFileSync(source + '/' + href, 'utf8'); const data = fs.readFileSync(new URL(`./${href}`, source), 'utf8');
// Split the doc. // Split the doc.
const match = /(<\/ul>\s*)?<\/\w+>\s*<\w+ id="apicontent">/.exec(data); const match = /(<\/ul>\s*)?<\/\w+>\s*<\w+ id="apicontent">/.exec(data);
@ -74,7 +72,7 @@ all = all.slice(0, apiStart.index + apiStart[0].length) +
all.slice(apiEnd); all.slice(apiEnd);
// Write results. // Write results.
fs.writeFileSync(source + '/all.html', all, 'utf8'); fs.writeFileSync(new URL('./all.html', source), all, 'utf8');
// Validate all hrefs have a target. // Validate all hrefs have a target.
const ids = new Set(); const ids = new Set();

View File

@ -1,18 +1,16 @@
'use strict';
// Build all.json by combining the miscs, modules, classes, globals, and methods // Build all.json by combining the miscs, modules, classes, globals, and methods
// from the generated json files. // from the generated json files.
const fs = require('fs'); import fs from 'fs';
const source = `${__dirname}/../../out/doc/api`; const source = new URL('../../out/doc/api/', import.meta.url);
// Get a list of generated API documents. // Get a list of generated API documents.
const jsonFiles = fs.readdirSync(source, 'utf8') const jsonFiles = fs.readdirSync(source, 'utf8')
.filter((name) => name.includes('.json') && name !== 'all.json'); .filter((name) => name.includes('.json') && name !== 'all.json');
// Read the table of contents. // Read the table of contents.
const toc = fs.readFileSync(source + '/index.html', 'utf8'); const toc = fs.readFileSync(new URL('./index.html', source), 'utf8');
// Initialize results. Only these four data values will be collected. // Initialize results. Only these four data values will be collected.
const results = { const results = {
@ -37,7 +35,7 @@ for (const link of toc.match(/<a.*?>/g)) {
const json = href.replace('.html', '.json'); const json = href.replace('.html', '.json');
if (!jsonFiles.includes(json) || seen[json]) continue; if (!jsonFiles.includes(json) || seen[json]) continue;
const data = JSON.parse( const data = JSON.parse(
fs.readFileSync(source + '/' + json, 'utf8') fs.readFileSync(new URL(`./${json}`, source), 'utf8')
.replace(/<a href=\\"#/g, `<a href=\\"${href}#`) .replace(/<a href=\\"#/g, `<a href=\\"${href}#`)
); );
@ -55,5 +53,5 @@ for (const link of toc.match(/<a.*?>/g)) {
} }
// Write results. // Write results.
fs.writeFileSync(source + '/all.json', fs.writeFileSync(new URL('./all.json', source),
`${JSON.stringify(results, null, 2)}\n`, 'utf8'); `${JSON.stringify(results, null, 2)}\n`, 'utf8');

View File

@ -1,5 +1,3 @@
'use strict';
// Scan API sources for definitions. // Scan API sources for definitions.
// //
// Note the output is produced based on a world class parser, adherence to // Note the output is produced based on a world class parser, adherence to
@ -18,10 +16,11 @@
// `function X(...) {...}`). Over time, we expect to handle more // `function X(...) {...}`). Over time, we expect to handle more
// cases (example: ES2015 class definitions). // cases (example: ES2015 class definitions).
const acorn = require('../../deps/acorn/acorn'); import child_process from 'child_process';
const fs = require('fs'); import fs from 'fs';
const path = require('path'); import path from 'path';
const child_process = require('child_process');
import * as acorn from '../../deps/acorn/acorn/dist/acorn.mjs';
// Run a command, capturing stdout, ignoring errors. // Run a command, capturing stdout, ignoring errors.
function execSync(command) { function execSync(command) {

View File

@ -1,9 +1,11 @@
'use strict'; import fs from 'fs';
import { extname, join, resolve } from 'path';
import { pathToFileURL } from 'url';
import gfm from 'remark-gfm';
import markdown from 'remark-parse';
import unified from 'unified';
const fs = require('fs');
const { extname, join, resolve } = require('path');
const unified = require('unified');
const { pathToFileURL } = require('url');
const DIR = resolve(process.argv[2]); const DIR = resolve(process.argv[2]);
console.log('Running Markdown link checker...'); console.log('Running Markdown link checker...');
@ -44,8 +46,8 @@ function findMarkdownFilesRecursively(dirPath) {
function checkFile(path) { function checkFile(path) {
const tree = unified() const tree = unified()
.use(require('remark-parse')) .use(markdown)
.use(require('remark-gfm')) .use(gfm)
.parse(fs.readFileSync(path)); .parse(fs.readFileSync(path));
const base = pathToFileURL(path); const base = pathToFileURL(path);

View File

@ -1,20 +1,18 @@
'use strict'; import yaml from 'js-yaml';
const yaml = require('js-yaml'); export function isYAMLBlock(text) {
function isYAMLBlock(text) {
return /^<!-- YAML/.test(text); return /^<!-- YAML/.test(text);
} }
function isSourceLink(text) { export function isSourceLink(text) {
return /^<!-- source_link=([^\s/]+\/)+\w+\.\w+ -->/.test(text); return /^<!-- source_link=([^\s/]+\/)+\w+\.\w+ -->/.test(text);
} }
function arrify(value) { export function arrify(value) {
return Array.isArray(value) ? value : [value]; return Array.isArray(value) ? value : [value];
} }
function extractAndParseYAML(text) { export function extractAndParseYAML(text) {
text = text.trim() text = text.trim()
.replace(/^<!-- YAML/, '') .replace(/^<!-- YAML/, '')
.replace(/-->$/, ''); .replace(/-->$/, '');
@ -45,5 +43,3 @@ function extractAndParseYAML(text) {
return meta; return meta;
} }
module.exports = { arrify, isYAMLBlock, isSourceLink, extractAndParseYAML };

View File

@ -19,21 +19,22 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE. // USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict'; import { readFileSync, promises as fs } from 'fs';
import path from 'path';
const { promises: fs } = require('fs'); import raw from 'rehype-raw';
const path = require('path'); import htmlStringify from 'rehype-stringify';
const unified = require('unified'); import gfm from 'remark-gfm';
const markdown = require('remark-parse'); import markdown from 'remark-parse';
const gfm = require('remark-gfm'); import remark2rehype from 'remark-rehype';
const remark2rehype = require('remark-rehype'); import unified from 'unified';
const raw = require('rehype-raw');
const htmlStringify = require('rehype-stringify');
const { replaceLinks } = require('./markdown'); import * as html from './html.mjs';
const linksMapper = require('./links-mapper'); import * as json from './json.mjs';
const html = require('./html'); import { replaceLinks } from './markdown.mjs';
const json = require('./json');
const linksMapperFile = new URL('links-mapper.json', import.meta.url);
const linksMapper = JSON.parse(readFileSync(linksMapperFile, 'utf8'));
// Parse the args. // Parse the args.
// Don't use nopt or whatever for this. It's simple enough. // Don't use nopt or whatever for this. It's simple enough.

View File

@ -19,26 +19,24 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE. // USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict'; import fs from 'fs';
import path from 'path';
const common = require('./common.js'); import highlightJs from 'highlight.js';
const fs = require('fs'); import raw from 'rehype-raw';
const unified = require('unified'); import htmlStringify from 'rehype-stringify';
const visit = require('unist-util-visit'); import gfm from 'remark-gfm';
const markdown = require('remark-parse'); import markdown from 'remark-parse';
const gfm = require('remark-gfm'); import remark2rehype from 'remark-rehype';
const remark2rehype = require('remark-rehype'); import unified from 'unified';
const raw = require('rehype-raw'); import { visit } from 'unist-util-visit';
const htmlStringify = require('rehype-stringify');
const path = require('path');
const typeParser = require('./type-parser.js');
const { highlight, getLanguage } = require('highlight.js');
module.exports = { import * as common from './common.mjs';
toHTML, firstHeader, preprocessText, preprocessElements, buildToc import * as typeParser from './type-parser.mjs';
};
const docPath = path.resolve(__dirname, '..', '..', 'doc'); const { highlight, getLanguage } = highlightJs;
const docPath = new URL('../../doc/', import.meta.url);
// Add class attributes to index navigation links. // Add class attributes to index navigation links.
function navClasses() { function navClasses() {
@ -50,7 +48,7 @@ function navClasses() {
}; };
} }
const gtocPath = path.join(docPath, 'api', 'index.md'); const gtocPath = new URL('./api/index.md', docPath);
const gtocMD = fs.readFileSync(gtocPath, 'utf8') const gtocMD = fs.readFileSync(gtocPath, 'utf8')
.replace(/\(([^#?]+?)\.md\)/ig, (_, filename) => `(${filename}.html)`) .replace(/\(([^#?]+?)\.md\)/ig, (_, filename) => `(${filename}.html)`)
.replace(/^<!--.*?-->/gms, ''); .replace(/^<!--.*?-->/gms, '');
@ -63,7 +61,7 @@ const gtocHTML = unified()
.use(htmlStringify) .use(htmlStringify)
.processSync(gtocMD).toString(); .processSync(gtocMD).toString();
const templatePath = path.join(docPath, 'template.html'); const templatePath = new URL('./template.html', docPath);
const template = fs.readFileSync(templatePath, 'utf8'); const template = fs.readFileSync(templatePath, 'utf8');
function processContent(content) { function processContent(content) {
@ -87,7 +85,7 @@ function processContent(content) {
}) + (firstTime ? '' : '</section>'); }) + (firstTime ? '' : '</section>');
} }
function toHTML({ input, content, filename, nodeVersion, versions }) { export function toHTML({ input, content, filename, nodeVersion, versions }) {
filename = path.basename(filename, '.md'); filename = path.basename(filename, '.md');
const id = filename.replace(/\W+/g, '-'); const id = filename.replace(/\W+/g, '-');
@ -115,7 +113,7 @@ function toHTML({ input, content, filename, nodeVersion, versions }) {
} }
// Set the section name based on the first header. Default to 'Index'. // Set the section name based on the first header. Default to 'Index'.
function firstHeader() { export function firstHeader() {
return (tree, file) => { return (tree, file) => {
let heading; let heading;
visit(tree, (node) => { visit(tree, (node) => {
@ -137,7 +135,7 @@ function firstHeader() {
// Handle general body-text replacements. // Handle general body-text replacements.
// For example, link man page references to the actual page. // For example, link man page references to the actual page.
function preprocessText({ nodeVersion }) { export function preprocessText({ nodeVersion }) {
return (tree) => { return (tree) => {
visit(tree, null, (node) => { visit(tree, null, (node) => {
if (common.isSourceLink(node.value)) { if (common.isSourceLink(node.value)) {
@ -199,7 +197,7 @@ function linkJsTypeDocs(text) {
const isJSFlavorSnippet = (node) => node.lang === 'cjs' || node.lang === 'mjs'; const isJSFlavorSnippet = (node) => node.lang === 'cjs' || node.lang === 'mjs';
// Preprocess headers, stability blockquotes, and YAML blocks. // Preprocess headers, stability blockquotes, and YAML blocks.
function preprocessElements({ filename }) { export function preprocessElements({ filename }) {
return (tree) => { return (tree) => {
const STABILITY_RE = /(.*:)\s*(\d)([\s\S]*)/; const STABILITY_RE = /(.*:)\s*(\d)([\s\S]*)/;
let headingIndex = -1; let headingIndex = -1;
@ -221,7 +219,7 @@ function preprocessElements({ filename }) {
const highlighted = const highlighted =
`<code class='${className}'>` + `<code class='${className}'>` +
(getLanguage(node.lang || '') ? (getLanguage(node.lang || '') ?
highlight(node.lang, node.value) : node).value + highlight(node.value, { language: node.lang }) : node).value +
'</code>'; '</code>';
node.type = 'html'; node.type = 'html';
@ -386,7 +384,7 @@ function versionSort(a, b) {
} }
const DEPRECATION_HEADING_PATTERN = /^DEP\d+:/; const DEPRECATION_HEADING_PATTERN = /^DEP\d+:/;
function buildToc({ filename, apilinks }) { export function buildToc({ filename, apilinks }) {
return (tree, file) => { return (tree, file) => {
const idCounters = Object.create(null); const idCounters = Object.create(null);
let toc = ''; let toc = '';

View File

@ -19,18 +19,15 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE. // USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict'; import html from 'remark-html';
import unified from 'unified';
import { selectAll } from 'unist-util-select';
const unified = require('unified'); import * as common from './common.mjs';
const common = require('./common.js');
const html = require('remark-html');
const { selectAll } = require('unist-util-select');
module.exports = { jsonAPI };
// Unified processor: input is https://github.com/syntax-tree/mdast, // Unified processor: input is https://github.com/syntax-tree/mdast,
// output is: https://gist.github.com/1777387. // output is: https://gist.github.com/1777387.
function jsonAPI({ filename }) { export function jsonAPI({ filename }) {
return (tree, file) => { return (tree, file) => {
const exampleHeading = /^example/i; const exampleHeading = /^example/i;

View File

@ -1,15 +1,8 @@
'use strict'; import { visit } from 'unist-util-visit';
const visit = require('unist-util-visit'); export const referenceToLocalMdFile = /^(?![+a-z]+:)([^#?]+)\.md(#.+)?$/i;
const referenceToLocalMdFile = /^(?![+a-z]+:)([^#?]+)\.md(#.+)?$/i; export function replaceLinks({ filename, linksMapper }) {
module.exports = {
replaceLinks,
referenceToLocalMdFile,
};
function replaceLinks({ filename, linksMapper }) {
return (tree) => { return (tree) => {
const fileHtmlUrls = linksMapper[filename]; const fileHtmlUrls = linksMapper[filename];

View File

@ -11,18 +11,18 @@
"node-doc-generator": "generate.js" "node-doc-generator": "generate.js"
}, },
"devDependencies": { "devDependencies": {
"highlight.js": "10.5.0", "highlight.js": "10.7.3",
"js-yaml": "4.0.0", "js-yaml": "4.1.0",
"rehype-raw": "5.0.0", "rehype-raw": "5.1.0",
"rehype-stringify": "8.0.0", "rehype-stringify": "8.0.0",
"remark-gfm": "^1.0.0", "remark-gfm": "^1.0.0",
"remark-html": "13.0.1", "remark-html": "13.0.1",
"remark-parse": "^9.0.0", "remark-parse": "^9.0.0",
"remark-rehype": "8.0.0", "remark-rehype": "8.1.0",
"to-vfile": "6.1.0", "to-vfile": "7.1.0",
"unified": "9.2.0", "unified": "9.2.1",
"unist-util-select": "3.0.4", "unist-util-select": "4.0.0",
"unist-util-visit": "2.0.3" "unist-util-visit": "3.1.0"
}, },
"engines": { "engines": {
"node": ">=12.10.0" "node": ">=12.10.0"
@ -163,6 +163,18 @@
} }
} }
}, },
"node_modules/escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true,
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/extend": { "node_modules/extend": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@ -227,9 +239,9 @@
} }
}, },
"node_modules/hast-util-raw": { "node_modules/hast-util-raw": {
"version": "6.0.2", "version": "6.1.0",
"resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-6.0.2.tgz", "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-6.1.0.tgz",
"integrity": "sha512-m7IlmqO8cytmG3EIMDMXUG8LjO2uyApWcxwL6apsGvikIClgykFg3UYps4rnt4kUpY3j8Mc7ANJ8zW6KPPLb+w==", "integrity": "sha512-5FoZLDHBpka20OlZZ4I/+RBw5piVQ8iI1doEvffQhx5CbCyTtP8UCq8Tw6NmTAMtXgsQxmhW7Ly8OdFre5/YMQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/hast": "^2.0.0", "@types/hast": "^2.0.0",
@ -238,6 +250,7 @@
"html-void-elements": "^1.0.0", "html-void-elements": "^1.0.0",
"parse5": "^6.0.0", "parse5": "^6.0.0",
"unist-util-position": "^3.0.0", "unist-util-position": "^3.0.0",
"unist-util-visit": "^2.0.0",
"vfile": "^4.0.0", "vfile": "^4.0.0",
"web-namespaces": "^1.0.0", "web-namespaces": "^1.0.0",
"xtend": "^4.0.0", "xtend": "^4.0.0",
@ -248,6 +261,21 @@
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/hast-util-raw/node_modules/unist-util-visit": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz",
"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==",
"dev": true,
"dependencies": {
"@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0",
"unist-util-visit-parents": "^3.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/hast-util-sanitize": { "node_modules/hast-util-sanitize": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/hast-util-sanitize/-/hast-util-sanitize-3.0.2.tgz", "resolved": "https://registry.npmjs.org/hast-util-sanitize/-/hast-util-sanitize-3.0.2.tgz",
@ -262,9 +290,9 @@
} }
}, },
"node_modules/hast-util-to-html": { "node_modules/hast-util-to-html": {
"version": "7.1.2", "version": "7.1.3",
"resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-7.1.2.tgz", "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-7.1.3.tgz",
"integrity": "sha512-pu73bvORzdF6XZgwl9eID/0RjBb/jtRfoGRRSykpR1+o9rCdiAHpgkSukZsQBRlIqMg6ylAcd7F0F7myJUb09Q==", "integrity": "sha512-yk2+1p3EJTEE9ZEUkgHsUSVhIpCsL/bvT8E5GzmWc+N1Po5gBw+0F8bo7dpxXR0nu0bQVxVZGX2lBGF21CmeDw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ccount": "^1.0.0", "ccount": "^1.0.0",
@ -328,9 +356,9 @@
} }
}, },
"node_modules/highlight.js": { "node_modules/highlight.js": {
"version": "10.5.0", "version": "10.7.3",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.5.0.tgz", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz",
"integrity": "sha512-xTmvd9HiIHR6L53TMC7TKolEj65zG1XU+Onr8oi86mYa+nLcIbxTTWkpW7CsEwv/vK7u1zb8alZIMLDqqN6KTw==", "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "*" "node": "*"
@ -429,9 +457,9 @@
} }
}, },
"node_modules/js-yaml": { "node_modules/js-yaml": {
"version": "4.0.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"argparse": "^2.0.1" "argparse": "^2.0.1"
@ -476,10 +504,40 @@
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/mdast-util-definitions/node_modules/unist-util-visit": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz",
"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==",
"dev": true,
"dependencies": {
"@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0",
"unist-util-visit-parents": "^3.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-find-and-replace": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-1.1.1.tgz",
"integrity": "sha512-9cKl33Y21lyckGzpSmEQnIDjEfeeWelN5s1kUW1LwdB0Fkuq2u+4GdqcGEygYxJE8GVqCl0741bYXHgamfWAZA==",
"dev": true,
"dependencies": {
"escape-string-regexp": "^4.0.0",
"unist-util-is": "^4.0.0",
"unist-util-visit-parents": "^3.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-from-markdown": { "node_modules/mdast-util-from-markdown": {
"version": "0.8.4", "version": "0.8.5",
"resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.4.tgz", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz",
"integrity": "sha512-jj891B5pV2r63n2kBTFh8cRI2uR9LQHsXG1zSDqfhXkIlDzrTcIlbB5+5aaYEkl8vOPIOPLf8VT7Ere1wWTMdw==", "integrity": "sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/mdast": "^3.0.0", "@types/mdast": "^3.0.0",
@ -494,9 +552,9 @@
} }
}, },
"node_modules/mdast-util-gfm": { "node_modules/mdast-util-gfm": {
"version": "0.1.1", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.1.tgz", "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.2.tgz",
"integrity": "sha512-oE1W1zSXU2L2LHg91V22HC3Z1fbsOZTBYUQq+kpM29f9297TbRm0C1l3bQ88RREl0WaUQaB49G7trvwy5utUKQ==", "integrity": "sha512-NNkhDx/qYcuOWB7xHUGWZYVXvjPFFd6afg6/e2g+SV4r9q5XUcCbV4Wfa3DLYIiD+xAEZc6K4MGaE/m0KDcPwQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"mdast-util-gfm-autolink-literal": "^0.1.0", "mdast-util-gfm-autolink-literal": "^0.1.0",
@ -511,10 +569,15 @@
} }
}, },
"node_modules/mdast-util-gfm-autolink-literal": { "node_modules/mdast-util-gfm-autolink-literal": {
"version": "0.1.2", "version": "0.1.3",
"resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.2.tgz", "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.3.tgz",
"integrity": "sha512-WFeIrcNNsfBety0gyWuiBIPing9UkVcl/m2iZOyW1uHEH2evjFocet2h77M24ub0WyZ4ucnQn/jWhO5Ozl6j4g==", "integrity": "sha512-GjmLjWrXg1wqMIO9+ZsRik/s7PLwTaeCHVB7vRxUwLntZc8mzmTsLVr6HW1yLokcnhfURsn5zmSVdi3/xWWu1A==",
"dev": true, "dev": true,
"dependencies": {
"ccount": "^1.0.0",
"mdast-util-find-and-replace": "^1.1.0",
"micromark": "^2.11.3"
},
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
@ -561,9 +624,9 @@
} }
}, },
"node_modules/mdast-util-to-hast": { "node_modules/mdast-util-to-hast": {
"version": "10.1.1", "version": "10.2.0",
"resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.1.1.tgz", "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.2.0.tgz",
"integrity": "sha512-+hvJrYiUgK2aY0Q1h1LaHQ4h0P7VVumWdAcUuG9k49lYglyU9GtTrA4O8hMh5gRnyT22wC15takM2qrrlpvNxQ==", "integrity": "sha512-JoPBfJ3gBnHZ18icCwHR50orC9kNH81tiR1gs01D8Q5YpV6adHNO9nKNuFBCJQ941/32PT1a63UF/DitmS3amQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/mdast": "^3.0.0", "@types/mdast": "^3.0.0",
@ -580,10 +643,25 @@
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/mdast-util-to-hast/node_modules/unist-util-visit": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz",
"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==",
"dev": true,
"dependencies": {
"@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0",
"unist-util-visit-parents": "^3.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-to-markdown": { "node_modules/mdast-util-to-markdown": {
"version": "0.6.2", "version": "0.6.5",
"resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.2.tgz", "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz",
"integrity": "sha512-iRczns6WMvu0hUw02LXsPDJshBIwtUPbvHBWo19IQeU0YqmzlA8Pd30U8V7uiI0VPkxzS7A/NXBXH6u+HS87Zg==", "integrity": "sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/unist": "^2.0.0", "@types/unist": "^2.0.0",
@ -615,9 +693,9 @@
"dev": true "dev": true
}, },
"node_modules/micromark": { "node_modules/micromark": {
"version": "2.11.2", "version": "2.11.4",
"resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.2.tgz", "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz",
"integrity": "sha512-IXuP76p2uj8uMg4FQc1cRE7lPCLsfAXuEfdjtdO55VRiFO1asrCSQ5g43NmPqFtRwzEnEhafRVzn2jg0UiKArQ==", "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -635,14 +713,14 @@
} }
}, },
"node_modules/micromark-extension-gfm": { "node_modules/micromark-extension-gfm": {
"version": "0.3.2", "version": "0.3.3",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.2.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.3.tgz",
"integrity": "sha512-ToQEpLkRgg7Tp8D3GM/SjZFPV0cCwWNxZmoEVIOQivOswRtPg7gg2WlCrtHhUWFNX+DgDjbq0iLOPGp4Y15oug==", "integrity": "sha512-oVN4zv5/tAIA+l3GbMi7lWeYpJ14oQyJ3uEim20ktYFAcfX1x3LNlFGGlmrZHt7u9YlKExmyJdDGaTt6cMSR/A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"micromark": "~2.11.0", "micromark": "~2.11.0",
"micromark-extension-gfm-autolink-literal": "~0.5.0", "micromark-extension-gfm-autolink-literal": "~0.5.0",
"micromark-extension-gfm-strikethrough": "~0.6.0", "micromark-extension-gfm-strikethrough": "~0.6.5",
"micromark-extension-gfm-table": "~0.4.0", "micromark-extension-gfm-table": "~0.4.0",
"micromark-extension-gfm-tagfilter": "~0.3.0", "micromark-extension-gfm-tagfilter": "~0.3.0",
"micromark-extension-gfm-task-list-item": "~0.3.0" "micromark-extension-gfm-task-list-item": "~0.3.0"
@ -653,12 +731,12 @@
} }
}, },
"node_modules/micromark-extension-gfm-autolink-literal": { "node_modules/micromark-extension-gfm-autolink-literal": {
"version": "0.5.4", "version": "0.5.7",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.4.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.7.tgz",
"integrity": "sha512-471VKd4k3SiX7vx9fC+IYeGQL0RnxwBBXeEc5WConb7naJDG5m16guA+VoFzyXchrvmU08t0dUWWPZ0mkJSXVw==", "integrity": "sha512-ePiDGH0/lhcngCe8FtH4ARFoxKTUelMp4L7Gg2pujYD5CSMb9PbblnyL+AAMud/SNMyusbS2XDSiPIRcQoNFAw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"micromark": "~2.11.0" "micromark": "~2.11.3"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -666,9 +744,9 @@
} }
}, },
"node_modules/micromark-extension-gfm-strikethrough": { "node_modules/micromark-extension-gfm-strikethrough": {
"version": "0.6.3", "version": "0.6.5",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.3.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.5.tgz",
"integrity": "sha512-MKMoP9x2dsr1aeX46ibBwVf4Q6nJsi5aaUFTOMOID5VOLSxwl4CrqUV4OGFQd6AqhtzBJAxaV+N2trlTBtZDNQ==", "integrity": "sha512-PpOKlgokpQRwUesRwWEp+fHjGGkZEejj83k9gU5iXCbDG+XBA92BqnRKYJdfqfkrRcZRgGuPuXb7DaK/DmxOhw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"micromark": "~2.11.0" "micromark": "~2.11.0"
@ -679,9 +757,9 @@
} }
}, },
"node_modules/micromark-extension-gfm-table": { "node_modules/micromark-extension-gfm-table": {
"version": "0.4.2", "version": "0.4.3",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.2.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.3.tgz",
"integrity": "sha512-AAzmj85XO1ydHYX0Lz52HGhcH2sZLm2AVvkwzELXWgZF6vGdq5yZ3CTByFRsqNUPyQBSIYFKLDAtc6KlnO42aw==", "integrity": "sha512-hVGvESPq0fk6ALWtomcwmgLvH8ZSVpcPjzi0AjPclB9FsVRgMtGZkUcpE0zgjOCFAznKepF4z3hX8z6e3HODdA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"micromark": "~2.11.0" "micromark": "~2.11.0"
@ -720,12 +798,6 @@
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true "dev": true
}, },
"node_modules/not": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/not/-/not-0.1.0.tgz",
"integrity": "sha1-yWkcF0bFXc++VMvYvU/wQbwrUZ0=",
"dev": true
},
"node_modules/nth-check": { "node_modules/nth-check": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz",
@ -776,12 +848,12 @@
} }
}, },
"node_modules/rehype-raw": { "node_modules/rehype-raw": {
"version": "5.0.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-5.0.0.tgz", "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-5.1.0.tgz",
"integrity": "sha512-q/MOBj4fs1WF/LSCh5uOtNhnm5OESuDcSvq1mDQP4/2t6Q52E9MHeVoLeMy9vOn93BEcgVBm4FCokcK2iXRDvA==", "integrity": "sha512-MDvHAb/5mUnif2R+0IPCYJU8WjHa9UzGtM/F4AVy5GixPlDZ1z3HacYy4xojDU+uBa+0X/3PIfyQI26/2ljJNA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"hast-util-raw": "^6.0.0" "hast-util-raw": "^6.1.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -844,12 +916,12 @@
} }
}, },
"node_modules/remark-rehype": { "node_modules/remark-rehype": {
"version": "8.0.0", "version": "8.1.0",
"resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-8.0.0.tgz", "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-8.1.0.tgz",
"integrity": "sha512-gVvOH02TMFqXOWoL6iXU7NXMsDJguNkNuMrzfkQeA4V6WCyHQnOKptn+IQBVVPuIH2sMJBwo8hlrmtn1MLTh9w==", "integrity": "sha512-EbCu9kHgAxKmW1yEYjx3QafMyGY3q8noUbNUI5xyKbaFP89wbhDrKxyIQNukNYthzjNHZu6J7hwFg7hRm1svYA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"mdast-util-to-hast": "^10.0.0" "mdast-util-to-hast": "^10.2.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -900,13 +972,56 @@
} }
}, },
"node_modules/to-vfile": { "node_modules/to-vfile": {
"version": "6.1.0", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-6.1.0.tgz", "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-7.1.0.tgz",
"integrity": "sha512-BxX8EkCxOAZe+D/ToHdDsJcVI4HqQfmw0tCkp31zf3dNP/XWIAjU4CmeuSwsSoOzOTqHPOL0KUzyZqJplkD0Qw==", "integrity": "sha512-t1c42ASuWo39ddjh2R+hX5+kbDcc2CmbhaTSJkVavDYMjnFkpq0L4LeF+rcPoDdieGUsFaivSSkmwuFpYzhBZw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"is-buffer": "^2.0.0", "is-buffer": "^2.0.0",
"vfile": "^4.0.0" "vfile": "^5.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/to-vfile/node_modules/unist-util-stringify-position": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz",
"integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==",
"dev": true,
"dependencies": {
"@types/unist": "^2.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/to-vfile/node_modules/vfile": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/vfile/-/vfile-5.0.1.tgz",
"integrity": "sha512-lbcf0k66x96Syy36HG+nIBFaSD/fAk589q4nETZTr0JW7eRRmrVo1vHwbD8NlHszUM5ICtFSWQ5xHC292hYZ/w==",
"dev": true,
"dependencies": {
"@types/unist": "^2.0.0",
"is-buffer": "^2.0.0",
"unist-util-stringify-position": "^3.0.0",
"vfile-message": "^3.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/to-vfile/node_modules/vfile-message": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.0.1.tgz",
"integrity": "sha512-gYmSHcZZUEtYpTmaWaFJwsuUD70/rTY4v09COp8TGtOkix6gGxb/a8iTQByIY9ciTk9GwAwIXd/J9OPfM4Bvaw==",
"dev": true,
"dependencies": {
"@types/unist": "^2.0.0",
"unist-util-stringify-position": "^3.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -924,9 +1039,9 @@
} }
}, },
"node_modules/unified": { "node_modules/unified": {
"version": "9.2.0", "version": "9.2.1",
"resolved": "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz", "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.1.tgz",
"integrity": "sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg==", "integrity": "sha512-juWjuI8Z4xFg8pJbnEZ41b5xjGUWGHqXALmBZ3FC3WX0PIx1CZBIIJ6mXbYMcf6Yw4Fi0rFUTA1cdz/BglbOhA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"bail": "^1.0.0", "bail": "^1.0.0",
@ -962,9 +1077,9 @@
} }
}, },
"node_modules/unist-util-is": { "node_modules/unist-util-is": {
"version": "4.0.4", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.4.tgz", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz",
"integrity": "sha512-3dF39j/u423v4BBQrk1AQ2Ve1FxY5W3JKwXxVFzBODQ6WEvccguhgp802qQLKSnxPODE6WuRZtV+ohlUg4meBA==", "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==",
"dev": true, "dev": true,
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -982,22 +1097,41 @@
} }
}, },
"node_modules/unist-util-select": { "node_modules/unist-util-select": {
"version": "3.0.4", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/unist-util-select/-/unist-util-select-3.0.4.tgz", "resolved": "https://registry.npmjs.org/unist-util-select/-/unist-util-select-4.0.0.tgz",
"integrity": "sha512-xf1zCu4okgPqGLdhCDpRnjwBNyv3EqjiXRUbz2SdK1+qnLMB7uXXajfzuBvvbHoQ+JLyp4AEbFCGndmc6S72sw==", "integrity": "sha512-UJsER0ubbBy8KR+5zZpcF/9/aApWOzjNqfseMjcw1h0wAUqbxAf56mMewspAqXtGKiwBylnYB+PbD/XqwcYrWg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"css-selector-parser": "^1.0.0", "css-selector-parser": "^1.0.0",
"not": "^0.1.0",
"nth-check": "^2.0.0", "nth-check": "^2.0.0",
"unist-util-is": "^4.0.0", "unist-util-is": "^5.0.0",
"zwitch": "^1.0.0" "zwitch": "^2.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/unist-util-select/node_modules/unist-util-is": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.0.tgz",
"integrity": "sha512-pWspZ+AvTqYbC+xWeRmzGqbcY8Na08Eowlfs2xchWTYot8vBBAq+syrE/LWS0bw1D/JOu4lwzDbEb6Mz13tK+g==",
"dev": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/unist-util-select/node_modules/zwitch": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.2.tgz",
"integrity": "sha512-JZxotl7SxAJH0j7dN4pxsTV6ZLXoLdGME+PsjkL/DaBrVryK9kTGq06GfKrwcSOqypP+fdXGoCHE36b99fWVoA==",
"dev": true,
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/unist-util-stringify-position": { "node_modules/unist-util-stringify-position": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz",
@ -1012,14 +1146,14 @@
} }
}, },
"node_modules/unist-util-visit": { "node_modules/unist-util-visit": {
"version": "2.0.3", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz",
"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", "integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/unist": "^2.0.0", "@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0", "unist-util-is": "^5.0.0",
"unist-util-visit-parents": "^3.0.0" "unist-util-visit-parents": "^4.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -1040,6 +1174,30 @@
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/unist-util-visit/node_modules/unist-util-is": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.0.tgz",
"integrity": "sha512-pWspZ+AvTqYbC+xWeRmzGqbcY8Na08Eowlfs2xchWTYot8vBBAq+syrE/LWS0bw1D/JOu4lwzDbEb6Mz13tK+g==",
"dev": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/unist-util-visit/node_modules/unist-util-visit-parents": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz",
"integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==",
"dev": true,
"dependencies": {
"@types/unist": "^2.0.0",
"unist-util-is": "^5.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/vfile": { "node_modules/vfile": {
"version": "4.2.1", "version": "4.2.1",
"resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz",
@ -1210,6 +1368,12 @@
"ms": "2.1.2" "ms": "2.1.2"
} }
}, },
"escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true
},
"extend": { "extend": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@ -1258,9 +1422,9 @@
"dev": true "dev": true
}, },
"hast-util-raw": { "hast-util-raw": {
"version": "6.0.2", "version": "6.1.0",
"resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-6.0.2.tgz", "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-6.1.0.tgz",
"integrity": "sha512-m7IlmqO8cytmG3EIMDMXUG8LjO2uyApWcxwL6apsGvikIClgykFg3UYps4rnt4kUpY3j8Mc7ANJ8zW6KPPLb+w==", "integrity": "sha512-5FoZLDHBpka20OlZZ4I/+RBw5piVQ8iI1doEvffQhx5CbCyTtP8UCq8Tw6NmTAMtXgsQxmhW7Ly8OdFre5/YMQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/hast": "^2.0.0", "@types/hast": "^2.0.0",
@ -1269,10 +1433,24 @@
"html-void-elements": "^1.0.0", "html-void-elements": "^1.0.0",
"parse5": "^6.0.0", "parse5": "^6.0.0",
"unist-util-position": "^3.0.0", "unist-util-position": "^3.0.0",
"unist-util-visit": "^2.0.0",
"vfile": "^4.0.0", "vfile": "^4.0.0",
"web-namespaces": "^1.0.0", "web-namespaces": "^1.0.0",
"xtend": "^4.0.0", "xtend": "^4.0.0",
"zwitch": "^1.0.0" "zwitch": "^1.0.0"
},
"dependencies": {
"unist-util-visit": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz",
"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==",
"dev": true,
"requires": {
"@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0",
"unist-util-visit-parents": "^3.0.0"
}
}
} }
}, },
"hast-util-sanitize": { "hast-util-sanitize": {
@ -1285,9 +1463,9 @@
} }
}, },
"hast-util-to-html": { "hast-util-to-html": {
"version": "7.1.2", "version": "7.1.3",
"resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-7.1.2.tgz", "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-7.1.3.tgz",
"integrity": "sha512-pu73bvORzdF6XZgwl9eID/0RjBb/jtRfoGRRSykpR1+o9rCdiAHpgkSukZsQBRlIqMg6ylAcd7F0F7myJUb09Q==", "integrity": "sha512-yk2+1p3EJTEE9ZEUkgHsUSVhIpCsL/bvT8E5GzmWc+N1Po5gBw+0F8bo7dpxXR0nu0bQVxVZGX2lBGF21CmeDw==",
"dev": true, "dev": true,
"requires": { "requires": {
"ccount": "^1.0.0", "ccount": "^1.0.0",
@ -1335,9 +1513,9 @@
} }
}, },
"highlight.js": { "highlight.js": {
"version": "10.5.0", "version": "10.7.3",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.5.0.tgz", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz",
"integrity": "sha512-xTmvd9HiIHR6L53TMC7TKolEj65zG1XU+Onr8oi86mYa+nLcIbxTTWkpW7CsEwv/vK7u1zb8alZIMLDqqN6KTw==", "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==",
"dev": true "dev": true
}, },
"html-void-elements": { "html-void-elements": {
@ -1393,9 +1571,9 @@
"dev": true "dev": true
}, },
"js-yaml": { "js-yaml": {
"version": "4.0.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true, "dev": true,
"requires": { "requires": {
"argparse": "^2.0.1" "argparse": "^2.0.1"
@ -1423,12 +1601,36 @@
"dev": true, "dev": true,
"requires": { "requires": {
"unist-util-visit": "^2.0.0" "unist-util-visit": "^2.0.0"
},
"dependencies": {
"unist-util-visit": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz",
"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==",
"dev": true,
"requires": {
"@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0",
"unist-util-visit-parents": "^3.0.0"
}
}
}
},
"mdast-util-find-and-replace": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-1.1.1.tgz",
"integrity": "sha512-9cKl33Y21lyckGzpSmEQnIDjEfeeWelN5s1kUW1LwdB0Fkuq2u+4GdqcGEygYxJE8GVqCl0741bYXHgamfWAZA==",
"dev": true,
"requires": {
"escape-string-regexp": "^4.0.0",
"unist-util-is": "^4.0.0",
"unist-util-visit-parents": "^3.0.0"
} }
}, },
"mdast-util-from-markdown": { "mdast-util-from-markdown": {
"version": "0.8.4", "version": "0.8.5",
"resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.4.tgz", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz",
"integrity": "sha512-jj891B5pV2r63n2kBTFh8cRI2uR9LQHsXG1zSDqfhXkIlDzrTcIlbB5+5aaYEkl8vOPIOPLf8VT7Ere1wWTMdw==", "integrity": "sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/mdast": "^3.0.0", "@types/mdast": "^3.0.0",
@ -1439,9 +1641,9 @@
} }
}, },
"mdast-util-gfm": { "mdast-util-gfm": {
"version": "0.1.1", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.1.tgz", "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.2.tgz",
"integrity": "sha512-oE1W1zSXU2L2LHg91V22HC3Z1fbsOZTBYUQq+kpM29f9297TbRm0C1l3bQ88RREl0WaUQaB49G7trvwy5utUKQ==", "integrity": "sha512-NNkhDx/qYcuOWB7xHUGWZYVXvjPFFd6afg6/e2g+SV4r9q5XUcCbV4Wfa3DLYIiD+xAEZc6K4MGaE/m0KDcPwQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"mdast-util-gfm-autolink-literal": "^0.1.0", "mdast-util-gfm-autolink-literal": "^0.1.0",
@ -1452,10 +1654,15 @@
} }
}, },
"mdast-util-gfm-autolink-literal": { "mdast-util-gfm-autolink-literal": {
"version": "0.1.2", "version": "0.1.3",
"resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.2.tgz", "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.3.tgz",
"integrity": "sha512-WFeIrcNNsfBety0gyWuiBIPing9UkVcl/m2iZOyW1uHEH2evjFocet2h77M24ub0WyZ4ucnQn/jWhO5Ozl6j4g==", "integrity": "sha512-GjmLjWrXg1wqMIO9+ZsRik/s7PLwTaeCHVB7vRxUwLntZc8mzmTsLVr6HW1yLokcnhfURsn5zmSVdi3/xWWu1A==",
"dev": true "dev": true,
"requires": {
"ccount": "^1.0.0",
"mdast-util-find-and-replace": "^1.1.0",
"micromark": "^2.11.3"
}
}, },
"mdast-util-gfm-strikethrough": { "mdast-util-gfm-strikethrough": {
"version": "0.2.3", "version": "0.2.3",
@ -1486,9 +1693,9 @@
} }
}, },
"mdast-util-to-hast": { "mdast-util-to-hast": {
"version": "10.1.1", "version": "10.2.0",
"resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.1.1.tgz", "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.2.0.tgz",
"integrity": "sha512-+hvJrYiUgK2aY0Q1h1LaHQ4h0P7VVumWdAcUuG9k49lYglyU9GtTrA4O8hMh5gRnyT22wC15takM2qrrlpvNxQ==", "integrity": "sha512-JoPBfJ3gBnHZ18icCwHR50orC9kNH81tiR1gs01D8Q5YpV6adHNO9nKNuFBCJQ941/32PT1a63UF/DitmS3amQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/mdast": "^3.0.0", "@types/mdast": "^3.0.0",
@ -1499,12 +1706,25 @@
"unist-util-generated": "^1.0.0", "unist-util-generated": "^1.0.0",
"unist-util-position": "^3.0.0", "unist-util-position": "^3.0.0",
"unist-util-visit": "^2.0.0" "unist-util-visit": "^2.0.0"
},
"dependencies": {
"unist-util-visit": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz",
"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==",
"dev": true,
"requires": {
"@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0",
"unist-util-visit-parents": "^3.0.0"
}
}
} }
}, },
"mdast-util-to-markdown": { "mdast-util-to-markdown": {
"version": "0.6.2", "version": "0.6.5",
"resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.2.tgz", "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz",
"integrity": "sha512-iRczns6WMvu0hUw02LXsPDJshBIwtUPbvHBWo19IQeU0YqmzlA8Pd30U8V7uiI0VPkxzS7A/NXBXH6u+HS87Zg==", "integrity": "sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/unist": "^2.0.0", "@types/unist": "^2.0.0",
@ -1528,9 +1748,9 @@
"dev": true "dev": true
}, },
"micromark": { "micromark": {
"version": "2.11.2", "version": "2.11.4",
"resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.2.tgz", "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz",
"integrity": "sha512-IXuP76p2uj8uMg4FQc1cRE7lPCLsfAXuEfdjtdO55VRiFO1asrCSQ5g43NmPqFtRwzEnEhafRVzn2jg0UiKArQ==", "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==",
"dev": true, "dev": true,
"requires": { "requires": {
"debug": "^4.0.0", "debug": "^4.0.0",
@ -1538,41 +1758,41 @@
} }
}, },
"micromark-extension-gfm": { "micromark-extension-gfm": {
"version": "0.3.2", "version": "0.3.3",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.2.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.3.tgz",
"integrity": "sha512-ToQEpLkRgg7Tp8D3GM/SjZFPV0cCwWNxZmoEVIOQivOswRtPg7gg2WlCrtHhUWFNX+DgDjbq0iLOPGp4Y15oug==", "integrity": "sha512-oVN4zv5/tAIA+l3GbMi7lWeYpJ14oQyJ3uEim20ktYFAcfX1x3LNlFGGlmrZHt7u9YlKExmyJdDGaTt6cMSR/A==",
"dev": true, "dev": true,
"requires": { "requires": {
"micromark": "~2.11.0", "micromark": "~2.11.0",
"micromark-extension-gfm-autolink-literal": "~0.5.0", "micromark-extension-gfm-autolink-literal": "~0.5.0",
"micromark-extension-gfm-strikethrough": "~0.6.0", "micromark-extension-gfm-strikethrough": "~0.6.5",
"micromark-extension-gfm-table": "~0.4.0", "micromark-extension-gfm-table": "~0.4.0",
"micromark-extension-gfm-tagfilter": "~0.3.0", "micromark-extension-gfm-tagfilter": "~0.3.0",
"micromark-extension-gfm-task-list-item": "~0.3.0" "micromark-extension-gfm-task-list-item": "~0.3.0"
} }
}, },
"micromark-extension-gfm-autolink-literal": { "micromark-extension-gfm-autolink-literal": {
"version": "0.5.4", "version": "0.5.7",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.4.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.7.tgz",
"integrity": "sha512-471VKd4k3SiX7vx9fC+IYeGQL0RnxwBBXeEc5WConb7naJDG5m16guA+VoFzyXchrvmU08t0dUWWPZ0mkJSXVw==", "integrity": "sha512-ePiDGH0/lhcngCe8FtH4ARFoxKTUelMp4L7Gg2pujYD5CSMb9PbblnyL+AAMud/SNMyusbS2XDSiPIRcQoNFAw==",
"dev": true, "dev": true,
"requires": { "requires": {
"micromark": "~2.11.0" "micromark": "~2.11.3"
} }
}, },
"micromark-extension-gfm-strikethrough": { "micromark-extension-gfm-strikethrough": {
"version": "0.6.3", "version": "0.6.5",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.3.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.5.tgz",
"integrity": "sha512-MKMoP9x2dsr1aeX46ibBwVf4Q6nJsi5aaUFTOMOID5VOLSxwl4CrqUV4OGFQd6AqhtzBJAxaV+N2trlTBtZDNQ==", "integrity": "sha512-PpOKlgokpQRwUesRwWEp+fHjGGkZEejj83k9gU5iXCbDG+XBA92BqnRKYJdfqfkrRcZRgGuPuXb7DaK/DmxOhw==",
"dev": true, "dev": true,
"requires": { "requires": {
"micromark": "~2.11.0" "micromark": "~2.11.0"
} }
}, },
"micromark-extension-gfm-table": { "micromark-extension-gfm-table": {
"version": "0.4.2", "version": "0.4.3",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.2.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.3.tgz",
"integrity": "sha512-AAzmj85XO1ydHYX0Lz52HGhcH2sZLm2AVvkwzELXWgZF6vGdq5yZ3CTByFRsqNUPyQBSIYFKLDAtc6KlnO42aw==", "integrity": "sha512-hVGvESPq0fk6ALWtomcwmgLvH8ZSVpcPjzi0AjPclB9FsVRgMtGZkUcpE0zgjOCFAznKepF4z3hX8z6e3HODdA==",
"dev": true, "dev": true,
"requires": { "requires": {
"micromark": "~2.11.0" "micromark": "~2.11.0"
@ -1599,12 +1819,6 @@
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true "dev": true
}, },
"not": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/not/-/not-0.1.0.tgz",
"integrity": "sha1-yWkcF0bFXc++VMvYvU/wQbwrUZ0=",
"dev": true
},
"nth-check": { "nth-check": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz",
@ -1644,12 +1858,12 @@
} }
}, },
"rehype-raw": { "rehype-raw": {
"version": "5.0.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-5.0.0.tgz", "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-5.1.0.tgz",
"integrity": "sha512-q/MOBj4fs1WF/LSCh5uOtNhnm5OESuDcSvq1mDQP4/2t6Q52E9MHeVoLeMy9vOn93BEcgVBm4FCokcK2iXRDvA==", "integrity": "sha512-MDvHAb/5mUnif2R+0IPCYJU8WjHa9UzGtM/F4AVy5GixPlDZ1z3HacYy4xojDU+uBa+0X/3PIfyQI26/2ljJNA==",
"dev": true, "dev": true,
"requires": { "requires": {
"hast-util-raw": "^6.0.0" "hast-util-raw": "^6.1.0"
} }
}, },
"rehype-stringify": { "rehype-stringify": {
@ -1692,12 +1906,12 @@
} }
}, },
"remark-rehype": { "remark-rehype": {
"version": "8.0.0", "version": "8.1.0",
"resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-8.0.0.tgz", "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-8.1.0.tgz",
"integrity": "sha512-gVvOH02TMFqXOWoL6iXU7NXMsDJguNkNuMrzfkQeA4V6WCyHQnOKptn+IQBVVPuIH2sMJBwo8hlrmtn1MLTh9w==", "integrity": "sha512-EbCu9kHgAxKmW1yEYjx3QafMyGY3q8noUbNUI5xyKbaFP89wbhDrKxyIQNukNYthzjNHZu6J7hwFg7hRm1svYA==",
"dev": true, "dev": true,
"requires": { "requires": {
"mdast-util-to-hast": "^10.0.0" "mdast-util-to-hast": "^10.2.0"
} }
}, },
"repeat-string": { "repeat-string": {
@ -1733,13 +1947,46 @@
} }
}, },
"to-vfile": { "to-vfile": {
"version": "6.1.0", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-6.1.0.tgz", "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-7.1.0.tgz",
"integrity": "sha512-BxX8EkCxOAZe+D/ToHdDsJcVI4HqQfmw0tCkp31zf3dNP/XWIAjU4CmeuSwsSoOzOTqHPOL0KUzyZqJplkD0Qw==", "integrity": "sha512-t1c42ASuWo39ddjh2R+hX5+kbDcc2CmbhaTSJkVavDYMjnFkpq0L4LeF+rcPoDdieGUsFaivSSkmwuFpYzhBZw==",
"dev": true, "dev": true,
"requires": { "requires": {
"is-buffer": "^2.0.0", "is-buffer": "^2.0.0",
"vfile": "^4.0.0" "vfile": "^5.0.0"
},
"dependencies": {
"unist-util-stringify-position": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz",
"integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==",
"dev": true,
"requires": {
"@types/unist": "^2.0.0"
}
},
"vfile": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/vfile/-/vfile-5.0.1.tgz",
"integrity": "sha512-lbcf0k66x96Syy36HG+nIBFaSD/fAk589q4nETZTr0JW7eRRmrVo1vHwbD8NlHszUM5ICtFSWQ5xHC292hYZ/w==",
"dev": true,
"requires": {
"@types/unist": "^2.0.0",
"is-buffer": "^2.0.0",
"unist-util-stringify-position": "^3.0.0",
"vfile-message": "^3.0.0"
}
},
"vfile-message": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.0.1.tgz",
"integrity": "sha512-gYmSHcZZUEtYpTmaWaFJwsuUD70/rTY4v09COp8TGtOkix6gGxb/a8iTQByIY9ciTk9GwAwIXd/J9OPfM4Bvaw==",
"dev": true,
"requires": {
"@types/unist": "^2.0.0",
"unist-util-stringify-position": "^3.0.0"
}
}
} }
}, },
"trough": { "trough": {
@ -1749,9 +1996,9 @@
"dev": true "dev": true
}, },
"unified": { "unified": {
"version": "9.2.0", "version": "9.2.1",
"resolved": "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz", "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.1.tgz",
"integrity": "sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg==", "integrity": "sha512-juWjuI8Z4xFg8pJbnEZ41b5xjGUWGHqXALmBZ3FC3WX0PIx1CZBIIJ6mXbYMcf6Yw4Fi0rFUTA1cdz/BglbOhA==",
"dev": true, "dev": true,
"requires": { "requires": {
"bail": "^1.0.0", "bail": "^1.0.0",
@ -1775,9 +2022,9 @@
"dev": true "dev": true
}, },
"unist-util-is": { "unist-util-is": {
"version": "4.0.4", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.4.tgz", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz",
"integrity": "sha512-3dF39j/u423v4BBQrk1AQ2Ve1FxY5W3JKwXxVFzBODQ6WEvccguhgp802qQLKSnxPODE6WuRZtV+ohlUg4meBA==", "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==",
"dev": true "dev": true
}, },
"unist-util-position": { "unist-util-position": {
@ -1787,16 +2034,29 @@
"dev": true "dev": true
}, },
"unist-util-select": { "unist-util-select": {
"version": "3.0.4", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/unist-util-select/-/unist-util-select-3.0.4.tgz", "resolved": "https://registry.npmjs.org/unist-util-select/-/unist-util-select-4.0.0.tgz",
"integrity": "sha512-xf1zCu4okgPqGLdhCDpRnjwBNyv3EqjiXRUbz2SdK1+qnLMB7uXXajfzuBvvbHoQ+JLyp4AEbFCGndmc6S72sw==", "integrity": "sha512-UJsER0ubbBy8KR+5zZpcF/9/aApWOzjNqfseMjcw1h0wAUqbxAf56mMewspAqXtGKiwBylnYB+PbD/XqwcYrWg==",
"dev": true, "dev": true,
"requires": { "requires": {
"css-selector-parser": "^1.0.0", "css-selector-parser": "^1.0.0",
"not": "^0.1.0",
"nth-check": "^2.0.0", "nth-check": "^2.0.0",
"unist-util-is": "^4.0.0", "unist-util-is": "^5.0.0",
"zwitch": "^1.0.0" "zwitch": "^2.0.0"
},
"dependencies": {
"unist-util-is": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.0.tgz",
"integrity": "sha512-pWspZ+AvTqYbC+xWeRmzGqbcY8Na08Eowlfs2xchWTYot8vBBAq+syrE/LWS0bw1D/JOu4lwzDbEb6Mz13tK+g==",
"dev": true
},
"zwitch": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.2.tgz",
"integrity": "sha512-JZxotl7SxAJH0j7dN4pxsTV6ZLXoLdGME+PsjkL/DaBrVryK9kTGq06GfKrwcSOqypP+fdXGoCHE36b99fWVoA==",
"dev": true
}
} }
}, },
"unist-util-stringify-position": { "unist-util-stringify-position": {
@ -1809,14 +2069,32 @@
} }
}, },
"unist-util-visit": { "unist-util-visit": {
"version": "2.0.3", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz",
"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", "integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/unist": "^2.0.0", "@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0", "unist-util-is": "^5.0.0",
"unist-util-visit-parents": "^3.0.0" "unist-util-visit-parents": "^4.0.0"
},
"dependencies": {
"unist-util-is": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.0.tgz",
"integrity": "sha512-pWspZ+AvTqYbC+xWeRmzGqbcY8Na08Eowlfs2xchWTYot8vBBAq+syrE/LWS0bw1D/JOu4lwzDbEb6Mz13tK+g==",
"dev": true
},
"unist-util-visit-parents": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz",
"integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==",
"dev": true,
"requires": {
"@types/unist": "^2.0.0",
"unist-util-is": "^5.0.0"
}
}
} }
}, },
"unist-util-visit-parents": { "unist-util-visit-parents": {

View File

@ -4,21 +4,21 @@
"description": "Internal tool for generating Node.js API docs", "description": "Internal tool for generating Node.js API docs",
"version": "0.0.0", "version": "0.0.0",
"engines": { "engines": {
"node": ">=12.10.0" "node": ">=14.8.0"
}, },
"devDependencies": { "devDependencies": {
"highlight.js": "10.5.0", "highlight.js": "10.7.3",
"js-yaml": "4.0.0", "js-yaml": "4.1.0",
"rehype-raw": "5.0.0", "rehype-raw": "5.1.0",
"rehype-stringify": "8.0.0", "rehype-stringify": "8.0.0",
"remark-gfm": "^1.0.0", "remark-gfm": "^1.0.0",
"remark-html": "13.0.1", "remark-html": "13.0.1",
"remark-parse": "^9.0.0", "remark-parse": "^9.0.0",
"remark-rehype": "8.0.0", "remark-rehype": "8.1.0",
"to-vfile": "6.1.0", "to-vfile": "7.1.0",
"unified": "9.2.0", "unified": "9.2.1",
"unist-util-select": "3.0.4", "unist-util-select": "4.0.0",
"unist-util-visit": "2.0.3" "unist-util-visit": "3.1.0"
}, },
"bin": { "bin": {
"node-doc-generator": "generate.js" "node-doc-generator": "generate.js"

View File

@ -1,28 +1,26 @@
'use strict';
// Build stability table to documentation.html/json/md by generated all.json // Build stability table to documentation.html/json/md by generated all.json
const fs = require('fs'); import fs from 'fs';
const path = require('path');
const unified = require('unified');
const raw = require('rehype-raw');
const markdown = require('remark-parse');
const htmlStringify = require('rehype-stringify');
const gfm = require('remark-gfm');
const remark2rehype = require('remark-rehype');
const visit = require('unist-util-visit');
const source = `${__dirname}/../../out/doc/api`; import raw from 'rehype-raw';
const data = require(path.join(source, 'all.json')); import htmlStringify from 'rehype-stringify';
import gfm from 'remark-gfm';
import markdown from 'remark-parse';
import remark2rehype from 'remark-rehype';
import unified from 'unified';
import { visit } from 'unist-util-visit';
const source = new URL('../../out/doc/api/', import.meta.url);
const data = JSON.parse(fs.readFileSync(new URL('./all.json', source), 'utf8'));
const markBegin = '<!-- STABILITY_OVERVIEW_SLOT_BEGIN -->'; const markBegin = '<!-- STABILITY_OVERVIEW_SLOT_BEGIN -->';
const markEnd = '<!-- STABILITY_OVERVIEW_SLOT_END -->'; const markEnd = '<!-- STABILITY_OVERVIEW_SLOT_END -->';
const mark = `${markBegin}(.*)${markEnd}`; const mark = `${markBegin}(.*)${markEnd}`;
const output = { const output = {
json: path.join(source, 'stability.json'), json: new URL('./stability.json', source),
docHTML: path.join(source, 'documentation.html'), docHTML: new URL('./documentation.html', source),
docJSON: path.join(source, 'documentation.json'), docJSON: new URL('./documentation.json', source),
docMarkdown: path.join(source, 'documentation.md'), docMarkdown: new URL('./documentation.md', source),
}; };
function collectStability(data) { function collectStability(data) {

View File

@ -1,5 +1,3 @@
'use strict';
const jsDocPrefix = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/'; const jsDocPrefix = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/';
const jsDataStructuresUrl = `${jsDocPrefix}Data_structures`; const jsDataStructuresUrl = `${jsDocPrefix}Data_structures`;
@ -175,7 +173,7 @@ const customTypesMap = {
const arrayPart = /(?:\[])+$/; const arrayPart = /(?:\[])+$/;
function toLink(typeInput) { export function toLink(typeInput) {
const typeLinks = []; const typeLinks = [];
typeInput = typeInput.replace('{', '').replace('}', ''); typeInput = typeInput.replace('{', '').replace('}', '');
const typeTexts = typeInput.split('|'); const typeTexts = typeInput.split('|');
@ -216,5 +214,3 @@ function toLink(typeInput) {
return typeLinks.length ? typeLinks.join(' | ') : typeInput; return typeLinks.length ? typeLinks.join(' | ') : typeInput;
} }
module.exports = { toLink };

View File

@ -1,18 +1,16 @@
'use strict'; import { readFileSync, writeFileSync } from 'fs';
import https from 'https';
const { readFileSync, writeFileSync } = require('fs'); const srcRoot = new URL('../../', import.meta.url);
const path = require('path');
const srcRoot = path.join(__dirname, '..', '..');
const isRelease = () => { const isRelease = () => {
const re = /#define NODE_VERSION_IS_RELEASE 0/; const re = /#define NODE_VERSION_IS_RELEASE 0/;
const file = path.join(srcRoot, 'src', 'node_version.h'); const file = new URL('./src/node_version.h', srcRoot);
return !re.test(readFileSync(file, { encoding: 'utf8' })); return !re.test(readFileSync(file, { encoding: 'utf8' }));
}; };
const getUrl = (url) => { const getUrl = (url) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const https = require('https');
const request = https.get(url, { timeout: 30000 }, (response) => { const request = https.get(url, { timeout: 30000 }, (response) => {
if (response.statusCode !== 200) { if (response.statusCode !== 200) {
reject(new Error( reject(new Error(
@ -38,7 +36,7 @@ async function versions() {
const url = const url =
'https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.md'; 'https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.md';
let changelog; let changelog;
const file = path.join(srcRoot, 'CHANGELOG.md'); const file = new URL('./CHANGELOG.md', srcRoot);
if (kNoInternet) { if (kNoInternet) {
changelog = readFileSync(file, { encoding: 'utf8' }); changelog = readFileSync(file, { encoding: 'utf8' });
} else { } else {

View File

@ -566,7 +566,7 @@ robocopy /e doc\api %config%\doc\api
robocopy /e doc\api_assets %config%\doc\api\assets robocopy /e doc\api_assets %config%\doc\api\assets
for %%F in (%config%\doc\api\*.md) do ( for %%F in (%config%\doc\api\*.md) do (
%node_exe% tools\doc\generate.js --node-version=v%FULLVERSION% %%F --output-directory=%%~dF%%~pF %node_exe% tools\doc\generate.mjs --node-version=v%FULLVERSION% %%F --output-directory=%%~dF%%~pF
) )
:run :run
@ -583,7 +583,7 @@ for /d %%F in (test\addons\??_*) do (
rd /s /q %%F rd /s /q %%F
) )
:: generate :: generate
"%node_exe%" tools\doc\addon-verify.js "%node_exe%" tools\doc\addon-verify.mjs
if %errorlevel% neq 0 exit /b %errorlevel% if %errorlevel% neq 0 exit /b %errorlevel%
:: building addons :: building addons
setlocal setlocal