*: format
vi did:web:vt3e.cat
Mon, 25 May 2026 15:44:22 +0100
10 files changed,
143 insertions(+),
75 deletions(-)
A
.zed/settings.json
@@ -0,0 +1,80 @@
+{ + "lsp": { + "oxlint": { + "initialization_options": { + "settings": { + "configPath": null, + "run": "onType", + "disableNestedConfig": false, + "fixKind": "safe_fix", + "unusedDisableDirectives": "deny", + }, + }, + }, + "oxfmt": { + "initialization_options": { + "settings": { + "fmt.configPath": null, + "run": "onSave", + }, + }, + }, + }, + "languages": { + "JavaScript": { + "format_on_save": "on", + "prettier": { + "allowed": false, + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt", + }, + }, + { + "code_action": "source.fixAll.oxc", + }, + ], + }, + "JSON": { + "format_on_save": "on", + "prettier": { + "allowed": false, + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt", + }, + }, + ], + }, + "Markdown": { + "format_on_save": "on", + "prettier": { + "allowed": false, + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt", + }, + }, + ], + }, + "TypeScript": { + "format_on_save": "on", + "prettier": { + "allowed": false, + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt", + }, + }, + ], + }, + }, +}
M
package.json
→
package.json
@@ -1,12 +1,16 @@
{ "name": "stealth-developers", - "module": "index.ts", - "type": "module", + "private": true, "workspaces": [ "apps/*", "pkgs/*" ], - "private": true, + "type": "module", + "module": "index.ts", + "scripts": { + "format": "bunx oxfmt format pkgs apps", + "lint": "bunx oxlint link pkgs apps" + }, "devDependencies": { "@types/bun": "latest", "oxfmt": "^0.51.0",
M
pkgs/config/package.json
→
pkgs/config/package.json
@@ -1,20 +1,20 @@
{ "name": "@stealth-developers/config", + "type": "module", "main": "./src/index.ts", "types": "./src/index.ts", - "type": "module", + "scripts": { + "build:types": "tsc --emitDeclarationOnly", + "build:js": "bun build ./src/index.ts --outdir ./dist --minify --target bun", + "build": "bun run build:types && bun run build:js" + }, + "dependencies": { + "zod": "^4.4.3" + }, "devDependencies": { "@types/bun": "latest" }, "peerDependencies": { "typescript": "^5" - }, - "dependencies": { - "zod": "^4.4.3" - }, - "scripts": { - "build:types": "tsc --emitDeclarationOnly", - "build:js": "bun build ./src/index.ts --outdir ./dist --minify --target bun", - "build": "bun run build:types && bun run build:js" } }
M
pkgs/config/src/index.ts
→
pkgs/config/src/index.ts
@@ -8,19 +8,12 @@
function getConfigPath() { let envPath = Bun.env.CONFIG_FILE; if (envPath) { - envPath = envPath - .replaceAll("{ENVIRONMENT}", ENVIRONMENT) - .replaceAll("{ENV}", ENVIRONMENT); + envPath = envPath.replaceAll("{ENVIRONMENT}", ENVIRONMENT).replaceAll("{ENV}", ENVIRONMENT); return resolve(envPath); } - return join( - import.meta.dir, - "..", - "environments", - `config.${ENVIRONMENT}.json`, - ); + return join(import.meta.dir, "..", "environments", `config.${ENVIRONMENT}.json`); } async function loadConfig(): Promise<Config> {@@ -37,14 +30,10 @@ if (parsed.success) return parsed.data;
console.error("[!] failed to parse config:"); - const longestPath = Math.max( - ...parsed.error.issues.map((err) => err.path.join(".").length), - ); + const longestPath = Math.max(...parsed.error.issues.map((err) => err.path.join(".").length)); for (const err of parsed.error.issues) { const path = err.path.join("."); - console.error( - ` * ${path.padEnd(longestPath)} ${err.message} (${err.code})`, - ); + console.error(` * ${path.padEnd(longestPath)} ${err.message} (${err.code})`); } process.exit(1); }
M
pkgs/config/src/schema.ts
→
pkgs/config/src/schema.ts
@@ -4,7 +4,7 @@
const discordSchema = z.object({ token: z.string(), app_id: z.string(), - client_secret: z.string() + client_secret: z.string(), }); const dbSchema = z.object({
M
pkgs/db/drizzle.config.ts
→
pkgs/db/drizzle.config.ts
@@ -1,12 +1,12 @@
-import { defineConfig } from 'drizzle-kit'; -import config from '@stealth-developers/config'; +import { defineConfig } from "drizzle-kit"; +import config from "@stealth-developers/config"; export default defineConfig({ - out: './drizzle', - schema: './src/db/schema.ts', - dialect: 'turso', + out: "./drizzle", + schema: "./src/db/schema.ts", + dialect: "turso", dbCredentials: { url: config.db.url, - authToken: config.db.auth + authToken: config.db.auth, }, });
M
pkgs/db/package.json
→
pkgs/db/package.json
@@ -1,18 +1,18 @@
{ "name": "@stealth-developers/db", + "type": "module", "main": "./src/index.ts", "types": "./src/index.ts", - "type": "module", + "dependencies": { + "@libsql/client": "^0.17.3", + "drizzle-orm": "v1.0.0-rc.3" + }, "devDependencies": { "@types/bun": "latest", "drizzle-kit": "v1.0.0-rc.3" }, "peerDependencies": { - "typescript": "^5", - "@stealth-developers/config": "workspace:*" - }, - "dependencies": { - "@libsql/client": "^0.17.3", - "drizzle-orm": "v1.0.0-rc.3" + "@stealth-developers/config": "workspace:*", + "typescript": "^5" } }
M
pkgs/db/src/index.ts
→
pkgs/db/src/index.ts
@@ -1,13 +1,13 @@
-import { createClient } from '@libsql/client'; -import { drizzle } from 'drizzle-orm/libsql'; -import config from '@stealth-developers/config'; +import { createClient } from "@libsql/client"; +import { drizzle } from "drizzle-orm/libsql"; +import config from "@stealth-developers/config"; const client = createClient({ url: config.db.url, - authToken: config.db.auth + authToken: config.db.auth, }); const db = drizzle({ client }); -export * from "./schemas" -export default db +export * from "./schemas"; +export default db;
M
pkgs/db/src/schemas/index.ts
→
pkgs/db/src/schemas/index.ts
@@ -1,5 +1,5 @@
-import { defineRelations } from "drizzle-orm" -import * as s from "drizzle-orm/sqlite-core" +import { defineRelations } from "drizzle-orm"; +import * as s from "drizzle-orm/sqlite-core"; export const actors = s.sqliteTable("actors", { id: s.integer("id").primaryKey({ autoIncrement: true }),@@ -12,13 +12,14 @@
createdAt: s.integer("created_at", { mode: "timestamp" }).notNull(), updatedAt: s.integer("updated_at", { mode: "timestamp" }).notNull(), deletedAt: s.integer("deleted_at", { mode: "timestamp" }), -}) +}); export const sessions = s.sqliteTable("sessions", { id: s.text("id").primaryKey(), - userId: s.integer("user_id") - .notNull() - .references(() => actors.id), + userId: s + .integer("user_id") + .notNull() + .references(() => actors.id), accessToken: s.text("access_token").notNull(), refreshToken: s.text("refresh_token").notNull(),@@ -27,22 +28,19 @@ createdAt: s.integer("created_at", { mode: "timestamp" }).notNull(),
scope: s.text("scope"), tokenType: s.text("token_type"), -}) +}); -export const actorRelationships = defineRelations( - { actors, sessions }, - (r) => ({ - actors: { - sessions: r.many.sessions({ - from: r.actors.id, - to: r.sessions.userId, - }), - }, - sessions: { - actor: r.one.actors({ - from: r.sessions.userId, - to: r.actors.id, - }), - }, - }) -) +export const actorRelationships = defineRelations({ actors, sessions }, (r) => ({ + actors: { + sessions: r.many.sessions({ + from: r.actors.id, + to: r.sessions.userId, + }), + }, + sessions: { + actor: r.one.actors({ + from: r.sessions.userId, + to: r.actors.id, + }), + }, +}));
M
pkgs/db/tsconfig.json
→
pkgs/db/tsconfig.json
@@ -3,8 +3,5 @@ "extends": "../../tsconfig.json",
"compilerOptions": { "rootDir": "." }, - "include": [ - "src/**/*", - "drizzle.config.ts" - ] + "include": ["src/**/*", "drizzle.config.ts"] }