From 65ace174fff7f15b62c4a88ecd2522bd9f75dd60 Mon Sep 17 00:00:00 2001 From: joseferben Date: Sat, 5 Oct 2024 08:44:16 +0200 Subject: [PATCH] fix: ci --- .github/workflows/ci.yml | 10 ---------- example/0-todo.tsx | 11 ++++++++++- src/database.ts | 4 ++++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16e80cb..123e869 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,16 +20,6 @@ jobs: bun-version: 1.1.29 - name: install dependencies 🔧 run: bun install - - name: migrate ✅ - run: | - timeout_cmd="" - if [ "$RUNNER_OS" == "Windows" ]; then - timeout_cmd="timeout 3" - else - timeout_cmd="timeout 3s" - fi - $timeout_cmd bun run example/0-todo.tsx || true - shell: bash - name: build ✅ run: bun run build - name: test ✅ diff --git a/example/0-todo.tsx b/example/0-todo.tsx index 7082b13..bcfe106 100644 --- a/example/0-todo.tsx +++ b/example/0-todo.tsx @@ -1,11 +1,20 @@ import { Hono } from "hono"; import { jsxRenderer } from "hono/jsx-renderer"; import { logger } from "hono/logger"; -import type { DB } from "kysely-codegen"; import { form, store } from "plainstack"; import { bunSqlite, secret } from "plainstack/bun"; import { session } from "plainstack/session"; +interface Items { + content: string; + createdAt: number; + id: string; +} + +interface DB { + items: Items; +} + const { database, migrate } = bunSqlite(); await migrate(({ schema }) => { diff --git a/src/database.ts b/src/database.ts index 917cc0f..dc6b4a5 100644 --- a/src/database.ts +++ b/src/database.ts @@ -53,6 +53,10 @@ export function migrate( }); } consola.info("✓ types generated"); + if (process.env.MIRGATE) { + console.info("MIGRATE env var set, stopping process"); + process.exit(0); + } }; }