Skip to content

Commit 45aed45

Browse files
Add support for Bun
1 parent b534d75 commit 45aed45

19 files changed

Lines changed: 214 additions & 15 deletions

.github/workflows/ci.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,25 @@ jobs:
3333
- uses: codecov/codecov-action@v5
3434
with:
3535
token: ${{ secrets.CODECOV_TOKEN }}
36+
bun-tests:
37+
runs-on: ubuntu-latest
38+
services:
39+
postgres:
40+
image: postgres
41+
env:
42+
POSTGRES_PASSWORD: postgres
43+
ports:
44+
- 5432:5432
45+
options: >-
46+
--health-cmd pg_isready
47+
--health-interval 10s
48+
--health-timeout 5s
49+
--health-retries 5
50+
steps:
51+
- uses: actions/checkout@v6
52+
- uses: actions/setup-node@v6
53+
with:
54+
node-version-file: package.json
55+
- run: npm ci
56+
- uses: oven-sh/setup-bun@v2
57+
- run: bun run test

packages/docs/docs/cli.mdx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ npm install -D @openworkflow/cli
1717
pnpm add -D @openworkflow/cli
1818
```
1919

20+
```bash bun
21+
bun add -D @openworkflow/cli
22+
```
23+
2024
</CodeGroup>
2125

2226
## Commands
@@ -34,6 +38,10 @@ npx @openworkflow/cli init
3438
pnpx @openworkflow/cli init
3539
```
3640

41+
```bash bun
42+
bunx @openworkflow/cli init
43+
```
44+
3745
</CodeGroup>
3846

3947
This interactive command:
@@ -59,6 +67,10 @@ npx @openworkflow/cli worker start
5967
pnpx @openworkflow/cli worker start
6068
```
6169

70+
```bash bun
71+
bunx @openworkflow/cli worker start
72+
```
73+
6274
</CodeGroup>
6375

6476
Options:
@@ -77,6 +89,11 @@ npx @openworkflow/cli worker start --concurrency 4
7789
pnpx @openworkflow/cli worker start --concurrency 4
7890
```
7991

92+
```bash bun
93+
# Run with 4 concurrent workflows
94+
bunx @openworkflow/cli worker start --concurrency 4
95+
```
96+
8097
</CodeGroup>
8198

8299
The worker:
@@ -100,6 +117,10 @@ npx @openworkflow/cli dashboard
100117
pnpx @openworkflow/cli dashboard
101118
```
102119

120+
```bash bun
121+
bunx @openworkflow/cli dashboard
122+
```
123+
103124
</CodeGroup>
104125

105126
This launches the OpenWorkflow dashboard on `http://localhost:3000`. See
@@ -118,6 +139,10 @@ npx @openworkflow/cli doctor
118139
pnpx @openworkflow/cli doctor
119140
```
120141

142+
```bash bun
143+
bunx @openworkflow/cli doctor
144+
```
145+
121146
</CodeGroup>
122147

123148
This command checks:
@@ -164,6 +189,10 @@ npx @openworkflow/cli --version
164189
pnpx @openworkflow/cli --version
165190
```
166191

192+
```bash bun
193+
bunx @openworkflow/cli --version
194+
```
195+
167196
</CodeGroup>
168197

169198
### `--help`
@@ -183,6 +212,12 @@ pnpx @openworkflow/cli worker --help
183212
pnpx @openworkflow/cli worker start --help
184213
```
185214

215+
```bash bun
216+
bunx @openworkflow/cli --help
217+
bunx @openworkflow/cli worker --help
218+
bunx @openworkflow/cli worker start --help
219+
```
220+
186221
</CodeGroup>
187222

188223
## Environment Variables

packages/docs/docs/configuration.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ npm i openworkflow postgres
1717
pnpm add openworkflow postgres
1818
```
1919

20+
```bash bun
21+
bun add openworkflow postgres
22+
```
23+
2024
</CodeGroup>
2125

2226
## Config File

packages/docs/docs/core-concepts.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ npx @openworkflow/cli worker start
7171
pnpx @openworkflow/cli worker start
7272
```
7373

74+
```bash bun
75+
bunx @openworkflow/cli worker start
76+
```
77+
7478
</CodeGroup>
7579

7680
## How it Works

packages/docs/docs/dashboard.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ npx @openworkflow/cli dashboard
1717
pnpx @openworkflow/cli dashboard
1818
```
1919

20+
```bash bun
21+
bunx @openworkflow/cli dashboard
22+
```
23+
2024
</CodeGroup>
2125

2226
The dashboard starts on `http://localhost:3000`.

packages/docs/docs/migration-v6.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ npm uninstall @openworkflow/backend-postgres @openworkflow/backend-sqlite
3636
pnpm remove @openworkflow/backend-postgres @openworkflow/backend-sqlite
3737
```
3838

39+
```bash bun
40+
bun remove @openworkflow/backend-postgres @openworkflow/backend-sqlite
41+
```
42+
3943
</CodeGroup>
4044

4145
If you're using PostgreSQL, install the `postgres` driver directly:
@@ -49,6 +53,10 @@ npm install postgres
4953
pnpm add postgres
5054
```
5155

56+
```bash bun
57+
bun add postgres
58+
```
59+
5260
</CodeGroup>
5361

5462
Your `package.json` should now look like:
@@ -79,6 +87,10 @@ npx @openworkflow/cli init
7987
pnpx @openworkflow/cli init
8088
```
8189

90+
```bash bun
91+
bunx @openworkflow/cli init
92+
```
93+
8294
</CodeGroup>
8395

8496
The CLI now generates code with the new import paths automatically.

packages/docs/docs/namespaces.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ NAMESPACE=staging pnpm run worker
7979
NAMESPACE=production pnpm run worker
8080
```
8181

82+
```bash bun
83+
# Development
84+
NAMESPACE=development bun run worker
85+
# Staging
86+
NAMESPACE=staging bun run worker
87+
# Production
88+
NAMESPACE=production bun run worker
89+
```
90+
8291
</CodeGroup>
8392

8493
### Multi-Tenancy

packages/docs/docs/postgres.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ npm i openworkflow postgres
2020
pnpm add openworkflow postgres
2121
```
2222

23+
```bash bun
24+
bun add openworkflow postgres
25+
```
26+
2327
</CodeGroup>
2428

2529
## Setup

packages/docs/docs/production.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ npx @openworkflow/cli dashboard
4545
pnpx @openworkflow/cli dashboard
4646
```
4747

48+
```bash bun
49+
bunx @openworkflow/cli dashboard
50+
```
51+
4852
</CodeGroup>
4953

5054
- Review step attempts and errors for failed workflows

packages/docs/docs/quickstart.mdx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Get up and running with OpenWorkflow
55

66
## Prerequisites
77

8-
- Node.js
8+
- Node.js or Bun
99
- PostgreSQL (and/or SQLite)
1010

1111
## 1. Install
@@ -21,6 +21,10 @@ npx @openworkflow/cli init
2121
pnpx @openworkflow/cli init
2222
```
2323

24+
```bash bun
25+
bunx @openworkflow/cli init
26+
```
27+
2428
</CodeGroup>
2529

2630
The CLI will help you set up OpenWorkflow, create your `openworkflow.config.ts`,
@@ -37,6 +41,10 @@ npx @openworkflow/cli worker start
3741
pnpx @openworkflow/cli worker start
3842
```
3943

44+
```bash bun
45+
bunx @openworkflow/cli worker start
46+
```
47+
4048
</CodeGroup>
4149

4250
This starts the worker using `openworkflow.config.{ts,js}` and auto-loads
@@ -59,6 +67,10 @@ pnpx tsx openworkflow/hello-world.run.ts
5967
node openworkflow/hello-world.run.js
6068
```
6169

70+
```bash bun
71+
bun openworkflow/hello-world.run.ts
72+
```
73+
6274
</CodeGroup>
6375

6476
This script runs the `helloWorld` workflow and waits for it to complete.
@@ -81,6 +93,10 @@ npx @openworkflow/cli dashboard
8193
pnpx @openworkflow/cli dashboard
8294
```
8395

96+
```bash bun
97+
bunx @openworkflow/cli dashboard
98+
```
99+
84100
</CodeGroup>
85101

86102
The dashboard provides a UI for monitoring workflow runs, viewing step details,

0 commit comments

Comments
 (0)