Skip to content

Commit

Permalink
pnpm -> bun
Browse files Browse the repository at this point in the history
  • Loading branch information
rekram1-node committed Sep 20, 2024
1 parent d265749 commit 655deda
Show file tree
Hide file tree
Showing 57 changed files with 127 additions and 135 deletions.
6 changes: 0 additions & 6 deletions .gitpod.yml

This file was deleted.

28 changes: 14 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ then, clone it to your local machine:
gh repo clone <your-github-name>/create-t3-app
```

This project uses [pnpm](https://pnpm.io) as its package manager. Install it if you haven't already:
This project uses [bun](https://bun.io) as its package manager. Install it if you haven't already:

```bash
npm install -g pnpm
npm install -g bun
```

Then, install the project's dependencies:

```bash
pnpm install
bun install
```

### Implement your changes
Expand All @@ -52,15 +52,15 @@ Here are some useful scripts for when you are developing:

| Command | Description |
| ---------------- | ------------------------------------------------------- |
| `pnpm dev:cli` | Builds and starts the CLI in watch-mode |
| `pnpm dev:www` | Starts the development server for the docs with HMR |
| `pnpm build:cli` | Builds the CLI |
| `pnpm build:www` | Builds the docs |
| `pnpm build` | Builds CLI and docs |
| `pnpm format` | Formats the code |
| `pnpm lint` | Lints the code |
| `pnpm lint:fix` | Lints the code and fixes any errors |
| `pnpm check` | Checks your code for typeerrors, formatting and linting |
| `bun dev:cli` | Builds and starts the CLI in watch-mode |
| `bun dev:www` | Starts the development server for the docs with HMR |
| `bun build:cli` | Builds the CLI |
| `bun build:www` | Builds the docs |
| `bun build` | Builds CLI and docs |
| `bun format` | Formats the code |
| `bun lint` | Lints the code |
| `bun lint:fix` | Lints the code and fixes any errors |
| `bun check` | Checks your code for typeerrors, formatting and linting |

When making commits, make sure to follow the [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) guidelines, i.e. prepending the message with `feat:`, `fix:`, `chore:`, `docs:`, etc... You can use `git status` to double check which files have not yet been staged for commit:

Expand All @@ -73,15 +73,15 @@ git add <file> && git commit -m "feat/fix/chore/docs: commit message"
Check that your code follows the project's style guidelines by running:

```bash
pnpm check
bun check
```

Please also make a manual, functional test of your changes.

If your change should appear in the changelog, i.e. it changes some behavior of either the CLI or the outputted application, it must be captured by `changeset` which is done by running

```bash
pnpm changeset
bun changeset
```

and filling out the form with the appropriate information. Then, add the generated changeset to git:
Expand Down
4 changes: 2 additions & 2 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@
- added JSDoc type to clientEnv in all env-schema ([#240](https://github.com/t3-oss/create-t3-app/issues/240)) ([9cb5ebb](https://github.com/t3-oss/create-t3-app/commit/9cb5ebbb2a0147ce15726c7e1a6c6be4065bc2dc))
- clarify some comments and rename some files in env ([#245](https://github.com/t3-oss/create-t3-app/issues/245)) ([2048783](https://github.com/t3-oss/create-t3-app/commit/2048783bd26f7f0522357a3ab1e74e6f560a221c))
- remove semicolon in \_app.tsx with next-auth to avoid early return ([1be7713](https://github.com/t3-oss/create-t3-app/commit/1be771393628631b818b46d3f3bf1ca41ad99dce))
- title being offset when using yarn/pnpm ([c881f00](https://github.com/t3-oss/create-t3-app/commit/c881f00430f606040a448eecc41e779ab0c728a7))
- title being offset when using yarn/bun ([c881f00](https://github.com/t3-oss/create-t3-app/commit/c881f00430f606040a448eecc41e779ab0c728a7))

### [5.2.1](https://github.com/t3-oss/create-t3-app/compare/v5.2.0...v5.2.1) (2022-07-19)

Expand Down Expand Up @@ -1109,7 +1109,7 @@
- format contributing.md ([4111476](https://github.com/t3-oss/create-t3-app/commit/41114766582ca33fb2a3fd0b566e609a6dd3e861))
- handle git projects correctly ([3ed897f](https://github.com/t3-oss/create-t3-app/commit/3ed897ff49c06f6d70d49aee31d5c3741fced96e))
- incompatible git version ([#127](https://github.com/t3-oss/create-t3-app/issues/127)) ([34f44f8](https://github.com/t3-oss/create-t3-app/commit/34f44f817df52b317afea5b8d55c87eea487833f))
- invalid pnpm action version ([2a1f6e3](https://github.com/t3-oss/create-t3-app/commit/2a1f6e32aedb8f86ee7ca403e481be8e474b76b2))
- invalid bun action version ([2a1f6e3](https://github.com/t3-oss/create-t3-app/commit/2a1f6e32aedb8f86ee7ca403e481be8e474b76b2))
- language prompt short answer should both be ts ([#142](https://github.com/t3-oss/create-t3-app/issues/142)) ([5e4f80d](https://github.com/t3-oss/create-t3-app/commit/5e4f80d7aa930f16add3bb2273a23f5829548f49))
- **markup:** multiple h1 replaced to h2 ([6bf9040](https://github.com/t3-oss/create-t3-app/commit/6bf90407b9a9774348a77927d37c47f3ded5552a))
- **prompts:** show correct package manager in prompts ([#153](https://github.com/t3-oss/create-t3-app/issues/153)) ([fe66ae9](https://github.com/t3-oss/create-t3-app/commit/fe66ae9f60cbe6a2e429be406a1cd548c51e7bbd))
Expand Down
4 changes: 2 additions & 2 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ npm create t3-app@latest
yarn create t3-app
```

### pnpm
### bun

```bash
pnpm create t3-app@latest
bun create t3-app@latest
```

### bun
Expand Down
8 changes: 4 additions & 4 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
"clean": "rm -rf dist .turbo node_modules",
"start": "node dist/index.js",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "pnpm lint --fix",
"lint:fix": "bun lint --fix",
"format": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --write",
"format:check": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --check",
"release": "changeset version",
"pub:beta": "pnpm build && npm publish --tag beta",
"pub:next": "pnpm build && npm publish --tag next",
"pub:release": "pnpm build && npm publish"
"pub:beta": "bun build && npm publish --tag beta",
"pub:next": "bun build && npm publish --tag next",
"pub:release": "bun build && npm publish"
},
"dependencies": {
"@clack/core": "^0.3.4",
Expand Down
2 changes: 1 addition & 1 deletion cli/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const runCli = async (): Promise<CliResults> => {
if (process.env.npm_config_user_agent?.startsWith("yarn/3")) {
logger.warn(` WARNING: It looks like you are using Yarn 3. This is currently not supported,
and likely to result in a crash. Please run create-t3-app with another
package manager such as pnpm, npm, or Yarn Classic.
package manager such as bun, npm, or Yarn Classic.
See: https://github.com/t3-oss/create-t3-app/issues/57`);
}

Expand Down
4 changes: 2 additions & 2 deletions cli/src/helpers/installDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ const runInstallCommand = async (
});

return null;
// When using yarn or pnpm, use the stdout stream and ora spinner to show the progress
case "pnpm":
// When using yarn or bun, use the stdout stream and ora spinner to show the progress
case "bun":
return execWithSpinner(projectDir, pkgManager, {
onDataHandle: (spinner) => (data) => {
const text = data.toString();
Expand Down
8 changes: 4 additions & 4 deletions cli/src/utils/getUserPkgManager.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
export type PackageManager = "npm" | "bun" | "yarn" | "bun";

export const getUserPkgManager: () => PackageManager = () => {
// This environment variable is set by npm and yarn but pnpm seems less consistent
// This environment variable is set by npm and yarn but bun seems less consistent
const userAgent = process.env.npm_config_user_agent;

if (userAgent) {
if (userAgent.startsWith("yarn")) {
return "yarn";
} else if (userAgent.startsWith("pnpm")) {
return "pnpm";
} else if (userAgent.startsWith("bun")) {
return "bun";
} else if (userAgent.startsWith("bun")) {
return "bun";
} else {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/utils/renderTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const renderTitle = () => {

// resolves weird behavior where the ascii is offset
const pkgManager = getUserPkgManager();
if (pkgManager === "yarn" || pkgManager === "pnpm") {
if (pkgManager === "yarn" || pkgManager === "bun") {
console.log("");
}
console.log(t3Gradient.multiline(TITLE_TEXT));
Expand Down
2 changes: 1 addition & 1 deletion cli/template/base/_gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ next-env.d.ts
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
.bun-debug.log*

# local env files
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"engines": {
"node": ">=18.17.0"
},
"packageManager": "[email protected]",
"packageManager": "[email protected]",
"scripts": {
"typecheck": "turbo typecheck",
"build:cli": "turbo --filter=create-t3-app build",
Expand All @@ -41,8 +41,8 @@
"format:check": "turbo format:check && prettier --check '*.{cjs,json}' --ignore-unknown --no-error-on-unmatched-pattern",
"check": "turbo lint typecheck format:check && manypkg check",
"release": "changeset version",
"pub:beta": "cd cli && pnpm pub:beta",
"pub:release": "cd cli && pnpm pub:release"
"pub:beta": "cd cli && bun pub:beta",
"pub:release": "cd cli && bun pub:release"
},
"dependencies": {
"@changesets/changelog-github": "^0.4.8",
Expand Down
4 changes: 0 additions & 4 deletions pnpm-workspace.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion www/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# For developers who would like the data to be pulled correctly,
# generate these tokens from the provider and add them to a .gitignored .env file
# You can run `pnpm dev` without them, and dummy data (or no data) will be used instead
# You can run `bun dev` without them, and dummy data (or no data) will be used instead

# Github - for grabbing star count in navbar, and commit history for docs pages
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
Expand Down
3 changes: 2 additions & 1 deletion www/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# build output
dist/
.astro

# dependencies
node_modules/
Expand All @@ -8,7 +9,7 @@ node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
bun-debug.log*


# environment variables
Expand Down
2 changes: 1 addition & 1 deletion www/.npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Expose Astro dependencies for `pnpm` users
# Expose Astro dependencies for `bun` users
shamefully-hoist=true
4 changes: 2 additions & 2 deletions www/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Based on the [Astro Starter Kit: Docs Site](https://github.com/withastro/astro/t
```bash
git clone https://github.com/t3-oss/create-t3-app.git
cd create-t3-app/www
pnpm i
pnpm dev
bun i
bun dev
```

## Command Cheat Sheet
Expand Down
Binary file added www/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"format": "prettier '**/*.{cjs,mjs,ts,tsx,md,json,astro}' --ignore-path ../.gitignore --ignore-unknown --write",
"format:check": "prettier '**/*.{cjs,mjs,ts,tsx,md,json,astro}' --ignore-path ../.gitignore --ignore-unknown --check",
"lint": "eslint . --report-unused-disable-directives",
"lint:fix": "pnpm lint --fix",
"lint:fix": "bun lint --fix",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
Expand Down
4 changes: 2 additions & 2 deletions www/src/components/landingPage/ClipboardSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const commands = [
},
{
command: "create t3-app@latest",
manager: "pnpm",
manager: "bun",
},
{
command: "create t3-app@latest",
Expand Down Expand Up @@ -42,7 +42,7 @@ export default function ClipboardSelect() {
<div className="flex items-center gap-2">
<Menu as="div">
<div className="relative">
<Menu.Button className="relative flex cursor-pointer items-center justify-center rounded-lg border bg-t3-purple-200/50 p-2 text-left focus:outline-none hover:bg-t3-purple-200/75 sm:text-sm dark:border-t3-purple-200/20 dark:bg-t3-purple-200/10 dark:hover:border-t3-purple-200/50">
<Menu.Button className="relative flex cursor-pointer items-center justify-center rounded-lg border bg-t3-purple-200/50 p-2 text-left hover:bg-t3-purple-200/75 focus:outline-none sm:text-sm dark:border-t3-purple-200/20 dark:bg-t3-purple-200/10 dark:hover:border-t3-purple-200/50">
<svg
className={`h-[1em] w-[1em] ${coolDown && "hidden"}`}
xmlns="http://www.w3.org/2000/svg"
Expand Down
1 change: 1 addition & 0 deletions www/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
6 changes: 3 additions & 3 deletions www/src/pages/ar/deployment/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ COPY prisma ./
# تثبيت المتطلبات وفقا للـ package manager الذي تُفضلة
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml\* ./
COPY package.json yarn.lock* package-lock.json* bun-lock.yaml\* ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i; \
elif [ -f bun-lock.yaml ]; then yarn global add bun && bun i; \
else echo "Lockfile not found." && exit 1; \
fi
Expand All @@ -99,7 +99,7 @@ COPY . .
RUN \
if [ -f yarn.lock ]; then SKIP_ENV_VALIDATION=1 yarn build; \
elif [ -f package-lock.json ]; then SKIP_ENV_VALIDATION=1 npm run build; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && SKIP_ENV_VALIDATION=1 pnpm run build; \
elif [ -f bun-lock.yaml ]; then yarn global add bun && SKIP_ENV_VALIDATION=1 bun run build; \
else echo "Lockfile not found." && exit 1; \
fi
Expand Down
6 changes: 3 additions & 3 deletions www/src/pages/ar/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ npm create t3-app@latest
yarn create t3-app
```

### pnpm
### bun

```bash
pnpm create t3-app@latest
bun create t3-app@latest
```

### bun
Expand Down Expand Up @@ -69,5 +69,5 @@ bun create t3-app@latest
الامر التالي سَيٌنشئ تطبيق T3 باستخدام tRPC و Tailwind CSS.

```bash
pnpm dlx create-t3-app@latest --CI --trpc --tailwind
bun dlx create-t3-app@latest --CI --trpc --tailwind
```
2 changes: 1 addition & 1 deletion www/src/pages/ar/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ main()
});
```

ثُم قُم بتشغيل `pnpm db-seed` او `npm` او `yarn`
ثُم قُم بتشغيل `bun db-seed` او `npm` او `yarn`

## مصادر مُفيدة

Expand Down
6 changes: 3 additions & 3 deletions www/src/pages/en/deployment/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ COPY prisma ./
# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml\* ./
COPY package.json yarn.lock* package-lock.json* bun-lock.yaml\* ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then npm install -g pnpm && pnpm i; \
elif [ -f bun-lock.yaml ]; then npm install -g bun && bun i; \
else echo "Lockfile not found." && exit 1; \
fi
Expand All @@ -95,7 +95,7 @@ COPY . .
RUN \
if [ -f yarn.lock ]; then SKIP_ENV_VALIDATION=1 yarn build; \
elif [ -f package-lock.json ]; then SKIP_ENV_VALIDATION=1 npm run build; \
elif [ -f pnpm-lock.yaml ]; then npm install -g pnpm && SKIP_ENV_VALIDATION=1 pnpm run build; \
elif [ -f bun-lock.yaml ]; then npm install -g bun && SKIP_ENV_VALIDATION=1 bun run build; \
else echo "Lockfile not found." && exit 1; \
fi
Expand Down
8 changes: 4 additions & 4 deletions www/src/pages/en/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ npm create t3-app@latest
yarn create t3-app
```

### pnpm
### bun

```bash
pnpm create t3-app@latest
bun create t3-app@latest
```

### bun
Expand Down Expand Up @@ -72,11 +72,11 @@ The --dbProvider command has 4 database values to choose from: mysql, postgres,
The following would scaffold a T3 App with tRPC and Tailwind CSS.

```bash
pnpm dlx create-t3-app@latest --CI --trpc --tailwind
bun dlx create-t3-app@latest --CI --trpc --tailwind
```

The following would scaffold a T3 App with NextAuth.js, Tailwind CSS, Drizzle, and PostgreSQL.

```bash
pnpm dlx create-t3-app@latest --CI --nextAuth --tailwind --drizzle --dbProvider postgres
bun dlx create-t3-app@latest --CI --nextAuth --tailwind --drizzle --dbProvider postgres
```
2 changes: 1 addition & 1 deletion www/src/pages/en/usage/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If your app includes Prisma, make sure to run `npx prisma db push` from the root

### Drizzle

If your app includes Drizzle, check the `.env` file for instructions on how to construct your `DATABASE_URL` env variable. Once your env file is ready, run `pnpm db:push` (or the equivalent for other package managers) to push your schema.
If your app includes Drizzle, check the `.env` file for instructions on how to construct your `DATABASE_URL` env variable. Once your env file is ready, run `bun db:push` (or the equivalent for other package managers) to push your schema.

## Authentication

Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/en/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ main()
});
```

Then, just run `pnpm db-seed` (or `npm`/`yarn`) to seed your database.
Then, just run `bun db-seed` (or `npm`/`yarn`) to seed your database.

## Useful Resources

Expand Down
Loading

0 comments on commit 655deda

Please sign in to comment.