chore: progress to removing barrel file reliance
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
"clean:cache": "rimraf node_modules/.cache && rimraf packages/payload/node_modules/.cache && rimraf .next",
|
"clean:cache": "rimraf node_modules/.cache && rimraf packages/payload/node_modules/.cache && rimraf .next",
|
||||||
"clean:build": "find . \\( -type d \\( -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -not -path '*/node_modules/*' -exec rm -rf {} +",
|
"clean:build": "find . \\( -type d \\( -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -not -path '*/node_modules/*' -exec rm -rf {} +",
|
||||||
"clean:all": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +",
|
"clean:all": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +",
|
||||||
"dev": "cross-env NODE_OPTIONS=--no-deprecation tsx ./test/dev.ts",
|
"dev": "cross-env NODE_OPTIONS=--no-deprecation node ./test/dev.js",
|
||||||
"devsafe": "rimraf .next && pnpm dev",
|
"devsafe": "rimraf .next && pnpm dev",
|
||||||
"dev:generate-graphql-schema": "cross-env NODE_OPTIONS=--no-deprecation tsx ./test/generateGraphQLSchema.ts",
|
"dev:generate-graphql-schema": "cross-env NODE_OPTIONS=--no-deprecation tsx ./test/generateGraphQLSchema.ts",
|
||||||
"dev:generate-types": "cross-env NODE_OPTIONS=--no-deprecation tsx ./test/generateTypes.ts",
|
"dev:generate-types": "cross-env NODE_OPTIONS=--no-deprecation tsx ./test/generateTypes.ts",
|
||||||
|
|||||||
8
packages/live-preview/src/handleMessage.d.ts
vendored
Normal file
8
packages/live-preview/src/handleMessage.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export declare const handleMessage: <T>(args: {
|
||||||
|
apiRoute?: string
|
||||||
|
depth?: number
|
||||||
|
event: MessageEvent
|
||||||
|
initialData: T
|
||||||
|
serverURL: string
|
||||||
|
}) => Promise<T>
|
||||||
|
//# sourceMappingURL=handleMessage.d.ts.map
|
||||||
1
packages/live-preview/src/handleMessage.d.ts.map
Normal file
1
packages/live-preview/src/handleMessage.d.ts.map
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"handleMessage.d.ts","sourceRoot":"","sources":["handleMessage.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa;eACb,MAAM;YACT,MAAM;WACP,YAAY;;eAER,MAAM;gBAyClB,CAAA"}
|
||||||
6
packages/live-preview/src/index.d.ts
vendored
Normal file
6
packages/live-preview/src/index.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export { handleMessage } from './handleMessage.js'
|
||||||
|
export { mergeData } from './mergeData.js'
|
||||||
|
export { ready } from './ready.js'
|
||||||
|
export { subscribe } from './subscribe.js'
|
||||||
|
export { unsubscribe } from './unsubscribe.js'
|
||||||
|
//# sourceMappingURL=index.d.ts.map
|
||||||
1
packages/live-preview/src/index.d.ts.map
Normal file
1
packages/live-preview/src/index.d.ts.map
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA"}
|
||||||
26
packages/live-preview/src/mergeData.d.ts
vendored
Normal file
26
packages/live-preview/src/mergeData.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import type { fieldSchemaToJSON } from 'payload/utilities'
|
||||||
|
import type { UpdatedDocument } from './types.js'
|
||||||
|
export declare const mergeData: <T>(args: {
|
||||||
|
apiRoute?: string
|
||||||
|
collectionPopulationRequestHandler?: ({
|
||||||
|
apiPath,
|
||||||
|
endpoint,
|
||||||
|
serverURL,
|
||||||
|
}: {
|
||||||
|
apiPath: string
|
||||||
|
endpoint: string
|
||||||
|
serverURL: string
|
||||||
|
}) => Promise<Response>
|
||||||
|
depth?: number
|
||||||
|
externallyUpdatedRelationship?: UpdatedDocument
|
||||||
|
fieldSchema: ReturnType<typeof fieldSchemaToJSON>
|
||||||
|
incomingData: Partial<T>
|
||||||
|
initialData: T
|
||||||
|
returnNumberOfRequests?: boolean
|
||||||
|
serverURL: string
|
||||||
|
}) => Promise<
|
||||||
|
T & {
|
||||||
|
_numberOfRequests?: number
|
||||||
|
}
|
||||||
|
>
|
||||||
|
//# sourceMappingURL=mergeData.d.ts.map
|
||||||
1
packages/live-preview/src/mergeData.d.ts.map
Normal file
1
packages/live-preview/src/mergeData.d.ts.map
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"mergeData.d.ts","sourceRoot":"","sources":["mergeData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,OAAO,KAAK,EAA2B,eAAe,EAAE,MAAM,YAAY,CAAA;AAc1E,eAAO,MAAM,SAAS;eACT,MAAM;;iBAMN,MAAM;kBACL,MAAM;mBACL,MAAM;UACb,QAAQ,QAAQ,CAAC;YACf,MAAM;oCACkB,eAAe;iBAClC,WAAW,wBAAwB,CAAC;;;6BAGxB,OAAO;eACrB,MAAM;;wBAGK,MAAM;EA6D7B,CAAA"}
|
||||||
8
packages/live-preview/src/subscribe.d.ts
vendored
Normal file
8
packages/live-preview/src/subscribe.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export declare const subscribe: <T>(args: {
|
||||||
|
apiRoute?: string
|
||||||
|
callback: (data: T) => void
|
||||||
|
depth?: number
|
||||||
|
initialData: T
|
||||||
|
serverURL: string
|
||||||
|
}) => (event: MessageEvent) => void
|
||||||
|
//# sourceMappingURL=subscribe.d.ts.map
|
||||||
1
packages/live-preview/src/subscribe.d.ts.map
Normal file
1
packages/live-preview/src/subscribe.d.ts.map
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"subscribe.d.ts","sourceRoot":"","sources":["subscribe.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;eACT,MAAM;2BACM,IAAI;YACnB,MAAM;;eAEH,MAAM;cACN,YAAY,KAAK,IAa7B,CAAA"}
|
||||||
10
packages/live-preview/src/traverseFields.d.ts
vendored
Normal file
10
packages/live-preview/src/traverseFields.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import type { fieldSchemaToJSON } from 'payload/utilities'
|
||||||
|
import type { PopulationsByCollection, UpdatedDocument } from './types.js'
|
||||||
|
export declare const traverseFields: <T>(args: {
|
||||||
|
externallyUpdatedRelationship?: UpdatedDocument
|
||||||
|
fieldSchema: ReturnType<typeof fieldSchemaToJSON>
|
||||||
|
incomingData: T
|
||||||
|
populationsByCollection: PopulationsByCollection
|
||||||
|
result: T
|
||||||
|
}) => void
|
||||||
|
//# sourceMappingURL=traverseFields.d.ts.map
|
||||||
1
packages/live-preview/src/traverseFields.d.ts.map
Normal file
1
packages/live-preview/src/traverseFields.d.ts.map
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["traverseFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAI1E,eAAO,MAAM,cAAc;oCACO,eAAe;iBAClC,WAAW,wBAAwB,CAAC;;6BAExB,uBAAuB;;MAE9C,IA4QH,CAAA"}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { Modal, useModal } from '@payloadcms/ui'
|
import { Button, Modal } from '@payloadcms/ui/elements'
|
||||||
import { Button } from '@payloadcms/ui/elements'
|
|
||||||
import { useFormModified } from '@payloadcms/ui/forms'
|
import { useFormModified } from '@payloadcms/ui/forms'
|
||||||
|
import { useModal } from '@payloadcms/ui/hooks'
|
||||||
import { useAuth } from '@payloadcms/ui/providers'
|
import { useAuth } from '@payloadcms/ui/providers'
|
||||||
import { useTranslation } from '@payloadcms/ui/providers'
|
import { useTranslation } from '@payloadcms/ui/providers'
|
||||||
import React, { useCallback, useEffect } from 'react'
|
import React, { useCallback, useEffect } from 'react'
|
||||||
|
|||||||
1
packages/next/src/exports/utilities.ts
Normal file
1
packages/next/src/exports/utilities.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { getPayloadHMR } from '../utilities/getPayloadHMR.js'
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import type { SanitizedConfig } from 'payload/types'
|
import type { SanitizedConfig } from 'payload/types'
|
||||||
|
|
||||||
import { translations } from '@payloadcms/translations/client'
|
import { translations } from '@payloadcms/translations/client'
|
||||||
import { RootProvider, buildComponentMap } from '@payloadcms/ui'
|
import { RootProvider } from '@payloadcms/ui/providers'
|
||||||
import '@payloadcms/ui/scss/app.scss'
|
import '@payloadcms/ui/scss/app.scss'
|
||||||
|
import { buildComponentMap } from '@payloadcms/ui/utilities'
|
||||||
import { headers as getHeaders, cookies as nextCookies } from 'next/headers.js'
|
import { headers as getHeaders, cookies as nextCookies } from 'next/headers.js'
|
||||||
import { parseCookies } from 'payload/auth'
|
import { parseCookies } from 'payload/auth'
|
||||||
import { createClientConfig } from 'payload/config'
|
import { createClientConfig } from 'payload/config'
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import type { BuildFormStateArgs, FieldSchemaMap } from '@payloadcms/ui'
|
import type { BuildFormStateArgs } from '@payloadcms/ui/form-utilities'
|
||||||
|
import type { FieldSchemaMap } from '@payloadcms/ui/utilities'
|
||||||
import type { Field, PayloadRequest, SanitizedConfig } from 'payload/types'
|
import type { Field, PayloadRequest, SanitizedConfig } from 'payload/types'
|
||||||
|
|
||||||
import { buildFieldSchemaMap, buildStateFromSchema, reduceFieldsToValues } from '@payloadcms/ui'
|
import { buildStateFromSchema, reduceFieldsToValues } from '@payloadcms/ui/form-utilities'
|
||||||
|
import { buildFieldSchemaMap } from '@payloadcms/ui/utilities'
|
||||||
import httpStatus from 'http-status'
|
import httpStatus from 'http-status'
|
||||||
|
|
||||||
let cached = global._payload_fieldSchemaMap
|
let cached = global._payload_fieldSchemaMap
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import type {
|
|||||||
|
|
||||||
import { initI18n } from '@payloadcms/translations'
|
import { initI18n } from '@payloadcms/translations'
|
||||||
import { translations } from '@payloadcms/translations/client'
|
import { translations } from '@payloadcms/translations/client'
|
||||||
import { findLocaleFromCode } from '@payloadcms/ui'
|
import { findLocaleFromCode } from '@payloadcms/ui/utilities'
|
||||||
import { headers as getHeaders } from 'next/headers.js'
|
import { headers as getHeaders } from 'next/headers.js'
|
||||||
import { notFound, redirect } from 'next/navigation.js'
|
import { notFound, redirect } from 'next/navigation.js'
|
||||||
import { createLocalReq } from 'payload/utilities'
|
import { createLocalReq } from 'payload/utilities'
|
||||||
|
|||||||
@@ -1,20 +1,15 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
|
import { CopyToClipboard, Gutter, SetViewActions } from '@payloadcms/ui/elements'
|
||||||
|
import { Checkbox, Form, Number as NumberInput, Select } from '@payloadcms/ui/forms'
|
||||||
|
import { MinimizeMaximize } from '@payloadcms/ui/icons'
|
||||||
import {
|
import {
|
||||||
Checkbox,
|
|
||||||
CopyToClipboard,
|
|
||||||
Form,
|
|
||||||
Gutter,
|
|
||||||
MinimizeMaximize,
|
|
||||||
Number as NumberInput,
|
|
||||||
Select,
|
|
||||||
SetViewActions,
|
|
||||||
useComponentMap,
|
useComponentMap,
|
||||||
useConfig,
|
useConfig,
|
||||||
useDocumentInfo,
|
useDocumentInfo,
|
||||||
useLocale,
|
useLocale,
|
||||||
useTranslation,
|
useTranslation,
|
||||||
} from '@payloadcms/ui'
|
} from '@payloadcms/ui/providers'
|
||||||
import { useSearchParams } from 'next/navigation.js'
|
import { useSearchParams } from 'next/navigation.js'
|
||||||
import qs from 'qs'
|
import qs from 'qs'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { Label, ReactSelect } from '@payloadcms/ui'
|
import { ReactSelect } from '@payloadcms/ui/elements'
|
||||||
|
import { Label } from '@payloadcms/ui/forms'
|
||||||
import { useTranslation } from '@payloadcms/ui/providers'
|
import { useTranslation } from '@payloadcms/ui/providers'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { OnChange, Theme } from '@payloadcms/ui'
|
import type { OnChange } from '@payloadcms/ui/forms'
|
||||||
|
import type { Theme } from '@payloadcms/ui/providers'
|
||||||
|
|
||||||
import { RadioGroupInput, useTheme, useTranslation } from '@payloadcms/ui'
|
import { RadioGroupInput } from '@payloadcms/ui/forms'
|
||||||
|
import { useTheme, useTranslation } from '@payloadcms/ui/providers'
|
||||||
import React, { useCallback } from 'react'
|
import React, { useCallback } from 'react'
|
||||||
|
|
||||||
export const ToggleTheme: React.FC = () => {
|
export const ToggleTheme: React.FC = () => {
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
import type { DocumentPreferences, ServerSideEditViewProps, TypeWithID } from 'payload/types'
|
import type { DocumentPreferences, ServerSideEditViewProps, TypeWithID } from 'payload/types'
|
||||||
import type { AdminViewProps } from 'payload/types'
|
import type { AdminViewProps } from 'payload/types'
|
||||||
|
|
||||||
import {
|
import { DocumentHeader, HydrateClientUser, RenderCustomComponent } from '@payloadcms/ui/elements'
|
||||||
DocumentHeader,
|
import { buildStateFromSchema } from '@payloadcms/ui/form-utilities'
|
||||||
DocumentInfoProvider,
|
import { DocumentInfoProvider, FormQueryParamsProvider } from '@payloadcms/ui/providers'
|
||||||
FormQueryParamsProvider,
|
import { formatDocTitle, formatFields } from '@payloadcms/ui/utilities'
|
||||||
HydrateClientUser,
|
|
||||||
RenderCustomComponent,
|
|
||||||
buildStateFromSchema,
|
|
||||||
formatDocTitle,
|
|
||||||
formatFields,
|
|
||||||
} from '@payloadcms/ui'
|
|
||||||
import { notFound } from 'next/navigation.js'
|
import { notFound } from 'next/navigation.js'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
|
|||||||
2
packages/payload/uploads.d.ts
vendored
Normal file
2
packages/payload/uploads.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export { default as getFileByPath } from './dist/uploads/getFileByPath.js'
|
||||||
|
//# sourceMappingURL=uploads.d.ts.map
|
||||||
3
packages/payload/uploads.js
Normal file
3
packages/payload/uploads.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export { default as getFileByPath } from './dist/uploads/getFileByPath.js'
|
||||||
|
|
||||||
|
//# sourceMappingURL=uploads.js.map
|
||||||
3
packages/ui/src/exports/form-utilities.ts
Normal file
3
packages/ui/src/exports/form-utilities.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export { default as reduceFieldsToValues } from '../forms/Form/reduceFieldsToValues.js'
|
||||||
|
export { buildStateFromSchema } from '../forms/buildStateFromSchema/index.js'
|
||||||
|
export type { BuildFormStateArgs } from '../forms/buildStateFromSchema/index.js'
|
||||||
@@ -14,15 +14,13 @@ export {
|
|||||||
export { useFormModified } from '../forms/Form/context.js'
|
export { useFormModified } from '../forms/Form/context.js'
|
||||||
export { createNestedFieldPath } from '../forms/Form/createNestedFieldPath.js'
|
export { createNestedFieldPath } from '../forms/Form/createNestedFieldPath.js'
|
||||||
export { default as Form } from '../forms/Form/index.js'
|
export { default as Form } from '../forms/Form/index.js'
|
||||||
export { default as reduceFieldsToValues } from '../forms/Form/reduceFieldsToValues.js'
|
|
||||||
export type { Props as FormProps } from '../forms/Form/types.js'
|
export type { Props as FormProps } from '../forms/Form/types.js'
|
||||||
export { default as Label } from '../forms/Label/index.js'
|
export { default as Label } from '../forms/Label/index.js'
|
||||||
export { RenderFields } from '../forms/RenderFields/index.js'
|
export { RenderFields } from '../forms/RenderFields/index.js'
|
||||||
export { useRowLabel } from '../forms/RowLabel/Context/index.js'
|
export { useRowLabel } from '../forms/RowLabel/Context/index.js'
|
||||||
export { default as FormSubmit } from '../forms/Submit/index.js'
|
export { default as FormSubmit } from '../forms/Submit/index.js'
|
||||||
export { default as Submit } from '../forms/Submit/index.js'
|
export { default as Submit } from '../forms/Submit/index.js'
|
||||||
export { buildStateFromSchema } from '../forms/buildStateFromSchema/index.js'
|
|
||||||
export type { BuildFormStateArgs } from '../forms/buildStateFromSchema/index.js'
|
|
||||||
export type { ArrayFieldProps } from '../forms/fields/Array/types.js'
|
export type { ArrayFieldProps } from '../forms/fields/Array/types.js'
|
||||||
export { default as SectionTitle } from '../forms/fields/Blocks/SectionTitle/index.js'
|
export { default as SectionTitle } from '../forms/fields/Blocks/SectionTitle/index.js'
|
||||||
export type { BlocksFieldProps } from '../forms/fields/Blocks/types.js'
|
export type { BlocksFieldProps } from '../forms/fields/Blocks/types.js'
|
||||||
@@ -60,5 +58,3 @@ export { fieldBaseClass } from '../forms/fields/shared.js'
|
|||||||
export { useField } from '../forms/useField/index.js'
|
export { useField } from '../forms/useField/index.js'
|
||||||
export type { FieldType, Options } from '../forms/useField/types.js'
|
export type { FieldType, Options } from '../forms/useField/types.js'
|
||||||
export { withCondition } from '../forms/withCondition/index.js'
|
export { withCondition } from '../forms/withCondition/index.js'
|
||||||
export { buildComponentMap } from '../utilities/buildComponentMap/index.js'
|
|
||||||
export type { ReducedBlock } from '../utilities/buildComponentMap/types.js'
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
export * from './elements.js'
|
|
||||||
export * from './forms.js'
|
|
||||||
export * from './hooks.js'
|
|
||||||
export * from './providers.js'
|
|
||||||
export * from './utilities.js'
|
|
||||||
export * from './templates.js'
|
|
||||||
export * from './graphics.js'
|
|
||||||
export * from './icons.js'
|
|
||||||
export * from './types.js'
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
export { buildComponentMap } from '../utilities/buildComponentMap/index.js'
|
||||||
export { mapFields } from '../utilities/buildComponentMap/mapFields.js'
|
export { mapFields } from '../utilities/buildComponentMap/mapFields.js'
|
||||||
export type { FieldMap, MappedField } from '../utilities/buildComponentMap/types.js'
|
export type { FieldMap, MappedField } from '../utilities/buildComponentMap/types.js'
|
||||||
|
export type { ReducedBlock } from '../utilities/buildComponentMap/types.js'
|
||||||
export { buildFieldSchemaMap } from '../utilities/buildFieldSchemaMap/index.js'
|
export { buildFieldSchemaMap } from '../utilities/buildFieldSchemaMap/index.js'
|
||||||
export type { FieldSchemaMap } from '../utilities/buildFieldSchemaMap/types.js'
|
export type { FieldSchemaMap } from '../utilities/buildFieldSchemaMap/types.js'
|
||||||
export { default as canUseDOM } from '../utilities/canUseDOM.js'
|
export { default as canUseDOM } from '../utilities/canUseDOM.js'
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export * from './exports/index.js'
|
|
||||||
@@ -24,8 +24,10 @@ process.env.PAYLOAD_DROP_DATABASE = 'true'
|
|||||||
const { afterTest, beforeTest } = await createTestHooks(testSuiteArg)
|
const { afterTest, beforeTest } = await createTestHooks(testSuiteArg)
|
||||||
await beforeTest()
|
await beforeTest()
|
||||||
|
|
||||||
|
const rootDir = resolve(_dirname, './')
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
await nextDev({ _: [resolve(_dirname, '..')], port: process.env.PORT || 3000 })
|
await nextDev({ port: process.env.PORT || 3000, dirname: rootDir }, 'default', rootDir)
|
||||||
|
|
||||||
// On cmd+c, clean up
|
// On cmd+c, clean up
|
||||||
process.on('SIGINT', async () => {
|
process.on('SIGINT', async () => {
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import type { SanitizedConfig } from 'payload/config'
|
import type { SanitizedConfig } from 'payload/config'
|
||||||
|
|
||||||
|
import { getPayloadHMR } from '@payloadcms/next/utilities'
|
||||||
import { createServer } from 'http'
|
import { createServer } from 'http'
|
||||||
import nextImport from 'next'
|
import nextImport from 'next'
|
||||||
|
import path from 'path'
|
||||||
import { type Payload } from 'payload'
|
import { type Payload } from 'payload'
|
||||||
import { wait } from 'payload/utilities'
|
import { wait } from 'payload/utilities'
|
||||||
import { parse } from 'url'
|
import { parse } from 'url'
|
||||||
|
|
||||||
import { getPayloadHMR } from '../../packages/next/src/utilities/getPayloadHMR.js'
|
|
||||||
import { startMemoryDB } from '../startMemoryDB.js'
|
import { startMemoryDB } from '../startMemoryDB.js'
|
||||||
import { createTestHooks } from '../testHooks.js'
|
import { createTestHooks } from '../testHooks.js'
|
||||||
|
|
||||||
@@ -39,7 +40,13 @@ export async function initPayloadE2E({ config, dirname }: Args): Promise<Result>
|
|||||||
const serverURL = `http://localhost:${port}`
|
const serverURL = `http://localhost:${port}`
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const app = nextImport({ dev: true, hostname: 'localhost', port })
|
const app = nextImport({
|
||||||
|
dev: true,
|
||||||
|
hostname: 'localhost',
|
||||||
|
port,
|
||||||
|
dir: path.resolve(dirname, '../'),
|
||||||
|
})
|
||||||
|
|
||||||
const handle = app.getRequestHandler()
|
const handle = app.getRequestHandler()
|
||||||
|
|
||||||
let resolveServer
|
let resolveServer
|
||||||
|
|||||||
@@ -49,8 +49,6 @@
|
|||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"./**/*.ts",
|
"./**/*.ts",
|
||||||
"../packages/**/*.ts",
|
|
||||||
"../packages/**/*.tsx",
|
|
||||||
".next/types/**/*.ts"
|
".next/types/**/*.ts"
|
||||||
],
|
],
|
||||||
"references": []
|
"references": []
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
"./packages/graphql/src"
|
"./packages/graphql/src"
|
||||||
],
|
],
|
||||||
"@payload-config": [
|
"@payload-config": [
|
||||||
"./test/auth/config.ts"
|
"./test/_community/config.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user