Skip to content

Commit 16973f8

Browse files
authored
Bump docusaurus to 3.0.0-alpha.0 (#1745)
We have some security warnings on a couple packages that are dependencies of docusaurus, so I decided to upgrade to the latest to remove those dependencies. Docusaurus uses their nightly version on their own docs, and things seem to work for us on this version with no issue, so I think it's ok. In addition, we were violating their peer dependencies by using react 18; we now no longer need to do that. Also, this version allows us to use mdx v2, which has a lot of niceties that we'll probably want as we do our big docs refactor (#867) - depends on #1750 to fix typedoc failure ## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [ ] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [ ] I have not broken the cheatsheet
1 parent 851e0bc commit 16973f8

File tree

6 files changed

+2184
-1523
lines changed

6 files changed

+2184
-1523
lines changed

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@
4141
},
4242
"pnpm": {
4343
"patchedDependencies": {
44-
"@docusaurus/theme-search-algolia@2.3.1": "patches/@[email protected]"
44+
"@docusaurus/theme-search-algolia@3.0.0-alpha.0": "patches/@[email protected]"
4545
},
4646
"peerDependencyRules": {
4747
"ignoreMissing": [
48-
"@docusaurus/core",
49-
"@docusaurus/mdx-loader",
50-
"@docusaurus/plugin-content-blog",
51-
"@docusaurus/preset-classic"
48+
"react-json-view"
5249
],
5350
"allowedVersions": {
5451
"react": "18",

packages/cursorless-org-docs/package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
"dependencies": {
2121
"@algolia/client-search": "4.15.0",
2222
"@docsearch/react": "3.3.3",
23-
"@docusaurus/core": "~2.3.1",
24-
"@docusaurus/preset-classic": "~2.3.1",
25-
"@docusaurus/theme-common": "2.3.1",
26-
"@docusaurus/theme-search-algolia": "2.3.1",
27-
"@mdx-js/react": "^1.6.22",
23+
"@docusaurus/core": "3.0.0-alpha.0",
24+
"@docusaurus/preset-classic": "3.0.0-alpha.0",
25+
"@docusaurus/theme-classic": "3.0.0-alpha.0",
26+
"@docusaurus/theme-common": "3.0.0-alpha.0",
27+
"@docusaurus/theme-search-algolia": "3.0.0-alpha.0",
28+
"@mdx-js/react": "2.3.0",
2829
"clsx": "^1.2.1",
2930
"mdast-util-find-and-replace": "^2.2.2",
3031
"prism-react-renderer": "^1.3.5",
@@ -45,6 +46,8 @@
4546
]
4647
},
4748
"devDependencies": {
49+
"@docusaurus/module-type-aliases": "3.0.0-alpha.0",
50+
"@tsconfig/docusaurus": "2.0.0",
4851
"docusaurus-plugin-typedoc": "^0.18.0",
4952
"typedoc": "^0.23.28",
5053
"typedoc-plugin-markdown": "^3.14.0",

packages/cursorless-org-docs/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.base.json",
2+
"extends": ["@tsconfig/docusaurus/tsconfig.json", "../../tsconfig.base.json"],
33
"compilerOptions": {
44
"rootDir": "src",
55
"esModuleInterop": true,

packages/meta-updater/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
"@pnpm/types": "8.9.0",
1717
"@types/normalize-path": "^3.0.0",
1818
"js-yaml": "^4.1.0",
19+
"lodash": "^4.17.21",
1920
"normalize-path": "^3.0.0",
2021
"path-exists": "^4.0.0",
21-
"type-fest": "3.6.1"
22+
"type-fest": "4.2.0"
2223
},
2324
"main": "./out/index.js",
2425
"types": "./out/index.d.ts",
@@ -31,6 +32,7 @@
3132
},
3233
"devDependencies": {
3334
"@types/js-yaml": "^4.0.2",
35+
"@types/lodash": "4.14.181",
3436
"esbuild": "^0.17.11"
3537
}
3638
}

packages/meta-updater/src/updateTSConfig.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import exists from "path-exists";
55
import { TsConfigJson } from "type-fest";
66
import { toPosixPath } from "./toPosixPath";
77
import { Context } from "./Context";
8+
import { uniq } from "lodash";
89

910
/**
1011
* Given a tsconfig.json, update it to match our conventions. This function is
@@ -76,9 +77,7 @@ export async function updateTSConfig(
7677

7778
return {
7879
...input,
79-
extends: toPosixPath(
80-
path.join(pathFromPackageToRoot, "tsconfig.base.json"),
81-
),
80+
extends: getExtends(pathFromPackageToRoot, input.extends),
8281
compilerOptions: {
8382
...(input.compilerOptions ?? {}),
8483
rootDir: "src",
@@ -99,3 +98,23 @@ export async function updateTSConfig(
9998
],
10099
};
101100
}
101+
102+
function getExtends(
103+
pathFromPackageToRoot: string,
104+
inputExtends: string | string[] | undefined,
105+
) {
106+
let extendsList =
107+
inputExtends == null
108+
? []
109+
: Array.isArray(inputExtends)
110+
? [...inputExtends]
111+
: [inputExtends];
112+
113+
extendsList.push(
114+
toPosixPath(path.join(pathFromPackageToRoot, "tsconfig.base.json")),
115+
);
116+
117+
extendsList = uniq(extendsList);
118+
119+
return extendsList.length === 1 ? extendsList[0] : extendsList;
120+
}

0 commit comments

Comments
 (0)