Skip to main content

Bun + TypeScript 開発サーバーをホットリロード付きで1コマンド起動するツール

Project description

tsbuild

tssetup で構築した Bun + TypeScript プロジェクトにおいて、開発サーバーの起動・TypeScript の自動ビルド・ブラウザのホットリロードを1コマンドで一元管理する開発支援ツールです。

🚀 特徴

  • 1コマンド起動: ローカルWebサーバー起動・ブラウザ自動起動・TS監視ビルドをすべて開始します。
  • ポート衝突の自動回避: デフォルトの 53000 番ポートが使用中の場合、空いているポートを自動で探します。
  • 404エラー防止: 起動と同時に初回コンパイルを実行し、ブラウザ起動直後の404エラーを防ぎます。
  • ホットリロード: src/ 内のコード変更や index.html の編集を検知し、ブラウザを自動でリロードします。
  • ゾンビプロセス防止: Ctrl + C で終了した際に、バックグラウンドの Bun サーバーを自動停止・クリーンアップします。
  • 自動バージョン確認: 実行時に最新バージョンを確認し、更新がある場合は通知します。

🛠️ インストール方法

pip install tsbuild

[!NOTE]

  • PowerShell・CMD・Windows Terminal どれからでも使えます。
  • 動作には Python 3.9+Bun が必要です。

⚙️ 動作に必要な環境(依存関係)

ツール 用途 インストール
Python 3.9+ tsbuild 本体の実行 python.org
Bun 開発サーバー起動・TSコンパイル powershell -c "irm bun.sh/install.ps1 | iex"

⚡ 使い方

tssetup で構築したプロジェクトのルートディレクトリ(package.jsonserver.ts があるフォルダ)で実行します。

tsbuild

プロジェクト外(package.json / server.ts がないディレクトリ)で実行するとバージョン情報・インフォ画面が表示されます。

パラメータ

パラメータ 短縮形 説明
--version -v バージョンを表示
--help -h ヘルプを表示

📁 対象プロジェクトの構成

tsbuildtssetup で作成した以下の構成を前提としています。

my-app/
├── src/
│   └── index.ts        ← 編集対象の TypeScript ファイル
├── dist/               ← tsc が自動生成する JS 出力先
├── index.html          ← フロントエンドの HTML
├── server.ts           ← tsbuild が起動する Bun サーバー
├── tsconfig.json       ← TypeScript コンパイラ設定
└── package.json        ← Bun プロジェクト設定

🚀 プロジェクトの始め方

# 1. プロジェクトを作成(カレントディレクトリが自動で移動)
tssetup my-app

# 2. 開発サーバーを起動
tsbuild

コマンド実行時の挙動

  1. ポート自動探索53000 番から順に空きポートを検索してサーバーを起動
  2. 初回ビルドbun x tsc で初回コンパイルを実行(ブラウザ起動前に JS を生成)
  3. ブラウザ自動起動http://localhost:53000(または自動検出したポート)を開く
  4. リアルタイム監視bun x tsc --watch でファイル変更を検知して自動コンパイル
  5. ホットリロード — ビルド完了後、WebSocket 経由でブラウザに通知してリロード

終了方法

Ctrl + C を押すと、バックグラウンドの Bun サーバーを自動停止してクリーンアップします。


🔄 アップデート

pip install --upgrade tsbuild

✉️ 問い合わせ先


⚠️ 免責事項

本ソフトウェアの使用によって生じた直接的・間接的な損害について、作者は一切の責任を負いません。自己責任のもとでご使用ください。


📄 ライセンス & コピーライト

本プロジェクトは MIT License のもとで公開されています。

Copyright (c) 2026 Lapius7

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsbuild-1.3.5.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsbuild-1.3.5-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file tsbuild-1.3.5.tar.gz.

File metadata

  • Download URL: tsbuild-1.3.5.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tsbuild-1.3.5.tar.gz
Algorithm Hash digest
SHA256 893835bd546e6e3fac7366c44e8e8d4a2fa7dbf2086075ef9d8dca67b751d92b
MD5 f8e31e95168080dc0578472b1515249c
BLAKE2b-256 696fa93edb469fbe6ad05e7b50dd78ee844557eb3d1a56d559644057a0b5ec47

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsbuild-1.3.5.tar.gz:

Publisher: publish.yml on Lapius7/tsbuild

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsbuild-1.3.5-py3-none-any.whl.

File metadata

  • Download URL: tsbuild-1.3.5-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tsbuild-1.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0b3a46dadbe98b2c11b2f2d0d92ec29410c3348c34f9e365538dbb266ff892b1
MD5 43ba4073092bf28c8bdf1021c997690b
BLAKE2b-256 ab57dc0d3b8ce9e501384be468cdd2cfffebc4e365e7f8f3557f904cf2f53d66

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsbuild-1.3.5-py3-none-any.whl:

Publisher: publish.yml on Lapius7/tsbuild

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page