Skip to content
Open
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
8 changes: 4 additions & 4 deletions apps/blog/source.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ export default defineConfig({
persist: { id: "package-manager" },
// Custom package managers to add --bun flag for bunx commands
packageManagers: [
{ command: (cmd: string) => convert(cmd, "npm"), name: "npm" },
{ command: (cmd: string) => convert(cmd, "pnpm"), name: "pnpm" },
{ command: (cmd: string) => convert(cmd, "yarn"), name: "yarn" },
{ command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "npm"), name: "npm" },
{ 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) => {
const converted = convert(cmd, "bun");
const converted = convert(cmd.replace(/^npm init -y$/, "npm init"), "bun");
if (!converted) return undefined;
return converted.replace(/^bun x /, "bunx --bun ");
},
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/source.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import convert from "npm-to-yarn";
function convertLine(cmd: string, pm: "npm" | "pnpm" | "yarn" | "bun"): string {
return cmd
.split("\n")
.map((line) => convert(line, pm))
.map((line) => convert(line.replace(/^npm init -y$/, "npm init"), pm))
.join("\n");
}

Expand Down
8 changes: 4 additions & 4 deletions apps/eclipse/source.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ export default defineConfig({
},
// Custom package managers to add --bun flag for bunx commands
packageManagers: [
{ command: (cmd: string) => convert(cmd, 'npm'), name: 'npm' },
{ command: (cmd: string) => convert(cmd, 'pnpm'), name: 'pnpm' },
{ command: (cmd: string) => convert(cmd, 'yarn'), name: 'yarn' },
{ command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, 'npm init'), 'npm'), name: 'npm' },
{ 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) => {
const converted = convert(cmd, 'bun');
const converted = convert(cmd.replace(/^npm init -y$/, 'npm init'), 'bun');
if (!converted) return undefined;
return converted.replace(/^bun x /, 'bunx --bun ');
},
Expand Down
Loading