-
Notifications
You must be signed in to change notification settings - Fork 62
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
Docusaurus v3 Update #237
base: main
Are you sure you want to change the base?
Docusaurus v3 Update #237
Conversation
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.
lgtm
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 is not working for me. I get a lot of:
Error: MDX compilation failed for file "/Users/mspigolon/workspace/fastify-org/website-next/versioned_docs/version-v4.19.x/docs/Reference/TypeScript.md"
Cause: Unexpected character `,` (U+002C) in name, expected a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag
Details:
{
"column": 66,
"message": "Unexpected character `,` (U+002C) in name, expected a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag",
"line": 1467,
"name": "1467:66",
"place": {
"line": 1467,
"column": 66,
"offset": 52450,
"_index": 0,
"_bufferIndex": 59
},
"reason": "Unexpected character `,` (U+002C) in name, expected a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag",
"ruleId": "unexpected-character",
"source": "micromark-extension-mdx-jsx",
"url": "https://github.com/micromark/micromark-extension-mdx-jsx#unexpected-character-at-expected-expect"
}
If I remove all the TS files:
find "versioned_docs/" -type f -name "TypeScript.md" -exec rm -f {} +
Now the build works - could ybe ou check it?
I hate this edit phase, but your solution is good, but the replace logic in latest
build is not safe, because the line number can change, so we should skip it for it and try a simple find/replace.
@@ -200,7 +201,6 @@ const config = { | |||
}), | |||
|
|||
plugins: [ | |||
'@orama/plugin-docusaurus', |
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 a blocker, we need to wait for it
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.
Yes I also enoutered that issue where it says there are some missing items. I was able to pinpoint the issue ...I believe it was due a certain command copying docs from say version-folder/* into version-folder/docs . so when you tun the build website again which is designed to look into version-folder/* and not version-folder/docs which now causes a build error since the files in version-folder/docs were not updated. Will recreate this and get back to you
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.
The fix has been released!
} | ||
|
||
let currentLineContent = lines[lineNumber - 1] | ||
|
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.
Idempotency
if (currentLineContent.includes(newContent)) { | |
console.log('No changes needed') | |
return | |
} |
const { join } = path | ||
|
||
async function editLine(file, lineNumber, oldContent, newContent) { | ||
const data = await fs.readFile(file, 'utf8') |
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.
We can avoid to read the file for each edit, but the script is trivial and fast anyway
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 had made the edits line by line so that it would be easy for anyone to identify what items were changed..but we could do a simple regex check in specific files ..cause I noticed that its only a few files that require changing so we could check only in those files.
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.
@Eomm as for the latest branch I also noticed the issue where we'd be updating beyond the scope. To ensure this I believe it might require some steps
- Merge the changes with the latest branch still being checked
- Add a docusaurus v3 check in the fastify/fastify build to ensure the latest is always docusaurus compatiple
npx docusaurus-mdx-checker
- Remove the latest check in the docusaurus v3 upgrade
@Eomm. The first image was for the a fresh install of the fastify website in contrast |
3de85d2
to
8633c45
Compare
Description
In this pr I tried to upgrade docusaurus from v2 to v3
Related Issues
Addresses #223
Check List
Not appilcable
Despite being able to upgrade to v3 there are some items that I have noted
Orama plugin has issues with docusaurus v3 upgrade as per issue Docusaurus V3 plugin not working on fresh install oramasearch/orama#728. This therefor necessitated the removal of orama plugin temporarily as the issue is fixed. There is a PR that seeks to addresses it over here Fix issues with
plugin-docusaurus-v3
detecting local mode. oramasearch/orama#754I have read the Contributing Guidelines
Closes #223