Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(create-abell): add bun support in create-abell command #171

Merged
merged 1 commit into from
Oct 27, 2023
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/create-abell/src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ program
.option('-t|--template <template>', 'Specify template for abell app')
.option(
'-i|--installer <installer>',
'Specify package installer. npm, pnpm, or yarn.'
'Specify package installer. npm, pnpm, yarn, or bun.'
)
.arguments('[projectName]')
.action((projectName: string | undefined, options: CreateAbellOptions) =>
Expand Down
4 changes: 3 additions & 1 deletion packages/create-abell/src/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { colors, deleteDir, log, relative, run } from './utils';

export type CreateAbellOptions = {
installer?: 'npm' | 'yarn' | 'pnpm';
installer?: 'npm' | 'yarn' | 'pnpm' | 'bun';
template?: string;
};

Expand Down Expand Up @@ -61,6 +61,8 @@ async function create(
runCommand = 'yarn dev';
} else if (installCommand === 'pnpm install') {
runCommand = 'pnpm run dev';
} else if (installCommand === 'bun install') {
runCommand = 'bun run dev'
}

log.info(
Expand Down
10 changes: 8 additions & 2 deletions packages/create-abell/src/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export const getProjectInfo = async (projectNameArg: string | undefined) => {
* Prompts user to choose package installer if not defined
*/
export const getInstallCommand = async (
installerVal: 'npm' | 'yarn' | 'pnpm' | undefined
): Promise<'npm install' | 'pnpm install' | 'yarn'> => {
installerVal: 'npm' | 'yarn' | 'pnpm' | 'bun' | undefined
): Promise<'npm install' | 'pnpm install' | 'yarn' | 'bun install'> => {
if (!installerVal) {
// if installer flag is undefined, ask user.
const answers = await prompts({
Expand All @@ -66,6 +66,10 @@ export const getInstallCommand = async (
{
title: 'pnpm',
value: 'pnpm'
},
{
title: 'bun',
value: 'bun'
}
]
});
Expand All @@ -77,6 +81,8 @@ export const getInstallCommand = async (
return 'yarn';
} else if (installerVal === 'pnpm') {
return 'pnpm install';
} else if (installerVal === 'bun') {
return 'bun install';
} else {
return 'npm install';
}
Expand Down