Skip to content

Commit

Permalink
Add Bun example
Browse files Browse the repository at this point in the history
  • Loading branch information
deptyped committed May 16, 2024
1 parent bef94e5 commit 35ff184
Showing 1 changed file with 57 additions and 17 deletions.
74 changes: 57 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ Bot starter template based on [grammY](https://grammy.dev/) bot framework.
- [Docker](#docker-dockercom)
- [Vercel](#vercel-vercelcom)
- Examples:
- [Prisma ORM](#prisma-orm-prismaio)
- grammY plugins:
- [Conversations](#grammy-conversations-grammydevpluginsconversations)
- [Runner](#grammy-runner-grammydevpluginsrunner)
- Databases:
- [Prisma ORM](#prisma-orm-prismaio)
- Runtimes:
- [Bun](#bun-bunsh)

## Usage

Expand Down Expand Up @@ -155,11 +158,11 @@ git merge template/deploy/vercel -X theirs --squash --no-commit --allow-unrelate

## Examples

### Prisma ORM ([prisma.io](https://prisma.io))
### grammY conversations ([grammy.dev/plugins/conversations](https://grammy.dev/plugins/conversations))

Branch:
[example/orm-prisma](https://github.com/bot-base/telegram-bot-template/tree/example/orm-prisma)
([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/orm-prisma))
[example/plugin-conversations](https://github.com/bot-base/telegram-bot-template/tree/example/plugin-conversations)
([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/plugin-conversations))

Use in your project:

Expand All @@ -173,21 +176,20 @@ git remote update
2. Merge example

```sh
git merge template/example/orm-prisma -X theirs --squash --no-commit --allow-unrelated-histories
git merge template/example/plugin-conversations -X theirs --squash --no-commit --allow-unrelated-histories
```

3. Install dependencies

```sh
npm i -D prisma
npm i @prisma/client
npm i @grammyjs/conversations
```

### grammY conversations ([grammy.dev/plugins/conversations](https://grammy.dev/plugins/conversations))
### grammY runner ([grammy.dev/plugins/runner](https://grammy.dev/plugins/runner))

Branch:
[example/plugin-conversations](https://github.com/bot-base/telegram-bot-template/tree/example/plugin-conversations)
([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/plugin-conversations))
[example/plugin-runner](https://github.com/bot-base/telegram-bot-template/tree/example/plugin-runner)
([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/plugin-runner))

Use in your project:

Expand All @@ -201,20 +203,20 @@ git remote update
2. Merge example

```sh
git merge template/example/plugin-conversations -X theirs --squash --no-commit --allow-unrelated-histories
git merge template/example/plugin-runner -X theirs --squash --no-commit --allow-unrelated-histories
```

3. Install dependencies

```sh
npm i @grammyjs/conversations
npm i @grammyjs/runner
```

### grammY runner ([grammy.dev/plugins/runner](https://grammy.dev/plugins/runner))
### Prisma ORM ([prisma.io](https://prisma.io))

Branch:
[example/plugin-runner](https://github.com/bot-base/telegram-bot-template/tree/example/plugin-runner)
([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/plugin-runner))
[example/orm-prisma](https://github.com/bot-base/telegram-bot-template/tree/example/orm-prisma)
([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/orm-prisma))

Use in your project:

Expand All @@ -228,13 +230,51 @@ git remote update
2. Merge example

```sh
git merge template/example/plugin-runner -X theirs --squash --no-commit --allow-unrelated-histories
git merge template/example/orm-prisma -X theirs --squash --no-commit --allow-unrelated-histories
```

3. Install dependencies

```sh
npm i @grammyjs/runner
npm i -D prisma
npm i @prisma/client
```

### Bun ([bun.sh](https://bun.sh))

Branch:
[example/runtime-bun](https://github.com/bot-base/telegram-bot-template/tree/example/runtime-bun)
([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/runtime-bun))

Use in your project:

1. Add the template repository as a remote

```sh
git remote add template [email protected]:bot-base/telegram-bot-template.git
git remote update
```

2. Merge example

```sh
git merge template/example/runtime-bun -X theirs --squash --no-commit --allow-unrelated-histories
```

3. Install dependencies

```sh
# remove Node-related dependencies
npm r @types/node tsx tsc-watch

# install dependencies
bun i

# remove npm lockfile
rm package-lock.json

# install bun typings
bun add -d @types/bun
```

## Environment Variables
Expand Down

0 comments on commit 35ff184

Please sign in to comment.