Skip to content

Commit

Permalink
feat: use bun
Browse files Browse the repository at this point in the history
  • Loading branch information
dan5py committed Sep 11, 2024
1 parent 3b02952 commit 24613c8
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 4,477 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
This is Turborepo starter with shadcn/ui pre-configured.

> [!NOTE]
> This example uses `pnpm` as package manager.
> This example uses `bun` as package manager.
[pnpm version](https://github.com/dan5py/turborepo-shadcn-ui/tree/main)
[npm version](https://github.com/dan5py/turborepo-shadcn-ui/tree/npm)

## Using this example
Expand All @@ -21,15 +22,15 @@ Install dependencies:

```sh
cd turborepo-shadcn-ui
pnpm install
bun install
```

### Add ui components

Use the pre-made script:

```sh
pnpm ui add <component-name>
bun ui add <component-name>
```

> This works just like the `shadcn/ui` CLI.
Expand All @@ -39,19 +40,19 @@ pnpm ui add <component-name>
Turborepo offer a simple command to add a new app:

```sh
pnpm turbo gen workspace --name <app-name>
bun turbo gen workspace --name <app-name>
```

This will create a new empty app in the `apps` directory.

If you want, you can copy an existing app with:

```sh
pnpm turbo gen workspace --name <app-name> --copy
bun turbo gen workspace --name <app-name> --copy
```

> [!NOTE]
> Remember to run `pnpm install` after copying an app.
> Remember to run `bun install` after copying an app.
## What's inside?

Expand Down Expand Up @@ -80,7 +81,7 @@ To build all apps and packages, run the following command:

```sh
cd turborepo-shadcn-ui
pnpm build
bun build
```

### Develop
Expand All @@ -89,7 +90,7 @@ To develop all apps and packages, run the following command:

```sh
cd turborepo-shadcn-ui
pnpm dev
bun dev
```

### Remote Caching
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
First, run the development server:

```bash
pnpm dev
bun dev
```

Open [http://localhost:3001](http://localhost:3001) with your browser to see the result.
Expand Down
Binary file added bun.lockb
Binary file not shown.
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
"dev": "turbo dev",
"lint": "turbo lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"ui": "pnpm --filter @repo/ui ui"
"ui": "bun --filter @repo/ui ui"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"prettier": "^3.3.3",
"turbo": "2.1.1"
},
"packageManager": "[email protected]",
"packageManager": "[email protected]",
"engines": {
"node": ">=18"
}
},
"workspaces": [
"./apps/*",
"./packages/*"
]
}
4 changes: 2 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"ui": "pnpm dlx shadcn@latest",
"ui": "bunx shadcn@latest",
"lint": "eslint ."
},
"peerDependencies": {
Expand All @@ -21,7 +21,7 @@
"typescript": "^5"
},
"dependencies": {
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-slot": "^1.1.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"lucide-react": "^0.395.0",
Expand Down
Loading

0 comments on commit 24613c8

Please sign in to comment.