Skip to content

Commit

Permalink
feat(nuxt): add lucia arctic package
Browse files Browse the repository at this point in the history
  • Loading branch information
productdevbook committed Feb 17, 2024
1 parent a7c7dd5 commit 230cf55
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"@urql/exchange-graphcache": "^6.4.1",
"@urql/vue": "^1.1.2",
"@vue/test-utils": "^2.4.4",
"arctic": "^1.1.6",
"bullmq": "^5.2.0",
"c12": "^1.8.0",
"dotenv": "^16.4.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/playground/server/graphqlYoga-test/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ declare module 'pergel/test/types' {
import type { H3Event } from 'h3'
import type { YogaInitialContext } from 'graphql-yoga'
import type { PostgresJsDatabase } from 'drizzle-orm/postgres-js'
import type { TestDrizzleStorage } from '#test/server/drizzle/storage'
import type { TestDrizzleStorage } from '#test/drizzle/storage'

interface GraphqlYogaContext extends YogaInitialContext {
res: ServerResponse
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/playground/server/lucia-test/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { session, user } from '#test/server/drizzle/schema'
import { session, user } from '#test/drizzle/schema'

const connect = await pergelTest()
.drizzle()
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/playground/server/lucia-test/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Session, User } from '#test/server/drizzle/schema'
import type { testAuth } from '#test/server/lucia'
import type { Session, User } from '#test/drizzle/schema'
import type { testAuth } from '#test/lucia'

declare module 'lucia' {
interface Register {
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/runtime/modules/graphqlYoga/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export interface GraphQLYogaConfig extends PergelModuleOptions {
nuxtModule: string

/**
* #projectName/server/drizzle/schema
* #projectName/drizzle/schema
*/
drizzleShemas: (key: string) => string
}
Expand Down Expand Up @@ -279,7 +279,7 @@ export interface ResolvedGraphQLYogaConfig extends GraphQLYogaConfig, ResolvedPe
nuxtModule: string

/**
* #projectName/server/drizzle/schema
* #projectName/drizzle/schema
*/
drizzleShemas: (key: string) => string
}
Expand Down
3 changes: 2 additions & 1 deletion packages/nuxt/src/runtime/modules/lucia/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default definePergelModule<LuciaModuleOptions, ResolvedLuciaModuleOptions
'lucia': deps.lucia,
'oslo': deps.oslo,
'@lucia-auth/oauth': deps['@lucia-auth/oauth'],
'arctic': deps.arctic,
}

switch (driver) {
Expand Down Expand Up @@ -88,7 +89,7 @@ export default definePergelModule<LuciaModuleOptions, ResolvedLuciaModuleOptions
writeFilePergel(
`${options.serverDir}/index.ts`,
/* ts */`
import { session, user } from '#${options.projectName}/server/drizzle/schema'
import { session, user } from '#${options.projectName}/drizzle/schema'
const connect = await ${options.projectNameCamelCaseWithPergel}()
.drizzle()
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 230cf55

Please sign in to comment.