chore: plugin-cloud suite (#3821)
* test: plugin-cloud suite * chore: clean up dist imports * chore(plugin-cloud): linting
This commit is contained in:
@@ -28,6 +28,13 @@ module.exports = {
|
||||
'perfectionist/sort-vue-attributes': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.spec.ts'],
|
||||
rules: {
|
||||
'jest/prefer-strict-equal': 'off',
|
||||
'no-console': 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/nodemailer": "^6.4.7",
|
||||
"nodemailer": "^6.9.1",
|
||||
"payload": "^1.11.6",
|
||||
"payload": "workspace:*",
|
||||
"ts-jest": "^29.1.0",
|
||||
"webpack": "^5.78.0"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Config } from 'payload/config'
|
||||
|
||||
import { defaults } from 'payload/dist/config/defaults'
|
||||
import { defaults } from 'payload/config'
|
||||
|
||||
import { payloadCloudEmail } from './email'
|
||||
|
||||
@@ -11,6 +11,7 @@ describe('email', () => {
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
// @ts-expect-error No need for db or editor
|
||||
defaultConfig = { ...defaults }
|
||||
})
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { TypeWithID } from 'payload/dist/globals/config/types'
|
||||
import type { FileData } from 'payload/dist/uploads/types'
|
||||
import type { TypeWithID } from 'payload/types'
|
||||
import type { FileData } from 'payload/types'
|
||||
import type { CollectionAfterDeleteHook, CollectionConfig } from 'payload/types'
|
||||
|
||||
import type { TypeWithPrefix } from '../types'
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { TypeWithID } from 'payload/dist/collections/config/types'
|
||||
import type { FileData } from 'payload/dist/uploads/types'
|
||||
import type { TypeWithID, FileData } from 'payload/types'
|
||||
import type { CollectionBeforeChangeHook, CollectionConfig } from 'payload/types'
|
||||
import type stream from 'stream'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Config } from 'payload/config'
|
||||
|
||||
import nodemailer from 'nodemailer'
|
||||
import { defaults } from 'payload/dist/config/defaults'
|
||||
import { defaults } from 'payload/config'
|
||||
|
||||
import { payloadCloud } from './plugin'
|
||||
|
||||
@@ -11,6 +11,7 @@ describe('plugin', () => {
|
||||
})
|
||||
|
||||
describe('not in Payload Cloud', () => {
|
||||
// eslint-disable-next-line jest/expect-expect
|
||||
it('should return unmodified config, with webpack aliases', () => {
|
||||
const plugin = payloadCloud()
|
||||
const config = plugin(createConfig())
|
||||
@@ -28,6 +29,7 @@ describe('plugin', () => {
|
||||
})
|
||||
|
||||
describe('storage', () => {
|
||||
// eslint-disable-next-line jest/expect-expect
|
||||
it('should default to using payload cloud storage', () => {
|
||||
const plugin = payloadCloud()
|
||||
const config = plugin(createConfig())
|
||||
@@ -35,6 +37,7 @@ describe('plugin', () => {
|
||||
assertCloudStorage(config)
|
||||
})
|
||||
|
||||
// eslint-disable-next-line jest/expect-expect
|
||||
it('should allow opt-out', () => {
|
||||
const plugin = payloadCloud({ storage: false })
|
||||
const config = plugin(createConfig())
|
||||
@@ -44,6 +47,7 @@ describe('plugin', () => {
|
||||
})
|
||||
|
||||
describe('email', () => {
|
||||
// eslint-disable-next-line jest/expect-expect
|
||||
it('should default to using payload cloud email', () => {
|
||||
const plugin = payloadCloud()
|
||||
const config = plugin(createConfig())
|
||||
@@ -51,6 +55,7 @@ describe('plugin', () => {
|
||||
assertCloudEmail(config)
|
||||
})
|
||||
|
||||
// eslint-disable-next-line jest/expect-expect
|
||||
it('should allow opt-out', () => {
|
||||
const plugin = payloadCloud({ email: false })
|
||||
const config = plugin(createConfig())
|
||||
@@ -58,6 +63,7 @@ describe('plugin', () => {
|
||||
assertNoCloudEmail(config)
|
||||
})
|
||||
|
||||
// eslint-disable-next-line jest/expect-expect
|
||||
it('should allow PAYLOAD_CLOUD_EMAIL_* env vars to be unset', () => {
|
||||
delete process.env.PAYLOAD_CLOUD_EMAIL_API_KEY
|
||||
delete process.env.PAYLOAD_CLOUD_DEFAULT_DOMAIN
|
||||
@@ -71,6 +77,7 @@ describe('plugin', () => {
|
||||
it('should not modify existing email transport', () => {
|
||||
const existingTransport = nodemailer.createTransport({
|
||||
name: 'existing-transport',
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
send: async (mail) => {
|
||||
console.log('mock send', mail)
|
||||
},
|
||||
@@ -148,5 +155,5 @@ function createConfig(overrides?: Partial<Config>): Config {
|
||||
return {
|
||||
...defaults,
|
||||
...overrides,
|
||||
}
|
||||
} as Config
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { NextFunction, Response } from 'express'
|
||||
import type { Config } from 'payload/config'
|
||||
import type { TypeWithID } from 'payload/dist/collections/config/types'
|
||||
import type { FileData } from 'payload/dist/uploads/types'
|
||||
import type { TypeWithID } from 'payload/types'
|
||||
import type { FileData } from 'payload/types'
|
||||
import type { CollectionConfig, PayloadRequest } from 'payload/types'
|
||||
|
||||
export interface File {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FileData } from 'payload/dist/uploads/types'
|
||||
import type { FileData } from 'payload/types'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import type { File } from '../types'
|
||||
|
||||
@@ -7,18 +7,7 @@
|
||||
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
||||
"rootDir": "./src" /* Specify the root folder within your source files. */
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
"build",
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.spec.tsx"
|
||||
],
|
||||
"exclude": ["dist", "build", "tests", "test", "node_modules", ".eslintrc.js"],
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"],
|
||||
"references": [{ "path": "../payload" }]
|
||||
}
|
||||
|
||||
187
pnpm-lock.yaml
generated
187
pnpm-lock.yaml
generated
@@ -1032,14 +1032,14 @@ importers:
|
||||
specifier: ^6.9.1
|
||||
version: 6.9.4
|
||||
payload:
|
||||
specifier: ^1.11.6
|
||||
version: 1.15.8(@types/react@18.2.15)(typescript@5.2.2)
|
||||
specifier: workspace:*
|
||||
version: link:../payload
|
||||
ts-jest:
|
||||
specifier: ^29.1.0
|
||||
version: 29.1.1(@babel/core@7.22.20)(jest@29.6.4)(typescript@5.2.2)
|
||||
webpack:
|
||||
specifier: ^5.78.0
|
||||
version: 5.88.2(@swc/core@1.3.78)(webpack-cli@4.10.0)
|
||||
version: 5.88.2(@swc/core@1.3.76)(webpack-cli@4.10.0)
|
||||
|
||||
packages/plugin-nested-docs:
|
||||
devDependencies:
|
||||
@@ -3047,6 +3047,7 @@ packages:
|
||||
'@types/react': 18.2.15
|
||||
hoist-non-react-statics: 3.3.2
|
||||
react: 18.2.0
|
||||
dev: false
|
||||
|
||||
/@emotion/serialize@1.1.2:
|
||||
resolution: {integrity: sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA==}
|
||||
@@ -13702,148 +13703,6 @@ packages:
|
||||
uuid: 8.3.2
|
||||
webpack: 5.88.2(@swc/core@1.3.78)(webpack-cli@4.10.0)
|
||||
webpack-bundle-analyzer: 4.9.1
|
||||
webpack-cli: 4.10.0(webpack-bundle-analyzer@4.9.1)(webpack@5.88.2)
|
||||
webpack-dev-middleware: 6.0.1(webpack@5.88.2)
|
||||
webpack-hot-middleware: 2.25.4
|
||||
transitivePeerDependencies:
|
||||
- '@parcel/css'
|
||||
- '@swc/css'
|
||||
- '@swc/helpers'
|
||||
- '@types/react'
|
||||
- '@webpack-cli/generators'
|
||||
- '@webpack-cli/migrate'
|
||||
- aws-crt
|
||||
- bufferutil
|
||||
- clean-css
|
||||
- csso
|
||||
- encoding
|
||||
- esbuild
|
||||
- fibers
|
||||
- lightningcss
|
||||
- node-sass
|
||||
- react-native
|
||||
- sass-embedded
|
||||
- supports-color
|
||||
- typescript
|
||||
- uglify-js
|
||||
- utf-8-validate
|
||||
- webpack-dev-server
|
||||
dev: true
|
||||
|
||||
/payload@1.15.8(@types/react@18.2.15)(typescript@5.2.2):
|
||||
resolution: {integrity: sha512-3TqHR42r7dzADfVDfbCgUkap46Dk5w02dNGaI8zTSNjIdjVJ4h9NjBM0rRbP5s1JDGuygrvAzAhiFMAN44aVnQ==}
|
||||
engines: {node: '>=14', yarn: '>=1.22 <2'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@date-io/date-fns': 2.16.0(date-fns@2.30.0)
|
||||
'@dnd-kit/core': 6.0.8(react-dom@18.2.0)(react@18.2.0)
|
||||
'@dnd-kit/sortable': 7.0.2(@dnd-kit/core@6.0.8)(react@18.2.0)
|
||||
'@faceless-ui/modal': 2.0.1(react-dom@18.2.0)(react@18.2.0)
|
||||
'@faceless-ui/scroll-info': 1.3.0(react-dom@18.2.0)(react@18.2.0)
|
||||
'@faceless-ui/window-info': 2.1.1(react-dom@18.2.0)(react@18.2.0)
|
||||
'@monaco-editor/react': 4.5.1(monaco-editor@0.38.0)(react-dom@18.2.0)(react@18.2.0)
|
||||
'@swc/core': 1.3.78
|
||||
'@swc/register': 0.1.10(@swc/core@1.3.78)
|
||||
'@types/sharp': 0.31.1
|
||||
body-parser: 1.20.2
|
||||
bson-objectid: 2.0.4
|
||||
compression: 1.7.4
|
||||
conf: 10.2.0
|
||||
connect-history-api-fallback: 1.6.0
|
||||
console-table-printer: 2.11.2
|
||||
css-loader: 5.2.7(webpack@5.88.2)
|
||||
css-minimizer-webpack-plugin: 5.0.1(webpack@5.88.2)
|
||||
dataloader: 2.2.2
|
||||
date-fns: 2.30.0
|
||||
deep-equal: 2.2.2
|
||||
deepmerge: 4.3.1
|
||||
dotenv: 8.6.0
|
||||
express: 4.18.2
|
||||
express-fileupload: 1.4.0
|
||||
express-rate-limit: 5.5.1
|
||||
file-loader: 6.2.0(webpack@5.88.2)
|
||||
file-type: 16.5.4
|
||||
find-up: 4.1.0
|
||||
flatley: 5.2.0
|
||||
fs-extra: 10.1.0
|
||||
get-tsconfig: 4.6.2
|
||||
graphql: 16.8.1
|
||||
graphql-http: 1.21.0(graphql@16.8.1)
|
||||
graphql-playground-middleware-express: 1.7.23(express@4.18.2)
|
||||
graphql-query-complexity: 0.12.0(graphql@16.8.1)
|
||||
graphql-scalars: 1.22.2(graphql@16.8.1)
|
||||
graphql-type-json: 0.3.2(graphql@16.8.1)
|
||||
html-webpack-plugin: 5.5.3(webpack@5.88.2)
|
||||
http-status: 1.6.2
|
||||
i18next: 22.5.1
|
||||
i18next-browser-languagedetector: 6.1.8
|
||||
i18next-http-middleware: 3.3.2
|
||||
is-hotkey: 0.2.0
|
||||
is-plain-object: 5.0.0
|
||||
isomorphic-fetch: 3.0.0
|
||||
joi: 17.9.2
|
||||
json-schema-to-typescript: 11.0.3
|
||||
jsonwebtoken: 9.0.1
|
||||
jwt-decode: 3.1.2
|
||||
md5: 2.3.0
|
||||
method-override: 3.0.0
|
||||
micro-memoize: 4.1.2
|
||||
mini-css-extract-plugin: 1.6.2(webpack@5.88.2)
|
||||
minimist: 1.2.8
|
||||
mkdirp: 1.0.4
|
||||
monaco-editor: 0.38.0
|
||||
mongoose: 6.11.4
|
||||
mongoose-aggregate-paginate-v2: 1.0.6
|
||||
mongoose-paginate-v2: 1.7.22
|
||||
nodemailer: 6.9.4
|
||||
object-to-formdata: 4.5.1
|
||||
passport: 0.6.0
|
||||
passport-anonymous: 1.0.1
|
||||
passport-headerapikey: 1.2.2
|
||||
passport-jwt: 4.0.1
|
||||
passport-local: 1.0.0
|
||||
path-browserify: 1.0.1
|
||||
pino: 6.14.0
|
||||
pino-pretty: 9.4.1
|
||||
pluralize: 8.0.0
|
||||
postcss: 8.4.31
|
||||
postcss-loader: 6.2.1(postcss@8.4.31)(webpack@5.88.2)
|
||||
postcss-preset-env: 9.0.0(postcss@8.4.31)
|
||||
probe-image-size: 6.0.0
|
||||
process: 0.11.10
|
||||
qs: 6.11.2
|
||||
qs-middleware: 1.0.3
|
||||
react: 18.2.0
|
||||
react-animate-height: 2.1.2(react-dom@18.2.0)(react@18.2.0)
|
||||
react-datepicker: 4.16.0(react-dom@18.2.0)(react@18.2.0)
|
||||
react-diff-viewer-continued: 3.2.6(react-dom@18.2.0)(react@18.2.0)
|
||||
react-dom: 18.2.0(react@18.2.0)
|
||||
react-helmet: 6.1.0(react@18.2.0)
|
||||
react-i18next: 11.18.6(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0)
|
||||
react-router-dom: 5.3.4(react@18.2.0)
|
||||
react-router-navigation-prompt: 1.9.6(react-router-dom@5.3.4)(react@18.2.0)
|
||||
react-select: 5.7.4(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0)
|
||||
react-toastify: 8.2.0(react-dom@18.2.0)(react@18.2.0)
|
||||
sanitize-filename: 1.6.3
|
||||
sass: 1.64.0
|
||||
sass-loader: 12.6.0(sass@1.64.0)(webpack@5.88.2)
|
||||
scheduler: 0.23.0
|
||||
scmp: 2.1.0
|
||||
sharp: 0.31.3
|
||||
slate: 0.91.4
|
||||
slate-history: 0.86.0(slate@0.91.4)
|
||||
slate-hyperscript: 0.81.3(slate@0.91.4)
|
||||
slate-react: 0.92.0(react-dom@18.2.0)(react@18.2.0)(slate@0.91.4)
|
||||
style-loader: 2.0.0(webpack@5.88.2)
|
||||
swc-loader: 0.2.3(@swc/core@1.3.78)(webpack@5.88.2)
|
||||
swc-minify-webpack-plugin: 2.1.1(@swc/core@1.3.78)(webpack@5.88.2)
|
||||
terser-webpack-plugin: 5.3.9(@swc/core@1.3.78)(webpack@5.88.2)
|
||||
ts-essentials: 7.0.3(typescript@5.2.2)
|
||||
url-loader: 4.1.1(file-loader@6.2.0)(webpack@5.88.2)
|
||||
use-context-selector: 1.4.1(react-dom@18.2.0)(react@18.2.0)(scheduler@0.23.0)
|
||||
uuid: 8.3.2
|
||||
webpack: 5.88.2(@swc/core@1.3.78)(webpack-cli@4.10.0)
|
||||
webpack-bundle-analyzer: 4.9.1
|
||||
webpack-cli: 4.10.0(webpack@5.88.2)
|
||||
webpack-dev-middleware: 6.0.1(webpack@5.88.2)
|
||||
webpack-hot-middleware: 2.25.4
|
||||
@@ -15288,6 +15147,7 @@ packages:
|
||||
use-isomorphic-layout-effect: 1.1.2(@types/react@18.2.15)(react@18.2.0)
|
||||
transitivePeerDependencies:
|
||||
- '@types/react'
|
||||
dev: false
|
||||
|
||||
/react-side-effect@2.1.2(react@18.2.0):
|
||||
resolution: {integrity: sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw==}
|
||||
@@ -15746,31 +15606,6 @@ packages:
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/sass-loader@12.6.0(sass@1.64.0)(webpack@5.88.2):
|
||||
resolution: {integrity: sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA==}
|
||||
engines: {node: '>= 12.13.0'}
|
||||
peerDependencies:
|
||||
fibers: '>= 3.1.0'
|
||||
node-sass: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0
|
||||
sass: ^1.3.0
|
||||
sass-embedded: '*'
|
||||
webpack: ^5.0.0
|
||||
peerDependenciesMeta:
|
||||
fibers:
|
||||
optional: true
|
||||
node-sass:
|
||||
optional: true
|
||||
sass:
|
||||
optional: true
|
||||
sass-embedded:
|
||||
optional: true
|
||||
dependencies:
|
||||
klona: 2.0.6
|
||||
neo-async: 2.6.2
|
||||
sass: 1.64.0
|
||||
webpack: 5.88.2(@swc/core@1.3.78)(webpack-cli@4.10.0)
|
||||
dev: true
|
||||
|
||||
/sass-loader@12.6.0(sass@1.69.4)(webpack@5.88.2):
|
||||
resolution: {integrity: sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA==}
|
||||
engines: {node: '>= 12.13.0'}
|
||||
@@ -15795,16 +15630,6 @@ packages:
|
||||
sass: 1.69.4
|
||||
webpack: 5.88.2(@swc/core@1.3.76)(webpack-cli@4.10.0)
|
||||
|
||||
/sass@1.64.0:
|
||||
resolution: {integrity: sha512-m7YtAGmQta9uANIUJwXesAJMSncqH+3INc8kdVXs6eV6GUC8Qu2IYKQSN8PRLgiQfpca697G94klm2leYMxSHw==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
chokidar: 3.5.3
|
||||
immutable: 4.3.4
|
||||
source-map-js: 1.0.2
|
||||
dev: true
|
||||
|
||||
/sass@1.69.4:
|
||||
resolution: {integrity: sha512-+qEreVhqAy8o++aQfCJwp0sklr2xyEzkm9Pp/Igu9wNPoe7EZEQ8X/MBvvXggI2ql607cxKg/RKOwDj6pp2XDA==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
@@ -16895,6 +16720,7 @@ packages:
|
||||
typescript: '>=3.7.0'
|
||||
dependencies:
|
||||
typescript: 5.2.2
|
||||
dev: false
|
||||
|
||||
/ts-jest@29.1.1(@babel/core@7.22.20)(jest@29.6.4)(typescript@5.2.2):
|
||||
resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==}
|
||||
@@ -17349,6 +17175,7 @@ packages:
|
||||
dependencies:
|
||||
'@types/react': 18.2.15
|
||||
react: 18.2.0
|
||||
dev: false
|
||||
|
||||
/utf8-byte-length@1.0.4:
|
||||
resolution: {integrity: sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==}
|
||||
|
||||
28
test/plugin-cloud/collections/Media.ts
Normal file
28
test/plugin-cloud/collections/Media.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { CollectionConfig } from '../../../packages/payload/src/collections/config/types'
|
||||
|
||||
export const Media: CollectionConfig = {
|
||||
slug: 'media',
|
||||
upload: {
|
||||
imageSizes: [
|
||||
{
|
||||
height: 400,
|
||||
width: 400,
|
||||
crop: 'center',
|
||||
name: 'square',
|
||||
},
|
||||
{
|
||||
width: 900,
|
||||
height: 450,
|
||||
crop: 'center',
|
||||
name: 'sixteenByNineMedium',
|
||||
},
|
||||
],
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'alt',
|
||||
label: 'Alt Text',
|
||||
type: 'text',
|
||||
},
|
||||
],
|
||||
}
|
||||
16
test/plugin-cloud/collections/Users.ts
Normal file
16
test/plugin-cloud/collections/Users.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { CollectionConfig } from '../../../packages/payload/src/collections/config/types'
|
||||
|
||||
export const Users: CollectionConfig = {
|
||||
slug: 'users',
|
||||
auth: true,
|
||||
admin: {
|
||||
useAsTitle: 'email',
|
||||
},
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
fields: [
|
||||
// Email added by default
|
||||
// Add more fields as needed
|
||||
],
|
||||
}
|
||||
42
test/plugin-cloud/config.ts
Normal file
42
test/plugin-cloud/config.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import dotenv from 'dotenv'
|
||||
import path from 'path'
|
||||
|
||||
import { payloadCloud } from '../../packages/plugin-cloud/src'
|
||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||
import { devUser } from '../credentials'
|
||||
import { Media } from './collections/Media'
|
||||
import { Users } from './collections/Users'
|
||||
|
||||
// NOTE: may need to create .env file for testing
|
||||
dotenv.config({
|
||||
path: path.resolve(__dirname, '.env'),
|
||||
})
|
||||
|
||||
export default buildConfigWithDefaults({
|
||||
collections: [Media, Users],
|
||||
admin: {
|
||||
webpack: (config) => ({
|
||||
...config,
|
||||
resolve: {
|
||||
...config.resolve,
|
||||
alias: {
|
||||
...config?.resolve?.alias,
|
||||
[path.resolve(__dirname, '../../packages/plugin-cloud/src')]: path.resolve(
|
||||
__dirname,
|
||||
'../../packages/plugin-cloud/src/admin.js',
|
||||
),
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
plugins: [payloadCloud()],
|
||||
onInit: async (payload) => {
|
||||
await payload.create({
|
||||
collection: 'users',
|
||||
data: {
|
||||
email: devUser.email,
|
||||
password: devUser.password,
|
||||
},
|
||||
})
|
||||
},
|
||||
})
|
||||
11
test/plugin-cloud/int.spec.ts
Normal file
11
test/plugin-cloud/int.spec.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { initPayloadTest } from '../helpers/configHelpers'
|
||||
|
||||
describe('Nested Docs', () => {
|
||||
beforeAll(async () => {
|
||||
await initPayloadTest({ __dirname, init: { local: true } })
|
||||
})
|
||||
|
||||
describe('tests', () => {
|
||||
it.todo('plugin-cloud tests')
|
||||
})
|
||||
})
|
||||
1
test/plugin-cloud/mocks/admin.js
Normal file
1
test/plugin-cloud/mocks/admin.js
Normal file
@@ -0,0 +1 @@
|
||||
export const payloadCloud = () => (config) => config
|
||||
Reference in New Issue
Block a user