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

fix(api): fixed api generation issues and improved transformer #2758

Merged
merged 12 commits into from Sep 13, 2022

Conversation

ovflowd
Copy link
Member

@ovflowd ovflowd commented Sep 12, 2022

Description

This PR tackles the remaining MDX/Markdown issues from our repository. Basically the current sync-api script still had some issues and some of our Markdown pages are non-conforming, son this PR does the following:

  • Updates the sync-api and its API utilities fixing the existing problems such as:
    • Only run regex queries for the parts of each paragraph block that we need
    • Optimised some expensive regex queries
    • Added missing regex queries (for missing cases such as <https://....> links to be transformed into markdown links, and inline {} syntax to be escaped)
    • Cover the case of ignoring (not running regex queries) on code blocks and identifying the beginning and end of multi-paragraphal code blocks)
  • Updates how we replace <DataTag> from TableOfContents and ApiLinks by decoupling the logic from the actual components
  • Added a patch to gatsby-plugin-mdx which should reduce the amount of babel generator warnings due to large size markdown files

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.

@nschonni
Copy link
Member

This is still making multiple large changes at once. I've opened #2759 with a clean version update

@ovflowd
Copy link
Member Author

ovflowd commented Sep 12, 2022

Correcting my previous comment, I think I got what you meant all along, by having a separate PR that just updates the current docs, we can have the least possible diff.

@ovflowd ovflowd force-pushed the feat/api-transformer-fixes branch 2 times, most recently from 08c0179 to 9c18409 Compare September 12, 2022 22:00
@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2022

Codecov Report

Merging #2758 (ce3b5a6) into main (fd57b87) will decrease coverage by 3.15%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2758      +/-   ##
==========================================
- Coverage   66.02%   62.87%   -3.16%     
==========================================
  Files         118      123       +5     
  Lines        1351     1441      +90     
  Branches      342      361      +19     
==========================================
+ Hits          892      906      +14     
- Misses        422      494      +72     
- Partials       37       41       +4     
Impacted Files Coverage Δ
src/__fixtures__/page.tsx 94.11% <ø> (-5.89%) ⬇️
...components/ApiComponents/Components/ApiHeading.tsx 0.00% <ø> (ø)
...rc/components/ApiComponents/Components/ApiLink.tsx 0.00% <ø> (ø)
...ents/ApiComponents/Components/SourceLink/index.tsx 0.00% <ø> (ø)
src/components/ApiComponents/index.tsx 0.00% <ø> (ø)
src/components/Article/index.tsx 100.00% <ø> (ø)
src/components/Banner/index.tsx 100.00% <ø> (ø)
src/components/Codebox/index.tsx 100.00% <ø> (ø)
src/components/EditLink/index.tsx 100.00% <ø> (ø)
src/components/Header/index.tsx 100.00% <ø> (ø)
... and 58 more

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

src/templates/api.tsx Outdated Show resolved Hide resolved
@ovflowd
Copy link
Member Author

ovflowd commented Sep 13, 2022

@nschonni I'm updating this PR and decoupling the visual changes on Markdown-side. So that we have a grasp of the actual diff.

@ovflowd
Copy link
Member Author

ovflowd commented Sep 13, 2022

@nschonni @benhalverson PR ready for review, the verbose now is way smaller and the actual changes are visible.

refactor(api): improved api generation and reduced noise

chore(docs): resynced docs

fix(structure-types): improved recognition for structure types

chore(api): synced api docs
feat(utils): created util specific for data tags replacement

chore(components): updated usage of components for data-tag replacement and improved toc

chore(snaps): updated snapshots

chore(api): regenerated api docs
@ovflowd ovflowd merged commit 2a0d78a into nodejs:main Sep 13, 2022
@ovflowd ovflowd deleted the feat/api-transformer-fixes branch September 13, 2022 12:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs enhancement New feature or request Infrastructure Infra related task
Projects
None yet
4 participants