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
17 changes: 8 additions & 9 deletions apps/blog/source.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ export default defineConfig({
remarkCodeTabOptions: { parseMdx: true },
remarkNpmOptions: {
persist: { id: "package-manager" },
// Custom package managers to add --bun flag for bunx commands
packageManagers: [
{
command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "npm"),
name: "npm",
command: (cmd: string) => {
const converted = convert(cmd.replace(/^npm init -y$/, "npm init"), "bun");
if (!converted) return undefined;
return converted.replace(/^bun x /, "bunx --bun ");
},
name: "bun",
},
{
command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "pnpm"),
Expand All @@ -74,12 +77,8 @@ export default defineConfig({
name: "yarn",
},
{
command: (cmd: string) => {
const converted = convert(cmd.replace(/^npm init -y$/, "npm init"), "bun");
if (!converted) return undefined;
return converted.replace(/^bun x /, "bunx --bun ");
},
name: "bun",
command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "npm"),
name: "npm",
},
],
},
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/source.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ export default defineConfig({
id: "package-manager",
},
packageManagers: [
{ command: (cmd: string) => convertLine(cmd, "npm"), name: "npm" },
{ command: (cmd: string) => convertLine(cmd, "pnpm"), name: "pnpm" },
{ command: (cmd: string) => convertLine(cmd, "yarn"), name: "yarn" },
{
command: (cmd: string) => {
const converted = convertLine(cmd, "bun");
Expand All @@ -102,6 +99,9 @@ export default defineConfig({
},
name: "bun",
},
{ command: (cmd: string) => convertLine(cmd, "pnpm"), name: "pnpm" },
{ command: (cmd: string) => convertLine(cmd, "yarn"), name: "yarn" },
{ command: (cmd: string) => convertLine(cmd, "npm"), name: "npm" },
],
},
},
Expand Down
17 changes: 8 additions & 9 deletions apps/eclipse/source.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ export default defineConfig({
persist: {
id: "package-manager",
},
// Custom package managers to add --bun flag for bunx commands
packageManagers: [
{
command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "npm"),
name: "npm",
command: (cmd: string) => {
const converted = convert(cmd.replace(/^npm init -y$/, "npm init"), "bun");
if (!converted) return undefined;
return converted.replace(/^bun x /, "bunx --bun ");
},
name: "bun",
},
{
command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "pnpm"),
Expand All @@ -46,12 +49,8 @@ export default defineConfig({
name: "yarn",
},
{
command: (cmd: string) => {
const converted = convert(cmd.replace(/^npm init -y$/, "npm init"), "bun");
if (!converted) return undefined;
return converted.replace(/^bun x /, "bunx --bun ");
},
name: "bun",
command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "npm"),
name: "npm",
},
],
},
Expand Down
26 changes: 26 additions & 0 deletions apps/site/source.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { remarkDirectiveAdmonition, remarkImage, remarkMdxFiles } from "fumadocs
import { defineCollections, defineConfig, frontmatterSchema } from "fumadocs-mdx/config";
import lastModified from "fumadocs-mdx/plugins/last-modified";
import { z } from "zod";
import convert from "npm-to-yarn";

export const releaseNotes = defineCollections({
type: "doc",
Expand Down Expand Up @@ -31,5 +32,30 @@ export default defineConfig({
remarkMdxFiles,
],
remarkCodeTabOptions: { parseMdx: true },
remarkNpmOptions: {
persist: { id: "package-manager" },
packageManagers: [
{
command: (cmd: string) => {
const converted = convert(cmd.replace(/^npm init -y$/, "npm init"), "bun");
if (!converted) return undefined;
return converted.replace(/^bun x /, "bunx --bun ");
},
name: "bun",
},
{
command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "pnpm"),
name: "pnpm",
},
{
command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "yarn"),
name: "yarn",
},
{
command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "npm"),
name: "npm",
},
],
},
},
});
Loading