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
2 changes: 2 additions & 0 deletions .github/workflows/v2-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ jobs:
install-command: yarn
- name: Test
run: yarn test
- name: TypeCheck website
run: yarn workspace website tsc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.5",
"@tsconfig/docusaurus": "^1.0.3",
"@tsconfig/docusaurus": "^1.0.4",
"@types/react": "^17.0.14",
"@types/react-helmet": "^6.1.2",
"@types/react-router-dom": "^5.1.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@tsconfig/docusaurus/tsconfig.json",
"compilerOptions": {
"paths": {
"@site/*": ["./*"]
}
},
"include": ["src/"]
"baseUrl": "."
}
}
12 changes: 7 additions & 5 deletions packages/docusaurus-mdx-loader/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/

declare module '@docusaurus/mdx-loader' {
type RemarkOrRehypePlugin =
// eslint-disable-next-line @typescript-eslint/ban-types
[Function, Record<string, unknown>] | Function;
export interface RemarkAndRehypePluginOptions {
remarkPlugins: RemarkOrRehypePlugin[];
rehypePlugins: string[];
Expand All @@ -18,7 +21,7 @@ declare module '@docusaurus/mdx-loader' {
declare module '@mdx-js/mdx' {
import type {Plugin, Processor} from 'unified';

export namespace mdx {
namespace mdx {
interface Options {
filepath?: string;
skipExport?: boolean;
Expand All @@ -31,8 +34,7 @@ declare module '@mdx-js/mdx' {
function createMdxAstCompiler(options?: Options): Processor;
function createCompiler(options?: Options): Processor;
}
export default function mdx(
content: string,
options?: mdx.Options,
): Promise<string>;
function mdx(content: string, options?: mdx.Options): Promise<string>;

export default mdx;
}
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-content-blog/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ declare module '@theme/BlogSidebar' {

declare module '@theme/BlogPostPage' {
import type {BlogSidebar} from '@theme/BlogSidebar';
import type {TOCItem} from '@docusaurus/types';

export type FrontMatter = import('./src/blogFrontMatter').BlogPostFrontMatter;
export type Assets = import('./src/types').Assets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,11 @@ export type ActivePlugin = {
pluginData: GlobalPluginData;
};

export type GetActivePluginOptions = {failfast?: boolean};
export type GetActivePluginOptions = {failfast?: boolean}; // use fail-fast option if you know for sure one plugin instance is active

// get the data of the plugin that is currently "active"
// ie the docs of that plugin are currently browsed
// it is useful to support multiple docs plugin instances
export function getActivePlugin(
allPluginDatas: Record<string, GlobalPluginData>,
pathname: string,
options: {failfast: true}, // use fail-fast option if you know for sure one plugin instance is active
): ActivePlugin;
export function getActivePlugin(
allPluginDatas: Record<string, GlobalPluginData>,
pathname: string,
options?: GetActivePluginOptions,
): ActivePlugin | undefined;

export function getActivePlugin(
allPluginDatas: Record<string, GlobalPluginData>,
pathname: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ declare module '@theme/DocPage' {
}

declare module '@theme/Seo' {
import type {ReactNode} from 'react';

export type Props = {
readonly title?: string;
readonly description?: string;
Expand All @@ -184,15 +186,16 @@ declare module '@theme/hooks/useDocs' {
type ActivePlugin = import('./client/docsClientUtils').ActivePlugin;
type ActiveDocContext = import('./client/docsClientUtils').ActiveDocContext;
type DocVersionSuggestions = import('./client/docsClientUtils').DocVersionSuggestions;
type GetActivePluginOptions = import('./client/docsClientUtils').GetActivePluginOptions;

export type {GlobalPluginData, GlobalVersion};
export const useAllDocsData: () => Record<string, GlobalPluginData>;
export const useDocsData: (pluginId?: string) => GlobalPluginData;
export const useActivePlugin: (
options: GetActivePluginOptions = {},
options?: GetActivePluginOptions,
) => ActivePlugin | undefined;
export const useActivePluginAndVersion: (
options: GetActivePluginOptions = {},
options?: GetActivePluginOptions,
) =>
| {activePlugin: ActivePlugin; activeVersion: GlobalVersion | undefined}
| undefined;
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-theme-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.5",
"@types/parse-numeric-range": "^0.0.1"
"@types/parse-numeric-range": "^0.0.1",
"utility-types": "^3.10.0"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ declare module '@theme/TagsListInline' {

declare module '@theme/Tag' {
import type {TagsListItem} from '@theme/TagsListByLetter';
import type {Optional} from 'utility-types';

export type Props = Optional<TagsListItem, 'count'>;

Expand Down
5 changes: 3 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"netlify:crowdin:downloadTranslations": "yarn netlify:crowdin:wait && yarn --cwd .. crowdin:download:website",
"netlify:crowdin:downloadTranslationsFailSafe": "yarn netlify:crowdin:wait && (yarn --cwd .. crowdin:download:website || echo 'Crowdin translation download failure (only internal PRs have access to the Crowdin env token)')",
"netlify:crowdin:uploadSources": "yarn --cwd .. crowdin:upload:website",
"netlify:test": "yarn netlify:build:deployPreview && yarn netlify dev --debug"
"netlify:test": "yarn netlify:build:deployPreview && yarn netlify dev --debug",
"typecheck": "tsc"
},
"dependencies": {
"@crowdin/cli": "^3.5.2",
Expand Down Expand Up @@ -63,7 +64,7 @@
]
},
"devDependencies": {
"@tsconfig/docusaurus": "^1.0.3",
"@tsconfig/docusaurus": "^1.0.4",
"cross-env": "^7.0.3",
"raw-loader": "^4.0.2"
}
Expand Down
6 changes: 2 additions & 4 deletions website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@tsconfig/docusaurus/tsconfig.json",
"compilerOptions": {
"paths": {
"@site/*": ["./*"]
},
"baseUrl": ".",
"resolveJsonModule": true
},
"include": ["src/"]
"exclude": ["src/sw.js"]
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3849,10 +3849,10 @@
resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.1.1.tgz#3348564048e7a2d7398c935d466c0414ebb6a669"
integrity sha512-Z6DoceYb/1xSg5+e+ZlPZ9v0N16ZvZ+wYMraFue4HYrE4ttONKtsvruIRf6t9TBR0YvSOfi1hUU0fJfBLCDYow==

"@tsconfig/docusaurus@^1.0.3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@tsconfig/docusaurus/-/docusaurus-1.0.3.tgz#040582bdceb27336d7abf2301fb0f4c909a9ac2f"
integrity sha512-g4X3HvNXbkowvEdPLu759fZjbXoazPjvi2a/fAAITp2yMOGeSKpHuY6N538ZY+1u6Z91Er3QKPtYGdZQ+tqXUA==
"@tsconfig/docusaurus@^1.0.4":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@tsconfig/docusaurus/-/docusaurus-1.0.4.tgz#fc40f87a672568678d83533dd4031a09d75877ca"
integrity sha512-I6sziQAzLrrqj9r6S26c7aOAjfGVXIE7gWdNONPwnpDcHiMRMQut1s1YCi/APem3dOy23tAb2rvHfNtGCaWuUQ==

"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7":
version "7.1.14"
Expand Down