Skip to content

Commit 4cdb614

Browse files
authored
Add postinstall script to support git installations (#22)
- Add postinstall script that builds the package if dist/ is missing - This fixes installations from git where dist/ is not committed - For npm registry installs, the script skips build (dist/ already exists) - Update INSTALL.md and README.md with git installation instructions Fixes git installations by automatically building the package after clone. Requires Bun to be installed. Takes ~3-5 seconds during install.
1 parent 2da65f2 commit 4cdb614

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

INSTALL.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ bun add @coder/ghostty-web
1010
yarn add @coder/ghostty-web
1111
```
1212

13+
### Installing from Git
14+
15+
You can install directly from GitHub:
16+
17+
```bash
18+
npm install github:coder/ghostty-web
19+
# or
20+
bun add github:coder/ghostty-web
21+
```
22+
23+
**Note:** When installing from git, the package automatically builds itself via a `postinstall` script. This requires Bun to be installed and may take a few seconds during installation.
24+
1325
## Basic Usage
1426

1527
```typescript

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ A web-based terminal emulator that integrates [Ghostty's](https://github.com/gho
88
npm install @coder/ghostty-web
99
```
1010

11+
Or install from GitHub:
12+
13+
```bash
14+
npm install github:coder/ghostty-web
15+
```
16+
17+
**Note:** Git installs will auto-build during `postinstall` (requires Bun).
18+
1119
## Quick Start
1220

1321
```typescript

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
"fmt:fix": "prettier --write .",
5858
"lint": "biome check .",
5959
"lint:fix": "biome check --write .",
60-
"prepublishOnly": "bun run test && bun run build"
60+
"prepublishOnly": "bun run test && bun run build",
61+
"postinstall": "[ -d dist ] || bun run build"
6162
},
6263
"devDependencies": {
6364
"@biomejs/biome": "^1.9.4",

0 commit comments

Comments
 (0)