Skip to main content

tsbuild

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

🚀 特徴

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

🛠️ インストール方法

npm(推奨):

npm i -g @lapius/tsbuild

tsbuild コマンドが使えるようになります(Node.js 18 以降が必要。本体はシステムの Python 3.9+ で動きます)。

pip:

pip install tsbuild

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

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

⚡ 使い方

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

tsbuild

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

パラメータ

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

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

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

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 サーバーを自動停止してクリーンアップします。


🔄 アップデート

npm で入れた場合:

npm i -g @lapius/tsbuild

pip で入れた場合:

pip install --upgrade tsbuild

どちらの場合も tsbuild --update で、入れた方法に合わせて更新できます。


✉️ 問い合わせ先


⚠️ 免責事項

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


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

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

Copyright (c) 2026 Lapius7

Metadata

Release files for tsbuild 1.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tsbuild 1.3.7
File Size Uploaded
tsbuild-1.3.7.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tsbuild 1.3.7
File Interpreter ABI Platform
tsbuild-1.3.7-py3-none-any.whl Python 3 none any Details

Total release size: 26.5 kB

Release files / tsbuild-1.3.7.tar.gz

Download URL tsbuild-1.3.7.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
50288d6a7efb9c937713704d25dd1f9ca4199b008d60beb956b1f324deb3c9b2
BLAKE2b-256 checksum
How to use checksums
7c0bd0d09b99eef85a58df90cc3a27eb912b144af6d496fed1273af28f495c9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release files / tsbuild-1.3.7-py3-none-any.whl

Download URL tsbuild-1.3.7-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23b52b8e84487de8a3d231e5bb4748f8760b972598fe8b82c22dce4799b17f7f
BLAKE2b-256 checksum
How to use checksums
4154654a1f4e27213a607a0dc6d3570fb29a2603df6312a699e2b7237d87f2a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

1.3.8

2 release files

This release

1.3.7 This release

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page