Skip to content

Commit 5d06fa5

Browse files
feat: introduce @auth/sequelize-adapter (#7806)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope. This PR is part of a series to convert adapters, using `@auth/core` for types. BREAKING CHANGE: If you are coming from the previous adapter, change your `package.json`: ```diff - "@next-auth/sequelize-adapter": "0.0.0", + "@auth/sequelize-adapter": "0.0.0", ``` And run `npm install`, `yarn install` or `pnpm install` respectively. **Note:** This packages is published as ESM-only
1 parent e7a5207 commit 5d06fa5

File tree

8 files changed

+59
-32
lines changed

8 files changed

+59
-32
lines changed

.github/ISSUE_TEMPLATE/3_bug_adapter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ body:
3030
- "@auth/neo4j-adapter"
3131
- "@auth/pouchdb-adapter"
3232
- "@auth/prisma-adapter"
33-
- "@next-auth/sequelize-adapter"
33+
- "@auth/sequelize-adapter"
3434
- "@next-auth/supabase-adapter"
3535
- "@auth/typeorm-adapter"
3636
- "@auth/upstash-redis-adapter"

.github/issue-labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ prisma:
2828
- "@auth/prisma-adapter"
2929

3030
sequelize:
31-
- "@next-auth/sequelize-adapter"
31+
- "@auth/sequelize-adapter"
3232

3333
supabase:
3434
- "@next-auth/supabase-adapter"

packages/adapter-sequelize/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
</a>
99
<h3 align="center"><b>Sequelize Adapter</b> - NextAuth.js / Auth.js</a></h3>
1010
<p align="center" style="align: center;">
11-
<a href="https://npm.im/@next-auth/sequelize-adapter">
11+
<a href="https://npm.im/@auth/sequelize-adapter">
1212
<img src="https://img.shields.io/badge/TypeScript-blue?style=flat-square" alt="TypeScript" />
1313
</a>
14-
<a href="https://npm.im/@next-auth/sequelize-adapter">
15-
<img alt="npm" src="https://img.shields.io/npm/v/@next-auth/sequelize-adapter?color=green&label=@next-auth/sequelize-adapter&style=flat-square">
14+
<a href="https://npm.im/@auth/sequelize-adapter">
15+
<img alt="npm" src="https://img.shields.io/npm/v/@auth/sequelize-adapter?color=green&label=@auth/sequelize-adapter&style=flat-square">
1616
</a>
17-
<a href="https://www.npmtrends.com/@next-auth/sequelize-adapter">
18-
<img src="https://img.shields.io/npm/dm/@next-auth/sequelize-adapter?label=%20downloads&style=flat-square" alt="Downloads" />
17+
<a href="https://www.npmtrends.com/@auth/sequelize-adapter">
18+
<img src="https://img.shields.io/npm/dm/@auth/sequelize-adapter?label=%20downloads&style=flat-square" alt="Downloads" />
1919
</a>
2020
<a href="https://github.com/nextauthjs/next-auth/stargazers">
2121
<img src="https://img.shields.io/github/stars/nextauthjs/next-auth?style=flat-square" alt="Github Stars" />
Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
{
2-
"name": "@next-auth/sequelize-adapter",
3-
"version": "1.0.8",
4-
"description": "Sequelize adapter for next-auth.",
2+
"name": "@auth/sequelize-adapter",
3+
"version": "0.0.0.",
4+
"description": "Sequelize adapter for Auth.js",
55
"homepage": "https://authjs.dev",
66
"repository": "https://github.com/nextauthjs/next-auth",
77
"bugs": {
88
"url": "https://github.com/nextauthjs/next-auth/issues"
99
},
1010
"author": "github.com/luke-j",
11-
"main": "dist/index.js",
11+
"type": "module",
12+
"types": "./index.d.ts",
13+
"files": [
14+
"*.js",
15+
"*.d.ts*",
16+
"src"
17+
],
18+
"exports": {
19+
".": {
20+
"types": "./index.d.ts",
21+
"import": "./index.js"
22+
}
23+
},
1224
"license": "ISC",
1325
"keywords": [
1426
"next-auth",
@@ -21,25 +33,22 @@
2133
"access": "public"
2234
},
2335
"scripts": {
24-
"test:wip": "jest",
36+
"test": "jest",
2537
"build": "tsc"
2638
},
27-
"files": [
28-
"README.md",
29-
"dist"
30-
],
39+
"dependencies": {
40+
"@auth/core": "workspace:*"
41+
},
3142
"peerDependencies": {
32-
"next-auth": "^4",
3343
"sequelize": "^6.6.5"
3444
},
3545
"devDependencies": {
3646
"@next-auth/adapter-test": "workspace:*",
3747
"@next-auth/tsconfig": "workspace:*",
3848
"jest": "^27.4.3",
39-
"next-auth": "workspace:*",
4049
"sequelize": "^6.6.5"
4150
},
4251
"jest": {
4352
"preset": "@next-auth/adapter-test/jest"
4453
}
45-
}
54+
}

packages/adapter-sequelize/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
* ## Installation
1010
*
1111
* ```bash npm2yarn2pnpm
12-
* npm install next-auth @next-auth/sequelize-adapter sequelize
12+
* npm install next-auth @auth/sequelize-adapter sequelize
1313
* ```
1414
*
15-
* @module @next-auth/sequelize-adapter
15+
* @module @auth/sequelize-adapter
1616
*/
1717
import type {
1818
Adapter,
@@ -70,7 +70,7 @@ export interface SequelizeAdapterOptions {
7070
*
7171
* ```javascript title="pages/api/auth/[...nextauth].js"
7272
* import NextAuth from "next-auth"
73-
* import SequelizeAdapter from "@next-auth/sequelize-adapter"
73+
* import SequelizeAdapter from "@auth/sequelize-adapter"
7474
* import { Sequelize } from "sequelize"
7575
*
7676
* // https://sequelize.org/master/manual/getting-started.html#connecting-to-a-database
@@ -93,7 +93,7 @@ export interface SequelizeAdapterOptions {
9393
*
9494
* ```js
9595
* import NextAuth from "next-auth"
96-
* import SequelizeAdapter from "@next-auth/sequelize-adapter"
96+
* import SequelizeAdapter from "@auth/sequelize-adapter"
9797
* import Sequelize from 'sequelize'
9898
*
9999
* const sequelize = new Sequelize("sqlite::memory:")
@@ -117,7 +117,7 @@ export interface SequelizeAdapterOptions {
117117
*
118118
* ```js
119119
* import NextAuth from "next-auth"
120-
* import SequelizeAdapter, { models } from "@next-auth/sequelize-adapter"
120+
* import SequelizeAdapter, { models } from "@auth/sequelize-adapter"
121121
* import Sequelize, { DataTypes } from "sequelize"
122122
*
123123
* const sequelize = new Sequelize("sqlite::memory:")
Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
{
2-
"extends": "@next-auth/tsconfig/tsconfig.adapters.json",
2+
"extends": "@next-auth/tsconfig/tsconfig.base.json",
33
"compilerOptions": {
4+
"allowJs": true,
5+
"baseUrl": ".",
6+
"isolatedModules": true,
7+
"target": "ES2020",
8+
"module": "ESNext",
9+
"moduleResolution": "node",
10+
"outDir": ".",
411
"rootDir": "src",
5-
"outDir": "dist"
12+
"skipDefaultLibCheck": true,
13+
"strictNullChecks": true,
14+
"stripInternal": true,
15+
"declarationMap": true,
16+
"declaration": true
617
},
7-
"exclude": ["tests", "dist", "jest.config.js"]
8-
}
18+
"include": [
19+
"src/**/*"
20+
],
21+
"exclude": [
22+
"*.js",
23+
"*.d.ts",
24+
]
25+
}

pnpm-lock.yaml

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

turbo.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@auth/mongodb-adapter#build",
6464
"@auth/neo4j-adapter#build",
6565
"@auth/pouchdb-adapter#build",
66-
"@next-auth/sequelize-adapter#build",
66+
"@auth/sequelize-adapter#build",
6767
"@next-auth/supabase-adapter#build",
6868
"@auth/typeorm-adapter#build",
6969
"@auth/upstash-redis-adapter#build",
@@ -86,7 +86,7 @@
8686
"@auth/mongodb-adapter#build",
8787
"@auth/neo4j-adapter#build",
8888
"@auth/pouchdb-adapter#build",
89-
"@next-auth/sequelize-adapter#build",
89+
"@auth/sequelize-adapter#build",
9090
"@next-auth/supabase-adapter#build",
9191
"@auth/typeorm-adapter#build",
9292
"@auth/upstash-redis-adapter#build",

0 commit comments

Comments
 (0)