-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## What's the problem this PR addresses? Some minor/nitpick-level problems with the website Note: This PR has *some* overlap with #6218. I'll rebase one when the other is merged ## How did you fix it? - Removed remnants of TypeScript misconfiguration created when first adding the docusaurus workspace via `create-docusaurus` - Reorganized the directory structure of the docusaurus workspace. In particular, moved stuff that is run in build-time (except the `docusaurus.config.ts` itself) to a `config` directory. May not seem like much but as more stuff gets added this can keep thing clean and manageable. - Used admonitions instead of plain text where appropriate - Made the remark plugins apply to the CHANGELOG (they weren't before) - Cleaned up and reorganized the dependencies. Of course there are different schools of philosophy regarding what should count as a dependency vs devDependency in a frontend app. Ultimately I decided for Docusaurus, it makes more sense to say everything needed to run `yarn build` successfully is a dep and devDeps are those that are purely for DX (e.g. types) - Removed babel and browserslist config as we are not using them at all ## 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.
- Loading branch information
Showing
27 changed files
with
164 additions
and
208 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
packages/docusaurus/config/docusaurus/plugins/webpack-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import type {Options as MDXLoaderOptions, MDXOptions} from '@docusaurus/mdx-loader'; | ||
import type {LoadContext, Plugin} from '@docusaurus/types'; | ||
import {createRequire} from 'node:module'; | ||
import path from 'node:path'; | ||
|
||
const webpack = createRequire(require.resolve(`@docusaurus/core/package.json`))(`webpack`); | ||
|
||
export type Options = { | ||
changelog: Partial<MDXOptions>; | ||
}; | ||
|
||
const plugin = async function(context: LoadContext, options: Options): Promise<Plugin> { | ||
return { | ||
name: `docusaurus-plugin-yarn-webpack-config`, | ||
configureWebpack(config, isServer, utils) { | ||
return { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.term\.dat$/, | ||
use: [require.resolve(`../../webpack/ansi-loader.js`)], | ||
}, | ||
{ | ||
test: /\.mdx?$/, | ||
include: require.resolve(`@yarnpkg/monorepo/CHANGELOG.md`), | ||
use: [ | ||
utils.getJSLoader({isServer}), | ||
{ | ||
loader: require.resolve(`@docusaurus/mdx-loader`), | ||
options: { | ||
admonitions: true, | ||
siteDir: context.siteDir, | ||
staticDirs: context.siteConfig.staticDirectories.map(dir => path.resolve(context.siteDir, dir)), | ||
isMDXPartial: () => true, | ||
isMDXPartialFrontMatterWarningDisabled: true, | ||
markdownConfig: context.siteConfig.markdown, | ||
...options.changelog, | ||
} satisfies MDXLoaderOptions, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
fallback: { | ||
fs: false, | ||
module: false, | ||
buffer: false, | ||
os: require.resolve(`os-browserify`), | ||
path: require.resolve(`path-browserify`), | ||
}, | ||
alias: { | ||
'@mdx-js/react': require.resolve(`@mdx-js/react`), | ||
react: path.resolve(require.resolve(`react/package.json`), `..`), | ||
}, | ||
}, | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
[`process.env`]: JSON.stringify({ | ||
NODE_ENV: `development`, | ||
}), | ||
[`process.platform`]: JSON.stringify(`browser`), | ||
[`process.versions`]: JSON.stringify({ | ||
node: `18.0.0`, | ||
}), | ||
}), | ||
], | ||
}; | ||
}, | ||
}; | ||
}; | ||
|
||
// eslint-disable-next-line arca/no-default-export | ||
export default plugin; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.