Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

feat(api): decoupled docs parsing - #2728

Merged
ovflowd merged 7 commits into
nodejs:mainfrom
ovflowd:feat/decoupled-api-sync
Sep 8, 2022
Merged

feat(api): decoupled docs parsing#2728
ovflowd merged 7 commits into
nodejs:mainfrom
ovflowd:feat/decoupled-api-sync

Conversation

@ovflowd

@ovflowd ovflowd commented Sep 7, 2022

Copy link
Copy Markdown
Member

Description

This PR introduces a decoupled API synchronisation. Which allows the whole API docs to be written towards the file-system, instead of using cache.

It allows also for in the future for a GitHub Action to sync the API docs from time-to-time, reduces the build-generation and finally allows Internationalisation of the API docs.

Future changes

  • Create the GitHub Action
  • Update the api.tsx to attempt to get the version of the doc for the current language or fallback to the default language.

Related changes

  • Some config files were moved from util-node to the root of the repository
  • The deprecated docs/adr and okr.md were removed
  • The parse blog post from Nodejs.org Blogs was moved to the scripts folder

Related Issues

Closes https://github.com/nodejs/nodejs.dev/issues/2719

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npm run lint:js -- --fix and/or npm run lint:md -- --fix for my JavaScript and/or Markdown changes.
    • This is important as most of the cases your code changes might not be correctly linted
  • I have run npm run test to check if all tests are passing, and/or npm run test -- -u to update snapshots if I created and/or updated React Components.
  • I have checked that the build works locally and that npm run build work fine.
  • I've covered new added functionality with unit tests if necessary.

@ovflowd ovflowd added enhancement New feature or request docs i18n All Issues regarding Localisation of the Website labels Sep 7, 2022
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #2728 (17d5d43) into main (d56388c) will decrease coverage by 2.78%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2728      +/-   ##
==========================================
- Coverage   68.83%   66.04%   -2.79%     
==========================================
  Files         119      117       -2     
  Lines        1325     1334       +9     
  Branches      332      334       +2     
==========================================
- Hits          912      881      -31     
- Misses        379      417      +38     
- Partials       34       36       +2     
Impacted Files Coverage Δ
src/hooks/useLocaleAsDropdown.ts 80.00% <ø> (ø)
src/util/detectLanguage.ts 0.00% <ø> (ø)
util-node/apiDocsTransformUtils.js 0.00% <ø> (-6.20%) ⬇️
util-node/apiDocsTypeParser.js 0.00% <ø> (ø)
util-node/createApiPages.js 16.12% <ø> (+5.60%) ⬆️
util-node/createApiQuery.js 100.00% <ø> (ø)
util-node/getApiDocsData.js 0.00% <ø> (-28.21%) ⬇️
util-node/getCurrentActiveReleases.js 0.00% <0.00%> (-12.50%) ⬇️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ovflowd ovflowd added the create-preview Generate preview on staging.nodejs.dev label Sep 7, 2022
@github-actions github-actions Bot removed the create-preview Generate preview on staging.nodejs.dev label Sep 7, 2022
Comment thread .eslintignore Outdated
@github-actions

github-actions Bot commented Sep 7, 2022

Copy link
Copy Markdown

Please find a preview at: https://staging.nodejs.dev/2728/

Co-authored-by: Michael Esteban <mickel13@gmail.com>
@manishprivet

Copy link
Copy Markdown
Member

LGTM!

I just had a question. How will we decide when to run the upcoming Github Action to update the files? I think GitHub Actions supports triggering actions cross repository... So are we planning to use that, or does it has to be manual?

@ovflowd

ovflowd commented Sep 7, 2022

Copy link
Copy Markdown
Member Author

That’s a good point! We could have a CRON scheduler or just do this inter repo triggers (need to check the docs)

@manishprivet

manishprivet commented Sep 7, 2022

Copy link
Copy Markdown
Member

That’s a good point! We could have a CRON scheduler or just do this inter repo triggers (need to check the docs)

We had a similar issue previously as well where we were planning to use the repository-dispatch action (See #1538 (comment))

Maybe we can keep it for a next PR

@ovflowd

ovflowd commented Sep 7, 2022

Copy link
Copy Markdown
Member Author

We had a similar issue previously as well where we were planning to use the repository-dispatch action (See #1538 (comment))

repository_dispatch would require nodejs/node to do it. I think I can make an action that runs daily, checks if the files changed, and then commits it directly to master.

@ovflowd

ovflowd commented Sep 8, 2022

Copy link
Copy Markdown
Member Author

@manishprivet @benhalverson kindly requesting a review here :)

@benhalverson benhalverson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@ovflowd
ovflowd merged commit 07f0d80 into nodejs:main Sep 8, 2022
@ovflowd
ovflowd deleted the feat/decoupled-api-sync branch September 8, 2022 09:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

docs enhancement New feature or request i18n All Issues regarding Localisation of the Website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decouple API docs generation from bundling process

5 participants