Skip to content

Commit

Permalink
Upgrade to Docusaurus 3.6.2
Browse files Browse the repository at this point in the history
Summary:
Based on the [official guide](https://docusaurus.io/docs/migration/v3) + the [Buck2 website upgrade](facebook/buck2@4a2f837#diff-fae242fbf77a8a9d52625664bc36ea12316586f8a716b41137d897a2b7e3df76R27) + extra fixes due to Markdown links.

* Remove explicit lunr search plugin, since it comes with the new version
* Opt-out from MDX since it caused a build error
* Remove outdated resolutions
* Bump `react-live` to avoid depending on the vulnerable `dom-iterator` package
* Add a resolution for `jackspeak` to avoid an [incompatibility with `yarn1`](isaacs/jackspeak#5)
* Fix broken links, now reported on build
* Fix theme definition according to new [sample project](https://github.com/facebook/docusaurus/blob/90e85e83a52b7d79d1d2f5e1a9ab5cfd21163c60/examples/classic/docusaurus.config.js#L7)

Reviewed By: alanz

Differential Revision: D66176653

fbshipit-source-id: a4f58fa2a0179c49d95cd143beae0797feb790b9
  • Loading branch information
robertoaloi authored and facebook-github-bot committed Nov 20, 2024
1 parent 8a1900c commit bfb0d09
Show file tree
Hide file tree
Showing 5 changed files with 4,546 additions and 3,108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 4

# Custom Project

If your project is not using `rebar3` or `buck2` as a build system, you can still [configure ELP to load the project configuration from a JSON file](./elp-toml.md#empty-section). This section describes the format of such a file.
If your project is not using `rebar3` or `buck2` as a build system, you can still [configure ELP to load the project configuration from a JSON file](./elp-toml.md#build-info). This section describes the format of such a file.

### The `build_info.json` format

Expand Down
12 changes: 6 additions & 6 deletions website/docs/get-started/configure-project/elp-toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ will not perform any upward auto-discovery for the structure of a project.
## A Sample `.elp.toml` Configuration File

Here is an example of a full `.elp.toml` file. All sections are optional. The
[build_info](#empty-section) can be used to mark the root of a project (via
[build_info](#build-info) can be used to mark the root of a project (via
the `build_info` property). The available configuration sections are described
below.

Expand All @@ -35,17 +35,17 @@ profile = "test"

## Configuration Sections

### \[build\_info\]
### \[build\_info\] {#build-info}

This section is used to configure project discovery.

| Key | Type | Description |
| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| file | String | Path to a JSON file describing the project. This is only honoured if `buck.enabled` is `false` or missing. The format of the JSON file is described in the [build_info.json](#the-build_infojson-format) section. |
| file | String | Path to a JSON file describing the project. This is only honoured if `buck.enabled` is `false` or missing. The format of the JSON file is described in the [build_info.json](custom-project.md#the-build_infojson-format) section. |
| apps | String | A string pattern used to generate the applications for the `build_info.json` configuration. Unused if `file` is specified. E.g. `apps/*`|
| deps | String | A string pattern used to generate the dependencies for the `build_info.json` configuration. Unused if `file` is specified. E.g. `deps/*`|

### \[eqwalizer\]
### \[eqwalizer\] {#eqwalizer}

ELP is integrated with the [eqWAlizer](https://github.com/whatsapp/eqwalizer)
type checker. The integration can be configured via this section.
Expand All @@ -66,7 +66,7 @@ This can be overriden per module via the following attributes:
| enabled_all | Boolean | Disable eqwalizer for all modules by default, but still honours the module-specific overrides listed above |
| max_tasks | Integer | Max number of parallel eqWAlizer tasks, defaults to 4 (eqWAlizer instances are memory intensive). This only applies to using eqWAlizer from the CLI. |

### \[buck\]
### \[buck\] {#buck}

Configure the interaction between ELP and the [Buck2](https://buck2.build/)
build tool. See [this presentation](https://youtu.be/4ALgsBqNBhQ) for details
Expand All @@ -83,7 +83,7 @@ change soon, once we tweak the tests.

:::

### \[rebar\]
### \[rebar\] {#rebar}

Configure ELP for [rebar3](https://rebar3.org/)-based projects.

Expand Down
17 changes: 8 additions & 9 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
* of this source tree.
*/


const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
import {themes as prismThemes} from 'prism-react-renderer';

// With JSDoc @type annotations, IDEs can provide config autocompletion
/** @type {import('@docusaurus/types').DocusaurusConfig} */
Expand Down Expand Up @@ -43,12 +41,13 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
],

plugins: [
[require.resolve('docusaurus-lunr-search'), {
excludeRoutes: [
]
}],
],

markdown: ({
// Use mdx for `.mdx` files and commonmark for `.md` files
format: 'detect',
}),

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
Expand Down Expand Up @@ -147,8 +146,8 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
copyright: `Copyright © ${new Date().getFullYear()} Meta Platforms, Inc. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['erlang'],
},
}),
Expand Down
42 changes: 11 additions & 31 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,14 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@babel/traverse": ">=7.23.2",
"@docusaurus/core": "2.4.3",
"@docusaurus/preset-classic": "2.4.3",
"@mdx-js/react": "^1.6.21",
"clsx": "^1.1.1",
"docusaurus-lunr-search": "^2.2.0",
"docusaurus-plugin-internaldocs-fb": "1.8.0",
"follow-redirects": ">=1.15.4",
"got": ">=11.8.5",
"prism-react-renderer": "^1.3.3",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@docusaurus/core": "3.6.2",
"@docusaurus/preset-classic": "3.6.2",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.3.0",
"docusaurus-plugin-internaldocs-fb": "^1.18.4",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"browserslist": {
"production": [
Expand All @@ -49,25 +45,9 @@
"yarn-audit-fix": "^9.3.10"
},
"resolutions": {
"@babel/traverse": ">=7.23.2",
"cookie": ">=0.7.0",
"got": ">=11.8.5",
"trim": ">=0.0.3",
"wait-on": ">=7.2.0",
"follow-redirects": ">=1.15.4",
"braces": ">=3.0.3",
"ws": ">=8.17.1",
"axios": ">=1.7.4",
"micromatch": ">=4.0.8",
"webpack": "5.94.0",
"path-to-regexp": "<0.2.0",
"dompurify": ">=2.5.4 ",
"body-parser": ">1.20.3",
"send": ">0.19.0",
"express": ">=4.20.0",
"serve-static": ">=1.16.0",
"mermaid": ">=10.9.3",
"http-proxy-middleware": ">=2.0.7",
"cross-spawn": ">=7.0.5"
"cross-spawn": ">=6.0.6",
"react-live": ">=3.2.0",
"jackspeak": "2.1.1"
}
}
Loading

0 comments on commit bfb0d09

Please sign in to comment.