@rubriclab/bunl 0.1.25 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +2 -1
- package/.github/workflows/publish.yml +16 -0
- package/.vscode/settings.json +16 -0
- package/CHANGELOG.md +3 -0
- package/Dockerfile +6 -8
- package/LICENSE +1 -1
- package/README.md +15 -67
- package/biome.json +3 -0
- package/build/client.js +130 -468
- package/bun.lock +169 -0
- package/client.ts +132 -85
- package/demo.tsx +127 -0
- package/docker-compose.yml +36 -0
- package/e2e.test.ts +187 -0
- package/package.json +52 -44
- package/server.ts +160 -85
- package/tsconfig.json +3 -3
- package/types.ts +23 -9
- package/utils.ts +149 -6
- package/bun.lockb +0 -0
- package/demo.ts +0 -18
- package/fly.toml +0 -19
- package/index.ts +0 -67
package/.env.example
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"[json]": {
|
|
3
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
4
|
+
},
|
|
5
|
+
"[typescript]": {
|
|
6
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
7
|
+
},
|
|
8
|
+
"[typescriptreact]": {
|
|
9
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
10
|
+
},
|
|
11
|
+
"editor.codeActionsOnSave": {
|
|
12
|
+
"source.fixAll.biome": "always"
|
|
13
|
+
},
|
|
14
|
+
"editor.defaultFormatter": "biomejs.biome",
|
|
15
|
+
"editor.formatOnSave": true
|
|
16
|
+
}
|
package/CHANGELOG.md
ADDED
package/Dockerfile
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
FROM oven/bun:1
|
|
1
|
+
FROM oven/bun:1.3-slim AS base
|
|
2
2
|
|
|
3
3
|
WORKDIR /app
|
|
4
4
|
|
|
5
|
-
COPY package.json
|
|
6
|
-
COPY bun.lockb /app/
|
|
7
|
-
|
|
5
|
+
COPY package.json bun.lock ./
|
|
8
6
|
RUN bun install --frozen-lockfile --production
|
|
9
7
|
|
|
10
|
-
COPY .
|
|
8
|
+
COPY . .
|
|
11
9
|
|
|
12
|
-
ENV NODE_ENV
|
|
13
|
-
|
|
10
|
+
ENV NODE_ENV=production
|
|
11
|
+
EXPOSE 1234
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
ENTRYPOINT ["bun", "run", "server.ts"]
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,78 +1,26 @@
|
|
|
1
1
|
# bunl
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
### Usage
|
|
6
|
-
|
|
7
|
-
To try it:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
bun x bunl -p 3000 -d dev.rubric.me -s my-name
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
### Development
|
|
14
|
-
|
|
15
|
-
To install dependencies:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
bun i
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
To run the server:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
bun dev:server
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
(Optional) to run a dummy process on localhost:3000:
|
|
3
|
+
Expose localhost to the world. Bun-native WebSocket tunnel.
|
|
28
4
|
|
|
29
5
|
```bash
|
|
30
|
-
bun
|
|
6
|
+
bun x bunl -p 3000
|
|
31
7
|
```
|
|
32
8
|
|
|
33
|
-
|
|
9
|
+
## Options
|
|
34
10
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
11
|
+
| Flag | Short | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `--port` | `-p` | `3000` | Local port to expose |
|
|
14
|
+
| `--domain` | `-d` | `bunl.sh` | Tunnel server |
|
|
15
|
+
| `--subdomain` | `-s` | random | Requested subdomain |
|
|
16
|
+
| `--open` | `-o` | `false` | Open URL in browser |
|
|
38
17
|
|
|
39
|
-
|
|
18
|
+
## Development
|
|
40
19
|
|
|
41
20
|
```bash
|
|
42
|
-
bun
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
bun client -p 3000 -d example.so -s my-subdomain -o
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
The options:
|
|
52
|
-
|
|
53
|
-
- `port` / `p` the localhost port to expose eg. **3000**
|
|
54
|
-
- `domain` / `d` the hostname of the server Bunl is running on eg. **example.so**
|
|
55
|
-
- `subdomain` / `s` the public URL to request eg. **my-subdomain**.example.so
|
|
56
|
-
- `open` / `o` to auto-open your public URL in the browser
|
|
57
|
-
|
|
58
|
-
### [WIP] Deployment
|
|
59
|
-
|
|
60
|
-
To build the client code:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
bun run build
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
To deploy the server, for example on [Fly](https://fly.io):
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
fly launch && fly deploy
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Making sure to set `DOMAIN` to your domain:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
fly secrets set DOMAIN=example.so
|
|
21
|
+
bun i
|
|
22
|
+
bun dev:server # tunnel server on :1234
|
|
23
|
+
bun demo # demo app on :3000
|
|
24
|
+
bun client # connect demo to server
|
|
25
|
+
bun test:e2e # end-to-end tests
|
|
76
26
|
```
|
|
77
|
-
|
|
78
|
-
Open to PRs!
|
package/biome.json
ADDED