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

feat: rm npm2yarn add npm2yarn2pnpm plugin #4805

Merged
merged 19 commits into from Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/docs/adapters/dgraph.md
Expand Up @@ -11,7 +11,7 @@ This is the Dgraph Adapter for [`next-auth`](https://next-auth.js.org).

1. Install the necessary packages

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth @next-auth/dgraph-adapter
```

Expand Down Expand Up @@ -226,22 +226,22 @@ database you must customize next-auth `encode` and `decode` functions, as the de
further customize the jwt with roles if you want to implement [`RBAC logic`](https://dgraph.io/docs/graphql/authorization/directive/#role-based-access-control).

```js
import * as jwt from "jsonwebtoken";
import * as jwt from "jsonwebtoken"
export default NextAuth({
session: {
strategy: "jwt"
strategy: "jwt",
},
jwt: {
secret: process.env.SECRET,
encode: async ({ secret, token }) => {
return jwt.sign({...token, userId: token.id}, secret, {
return jwt.sign({ ...token, userId: token.id }, secret, {
algorithm: "HS256",
expiresIn: 30 * 24 * 60 * 60, // 30 days
});
})
},
decode: async ({ secret, token }) => {
return jwt.verify(token, secret, { algorithms: ["HS256"] });
}
return jwt.verify(token, secret, { algorithms: ["HS256"] })
},
},
})
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/dynamodb.md
Expand Up @@ -15,7 +15,7 @@ You can find the full schema in the table structure section below.

1. Install `next-auth` and `@next-auth/dynamodb-adapter`

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth @next-auth/dynamodb-adapter
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/fauna.md
Expand Up @@ -13,7 +13,7 @@ You can find the Fauna schema and seed information in the docs at [next-auth.js.

1. Install the necessary packages

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth @next-auth/fauna-adapter faunadb
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/firebase.md
Expand Up @@ -15,7 +15,7 @@ This is the Firebase Adapter for [`next-auth`](https://next-auth.js.org). This p

1. Install the necessary packages

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth @next-auth/firebase-adapter@experimental
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/mikro-orm.md
Expand Up @@ -5,7 +5,7 @@ title: MikroORM

To use this Adapter, you need to install Mikro ORM, the driver that suits your database, and the separate `@next-auth/mikro-orm-adapter` package:

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth @next-auth/mikro-orm-adapter @mikro-orm/core @mikro-orm/[YOUR DRIVER]
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/mongodb.md
Expand Up @@ -11,7 +11,7 @@ The MongoDB adapter does not handle connections automatically, so you will have

1. Install the necessary packages

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth @next-auth/mongodb-adapter mongodb
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/neo4j.md
Expand Up @@ -11,7 +11,7 @@ This is the Neo4j Adapter for [`next-auth`](https://next-auth.js.org). This pack

1. Install the necessary packages

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth @next-auth/neo4j-adapter neo4j-driver
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/pouchdb.md
Expand Up @@ -19,7 +19,7 @@ Depending on your architecture you can use PouchDB's http adapter to reach any d

1. Install `next-auth` and `@next-auth/pouchdb-adapter`

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth @next-auth/pouchdb-adapter
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/prisma.md
Expand Up @@ -7,7 +7,7 @@ title: Prisma

To use this Adapter, you need to install Prisma Client, Prisma CLI, and the separate `@next-auth/prisma-adapter` package:

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth @prisma/client @next-auth/prisma-adapter
npm install prisma --save-dev
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/sequelize.md
Expand Up @@ -11,7 +11,7 @@ This is the Sequelize Adapter for [`next-auth`](https://next-auth.js.org).

1. Install the necessary packages

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth @next-auth/sequelize-adapter sequelize
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/typeorm.md
Expand Up @@ -19,7 +19,7 @@ In the future, we might split up this adapter to support single flavors of SQL f

To use this Adapter, you need to install the following packages:

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth @next-auth/typeorm-legacy-adapter typeorm
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/upstash-redis.md
Expand Up @@ -7,7 +7,7 @@ title: Upstash Redis

To use this Adapter, you need to install `@upstash/redis` and `@next-auth/upstash-redis-adapter` package:

```bash npm2yarn
```bash npm2yarn2pnpm
npm install @upstash/redis @next-auth/upstash-redis-adapter
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/getting-started/upgrade-to-v4.md
Expand Up @@ -13,7 +13,7 @@ We encourage users to try it out and report any and all issues they come across.

You can upgrade to the new version by running:

```bash npm2yarn
```bash npm2yarn2pnpm
npm install next-auth
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tutorials/ldap-auth.md
Expand Up @@ -7,7 +7,7 @@ NextAuth.js provides the ability to setup a [custom Credential provider](/config

You will need an additional dependency, `ldapjs`, which you can install by running

```bash npm2yarn
```bash npm2yarn2pnpm
npm install ldapjs
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tutorials/testing-with-cypress.md
Expand Up @@ -9,7 +9,7 @@ To test an implementation of NextAuth.js, we encourage you to use [Cypress](http

To get started, install the dependencies:

```bash npm2yarn
```bash npm2yarn2pnpm
npm install --save-dev cypress cypress-social-logins @testing-library/cypress
```

Expand Down
5 changes: 4 additions & 1 deletion docs/docusaurus.config.js
@@ -1,3 +1,5 @@
const { npm2yarn2pnpm } = require("@sapphire/docusaurus-plugin-npm2yarn2pnpm")

module.exports = {
title: "NextAuth.js",
tagline: "Authentication for Next.js",
Expand Down Expand Up @@ -147,6 +149,7 @@ module.exports = {
[
"@docusaurus/preset-classic",
{
debug: true,
ndom91 marked this conversation as resolved.
Show resolved Hide resolved
docs: {
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
Expand All @@ -155,9 +158,9 @@ module.exports = {
showLastUpdateAuthor: true,
showLastUpdateTime: true,
remarkPlugins: [
npm2yarn2pnpm,
ndom91 marked this conversation as resolved.
Show resolved Hide resolved
require("remark-github"),
require("mdx-mermaid"),
[require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }],
],
versions: {
current: {
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Expand Up @@ -21,9 +21,9 @@
"dependencies": {
"@docusaurus/core": "^2.0.0-beta.21",
"@docusaurus/preset-classic": "^2.0.0-beta.21",
"@docusaurus/remark-plugin-npm2yarn": "^2.0.0-beta.21",
"@docusaurus/theme-common": "2.0.0-beta.21",
"@mdx-js/react": "1.6.22",
"@sapphire/docusaurus-plugin-npm2yarn2pnpm": "^1.1.0",
"classnames": "^2.3.1",
"mdx-mermaid": "^1.2.2",
"mermaid": "^9.0.1",
Expand Down