-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #57343 +/- ##
==========================================
- Coverage 90.27% 90.19% -0.09%
==========================================
Files 630 628 -2
Lines 186124 185689 -435
Branches 36469 36339 -130
==========================================
- Hits 168021 167475 -546
- Misses 10974 11140 +166
+ Partials 7129 7074 -55 🚀 New features to boost your workflow:
|
I’m not sure either, but I’ll check it out. |
On the README.md file you updated ( |
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.
That shouldn't be the case? The |
I can confirm that |
@aduh95 |
Here's what we currently have: https://github.com/nodejs/remark-preset-lint-node/blob/79792fc74f48f467b8c649672c08003a55bba4ed/remark-lint-nodejs-yaml-comments.js#L55-L60 |
We just fixed it upstream. @flakey5 can you update the version used here? And rebase the PR so that @aduh95 can remove the block and we can finally merge this? 🙏 |
7df263f
to
a418c13
Compare
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.
Issues that need to be addressed:
- We should keep the existing tests (at least for now, can be removed in a follow up).
We should not reportaddressed, thank you!REPLACEME
as an invalid version.We should report invalid versions as a hard failure.addressed, thank you!- It pretends it generates the docs for Node.js 22.14.0 instead of 24.0.0 🤨
make: *** No rule to make target 'out/doc/api/index.html'
I would note that it seems there no cache mecanism, running make docserve
takes forever on my quite powerful machine, even if I've made no changes to the files since the last doc build. Just a complain, not a blocker.
Hey @avivkeller, I noticed that you pushed a commit to @flakey5's pull request. It’s generally not common practice for contributors to push changes to someone else's pull request on the nodejs/node repository without explicit permission from the author. Please keep that in mind! Additionally, since you’re not a core collaborator, you shouldn’t perform actions that are reserved for core collaborators, which I believe this would qualify as. If I’m wrong or if anyone has a different perspective, please feel free to correct me. |
I don't have direct push permissions, even if I wanted to (I have See flakey5#1 |
Now,
Why? The files they are testing no longer exist. There's no point in testing files that aren't present or don't serve any function. Instead, we should incorporate any missing tests into the new tooling, rather than leaving them here to be ineffective. |
It was a pr that I merged.
I've re-added the tests that are still applicable. Note however that some of the tests need to be removed because the new tooling doesn't expose the same things. Also noteworthy that we have tests for these things in the api-docs-tooling repo |
Switches over to using the new doc generation tooling. For more background on this, please see nodejs#52343 Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> Co-authored-by: Claudio W <cwunder@gnome.org> Co-authored-by: avivkeller <me@aviv.sh>
ddaa32a
to
279e51f
Compare
Noted, that makes more sense. For me it looked like @flakey5 rebased his PR; But indeed it was a PR they merged; Disregard my comment :D |
@aduh95 could you re-review when you get a chance? I believe we have resolved all your concerns 😄 |
Is there still time to get the new API docs tooling before 24.0.0 release on Tue, May 6th? |
Wait for Antoine and fix CI. IDK Why it's fail |
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.
I think there's still a problem in the Makefile
, if I run rm -f out/doc/api/index.html && make out/doc/api/index.html
, it errors with make: *** No rule to make target 'out/doc/api/index.html'. Stop.
. This does not happen on main
.
I'd also like to get some comment on the performance, here's the command I'm using to measure it:
make docclean doc-only -j && time make doc-only -j
On this PR: make doc-only -j 67.66s user 2.38s system 126% cpu 55.554 total
On main
: make doc-only -j 1.23s user 0.33s system 118% cpu 1.317 total
|
||
rm -rf node_modules/ package-lock.json | ||
|
||
npm install "git://github.com/nodejs/api-docs-tooling#$latest_commit" |
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 should not rely on a globally installed npm
and instead target the one in the tree, for an example see
node/tools/dep_updaters/update-acorn-walk.sh
Lines 10 to 13 in 995ad2b
BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd) | |
[ -z "$NODE" ] && NODE="$BASE_DIR/out/Release/node" | |
[ -x "$NODE" ] || NODE=$(command -v node) | |
NPM="$BASE_DIR/deps/npm/bin/npm-cli.js" |
npm install "git://github.com/nodejs/api-docs-tooling#$latest_commit" | |
"$NODE" "$NPM" install "git://github.com/nodejs/api-docs-tooling#$latest_commit" |
CURL=$(command -v curl) | ||
|
||
if ! [ -x "$CURL" ]; then | ||
echo curl is needed to update api doc tooling | ||
exit 1 | ||
fi | ||
|
||
latest_commit=$($CURL -s -H "Accept: application/vnd.github.VERSION.sha" "https://api.github.com/repos/nodejs/api-docs-tooling/commits/main") |
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.
nit: we could use node -e 'fetch(…
to remove the dependency on curl
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.
Could we have a comment on why we are removing this file? Sorry if it has already been answered, those long GH thread are hard to follow
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.
Same here, could we have a comment on why we are removing this file?
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.
Same here, could we have a comment on why we are removing this file?
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.
Same here, could we have a comment on why we are removing this file?
- name: Install Node.js | ||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} |
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.
Let's remove this, we should be able to build node
without node
(it's probably related to #57343 (comment), no?)
Even if it lands before then, it's unlikely to be included. Why do you ask? |
Usually major changes are aligned with major version release, so wanted to know since we're close to 24.0.0 release. We'll have to wait for 24.1.0 release right? |
Well, not really. This just includes the 1:1 HTML generation. The LLM file would be in a follow up if anything |
That's because, (like you said prior) in the original makefile, everything is built seperately, so individual files aren't rebuilt if they haven't changed: out/doc/api/%.json out/doc/api/%.html: doc/api/%.md tools/doc/generate.mjs \
tools/doc/markdown.mjs tools/doc/html.mjs tools/doc/json.mjs \
tools/doc/apilinks.mjs $(VERSIONS_DATA) | $(LINK_DATA) out/doc/api
@if [ "$(shell $(node_use_icu))" != "true" ]; then \
echo "Skipping documentation generation (no ICU)"; \
else \
$(call available-node, $(gen-api)) \
fi Whereas, in this PR, they are all built, every time. out/doc/api/%.json out/doc/api/%.html: doc-only |
@avivkeller I can see that, it's in the diff; what's not in the diff is why is it like that, how to fix it, etc. |
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