Skip to content

Commit

Permalink
chore: bun is required to setup the project
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Jan 14, 2024
1 parent 2534d0c commit d60333f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Installation

```
yarn && yarn build
npm install && npm run build
```

## Link package
Expand Down
4 changes: 3 additions & 1 deletion bin/cb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export const cbResultExpo = (
shell.echo(chalk.greenBright(`Created ${nameOfApp} successfully.`));

shell.echo(
chalk.greenBright(`Run cd ${nameOfApp} and yarn && yarn start.`),
chalk.greenBright(
`Run cd ${nameOfApp} and bun install && bun start.`,
),
);

spinner.stop();
Expand Down
20 changes: 10 additions & 10 deletions bin/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ program
shell.exit(1);
}

if (!shell.which('yarn')) {
if (!shell.which('bun')) {
shell.echo(
chalk.redBright(
'Sorry, this script requires yarn to be installed.',
'Sorry, this script requires bun to be installed. Install bun with `npm install -g bun`.',
),
);

Expand Down Expand Up @@ -230,10 +230,10 @@ program
if (!exists) {
shell.echo(chalk.cyanBright('Installing dependencies...'));

shell.exec('yarn', (code) => {
shell.exec('bun install', (code) => {
if (code === 0) {
shell.echo(chalk.cyanBright('Running project...\n'));
shell.exec('yarn start');
shell.exec('bun start');

return;
}
Expand All @@ -245,13 +245,13 @@ program
}

shell.echo(chalk.cyanBright('Running project...'));
shell.exec('yarn start');
shell.exec('bun start');
} catch (err) {
shell.echo(chalk.red(err));

shell.echo(
chalk.redBright(
'Failed while installing dependencies. Please try again with yarn.',
'Failed while installing dependencies. Please try again after `bun install`.',
),
);
} finally {
Expand All @@ -274,10 +274,10 @@ program
if (!exists) {
shell.echo(chalk.cyanBright('Installing dependencies...'));

shell.exec('yarn', (code) => {
shell.exec('bun', (code) => {
if (code === 0) {
shell.echo(chalk.cyanBright('Running project...'));
shell.exec('yarn test');
shell.exec('bun run test');
spinner.stop();

// process.exit(0);
Expand All @@ -286,7 +286,7 @@ program

shell.echo(
chalk.redBright(
'Failed installing dependencies. Please try again with yarn.',
'Failed installing dependencies. Please try again after `bun install`.',
),
);
});
Expand All @@ -295,7 +295,7 @@ program
}

shell.echo(chalk.cyanBright('Testing project...'));
shell.exec('yarn test');
shell.exec('bun run test');
spinner.stop();
// process.exit(0);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dooboo",
"version": "0.1.8",
"version": "0.1.9",
"description": "Expo and expo router starter kit maintained by dooboolab.",
"bin": {
"dooboo": "lib/bin/root.js"
Expand Down

0 comments on commit d60333f

Please sign in to comment.