-
-
Notifications
You must be signed in to change notification settings - Fork 88
Bump docusaurus to 3.0.0-alpha.0
#1745
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,14 +41,11 @@ | |
}, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"@docusaurus/theme-search-algolia@2.3.1": "patches/@[email protected]" | ||
"@docusaurus/theme-search-algolia@3.0.0-alpha.0": "patches/@[email protected]" | ||
}, | ||
"peerDependencyRules": { | ||
"ignoreMissing": [ | ||
"@docusaurus/core", | ||
"@docusaurus/mdx-loader", | ||
"@docusaurus/plugin-content-blog", | ||
"@docusaurus/preset-classic" | ||
"react-json-view" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We still need this peer dependency override until facebook/docusaurus#9116 is released |
||
], | ||
"allowedVersions": { | ||
"react": "18", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import exists from "path-exists"; | |
import { TsConfigJson } from "type-fest"; | ||
import { toPosixPath } from "./toPosixPath"; | ||
import { Context } from "./Context"; | ||
import { uniq } from "lodash"; | ||
|
||
/** | ||
* Given a tsconfig.json, update it to match our conventions. This function is | ||
|
@@ -76,9 +77,7 @@ export async function updateTSConfig( | |
|
||
return { | ||
...input, | ||
extends: toPosixPath( | ||
path.join(pathFromPackageToRoot, "tsconfig.base.json"), | ||
), | ||
extends: getExtends(pathFromPackageToRoot, input.extends), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need this because we are now extending docusaurus tsconfig in our docs site |
||
compilerOptions: { | ||
...(input.compilerOptions ?? {}), | ||
rootDir: "src", | ||
|
@@ -99,3 +98,23 @@ export async function updateTSConfig( | |
], | ||
}; | ||
} | ||
|
||
function getExtends( | ||
pathFromPackageToRoot: string, | ||
inputExtends: string | string[] | undefined, | ||
) { | ||
let extendsList = | ||
inputExtends == null | ||
? [] | ||
: Array.isArray(inputExtends) | ||
? [...inputExtends] | ||
: [inputExtends]; | ||
|
||
extendsList.push( | ||
toPosixPath(path.join(pathFromPackageToRoot, "tsconfig.base.json")), | ||
); | ||
|
||
extendsList = uniq(extendsList); | ||
|
||
return extendsList.length === 1 ? extendsList[0] : extendsList; | ||
} |
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 patch seemed to apply cleanly, and still is having the intended effect in local testing, so that's a relief 😅