Skip to content
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

chore(website): add Rsdoctor plugin #10418

Merged
merged 7 commits into from
Aug 20, 2024
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
3 changes: 3 additions & 0 deletions project-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ Retrocompatibility
retrocompatible
Retrocompatible
rmiz
rsdoctor
Rsdoctor
RSDOCTOR
rtcts
rtlcss
saurus
Expand Down
2 changes: 2 additions & 0 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import npm2yarn from '@docusaurus/remark-plugin-npm2yarn';
import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';
import configTabs from './src/remark/configTabs';
import RsdoctorPlugin from './src/plugins/rsdoctor/RsdoctorPlugin';

import versions from './versions.json';
import VersionsArchived from './versionsArchived.json';
Expand Down Expand Up @@ -270,6 +271,7 @@ export default async function createConfigAsync() {
],
themes: ['live-codeblock', ...dogfoodingThemeInstances],
plugins: [
RsdoctorPlugin,
[
'./src/plugins/changelog/index.js',
{
Expand Down
1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"devDependencies": {
"@docusaurus/eslint-plugin": "3.5.2",
"@docusaurus/tsconfig": "3.5.2",
"@rsdoctor/webpack-plugin": "^0.3.11",
"@types/color": "^3.0.4",
"@types/jest": "^29.5.3",
"cross-env": "^7.0.3",
Expand Down
44 changes: 44 additions & 0 deletions website/src/plugins/rsdoctor/RsdoctorPlugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import type {PluginConfig} from '@docusaurus/types';

async function createRsdoctorBundlerPlugin() {
// TODO Shitty workaround to bypass lib typechecking
// package does not work will with skipLibCheck false
// eslint-disable-next-line
const {RsdoctorWebpackMultiplePlugin} = require('@rsdoctor/webpack-plugin');
Comment on lines +11 to +14
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not fan of this but will merge the PR as-is until the Rsdoctor maintainer gives me feedback


return new RsdoctorWebpackMultiplePlugin({
disableTOSUpload: true,
supports: {
// https://rsdoctor.dev/config/options/options#generatetilegraph
generateTileGraph: true,
},
linter: {
rules: {
'ecma-version-check': 'off',
},
},
});
}

export default (async function RsdoctorPlugin() {
if (!process.env.RSDOCTOR) {
return null;
}
const plugin = await createRsdoctorBundlerPlugin();
console.log('Rsdoctor plugin enabled');
return {
name: 'rsdoctor-plugin',
configureWebpack: () => {
return {
plugins: [plugin],
};
},
};
} satisfies PluginConfig);
Loading