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

fix(errors): expose custom errors #1816

Merged
merged 3 commits into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ node_modules
# Generated files
.docusaurus
.cache-loader
.next
www/providers.json
src/providers/index.js
internals
Expand All @@ -39,6 +38,7 @@ jwt.d.ts
jwt.js
providers.d.ts
providers.js
errors.js

# Development app
app/next-auth
Expand Down
3 changes: 3 additions & 0 deletions config/babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"presets": [
["@babel/preset-env", { "targets": { "esmodules": true } }]
],
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"comments": false,
"overrides": [
{
Expand Down
2 changes: 2 additions & 0 deletions config/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const MODULE_ENTRIES = {
PROVIDERS: "providers",
ADAPTERS: "adapters",
JWT: "jwt",
ERRORS: "errors",
}

// Building submodule entries
Expand All @@ -17,6 +18,7 @@ const BUILD_TARGETS = {
[`${MODULE_ENTRIES.ADAPTERS}.js`]: "module.exports = require('./dist/adapters').default\n",
[`${MODULE_ENTRIES.PROVIDERS}.js`]: "module.exports = require('./dist/providers').default\n",
[`${MODULE_ENTRIES.JWT}.js`]: "module.exports = require('./dist/lib/jwt').default\n",
[`${MODULE_ENTRIES.ERRORS}.js`]: "module.exports = require('./dist/lib/errors').default\n",
}

Object.entries(BUILD_TARGETS).forEach(([target, content]) => {
Expand Down
180 changes: 172 additions & 8 deletions package-lock.json

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

30 changes: 25 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,26 @@
"author": "Iain Collins <[email protected]>",
"main": "index.js",
"types": "./index.d.ts",
"keywords": ["react", "nodejs", "oauth", "jwt", "oauth2", "authentication", "nextjs", "csrf", "oidc", "nextauth"],
"keywords": [
"react",
"nodejs",
"oauth",
"jwt",
"oauth2",
"authentication",
"nextjs",
"csrf",
"oidc",
"nextauth"
],
"exports": {
".": "./dist/server/index.js",
"./jwt": "./dist/lib/jwt.js",
"./adapters": "./dist/adapters/index.js",
"./client": "./dist/client/index.js",
"./providers": "./dist/providers/index.js",
"./providers/*": "./dist/providers/*.js"
"./providers/*": "./dist/providers/*.js",
"./errors": "./dist/lib/errors.js"
},
"scripts": {
"build": "npm run build:js && npm run build:css",
Expand Down Expand Up @@ -56,7 +68,8 @@
"client.d.ts",
"jwt.js",
"jwt.d.ts",
"internals"
"internals",
"errors.js"
],
"license": "ISC",
"dependencies": {
Expand Down Expand Up @@ -87,6 +100,7 @@
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.6",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/preset-env": "^7.9.6",
"@prisma/client": "^2.16.1",
"@semantic-release/commit-analyzer": "^8.0.1",
Expand Down Expand Up @@ -157,8 +171,14 @@
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
{ "name": "beta", "prerelease": true },
{ "name": "next", "prerelease": true }
{
"name": "beta",
"prerelease": true
},
{
"name": "next",
"prerelease": true
}
]
},
"funding": [
Expand Down
Loading