Skip to content
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

infra: update docs to docusaurus v3 #1864

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

timdeschryver
Copy link
Contributor

@timdeschryver timdeschryver commented Nov 11, 2023

I recently did this for Testing Library, and noticed that the docs could be upgraded to docusaurus v3.
Feel free to close if the docs should remain on v2, or if you want to upgrade later.

For more info see https://docusaurus.io/blog/releases/3.0

Copy link
Contributor Author

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

Some more info about the upgrade can be found in the comments

@@ -22,7 +22,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16.16.0
node-version: 18
Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

README.md Outdated

/*...*/
});
this.oidcSecurityService
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is prettier doing the formatting, I can revert if needed.

@@ -12,6 +12,9 @@ module.exports = {
favicon: 'img/favicon.ico',
organizationName: 'damienbod', // Usually your GitHub org/user name.
projectName: 'Angular Auth OIDC Client', // Usually your repo name.
markdown: {
format: 'md',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default parses is now mdx2, due to this many compile errors are thrown.
Because we don't make use of it, I changed the default parser to just markdown.

For example, the header in public api forceRefreshSession(customParams?: { ... }, configId?: string) throws an error because it tries to parse the code between the brackets { ... }, because it thinks that this is a JSX block.

You can also verify this using the upgrade checker:

npx docusaurus-mdx-checker

@@ -71,7 +74,7 @@ module.exports = {
copyright: `Copyright © ${new Date().getFullYear()} Angular Auth OIDC Client Docs, Inc. Built with Docusaurus.`,
},
prism: {
additionalLanguages: ['typescript'],
additionalLanguages: ['typescript', 'bash', 'json'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

v3 removes some default languages. I added the ones that were used in the docs.

@@ -81,7 +84,13 @@ module.exports = {
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl: 'https://github.com/damienbod/angular-auth-oidc-client',
editUrl:
'https://github.com/damienbod/angular-auth-oidc-client/edit/main/docs/site/angular-auth-oidc-client',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed the current edit functionally redirects the user to a 404, e.g. https://github.com/damienbod/angular-auth-oidc-client/docs/documentation/public-api.md

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice catch!

[require('@docusaurus/remark-plugin-npm2yarn'), { sync: true }],
],
showLastUpdateAuthor: true,
showLastUpdateTime: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I find it useful, I can also revert this if you want

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perfect, thanks!

@FabianGosebrink
Copy link
Collaborator

FabianGosebrink commented Nov 14, 2023

Thanks @timdeschryver ! LGTM. Merge, okay?

@timdeschryver
Copy link
Contributor Author

Ship it @FabianGosebrink 🚀

@FabianGosebrink FabianGosebrink merged commit d9d48f3 into damienbod:main Nov 14, 2023
9 checks passed
@timdeschryver
Copy link
Contributor Author

@FabianGosebrink it seems as the build on main fails to build/deploy the docs.
I'll look into this later today, sorry for the inconvenience.

@FabianGosebrink
Copy link
Collaborator

No worries. Ping me if you need help. Thank you for all your effort. We really appreciate it!

@damienbod
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants