Skip to content

Commit

Permalink
Add API Reference to website (#5922)
Browse files Browse the repository at this point in the history
**What's the problem this PR addresses?**
<!-- Describe the rationale of your PR. -->
<!-- Link all issues that it closes. (Closes/Resolves #xxxx.) -->

The API reference is not available in new website

**How did you fix it?**
<!-- A detailed description of your implementation. -->

This is a WIP to bring the API reference to the new website via
`docusaurus-plugin-typedoc-api`.

The current state is has some kinks and issues to work out. The purpose
of this draft PR is to track and discuss. I'll sort those out over time
but if anyone wants to take over then be my guest.

- ~~Seems like `docusaurus-plugin-typedoc-api` need to use the instance
from `@docusaurus/theme-common` and `@docusaurus/plugin-content-docs`
used by the main doc, which were hidden inside
`@docusaurus/preset-classic`. I added package extensions to resolve them
but that seems brittle.~~
- ~~Docusaurus's MDX loader resolves `react` and `@mdx-js/react` from
the loaded Markdown file. To include READMEs into the API reference we
need every workspace to depend on `react` and `@mdx-js/react` which is
not very reasonable. For now I use `pnpFallbackMode: all` so they
fallback to the `react` and `@mdx-js/react` in the top-level but again
seems brittle.~~
- ~~Only resolve one entrypoint for each workspace. Tried multiple
entries and some pages broke. Maybe try again later?~~
- ~~Some stuff have duplicate source links due to virtual paths. Need to
deduplicate~~
- ~~Functions receive dedicated pages but the header is just "Callable".
Ideally I want them to be just in the index page like variables~~

**Checklist**
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).

<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.

<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.

---------

Co-authored-by: Maël Nison <[email protected]>
  • Loading branch information
clemyan and arcanis authored Nov 14, 2023
1 parent d47d066 commit 017b94a
Show file tree
Hide file tree
Showing 31 changed files with 1,182 additions and 54 deletions.
239 changes: 201 additions & 38 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
64 changes: 64 additions & 0 deletions .yarn/patches/@docusaurus-mdx-loader-npm-2.4.3-0d95b4751a.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
diff --git a/lib/loader.d.ts.map b/lib/loader.d.ts.map
index f6fe486305f2a29b7b1545c1f61c756eb37a9722..1fac9acbbb2ddb843dbc17ef680c5de675aea2ce 100644
--- a/lib/loader.d.ts.map
+++ b/lib/loader.d.ts.map
@@ -1 +1 @@
-{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAsBH,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAY,MAAM,EAAC,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAsB5D,oBAAY,SAAS,GAEnB;IAAC,MAAM,CAAC,GAAG,EAAE,CAAC;IAAE,GAAG;CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;AAEvC,oBAAY,UAAU,GAAG;IACvB,WAAW,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACzC,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,0BAA0B,EAAE,SAAS,EAAE,CAAC;IACxC,0BAA0B,EAAE,SAA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-8,6 +8,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.mdxLoader = void 0;
const tslib_1 = require("tslib");
+const url_1 = require("url");
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
const logger_1 = tslib_1.__importDefault(require("@docusaurus/logger"));
const utils_1 = require("@docusaurus/utils");
@@ -200,8 +201,8 @@ ${assets ? `export const assets = ${createAssetsExportCode(assets)};` : ''}
`;
const code = `
${pragma}
-import React from 'react';
-import { mdx } from '@mdx-js/react';
+import React from "${(0, url_1.pathToFileURL)(require.resolve('react'))}";
+import { mdx } from "${(0, url_1.pathToFileURL)(require.resolve('@mdx-js/react'))}";

${exportsCode}
${result}
diff --git a/lib/loader.js.map b/lib/loader.js.map
index 69559491cd0bf61e0ed80fea0ac135417c90eb2e..e7e34bea9301772fd7315550d5b8296c87945202 100644
--- a/lib/loader.js.map
+++ b/lib/loader.js.map
@@ -1 +1 @@
-{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,gEAA0B;AAC1B,wEAAwC;AACxC,6CAK2B;AAC3B,qCAA2C;AAC3C,wEAAiC;AACjC,gFAA+C;AAE/C,yEAAyC;AACzC,+DAA+B;AAC/B,+FAA+D;AAC/D,qFAAqD;AACrD,qFAAqD;AACrD,uEAAuC;AAEvC,+EAAwD;AAMxD,MAAM,EACJ,OAAO,EAAE,EAAC,6BAA6B,EAAC,GACzC,GAAG,IAAA,0BAAkB,GAAE,CAAC;AAEzB,MAAM,MAAM,GAAG;;;;CAId,CAAC;AAEF,MAAM,eAAe,GAAe;IAClC,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,EAAE;IACjB,aAAa,EAAE,CAAC,6BAAmB,EAAE,sBAAK,EAAE,kBAAQ,EAAE,aAAG,CAAC;IAC1D,0BAA0B,EAAE,EAAE;IAC9B,0BAA0B,EAAE,EAAE;CAC/B,CAAC;AAEF,MAAM,aAAa,GAAG,IAAI,GAAG,EA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AC;QACtC,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,QAAQ,GAAG,kBAAkB;QACjC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAA8B;QAC9D,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,MAAM,GACV,UAAU,CAAC,YAAY,IAAI,QAAQ;QACjC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,EAAC,WAAW,EAAE,QAAQ,EAAC,CAAC;QAClD,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,WAAW,GAAG;6BACO,IAAA,0BAAe,EAAC,WAAW,CAAC;8BAC3B,IAAA,0BAAe,EAAC,YAAY,CAAC;EACzD,kBAAkB,CAAC,CAAC,CAAC,2BAA2B,kBAAkB,GAAG,CAAC,CAAC,CAAC,EAAE;EAC1E,MAAM,CAAC,CAAC,CAAC,yBAAyB,sBAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;CACzE,CAAC;IAEA,MAAM,IAAI,GAAG;EACb,MAAM;qBACa,IAAA,mBAAa,EAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;uBACrC,IAAA,mBAAa,EAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;;EAEpE,WAAW;EACX,MAAM;CACP,CAAC;IAEA,OAAO,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9B,CAAC;AAlID,8BAkIC"}
\ No newline at end of file
diff --git a/src/loader.ts b/src/loader.ts
index 1b40d5833c8d61784ba12e310a6b558a5c678c05..e2a75d25dec39981d7cf18ba052c8cb92a04834c 100644
--- a/src/loader.ts
+++ b/src/loader.ts
@@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

+import {pathToFileURL} from 'url';
import fs from 'fs-extra';
import logger from '@docusaurus/logger';
import {
@@ -274,8 +275,8 @@ ${assets ? `export const assets = ${createAssetsExportCode(assets)};` : ''}

const code = `
${pragma}
-import React from 'react';
-import { mdx } from '@mdx-js/react';
+import React from "${pathToFileURL(require.resolve('react'))}";
+import { mdx } from "${pathToFileURL(require.resolve('@mdx-js/react'))}";

${exportsCode}
${result}
Loading

0 comments on commit 017b94a

Please sign in to comment.