-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extract a database adapter package for drizzle (#104)
* feat: extract a database adapter package for drizzle * feat: extract a database adapter package for drizzle * Add core types and adapters, update tsconfig.json and package.json, delete drizzle adapter and auth-drizzle-adapter * Add core types and adapters, update tsconfig.json and package.json, delete drizzle adapter and auth-drizzle-adapter * add changesets * apply CourseBuilderAdapter interface to sqlite and pg to remove `any` from DrizzleAdapter * Add role column to user table for sqlite & pg * add a changeset * fix:build * fix: remove broken test scripts * fix: turbo caching outputs for adapter * fix: prettier * we ain't trying to test * Delete .changeset/wet-fans-notice.md * Update weak-pillows-exist.md * drizzle-orm as a peer dependency * fix the package lock * fix package sorting 🤡 * Update apps/course-builder-web/src/app/tips/page.tsx * created an initial deepgram provider that handles the initial ordering of a transcript * providers folder not to be committed * providers in turbo outputs * handle deepgram results with provider * move the adapter and transcriptProvider into a top level config for the app * sort a package
- Loading branch information
Showing
49 changed files
with
5,084 additions
and
3,181 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,9 @@ | ||
--- | ||
"@coursebuilder/adapter-drizzle": patch | ||
"@coursebuilder/core": patch | ||
"create-course-app": patch | ||
--- | ||
|
||
adding adapter and core packages to extend the pattern that is presented by authjs to include Course Builder `contentResource` schema | ||
|
||
this approach will allow us to maintain adapters for mysql, sqlite, and pg, potentially beyond drizzle if needed |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20.5.0 | ||
20.11.1 |
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
8 changes: 2 additions & 6 deletions
8
apps/course-builder-web/src/app/api/auth/[...nextauth]/route.ts
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,6 +1,2 @@ | ||
import { authOptions } from '@/server/auth' | ||
import { withSkill } from '@/server/with-skill' | ||
import NextAuth from 'next-auth' | ||
|
||
const handler = withSkill(NextAuth(authOptions)) | ||
export { handler as GET, handler as POST } | ||
export { GET, POST } from '@/server/auth' | ||
export const runtime = 'edge' // optional |
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
23 changes: 23 additions & 0 deletions
23
apps/course-builder-web/src/coursebuilder/course-builder-config.ts
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,23 @@ | ||
import { db } from '@/db' | ||
import { mysqlTable } from '@/db/schema' | ||
import { env } from '@/env.mjs' | ||
|
||
import { DrizzleAdapter } from '@coursebuilder/adapter-drizzle' | ||
import { type CourseBuilderAdapter } from '@coursebuilder/core/adapters' | ||
import { type TranscriptionConfig } from '@coursebuilder/core/providers' | ||
import DeepgramProvider from '@coursebuilder/core/providers/deepgram' | ||
|
||
const callbackBase = env.NODE_ENV === 'production' ? env.UPLOADTHING_URL : env.NEXT_PUBLIC_URL | ||
|
||
interface CourseBuilderConfig { | ||
adapter: CourseBuilderAdapter | ||
transcriptProvider: TranscriptionConfig | ||
} | ||
|
||
export const courseBuilderConfig: CourseBuilderConfig = { | ||
adapter: DrizzleAdapter(db, mysqlTable), | ||
transcriptProvider: DeepgramProvider({ | ||
apiKey: env.DEEPGRAM_API_KEY, | ||
callbackUrl: `${callbackBase}/api/deepgram/webhook`, | ||
}), | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.