Unverified Commit 3f83743a authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

Make next a devDependency of `@next/third-parties` package (#53996)

ensure `next` is the dependency of third-parties package so turbo will
build next first then `@next/third-parties` to avoid type failing

---------
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent dd00229e
...@@ -22,7 +22,7 @@ export let backendConfig = (): AuthConfig => { ...@@ -22,7 +22,7 @@ export let backendConfig = (): AuthConfig => {
// IMPORTANT: Please replace them with your own OAuth keys for production use. // IMPORTANT: Please replace them with your own OAuth keys for production use.
{ {
config: { config: {
thirdPartyId: "google", thirdPartyId: 'google',
clients: [ clients: [
{ {
clientId: process.env.GOOGLE_CLIENT_ID, clientId: process.env.GOOGLE_CLIENT_ID,
...@@ -33,7 +33,7 @@ export let backendConfig = (): AuthConfig => { ...@@ -33,7 +33,7 @@ export let backendConfig = (): AuthConfig => {
}, },
{ {
config: { config: {
thirdPartyId: "github", thirdPartyId: 'github',
clients: [ clients: [
{ {
clientId: process.env.GITHUB_CLIENT_ID, clientId: process.env.GITHUB_CLIENT_ID,
...@@ -44,13 +44,16 @@ export let backendConfig = (): AuthConfig => { ...@@ -44,13 +44,16 @@ export let backendConfig = (): AuthConfig => {
}, },
{ {
config: { config: {
thirdPartyId: "apple", thirdPartyId: 'apple',
clients: [ clients: [
{ {
clientId: process.env.APPLE_CLIENT_ID, clientId: process.env.APPLE_CLIENT_ID,
additionalConfig: { additionalConfig: {
keyId: process.env.APPLE_KEY_ID, keyId: process.env.APPLE_KEY_ID,
privateKey: process.env.APPLE_PRIVATE_KEY.replace(/\\n/g, "\n"), privateKey: process.env.APPLE_PRIVATE_KEY.replace(
/\\n/g,
'\n'
),
teamId: process.env.APPLE_TEAM_ID, teamId: process.env.APPLE_TEAM_ID,
}, },
}, },
......
import Head from 'next/head' import Head from 'next/head'
import React, { ComponentType, useEffect } from 'react' import React, { useEffect } from 'react'
import styles from '../../styles/Home.module.css' import styles from '../../styles/Home.module.css'
import dynamic from 'next/dynamic' import dynamic from 'next/dynamic'
import { canHandleRoute, getRoutingComponent } from 'supertokens-auth-react/ui' import { canHandleRoute, getRoutingComponent } from 'supertokens-auth-react/ui'
import { redirectToAuth } from 'supertokens-auth-react' import { redirectToAuth } from 'supertokens-auth-react'
import { ThirdPartyEmailPasswordPreBuiltUI } from "supertokens-auth-react/recipe/thirdpartyemailpassword/prebuiltui"; import { ThirdPartyEmailPasswordPreBuiltUI } from 'supertokens-auth-react/recipe/thirdpartyemailpassword/prebuiltui'
import { EmailVerificationPreBuiltUI } from "supertokens-auth-react/recipe/emailverification/prebuiltui"; import { EmailVerificationPreBuiltUI } from 'supertokens-auth-react/recipe/emailverification/prebuiltui'
const SuperTokensComponentNoSSR = dynamic<{}>(new Promise((res) => res(() => getRoutingComponent([ThirdPartyEmailPasswordPreBuiltUI, EmailVerificationPreBuiltUI]))), { ssr: false }) const SuperTokensComponentNoSSR = dynamic<{}>(
new Promise((res) =>
res(() =>
getRoutingComponent([
ThirdPartyEmailPasswordPreBuiltUI,
EmailVerificationPreBuiltUI,
])
)
),
{ ssr: false }
)
export default function Auth(): JSX.Element { export default function Auth(): JSX.Element {
useEffect(() => { useEffect(() => {
if (canHandleRoute([ThirdPartyEmailPasswordPreBuiltUI, EmailVerificationPreBuiltUI]) === false) { if (
canHandleRoute([
ThirdPartyEmailPasswordPreBuiltUI,
EmailVerificationPreBuiltUI,
]) === false
) {
redirectToAuth({ redirectToAuth({
redirectBack: false, redirectBack: false,
}) })
......
...@@ -136,7 +136,7 @@ function ProtectedPage({ userId }) { ...@@ -136,7 +136,7 @@ function ProtectedPage({ userId }) {
{JSON.stringify(session.accessTokenPayload, null, 2)} {JSON.stringify(session.accessTokenPayload, null, 2)}
</pre> </pre>
</p> </p>
<div className={styles.grid}> <div className={styles.grid}>
<a href="https://nextjs.org/docs" className={styles.card}> <a href="https://nextjs.org/docs" className={styles.card}>
<h3>Documentation &rarr;</h3> <h3>Documentation &rarr;</h3>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"scripts": { "scripts": {
"build": "rm -rf dist && tsc -d -p tsconfig.json", "build": "rm -rf dist && tsc -d -p tsconfig.json",
"prepublishOnly": "cd ../../ && turbo run build", "prepublishOnly": "cd ../../ && turbo run build",
"updateThirdParties": "rm -rf src/**/index.tsx && node scripts/update-third-parties", "update-third-parties": "rm -rf src/**/index.tsx && node scripts/update-third-parties",
"dev": "tsc -d -w -p tsconfig.json", "dev": "tsc -d -w -p tsconfig.json",
"typescript": "tsec --noEmit -p tsconfig.json" "typescript": "tsec --noEmit -p tsconfig.json"
}, },
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"third-party-capital": "1.0.17" "third-party-capital": "1.0.17"
}, },
"devDependencies": { "devDependencies": {
"next": "13.4.14",
"outdent": "0.8.0", "outdent": "0.8.0",
"prettier": "2.5.1" "prettier": "2.5.1"
}, },
......
...@@ -1572,9 +1572,6 @@ importers: ...@@ -1572,9 +1572,6 @@ importers:
packages/third-parties: packages/third-parties:
dependencies: dependencies:
next:
specifier: ^13.0.0
version: link:../next
react: react:
specifier: ^18.2.0 specifier: ^18.2.0
version: 18.2.0 version: 18.2.0
...@@ -1582,6 +1579,9 @@ importers: ...@@ -1582,6 +1579,9 @@ importers:
specifier: 1.0.17 specifier: 1.0.17
version: 1.0.17 version: 1.0.17
devDependencies: devDependencies:
next:
specifier: 13.4.14
version: link:../next
outdent: outdent:
specifier: 0.8.0 specifier: 0.8.0
version: 0.8.0 version: 0.8.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment