HonoX の学習用リポジトリです。
-
開発ツールをインストール
Volta
# Volta をインストール curl https://get.volta.sh | bash # Node.js 22.6.0 をインストール volta install node@22.6.0 # Volta が現在アクティブにしている Node.js のバージョンを確認 volta list node -c # Node.js のバージョンを確認 node -v
Bun
# Bun をインストール curl -fsSL https://bun.sh/install | bash
-
設定ファイル wrangler.toml を作成
name = "training-honox" compatibility_date = "2024-04-01" compatibility_flags = [ "nodejs_compat" ] pages_build_output_dir = "./dist" [[d1_databases]] binding = "DB" database_name = "training-honox" database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" preview_database_id = "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" migrations_dir = "./db/migrations"
-
実行環境を作成
# パッケージをインストール bun i # マイグレーションを適用 yes | bun wrangler d1 migrations apply training-honox --local
# 開発サーバー
bun run dev# プロダクションビルドのプレビュー
bun run build
bun run preview