diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml new file mode 100644 index 0000000..5da04d5 --- /dev/null +++ b/.github/workflows/fmt.yml @@ -0,0 +1,20 @@ +name: lint-and-format +run-name: ${{ github.actor }} is pushing code +on: [push] +jobs: + check-formatting: + name: "Run Prettier" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@4 + - uses: oven-sh/bun@v2 + - run: bun install + - run: bun fmt:check + lint: + name: "Run ESLint" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@4 + - uses: oven-sh/bun@v2 + - run: bun install + - run: bun lint diff --git a/devenv.lock b/devenv.lock deleted file mode 100644 index fb51585..0000000 --- a/devenv.lock +++ /dev/null @@ -1,122 +0,0 @@ -{ - "nodes": { - "devenv": { - "locked": { - "dir": "src/modules", - "lastModified": 1722262342, - "owner": "cachix", - "repo": "devenv", - "rev": "11a1ca0ad80bc172d2efda34ae542494442dcf48", - "treeHash": "c1be883f8fad6adb0369cef0ac6e6c9bd7f3ec66", - "type": "github" - }, - "original": { - "dir": "src/modules", - "owner": "cachix", - "repo": "devenv", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1716977621, - "owner": "cachix", - "repo": "devenv-nixpkgs", - "rev": "4267e705586473d3e5c8d50299e71503f16a6fb6", - "treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412", - "type": "github" - }, - "original": { - "owner": "cachix", - "ref": "rolling", - "repo": "devenv-nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1722087241, - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8c50662509100d53229d4be607f1a3a31157fa12", - "treeHash": "cbc560aaf05dfc49bde55e55f603d7245515b13a", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1721042469, - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", - "treeHash": "91f40b7a3b9f6886bd77482cba5b5cd890415a2e", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "root": { - "inputs": { - "devenv": "devenv", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index b9b8421..4377507 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -1 +1,5 @@ -{"version":"7","dialect":"sqlite","entries":[]} \ No newline at end of file +{ + "version": "7", + "dialect": "sqlite", + "entries": [] +} diff --git a/package.json b/package.json index 8903c67..ff78610 100644 --- a/package.json +++ b/package.json @@ -6,17 +6,13 @@ "dev": "vite dev", "build": "vite build", "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "lint": "eslint .", - "fmt": "prettier --write .", "fmt:check": "prettier --check .", - - "generate": "drizzle-kit generate --dialect sqlite --schema ./src/schema.ts", - "migrate": "bun ./src/migrate.ts" + "generate": "drizzle-kit generate --dialect sqlite --schema ./src/contrib/schema.ts", + "migrate": "bun ./src/contrib/migrate.ts" }, "devDependencies": { "@sveltejs/kit": "^2.0.0", diff --git a/src/migrate.ts b/src/contrib/migrate.ts similarity index 74% rename from src/migrate.ts rename to src/contrib/migrate.ts index 36c0ad5..8af5859 100644 --- a/src/migrate.ts +++ b/src/contrib/migrate.ts @@ -1,5 +1,5 @@ import { migrate } from "drizzle-orm/bun-sqlite/migrator"; -import { DB } from "./lib/server/db"; +import { DB } from "../lib/server/db"; await migrate(DB, { migrationsFolder: "./drizzle" }); diff --git a/src/contrib/schema.ts b/src/contrib/schema.ts new file mode 100644 index 0000000..b82d744 --- /dev/null +++ b/src/contrib/schema.ts @@ -0,0 +1,17 @@ +// import { +// type InferSelectModel, +// type InferInsertModel, +// sql +// } from "drizzle-orm"; + +// import { +// blob, +// sqliteTable, +// text, +// real, +// numeric, +// integer, +// foreignKey, +// } from "drizzle-orm/sqlite-core"; + +export {} diff --git a/src/lib/drizzle.ts b/src/lib/drizzle.ts new file mode 100644 index 0000000..9e4e1f4 --- /dev/null +++ b/src/lib/drizzle.ts @@ -0,0 +1 @@ +export * from "../contrib/schema"; diff --git a/src/schema.ts b/src/schema.ts deleted file mode 100644 index 8af3077..0000000 --- a/src/schema.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { type InferSelectModel } from "drizzle-orm"; -import { - blob, - sqliteTable, - text, - real, - numeric, - integer, - foreignKey, -} from "drizzle-orm/sqlite-core";