-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use biome for formatting for the javascript projects (#12)
* Add zod for types or whatever * wip * Remove type defs from queries/decoders * Further cleanup * Remove commented out code + minor code tweak * Add basic biome setup * wip * Simplify * lint & format using biome * Refine config * Tray once more to ignore test-content * Use original scripts/test-content * Add format command * Add format command to frontend * Remove author/license from package.json * update pacakge-lock.json * Use biome 1.8.0 * enable css linter * Add linting to api Plus fix some biome complaints * Simplify biome.jsonc files And format code * Add github workflow * Fix build * Add build step for ci * Oh npm, you do like the word `run` * Skip build if no build present --------- Co-authored-by: Brett Beutell <[email protected]>
- Loading branch information
Showing
71 changed files
with
10,973 additions
and
5,485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This workflow will be triggered by a GitHub pull-request. | ||
--- | ||
name: Build node packages | ||
|
||
on: | ||
pull_request: | ||
branches: ["*"] | ||
push: | ||
branches: ["main", "release-*"] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
FORCE_COLOR: true | ||
|
||
jobs: | ||
build_packages: | ||
name: Build packages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: lts/* | ||
cache: npm | ||
- name: Install dependencies | ||
run: npm ci --workspaces | ||
|
||
- name: Lint all workspaces | ||
run: npm run lint:ci --workspaces | ||
|
||
- name: Build all workspaces | ||
run: npm run build --workspaces --if-present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,6 @@ yarn-error.log | |
|
||
# Personal files | ||
mizu.boots.code-workspace | ||
.vscode | ||
node_modules | ||
start-dev.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json", | ||
"extends": ["../biome.jsonc"], | ||
"css": { | ||
"linter": { | ||
"enabled": true | ||
} | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
}, | ||
"files": { | ||
"ignore": ["meta/*.json", "test-content/*.*"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import type { Config } from 'drizzle-kit'; | ||
import { config } from 'dotenv'; | ||
import { config } from "dotenv"; | ||
import type { Config } from "drizzle-kit"; | ||
|
||
config({ path: '.dev.vars' }); | ||
config({ path: ".dev.vars" }); | ||
|
||
export default { | ||
schema: './src/db/schema.ts', | ||
out: 'drizzle', | ||
dialect: 'sqlite', | ||
schema: "./src/db/schema.ts", | ||
out: "drizzle", | ||
dialect: "sqlite", | ||
dbCredentials: { | ||
// biome-ignore lint/style/noNonNullAssertion: we want this to fail if not defined | ||
url: process.env.DATABASE_URL!, | ||
} | ||
} satisfies Config; | ||
}, | ||
} satisfies Config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import { createClient } from '@libsql/client'; | ||
import { config } from 'dotenv'; | ||
import { migrate } from 'drizzle-orm/libsql/migrator'; | ||
import { drizzle } from 'drizzle-orm/libsql'; | ||
import { createClient } from "@libsql/client"; | ||
import { config } from "dotenv"; | ||
import { drizzle } from "drizzle-orm/libsql"; | ||
import { migrate } from "drizzle-orm/libsql/migrator"; | ||
|
||
config({ path: '.dev.vars' }); | ||
config({ path: ".dev.vars" }); | ||
|
||
if (!process.env.DATABASE_URL) { | ||
console.error('DATABASE_URL not defined'); | ||
console.error("DATABASE_URL not defined"); | ||
process.exit(1); | ||
} | ||
|
||
const databaseUrl = process.env.DATABASE_URL; | ||
const sql = createClient({ | ||
url: databaseUrl | ||
}) | ||
url: databaseUrl, | ||
}); | ||
const db = drizzle(sql); | ||
|
||
const main = async () => { | ||
try { | ||
await migrate(db, { migrationsFolder: 'drizzle' }); | ||
console.log('Migration complete'); | ||
await migrate(db, { migrationsFolder: "drizzle" }); | ||
console.log("Migration complete"); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
process.exit(0); | ||
}; | ||
|
||
main(); | ||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.