Add ESLint to all packages and reorganize CLI
ESLint: - Add @macalinao/eslint-config and eslint to all packages/apps - Add lint scripts to all package.json files - Create eslint.config.js for all apps - Add lint task to turbo.json - Add @macalinao/eslint-config and @types/bun to catalog Biome: - Exclude docs/ from biome checks CLI Reorganization: - Restructure CLI to use route maps with one command per file - Move commands to routes/ directory structure - Use func property instead of async loaders - Route maps in _command.ts files for each directory Environment: - Use Bun.env instead of process.env for env vars - Add DATABASE_URL and PORT to turbo.json globalEnv Lint Fixes: - Fix nullish coalescing operator usage - Update deprecated Zod API (z.email() instead of .string().email()) - Fix import sorting Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,9 @@
|
||||
"zod": "^4.3.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@macalinao/eslint-config": "catalog:",
|
||||
"@macalinao/tsconfig": "catalog:",
|
||||
"eslint": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export const signupInputSchema = z
|
||||
password: z.string().min(8).optional(),
|
||||
passkeyInfo: passkeyInfoSchema.optional(),
|
||||
})
|
||||
.refine((data) => data.password || data.passkeyInfo, {
|
||||
.refine((data) => data.password ?? data.passkeyInfo, {
|
||||
message: "Either password or passkeyInfo is required",
|
||||
});
|
||||
|
||||
|
||||
@@ -7,10 +7,7 @@ import { z } from "zod";
|
||||
/**
|
||||
* Email schema - validates email format and transforms to lowercase
|
||||
*/
|
||||
export const emailSchema = z
|
||||
.string()
|
||||
.email()
|
||||
.toLowerCase() satisfies z.ZodTypeAny;
|
||||
export const emailSchema = z.email().toLowerCase() satisfies z.ZodType;
|
||||
|
||||
/**
|
||||
* Slug schema for org slugs
|
||||
|
||||
@@ -17,10 +17,12 @@
|
||||
"pg": "^8.13.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"kysely-codegen": "^0.19.0",
|
||||
"@macalinao/eslint-config": "catalog:",
|
||||
"@macalinao/tsconfig": "catalog:",
|
||||
"@types/node": "^25.0.3",
|
||||
"@types/pg": "^8.11.10",
|
||||
"@macalinao/tsconfig": "catalog:",
|
||||
"eslint": "catalog:",
|
||||
"kysely-codegen": "^0.19.0",
|
||||
"typescript": "catalog:"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,12 @@
|
||||
"pg": "^8.13.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@macalinao/eslint-config": "catalog:",
|
||||
"@macalinao/tsconfig": "catalog:",
|
||||
"@types/bun": "catalog:",
|
||||
"@types/node": "^25.0.3",
|
||||
"@types/pg": "^8.11.10",
|
||||
"@macalinao/tsconfig": "catalog:",
|
||||
"eslint": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ const { Pool } = pg;
|
||||
* @returns Kysely database instance
|
||||
*/
|
||||
export const createDb = (
|
||||
connectionString: string = process.env.DATABASE_URL || "",
|
||||
connectionString: string = Bun.env.DATABASE_URL ?? "",
|
||||
): Kysely<Database> => {
|
||||
if (!connectionString) {
|
||||
throw new Error(
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"moduleResolution": "NodeNext",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"types": ["node"]
|
||||
"types": ["node", "bun"]
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
|
||||
Reference in New Issue
Block a user