diff --git a/examples/nextjs-app-router/app/auth/layout.tsx b/examples/nextjs-app-router/app/auth/layout.tsx index a96039f63..b38fd785f 100644 --- a/examples/nextjs-app-router/app/auth/layout.tsx +++ b/examples/nextjs-app-router/app/auth/layout.tsx @@ -1,3 +1,3 @@ -import { AuthLayout } from "../../nextjs/app" +import { OryCardContent } from "@ory/elements-react" -export default AuthLayout +export default OryCardContent diff --git a/examples/nextjs-app-router/app/auth/login/page.tsx b/examples/nextjs-app-router/app/auth/login/page.tsx index 060cda02e..f55d1b7da 100644 --- a/examples/nextjs-app-router/app/auth/login/page.tsx +++ b/examples/nextjs-app-router/app/auth/login/page.tsx @@ -1,6 +1,7 @@ -import { Login } from "@ory/elements-react/theme" +import { Login } from "@ory/elements-react" import { useOryConfig } from "@ory/nextjs" import { getLoginFlow, OryPageParams } from "@ory/nextjs/app" +import "@ory/elements-react/theme/styles.css" import config from "@/ory.config" import CardHeader from "@/app/auth/login/card-header" diff --git a/examples/nextjs-app-router/package.json b/examples/nextjs-app-router/package.json index bfd2211df..557c5d53d 100644 --- a/examples/nextjs-app-router/package.json +++ b/examples/nextjs-app-router/package.json @@ -9,6 +9,7 @@ "lint": "next lint" }, "dependencies": { + "@ory/nextjs": "^0.0.1", "next": "14.2.15", "react": "^18", "react-dom": "^18" @@ -17,7 +18,6 @@ "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", - "@types/tldjs": "^2.3.4", "eslint": "^8", "eslint-config-next": "14.2.15", "postcss": "^8", diff --git a/nx.json b/nx.json index 3aef02ecc..ee4a3b0bf 100644 --- a/nx.json +++ b/nx.json @@ -1,4 +1,9 @@ { + "pluginsConfig": { + "@nx/js": { + "analyzeSourceFiles": true + } + }, "extends": "nx/presets/npm.json", "tasksRunnerOptions": { "default": { @@ -66,10 +71,5 @@ "unitTestRunner": "none" } } - }, - "pluginsConfig": { - "@nx/js": { - "analyzeSourceFiles": true - } } } diff --git a/package-lock.json b/package-lock.json index 609f483dc..57d24820e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -117,20 +117,15 @@ "examples/nextjs-app-router": { "version": "0.1.0", "dependencies": { - "@types/set-cookie-parser": "^2.4.10", - "cookie": "^1.0.1", + "@ory/nextjs": "^0.0.1", "next": "14.2.15", "react": "^18", - "react-dom": "^18", - "set-cookie-parser": "^2.7.0", - "tldjs": "^2.3.1" + "react-dom": "^18" }, "devDependencies": { - "@ory/client-fetch": "^1.15.6", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", - "@types/tldjs": "^2.3.4", "eslint": "^8", "eslint-config-next": "14.2.15", "postcss": "^8", @@ -287,12 +282,6 @@ "node": ">= 10" } }, - "examples/nextjs-app-router/node_modules/@ory/client-fetch": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/@ory/client-fetch/-/client-fetch-1.15.6.tgz", - "integrity": "sha512-etWhiJC5kF/qbXugAtUHGi+8Z8L/v+dKXzkRA7jy90tlfSTVem+rmwCPtaH3KaLaYWQ4ltAjOh0LEOCetrE2sQ==", - "dev": true - }, "examples/nextjs-app-router/node_modules/@swc/helpers": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz", @@ -320,14 +309,6 @@ "balanced-match": "^1.0.0" } }, - "examples/nextjs-app-router/node_modules/cookie": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.1.tgz", - "integrity": "sha512-Xd8lFX4LM9QEEwxQpF9J9NTUh8pmdJO0cyRJhFiDoLTk2eH8FXlRv2IFGYVadZpqI3j8fhNrSdKCeYPxiAhLXw==", - "engines": { - "node": ">=18" - } - }, "examples/nextjs-app-router/node_modules/doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -3660,16 +3641,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/preset-env/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@babel/preset-modules": { "version": "0.1.6-no-external-plugins", "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", @@ -8312,6 +8283,10 @@ "resolved": "packages/test", "link": true }, + "node_modules/@ory/nextjs": { + "resolved": "packages/nextjs", + "link": true + }, "node_modules/@phenomnomnominal/tsquery": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-5.0.1.tgz", @@ -8485,16 +8460,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@prefresh/vite/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@remix-run/router": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.3.1.tgz", @@ -10567,41 +10532,6 @@ } } }, - "node_modules/@storybook/react-vite/node_modules/magic-string": { - "version": "0.30.11", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", - "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, - "node_modules/@storybook/react-vite/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@storybook/react-vite/node_modules/tsconfig-paths": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", - "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", - "dev": true, - "license": "MIT", - "dependencies": { - "json5": "^2.2.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@storybook/react/node_modules/@types/estree": { "version": "0.0.51", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", @@ -13795,6 +13725,13 @@ "@types/node": "*" } }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/detect-port": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/detect-port/-/detect-port-1.3.5.tgz", @@ -15291,16 +15228,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@vitejs/plugin-react/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@vitest/expect": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.5.tgz", @@ -20715,30 +20642,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/eslint-plugin-storybook/node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-plugin-storybook/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, "node_modules/eslint-plugin-storybook/node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -27000,16 +26903,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -27458,10 +27351,6 @@ "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "license": "0BSD" }, - "node_modules/nextjs": { - "resolved": "packages/nextjs", - "link": true - }, "node_modules/nextjs-app-router": { "resolved": "examples/nextjs-app-router", "link": true @@ -27996,20 +27885,6 @@ "node": ">=8" } }, - "node_modules/nyc/node_modules/foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/nyc/node_modules/istanbul-lib-instrument": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", @@ -28068,16 +27943,6 @@ "node": ">=8" } }, - "node_modules/nyc/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/nyc/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -29831,16 +29696,6 @@ "node": ">=8" } }, - "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=8" - } - }, "node_modules/read-pkg/node_modules/type-fest": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", @@ -30562,11 +30417,6 @@ "node": ">= 0.8" } }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "dev": true, - "license": "MIT" - }, "node_modules/serialize-javascript": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", @@ -33804,16 +33654,6 @@ "node": ">=10" } }, - "node_modules/vite-plugin-dts/node_modules/magic-string": { - "version": "0.30.11", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", - "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, "node_modules/vite-plugin-dts/node_modules/minimatch": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", @@ -36062,11 +35902,297 @@ } }, "packages/nextjs": { + "name": "@ory/nextjs", "version": "0.0.1", "dependencies": { + "@ory/client-fetch": "^1.15.6", + "@types/set-cookie-parser": "^2.4.10", + "cookie": "^1.0.1", + "set-cookie-parser": "^2.7.0", + "tldjs": "^2.3.1", "tslib": "^2.3.0" + }, + "devDependencies": { + "@types/cookie": "^0.6.0", + "@types/tldjs": "^2.3.4", + "next": "^14.2.15" + }, + "peerDependencies": { + "next": ">=13.1.0" } }, + "packages/nextjs/node_modules/@next/env": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.15.tgz", + "integrity": "sha512-S1qaj25Wru2dUpcIZMjxeMVSwkt8BK4dmWHHiBuRstcIyOsMapqT4A4jSB6onvqeygkSSmOkyny9VVx8JIGamQ==", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@next/swc-darwin-arm64": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.15.tgz", + "integrity": "sha512-Rvh7KU9hOUBnZ9TJ28n2Oa7dD9cvDBKua9IKx7cfQQ0GoYUwg9ig31O2oMwH3wm+pE3IkAQ67ZobPfEgurPZIA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-darwin-x64": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.15.tgz", + "integrity": "sha512-5TGyjFcf8ampZP3e+FyCax5zFVHi+Oe7sZyaKOngsqyaNEpOgkKB3sqmymkZfowy3ufGA/tUgDPPxpQx931lHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.15.tgz", + "integrity": "sha512-3Bwv4oc08ONiQ3FiOLKT72Q+ndEMyLNsc/D3qnLMbtUYTQAmkx9E/JRu0DBpHxNddBmNT5hxz1mYBphJ3mfrrw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-linux-arm64-musl": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.15.tgz", + "integrity": "sha512-k5xf/tg1FBv/M4CMd8S+JL3uV9BnnRmoe7F+GWC3DxkTCD9aewFRH1s5rJ1zkzDa+Do4zyN8qD0N8c84Hu96FQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-linux-x64-gnu": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.15.tgz", + "integrity": "sha512-kE6q38hbrRbKEkkVn62reLXhThLRh6/TvgSP56GkFNhU22TbIrQDEMrO7j0IcQHcew2wfykq8lZyHFabz0oBrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-linux-x64-musl": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.15.tgz", + "integrity": "sha512-PZ5YE9ouy/IdO7QVJeIcyLn/Rc4ml9M2G4y3kCM9MNf1YKvFY4heg3pVa/jQbMro+tP6yc4G2o9LjAz1zxD7tQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.15.tgz", + "integrity": "sha512-2raR16703kBvYEQD9HNLyb0/394yfqzmIeyp2nDzcPV4yPjqNUG3ohX6jX00WryXz6s1FXpVhsCo3i+g4RUX+g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.15.tgz", + "integrity": "sha512-fyTE8cklgkyR1p03kJa5zXEaZ9El+kDNM5A+66+8evQS5e/6v0Gk28LqA0Jet8gKSOyP+OTm/tJHzMlGdQerdQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-win32-x64-msvc": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.15.tgz", + "integrity": "sha512-SzqGbsLsP9OwKNUG9nekShTwhj6JSB9ZLMWQ8g1gG6hdE5gQLncbnbymrwy2yVmH9nikSLYRYxYMFu78Ggp7/g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@ory/client-fetch": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/@ory/client-fetch/-/client-fetch-1.15.6.tgz", + "integrity": "sha512-etWhiJC5kF/qbXugAtUHGi+8Z8L/v+dKXzkRA7jy90tlfSTVem+rmwCPtaH3KaLaYWQ4ltAjOh0LEOCetrE2sQ==", + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/@swc/helpers": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz", + "integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@swc/counter": "^0.1.3", + "tslib": "^2.4.0" + } + }, + "packages/nextjs/node_modules/cookie": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.1.tgz", + "integrity": "sha512-Xd8lFX4LM9QEEwxQpF9J9NTUh8pmdJO0cyRJhFiDoLTk2eH8FXlRv2IFGYVadZpqI3j8fhNrSdKCeYPxiAhLXw==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "packages/nextjs/node_modules/next": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.15.tgz", + "integrity": "sha512-h9ctmOokpoDphRvMGnwOJAedT6zKhwqyZML9mDtspgf4Rh3Pn7UTYKqePNoDvhsWBAO5GoPNYshnAUGIazVGmw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@next/env": "14.2.15", + "@swc/helpers": "0.5.5", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", + "postcss": "8.4.31", + "styled-jsx": "5.1.1" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=18.17.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "14.2.15", + "@next/swc-darwin-x64": "14.2.15", + "@next/swc-linux-arm64-gnu": "14.2.15", + "@next/swc-linux-arm64-musl": "14.2.15", + "@next/swc-linux-x64-gnu": "14.2.15", + "@next/swc-linux-x64-musl": "14.2.15", + "@next/swc-win32-arm64-msvc": "14.2.15", + "@next/swc-win32-ia32-msvc": "14.2.15", + "@next/swc-win32-x64-msvc": "14.2.15" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.41.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "packages/nextjs/node_modules/tslib": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz", + "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==", + "license": "0BSD" + }, "packages/preact": { "name": "@ory/elements-preact", "version": "0.0.0", diff --git a/package.json b/package.json index cf879837b..215741f6e 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "build:clean": "nx run-many --target=build --all --skip-nx-cache", "build": "nx run-many --target=build --all", "build:react": "nx run @ory/elements:build --skip-nx-cache", - "build:nextjs": "nx build @ory/nextjs:build --skip-nx-cache", "build:elements-react": "nx build @ory/elements-react", "dev:elements-react": "nx build @ory/elements-react", "build:nextjs": "nx build @ory/nextjs", diff --git a/packages/elements-react/src/index.ts b/packages/elements-react/src/index.ts index 81c2da38c..80f30264a 100644 --- a/packages/elements-react/src/index.ts +++ b/packages/elements-react/src/index.ts @@ -3,6 +3,7 @@ export type * from "./types" export * from "./components" +export * from "./theme/default" export * from "./context" export * from "./util" export { locales as OryLocales } from "./locales" diff --git a/packages/elements-react/src/theme/default/components/card/index.tsx b/packages/elements-react/src/theme/default/components/card/index.tsx index 0ad38fe5c..86b0a6a29 100644 --- a/packages/elements-react/src/theme/default/components/card/index.tsx +++ b/packages/elements-react/src/theme/default/components/card/index.tsx @@ -7,6 +7,7 @@ import { DefaultCardContent } from "./content" import { DefaultCardFooter } from "./footer" import { DefaultCardHeader } from "./header" import { DefaultCardLogo } from "./logo" +import { DefaultCardLayout } from "./layout" export function DefaultCard({ children }: OryCardProps) { return ( @@ -24,4 +25,5 @@ export { DefaultCardFooter, DefaultCardHeader, DefaultCardLogo, + DefaultCardLayout, } diff --git a/packages/elements-react/src/theme/default/components/card/layout.tsx b/packages/elements-react/src/theme/default/components/card/layout.tsx new file mode 100644 index 000000000..b6a675eaf --- /dev/null +++ b/packages/elements-react/src/theme/default/components/card/layout.tsx @@ -0,0 +1,9 @@ +import { PropsWithChildren } from "react" + +export function DefaultCardLayout({ children }: PropsWithChildren) { + return ( +
+ {children} +
+ ) +} diff --git a/packages/nextjs/src/app/index.ts b/packages/nextjs/src/app/index.ts deleted file mode 100644 index 2d09e0f75..000000000 --- a/packages/nextjs/src/app/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import AuthLayout from "@/nextjs/app/layout" -import { getLoginFlow } from "@/nextjs/app/login" - -export { AuthLayout, getLoginFlow } - -export interface OryPageParams { - searchParams: URLSearchParams -} diff --git a/packages/nextjs/.eslintrc.json b/packages/nextjs123/.eslintrc.json similarity index 100% rename from packages/nextjs/.eslintrc.json rename to packages/nextjs123/.eslintrc.json diff --git a/packages/nextjs/README.md b/packages/nextjs123/README.md similarity index 100% rename from packages/nextjs/README.md rename to packages/nextjs123/README.md diff --git a/packages/nextjs/jest.config.ts b/packages/nextjs123/jest.config.ts similarity index 100% rename from packages/nextjs/jest.config.ts rename to packages/nextjs123/jest.config.ts diff --git a/packages/nextjs/package.json b/packages/nextjs123/package.json similarity index 71% rename from packages/nextjs/package.json rename to packages/nextjs123/package.json index 85d6bc613..7f8a45b25 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs123/package.json @@ -2,12 +2,17 @@ "name": "@ory/nextjs", "version": "0.0.1", "dependencies": { - "tslib": "^2.3.0", "@ory/client-fetch": "^1.15.6", "@types/set-cookie-parser": "^2.4.10", "cookie": "^1.0.1", "set-cookie-parser": "^2.7.0", - "tldjs": "^2.3.1" + "tldjs": "^2.3.1", + "tslib": "^2.3.0" + }, + "devDependencies": { + "@types/cookie": "^0.6.0", + "@types/tldjs": "^2.3.4", + "next": "^14.2.15" }, "type": "commonjs", "main": "./src/index.js", @@ -26,5 +31,8 @@ "vercel", "app router", "pages router" - ] + ], + "peerDependencies": { + "next": ">=13.1.0" + } } diff --git a/packages/nextjs/project.json b/packages/nextjs123/project.json similarity index 86% rename from packages/nextjs/project.json rename to packages/nextjs123/project.json index 6a9872099..2e4690dc3 100644 --- a/packages/nextjs/project.json +++ b/packages/nextjs123/project.json @@ -1,5 +1,5 @@ { - "name": "nextjs", + "name": "@ory/nextjs", "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "packages/nextjs/src", "projectType": "library", @@ -9,7 +9,7 @@ "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { - "outputPath": "dist/packages/nextjs", + "outputPath": "packages/nextjs/dist", "main": "packages/nextjs/src/index.ts", "tsConfig": "packages/nextjs/tsconfig.lib.json", "assets": ["packages/nextjs/*.md"] diff --git a/packages/nextjs/src/app/flow.ts b/packages/nextjs123/src/app/flow.ts similarity index 79% rename from packages/nextjs/src/app/flow.ts rename to packages/nextjs123/src/app/flow.ts index 1e393a395..1c397d9ae 100644 --- a/packages/nextjs/src/app/flow.ts +++ b/packages/nextjs123/src/app/flow.ts @@ -1,11 +1,6 @@ -import { - FlowType, - handleFlowError, - FrontendApi, - ApiResponse, -} from "@ory/client-fetch" -import { FlowParams, initOverrides, QueryParams } from "@/nextjs/types" -import { onValidationError, toValue } from "@/nextjs/utils" +import { FlowType, handleFlowError, ApiResponse } from "@ory/client-fetch" +import { FlowParams, initOverrides, QueryParams } from "../types" +import { onValidationError, toValue } from "../utils" export function getFlowFactory(factory: { redirectToBrowserEndpoint: (params: QueryParams, flowType: FlowType) => void @@ -21,7 +16,7 @@ export function getFlowFactory(factory: { const onRestartFlow = () => factory.redirectToBrowserEndpoint(params, factory.flowType) - if (!params.flow) { + if (!params["flow"]) { onRestartFlow() return } diff --git a/packages/nextjs123/src/app/index.ts b/packages/nextjs123/src/app/index.ts new file mode 100644 index 000000000..ee7eb7e58 --- /dev/null +++ b/packages/nextjs123/src/app/index.ts @@ -0,0 +1,7 @@ +import { getLoginFlow } from "./login" + +export { getLoginFlow } + +export interface OryPageParams { + searchParams: URLSearchParams +} diff --git a/packages/nextjs/src/app/layout.tsx b/packages/nextjs123/src/app/layout.tsx similarity index 100% rename from packages/nextjs/src/app/layout.tsx rename to packages/nextjs123/src/app/layout.tsx diff --git a/packages/nextjs/src/app/login.ts b/packages/nextjs123/src/app/login.ts similarity index 85% rename from packages/nextjs/src/app/login.ts rename to packages/nextjs123/src/app/login.ts index b7746d6b4..7b25234c3 100644 --- a/packages/nextjs/src/app/login.ts +++ b/packages/nextjs123/src/app/login.ts @@ -1,9 +1,9 @@ import { onRedirect, redirectToBrowserEndpoint } from "./utils" import { FlowType, LoginFlow } from "@ory/client-fetch" -import { QueryParams } from "@/nextjs/types" -import { toFlowParams } from "@/nextjs/app/utils" -import { getFlowFactory } from "@/nextjs/app/flow" -import { newFrontendClient } from "@/nextjs" +import { QueryParams } from "../types" +import { toFlowParams } from "./utils" +import { getFlowFactory } from "./flow" +import { newFrontendClient } from "../sdk" const factory = getFlowFactory({ redirectToBrowserEndpoint, diff --git a/packages/nextjs/src/app/registration.ts b/packages/nextjs123/src/app/registration.ts similarity index 77% rename from packages/nextjs/src/app/registration.ts rename to packages/nextjs123/src/app/registration.ts index fad2e2ebe..8c5d0cac7 100644 --- a/packages/nextjs/src/app/registration.ts +++ b/packages/nextjs123/src/app/registration.ts @@ -1,10 +1,9 @@ import { redirectToBrowserEndpoint, onRedirect } from "./utils" -import { RegistrationFlow, FrontendApi, FlowType } from "@ory/client-fetch" -import { QueryParams } from "@/nextjs/types" -import { toFlowParams } from "@/nextjs/app/utils" -import { useRegistrationFlowFactory } from "@/nextjs/registration" -import { getFlowFactory } from "@/nextjs/app/flow" -import { newFrontendClient } from "@/nextjs" +import { RegistrationFlow, FlowType } from "@ory/client-fetch" +import { QueryParams } from "../types" +import { toFlowParams } from "./utils" +import { getFlowFactory } from "./flow" +import { newFrontendClient } from "../sdk" const factory = getFlowFactory({ redirectToBrowserEndpoint, diff --git a/packages/nextjs/src/app/utils.ts b/packages/nextjs123/src/app/utils.ts similarity index 92% rename from packages/nextjs/src/app/utils.ts rename to packages/nextjs123/src/app/utils.ts index 44ed01c21..4d29e0276 100644 --- a/packages/nextjs/src/app/utils.ts +++ b/packages/nextjs123/src/app/utils.ts @@ -1,11 +1,11 @@ import { headers } from "next/headers" import { FlowType, OnRedirectHandler } from "@ory/client-fetch" import { redirect, RedirectType } from "next/navigation" -import { QueryParams } from "@/nextjs/types" +import { QueryParams } from "../types" import { toBrowserEndpointRedirect, toFlowParams as baseToFlowParams, -} from "@/nextjs/utils" +} from "../utils" export function getCookieHeader() { return headers().get("cookie") ?? undefined diff --git a/packages/nextjs/src/config.ts b/packages/nextjs123/src/config.ts similarity index 85% rename from packages/nextjs/src/config.ts rename to packages/nextjs123/src/config.ts index 256471aa3..64b444d6f 100644 --- a/packages/nextjs/src/config.ts +++ b/packages/nextjs123/src/config.ts @@ -1,6 +1,6 @@ -import { OryConfig } from "@/nextjs/types" +import { OryConfig } from "./types" import { OryClientConfiguration } from "@ory/elements-react" -import { getSdkUrl } from "@/nextjs/sdk" +import { getSdkUrl } from "./sdk" export function useOryConfig( config: Partial, @@ -10,7 +10,7 @@ export function useOryConfig( return { name: config.override?.applicationName ?? "Default name", sdk: { - url: config.orySdkUrl || getSdkUrl(), + url: getSdkUrl(), }, project: { registration_enabled: true, diff --git a/packages/nextjs/src/cookie.test.ts b/packages/nextjs123/src/cookie.test.ts similarity index 100% rename from packages/nextjs/src/cookie.test.ts rename to packages/nextjs123/src/cookie.test.ts diff --git a/packages/nextjs/src/cookie.ts b/packages/nextjs123/src/cookie.ts similarity index 100% rename from packages/nextjs/src/cookie.ts rename to packages/nextjs123/src/cookie.ts diff --git a/packages/nextjs/src/headers.ts b/packages/nextjs123/src/headers.ts similarity index 100% rename from packages/nextjs/src/headers.ts rename to packages/nextjs123/src/headers.ts diff --git a/packages/nextjs/src/hooks.ts b/packages/nextjs123/src/hooks.ts similarity index 88% rename from packages/nextjs/src/hooks.ts rename to packages/nextjs123/src/hooks.ts index 9fe9b214e..c9d59b824 100644 --- a/packages/nextjs/src/hooks.ts +++ b/packages/nextjs123/src/hooks.ts @@ -1,4 +1,4 @@ -import { newFrontendClient } from "@/nextjs/sdk" +import { newFrontendClient } from "./sdk" import { Session } from "@ory/client-fetch" import { useEffect, useState } from "react" diff --git a/packages/nextjs/src/index.ts b/packages/nextjs123/src/index.ts similarity index 52% rename from packages/nextjs/src/index.ts rename to packages/nextjs123/src/index.ts index 96a68099f..365e310c4 100644 --- a/packages/nextjs/src/index.ts +++ b/packages/nextjs123/src/index.ts @@ -1,6 +1,6 @@ import { OryConfig } from "./types" -import { useOryConfig } from "@/nextjs/config" -import { newFrontendClient } from "@/nextjs/sdk" +import { useOryConfig } from "./config" +import { newFrontendClient } from "./sdk" export type { OryConfig } export { useOryConfig, newFrontendClient } diff --git a/packages/nextjs/src/pages/index.ts b/packages/nextjs123/src/pages/index.ts similarity index 100% rename from packages/nextjs/src/pages/index.ts rename to packages/nextjs123/src/pages/index.ts diff --git a/packages/nextjs/src/pages/registration.ts b/packages/nextjs123/src/pages/registration.ts similarity index 90% rename from packages/nextjs/src/pages/registration.ts rename to packages/nextjs123/src/pages/registration.ts index 320fee6a5..bd410ca7d 100644 --- a/packages/nextjs/src/pages/registration.ts +++ b/packages/nextjs123/src/pages/registration.ts @@ -1,19 +1,11 @@ import { FlowType, handleFlowError, RegistrationFlow } from "@ory/client-fetch" import { useEffect, useState } from "react" import { useRouter } from "next/router" -import { newFrontendClient } from "@/nextjs" -import { - onValidationError, - toBrowserEndpointRedirect, - toValue, -} from "@/nextjs/utils" +import { newFrontendClient } from "../sdk" +import { onValidationError, toBrowserEndpointRedirect, toValue } from "../utils" import { GetServerSidePropsContext } from "next" import { useSearchParams } from "next/navigation" -import { - handleRestartFlow, - toSearchParams, - useOnRedirect, -} from "@/nextjs/pages/utils" +import { handleRestartFlow, toSearchParams, useOnRedirect } from "./utils" const client = newFrontendClient() diff --git a/packages/nextjs/src/pages/utils.ts b/packages/nextjs123/src/pages/utils.ts similarity index 94% rename from packages/nextjs/src/pages/utils.ts rename to packages/nextjs123/src/pages/utils.ts index 5bcc7f892..412e2318d 100644 --- a/packages/nextjs/src/pages/utils.ts +++ b/packages/nextjs123/src/pages/utils.ts @@ -1,6 +1,6 @@ import { FlowType, OnRedirectHandler } from "@ory/client-fetch" import { useRouter } from "next/router" -import { toBrowserEndpointRedirect } from "@/nextjs/utils" +import { toBrowserEndpointRedirect } from "../utils" import type { ParsedUrlQuery } from "querystring" export const handleRestartFlow = diff --git a/packages/nextjs/src/registration.ts b/packages/nextjs123/src/registration.ts similarity index 86% rename from packages/nextjs/src/registration.ts rename to packages/nextjs123/src/registration.ts index 38d6ded4e..eb5563d2a 100644 --- a/packages/nextjs/src/registration.ts +++ b/packages/nextjs123/src/registration.ts @@ -4,8 +4,8 @@ import { handleFlowError, FrontendApi, } from "@ory/client-fetch" -import { FlowParams, initOverrides, QueryParams } from "@/nextjs/types" -import { onValidationError, toValue } from "@/nextjs/utils" +import { FlowParams, initOverrides, QueryParams } from "./types" +import { onValidationError, toValue } from "./utils" export function useRegistrationFlowFactory(factory: { redirectToBrowserEndpoint: (params: QueryParams, flowType: FlowType) => void @@ -19,7 +19,7 @@ export function useRegistrationFlowFactory(factory: { const onRestartFlow = () => factory.redirectToBrowserEndpoint(params, FlowType.Registration) - if (!params.flow) { + if (!params["flow"]) { onRestartFlow() return } diff --git a/packages/nextjs/src/rewrite.ts b/packages/nextjs123/src/rewrite.ts similarity index 100% rename from packages/nextjs/src/rewrite.ts rename to packages/nextjs123/src/rewrite.ts diff --git a/packages/nextjs/src/sdk.ts b/packages/nextjs123/src/sdk.ts similarity index 53% rename from packages/nextjs/src/sdk.ts rename to packages/nextjs123/src/sdk.ts index 53242bcd8..71e19d047 100644 --- a/packages/nextjs/src/sdk.ts +++ b/packages/nextjs123/src/sdk.ts @@ -1,22 +1,22 @@ import { Configuration, FrontendApi } from "@ory/client-fetch" -const sdkUrl = process.env.ORY_SDK_URL || "" +const sdkUrl = process.env["ORY_SDK_URL"] || "" function isProduction() { return ( ["production", "prod"].indexOf( - process.env.VERCEL_ENV || process.env.NODE_ENV || "", + process.env["VERCEL_ENV"] || process.env["NODE_ENV"] || "", ) > -1 ) } export function getSdkUrl() { - if (!isProduction() && process.env.__NEXT_PRIVATE_ORIGIN) { - return process.env.__NEXT_PRIVATE_ORIGIN.replace(/\/$/, "") + if (!isProduction() && process.env["__NEXT_PRIVATE_ORIGIN"]) { + return process.env["__NEXT_PRIVATE_ORIGIN"].replace(/\/$/, "") } - if (!isProduction() && process.env.VERCEL_URL) { - return `https://${process.env.VERCEL_URL}`.replace(/\/$/, "") + if (!isProduction() && process.env["VERCEL_URL"]) { + return `https://${process.env["VERCEL_URL"]}`.replace(/\/$/, "") } return sdkUrl.replace(/\/$/, "") diff --git a/packages/nextjs/src/server/index.ts b/packages/nextjs123/src/server/index.ts similarity index 100% rename from packages/nextjs/src/server/index.ts rename to packages/nextjs123/src/server/index.ts diff --git a/packages/nextjs/src/server/middleware.ts b/packages/nextjs123/src/server/middleware.ts similarity index 89% rename from packages/nextjs/src/server/middleware.ts rename to packages/nextjs123/src/server/middleware.ts index dca64a127..9e3b1ff7d 100644 --- a/packages/nextjs/src/server/middleware.ts +++ b/packages/nextjs123/src/server/middleware.ts @@ -1,18 +1,14 @@ import { NextResponse, type NextRequest } from "next/server" -import { rewriteUrls } from "@/nextjs/rewrite" -import { filterRequestHeaders, processSetCookieHeaders } from "@/nextjs/utils" -import { OryConfig } from "@/nextjs/types" -import { defaultOmitHeaders } from "@/nextjs/headers" +import { rewriteUrls } from "../rewrite" +import { filterRequestHeaders, processSetCookieHeaders } from "../utils" +import { OryConfig } from "../types" +import { defaultOmitHeaders } from "../headers" function getProjectSdkUrl(options: OryConfig) { let baseUrl = "" - if (process.env.ORY_SDK_URL) { - baseUrl = process.env.ORY_SDK_URL - } - - if (options.orySdkUrl) { - baseUrl = options.orySdkUrl + if (process.env["ORY_SDK_URL"]) { + baseUrl = process.env["ORY_SDK_URL"] } return baseUrl.replace(/\/$/, "") diff --git a/packages/nextjs/src/types.ts b/packages/nextjs123/src/types.ts similarity index 100% rename from packages/nextjs/src/types.ts rename to packages/nextjs123/src/types.ts diff --git a/packages/nextjs/src/urls.ts b/packages/nextjs123/src/urls.ts similarity index 100% rename from packages/nextjs/src/urls.ts rename to packages/nextjs123/src/urls.ts diff --git a/packages/nextjs/src/utils.ts b/packages/nextjs123/src/utils.ts similarity index 86% rename from packages/nextjs/src/utils.ts rename to packages/nextjs123/src/utils.ts index 0bdd523be..0aa49e3e5 100644 --- a/packages/nextjs/src/utils.ts +++ b/packages/nextjs123/src/utils.ts @@ -1,11 +1,11 @@ import { ApiResponse } from "@ory/client-fetch" -import { FlowParams, OryConfig, QueryParams } from "@/nextjs/types" +import { FlowParams, OryConfig, QueryParams } from "./types" import { FlowType, handleFlowError, OnRedirectHandler } from "@ory/client-fetch" -import { getSdkUrl } from "@/nextjs/sdk" -import { guessCookieDomain } from "@/nextjs/cookie" -import parse, { splitCookiesString } from "set-cookie-parser" +import { getSdkUrl } from "./sdk" +import { guessCookieDomain } from "./cookie" +import { parse, splitCookiesString } from "set-cookie-parser" import { serialize, SerializeOptions as CookieSerializeOptions } from "cookie" -import { defaultForwardedHeaders } from "@/nextjs/headers" +import { defaultForwardedHeaders } from "./headers" export function onValidationError(value: T): T { return value @@ -16,9 +16,9 @@ export function toFlowParams( getCookieHeader: () => string | undefined, ): FlowParams { return { - id: params.flow, + id: params["flow"], cookie: getCookieHeader(), - return_to: params.return_to, + return_to: params["return_to"], } } diff --git a/packages/nextjs/tsconfig.json b/packages/nextjs123/tsconfig.json similarity index 100% rename from packages/nextjs/tsconfig.json rename to packages/nextjs123/tsconfig.json diff --git a/packages/nextjs/tsconfig.lib.json b/packages/nextjs123/tsconfig.lib.json similarity index 83% rename from packages/nextjs/tsconfig.lib.json rename to packages/nextjs123/tsconfig.lib.json index 33eca2c2c..32a7f2e06 100644 --- a/packages/nextjs/tsconfig.lib.json +++ b/packages/nextjs123/tsconfig.lib.json @@ -3,7 +3,8 @@ "compilerOptions": { "outDir": "../../dist/out-tsc", "declaration": true, - "types": ["node"] + "types": ["node"], + "rootDir": "./src" }, "include": ["src/**/*.ts"], "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] diff --git a/packages/nextjs/tsconfig.spec.json b/packages/nextjs123/tsconfig.spec.json similarity index 100% rename from packages/nextjs/tsconfig.spec.json rename to packages/nextjs123/tsconfig.spec.json diff --git a/tsconfig.base.json b/tsconfig.base.json index da8ca6803..4a7940944 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -9,6 +9,8 @@ "skipLibCheck": true, "baseUrl": ".", "paths": { + "@ory/nextjs": ["libs/nextjs/src/index.ts"], + "@ory/nextjs-next": ["packages/nextjs/src/index.ts"], "nextjs": ["packages/nextjs/src/index.ts"], "storybook-host": ["libs/storybook-host/src/index.ts"] }