Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/docusaurus-remark-plugin-npm2yarn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = {
| Property | Type | Default | Description |
| --- | --- | --- | --- |
| `sync` | `boolean` | `false` | Syncing tab choices (Yarn and npm). See https://docusaurus.io/docs/markdown-features/#syncing-tab-choices for details. |
| `converters` | `array` | `'yarn'`, `'pnpm'`, `'bun'` | The list of converters to use. The order of the converters is important, as the first converter will be used as the default choice. |
| `converters` | `array` | `['yarn', 'pnpm', 'bun']` | The list of converters to use. The order of the converters is important, as the first converter will be used as the default choice. |

## Custom converters

Expand Down
Binary file modified packages/docusaurus-remark-plugin-npm2yarn/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ import TabItem from '@theme/TabItem'
$ pnpm add --global docusaurus
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
$ bun add --global docusaurus
\`\`\`
</TabItem>
</Tabs>

<div className="nested-npm2yarn">
Expand All @@ -45,6 +51,12 @@ import TabItem from '@theme/TabItem'
pnpm install
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
bun install
\`\`\`
</TabItem>
</Tabs>
</div>

Expand Down Expand Up @@ -72,6 +84,12 @@ echo "no npm2yarn here"
yarn add @docusaurus/core
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
yarn add @docusaurus/core
\`\`\`
</TabItem>
</Tabs>
"
`;
Expand Down Expand Up @@ -99,6 +117,12 @@ import TabItem from '@theme/TabItem';
$ pnpm add --global docusaurus
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
$ bun add --global docusaurus
\`\`\`
</TabItem>
</Tabs>
"
`;
Expand All @@ -122,6 +146,12 @@ exports[`npm2yarn plugin does not re-import tabs components when already importe
$ pnpm add --global docusaurus
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
$ bun add --global docusaurus
\`\`\`
</TabItem>
</Tabs>

import Tabs from '@theme/Tabs';
Expand Down Expand Up @@ -263,6 +293,12 @@ import TabItem from '@theme/TabItem'
$ pnpm add --global docusaurus
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
$ bun add --global docusaurus
\`\`\`
</TabItem>
</Tabs>
"
`;
Expand Down Expand Up @@ -293,6 +329,12 @@ A plugin is usually a npm package, so you install them like other npm packages u
pnpm add docusaurus-plugin-name
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
bun add docusaurus-plugin-name
\`\`\`
</TabItem>
</Tabs>
"
`;
Expand All @@ -319,6 +361,12 @@ import TabItem from '@theme/TabItem'
pnpm run xxx --arg
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
bun run xxx --arg
\`\`\`
</TabItem>
</Tabs>

<Tabs groupId="npm2yarn">
Expand All @@ -339,6 +387,12 @@ import TabItem from '@theme/TabItem'
pnpm add package
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
bun add package
\`\`\`
</TabItem>
</Tabs>

<Tabs groupId="npm2yarn">
Expand All @@ -359,6 +413,12 @@ import TabItem from '@theme/TabItem'
pnpm remove package-name
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
bun remove package-name
\`\`\`
</TabItem>
</Tabs>

<Tabs groupId="npm2yarn">
Expand All @@ -382,6 +442,13 @@ import TabItem from '@theme/TabItem'
pnpm create docusaurus@latest my-website classic
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
bunx create-docusaurus
bunx create-docusaurus@latest my-website classic
\`\`\`
</TabItem>
</Tabs>
"
`;
Expand Down Expand Up @@ -412,6 +479,12 @@ Hey
pnpm add test
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
bun add test
\`\`\`
</TabItem>
</Tabs>
"
`;
Expand Down Expand Up @@ -442,6 +515,12 @@ A plugin is usually a npm package, so you install them like other npm packages u
pnpm add docusaurus-plugin-name
\`\`\`
</TabItem>

<TabItem value="bun" label="Bun">
\`\`\`bash
bun add docusaurus-plugin-name
\`\`\`
</TabItem>
</Tabs>
"
`;
2 changes: 1 addition & 1 deletion packages/docusaurus-remark-plugin-npm2yarn/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function createImportNode() {
}

const plugin: Plugin<[PluginOptions?]> = (options = {}): Transformer => {
const {sync = false, converters = ['yarn', 'pnpm']} = options;
const {sync = false, converters = ['yarn', 'pnpm', 'bun']} = options;
return async (root) => {
const {visit} = await import('unist-util-visit');

Expand Down