-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
build, doc: use new api doc tooling #57343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Review requested:
|
77ede22 to
3423c21
Compare
3423c21 to
451f8a7
Compare
ovflowd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flakey5 I guess you also need to check our GitHub Action Workflows, and also other mentions of these files within the source.
Like within the Contributor Docs, there is a file that describes how the legacy API doc tooling works, and I believe there are other references also.
cf2609b to
a3ce99d
Compare
|
It also looks like |
|
Also not sure what's going on with |
REPLACEME shouldn't error, imo, just give a warning. Our linter should have warn and error levels. And yes introduced_in must be top level! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #57343 +/- ##
=======================================
Coverage 88.56% 88.56%
=======================================
Files 703 703
Lines 208291 208291
Branches 40169 40175 +6
=======================================
+ Hits 184472 184482 +10
- Misses 15831 15833 +2
+ Partials 7988 7976 -12 🚀 New features to boost your workflow:
|
I’m not sure either, but I’ll check it out. |
On the README.md file you updated ( |
ovflowd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the result of many months of arduous work between many awesome folks, including @flakey5 @AugustinMauroy @araujogui @ovflowd @avivkeller and others.
I'm so proud of what we are achieving here and this is a huge step towards a modern tooling and a revamped API docs within Node.js
Approving, as I believe this is ready!
|
cc @nodejs/collaborators can we have another approval here? 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSLGTM because it is hard to review and outside of my comfort zone.
|
cc @aduh95 anything else needed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the generated JSON files are very different from the one generated by the existing tool. IMO we should have assert.partialDeepStrictEqual(JSON.parse(fileOnThisBranch), JSON.parse(sameFileOnMain)), otherwise it would be a breaking change for users who consume those JSON files. Maybe an option would be keep the existing tooling for JSON files, so it doesn't block this PR?
Other than that, the HTML part LGTM (although the time it takes to generate is still a notable regression, but not a blocker).
The JSON output is supposed to be an 1:1 match in terms of structure. We already validated this format with @targos and many others in the past. Can you please point out on what is different?
As mentioned, that is only on the legacy generator. The one with the redesign is much faster. |
Well it's not; for example, "meta": {
"deprecated": [
"v1.4.2"
],
"changes": [
{
"version": "v8.8.0",
"pr-url": "https://github.com/nodejs/node/pull/15695",
"description": "Any `Promise`s created in VM contexts no longer have a `.domain` property. Their handlers are still executed in the proper domain, however, and `Promise`s created in the main context still possess a `.domain` property."
},
{
"version": "v8.0.0",
"pr-url": "https://github.com/nodejs/node/pull/12489",
"description": "Handlers for `Promise`s are now invoked in the domain in which the first promise of a chain was created."
}
]
},It looks like this on this PR: "meta": [
{
"changes": [
{
"version": "v8.0.0",
"pr-url": "https://github.com/nodejs/node/pull/12489",
"description": "Handlers for `Promise`s are now invoked in the domain in which the first promise of a chain was created."
},
{
"version": "v8.8.0",
"pr-url": "https://github.com/nodejs/node/pull/15695",
"description": "Any `Promise`s created in VM contexts no longer have a `.domain` property. Their handlers are still executed in the proper domain, however, and `Promise`s created in the main context still possess a `.domain` property."
}
],
"added": [],
"napiVersion": [],
"deprecated": [
"v1.4.2"
],
"removed": []
},
{
"changes": [],
"added": [],
"napiVersion": [],
"deprecated": [],
"removed": []
},
{
"changes": [],
"added": [],
"napiVersion": [],
"deprecated": [],
"removed": []
},
{
"changes": [],
"added": [],
"napiVersion": [],
"deprecated": [],
"removed": []
},
{
"changes": [],
"added": [],
"napiVersion": [],
"deprecated": [],
"removed": []
}
],I don't mind the fact that the more keys are present, however it's weird that it's now an array and has additional empty entries. In "introduced_in": [],
"stability": [],
"stabilityText": [],
"shortDesc": [],
"classes": []On "introduced_in": "v0.10.0",
"stability": 2,
"stabilityText": "Stable",
"classes": [
{
…I verified with the GHA-generated files in https://github.com/nodejs/node/actions/runs/19650553861?pr=57343 in case it was something wrong with my local repo, but no I see the same discrepancies. |
|
That actually sounds like a bug. I wonder if it is a regression. On early days of the doc-kit the JSON was fully compliant with main, I even remember doing tests with @flakey5 and @targos in-person at NodeConf but I might be misremembering things. Since many changes have happened in between, things could have slipped. Since we want to initially bring doc-kit to be fully compliant with the current state of the existing tooling before we move to the new JSON format and generated pages, I do feel these need to be fixed. cc @avivkeller / @araujogui and @flakey5 any ideas? |
|
I have a strong feeling that it’s from https://github.com/nodejs/doc-kit/blob/main/src/generators/legacy-json/utils/buildSection.mjs#L19, as we wanted to standardize the types (ie always make these things arrays, and not sometimes arrays, other times strings, and sometimes undefined) |
Re nodejs/node#57343 (comment) Signed-off-by: flakey5 <[email protected]>
Re nodejs/node#57343 (comment) Signed-off-by: flakey5 <[email protected]>
* fix(legacy-json): misc promotion logic fix Re nodejs/node#57343 (comment) Signed-off-by: flakey5 <[email protected]> * unit tests Signed-off-by: flakey5 <[email protected]> --------- Signed-off-by: flakey5 <[email protected]>
Switches over to using the new doc generation tooling. For more background on this, please see nodejs#52343 Signed-off-by: flakey5 <[email protected]> Co-authored-by: Claudio W <[email protected]> Co-authored-by: avivkeller <[email protected]> Co-authored-by: Antoine du Hamel <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Signed-off-by: flakey5 <[email protected]>
…ready Signed-off-by: flakey5 <[email protected]>
Co-authored-by: Antoine du Hamel <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Co-authored-by: Joyee Cheung <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Signed-off-by: flakey5 <[email protected]>
66edf16 to
88544ae
Compare

Switches over to using the new doc generation tooling. For more background on this, please see #52343
Currently a draft just to get feedback on the approach to this integration.cc @nodejs/web-infra