Skip to content

Commit

Permalink
Merge pull request #953 from logto-io/renovate/docusaurus-monorepo
Browse files Browse the repository at this point in the history
chore(deps): update docusaurus monorepo to v3.7.0
  • Loading branch information
charIeszhao authored Jan 21, 2025
2 parents 1a150a7 + 42c1fc5 commit 72b7eb3
Show file tree
Hide file tree
Showing 3 changed files with 467 additions and 624 deletions.
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

0 comments on commit 72b7eb3

Please sign in to comment.