mirror of
https://github.com/strapi/strapi.git
synced 2026-05-03 16:22:30 +00:00
chore: upgrade contributor docs dependencies (#26073)
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ A Request For Comments has to be created on the [strapi/rfcs](https://github.com
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project, and everyone participating in it, are governed by the [Strapi Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold it. Make sure to read the [full text](CODE_OF_CONDUCT.md) to understand which type of actions may or may not be tolerated.
|
||||
This project, and everyone participating in it, are governed by the [Strapi Code of Conduct](https://github.com/strapi/strapi/blob/main/CODE_OF_CONDUCT.md). By participating, you are expected to uphold it. Make sure to read the [full text](https://github.com/strapi/strapi/blob/main/CODE_OF_CONDUCT.md) to understand which type of actions may or may not be tolerated.
|
||||
|
||||
## Contributor License Agreement (CLA)
|
||||
|
||||
|
||||
@@ -46,11 +46,16 @@ const config = {
|
||||
}),
|
||||
[
|
||||
'docusaurus-plugin-typedoc',
|
||||
// Plugin / TypeDoc options
|
||||
{
|
||||
entryPoints: ['../packages/core/strapi/src/admin.ts'],
|
||||
tsconfig: '../packages/core/strapi/tsconfig.build.json',
|
||||
entryDocument: null,
|
||||
// `readme: 'none'` uses a single project page (no separate index). Together with
|
||||
// `entryDocument: 'modules.md'` this avoids generating `index.md` (invalid MDX: bare `<br>` tags).
|
||||
// Do not set `entryDocument: null` — it becomes an empty URL and TypeDoc tries to write
|
||||
// to the output directory (EISDIR: "Could not write .../exports").
|
||||
readme: 'none',
|
||||
entryDocument: 'modules.md',
|
||||
// Plugin output is under the docs content root (`site/docs/`); use `exports`, not `docs/exports`.
|
||||
out: 'exports',
|
||||
watch: process.env.TYPEDOC_WATCH,
|
||||
},
|
||||
@@ -71,6 +76,7 @@ const config = {
|
||||
routeBasePath: '/',
|
||||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
editUrl: 'https://github.com/strapi/strapi/tree/main/docs/',
|
||||
remarkPlugins: [require('./remark-design-system-links')],
|
||||
},
|
||||
blog: false,
|
||||
},
|
||||
|
||||
+12
-9
@@ -31,21 +31,24 @@
|
||||
"@babel/runtime-corejs3": "7.26.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cmfcmf/docusaurus-search-local": "1.1.0",
|
||||
"@docusaurus/core": "3.9.2",
|
||||
"@docusaurus/preset-classic": "3.9.2",
|
||||
"@docusaurus/theme-mermaid": "3.9.2",
|
||||
"@mdx-js/react": "^3.0.0",
|
||||
"clsx": "^1.1.1",
|
||||
"prism-react-renderer": "^2.4.1",
|
||||
"@cmfcmf/docusaurus-search-local": "2.0.1",
|
||||
"@docusaurus/core": "3.10.0",
|
||||
"@docusaurus/preset-classic": "3.10.0",
|
||||
"@docusaurus/theme-mermaid": "3.10.0",
|
||||
"@mdx-js/react": "3.1.1",
|
||||
"clsx": "2.1.1",
|
||||
"prism-react-renderer": "2.4.1",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "3.9.2",
|
||||
"@docusaurus/module-type-aliases": "3.10.0",
|
||||
"@types/react": "18.3.2",
|
||||
"@types/react-dom": "18.3.0",
|
||||
"docusaurus-plugin-typedoc": "0.22.0",
|
||||
"typedoc": "0.25.10",
|
||||
"typedoc-plugin-markdown": "3.17.1",
|
||||
"typescript": "5.4.5"
|
||||
"typescript": "5.4.5",
|
||||
"unist-util-visit": "5.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
const { visit } = require('unist-util-visit');
|
||||
|
||||
const DESIGN_SYSTEM = 'https://design-system.strapi.io';
|
||||
|
||||
/**
|
||||
* TypeDoc pulls JSDoc from @strapi/design-system .d.ts files. Those comments link to Storybook
|
||||
* using paths like `[Label](../?path=/docs/foundations-responsive--docs)` which resolve as site-relative
|
||||
* URLs in Docusaurus and fail the link checker. Map them to the public Storybook host.
|
||||
*/
|
||||
function remarkDesignSystemLinks() {
|
||||
return (tree) => {
|
||||
visit(tree, 'link', (node) => {
|
||||
if (typeof node.url !== 'string') {
|
||||
return;
|
||||
}
|
||||
let m = node.url.match(/^\.\.\/\?path=(.+)$/);
|
||||
if (m) {
|
||||
node.url = `${DESIGN_SYSTEM}/?path=${m[1]}`;
|
||||
return;
|
||||
}
|
||||
m = node.url.match(/^\.\.\?path=(.+)$/);
|
||||
if (m) {
|
||||
node.url = `${DESIGN_SYSTEM}/?path=${m[1]}`;
|
||||
}
|
||||
});
|
||||
visit(tree, 'html', (node) => {
|
||||
if (typeof node.value !== 'string' || !node.value.includes('?path=')) {
|
||||
return;
|
||||
}
|
||||
node.value = node.value.replace(/href="\.\.\/\?path=([^"]+)"/g, (_, p) => {
|
||||
return `href="${DESIGN_SYSTEM}/?path=${p}"`;
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = remarkDesignSystemLinks;
|
||||
+519
-538
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user