chore: working turbopack
This commit is contained in:
@@ -7,6 +7,11 @@ const nextConfig = {
|
||||
'**/*': ['drizzle-kit', 'drizzle-kit/utils'],
|
||||
},
|
||||
serverComponentsExternalPackages: ['drizzle-kit', 'drizzle-kit/utils', 'pino', 'pino-pretty'],
|
||||
turbo: {
|
||||
resolveAlias: {
|
||||
'@payloadcms/ui/scss': path.resolve(__dirname, './packages/ui/src/scss/styles.scss'),
|
||||
},
|
||||
},
|
||||
},
|
||||
webpack: (config) => {
|
||||
return {
|
||||
@@ -29,6 +34,7 @@ const nextConfig = {
|
||||
...config.resolve,
|
||||
alias: {
|
||||
...config.resolve.alias,
|
||||
'@payloadcms/ui/scss': path.resolve(__dirname, './packages/ui/src/scss/styles.scss'),
|
||||
'payload-config': process.env.PAYLOAD_CONFIG_PATH,
|
||||
},
|
||||
fallback: {
|
||||
|
||||
@@ -15,8 +15,8 @@ export const connect: Connect = async function connect(this: MongooseAdapter, pa
|
||||
throw new Error('Error: missing MongoDB connection URL.')
|
||||
}
|
||||
|
||||
let urlToConnect = this.url
|
||||
let successfulConnectionMessage = 'Connected to MongoDB server successfully!'
|
||||
const urlToConnect = this.url
|
||||
const successfulConnectionMessage = 'Connected to MongoDB server successfully!'
|
||||
|
||||
const connectionOptions: ConnectOptions & { useFacet: undefined } = {
|
||||
autoIndex: true,
|
||||
@@ -24,26 +24,26 @@ export const connect: Connect = async function connect(this: MongooseAdapter, pa
|
||||
useFacet: undefined,
|
||||
}
|
||||
|
||||
if ([process.env.APP_ENV, process.env.NODE_ENV].includes('test')) {
|
||||
if (process.env.PAYLOAD_TEST_MONGO_URL) {
|
||||
urlToConnect = process.env.PAYLOAD_TEST_MONGO_URL
|
||||
} else {
|
||||
connectionOptions.dbName = 'payloadmemory'
|
||||
const { MongoMemoryServer } = require('mongodb-memory-server')
|
||||
const getPort = require('get-port')
|
||||
// if ([process.env.APP_ENV, process.env.NODE_ENV].includes('test')) {
|
||||
// if (process.env.PAYLOAD_TEST_MONGO_URL) {
|
||||
// urlToConnect = process.env.PAYLOAD_TEST_MONGO_URL
|
||||
// } else {
|
||||
// connectionOptions.dbName = 'payloadmemory'
|
||||
// const { MongoMemoryServer } = require('mongodb-memory-server')
|
||||
// const getPort = require('get-port')
|
||||
|
||||
const port = await getPort()
|
||||
this.mongoMemoryServer = await MongoMemoryServer.create({
|
||||
instance: {
|
||||
dbName: 'payloadmemory',
|
||||
port,
|
||||
},
|
||||
})
|
||||
// const port = await getPort()
|
||||
// this.mongoMemoryServer = await MongoMemoryServer.create({
|
||||
// instance: {
|
||||
// dbName: 'payloadmemory',
|
||||
// port,
|
||||
// },
|
||||
// })
|
||||
|
||||
urlToConnect = this.mongoMemoryServer.getUri()
|
||||
successfulConnectionMessage = 'Connected to in-memory MongoDB server successfully!'
|
||||
}
|
||||
}
|
||||
// urlToConnect = this.mongoMemoryServer.getUri()
|
||||
// successfulConnectionMessage = 'Connected to in-memory MongoDB server successfully!'
|
||||
// }
|
||||
// }
|
||||
|
||||
try {
|
||||
this.connection = (await mongoose.connect(urlToConnect, connectionOptions)).connection
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '@payloadcms/ui/scss';
|
||||
@import '../../../../../ui/src/scss/styles.scss';
|
||||
|
||||
.dashboard {
|
||||
width: 100%;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@import 'vars';
|
||||
@import '~react-toastify/dist/ReactToastify.css';
|
||||
@import '../../node_modules/react-toastify/dist/ReactToastify.css';
|
||||
|
||||
.Toastify {
|
||||
.Toastify__toast-container {
|
||||
|
||||
@@ -11,11 +11,7 @@
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
||||
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
|
||||
"jsx": "preserve" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"noEmit": true /* Do not emit outputs. */,
|
||||
/* Concatenate and emit output to single file. */
|
||||
"outDir": "./dist" /* Redirect output structure to the directory. */,
|
||||
@@ -24,11 +20,7 @@
|
||||
"skipLibCheck": true /* Skip type checking of declaration files. */,
|
||||
"sourceMap": true,
|
||||
"strict": false /* Enable all strict type-checking options. */,
|
||||
"types": [
|
||||
"jest",
|
||||
"node",
|
||||
"@types/jest"
|
||||
],
|
||||
"types": ["jest", "node", "@types/jest"],
|
||||
"incremental": true,
|
||||
"isolatedModules": true,
|
||||
"plugins": [
|
||||
@@ -37,47 +29,22 @@
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"payload": [
|
||||
"./packages/payload/src"
|
||||
],
|
||||
"payload/*": [
|
||||
"./packages/payload/src/exports/*"
|
||||
],
|
||||
"@payloadcms/db-mongodb": [
|
||||
"./packages/db-mongodb/src"
|
||||
],
|
||||
"@payloadcms/richtext-lexical": [
|
||||
"./packages/richtext-lexical/src"
|
||||
],
|
||||
"@payloadcms/ui/*": [
|
||||
"./packages/ui/src/exports/*"
|
||||
],
|
||||
"@payloadcms/translations": [
|
||||
"./packages/translations/src/exports/index.ts"
|
||||
],
|
||||
"@payloadcms/translations/client": [
|
||||
"./packages/translations/src/all"
|
||||
],
|
||||
"@payloadcms/translations/api": [
|
||||
"./packages/translations/src/all"
|
||||
],
|
||||
"@payloadcms/next/*": [
|
||||
"./packages/next/src/*"
|
||||
],
|
||||
"@payloadcms/graphql": [
|
||||
"./packages/graphql/src"
|
||||
],
|
||||
"payload-config": [
|
||||
"./test/_community/config.ts"
|
||||
]
|
||||
"payload": ["./packages/payload/src"],
|
||||
"payload/*": ["./packages/payload/src/exports/*"],
|
||||
"@payloadcms/db-mongodb": ["./packages/db-mongodb/src"],
|
||||
"@payloadcms/richtext-lexical": ["./packages/richtext-lexical/src"],
|
||||
"@payloadcms/ui/*": ["./packages/ui/src/exports/*"],
|
||||
"@payloadcms/ui/scss": ["./packages/ui/src/scss/styles.scss"],
|
||||
"@payloadcms/ui/scss/app.scss": ["./packages/ui/src/scss/app.scss"],
|
||||
"@payloadcms/translations": ["./packages/translations/src/exports/index.ts"],
|
||||
"@payloadcms/translations/client": ["./packages/translations/src/all"],
|
||||
"@payloadcms/translations/api": ["./packages/translations/src/all"],
|
||||
"@payloadcms/next/*": ["./packages/next/src/*"],
|
||||
"@payloadcms/graphql": ["./packages/graphql/src"],
|
||||
"payload-config": ["./test/_community/config.ts"]
|
||||
}
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
"build",
|
||||
"temp",
|
||||
"node_modules"
|
||||
],
|
||||
"exclude": ["dist", "build", "temp", "node_modules"],
|
||||
/* Like tsconfig.build.json, but includes test directory and doesnt emit anything */
|
||||
"composite": true, // Required for references to work
|
||||
"references": [
|
||||
@@ -140,10 +107,5 @@
|
||||
"path": "./packages/ui"
|
||||
}
|
||||
],
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
".next/types/**/*.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx"
|
||||
]
|
||||
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user