Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: code structure #13

Merged
merged 12 commits into from
Dec 21, 2023
3 changes: 1 addition & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"printWidth": 120,
"printWidth": 100,
"semi": false,
"singleQuote": true,
"importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
"plugins": ["@trivago/prettier-plugin-sort-imports"]
}
17 changes: 15 additions & 2 deletions @api/context.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import type { Env } from './env'
import { createAuthGithub, createAuthGoogle, createCreateAuthJwtFn, createValidateAuthJwtFn } from './lib/auth'
import {
createAuthGithub,
createAuthGoogle,
createCreateAuthJwtFn,
createValidateAuthJwtFn,
} from './lib/auth'
import { createDb } from './lib/db'
import { createSendEmailFn } from './lib/email'

export function createContext({ env, ec, request }: { env: Env; ec: ExecutionContext; request?: Request }) {
export function createContext({
env,
ec,
request,
}: {
env: Env
ec: ExecutionContext
request?: Request
}) {
const db = createDb({ env })
const createAuthJwt = createCreateAuthJwtFn({ env })
const validateAuthJwt = createValidateAuthJwtFn({ env })
Expand Down
2 changes: 2 additions & 0 deletions @api/database/migrations/0003_youthful_magneto.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "organizations_invitations" RENAME COLUMN "id" TO "secret_key";--> statement-breakpoint
ALTER TABLE "sessions" RENAME COLUMN "id" TO "secret_key";
Loading
Loading