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(deps): update docusaurus monorepo to v3.7.0 #953

Merged
merged 2 commits into from
Jan 21, 2025
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
50 changes: 9 additions & 41 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,44 +48,6 @@ const addAliasPlugin: PluginConfig = () => ({
}),
});

/**
* A workaround to override the docusaurus svgo config. By default docusaurus
* does not prefix the svg ids, which can cause conflicts when multiple svgs
* are used on the same page.
* https://github.com/facebook/docusaurus/issues/8297
*
* TODO: @charles - Remove this once docusaurus 3.7 is released
*/
// @ts-expect-error - No return value is expected
const prefixSvgIdsPlugin: PluginConfig = () => ({
name: 'prefix-svg-ids',
configureWebpack(config) {
const svgRule = config.module?.rules?.find(
(
rule
): rule is {
test: RegExp;
oneOf: Array<{ use: Array<{ options: { svgoConfig: { plugins: unknown[] } } }> }>;
} =>
rule !== null &&
typeof rule === 'object' &&
'test' in rule &&
rule.test instanceof RegExp &&
rule.test.source === '\\.svg$'
);

if (svgRule) {
const useRule = svgRule.oneOf[0]?.use?.[0];
const svgoConfig = useRule?.options.svgoConfig;

if (svgoConfig && Array.isArray(svgoConfig.plugins)) {
// eslint-disable-next-line @silverhand/fp/no-mutation
svgoConfig.plugins = [...svgoConfig.plugins, 'prefixIds'];
}
}
},
});

const gtagAwTrackingId = 'AW-11124811245';

const injectHeadTagsPlugin: PluginConfig = () => ({
Expand Down Expand Up @@ -215,6 +177,13 @@ const config: Config = {
theme: {
customCss: './src/scss/custom.scss',
},
svgr: {
svgrConfig: {
svgoConfig: {
plugins: ['preset-default', 'prefixIds'],
},
},
},
} satisfies Options,
],
],
Expand Down Expand Up @@ -315,8 +284,8 @@ const config: Config = {
icon: 'discord',
hideExternalLinkIcon: true,
},
]
}
],
},
],
copyright: `Designed by Silverhand Inc.`,
},
Expand Down Expand Up @@ -351,7 +320,6 @@ const config: Config = {
} satisfies ThemeConfig,
plugins: [
addAliasPlugin,
prefixSvgIdsPlugin,
injectHeadTagsPlugin,
'docusaurus-plugin-sass',
tutorialGenerator,
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@commitlint/types": "^19.5.0",
"@docusaurus/core": "3.6.3",
"@docusaurus/module-type-aliases": "3.6.3",
"@docusaurus/plugin-client-redirects": "3.6.3",
"@docusaurus/plugin-content-blog": "3.6.3",
"@docusaurus/plugin-content-docs": "3.6.3",
"@docusaurus/preset-classic": "3.6.3",
"@docusaurus/theme-classic": "3.6.3",
"@docusaurus/theme-common": "3.6.3",
"@docusaurus/theme-mermaid": "3.6.3",
"@docusaurus/tsconfig": "3.6.3",
"@docusaurus/types": "3.6.3",
"@docusaurus/core": "3.7.0",
"@docusaurus/module-type-aliases": "3.7.0",
"@docusaurus/plugin-client-redirects": "3.7.0",
"@docusaurus/plugin-content-blog": "3.7.0",
"@docusaurus/plugin-content-docs": "3.7.0",
"@docusaurus/preset-classic": "3.7.0",
"@docusaurus/theme-classic": "3.7.0",
"@docusaurus/theme-common": "3.7.0",
"@docusaurus/theme-mermaid": "3.7.0",
"@docusaurus/tsconfig": "3.7.0",
"@docusaurus/types": "3.7.0",
"@eslint/eslintrc": "^3.1.0",
"@mdx-js/react": "^3.1.0",
"@silverhand/eslint-config": "^6.0.0",
Expand Down
Loading
Loading