Skip to content

Commit

Permalink
refactor(docs): Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
clemyan committed Apr 15, 2024
1 parent 6344f7f commit 0451017
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/docusaurus/config/docusaurus/plugins/cli-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const loader = jiti(__filename, {
requireCache: false,
});

const binaries = [
const binaries: Array<{ name: string, getCli: () => Promise<Cli<BaseContext>>, watch: Array<string> }> = [
{
name: `@yarnpkg/cli`,
getCli: async () => {
Expand Down Expand Up @@ -57,7 +57,7 @@ const binaries = [
},
watch: [`../yarnpkg-sdks/sources/commands/**/*.ts`],
},
] satisfies Array<{ name: string, getCli: () => Promise<Cli<BaseContext>>, watch?: Array<string> }>;
];

export type Options = {
remarkPlugins: Array<MDXPlugin>;
Expand Down Expand Up @@ -306,9 +306,9 @@ const plugin = async function(context: LoadContext, options: Options): Promise<P
})),
);
},
async contentLoaded({content: binaries, actions}) {
async contentLoaded({content, actions}) {
const pages = await Promise.all(
Object.entries(binaries).map(([packageName, definitions]) => createBinaryPages(packageName, definitions, actions)),
Object.entries(content).map(([packageName, definitions]) => createBinaryPages(packageName, definitions, actions)),
);

const version = await actions.createData(`version-metadata.json`, JSON.stringify({
Expand Down Expand Up @@ -354,7 +354,7 @@ const plugin = async function(context: LoadContext, options: Options): Promise<P
rules: [
{
test: /\.mdx$/,
include: path.join(context.generatedFilesDir, PLUGIN_NAME),
include: path.join(context.generatedFilesDir, PLUGIN_NAME, `default`),
use: [
utils.getJSLoader({isServer}),
{
Expand All @@ -378,7 +378,7 @@ const plugin = async function(context: LoadContext, options: Options): Promise<P
},

getPathsToWatch() {
return binaries.flatMap(({watch}) => watch ?? []);
return binaries.flatMap(({watch}) => watch);
},
};
};
Expand Down

0 comments on commit 0451017

Please sign in to comment.