Skip to content

Commit 60dcc2f

Browse files
committedJan 23, 2025·
feat!: use new Bun v1.2
1 parent 2743f4e commit 60dcc2f

File tree

8 files changed

+2897
-23
lines changed

8 files changed

+2897
-23
lines changed
 

‎Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM oven/bun AS build
33
WORKDIR /app
44

55
# Cache packages installation
6-
COPY package.json bun.lockb ./
6+
COPY package.json bun.lock ./
77
COPY ./patches ./patches
88

99
RUN bun install --ignore-scripts --production

‎Dockerfile.dev

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM oven/bun
33
WORKDIR /app
44

55
# Cache packages installation
6-
COPY package.json bun.lockb ./
6+
COPY package.json bun.lock ./
77
COPY ./patches ./patches
88

99
RUN bun install --ignore-scripts

‎README.md

+19-7
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,22 @@ Check out the [linked project](https://github.com/zAlweNy26/ts-cat/projects?quer
3838
- [x] Supports streaming both in WebSocket and HTTP
3939
- [x] Tokens usage visible through model interactions
4040
- [x] Cache support for LLM and Embedder responses
41-
- [ ] External plugins registry support
4241
- [ ] Built-in CLI
42+
- [ ] External plugins registry support
4343
- [ ] Add multi-modality support
4444
- [ ] Add multi-agent support
4545
- [ ] Add multi-chat support
4646

4747
## Pre-requisites
4848

49-
- Bun (>= 1.0.0) (for local development)
49+
- Bun (>= 1.2) (for local development)
5050
- Docker
5151

5252
## Installation
5353

5454
```bash
5555
# (for development)
5656
bun install
57-
rm -f .git/hooks/pre-commit && ln -s ../../pre-commit .git/hooks/pre-commit
5857

5958
# (for production)
6059
docker compose build --no-cache
@@ -66,19 +65,32 @@ docker compose build --no-cache
6665
# (for development)
6766
docker run -p 6333:6333 qdrant/qdrant
6867
bun run dev
69-
# OR
70-
docker compose build -f compose.dev.yml --no-cache # (if you want to use Docker for development)
68+
# OR (if you are using the dev docker compose)
69+
docker compose -f compose.dev.yml build --no-cache
70+
docker compose -f compose.dev.yml up -d
7171

7272
# (for production)
7373
docker compose up
7474
```
7575

76+
## How to run CLI
77+
78+
```bash
79+
bun run cli <command>
80+
# OR (if you are using the dev compose)
81+
docker exec ccat_ts_dev bun run cli <command>
82+
# OR (if you are using the prod compose)
83+
docker exec ccat_ts bun run cli <command>
84+
```
85+
7686
## How to test
7787

7888
```bash
7989
bun run test
80-
# OR
81-
docker compose -f compose.dev.yml exec ccat-ts-dev bun run test
90+
# OR (if you are using the dev compose)
91+
docker exec ccat_ts_dev bun run test
92+
# OR (if you are using the prod compose)
93+
docker exec ccat_ts bun run test
8294
```
8395

8496
## License

‎bun.lock

+2,871
Large diffs are not rendered by default.

‎bun.lockb

-489 KB
Binary file not shown.

‎src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { parsedEnv } from './utils.ts'
66
const inDocker = isDocker()
77
const { watch, verbose } = parsedEnv
88

9-
if (!Bun.semver.satisfies(Bun.version, '>=1.1.19')) {
10-
log.error('The Cat requires Bun version 1.1.19 or higher.')
9+
if (!Bun.semver.satisfies(Bun.version, '>=1.2')) {
10+
log.error('This project requires Bun v1.2 or higher.')
1111
process.exit(1)
1212
}
1313

‎src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const app = new Elysia()
2121
allowedHeaders: '*',
2222
credentials: true,
2323
}))
24-
.use(await staticPlugin({ // TODO: NOT_FOUND error reference at https://github.com/elysiajs/elysia/issues/739
24+
.use(await staticPlugin({ // BUG: NOT_FOUND error reference at https://github.com/elysiajs/elysia/issues/739
2525
prefix: '/assets',
2626
assets: resolve(process.cwd(), 'src', 'assets'),
2727
}))

‎src/plugins/README.md

+2-11
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,10 @@ To let the Cheshire Cat detect your plugin, you need to create at least one `.ts
77
To scaffold a new plugin, you can use the following command:
88

99
```bash
10-
# inside the plugins directory
11-
cp -r ../../.bun-create/plugin <your_plugin_id> # linux/macos
12-
xcopy ..\..\.bun-create\plugin <your_plugin_id> /E /I /H /K # windows (cmd)
13-
Copy-Item -Recurse -Force ..\..\.bun-create\plugin <your_plugin_id> # windows (powershell)
10+
# inside the root project directory
11+
bun create ./plugin ./src/plugins/<your_plugin_id>
1412
```
1513

16-
<!-- TODO: When Bun fixes `bun create` command, use this instead:
17-
```bash
18-
# inside the plugins directory
19-
bun create /plugin <your_plugin_id>
20-
```
21-
-->
22-
2314
This will create for you all the necessary files to start creating your plugin!
2415

2516
## How to import the methods

0 commit comments

Comments
 (0)
Please sign in to comment.