chore: hoists tests out of payload package
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
globalSetup: './test/jest.setup.ts',
|
globalSetup: './test/jest.setup.ts',
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'\\.(css|scss)$': '<rootDir>/src/bundlers/mocks/emptyModule.js',
|
'\\.(css|scss)$': '<rootDir>/packages/payload/src/bundlers/mocks/emptyModule.js',
|
||||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
||||||
'<rootDir>/src/bundlers/mocks/fileMock.js',
|
'<rootDir>/packages/payload/src/bundlers/mocks/fileMock.js',
|
||||||
},
|
},
|
||||||
testEnvironment: 'node',
|
testEnvironment: 'node',
|
||||||
testMatch: ['**/src/**/*.spec.ts', '**/test/**/*int.spec.ts'],
|
testMatch: ['**/packages/payload/src/**/*.spec.ts', '**/test/**/*int.spec.ts'],
|
||||||
testTimeout: 90000,
|
testTimeout: 90000,
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.(t|j)sx?$': ['@swc/jest'],
|
'^.+\\.(t|j)sx?$': ['@swc/jest'],
|
||||||
@@ -99,10 +99,10 @@
|
|||||||
"release:patch": "release-it patch",
|
"release:patch": "release-it patch",
|
||||||
"test": "pnpm --filter payload run test",
|
"test": "pnpm --filter payload run test",
|
||||||
"test:components": "pnpm --filter payload run test:components",
|
"test:components": "pnpm --filter payload run test:components",
|
||||||
"test:e2e": "pnpm --filter payload run test:e2e",
|
"test:e2e": "ts-node -T ./test/runE2E.ts",
|
||||||
"test:e2e:debug": "pnpm --filter payload run test:e2e:debug",
|
"test:e2e:debug": "pnpm --filter payload run test:e2e:debug",
|
||||||
"test:e2e:headed": "pnpm --filter payload run test:e2e:headed",
|
"test:e2e:headed": "pnpm --filter payload run test:e2e:headed",
|
||||||
"test:int": "pnpm --filter payload run test:int",
|
"test:int": "cross-env DISABLE_LOGGING=true jest --forceExit --detectOpenHandles",
|
||||||
"translateNewKeys": "pnpm --filter payload run translateNewKeys"
|
"translateNewKeys": "pnpm --filter payload run translateNewKeys"
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
@@ -111,4 +111,4 @@
|
|||||||
"workspaces:": [
|
"workspaces:": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"exec": "ts-node ./test/dev.ts",
|
"exec": "ts-node ../../test/dev.ts",
|
||||||
"ext": "ts,js,json",
|
"ext": "ts,js,json",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
".git",
|
".git",
|
||||||
@@ -9,5 +9,9 @@
|
|||||||
"src/**/*.spec.ts",
|
"src/**/*.spec.ts",
|
||||||
"test/**/payload-types.ts"
|
"test/**/payload-types.ts"
|
||||||
],
|
],
|
||||||
"watch": ["src/**/*.ts", "test/", "packages/**/*.ts"]
|
"watch": [
|
||||||
}
|
"src/**/*.ts",
|
||||||
|
"../../test/",
|
||||||
|
"packages/**/*.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import type { CollectionConfig } from '../../../src/collections/config/types'
|
|
||||||
|
|
||||||
export const Users: CollectionConfig = {
|
|
||||||
slug: 'users',
|
|
||||||
auth: true,
|
|
||||||
fields: [],
|
|
||||||
}
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"payload/types": ["./src/types/index.ts"]
|
"payload/types": ["./src/types/index.ts"]
|
||||||
},
|
},
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"rootDir": "." /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
|
"rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
|
||||||
"skipLibCheck": true /* Skip type checking of declaration files. */,
|
"skipLibCheck": true /* Skip type checking of declaration files. */,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"strict": false /* Enable all strict type-checking options. */,
|
"strict": false /* Enable all strict type-checking options. */,
|
||||||
@@ -30,7 +30,6 @@
|
|||||||
},
|
},
|
||||||
"exclude": ["dist", "build", "temp", "node_modules"],
|
"exclude": ["dist", "build", "temp", "node_modules"],
|
||||||
/* Like tsconfig.build.json, but includes test directory and doesnt emit anything */
|
/* Like tsconfig.build.json, but includes test directory and doesnt emit anything */
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
"src/**/*.tsx",
|
"src/**/*.tsx",
|
||||||
@@ -38,8 +37,7 @@
|
|||||||
"src/**/*.json",
|
"src/**/*.json",
|
||||||
"test/**/*.ts",
|
"test/**/*.ts",
|
||||||
"test/**/*.tsx",
|
"test/**/*.tsx",
|
||||||
"test/**/*.d.ts",
|
"test/**/*.d.ts"
|
||||||
"test/**/*.json"
|
|
||||||
],
|
],
|
||||||
"ts-node": {
|
"ts-node": {
|
||||||
"esm": true,
|
"esm": true,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { CollectionConfig } from '../../../../src/collections/config/types'
|
import type { CollectionConfig } from '../../../../packages/payload/src/collections/config/types'
|
||||||
|
|
||||||
export const mediaSlug = 'media'
|
export const mediaSlug = 'media'
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { CollectionConfig } from '../../../../src/collections/config/types'
|
import type { CollectionConfig } from '../../../../packages/payload/src/collections/config/types'
|
||||||
|
|
||||||
import { mediaSlug } from '../Media'
|
import { mediaSlug } from '../Media'
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { GlobalConfig } from '../../../../src/globals/config/types'
|
import type { GlobalConfig } from '../../../../packages/payload/src/globals/config/types'
|
||||||
|
|
||||||
export const menuSlug = 'menu'
|
export const menuSlug = 'menu'
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import payload from '../../src'
|
import payload from '../../packages/payload/src'
|
||||||
import { devUser } from '../credentials'
|
import { devUser } from '../credentials'
|
||||||
import { initPayloadTest } from '../helpers/configHelpers'
|
import { initPayloadTest } from '../helpers/configHelpers'
|
||||||
import { postsSlug } from './collections/Posts'
|
import { postsSlug } from './collections/Posts'
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { FieldAccess } from '../../src/fields/config/types'
|
import type { FieldAccess } from '../../packages/payload/src/fields/config/types'
|
||||||
|
|
||||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||||
import { devUser } from '../credentials'
|
import { devUser } from '../credentials'
|
||||||
@@ -4,8 +4,8 @@ import { expect, test } from '@playwright/test'
|
|||||||
|
|
||||||
import type { ReadOnlyCollection, RestrictedVersion } from './payload-types'
|
import type { ReadOnlyCollection, RestrictedVersion } from './payload-types'
|
||||||
|
|
||||||
import payload from '../../src'
|
import payload from '../../packages/payload/src'
|
||||||
import wait from '../../src/utilities/wait'
|
import wait from '../../packages/payload/src/utilities/wait'
|
||||||
import { AdminUrlUtil } from '../helpers/adminUrlUtil'
|
import { AdminUrlUtil } from '../helpers/adminUrlUtil'
|
||||||
import { initPayloadE2E } from '../helpers/configHelpers'
|
import { initPayloadE2E } from '../helpers/configHelpers'
|
||||||
import {
|
import {
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import type { PayloadRequest } from '../../src/types'
|
import type { PayloadRequest } from '../../packages/payload/src/types'
|
||||||
import type { Post, RelyOnRequestHeader, Restricted } from './payload-types'
|
import type { Post, RelyOnRequestHeader, Restricted } from './payload-types'
|
||||||
|
|
||||||
import payload from '../../src'
|
import payload from '../../packages/payload/src'
|
||||||
import { Forbidden } from '../../src/errors'
|
import { Forbidden } from '../../packages/payload/src/errors'
|
||||||
import { initPayloadTest } from '../helpers/configHelpers'
|
import { initPayloadTest } from '../helpers/configHelpers'
|
||||||
import {
|
import {
|
||||||
hiddenAccessSlug,
|
hiddenAccessSlug,
|
||||||
@@ -2,8 +2,8 @@ import React from 'react'
|
|||||||
import { NavLink } from 'react-router-dom'
|
import { NavLink } from 'react-router-dom'
|
||||||
|
|
||||||
// As this is the demo project, we import our dependencies from the `src` directory.
|
// As this is the demo project, we import our dependencies from the `src` directory.
|
||||||
import Chevron from '../../../../src/admin/components/icons/Chevron'
|
import Chevron from '../../../../packages/payload/src/admin/components/icons/Chevron'
|
||||||
import { useConfig } from '../../../../src/admin/components/utilities/Config'
|
import { useConfig } from '../../../../packages/payload/src/admin/components/utilities/Config'
|
||||||
|
|
||||||
// In your projects, you can import as follows:
|
// In your projects, you can import as follows:
|
||||||
// import { Chevron } from 'payload/components';
|
// import { Chevron } from 'payload/components';
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import LogOut from '../../../../src/admin/components/icons/LogOut'
|
import LogOut from '../../../../packages/payload/src/admin/components/icons/LogOut'
|
||||||
import { useConfig } from '../../../../src/admin/components/utilities/Config'
|
import { useConfig } from '../../../../packages/payload/src/admin/components/utilities/Config'
|
||||||
|
|
||||||
const Logout: React.FC = () => {
|
const Logout: React.FC = () => {
|
||||||
const config = useConfig()
|
const config = useConfig()
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@import '../../../../../../../src/admin/scss/styles.scss';
|
@import '../../../../../../../packages/payload/src/admin/scss/styles.scss';
|
||||||
|
|
||||||
.button-rich-text-button {
|
.button-rich-text-button {
|
||||||
.btn {
|
.btn {
|
||||||
@@ -3,16 +3,16 @@ import React, { Fragment, useCallback } from 'react'
|
|||||||
import { Transforms } from 'slate'
|
import { Transforms } from 'slate'
|
||||||
import { ReactEditor, useSlate } from 'slate-react'
|
import { ReactEditor, useSlate } from 'slate-react'
|
||||||
|
|
||||||
import Button from '../../../../../../../src/admin/components/elements/Button'
|
import Button from '../../../../../../../packages/payload/src/admin/components/elements/Button'
|
||||||
import Form from '../../../../../../../src/admin/components/forms/Form'
|
import Form from '../../../../../../../packages/payload/src/admin/components/forms/Form'
|
||||||
import reduceFieldsToValues from '../../../../../../../src/admin/components/forms/Form/reduceFieldsToValues'
|
import reduceFieldsToValues from '../../../../../../../packages/payload/src/admin/components/forms/Form/reduceFieldsToValues'
|
||||||
import Submit from '../../../../../../../src/admin/components/forms/Submit'
|
import Submit from '../../../../../../../packages/payload/src/admin/components/forms/Submit'
|
||||||
import Checkbox from '../../../../../../../src/admin/components/forms/field-types/Checkbox'
|
import Checkbox from '../../../../../../../packages/payload/src/admin/components/forms/field-types/Checkbox'
|
||||||
import ElementButton from '../../../../../../../src/admin/components/forms/field-types/RichText/elements/Button'
|
import ElementButton from '../../../../../../../packages/payload/src/admin/components/forms/field-types/RichText/elements/Button'
|
||||||
import Select from '../../../../../../../src/admin/components/forms/field-types/Select'
|
import Select from '../../../../../../../packages/payload/src/admin/components/forms/field-types/Select'
|
||||||
import Text from '../../../../../../../src/admin/components/forms/field-types/Text'
|
import Text from '../../../../../../../packages/payload/src/admin/components/forms/field-types/Text'
|
||||||
import X from '../../../../../../../src/admin/components/icons/X'
|
import X from '../../../../../../../packages/payload/src/admin/components/icons/X'
|
||||||
import MinimalTemplate from '../../../../../../../src/admin/components/templates/Minimal'
|
import MinimalTemplate from '../../../../../../../packages/payload/src/admin/components/templates/Minimal'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
||||||
const baseClass = 'button-rich-text-button'
|
const baseClass = 'button-rich-text-button'
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@import '../../../../../../../src/admin/scss/styles.scss';
|
@import '../../../../../../../packages/payload/src/admin/scss/styles.scss';
|
||||||
|
|
||||||
.rich-text-button {
|
.rich-text-button {
|
||||||
margin: $baseline 0;
|
margin: $baseline 0;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { RichTextCustomElement } from '../../../../../../src/fields/config/types'
|
import type { RichTextCustomElement } from '../../../../../../packages/payload/src/fields/config/types'
|
||||||
|
|
||||||
import Button from './Button'
|
import Button from './Button'
|
||||||
import Element from './Element'
|
import Element from './Element'
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import LeafButton from '../../../../../../../src/admin/components/forms/field-types/RichText/leaves/Button'
|
import LeafButton from '../../../../../../../packages/payload/src/admin/components/forms/field-types/RichText/leaves/Button'
|
||||||
|
|
||||||
const Button = () => <LeafButton format="purple-background">Purple Background</LeafButton>
|
const Button = () => <LeafButton format="purple-background">Purple Background</LeafButton>
|
||||||
|
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
import React, { useEffect } from 'react'
|
import React, { useEffect } from 'react'
|
||||||
import { Redirect } from 'react-router-dom'
|
import { Redirect } from 'react-router-dom'
|
||||||
|
|
||||||
import type { AdminView } from '../../../../../src/config/types'
|
import type { AdminView } from '../../../../../packages/payload/src/config/types'
|
||||||
|
|
||||||
import Button from '../../../../../src/admin/components/elements/Button'
|
import Button from '../../../../../packages/payload/src/admin/components/elements/Button'
|
||||||
import Eyebrow from '../../../../../src/admin/components/elements/Eyebrow'
|
import Eyebrow from '../../../../../packages/payload/src/admin/components/elements/Eyebrow'
|
||||||
import { useStepNav } from '../../../../../src/admin/components/elements/StepNav'
|
import { useStepNav } from '../../../../../packages/payload/src/admin/components/elements/StepNav'
|
||||||
// As this is the demo project, we import our dependencies from the `src` directory.
|
// As this is the demo project, we import our dependencies from the `src` directory.
|
||||||
import DefaultTemplate from '../../../../../src/admin/components/templates/Default'
|
import DefaultTemplate from '../../../../../packages/payload/src/admin/components/templates/Default'
|
||||||
import { useConfig } from '../../../../../src/admin/components/utilities/Config'
|
import { useConfig } from '../../../../../packages/payload/src/admin/components/utilities/Config'
|
||||||
import Meta from '../../../../../src/admin/components/utilities/Meta'
|
import Meta from '../../../../../packages/payload/src/admin/components/utilities/Meta'
|
||||||
|
|
||||||
// In your projects, you can import as follows:
|
// In your projects, you can import as follows:
|
||||||
// import { DefaultTemplate } from 'payload/components/templates';
|
// import { DefaultTemplate } from 'payload/components/templates';
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import Button from '../../../../../src/admin/components/elements/Button'
|
import Button from '../../../../../packages/payload/src/admin/components/elements/Button'
|
||||||
// As this is the demo project, we import our dependencies from the `src` directory.
|
// As this is the demo project, we import our dependencies from the `src` directory.
|
||||||
import MinimalTemplate from '../../../../../src/admin/components/templates/Minimal'
|
import MinimalTemplate from '../../../../../packages/payload/src/admin/components/templates/Minimal'
|
||||||
import { useConfig } from '../../../../../src/admin/components/utilities/Config'
|
import { useConfig } from '../../../../../packages/payload/src/admin/components/utilities/Config'
|
||||||
|
|
||||||
// In your projects, you can import as follows:
|
// In your projects, you can import as follows:
|
||||||
// import { MinimalTemplate } from 'payload/components/templates';
|
// import { MinimalTemplate } from 'payload/components/templates';
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
import { mapAsync } from '../../src/utilities/mapAsync'
|
import { mapAsync } from '../../packages/payload/src/utilities/mapAsync'
|
||||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||||
import { devUser } from '../credentials'
|
import { devUser } from '../credentials'
|
||||||
import AfterDashboard from './components/AfterDashboard'
|
import AfterDashboard from './components/AfterDashboard'
|
||||||
@@ -5,9 +5,9 @@ import qs from 'qs'
|
|||||||
|
|
||||||
import type { Post } from './config'
|
import type { Post } from './config'
|
||||||
|
|
||||||
import payload from '../../src'
|
import payload from '../../packages/payload/src'
|
||||||
import { mapAsync } from '../../src/utilities/mapAsync'
|
import { mapAsync } from '../../packages/payload/src/utilities/mapAsync'
|
||||||
import wait from '../../src/utilities/wait'
|
import wait from '../../packages/payload/src/utilities/wait'
|
||||||
import { saveDocAndAssert, saveDocHotkeyAndAssert } from '../helpers'
|
import { saveDocAndAssert, saveDocHotkeyAndAssert } from '../helpers'
|
||||||
import { AdminUrlUtil } from '../helpers/adminUrlUtil'
|
import { AdminUrlUtil } from '../helpers/adminUrlUtil'
|
||||||
import { initPayloadE2E } from '../helpers/configHelpers'
|
import { initPayloadE2E } from '../helpers/configHelpers'
|
||||||
@@ -427,8 +427,7 @@ describe('admin', () => {
|
|||||||
test('should accept where query from complex, valid URL where parameter using the near operator', async () => {
|
test('should accept where query from complex, valid URL where parameter using the near operator', async () => {
|
||||||
// We have one point collection with the point [5,-5] and one with [7,-7]. This where query should kick out the [5,-5] point
|
// We have one point collection with the point [5,-5] and one with [7,-7]. This where query should kick out the [5,-5] point
|
||||||
await page.goto(
|
await page.goto(
|
||||||
`${
|
`${new AdminUrlUtil(serverURL, 'geo').list
|
||||||
new AdminUrlUtil(serverURL, 'geo').list
|
|
||||||
}?limit=10&page=1&where[or][0][and][0][point][near]=6,-7,200000`,
|
}?limit=10&page=1&where[or][0][and][0][point][near]=6,-7,200000`,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -439,8 +438,7 @@ describe('admin', () => {
|
|||||||
test('should accept transformed where query from complex, invalid URL where parameter using the near operator', async () => {
|
test('should accept transformed where query from complex, invalid URL where parameter using the near operator', async () => {
|
||||||
// We have one point collection with the point [5,-5] and one with [7,-7]. This where query should kick out the [5,-5] point
|
// We have one point collection with the point [5,-5] and one with [7,-7]. This where query should kick out the [5,-5] point
|
||||||
await page.goto(
|
await page.goto(
|
||||||
`${
|
`${new AdminUrlUtil(serverURL, 'geo').list
|
||||||
new AdminUrlUtil(serverURL, 'geo').list
|
|
||||||
}?limit=10&page=1&where[point][near]=6,-7,200000`,
|
}?limit=10&page=1&where[point][near]=6,-7,200000`,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
@@ -1,4 +1,4 @@
|
|||||||
import payload from '../../src'
|
import payload from '../../packages/payload/src'
|
||||||
import { initPayloadTest } from '../helpers/configHelpers'
|
import { initPayloadTest } from '../helpers/configHelpers'
|
||||||
import configPromise from './config'
|
import configPromise from './config'
|
||||||
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
import type { User } from '../../src/auth'
|
import type { User } from '../../packages/payload/src/auth'
|
||||||
import type { UIField } from '../../src/fields/config/types'
|
import type { UIField } from '../../packages/payload/src/fields/config/types'
|
||||||
|
|
||||||
import { useAuth } from '../../src/admin/components/utilities/Auth'
|
import { useAuth } from '../../packages/payload/src/admin/components/utilities/Auth'
|
||||||
|
|
||||||
export const AuthDebug: React.FC<UIField> = () => {
|
export const AuthDebug: React.FC<UIField> = () => {
|
||||||
const [state, setState] = useState<User | null | undefined>()
|
const [state, setState] = useState<User | null | undefined>()
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
import { mapAsync } from '../../src/utilities/mapAsync'
|
import { mapAsync } from '../../packages/payload/src/utilities/mapAsync'
|
||||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||||
import { devUser } from '../credentials'
|
import { devUser } from '../credentials'
|
||||||
import { AuthDebug } from './AuthDebug'
|
import { AuthDebug } from './AuthDebug'
|
||||||
@@ -2,7 +2,7 @@ import type { Request } from 'express'
|
|||||||
|
|
||||||
import { Strategy } from 'passport-strategy'
|
import { Strategy } from 'passport-strategy'
|
||||||
|
|
||||||
import type { Payload } from '../../../src/payload'
|
import type { Payload } from '../../../packages/payload/src/payload'
|
||||||
|
|
||||||
import { buildConfigWithDefaults } from '../../buildConfigWithDefaults'
|
import { buildConfigWithDefaults } from '../../buildConfigWithDefaults'
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import payload from '../../../src'
|
import payload from '../../../packages/payload/src'
|
||||||
import { initPayloadTest } from '../../helpers/configHelpers'
|
import { initPayloadTest } from '../../helpers/configHelpers'
|
||||||
import { slug } from './config'
|
import { slug } from './config'
|
||||||
|
|
||||||
@@ -2,9 +2,9 @@ import { GraphQLClient } from 'graphql-request'
|
|||||||
import jwtDecode from 'jwt-decode'
|
import jwtDecode from 'jwt-decode'
|
||||||
import mongoose from 'mongoose'
|
import mongoose from 'mongoose'
|
||||||
|
|
||||||
import type { User } from '../../src/auth'
|
import type { User } from '../../packages/payload/src/auth'
|
||||||
|
|
||||||
import payload from '../../src'
|
import payload from '../../packages/payload/src'
|
||||||
import configPromise from '../collections-graphql/config'
|
import configPromise from '../collections-graphql/config'
|
||||||
import { devUser } from '../credentials'
|
import { devUser } from '../credentials'
|
||||||
import { initPayloadTest } from '../helpers/configHelpers'
|
import { initPayloadTest } from '../helpers/configHelpers'
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import mongoose from 'mongoose'
|
import mongoose from 'mongoose'
|
||||||
|
|
||||||
import payload from '../../../src'
|
import payload from '../../../packages/payload/src'
|
||||||
import { devUser } from '../../credentials'
|
import { devUser } from '../../credentials'
|
||||||
import { initPayloadTest } from '../../helpers/configHelpers'
|
import { initPayloadTest } from '../../helpers/configHelpers'
|
||||||
import { RESTClient } from '../../helpers/rest'
|
import { RESTClient } from '../../helpers/rest'
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
import type { User } from '../../../src/auth'
|
import type { User } from '../../../packages/payload/src/auth'
|
||||||
import type { UIField } from '../../../src/fields/config/types'
|
import type { UIField } from '../../../packages/payload/src/fields/config/types'
|
||||||
|
|
||||||
import { useAuth } from '../../../src/admin/components/utilities/Auth'
|
import { useAuth } from '../../../packages/payload/src/admin/components/utilities/Auth'
|
||||||
|
|
||||||
export const AuthDebug: React.FC<UIField> = () => {
|
export const AuthDebug: React.FC<UIField> = () => {
|
||||||
const [state, setState] = useState<User | null | undefined>()
|
const [state, setState] = useState<User | null | undefined>()
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
import type { Config, SanitizedConfig } from '../src/config/types'
|
import type { Config, SanitizedConfig } from '../packages/payload/src/config/types'
|
||||||
|
|
||||||
import { mongooseAdapter } from '../../db-mongodb/src/index'
|
import { mongooseAdapter } from '../packages/db-mongodb/src/index'
|
||||||
import { postgresAdapter } from '../../db-postgres/src/index'
|
import { postgresAdapter } from '../packages/db-postgres/src/index'
|
||||||
import { buildConfig as buildPayloadConfig } from '../src/config/build'
|
import { buildConfig as buildPayloadConfig } from '../packages/payload/src/config/build'
|
||||||
|
|
||||||
const databaseAdapters = {
|
const databaseAdapters = {
|
||||||
mongoose: mongooseAdapter({
|
mongoose: mongooseAdapter({
|
||||||
@@ -35,9 +35,9 @@ export function buildConfigWithDefaults(testConfig?: Partial<Config>): Promise<S
|
|||||||
process.env.PAYLOAD_PUBLIC_DISABLE_AUTO_LOGIN === 'true'
|
process.env.PAYLOAD_PUBLIC_DISABLE_AUTO_LOGIN === 'true'
|
||||||
? false
|
? false
|
||||||
: {
|
: {
|
||||||
email: 'dev@payloadcms.com',
|
email: 'dev@payloadcms.com',
|
||||||
password: 'test',
|
password: 'test',
|
||||||
},
|
},
|
||||||
...(config.admin || {}),
|
...(config.admin || {}),
|
||||||
webpack: (webpackConfig) => {
|
webpack: (webpackConfig) => {
|
||||||
const existingConfig =
|
const existingConfig =
|
||||||
@@ -52,21 +52,21 @@ export function buildConfigWithDefaults(testConfig?: Partial<Config>): Promise<S
|
|||||||
...existingConfig.resolve,
|
...existingConfig.resolve,
|
||||||
alias: {
|
alias: {
|
||||||
...existingConfig.resolve?.alias,
|
...existingConfig.resolve?.alias,
|
||||||
[path.resolve(__dirname, '../../db-postgres/src/index')]: path.resolve(
|
[path.resolve(__dirname, '../packages/db-postgres/src/index')]: path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../db-postgres/src/mock',
|
'../packages/db-postgres/src/mock',
|
||||||
),
|
),
|
||||||
[path.resolve(__dirname, '../../db-mongodb/src/index')]: path.resolve(
|
[path.resolve(__dirname, '../packages/db-mongodb/src/index')]: path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../db-mongodb/src/mock',
|
'../packages/db-mongodb/src/mock',
|
||||||
),
|
),
|
||||||
'@payloadcms/db-mongodb': path.resolve(
|
'@payloadcms/db-mongodb': path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../../packages/db-mongodb/src/mock',
|
'../packages/db-mongodb/src/mock',
|
||||||
),
|
),
|
||||||
'@payloadcms/db-postgres': path.resolve(
|
'@payloadcms/db-postgres': path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../../packages/db-postgres/src/mock',
|
'../packages/db-postgres/src/mock',
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
import type { CollectionConfig } from '../../src/collections/config/types'
|
import type { CollectionConfig } from '../../packages/payload/src/collections/config/types'
|
||||||
|
|
||||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||||
import { devUser } from '../credentials'
|
import { devUser } from '../credentials'
|
||||||
@@ -2,8 +2,8 @@ import { GraphQLClient } from 'graphql-request'
|
|||||||
|
|
||||||
import type { Post } from './payload-types'
|
import type { Post } from './payload-types'
|
||||||
|
|
||||||
import payload from '../../src'
|
import payload from '../../packages/payload/src'
|
||||||
import { mapAsync } from '../../src/utilities/mapAsync'
|
import { mapAsync } from '../../packages/payload/src/utilities/mapAsync'
|
||||||
import { initPayloadTest } from '../helpers/configHelpers'
|
import { initPayloadTest } from '../helpers/configHelpers'
|
||||||
import configPromise, { pointSlug, slug } from './config'
|
import configPromise, { pointSlug, slug } from './config'
|
||||||
|
|
||||||
@@ -477,7 +477,7 @@ describe('collections-graphql', () => {
|
|||||||
docs.forEach(({ point: coordinates }) => {
|
docs.forEach(({ point: coordinates }) => {
|
||||||
// The next document point should always be greater than the one before
|
// The next document point should always be greater than the one before
|
||||||
expect(previous).toBeLessThanOrEqual(coordinates[0])
|
expect(previous).toBeLessThanOrEqual(coordinates[0])
|
||||||
;[previous] = coordinates
|
;[previous] = coordinates
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { CollectionConfig } from '../../src/collections/config/types'
|
import type { CollectionConfig } from '../../packages/payload/src/collections/config/types'
|
||||||
|
|
||||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||||
import { devUser } from '../credentials'
|
import { devUser } from '../credentials'
|
||||||
@@ -4,8 +4,8 @@ import mongoose from 'mongoose'
|
|||||||
import type { Relation } from './config'
|
import type { Relation } from './config'
|
||||||
import type { ErrorOnHook, Post } from './payload-types'
|
import type { ErrorOnHook, Post } from './payload-types'
|
||||||
|
|
||||||
import payload from '../../src'
|
import payload from '../../packages/payload/src'
|
||||||
import { mapAsync } from '../../src/utilities/mapAsync'
|
import { mapAsync } from '../../packages/payload/src/utilities/mapAsync'
|
||||||
import { initPayloadTest } from '../helpers/configHelpers'
|
import { initPayloadTest } from '../helpers/configHelpers'
|
||||||
import { RESTClient } from '../helpers/rest'
|
import { RESTClient } from '../helpers/rest'
|
||||||
import config, {
|
import config, {
|
||||||
@@ -430,18 +430,18 @@ describe('collections-rest', () => {
|
|||||||
const nameToQuery2 = 'name2'
|
const nameToQuery2 = 'name2'
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
;({ doc: relation } = await client.create<Relation>({
|
; ({ doc: relation } = await client.create<Relation>({
|
||||||
slug: relationSlug,
|
slug: relationSlug,
|
||||||
data: {
|
data: {
|
||||||
name: nameToQuery,
|
name: nameToQuery,
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
;({ doc: relation2 } = await client.create<Relation>({
|
; ({ doc: relation2 } = await client.create<Relation>({
|
||||||
slug: relationSlug,
|
slug: relationSlug,
|
||||||
data: {
|
data: {
|
||||||
name: nameToQuery2,
|
name: nameToQuery2,
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
post = await createPost({
|
post = await createPost({
|
||||||
relationField: relation.id,
|
relationField: relation.id,
|
||||||
@@ -909,7 +909,7 @@ describe('collections-rest', () => {
|
|||||||
docs.forEach(({ point: coordinates }) => {
|
docs.forEach(({ point: coordinates }) => {
|
||||||
// the next document point should always be greater than the one before
|
// the next document point should always be greater than the one before
|
||||||
expect(previous).toBeLessThanOrEqual(coordinates[0])
|
expect(previous).toBeLessThanOrEqual(coordinates[0])
|
||||||
;[previous] = coordinates
|
;[previous] = coordinates
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Config } from '../../src/config/types'
|
import type { Config } from '../../packages/payload/src/config/types'
|
||||||
|
|
||||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||||
import { openAccess } from '../helpers/configHelpers'
|
import { openAccess } from '../helpers/configHelpers'
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import payload from '../../src'
|
import payload from '../../packages/payload/src'
|
||||||
import { initPayloadTest } from '../helpers/configHelpers'
|
import { initPayloadTest } from '../helpers/configHelpers'
|
||||||
|
|
||||||
require('isomorphic-fetch')
|
require('isomorphic-fetch')
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { GraphQLClient } from 'graphql-request'
|
import { GraphQLClient } from 'graphql-request'
|
||||||
|
|
||||||
import payload from '../../src'
|
import payload from '../../packages/payload/src'
|
||||||
import { devUser } from '../credentials'
|
import { devUser } from '../credentials'
|
||||||
import { initPayloadTest } from '../helpers/configHelpers'
|
import { initPayloadTest } from '../helpers/configHelpers'
|
||||||
import { postDoc } from './config'
|
import { postDoc } from './config'
|
||||||
@@ -4,7 +4,7 @@ import fs from 'fs'
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
import payload from '../src'
|
import payload from '../packages/payload/src'
|
||||||
|
|
||||||
dotenv.config()
|
dotenv.config()
|
||||||
|
|
||||||
@@ -2,8 +2,8 @@ import type { Response } from 'express'
|
|||||||
|
|
||||||
import express from 'express'
|
import express from 'express'
|
||||||
|
|
||||||
import type { Config } from '../../src/config/types'
|
import type { Config } from '../../packages/payload/src/config/types'
|
||||||
import type { PayloadRequest } from '../../src/express/types'
|
import type { PayloadRequest } from '../../packages/payload/src/express/types'
|
||||||
|
|
||||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||||
import { devUser } from '../credentials'
|
import { devUser } from '../credentials'
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { CollectionConfig } from '../../../../src/collections/config/types'
|
import type { CollectionConfig } from '../../../../packages/payload/src/collections/config/types'
|
||||||
import type { Field } from '../../../../src/fields/config/types'
|
import type { Field } from '../../../../packages/payload/src/fields/config/types'
|
||||||
|
|
||||||
export const errorFieldsSlug = 'error-fields'
|
export const errorFieldsSlug = 'error-fields'
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
import type { CollectionConfig } from '../../../../src/collections/config/types'
|
import type { CollectionConfig } from '../../../../packages/payload/src/collections/config/types'
|
||||||
|
|
||||||
const Uploads: CollectionConfig = {
|
const Uploads: CollectionConfig = {
|
||||||
slug: 'uploads',
|
slug: 'uploads',
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
import useField from '../../../src/admin/components/forms/useField'
|
import useField from '../../../packages/payload/src/admin/components/forms/useField'
|
||||||
import { collection1Slug } from '../collectionSlugs'
|
import { collection1Slug } from '../collectionSlugs'
|
||||||
|
|
||||||
export const PrePopulateFieldUI: React.FC<{
|
export const PrePopulateFieldUI: React.FC<{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { CollectionConfig } from '../../src/collections/config/types'
|
import type { CollectionConfig } from '../../packages/payload/src/collections/config/types'
|
||||||
import type { FilterOptionsProps } from '../../src/fields/config/types'
|
import type { FilterOptionsProps } from '../../packages/payload/src/fields/config/types'
|
||||||
|
|
||||||
import { mapAsync } from '../../src/utilities/mapAsync'
|
import { mapAsync } from '../../packages/payload/src/utilities/mapAsync'
|
||||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||||
import { devUser } from '../credentials'
|
import { devUser } from '../credentials'
|
||||||
import { PrePopulateFieldUI } from './PrePopulateFieldUI'
|
import { PrePopulateFieldUI } from './PrePopulateFieldUI'
|
||||||
@@ -381,19 +381,19 @@ export default buildConfigWithDefaults({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
;[...Array(15)].forEach((_, i) => {
|
;[...Array(15)].forEach((_, i) => {
|
||||||
payload.create({
|
payload.create({
|
||||||
collection: collection1Slug,
|
collection: collection1Slug,
|
||||||
data: {
|
data: {
|
||||||
name: `relationship-test ${i}`,
|
name: `relationship-test ${i}`,
|
||||||
},
|
},
|
||||||
|
})
|
||||||
|
payload.create({
|
||||||
|
collection: collection2Slug,
|
||||||
|
data: {
|
||||||
|
name: `relationship-test ${i}`,
|
||||||
|
},
|
||||||
|
})
|
||||||
})
|
})
|
||||||
payload.create({
|
|
||||||
collection: collection2Slug,
|
|
||||||
data: {
|
|
||||||
name: `relationship-test ${i}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -10,9 +10,9 @@ import type {
|
|||||||
RelationWithTitle,
|
RelationWithTitle,
|
||||||
} from './config'
|
} from './config'
|
||||||
|
|
||||||
import payload from '../../src'
|
import payload from '../../packages/payload/src'
|
||||||
import { mapAsync } from '../../src/utilities/mapAsync'
|
import { mapAsync } from '../../packages/payload/src/utilities/mapAsync'
|
||||||
import wait from '../../src/utilities/wait'
|
import wait from '../../packages/payload/src/utilities/wait'
|
||||||
import { saveDocAndAssert } from '../helpers'
|
import { saveDocAndAssert } from '../helpers'
|
||||||
import { AdminUrlUtil } from '../helpers/adminUrlUtil'
|
import { AdminUrlUtil } from '../helpers/adminUrlUtil'
|
||||||
import { initPayloadE2E } from '../helpers/configHelpers'
|
import { initPayloadE2E } from '../helpers/configHelpers'
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { RowLabelComponent } from '../../../../src/admin/components/forms/RowLabel/types'
|
import type { RowLabelComponent } from '../../../../packages/payload/src/admin/components/forms/RowLabel/types'
|
||||||
|
|
||||||
export const ArrayRowLabel: RowLabelComponent = ({ data }) => {
|
export const ArrayRowLabel: RowLabelComponent = ({ data }) => {
|
||||||
return (
|
return (
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
import { useForm } from '../../../../../../src/admin/components/forms/Form/context'
|
import { useForm } from '../../../../../../packages/payload/src/admin/components/forms/Form/context'
|
||||||
import useField from '../../../../../../src/admin/components/forms/useField'
|
import useField from '../../../../../../packages/payload/src/admin/components/forms/useField'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
||||||
const baseClass = 'custom-blocks-field-management'
|
const baseClass = 'custom-blocks-field-management'
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { CollectionConfig } from '../../../../src/collections/config/types'
|
import type { CollectionConfig } from '../../../../packages/payload/src/collections/config/types'
|
||||||
|
|
||||||
import { ArrayRowLabel } from './LabelComponent'
|
import { ArrayRowLabel } from './LabelComponent'
|
||||||
import { AddCustomBlocks } from './components/AddCustomBlocks'
|
import { AddCustomBlocks } from './components/AddCustomBlocks'
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { CollectionConfig } from '../../../../src/collections/config/types'
|
import type { CollectionConfig } from '../../../../packages/payload/src/collections/config/types'
|
||||||
import type { Field } from '../../../../src/fields/config/types'
|
import type { Field } from '../../../../packages/payload/src/fields/config/types'
|
||||||
|
|
||||||
export const blocksFieldSeedData = [
|
export const blocksFieldSeedData = [
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { CollectionConfig } from '../../../../src/collections/config/types'
|
import type { CollectionConfig } from '../../../../packages/payload/src/collections/config/types'
|
||||||
import type { CodeField } from '../../payload-types'
|
import type { CodeField } from '../../payload-types'
|
||||||
|
|
||||||
const Code: CollectionConfig = {
|
const Code: CollectionConfig = {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { RowLabelComponent } from '../../../../src/admin/components/forms/RowLabel/types'
|
import type { RowLabelComponent } from '../../../../packages/payload/src/admin/components/forms/RowLabel/types'
|
||||||
|
|
||||||
export const CollapsibleLabelComponent: RowLabelComponent = ({ data }) => {
|
export const CollapsibleLabelComponent: RowLabelComponent = ({ data }) => {
|
||||||
return (
|
return (
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user