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

chore: turbo cleanup #4951

Merged
merged 14 commits into from Sep 8, 2022
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -35,6 +35,7 @@ packages/next-auth/core
packages/next-auth/jwt
packages/next-auth/react
packages/next-auth/adapters.d.ts
packages/next-auth/adapters.js
packages/next-auth/index.d.ts
packages/next-auth/index.js
packages/next-auth/next
Expand Down
1 change: 0 additions & 1 deletion apps/dev/next.config.js
Expand Up @@ -5,5 +5,4 @@ module.exports = {
return config
},
typescript: { ignoreBuildErrors: true },
experimental: { externalDir: true },
}
10 changes: 3 additions & 7 deletions apps/dev/package.json
Expand Up @@ -4,11 +4,8 @@
"description": "NextAuth.js Developer app",
"private": true,
"scripts": {
"clean": "rm -rf .next",
"copy:css": "cpx \"../../packages/next-auth/css/**/*\" src/css --watch",
"watch:css": "cd ../../packages/next-auth && pnpm watch:css",
"dev": "concurrently \"pnpm dev:next\" \"pnpm watch:css\" \"pnpm copy:css\"",
"dev:next": "next dev",
"clean": "rm -rf .next src/css",
ThangHuuVu marked this conversation as resolved.
Show resolved Hide resolved
"dev": "next dev",
"build": "next build",
"start": "next start",
"email": "fake-smtp-server",
Expand All @@ -22,15 +19,14 @@
"@prisma/client": "^3",
"faunadb": "^4",
"next": "12.2.0",
"next-auth": "workspace:*",
"nodemailer": "^6",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"concurrently": "^7",
"cpx": "^1.5.0",
"fake-smtp-server": "^0.8.0",
"pg": "^8.7.3",
"prisma": "^3",
Expand Down
4 changes: 0 additions & 4 deletions apps/dev/tsconfig.json
Expand Up @@ -15,10 +15,6 @@
"incremental": true,
"jsx": "preserve",
"baseUrl": ".",
"paths": {
"next-auth": ["../../packages/next-auth/src"],
"next-auth/*": ["../../packages/next-auth/src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "jest.config.js"]
Expand Down
16 changes: 8 additions & 8 deletions package.json
Expand Up @@ -6,16 +6,16 @@
"scripts": {
"build:app": "turbo run build --filter=next-auth-app --include-dependencies",
"build": "turbo run build --filter=next-auth --filter=@next-auth/* --no-deps",
"lint": "turbo run lint --filter=!next-auth-docs",
"lint:fix": "turbo run lint -- --fix",
"test": "turbo run test --concurrency=1 --filter=!@next-auth/pouchdb-adapter --filter=!next-auth-* --filter=[HEAD^1]",
"setup": "turbo run setup",
"clean": "turbo run clean --no-cache",
"dev:app": "turbo run dev --parallel --continue --filter=next-auth-app...",
"dev:docs": "turbo run dev --filter=next-auth-docs",
"dev": "pnpm dev:app",
"email": "cd apps/dev && pnpm email",
"dev:app": "turbo run dev --parallel --no-deps --no-cache --filter=next-auth-app",
"dev:docs": "turbo run dev --parallel --no-deps --no-cache --filter=next-auth-docs",
"version:pr": "node ./config/version-pr",
"release": "release"
"lint:fix": "turbo run lint -- --fix",
"lint": "turbo run lint --filter=!next-auth-docs",
"release": "release",
"test": "turbo run test --concurrency=1 --filter=!@next-auth/pouchdb-adapter --filter=!@next-auth/upstash-redis-adapter --filter=!@next-auth/mikro-orm-adapter --filter=!next-auth-* --filter=[HEAD^1]",
"version:pr": "node ./config/version-pr"
},
"devDependencies": {
"@actions/core": "^1.6.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-dgraph/package.json
Expand Up @@ -34,8 +34,8 @@
"next-auth": "^4"
},
"devDependencies": {
"@next-auth/adapter-test": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/adapter-test": "workspace:*",
"@next-auth/tsconfig": "workspace:*",
"@types/jest": "^26.0.24",
"@types/jsonwebtoken": "^8.5.5",
"@types/node-fetch": "^2.5.11",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-dynamodb/package.json
Expand Up @@ -37,8 +37,8 @@
"devDependencies": {
"@aws-sdk/client-dynamodb": "^3.36.1",
"@aws-sdk/lib-dynamodb": "^3.36.1",
"@next-auth/adapter-test": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/adapter-test": "workspace:*",
"@next-auth/tsconfig": "workspace:*",
"@shelf/jest-dynamodb": "^2.1.0",
"jest": "^27.4.3",
"next-auth": "workspace:*"
Expand Down
8 changes: 5 additions & 3 deletions packages/adapter-fauna/package.json
Expand Up @@ -35,8 +35,10 @@
"access": "public"
},
"scripts": {
"migrate": "fauna-schema-migrate generate",
"build": "tsc",
"dev": "tsc -w",
"clean": "rm -rf dist",
"migrate": "fauna-schema-migrate generate",
"test": "./tests/test.sh"
},
"peerDependencies": {
Expand All @@ -45,8 +47,8 @@
},
"devDependencies": {
"@fauna-labs/fauna-schema-migrate": "^2.1.3",
"@next-auth/adapter-test": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/adapter-test": "workspace:*",
"@next-auth/tsconfig": "workspace:*",
"faunadb": "^4.3.0",
"jest": "^27.4.3",
"next-auth": "workspace:*"
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-firebase/package.json
Expand Up @@ -36,8 +36,8 @@
"next-auth": "^4"
},
"devDependencies": {
"@next-auth/adapter-test": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/adapter-test": "workspace:*",
"@next-auth/tsconfig": "workspace:*",
"firebase": "^9.7.0",
"firebase-tools": "^10.7.2",
"jest": "^27.4.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-mikro-orm/package.json
Expand Up @@ -38,8 +38,8 @@
"devDependencies": {
"@mikro-orm/core": "^5.0.2",
"@mikro-orm/sqlite": "^5.0.2",
"@next-auth/adapter-test": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/adapter-test": "workspace:*",
"@next-auth/tsconfig": "workspace:*",
"@types/uuid": "^8.3.3",
"jest": "^27.4.3",
"next-auth": "workspace:*"
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-mongodb/package.json
Expand Up @@ -35,8 +35,8 @@
"next-auth": "^4"
},
"devDependencies": {
"@next-auth/adapter-test": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/adapter-test": "workspace:*",
"@next-auth/tsconfig": "workspace:*",
"jest": "^27.4.3",
"mongodb": "^4.4.0",
"next-auth": "workspace:*"
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-neo4j/package.json
Expand Up @@ -37,8 +37,8 @@
"next-auth": "^4"
},
"devDependencies": {
"@next-auth/adapter-test": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/adapter-test": "workspace:*",
"@next-auth/tsconfig": "workspace:*",
"@types/uuid": "^8.3.3",
"jest": "^27.4.3",
"neo4j-driver": "^4.4.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-pouchdb/package.json
Expand Up @@ -39,8 +39,8 @@
"ulid": "^2.3.0"
},
"devDependencies": {
"@next-auth/adapter-test": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/adapter-test": "workspace:*",
"@next-auth/tsconfig": "workspace:*",
"@types/pouchdb": "^6.4.0",
"jest": "^27.4.3",
"next-auth": "workspace:*",
Expand Down
7 changes: 4 additions & 3 deletions packages/adapter-prisma/package.json
Expand Up @@ -21,14 +21,15 @@
"access": "public"
},
"scripts": {
"clean": "rm -rf ./prisma/migrations && rm ./prisma/dev.db*",
"clean": "rm ./prisma/dev.db* || echo 'File deleted'",
"init:default": "prisma migrate dev --name init --skip-seed",
"init:custom": "prisma migrate dev --name init-custom --schema ./prisma/custom.prisma",
"test:default": "pnpm init:default && jest",
"test:custom": "pnpm init:custom && CUSTOM_MODEL=1 jest",
"test:mongodb": "./tests/mongodb.test.sh",
"test": "pnpm test:default && pnpm test:custom && pnpm test:mongodb",
"build": "prisma generate && tsc",
"dev": "prisma generate && tsc -w",
"studio": "prisma studio"
},
"files": [
Expand All @@ -40,8 +41,8 @@
"next-auth": "^4"
},
"devDependencies": {
"@next-auth/adapter-test": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/adapter-test": "workspace:*",
"@next-auth/tsconfig": "workspace:*",
"@prisma/client": "^3.10.0",
"jest": "^27.4.3",
"mongodb": "^4.4.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-sequelize/package.json
Expand Up @@ -33,8 +33,8 @@
"sequelize": "^6.6.5"
},
"devDependencies": {
"@next-auth/adapter-test": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/adapter-test": "workspace:*",
"@next-auth/tsconfig": "workspace:*",
"jest": "^27.4.3",
"next-auth": "workspace:*",
"sequelize": "^6.6.5"
Expand Down
8 changes: 5 additions & 3 deletions packages/adapter-typeorm-legacy/package.json
Expand Up @@ -29,12 +29,14 @@
},
"scripts": {
"build": "tsc",
"dev": "tsc -w",
"clean": "rm -rf dist",
"init:db": "tests/init.sh",
"test:containers": "tests/test.sh",
"test": "tests/test.sh",
"mysql": "pnpm init:db && tests/mysql/test.sh",
"postgres": "pnpm init:db && tests/postgresql/test.sh",
"sqlite": "tests/sqlite/test.sh"
"sqlite": "tests/sqlite/test.sh",
"test:containers": "tests/test.sh",
"test": "tests/test.sh"
},
"devDependencies": {
"@next-auth/adapter-test": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-upstash-redis/package.json
Expand Up @@ -34,8 +34,8 @@
"next-auth": "^4"
},
"devDependencies": {
"@next-auth/adapter-test": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/adapter-test": "workspace:*",
"@next-auth/tsconfig": "workspace:*",
"@types/uuid": "^8.3.3",
"@upstash/redis": "^1.0.1",
"dotenv": "^10.0.0",
Expand Down
10 changes: 6 additions & 4 deletions packages/next-auth/package.json
Expand Up @@ -38,14 +38,15 @@
},
"scripts": {
"build": "pnpm clean && pnpm build:js && pnpm build:css",
"clean": "rm -rf client css utils providers core jwt react next index.d.ts index.js adapters.d.ts middleware.d.ts middleware.js",
"build:js": "pnpm clean && pnpm generate-providers && tsc && babel --config-file ./config/babel.config.js src --out-dir . --extensions \".tsx,.ts,.js,.jsx\"",
"clean": "rm -rf coverage client css utils providers core jwt react next index.d.ts index.js adapters.d.ts middleware.d.ts middleware.js",
"build:js": "pnpm generate-providers && tsc && babel --config-file ./config/babel.config.js src --out-dir . --extensions \".tsx,.ts,.js,.jsx\"",
"build:css": "postcss --config config/postcss.config.js src/**/*.css --base src --dir . && node config/wrap-css.js",
"dev": "pnpm clean && pnpm generate-providers && concurrently \"pnpm watch:css\" \"pnpm watch:ts\"",
"watch:ts": "pnpm tsc --project tsconfig.dev.json",
"watch:css": "postcss --config config/postcss.config.js --watch src/**/*.css --base src --dir .",
"test": "jest --config ./config/jest.config.js",
"prepublishOnly": "pnpm build",
"generate-providers": "node ./config/generate-providers.js",
"setup": "pnpm generate-providers",
"lint": "eslint src config"
},
"files": [
Expand Down Expand Up @@ -94,7 +95,7 @@
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:*",
"@swc/core": "^1.2.198",
"@swc/jest": "^0.2.21",
"@testing-library/dom": "^8.13.0",
Expand All @@ -111,6 +112,7 @@
"autoprefixer": "^10.4.7",
"babel-plugin-jsx-pragmatic": "^1.0.2",
"babel-preset-preact": "^2.0.0",
"concurrently": "^7",
"cssnano": "^5.1.11",
"jest": "^28.1.1",
"jest-environment-jsdom": "^28.1.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/next-auth/src/css/index.ts
@@ -1,10 +1,10 @@
// To support serverless targets (which don't work if you try to read in things
// To support serverless targets (which don"t work if you try to read in things
// like CSS files at run time) this file is replaced in production builds with
// a function that returns compiled CSS (embedded as a string in the function).
import fs from "fs"
import path from "path"

const pathToCss = path.join(process.cwd(), "/src/css/index.css")
const pathToCss = path.join(process.cwd(), process.env.NODE_ENV === "development" ? "node_modules/next-auth/css/index.css" : "/src/css/index.css")

export default function css() {
return fs.readFileSync(pathToCss, "utf8")
Expand Down
25 changes: 25 additions & 0 deletions packages/next-auth/tsconfig.dev.json
@@ -0,0 +1,25 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"watch": true,
"emitDeclarationOnly": false,
},
"watchOptions": {
"excludeDirectories": [
"lib",
"css",
"jwt",
"react",
"next",
"client",
"providers",
"core",
"index.d.ts",
"index.js",
"adapters.d.ts",
"middleware.d.ts",
"middleware.js",
"utils"
],
}
}
3 changes: 0 additions & 3 deletions packages/next-auth/tsconfig.json
Expand Up @@ -15,9 +15,6 @@
"skipDefaultLibCheck": true,
"baseUrl": ".",
"outDir": ".",
"paths": {
"next": ["node_modules/next"]
}
},
"exclude": [
"./*.js",
Expand Down