From 243732393aa69cb968d3370a47e7324372a6fa4e Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Thu, 13 Nov 2025 15:18:36 +0000 Subject: [PATCH] Add postinstall script to support git installations - 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. --- INSTALL.md | 12 ++++++++++++ README.md | 8 ++++++++ package.json | 3 ++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 1fba77b..eed21d5 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -10,6 +10,18 @@ bun add @coder/ghostty-web yarn add @coder/ghostty-web ``` +### Installing from Git + +You can install directly from GitHub: + +```bash +npm install github:coder/ghostty-web +# or +bun add github:coder/ghostty-web +``` + +**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. + ## Basic Usage ```typescript diff --git a/README.md b/README.md index f9f40b8..03f977c 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,14 @@ A web-based terminal emulator that integrates [Ghostty's](https://github.com/gho npm install @coder/ghostty-web ``` +Or install from GitHub: + +```bash +npm install github:coder/ghostty-web +``` + +**Note:** Git installs will auto-build during `postinstall` (requires Bun). + ## Quick Start ```typescript diff --git a/package.json b/package.json index acba1e9..a497526 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,8 @@ "fmt:fix": "prettier --write .", "lint": "biome check .", "lint:fix": "biome check --write .", - "prepublishOnly": "bun run test && bun run build" + "prepublishOnly": "bun run test && bun run build", + "postinstall": "[ -d dist ] || bun run build" }, "devDependencies": { "@biomejs/biome": "^1.9.4",