Commit Graph

401 Commits

Author SHA1 Message Date
Rich Trott
038608d401 tools: relax max-len lint rule for template strings
Splitting template strings across multiple lines can make them harder to
read.

PR-URL: https://github.com/nodejs/node/pull/38097
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-04-07 04:16:35 -07:00
Richard Lau
cbe3b27166 doc,tools: allow stability table to be updated
Keep markers for the stability table so that it can be updated on
subsequent runs of the doc tooling. Only overwrite the files if
they have been changed.

PR-URL: https://github.com/nodejs/node/pull/38048
Fixes: https://github.com/nodejs/node/issues/37886
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2021-04-06 06:14:44 +02:00
James M Snell
e79471deb7
net: allow net.BlockList to use net.SocketAddress objects
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/37917
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-04-02 06:16:42 -07:00
Antoine du Hamel
e8b1ea4ee2
tools,doc: add "legacy" badge in the TOC
PR-URL: https://github.com/nodejs/node/pull/37949
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-04-01 12:31:25 -07:00
Rich Trott
3700ba0be3 doc,tools: use only one level 1 header per page
Increment the header levels from markdown files when producing HTML
documents. This is both better semantically (as the two h1 headers in
current docs are not actually equivalent level semantically--the second
belongs below/inside the first) and better for accessibility. (It is
valid HTML to have multiple h1 headers in a document, but it can be bad
for screen reader experience.)

PR-URL: https://github.com/nodejs/node/pull/37839
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-03-25 11:23:58 -07:00
Antoine du Hamel
104dac79cc lib: aggregate errors to avoid error swallowing
Uses `AggregateError` if there are more than one error with the message
of the outer error to preserve the current behaviour, or returns the
logical OR comparison of the two parameters.

PR-URL: https://github.com/nodejs/node/pull/37460
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2021-03-19 12:43:03 +01:00
Antoine du Hamel
2e1e74e9f8 tools,doc: add support for several flavors of JS code snippets
Enable code example using both modern ESM syntax and legacy CJS syntax.
It adds a toggle on the web interface to let users switch from one
JavaScript flavor to the other.

PR-URL: https://github.com/nodejs/node/pull/37162
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-03-06 16:13:57 +01:00
Antoine du Hamel
0177d4cc20 doc: optimize HTML rendering
Defer rendering sections of docs until they are displayed on
the user's screen.

PR-URL: https://github.com/nodejs/node/pull/37301
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-15 16:14:15 +01:00
James M Snell
4a19cc8947
perf_hooks: introduce createHistogram
Adds a new `perf_hooks.createHistogram()` API for creating histogram
instances that allow user recording.

Makes Histogram instances cloneable via MessagePort. This allows, for
instance, an event loop delay monitor to be running on the main thread
while the histogram data can be monitored actively from a worker thread.

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/37155
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-02-14 13:03:49 -08:00
Michaël Zasso
5bf2737e13
tools: avoid pending deprecation in doc generator
`unist-util-find` depends on `lodash.iteratee` which uses
`process.binding()`.
Let's remove this dependency which is used in one place to do a very
simple thing.

PR-URL: https://github.com/nodejs/node/pull/37267
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-02-12 21:46:54 +01:00
Rich Trott
683754c6f3 doc: remove TOC summary for pages with no TOC
Remove the table of contents summary for pages with no table of
contents. Currently, this affects at least index.html.

PR-URL: https://github.com/nodejs/node/pull/37043
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-01-31 06:03:33 -08:00
James M Snell
c3d6d50309
quic: remove quic
PR-URL: https://github.com/nodejs/node/pull/37067
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2021-01-30 07:49:28 -08:00
cjihrig
1b222f900e tools: remove commented code from stability.js
PR-URL: https://github.com/nodejs/node/pull/37092
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-29 20:05:25 +08:00
Zijian Liu
2bb42bf156 tools,doc: list the stability status of each API
Fixes: https://github.com/nodejs/node/issues/23723

PR-URL: https://github.com/nodejs/node/pull/36223
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-01-20 01:23:45 +01:00
James M Snell
d4bea09a0a
buffer: introduce Blob
The `Blob` object is an immutable data buffer. This is a first step
towards alignment with the `Blob` Web API.

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36811
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-01-18 13:55:25 -08:00
James M Snell
bd899bc656
crypto: experimental (Ed/X)25519/(Ed/X)448 support
Implements initial experimental support for Curve25519 and
Curve448 support for both ECDH and sign/verify in Web Crypto.

Introduced as a Node.js-specific extension to Web Crypto.

Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: https://github.com/nodejs/node/issues/36076

PR-URL: https://github.com/nodejs/node/pull/36879
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2021-01-18 08:12:08 -08:00
Mattia Pontonio
2ba8728b9f doc: wrap TOC in a <details> tag
PR-URL: https://github.com/nodejs/node/pull/36896
Fixes: https://github.com/nodejs/node/issues/36885
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-01-14 16:35:59 +01:00
Michaël Zasso
9883fe0114
tools: update doc tool dependencies
PR-URL: https://github.com/nodejs/node/pull/36844
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-11 08:13:23 +01:00
James M Snell
f5287a4b7b
crypto: introduce X509Certificate API
Introduces the `crypto.X509Certificate` object.

```js
const { X509Certificate } = require('crypto');

const x509 = new X509Certificate('{pem encoded cert}');
console.log(x509.subject);
```

Fixes: https://github.com/nodejs/node/issues/29181
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36804
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2021-01-09 12:04:23 -08:00
Michaël Zasso
8dbeac6c04 tools: update doc tool dependencies
PR-URL: https://github.com/nodejs/node/pull/36407
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-08 22:17:58 +00:00
James M Snell
9e446b3e9f
worker: add experimental BroadcastChannel
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36271
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-12-01 08:02:28 -08:00
Rich Trott
cb023a3e70 tools: update stability index linking logic
Fix logic that prevents stability index text from linking to itself.

PR-URL: https://github.com/nodejs/node/pull/36280
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-11-30 16:57:48 -08:00
Myles Borins
f34866a61c tools: update highlight.js to 10.1.2
Refs: https://github.com/advisories/GHSA-vfrc-7r7c-w9mx

PR-URL: https://github.com/nodejs/node/pull/36309
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-11-29 20:27:23 -08:00
Rich Trott
6312193391 tools: bump unist-util-find@1.0.1 to unist-util-find@1.0.2
PR-URL: https://github.com/nodejs/node/pull/36106
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-11-20 04:55:54 -08:00
Rich Trott
088af0f98b tools: update doc tools to remark-parse@9.0.0
PR-URL: https://github.com/nodejs/node/pull/36049
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2020-11-12 06:29:51 +00:00
Antoine du Hamel
3c9f072522 tools,doc: enable ecmaVersion 2021 in acorn parser
PR-URL: https://github.com/nodejs/node/pull/35994
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-11-07 01:30:21 +00:00
Stephen Belanger
c6c36c3da7 lib: create diagnostics_channel module
PR-URL: https://github.com/nodejs/node/pull/34895
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2020-10-31 21:24:11 +00:00
Simen Bekkhus
ee85eb9f8a doc: importModuleDynamically gets Script, not Module
PR-URL: https://github.com/nodejs/node/pull/35593
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-10-17 22:13:22 -07:00
Rich Trott
936ce85c0b doc: use sentence case for class property
Change the one instance of the Class Property heading in our docs to
Class property to match style with other headers.

PR-URL: https://github.com/nodejs/node/pull/35540
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-10-09 06:10:16 -07:00
James M Snell
dae283d96f
crypto: refactoring internals, add WebCrypto
Fixes: https://github.com/nodejs/node/issues/678
Refs: https://github.com/nodejs/node/issues/26854

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/35093
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-07 17:27:05 -07:00
Antoine du Hamel
6467d1d4e9 tools: fix typo in error message
PR-URL: https://github.com/nodejs/node/pull/35417
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-04 11:46:39 +02:00
Rich Trott
e9639ee7e8 tools,doc: fix broken link in module.html
Update tools/doc/type-parser.js with correct URL for the
module.SourceMap class. This fixes a broken link in our documentation.

PR-URL: https://github.com/nodejs/node/pull/35446
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-10-03 05:41:50 -07:00
Antoine du Hamel
91837e9fbb tools: check links in api docs
Fixes: https://github.com/nodejs/node/issues/35189

PR-URL: https://github.com/nodejs/node/pull/35191
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-01 06:19:42 -07:00
Antoine du Hamel
ecf5060a42 doc: use .md extension for internal links
This helps catch broken links as part of the test suite. This also
improves the user experience when browsing the markdown files.

PR-URL: https://github.com/nodejs/node/pull/35191
Fixes: https://github.com/nodejs/node/issues/35189
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-01 06:19:12 -07:00
Michaël Zasso
a77f2ea6d4
tools: exclude gyp from markdown link checker
The changelog format used in gyp-next does not comply to the rules.

PR-URL: https://github.com/nodejs/node/pull/35423
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-09-30 17:50:22 +02:00
Ash Cripps
77dd44078e tools: ignore build folder when checking links
We checkout build as a subdirectory as part of CI and
if you run `make test` instead of `make test-ci` you get
loads of errors about markdown link breaks. Ignore this
directory as we don't need to examine another repo

PR-URL: https://github.com/nodejs/node/pull/35315
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-09-24 10:30:59 +00:00
Antoine du Hamel
7794d36a37 tools,doc: enforce alphabetical order for md refs
PR-URL: https://github.com/nodejs/node/pull/35244
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
2020-09-22 10:25:43 -07:00
Antoine du Hamel
0b8fdb70ac tools,doc: upgrade dependencies
PR-URL: https://github.com/nodejs/node/pull/35244
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
2020-09-22 10:25:36 -07:00
Rich Trott
26e660f962 doc: remove problematic auto-linking of curl man pages
The only instance of curl man page linking is in repl.md and it is
explicit. The magic autolinking in html.js creates a superfluous empty
link. Remove it.

Before, two adjacent links generated, with the first one having no text:

```html
<a href="https://curl.haxx.se/docs/manpage.html"></a>
<a href="https://curl.haxx.se/docs/manpage.html"><code>curl(1)</code></a>
```

After, just one link:

```html
<a href="https://curl.haxx.se/docs/manpage.html"><code>curl(1)</code></a>
```

PR-URL: https://github.com/nodejs/node/pull/35174
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-09-15 10:50:09 -07:00
Antoine du HAMEL
fa105ebe7d doc: refactor deprecation anchors
PR-URL: https://github.com/nodejs/node/pull/34955
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-04 08:40:30 -07:00
Antoine du HAMEL
d2c5e89165 tools,doc: allow page titles to contain inline code
Previously the HTML title would be cut to the first text node only.

PR-URL: https://github.com/nodejs/node/pull/35003
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2020-09-03 06:36:03 -07:00
Antoine du Hamel
79ea22a531
tools,doc: fix global table of content active element
Assign active class to the correct HTML element when one nav-id is a
subset of another one (E.G.: `nav-module` and `nav-modules`).

Fixes: https://github.com/nodejs/node/issues/34975

PR-URL: https://github.com/nodejs/node/pull/34976
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-09-03 04:53:31 -04:00
Rich Trott
cc9ac42111 doc,tools: remove malfunctioning Linux manpage linker
The Linux manpage auto-linking is resulting in extraneous
links with empty text in the docs. Remove it as the only thing it
affects is linked explicitly in the one document that uses it.

PR-URL: https://github.com/nodejs/node/pull/34985
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
2020-09-02 07:55:43 -07:00
Rich Trott
4332f73832 tools,doc: remove "toc" anchor name
The _name_ attribute is obsolete. Changing it to _id_ in the case of
"toc" would result in a conflict with an existing id. However, there are
no links to "#toc" in our docs. And if there were, it would be more
appropriate to link to the id toc which is the toc for the individual
documents. So remove the anchor name entirely.

PR-URL: https://github.com/nodejs/node/pull/34893
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-08-26 07:31:45 -07:00
Antoine du HAMEL
21abb2545f doc: move module core module doc to separate page
The `module` core module is available for both CJS and ESM users, it
deserves its own page.

PR-URL: https://github.com/nodejs/node/pull/34747
Refs: https://github.com/nodejs/modules/issues/539
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-08-19 10:44:06 -07:00
Richard Lau
9a819ddbac doc,tools: annotate broken links in actions workflow
Change format of logged messages when run on GitHub Actions (i.e.
when the `GITHUB_ACTIONS` environment variable is true) so that
broken links are highlighted inline in pull requests.

Signed-off-by: Richard Lau <riclau@uk.ibm.com>

PR-URL: https://github.com/nodejs/node/pull/34810
Refs: https://github.com/nodejs/node/issues/34787
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-08-19 10:42:36 -07:00
James M Snell
1c14810edc src: allow instances of net.BlockList to be created internally
Initial PR had it so that user code would create BlockList
instances. This sets it up so that instances can be created
internally by Node.js

PR-URL: https://github.com/nodejs/node/pull/34741
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-08-17 11:31:26 -07:00
Rich Trott
6f12643142 doc: use _Static method_ instead of _Class Method_
Our docs describe static methods as Class Methods which seems
idiosyncratic for JavaScript. Align with MDN which calls them static
methods.

Refs: https://developer.mozilla.org/en-US/docs/MDN/Contribute/Structures/API_references/What_does_an_API_reference_need

JSON format for our docs will still use the key name `classMethods` for
this. I would like to change it to `staticMethods` but I don't know if
that will break things for consumers. So, leaving it alone. It's a
machine-consumable label more than a human-readable so I can live with
that.

PR-URL: https://github.com/nodejs/node/pull/34659
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-08-09 07:02:28 -07:00
Francisco Ryan Tolmasky I
fa2e460d0c
doc,tools: syntax highlight api docs at compile-time
Prior to this commit, API docs would be highlighted after the page
loaded using `highlightjs`. This commit still uses `highlightjs`, but
runs the generation during the compilation of the documentation, making
it so no script needs to load on the client. This results in a faster
load, as well as allowing the pages to fully functional even when
JavaScript is turned off.

PR-URL: https://github.com/nodejs/node/pull/34148
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-16 00:22:35 +02:00
Alec Davidson
e68563e31c
doc: add dynamic source code links
Fixes: https://github.com/nodejs/node/pull/33977

PR-URL: https://github.com/nodejs/node/pull/33996
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-26 10:25:14 -07:00
Rich Trott
d408ee1be3 tools: remove superfluous regex in tools/doc/json.js
Remove noCallOrProp from tools/doc/json.js. It is a negative lookahead
that is only used in one regex where it is placed immediately before a
terminating $, thus rendering it meaningless.

PR-URL: https://github.com/nodejs/node/pull/33998
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jamie Davis <davisjam@vt.edu>
2020-06-23 15:31:39 -07:00
James M Snell
55360443ce
quic: initial QUIC implementation
Co-authored-by: Anna Henningsen <anna@addaleax.net>
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
Co-authored-by: gengjiawen <technicalcute@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
Co-authored-by: Lucas Pardue <lucaspardue.24.7@gmail.com>
Co-authored-by: Ouyang Yadong <oyydoibh@gmail.com>
Co-authored-by: Juan Jos<C3><A9> Arboleda <soyjuanarbol@gmail.com>
Co-authored-by: Trivikram Kamat <trivikr.dev@gmail.com>
Co-authored-by: Denys Otrishko <shishugi@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32379
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-16 09:23:34 -07:00
cjihrig
862d005e60
doc: make globals Extends usage consistent
The docs use `* Extends: {type}` to define inheritance. This
commit updates the globals documentation to be consistent.

PR-URL: https://github.com/nodejs/node/pull/33777
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-06-08 21:25:26 -04:00
cjihrig
85dbd17bde
doc: make perf_hooks Extends usage consistent
The docs use `* Extends: {type}` to define inheritance. This
commit updates the perf_hooks documentation to be consistent.

PR-URL: https://github.com/nodejs/node/pull/33777
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-06-08 21:25:25 -04:00
cjihrig
2e49010bc8
doc: make events Extends usage consistent
The docs use `* Extends: {type}` to define inheritance. This
commit updates the events documentation to be consistent.

PR-URL: https://github.com/nodejs/node/pull/33777
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-06-08 21:25:25 -04:00
James M Snell
74ca960aac
lib: initial experimental AbortController implementation
AbortController impl based very closely on:
 https://github.com/mysticatea/abort-controller

Marked experimental.
Not currently used by any of the existing promise apis.

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/33527
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-05 12:21:47 -07:00
Derek Lewis
e2d3230565 doc: normalize Markdown code block info strings
Prior to this commit, Markdown fenced code blocks in Markdown
files had inconsistent info strings. This has been corrected to
standardize on the one shown in the CommonMark spec.

Refs: 1103710025/spec.txt (L131)

PR-URL: https://github.com/nodejs/node/pull/33542
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-05-30 04:27:31 +02:00
James M Snell
785842a053 events: initial implementation of experimental EventTarget
See documentation changes for details

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/33556
Refs: https://github.com/nodejs/node/pull/33527
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2020-05-28 06:31:58 -07:00
Joyee Cheung
8b0bdc918e
doc: clarify about the Node.js-only extensions in perf_hooks
- Add clarifications for Node.js-only extensions
- Explain the Web Performance APIs implemented in Node.js and
  clarify that perf_hooks also include other non-Web APIs.
- Prefix exposed interfaces with `perf_hooks.` to distinguish
  them from internal classes.

PR-URL: https://github.com/nodejs/node/pull/33199
Refs: https://github.com/nodejs/node/issues/28635
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-19 22:16:10 +08:00
Luigi Pinca
b533fb3508 tools: enable no-else-return lint rule
Refs: https://github.com/nodejs/node/pull/32644
Refs: https://github.com/nodejs/node/pull/32662

PR-URL: https://github.com/nodejs/node/pull/32667
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-05-16 06:42:16 +02:00
Matteo Collina
2d5d77306f Revert "vm: add importModuleDynamically option to compileFunction"
This reverts commit 74c393dd93.

Fixes: https://github.com/nodejs/node/issues/33166

PR-URL: https://github.com/nodejs/node/pull/33364
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-05-15 12:14:35 +02:00
rickyes
be7fd2d517
fs: add .ref() and .unref() methods to watcher classes
PR-URL: https://github.com/nodejs/node/pull/33134
Fixes: https://github.com/nodejs/node/issues/33096
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-05-09 07:59:08 +02:00
Ben Noordhuis
042c7496b2
doc: don't check links in tmp dirs
PR-URL: https://github.com/nodejs/node/pull/32996
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-04-29 03:54:34 +02:00
cjihrig
9037ad3e78
tools: update broken types in type parser
The links for the ArrayBufferView and WebAssembly.Instance types
appear to be broken. This commit updates them to point to the
correct MDN locations.

PR-URL: https://github.com/nodejs/node/pull/33068
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-28 13:01:47 -04:00
Gus Caplan
74c393dd93
vm: add importModuleDynamically option to compileFunction
Fixes: https://github.com/nodejs/node/issues/31860

PR-URL: https://github.com/nodejs/node/pull/32985
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-04-25 09:49:53 -05:00
Rich Trott
5315304e71 tools: remove unused code in doc generation tool
tools/doc/html.js includes code that looks for comments with
`start-include` and `end-include` for file inclusion. This seems to be
legacy code that is no longer used. The code only appears in the
table-of-contents generation function. The strings `start-include` and
`end-include` appear nowhere else in our tools and nowhere at all in our
docs.

PR-URL: https://github.com/nodejs/node/pull/32913
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-23 09:12:46 -07:00
Alba Mendez
882b61a7ee doc: fix more links
Fix broken links found by the checker, and exclude
test/fixtures as it contains invalid links.

Also exclude doc/changelogs because they're huge files
which take very long to parse, and (IIRC) are auto-generated
anyway.

(Oh and also a nit at the README next to my link)

PR-URL: https://github.com/nodejs/node/pull/32586
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-02 23:36:34 +02:00
Alba Mendez
77f9e0c814 doc: improve markdown link checker
- Test link definitions too
- Report all broken links in a file, not just the first one
- Avoid use of workers (launching ~90 workers has substantial
  overhead, and in my 4-core machine it is slower than not using
  them at all) & other simplifications

Refs: https://github.com/nodejs/node/pull/32359

PR-URL: https://github.com/nodejs/node/pull/32586
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-02 23:36:22 +02:00
Richard Lau
25a1f04cdc
tools: only fetch previous versions when necessary
Refactor the logic for working out the previous versions of Node.js for
the API documentation so that the parsing (including the potential https
get) happens at most once per build (as opposed to the current once per
generated API doc).

Signed-off-by: Richard Lau <riclau@uk.ibm.com>

PR-URL: https://github.com/nodejs/node/pull/32518
Fixes: https://github.com/nodejs/node/issues/32512
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-03-31 18:25:10 -04:00
Antoine du HAMEL
19db0e60bd
doc: tests local links in markdown documents
PR-URL: https://github.com/nodejs/node/pull/32359
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-03-30 10:20:59 +02:00
Rich Trott
b6cd2155c3 doc: remove em dashes
Our documentation uses em dashes inconsistently. They are treated
inconsistently typographically too. (For example, they are sometimes
surrounded by spaces and sometimes not.) They are also often confused
with ordinary hyphens such as in the CHANGELOG, where they are
inadvertently mixed together in a single list. The difference is
not obvious in the raw markdown but is very noticeable when rendered,
appearing to be a typographical error (which it in fact is).

The em dash is never needed. There are always alternatives. Remove em
dashes entirely.

PR-URL: https://github.com/nodejs/node/pull/32080
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-03-05 22:25:42 -08:00
Joyee Cheung
914d800a23
tools: add NODE_TEST_NO_INTERNET to the doc builder
At the moment the doc builder tries to access the internet
for CHANGELOG information and only falls back to local sources
after the connection fails or a 5 second timeout. This means
that the doc building could take at least 7 minutes on a
machine with hijacked connection to Github for useless network
attempts. This patch adds a NODE_TEST_NO_INTERNET environment
variable to directly bypass these attempts so that docs can be
built in reasonable time on a machine like that.

PR-URL: https://github.com/nodejs/node/pull/31849
Fixes: https://github.com/nodejs/node/issues/29918
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-02-25 21:24:03 +08:00
Robert Nagy
7b78ff0428 stream: support passing generator functions into pipeline()
PR-URL: https://github.com/nodejs/node/pull/31223
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-01-17 16:50:07 -08:00
bcoe
521b2224c3
module: add API for interacting with source maps
PR-URL: https://github.com/nodejs/node/pull/31132
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-14 12:39:06 -08:00
Rich Trott
be46a7257b tools: update JSON header parsing for backticks
Methods, events, and so on in headers in our documentation may (and
should) be set off with backticks in the raw markdown. When that
happens, the headers is misinterpreted by tools/json.js as not being a
method or event. Update the JSON tool generator to accommodate backticks
in this situation and add a test for this situation.

Fixes: https://github.com/nodejs/node/issues/31290

PR-URL: https://github.com/nodejs/node/pull/31294
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-01-12 07:10:33 -08:00
Marek Łabuz
62c61b754d
tools: add unified plugin changing links for html docs
This commit introduces additional stage in the process of generating
html docs from markdown files. Plugin transforms links to *.md files
in the respository to links to *.html files in the online documentation.

Fixes: https://github.com/nodejs/node/issues/28689

PR-URL: https://github.com/nodejs/node/pull/29946
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-11-30 18:17:56 +01:00
cjihrig
09b1228c3a
wasi: introduce initial WASI support
Co-authored-by: Gus Caplan <me@gus.host>
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
Co-authored-by: Jiawen Geng <technicalcute@gmail.com>
Co-authored-by: Tobias Nießen <tniessen@tnie.de>
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/30258
Refs: https://github.com/nodejs/node/pull/27850
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2019-11-30 18:06:39 +01:00
Richard Lau
3b124e0a73
tools: make doctool work if no internet available
Allow doctool to fallback to use local files if not building a release
build.

PR-URL: https://github.com/nodejs/node/pull/30214
Fixes: https://github.com/nodejs/node/issues/29918
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2019-11-05 22:10:33 -05:00
tpoisseau
f035f557d7
tools: doc: improve async workflow of generate.js
Use fs.promises for read and write file
Use unified().process wich is async instead processSync
html and json are write in parallel
errors are logged and exit process with `1` code

Fixes: https://github.com/nodejs/node/issues/30090

PR-URL: https://github.com/nodejs/node/pull/30106
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2019-10-27 10:08:22 +01:00
Rich Trott
f4f856b238 test: fix flaky doctool and test
Doctool tests have been failing a lot in CI on Win2008 R2. It appears
async functions and callback-based functions are being used in
combination such that the callback-based function cannot guarantee that
it will invoke its callback. Convert the callback-based functions to
async functions so we have one paradigm and reliable results.

PR-URL: https://github.com/nodejs/node/pull/29979
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-10-15 13:22:41 -07:00
Gus Caplan
f9caee986c vm: add Synthetic modules
- Refactor vm.SourceTextModule (again)
- Add vm.Module abstract superclass
- Add vm.SyntheticModule

Refs: https://heycam.github.io/webidl/#synthetic-module-records

PR-URL: https://github.com/nodejs/node/pull/29864
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2019-10-14 14:25:38 -07:00
Jeremiah Senkpiel
cbd8d715b2 fs: introduce opendir() and fs.Dir
This adds long-requested methods for asynchronously interacting and
iterating through directory entries by using `uv_fs_opendir`,
`uv_fs_readdir`, and `uv_fs_closedir`.

`fs.opendir()` and friends return an `fs.Dir`, which contains methods
for doing reads and cleanup. `fs.Dir` also has the async iterator
symbol exposed.

The `read()` method and friends only return `fs.Dirent`s for this API.
Having a entry type or doing a `stat` call is deemed to be necessary in
the majority of cases, so just returning dirents seems like the logical
choice for a new api.

Reading when there are no more entries returns `null` instead of a
dirent. However the async iterator hides that (and does automatic
cleanup).

The code lives in separate files from the rest of fs, this is done
partially to prevent over-pollution of those (already very large)
files, but also in the case of js allows loading into `fsPromises`.

Due to async_hooks, this introduces a new handle type of `DIRHANDLE`.

This PR does not attempt to make complete optimization of
this feature. Notable future improvements include:
- Moving promise work into C++ land like FileHandle.
- Possibly adding `readv()` to do multi-entry directory reads.
- Aliasing `fs.readdir` to `fs.scandir` and doing a deprecation.

Refs: https://github.com/nodejs/node-v0.x-archive/issues/388
Refs: https://github.com/nodejs/node/issues/583
Refs: https://github.com/libuv/libuv/pull/2057

PR-URL: https://github.com/nodejs/node/pull/29349
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
2019-10-08 10:34:48 -07:00
exoego
03b7a5a4bf doc: fix return type for crypto.createDiffieHellmanGroup()
PR-URL: https://github.com/nodejs/node/pull/29696
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-10-03 19:43:47 -07:00
Rich Trott
210b930c74 doc: prepare markdown files for more stringent blank-line linting
PR-URL: https://github.com/nodejs/node/pull/29447
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-09-07 07:07:25 -07:00
Kamat, Trivikram
c746ba4982 doc,crypto: add extends for derived classes
PR-URL: https://github.com/nodejs/node/pull/29302
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-08-29 15:19:06 -07:00
Kamat, Trivikram
5c9209bc4d doc,errors: add extends to derived classes
PR-URL: https://github.com/nodejs/node/pull/29303
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-08-26 18:49:41 -07:00
Anas Aboureada
e4bbbcc84b fs: add fs.writev() which exposes syscall writev()
fs with writev allow many buffers to be pushed to underlying OS
APIs in one batch, so this should improve write speed to files.

Refs: https://github.com/nodejs/node/issues/2298

PR-URL: https://github.com/nodejs/node/pull/25925
Fixes: https://github.com/nodejs/node/issues/2298
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-08-16 23:24:02 -07:00
Richard Lau
4ec6135c71 doc,tools: get altDocs versions from CHANGELOG.md
Parse `CHANGELOG.md` for versions of Node.js used by the documentation
feature `View another version` so that we don't have to manually update
the list when we cut a new version or transition a release to LTS.

PR-URL: https://github.com/nodejs/node/pull/27661
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-06-01 10:17:30 +02:00
Rich Trott
2d8367a5c3 tools: update dependencies in tools/doc
This clears warnings from `npm audit`.

PR-URL: https://github.com/nodejs/node/pull/27927
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-05-27 13:35:22 -07:00
Richard Lau
4a18b87a3f doc,tools: updates for 6.x End-of-Life
PR-URL: https://github.com/nodejs/node/pull/27658
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2019-05-14 15:10:19 -07:00
Richard Lau
b8242a26c2 tools: add 12.x to alternative docs versions
PR-URL: https://github.com/nodejs/node/pull/27658
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2019-05-14 15:10:17 -07:00
Rich Trott
e490ac5cbd tools: switch to camelcasing in apilinks.js
Use camelcasing in tools/doc/apilinks.js.

PR-URL: https://github.com/nodejs/node/pull/27607
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-05-09 21:41:03 -07:00
Gerson Niño
964174e339 tools,doc: fix 404 broken links in docs
Change the `linkManPages()` function to catch the `uname` and `curl`
correct websites on the docs page.

PR-URL: https://github.com/nodejs/node/pull/27168
Fixes: https://github.com/nodejs/node/issues/26074
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-04-20 14:52:14 +03:00
Vse Mozhet Byt
1afec97130 doc: link bigint type to MDN instead of proposal
PR-URL: https://github.com/nodejs/node/pull/27101
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-04-07 22:50:35 +03:00
Sam Ruby
cba2c7a874 tools: update to mdast-util-to-hast v3.0.2
See https://github.com/syntax-tree/mdast-util-to-hast/pull/21

Note: I updated all of the tools/doc dependencies, not just this one,
and removed the previous workaround that was in place until this change
landed.

PR-URL: https://github.com/nodejs/node/pull/22140
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-10 10:26:29 -04:00
Ruben Bridgewater
f8763bb077
benchmark,doc,lib,test: capitalize comments
PR-URL: https://github.com/nodejs/node/pull/26483
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-10 00:44:40 +01:00
Rich Trott
5fa642a917 tools: refactor tools JS code
* standardize on arrow functions for callbacks
* standaradize on trailing commas for multiline arrays

PR-URL: https://github.com/nodejs/node/pull/26394
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-04 11:06:23 -08:00
Rich Trott
60a148ad2e tools: update extend to 3.0.2
Update `extend` to 3.0.2 as 3.0.1 is susceptible to a low-severity
security issue.

Refs: https://snyk.io/vuln/npm:extend:20180424

PR-URL: https://github.com/nodejs/node/pull/26392
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-02 18:58:09 -08:00
Vse Mozhet Byt
0a4c69a5c5 doc: fix some nits in perf_hooks
PR-URL: https://github.com/nodejs/node/pull/26022
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-12 05:14:57 +02:00
James M Snell
bcdd228f90
perf_hooks: implement histogram based api
Add a sampling-based event loop delay monitor.

```js
const { monitorEventLoopDelay } = require('perf_hooks');

const h = monitorEventLoopDelay();

h.enable();

h.disable();

console.log(h.percentiles);
console.log(h.min);
console.log(h.max);
console.log(h.mean);
console.log(h.stddev);
console.log(h.percentile(50));
```

PR-URL: https://github.com/nodejs/node/pull/25378
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-08 09:20:18 -08:00
Michaël Zasso
582c12260e
deps: update acorn to 6.0.7
acorn and acorn-walk are now published as two different packages. Put
them both in subdirectories of `deps/acorn`.
Adapt the REPL's recoverable error detection to use the new API for
extending acorn parsers.

PR-URL: https://github.com/nodejs/node/pull/25844
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-08 15:34:10 +01:00
Daniel Bevenius
f4510c4148 test, tools: suppress addon function cast warnings
Currently, there are a number of compiler warnings generated when
building the addons on Linux, for example:

make[1]: Entering directory '/node/test/addons/zlib-binding/build'
  CXX(target) Release/obj.target/binding/binding.o
  SOLINK_MODULE(target) Release/obj.target/binding.node
  COPY Release/binding.node
make[1]: Leaving directory '/node/test/addons/zlib-binding/build'
In file included from ../binding.cc:1:
/node/src/node.h:515:51: warning:
cast between incompatible function types from
'void (*)(v8::Local<v8::Object>,
          v8::Local<v8::Value>,
          v8::Local<v8::Context>)' to
'node::addon_context_register_func' {aka
'void (*)(v8::Local<v8::Object>,
          v8::Local<v8::Value>,
          v8::Local<v8::Context>,
          void*)'} [-Wcast-function-type]
(node::addon_context_register_func) (regfunc), \
					   ^
/node/src/node.h:533:3:
note: in expansion of macro 'NODE_MODULE_CONTEXT_AWARE_X'
   NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../binding.cc:58:1:
note: in expansion of macro 'NODE_MODULE_CONTEXT_AWARE'
 NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME, Initialize)
 ^~~~~~~~~~~~~~~~~~~~~~~~~

This commit adds the flag -Wno-cast-function-type to suppress these
warnings. With this change the warnings are not displayed anymore and
the output matches that of osx when running
'make -j8 test/addons/.buildstamp'.

PR-URL: https://github.com/nodejs/node/pull/25663
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-02-01 14:08:20 +01:00
Vse Mozhet Byt
c69ea3b1d5 doc: fix, unify, formalize, and amplify vm.md
`vm` module API heavily reuses common code, but the doc seems
to be a bit out of date: some options are listed in wrong places,
some options and history entries are missed.

Also some fragments need to be formalized and unified.

PR-URL: https://github.com/nodejs/node/pull/25422
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2019-01-11 22:21:44 +02:00
Vse Mozhet Byt
27a03b84c4 doc: make modules.md more accurate
PR-URL: https://github.com/nodejs/node/pull/25357
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-01-08 01:16:51 +02:00
Anna Henningsen
b91093f0e5
doc: add documentation for brotli support
PR-URL: https://github.com/nodejs/node/pull/24938
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2019-01-05 21:36:48 +01:00
Tobias Nießen
823d86c47c crypto: add key object API
This commit makes multiple important changes:

1. A new key object API is introduced. The KeyObject class itself is
   not exposed to users, instead, several new APIs can be used to
   construct key objects: createSecretKey, createPrivateKey and
   createPublicKey. The new API also allows to convert between
   different key formats, and even though the API itself is not
   compatible to the WebCrypto standard in any way, it makes
   interoperability much simpler.

2. Key objects can be used instead of the raw key material in all
   relevant crypto APIs.

3. The handling of asymmetric keys has been unified and greatly
   improved. Node.js now fully supports both PEM-encoded and
   DER-encoded public and private keys.

4. Conversions between buffers and strings have been moved to native
   code for sensitive data such as symmetric keys due to security
   considerations such as zeroing temporary buffers.

5. For compatibility with older versions of the crypto API, this
   change allows to specify Buffers and strings as the "passphrase"
   option when reading or writing an encoded key. Note that this
   can result in unexpected behavior if the password contains a
   null byte.

PR-URL: https://github.com/nodejs/node/pull/24234
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-24 14:50:16 +01:00
Joyee Cheung
9190e4ecdf tools: make apilinks building more robust
1. Move the apilinks.json file into out/doc so it gets cleaned when
  running `make docclean`
2. When the apilinks.json generated is empty, throw a specific error
  so it's easier to understand what's wrong
3. Write to a file passed through CLI arguments instead writing to
  stdout in apilinks.js so the build process is more robust in
  the case of a bad binary

PR-URL: https://github.com/nodejs/node/pull/25019
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-18 05:14:24 +01:00
Ruben Bridgewater
50dd555910
doc,lib,test: capitalize comment sentences
This activates the eslint capitalize comment rule for comments
above 50 characters.

PR-URL: https://github.com/nodejs/node/pull/24996
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-17 17:14:35 +01:00
Rich Trott
6f64cda1ee tools,doc: fix version picker bug in html.js
The processing of strings like `8.x` into a major version number and a
minor version number results in minor versions that are `NaN`. In that
situation, since the picker will link to the latest docs in the
major version, include the version in the version picker.

Fixes: https://github.com/nodejs/node/issues/23979
PR-URL: https://github.com/nodejs/node/pull/24638
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2018-11-27 19:14:54 -08:00
Timothy Gu
2a7432dade readline: add support for async iteration
Co-authored-by: Ivan Filenko <ivan.filenko@protonmail.com>
Fixes: https://github.com/nodejs/node/issues/18603
Refs: https://github.com/nodejs/node/pull/18904
PR-URL: https://github.com/nodejs/node/pull/23916
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-11-20 15:41:16 -08:00
Richard Lau
a8e98f8ea9 tools: update alternative docs versions
Add `11.x` and mark `10.x` as `lts`.

PR-URL: https://github.com/nodejs/node/pull/23980
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-11-02 01:04:57 -04:00
Ouyang Yadong
5689d55392 doc: add types and their corresponding return values
This commit supplements some types and their corresponding return
values in docs, including `AsyncResource`, `DiffieHellman`,
`ECDH`, `https.Server`, `repl.REPLServer`.

PR-URL: https://github.com/nodejs/node/pull/23998
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-11-02 00:36:40 +02:00
Brandon Smith
13340d47fc benchmark,doc,lib,src,test,tools: fix typos
PR-URL: https://github.com/nodejs/node/pull/23302
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-10-09 16:53:12 +03:00
Ben Noordhuis
df6a1306e8 doc: remove GA tracking
The Google Analytics tracking wasn't wholly uncontroversial and hasn't
been used in practice. Remove it.

PR-URL: https://github.com/nodejs/node/pull/23083
Fixes: https://github.com/nodejs/node/issues/22652
Refs: https://github.com/nodejs/node/pull/6601
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-10-04 07:18:23 +02:00
Tobias Nießen
1f5261b7c8
tools: fix doc tool behavior for version arrays
Even though the doc tool supports version arrays in theory, it fails to
sort them properly causing the tool to crash.

PR-URL: https://github.com/nodejs/node/pull/22766
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-12 11:47:08 +02:00
Kyle Farnung
3bdc61d4d1 tools,doc: apilinks should handle root scenarios
* Prevent crash when setting root properties
* Allow return outside of function

PR-URL: https://github.com/nodejs/node/pull/22721
Reviewed-By: Sam Ruby <rubys@intertwingly.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-09-09 17:48:56 -07:00
Sam Ruby
8737683ba0 tools: add [src] links to child-process.html
handle exports. as an alternative to module.exports

PR-URL: https://github.com/nodejs/node/pull/22706
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-08 13:42:41 -04:00
Sam Ruby
441391b9eb tools: add [src] links to async_hooks.html
handle ES2015 Class, contructor, and instance methods

unrelated: update Makefile so that generated HTML is out of date whenever
tools/doc/apilinks.js is updated.

PR-URL: https://github.com/nodejs/node/pull/22656
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-09-05 12:46:51 +02:00
Sam Ruby
5da155398e tools: add [src] links to assert.html
Parse `const assert = module.exports = ok;` as exporting a constructor
named `assert`.

PR-URL: https://github.com/nodejs/node/pull/22601
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-09-02 10:14:03 -04:00
MaleDong
ec75ba6f0a
doc: Remove 'dnt_helper.js'
This file is totally useless, because it's an inner-used helper that is
for publishment of doc files.

PR-URL: https://github.com/nodejs/node/pull/22595
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-09-02 12:47:09 +02:00
Sam Ruby
60465700ed tools: Include links to source code in documentation
Parse source code using acorn; extracting exports.  When producing
documentation, match exports to headers.  When a match is found, add a [src]
link.

This first commit handles simple exported classes and functions, and does so
without requiring any changes to the source code or markdown.  Subsequent
commits will attempt to match more headers, and some of these changes are
likely to require changes to the source code and/or markdown.

PR-URL: https://github.com/nodejs/node/pull/22405
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-08-29 22:20:46 -04:00
Sarat Addepalli
c917540f22 doc: support 'removed' field in doc YAML sections
PR-URL: https://github.com/nodejs/node/pull/22100
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-08-26 10:35:33 +03:00
Christopher Hiller
80143f616d process: add allowedNodeEnvironmentFlags property
`process.allowedNodeEnvironmentFlags` provides an API to validate and
list flags as specified in `NODE_OPTIONS` from user code.

Refs: https://github.com/nodejs/node/issues/17740
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>

PR-URL: https://github.com/nodejs/node/pull/19335
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Sam Ruby <rubys@intertwingly.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-08-24 18:15:19 -07:00
Bryan English
c7944a7a7b fs: readdir optionally returning type information
readdir and readdirSync now have a "withFileTypes" option, which, when
enabled, provides an array of DirectoryEntry objects, similar to Stats
objects, which have the filename and the type information.

Refs: https://github.com/nodejs/node/issues/15699

PR-URL: https://github.com/nodejs/node/pull/22020
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
2018-08-13 19:18:45 -07:00
Sam Ruby
59f8276a6b tools: fix header escaping regression
quick fix for #22065

Preferred long term fix can be found at:
https://github.com/nodejs/node/pull/22140

PR-URL: https://github.com/nodejs/node/pull/22084
Fixes: https://github.com/nodejs/node/issues/22065
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-13 09:14:42 -06:00
Vse Mozhet Byt
5fded26e9e tools: do not autolink section to itself
Fix a regression in the new doc generation toolchain.

PR-URL: https://github.com/nodejs/node/pull/22138
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sam Ruby <rubys@intertwingly.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-08 20:56:08 +03:00
Sam Ruby
3ffd6892c4 tools: convert addon-verify to remark
This is the last use of the remark *module*. tools/remark-cli and
tools/remark-preset-lint-node remain.

PR-URL: https://github.com/nodejs/node/pull/21978
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-28 10:40:35 +03:00
Sam Ruby
83474ae1e3 tools: flatten apidoc headers
ensure optional parameters are not treated as markedown links by
replacing the children of headers nodes with a single text node
containing the raw markup;

Fixes issue identified in
https://github.com/nodejs/node/pull/21490#issuecomment-406859983

PR-URL: https://github.com/nodejs/node/pull/21936
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-07-26 00:27:59 +03:00
Sam Ruby
f41dd5592e tools: produce JSON documentation using unified/remark/rehype
PR-URL: https://github.com/nodejs/node/pull/21697
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-07-25 21:33:06 +03:00
Vse Mozhet Byt
811598bcda doc: specify options parameter type in zlib.md
Also, delete now redundant notes and links.

PR-URL: https://github.com/nodejs/node/pull/21920
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-07-24 17:01:15 +03:00
Sam Ruby
78039b5f87 tools: validate apidoc links
PR-URL: https://github.com/nodejs/node/pull/21889
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-07-22 19:33:55 +03:00
Sam Ruby
46de34b8c2 tools: build API TOC using raw headers
Markdown interprets the syntax for optional arguments as a form
of a link, so instead of trying to build up the contents using
the node value, use grab the raw original markup instead.

Fixes regression noted in
https://github.com/nodejs/node/pull/21490#issuecomment-406785023

PR-URL: https://github.com/nodejs/node/pull/21922
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-07-21 22:20:10 +03:00
Sam Ruby
946686521d tools: create HTML docs with unified/remark/rehype
PR-URL: https://github.com/nodejs/node/pull/21490
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-07-20 13:37:40 -07:00
Rich Trott
61cd101e12 doc: add "Edit on GitHub" link
Proof of concept for an "Edit on GitHub" link, inspired by the
Serverless docs.

One issue is that the link is to the version of the docs on the master
branch even if the person was reading a different version of the doc. I
don't consider that a big problem, although we can always remove the
link if it turns out to be a big problem. I don't think there is a good
solution. PRs need to be opened against the master branch generally.
Having a bunch of PRs against staging branches is probably not what we
want. If there's an update to one version of the doc, there will usually
be an update to other versions.

PR-URL: https://github.com/nodejs/node/pull/21703
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2018-07-13 20:37:05 -07:00
Sam Ruby
0c743b5f77 tools: build all.json by combining generated JSON
Notes:

1) Removed a number of root properties that did not seem relevant:
   source, desc, and introduced_in.  There no longer is a source, and
   the other two are from the first include and do not reflect the
   entire API.

2) As with https://github.com/nodejs/node/issues/20100, the current
   "desc" properties sometimes contained in-page links, other times
   referenced another page, and often did not match the links in the
   original HTML or JSON file. I chose to standardize on external links
   as "desc" values are isolated snippets as opposed to all.html which
   can be viewed as a standalone and self contained document.

3) Eliminated preprocessing for @include entirely, including the test
   case for this function.

4) _toc.md was renamed to index.md.

5) index comments no longer appear in embedded TOCs (left hand side
   column in the generated documentation.

PR-URL: https://github.com/nodejs/node/pull/21637
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-07-09 22:57:33 +03:00
Kyle Farnung
8476053c13 n-api: restrict exports by version
* Move `napi_get_uv_event_loop` into the `NAPI_VERSION >= 2` section
* Move `napi_open_callback_scope`, `napi_close_callback_scope`,
  `napi_fatal_exception`, `napi_add_env_cleanup_hook`, and
  `napi_remove_env_cleanup_hook` into the `NAPI_VERSION >= 3` section
* Added a missing `added` property to `napi_get_uv_event_loop` in the
  docs
* Added a `napiVersion` property to the docs and updated the parser and
  generator to use it.
* Added usage documentation

PR-URL: https://github.com/nodejs/node/pull/19962
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-07-05 10:19:27 -07:00
Sam Ruby
f85962fe4d tools: build all.html by combining generated HTML
Combine the toc and api contents from the generated doc/api/*.html
files. This ensures that the single page version of the documentation
exactly matches the individual pages.

PR-URL: https://github.com/nodejs/node/pull/21568
Fixes: https://github.com/nodejs/node/issues/20100
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-07-02 21:33:30 +03:00
Vse Mozhet Byt
2ae45240a2 doc: fix some links
PR-URL: https://github.com/nodejs/node/pull/21619
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-07-02 18:08:17 +03:00
Rich Trott
6ac3c44012
tools: remove unused global types from type-parser
`tools/doc/type-parser.js` has several global types that are not
used. Remove the unused global types.

PR-URL: https://github.com/nodejs/node/pull/21135
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-06-08 10:09:54 +02:00
Joyee Cheung
f54a598b44
doc: document BigInt support in fs.Stats
PR-URL: https://github.com/nodejs/node/pull/20220
Fixes: https://github.com/nodejs/node/issues/12115
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-06-07 22:05:24 +08:00
Anna Henningsen
e7a2367471
worker: implement MessagePort and MessageChannel
Implement `MessagePort` and `MessageChannel` along the lines of
the DOM classes of the same names. `MessagePort`s initially
support transferring only `ArrayBuffer`s.

Thanks to Stephen Belanger for reviewing this change in its
original form, to Benjamin Gruenbaum for reviewing the
added tests in their original form, and to Olivia Hugger
for reviewing the documentation in its original form.

Refs: https://github.com/ayojs/ayo/pull/98

PR-URL: https://github.com/nodejs/node/pull/20876
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-06-06 19:43:44 +02:00
Rich Trott
148b8ad9f3 tools: update tools/doc/package-lock.json
The package-lock.json file is out of sync with the checked-in
node_modules. `make doc-only` updates package-lock.json appropriately.

PR-URL: https://github.com/nodejs/node/pull/20970
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-05-29 08:58:46 -07:00
Vse Mozhet Byt
c241b7d85c tools: fix sorting in doc/type-parser.js
This section groups type links by their home modules
and sort these groups alphabetically,
so `modules` types should go before the `net` types.

PR-URL: https://github.com/nodejs/node/pull/20976
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-05-26 23:32:03 +03:00
Chris Young
c89669d87e doc: removed LTS label from v4 in doc version picker
Fixes: https://github.com/nodejs/node/issues/20903

PR-URL: https://github.com/nodejs/node/pull/20904
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-23 12:22:50 -07:00
Vse Mozhet Byt
e6b7f0ef0c tools, doc: wrap manpage links in code elements
PR-URL: https://github.com/nodejs/node/pull/20785
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-05-17 23:31:50 +03:00
Vse Mozhet Byt
2773de52fd tools, doc: fix stability index isssues
1. Do not autolink in doc stability section.
2. Do not add void wrapping elements to docs.

PR-URL: https://github.com/nodejs/node/pull/20731
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-17 21:03:33 +03:00
Vse Mozhet Byt
01e2f48c07 tools: eliminate intermediate module in doctools
PR-URL: https://github.com/nodejs/node/pull/20701
Fixes: https://github.com/nodejs/node/issues/20685
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-16 18:44:54 +03:00
Vse Mozhet Byt
12b0159adf tools: overhaul tools/doc/html.js
PR-URL: https://github.com/nodejs/node/pull/20613
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-14 19:07:47 +03:00
Vse Mozhet Byt
5f2b67dbcd doc, tools: unify stability signatures
PR-URL: https://github.com/nodejs/node/pull/20552
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-05-09 00:52:13 +03:00
Vse Mozhet Byt
802a63139f tools: add v10 to alternative version docs menu
PR-URL: https://github.com/nodejs/node/pull/20586
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-05-08 13:32:07 +03:00