Compare commits

..

12 Commits

Author SHA1 Message Date
Thang Vu
186e168da7 formatting the PR 2023-09-16 16:18:33 +07:00
Thang Vu
d2daf63c43 Merge branch 'main' into d1-adapter 2023-09-16 15:45:15 +07:00
Josh Schlesser
571ffc823c Merge branch 'main' into d1-adapter 2023-03-29 12:10:15 -07:00
Joshua Schlesser
75042bde21 Merge branch 'd1-adapter' of github.com:jschlesser/next-auth into d1-adapter 2023-03-28 09:58:52 -07:00
Joshua Schlesser
29cbd11552 changed to esm module 2023-03-27 10:36:15 -07:00
Nico Domino
030bae3517 Merge branch 'main' into d1-adapter 2023-03-27 19:00:41 +02:00
Nico Domino
46a5e369be Merge branch 'main' into d1-adapter 2023-03-26 18:59:42 +02:00
Joshua Schlesser
e54c195179 cleaning out unused file 2023-03-23 07:44:08 -07:00
Joshua Schlesser
b34aef3758 Merge branch 'main' into adapter-d1-2 2023-03-23 07:37:36 -07:00
Joshua Schlesser
294918e127 fixed up d1 logo in docs 2023-03-23 07:07:07 -07:00
Joshua Schlesser
84b51405ac Added documentation 2023-03-22 09:22:09 -07:00
Joshua Schlesser
8da00c56e4 cleaned everything up 2023-03-22 06:57:56 -07:00
7 changed files with 1023 additions and 402 deletions

View File

@@ -8,7 +8,6 @@ Using an Auth.js / NextAuth.js adapter you can connect to any database service o
<a href="/reference/adapter/d1" class="adapter-card">
<img src="/img/adapters/d1.svg" width="40" />
<h4 class="adapter-card__title">D1 Adapter</h4>
</a>
<a href="/reference/adapter/edgedb" class="adapter-card">
<img src="/img/adapters/edgedb.svg" width="30" />
<h4 class="adapter-card__title">EdgeDB Adapter</h4>

View File

@@ -1,6 +1,6 @@
{
"name": "@auth/d1-adapter",
"version": "0.2.0",
"version": "0.1.2",
"description": "A Cloudflare D1 adapter for Auth.js",
"homepage": "https://authjs.dev",
"repository": "https://github.com/nextauthjs/next-auth",
@@ -8,30 +8,24 @@
"url": "https://github.com/nextauthjs/next-auth/issues"
},
"author": "Josh Schlesser <josh@schlesser.dev>",
"contributors": [
"Thang Huu Vu <hi@thvu.dev>"
],
"contributors": [],
"license": "ISC",
"keywords": [
"next-auth",
"@auth",
"Auth.js",
"next.js",
"oauth",
"authjs",
"authjs.dev",
"cloudflare",
"d1"
],
"type": "module",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.js"
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"files": [
"*.d.ts*",
"*.js",
"src"
"dist"
],
"private": false,
"publishConfig": {
@@ -42,18 +36,19 @@
"clean": "rm -rf dist",
"test": "jest"
},
"dependencies": {
"peerDependencies": {
"@auth/core": "workspace:*"
},
"devDependencies": {
"@auth/adapter-test": "workspace:*",
"@auth/tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20230321.0",
"@miniflare/d1": "^2.12.2",
"@auth/adapter-test": "workspace:*",
"@auth/tsconfig": "workspace:*",
"better-sqlite3": "^7.0.0",
"jest": "^29.3.0"
"jest": "^27.0.3",
"next-auth": "workspace:*"
},
"jest": {
"preset": "@auth/adapter-test/jest"
}
}
}

View File

@@ -56,9 +56,11 @@ async function up(db: D1Database) {
// run the migration
upSQLStatements.forEach(async (sql) => {
try {
console.log("applying db migration sql", sql)
const res = await db.prepare(sql).run()
console.log("migration result", res)
} catch (e: any) {
console.error(e.cause?.message, e.message)
console.log(e.cause?.message, e.message)
}
})
}

View File

@@ -16,16 +16,6 @@ import { D1Database, D1DatabaseAPI } from "@miniflare/d1"
import { runBasicTests } from "@auth/adapter-test"
import Database from "better-sqlite3"
globalThis.crypto ??= require("node:crypto").webcrypto
if (process.env.CI) {
// TODO: Fix this
test('Skipping D1Adapter tests in CI because of "Error: Must use import to load ES Module: next-auth/node_modules/.pnpm/undici@5.20.0/node_modules/undici/lib/llhttp/llhttp.wasm" errors. Should revisit', () => {
expect(true).toBe(true)
})
process.exit(0)
}
const sqliteDB = new Database(":memory:")
let db = new D1Database(new D1DatabaseAPI(sqliteDB as any))
let adapter = D1Adapter(db)

View File

@@ -15,6 +15,6 @@
"declarationMap": true,
"declaration": true
},
"include": ["src/**/*"],
"include": ["src/**/*", "tests/migrations"],
"exclude": ["*.js", "*.d.ts"]
}

View File

@@ -8,9 +8,6 @@
"url": "https://github.com/nextauthjs/next-auth/issues"
},
"author": "Bruno Crosier",
"contributors": [
"Thang Huu Vu <hi@thvu.dev>"
],
"type": "module",
"types": "./index.d.ts",
"files": [
@@ -40,11 +37,9 @@
"build": "tsc",
"test": "jest"
},
"dependencies": {
"@auth/core": "workspace:*"
},
"peerDependencies": {
"edgedb": "^1.0.1"
"edgedb": "^1.0.1",
"@auth/core": "^0.3.0"
},
"devDependencies": {
"@auth/adapter-test": "workspace:^0.0.0",
@@ -57,4 +52,4 @@
"jest": {
"preset": "@auth/adapter-test/jest"
}
}
}

1364
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff