Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,11 @@
},
"pnpm": {
"patchedDependencies": {
"@docusaurus/theme-search-algolia@2.3.1": "patches/@docusaurus__theme-search-algolia@2.3.1.patch"
"@docusaurus/theme-search-algolia@3.0.0-alpha.0": "patches/@docusaurus__theme-search-algolia@2.3.1.patch"
Copy link
Copy Markdown
Member Author

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 😅

},
"peerDependencyRules": {
"ignoreMissing": [
"@docusaurus/core",
"@docusaurus/mdx-loader",
"@docusaurus/plugin-content-blog",
"@docusaurus/preset-classic"
"react-json-view"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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",
Expand Down
13 changes: 8 additions & 5 deletions packages/cursorless-org-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
"dependencies": {
"@algolia/client-search": "4.15.0",
"@docsearch/react": "3.3.3",
"@docusaurus/core": "~2.3.1",
"@docusaurus/preset-classic": "~2.3.1",
"@docusaurus/theme-common": "2.3.1",
"@docusaurus/theme-search-algolia": "2.3.1",
"@mdx-js/react": "^1.6.22",
"@docusaurus/core": "3.0.0-alpha.0",
"@docusaurus/preset-classic": "3.0.0-alpha.0",
"@docusaurus/theme-classic": "3.0.0-alpha.0",
"@docusaurus/theme-common": "3.0.0-alpha.0",
"@docusaurus/theme-search-algolia": "3.0.0-alpha.0",
"@mdx-js/react": "2.3.0",
"clsx": "^1.2.1",
"mdast-util-find-and-replace": "^2.2.2",
"prism-react-renderer": "^1.3.5",
Expand All @@ -45,6 +46,8 @@
]
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.0.0-alpha.0",
"@tsconfig/docusaurus": "2.0.0",
"docusaurus-plugin-typedoc": "^0.18.0",
"typedoc": "^0.23.28",
"typedoc-plugin-markdown": "^3.14.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cursorless-org-docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": ["@tsconfig/docusaurus/tsconfig.json", "../../tsconfig.base.json"],
"compilerOptions": {
"rootDir": "src",
"esModuleInterop": true,
Expand Down
4 changes: 3 additions & 1 deletion packages/meta-updater/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
"@pnpm/types": "8.9.0",
"@types/normalize-path": "^3.0.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"normalize-path": "^3.0.0",
"path-exists": "^4.0.0",
"type-fest": "3.6.1"
"type-fest": "4.2.0"
},
"main": "./out/index.js",
"types": "./out/index.d.ts",
Expand All @@ -31,6 +32,7 @@
},
"devDependencies": {
"@types/js-yaml": "^4.0.2",
"@types/lodash": "4.14.181",
"esbuild": "^0.17.11"
}
}
25 changes: 22 additions & 3 deletions packages/meta-updater/src/updateTSConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -76,9 +77,7 @@ export async function updateTSConfig(

return {
...input,
extends: toPosixPath(
path.join(pathFromPackageToRoot, "tsconfig.base.json"),
),
extends: getExtends(pathFromPackageToRoot, input.extends),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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",
Expand All @@ -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;
}
Loading