chore: moves dev folder to top, establishes new test pattern

This commit is contained in:
James
2024-02-14 15:58:03 -05:00
parent 559c132d17
commit df6fa0be24
57 changed files with 589 additions and 581 deletions

1
.vscode/launch.json vendored
View File

@@ -5,7 +5,6 @@
{ {
"command": "pnpm dev", "command": "pnpm dev",
"name": "Run Dev 3.0", "name": "Run Dev 3.0",
"cwd": "${workspaceFolder}/packages/dev",
"request": "launch", "request": "launch",
"type": "node-terminal" "type": "node-terminal"
}, },

12
app/layouter.tsx Normal file
View File

@@ -0,0 +1,12 @@
import React from 'react'
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
{/* Layout UI */}
<main>{children}</main>
</body>
</html>
)
}

10
app/my-route/route.ts Normal file
View File

@@ -0,0 +1,10 @@
export const GET = async () => {
console.log('1')
console.log('1')
console.log('1')
console.log('1')
console.log('1')
return Response.json({
hello: 'elliot',
})
}

View File

@@ -1,18 +1,24 @@
const nextJest = require('next/jest.js')
const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: './',
})
const customJestConfig = { const customJestConfig = {
globalSetup: './test/jest.setup.ts', globalSetup: './test/jest.setup.ts',
moduleNameMapper: { moduleNameMapper: {
'\\.(css|scss)$': '<rootDir>/packages/payload/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>/packages/payload/src/bundlers/mocks/fileMock.js', '<rootDir>/packages/payload/src/bundlers/mocks/fileMock.js',
'payload-config': '<rootDir>/__mocks__/payload-config.ts',
}, },
testEnvironment: 'node', // testEnvironment: 'node',
testMatch: ['<rootDir>/packages/payload/src/**/*.spec.ts', '<rootDir>/test/**/*int.spec.ts'], testMatch: ['<rootDir>/packages/payload/src/**/*.spec.ts', '<rootDir>/test/**/*int.spec.ts'],
testTimeout: 90000, testTimeout: 90000,
transform: { // transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest'], // '^.+\\.(t|j)sx?$': ['@swc/jest'],
}, // },
verbose: true, verbose: true,
} }
module.exports = customJestConfig module.exports = createJestConfig(customJestConfig)

5
next-env.d.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

50
next.config.js Normal file
View File

@@ -0,0 +1,50 @@
const path = require('path')
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
outputFileTracingExcludes: {
'**/*': ['drizzle-kit', 'drizzle-kit/utils'],
},
serverComponentsExternalPackages: ['drizzle-kit', 'drizzle-kit/utils', 'pino', 'pino-pretty'],
},
webpack: (config) => {
return {
...config,
externals: [
...config.externals,
'drizzle-kit',
'drizzle-kit/utils',
'pino',
'pino-pretty',
'sharp',
'mongodb-memory-server',
],
ignoreWarnings: [
...(config.ignoreWarnings || []),
{ module: /node_modules\/mongodb\/lib\/utils\.js/ },
{ file: /node_modules\/mongodb\/lib\/utils\.js/ },
],
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
'payload-config': process.env.PAYLOAD_CONFIG_PATH,
},
fallback: {
...config.resolve.fallback,
'@aws-sdk/credential-providers': false,
'@mongodb-js/zstd': false,
aws4: false,
kerberos: false,
'mongodb-client-encryption': false,
snappy: false,
'supports-color': false,
'yocto-queue': false,
},
},
}
},
}
module.exports = nextConfig

View File

@@ -7,11 +7,12 @@
], ],
"scripts": { "scripts": {
"build": "pnpm --filter payload run build", "build": "pnpm --filter payload run build",
"build:next": "next build",
"build:all": "turbo build", "build:all": "turbo build",
"clean": "rimraf dist && rimraf packages/payload/dist", "clean": "rimraf dist && rimraf packages/payload/dist",
"clean:cache": "rimraf node_modules/.cache && rimraf packages/payload/node_modules/.cache", "clean:cache": "rimraf node_modules/.cache && rimraf packages/payload/node_modules/.cache",
"clean:unix": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +", "clean:unix": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +",
"dev": "nodemon", "dev": "next dev",
"dev:generate-graphql-schema": "ts-node -T ./test/generateGraphQLSchema.ts", "dev:generate-graphql-schema": "ts-node -T ./test/generateGraphQLSchema.ts",
"dev:generate-types": "ts-node -T ./test/generateTypes.ts", "dev:generate-types": "ts-node -T ./test/generateTypes.ts",
"dev:postgres": "pnpm --filter payload run dev:postgres", "dev:postgres": "pnpm --filter payload run dev:postgres",
@@ -82,12 +83,15 @@
"minimist": "1.2.8", "minimist": "1.2.8",
"next": "14.1.1-canary.26", "next": "14.1.1-canary.26",
"node-fetch": "2.6.12", "node-fetch": "2.6.12",
"node-mocks-http": "^1.14.1",
"nodemon": "3.0.2", "nodemon": "3.0.2",
"pino": "8.15.0", "pino": "8.15.0",
"pino-pretty": "10.2.0", "pino-pretty": "10.2.0",
"prettier": "^3.0.3", "prettier": "^3.0.3",
"prompts": "2.4.2", "prompts": "2.4.2",
"qs": "6.11.2", "qs": "6.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"read-stream": "^2.1.1", "read-stream": "^2.1.1",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"semver": "^7.5.4", "semver": "^7.5.4",
@@ -100,7 +104,8 @@
"ts-node": "10.9.1", "ts-node": "10.9.1",
"turbo": "^1.11.1", "turbo": "^1.11.1",
"typescript": "5.2.2", "typescript": "5.2.2",
"uuid": "^9.0.1" "uuid": "^9.0.1",
"yocto-queue": "^1.0.0"
}, },
"peerDependencies": { "peerDependencies": {
"react": "18.2.0", "react": "18.2.0",

View File

@@ -15,7 +15,8 @@
"payload": "workspace:*", "payload": "workspace:*",
"postcss": "^8.4.35", "postcss": "^8.4.35",
"react": "18.3.0-canary-b36ae8d7a-20231207", "react": "18.3.0-canary-b36ae8d7a-20231207",
"react-dom": "18.3.0-canary-b36ae8d7a-20231207" "react-dom": "18.3.0-canary-b36ae8d7a-20231207",
"tailwindcss": "^3.4.1"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20", "@types/node": "^20",

View File

@@ -1,5 +0,0 @@
export const GET = (request) => {
return Response.json({
hello: 'elliot',
})
}

View File

@@ -1,25 +0,0 @@
import { CollectionConfig } from 'payload/types'
import { BeforeInput } from './Pages/BeforeInput'
export const Media: CollectionConfig = {
slug: 'media',
upload: {
staticDir: 'media',
},
access: {
read: () => true,
},
fields: [
{
name: 'title',
type: 'text',
label: 'Title',
required: true,
admin: {
components: {
beforeInput: [BeforeInput],
},
},
},
],
}

View File

@@ -1,5 +0,0 @@
import React from 'react'
export const AfterInput: React.FC = () => {
return <div>This is a custom `AfterInput` component</div>
}

View File

@@ -1,5 +0,0 @@
import React from 'react'
export const BeforeInput: React.FC = () => {
return <div>This is a custom `BeforeInput` component</div>
}

View File

@@ -1,5 +0,0 @@
import React from 'react'
export const CustomCell: React.FC = () => {
return <div>This is a custom `Cell` component</div>
}

View File

@@ -1,5 +0,0 @@
import React from 'react'
export const CustomDescription: React.FC = () => {
return <div>This is a custom `Description` component</div>
}

View File

@@ -1,5 +0,0 @@
import React from 'react'
export const CustomField: React.FC = () => {
return <div>This is a custom `Field` component</div>
}

View File

@@ -1,5 +0,0 @@
import React from 'react'
export const CustomLabel: React.FC = () => {
return <div>This is a custom `Label` component</div>
}

View File

@@ -1,5 +0,0 @@
import React from 'react'
export const CustomView: React.FC = async (props) => {
return <div>CustomView</div>
}

View File

@@ -1,324 +0,0 @@
import { CollectionConfig } from 'payload/types'
import { CustomView } from './CustomView'
import { BeforeInput } from './BeforeInput'
import { AfterInput } from './AfterInput'
import { CustomField } from './CustomField'
import { CustomDescription } from './CustomDescription'
import { CustomLabel } from './CustomLabel'
import { CustomCell } from './CustomCell'
export const Pages: CollectionConfig = {
slug: 'pages',
admin: {
// useAsTitle: 'title',
// defaultColumns: ['title', 'id'],
components: {
views: {
Edit: {
Custom: {
path: '/custom',
Component: CustomView,
Tab: {
label: 'Custom View',
href: '/custom',
},
},
},
},
},
},
versions: {
drafts: true,
},
fields: [
{
name: 'titleWithCustomComponents',
label: 'Title With Custom Components',
type: 'text',
required: true,
admin: {
description: CustomDescription,
components: {
beforeInput: [BeforeInput],
afterInput: [AfterInput],
Label: CustomLabel,
},
},
},
{
name: 'title',
label: 'Title',
type: 'text',
required: true,
defaultValue: 'This is a default value',
admin: {
description: 'This is a description',
},
},
{
name: 'titleWithCustomField',
label: 'Title With Custom Field',
type: 'text',
admin: {
components: {
Field: CustomField,
},
},
},
{
name: 'sidebarTitle',
label: 'Sidebar Title',
type: 'text',
required: true,
admin: {
position: 'sidebar',
},
},
{
name: 'enableConditionalField',
label: 'Enable Conditional Field',
type: 'checkbox',
},
{
name: 'conditionalField',
label: 'Conditional Field',
type: 'text',
admin: {
condition: (data) => data.enableConditionalField,
},
},
{
name: 'number',
label: 'Number',
type: 'number',
required: true,
defaultValue: 4,
admin: {
description: 'Defaults to 4',
},
},
{
name: 'select',
label: 'Select',
type: 'select',
required: true,
defaultValue: 'option-2',
options: [
{
label: 'Option 1',
value: 'option-1',
},
{
label: 'Option 2 (This is a default value)',
value: 'option-2',
},
],
},
{
type: 'textarea',
name: 'textarea',
label: 'Textarea',
required: true,
defaultValue: 'This is a default value',
admin: {
rows: 10,
},
},
{
type: 'point',
name: 'point',
label: 'Point',
required: true,
},
{
type: 'radio',
name: 'radio',
label: 'Radio',
required: true,
options: [
{
label: 'Option 1',
value: 'option-1',
},
{
label: 'Option 2',
value: 'option-2',
},
],
},
{
// TODO: fix this
// label: ({ data }) => `This is ${data?.title || 'Untitled'}`,
label: 'Hello',
type: 'collapsible',
admin: {
initCollapsed: true,
},
fields: [
{
name: 'collapsibleText',
label: 'Collapsible Text',
type: 'text',
required: true,
},
],
},
{
name: 'group',
label: 'Group',
type: 'group',
fields: [
{
name: 'groupText',
label: 'Group Text',
type: 'text',
required: true,
defaultValue: 'This is a default value',
},
],
},
{
name: 'upload',
label: 'Upload',
type: 'upload',
relationTo: 'media',
},
{
name: 'array',
label: 'Array',
type: 'array',
required: true,
fields: [
{
name: 'arrayText',
label: 'Array Text',
type: 'text',
required: true,
defaultValue: 'This is a default value',
},
],
},
{
name: 'blocks',
label: 'Blocks',
type: 'blocks',
required: true,
minRows: 1,
maxRows: 2,
blocks: [
{
slug: 'text',
labels: {
singular: 'Text Block',
plural: 'Text Blocks',
},
fields: [
{
name: 'text',
label: 'Text',
type: 'text',
required: true,
admin: {
components: {
beforeInput: [BeforeInput],
},
},
},
],
},
{
slug: 'textarea',
labels: {
singular: 'Textarea Block',
plural: 'Textarea Blocks',
},
fields: [
{
name: 'textarea',
label: 'Textarea',
type: 'textarea',
required: true,
},
],
},
],
},
{
label: 'Tabs',
type: 'tabs',
tabs: [
{
name: 'tab1',
label: 'Tab 1 (Named)',
validate: (value) => true,
fields: [
{
name: 'tab1Text',
label: 'Tab 1 Text',
type: 'text',
required: true,
},
],
},
{
label: 'Tab 2 (Unnamed)',
fields: [
{
name: 'tab2Text',
label: 'Tab 2 Text',
type: 'text',
required: true,
},
],
},
],
},
{
type: 'row',
fields: [
{
name: 'rowText1',
label: 'Row Text',
type: 'text',
admin: {
width: '50%',
},
},
{
name: 'rowText2',
label: 'Row Text',
type: 'text',
admin: {
width: '50%',
},
},
],
},
{
name: 'json',
label: 'JSON',
type: 'json',
required: true,
},
{
name: 'code',
label: 'Code',
type: 'code',
required: true,
admin: {
components: {
Cell: CustomCell,
},
},
},
{
name: 'hidden',
label: 'Hidden',
type: 'text',
required: true,
admin: {
hidden: true,
},
},
],
}

View File

@@ -1,10 +0,0 @@
import { CollectionConfig } from 'payload/types'
export const Users: CollectionConfig = {
slug: 'users',
auth: true,
admin: {
useAsTitle: 'email',
},
fields: [],
}

View File

@@ -1,11 +0,0 @@
import { GlobalConfig } from 'payload/types'
export const Settings: GlobalConfig = {
slug: 'settings',
fields: [
{
name: 'title',
type: 'text',
},
],
}

View File

@@ -1,53 +0,0 @@
import { mongooseAdapter } from '@payloadcms/db-mongodb'
// import { postgresAdapter } from '@payloadcms/db-postgres'
// import { lexicalEditor } from '@payloadcms/richtext-lexical'
import { buildConfig } from 'payload/config'
import { Users } from './collections/Users'
import { Settings } from './globals/Settings'
import { Pages } from './collections/Pages'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
import { Media } from './collections/Media'
import path from 'path'
export default buildConfig({
db: mongooseAdapter({
url: process.env.DATABASE_URI,
}),
// db: postgresAdapter({
// pool: {
// connectionString: 'postgres://127.0.0.1:5432/payloadtests',
// },
// }),
secret: process.env.PAYLOAD_SECRET,
collections: [Users, Pages, Media],
globals: [Settings],
editor: lexicalEditor({}),
onInit: async (payload) => {
// await payload.create({
// collection: 'users',
// data: {
// email: 'dev@payloadcms.com',
// password: 'test',
// },
// })
// const page = await payload.create({
// collection: 'pages',
// data: {
// title: 'Test Page',
// },
// })
// await payload.update({
// collection: 'pages',
// id: page.id,
// data: {
// title: 'Test Page (Updated)',
// },
// })
},
upload: {
useTempFiles: true,
tempFileDir: path.join(__dirname, '../temp'),
limits: { fileSize: 200 * 1024 },
abortOnLimit: true,
},
})

View File

@@ -30,19 +30,40 @@
"@payloadcms/translations/client": ["../translations/src/all"], "@payloadcms/translations/client": ["../translations/src/all"],
"@payloadcms/translations/api": ["../translations/src/all"], "@payloadcms/translations/api": ["../translations/src/all"],
"@payloadcms/next/*": ["../next/src/*"], "@payloadcms/next/*": ["../next/src/*"],
"payload-config": ["./src/payload.config.ts"] "payload-config": ["../../src/payload.config.ts"]
} }
}, },
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"], // "include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"], "exclude": ["node_modules"],
"composite": true, // Make sure typescript knows that this module depends on their references "composite": true, // Make sure typescript knows that this module depends on their references
"references": [ "references": [
{ "path": "../payload" }, {
{ "path": "../next" }, "path": "../payload"
{ "path": "../ui" }, },
{ "path": "../translations" }, {
{ "path": "../db-mongodb" }, "path": "../next"
{ "path": "../db-postgres" }, },
{ "path": "../richtext-lexical" } {
"path": "../ui"
},
{
"path": "../translations"
},
{
"path": "../db-mongodb"
},
{
"path": "../db-postgres"
},
{
"path": "../richtext-lexical"
}
],
"include": [
"next-env.d.ts",
".next/types/**/*.ts",
"**/*.ts",
"**/*.tsx",
"../../src/payload.config.ts"
] ]
} }

View File

@@ -66,42 +66,44 @@ export const RouteError = async ({
err: APIError err: APIError
collection?: Collection collection?: Collection
}) => { }) => {
const { config, logger } = req.payload return Response.json(err, { status: 500 })
let response = formatErrors(err)
let status = err.status || httpStatus.INTERNAL_SERVER_ERROR
logger.error(err.stack) // const { config, logger } = req.payload
// let response = formatErrors(err)
// let status = err.status || httpStatus.INTERNAL_SERVER_ERROR
// Internal server errors can contain anything, including potentially sensitive data. // logger.error(err.stack)
// Therefore, error details will be hidden from the response unless `config.debug` is `true`
if (!config.debug && status === httpStatus.INTERNAL_SERVER_ERROR) { // // Internal server errors can contain anything, including potentially sensitive data.
response = formatErrors(new APIError('Something went wrong.')) // // Therefore, error details will be hidden from the response unless `config.debug` is `true`
} // if (!config.debug && status === httpStatus.INTERNAL_SERVER_ERROR) {
// response = formatErrors(new APIError('Something went wrong.'))
if (config.debug && config.debug === true) { // }
response.stack = err.stack
} // if (config.debug && config.debug === true) {
// response.stack = err.stack
if (collection && typeof collection.config.hooks.afterError === 'function') { // }
;({ response, status } = (await collection.config.hooks.afterError(
err, // if (collection && typeof collection.config.hooks.afterError === 'function') {
response, // ;({ response, status } = (await collection.config.hooks.afterError(
req.context, // err,
collection.config, // response,
)) || { response, status }) // req.context,
} // collection.config,
// )) || { response, status })
if (typeof config.hooks.afterError === 'function') { // }
;({ response, status } = (await config.hooks.afterError(
err, // if (typeof config.hooks.afterError === 'function') {
response, // ;({ response, status } = (await config.hooks.afterError(
req.context, // err,
collection?.config, // response,
)) || { // req.context,
response, // collection?.config,
status, // )) || {
}) // response,
} // status,
// })
return Response.json(response, { status }) // }
// return Response.json(response, { status })
} }

View File

@@ -2,7 +2,7 @@ import path from 'path'
import { streamFile } from '../../../../../next-stream-file' import { streamFile } from '../../../../../next-stream-file'
import fsPromises from 'fs/promises' import fsPromises from 'fs/promises'
import type { Collection, PayloadRequest, SanitizedConfig, Where } from 'payload/types' import type { Collection, PayloadRequest, SanitizedConfig, Where } from 'payload/types'
import executeAccess from 'payload/dist/auth/executeAccess' import { executeAccess } from 'payload/auth'
import { APIError, Forbidden } from 'payload/errors' import { APIError, Forbidden } from 'payload/errors'
import { RouteError } from '../../../RouteError' import { RouteError } from '../../../RouteError'
import { createPayloadRequest } from '../../../../../utilities/createPayloadRequest' import { createPayloadRequest } from '../../../../../utilities/createPayloadRequest'

View File

@@ -6,8 +6,9 @@
"emitDeclarationOnly": true, "emitDeclarationOnly": true,
"outDir": "./dist" /* Specify an output folder for all emitted files. */, "outDir": "./dist" /* Specify an output folder for all emitted files. */,
"rootDir": "./src" /* Specify the root folder within your source files. */, "rootDir": "./src" /* Specify the root folder within your source files. */,
"sourceMap": true,
"paths": { "paths": {
"@payloadcms/graphql": ["../graphql/dist/index.ts"], "@payloadcms/graphql": ["../graphql/src"],
"@payloadcms/ui": ["../ui/src/exports/index.ts"], "@payloadcms/ui": ["../ui/src/exports/index.ts"],
"@payloadcms/translations/*": ["../translations/dist/*"] "@payloadcms/translations/*": ["../translations/dist/*"]
}, },
@@ -32,7 +33,7 @@
"src/**/*.d.ts", "src/**/*.d.ts",
"src/**/*.json", "src/**/*.json",
"../ui/src/createClientConfig.ts", "../ui/src/createClientConfig.ts",
"../dev/src/app/(payload)/admin/login/action.ts", "../../app/(payload)/admin/login/action.ts",
"../payload/src/auth/cookies.ts" "../payload/src/auth/cookies.ts"
], ],
"references": [ "references": [

View File

@@ -35,7 +35,7 @@ export const readMigrationFiles = async ({
return Promise.all( return Promise.all(
files.map(async (filePath) => { files.map(async (filePath) => {
const migration = (await import(`${filePath}`)) as Migration const migration = eval(`(await import(${filePath}))`) as Migration
migration.name = path.basename(filePath).split('.')?.[0] migration.name = path.basename(filePath).split('.')?.[0]
return migration return migration
}), }),

View File

@@ -1,4 +1,5 @@
export * from '../auth' export * from '../auth'
export { default as executeAccess } from '../auth/executeAccess'
export { getAccessResults } from '../auth/getAccessResults' export { getAccessResults } from '../auth/getAccessResults'
export { getAuthenticatedUser } from '../auth/getAuthenticatedUser' export { getAuthenticatedUser } from '../auth/getAuthenticatedUser'

View File

@@ -1,4 +1,4 @@
@import 'payload-styles'; @import '../../scss/styles.scss';
.icon--menu { .icon--menu {
.fill { .fill {

281
pnpm-lock.yaml generated
View File

@@ -14,9 +14,6 @@ importers:
'@sentry/react': '@sentry/react':
specifier: ^7.77.0 specifier: ^7.77.0
version: 7.77.0(react@18.2.0) version: 7.77.0(react@18.2.0)
react:
specifier: 18.2.0
version: 18.2.0
react-router-dom: react-router-dom:
specifier: 5.3.4 specifier: 5.3.4
version: 5.3.4(react@18.2.0) version: 5.3.4(react@18.2.0)
@@ -168,6 +165,9 @@ importers:
node-fetch: node-fetch:
specifier: 2.6.12 specifier: 2.6.12
version: 2.6.12 version: 2.6.12
node-mocks-http:
specifier: ^1.14.1
version: 1.14.1
nodemon: nodemon:
specifier: 3.0.2 specifier: 3.0.2
version: 3.0.2 version: 3.0.2
@@ -186,6 +186,12 @@ importers:
qs: qs:
specifier: 6.11.2 specifier: 6.11.2
version: 6.11.2 version: 6.11.2
react:
specifier: ^18.2.0
version: 18.2.0
react-dom:
specifier: ^18.2.0
version: 18.2.0(react@18.2.0)
read-stream: read-stream:
specifier: ^2.1.1 specifier: ^2.1.1
version: 2.1.1 version: 2.1.1
@@ -225,6 +231,9 @@ importers:
uuid: uuid:
specifier: ^9.0.1 specifier: ^9.0.1
version: 9.0.1 version: 9.0.1
yocto-queue:
specifier: ^1.0.0
version: 1.0.0
packages/create-payload-app: packages/create-payload-app:
dependencies: dependencies:
@@ -387,6 +396,9 @@ importers:
react-dom: react-dom:
specifier: 18.3.0-canary-b36ae8d7a-20231207 specifier: 18.3.0-canary-b36ae8d7a-20231207
version: 18.3.0-canary-b36ae8d7a-20231207(react@18.3.0-canary-b36ae8d7a-20231207) version: 18.3.0-canary-b36ae8d7a-20231207(react@18.3.0-canary-b36ae8d7a-20231207)
tailwindcss:
specifier: ^3.4.1
version: 3.4.1(ts-node@10.9.1)
devDependencies: devDependencies:
'@types/node': '@types/node':
specifier: ^20 specifier: ^20
@@ -1340,6 +1352,11 @@ packages:
resolution: {integrity: sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==} resolution: {integrity: sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==}
dev: true dev: true
/@alloc/quick-lru@5.2.0:
resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==}
engines: {node: '>=10'}
dev: false
/@ampproject/remapping@2.2.1: /@ampproject/remapping@2.2.1:
resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==}
engines: {node: '>=6.0.0'} engines: {node: '>=6.0.0'}
@@ -3271,6 +3288,18 @@ packages:
resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==}
dev: true dev: true
/@isaacs/cliui@8.0.2:
resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
engines: {node: '>=12'}
dependencies:
string-width: 5.1.2
string-width-cjs: /string-width@4.2.3
strip-ansi: 7.1.0
strip-ansi-cjs: /strip-ansi@6.0.1
wrap-ansi: 8.1.0
wrap-ansi-cjs: /wrap-ansi@7.0.0
dev: false
/@istanbuljs/load-nyc-config@1.1.0: /@istanbuljs/load-nyc-config@1.1.0:
resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
@@ -4271,6 +4300,13 @@ packages:
engines: {node: '>=8.0.0'} engines: {node: '>=8.0.0'}
dev: true dev: true
/@pkgjs/parseargs@0.11.0:
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
engines: {node: '>=14'}
requiresBuild: true
dev: false
optional: true
/@playwright/test@1.40.1: /@playwright/test@1.40.1:
resolution: {integrity: sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==} resolution: {integrity: sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==}
engines: {node: '>=16'} engines: {node: '>=16'}
@@ -5770,6 +5806,12 @@ packages:
resolution: {integrity: sha512-fNjDQzzOsZeKZu5NATgXUPsaFaTxeRgFXoosrHivTl8RGeV733OLawXsGfEk9a8/tySyZUyiZ6E8LcjPFZ2y1A==} resolution: {integrity: sha512-fNjDQzzOsZeKZu5NATgXUPsaFaTxeRgFXoosrHivTl8RGeV733OLawXsGfEk9a8/tySyZUyiZ6E8LcjPFZ2y1A==}
dev: true dev: true
/@types/node@20.11.17:
resolution: {integrity: sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==}
dependencies:
undici-types: 5.26.5
dev: true
/@types/node@20.5.7: /@types/node@20.5.7:
resolution: {integrity: sha512-dP7f3LdZIysZnmvP3ANJYTSwg+wLLl8p7RqniVlV7j+oXSXAbt9h0WIBFmJy5inWZoX9wZN6eXx+YXd9Rh3RBA==} resolution: {integrity: sha512-dP7f3LdZIysZnmvP3ANJYTSwg+wLLl8p7RqniVlV7j+oXSXAbt9h0WIBFmJy5inWZoX9wZN6eXx+YXd9Rh3RBA==}
@@ -6536,7 +6578,6 @@ packages:
/ansi-regex@6.0.1: /ansi-regex@6.0.1:
resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==}
engines: {node: '>=12'} engines: {node: '>=12'}
dev: true
/ansi-styles@3.2.1: /ansi-styles@3.2.1:
resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
@@ -6557,7 +6598,6 @@ packages:
/ansi-styles@6.2.1: /ansi-styles@6.2.1:
resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==}
engines: {node: '>=12'} engines: {node: '>=12'}
dev: true
/any-promise@1.3.0: /any-promise@1.3.0:
resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==}
@@ -7174,6 +7214,11 @@ packages:
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
engines: {node: '>=6'} engines: {node: '>=6'}
/camelcase-css@2.0.1:
resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==}
engines: {node: '>= 6'}
dev: false
/camelcase-keys@6.2.2: /camelcase-keys@6.2.2:
resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==}
engines: {node: '>=8'} engines: {node: '>=8'}
@@ -7434,6 +7479,11 @@ packages:
/commander@2.20.3: /commander@2.20.3:
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
/commander@4.1.1:
resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}
engines: {node: '>= 6'}
dev: false
/commander@7.2.0: /commander@7.2.0:
resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
@@ -7961,6 +8011,12 @@ packages:
resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==}
dev: true dev: true
/cssesc@3.0.0:
resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}
engines: {node: '>=4'}
hasBin: true
dev: false
/cssfilter@0.0.10: /cssfilter@0.0.10:
resolution: {integrity: sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==} resolution: {integrity: sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==}
dev: false dev: false
@@ -8255,6 +8311,11 @@ packages:
resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==}
dev: false dev: false
/depd@1.1.2:
resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==}
engines: {node: '>= 0.6'}
dev: true
/depd@2.0.0: /depd@2.0.0:
resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==}
engines: {node: '>= 0.8'} engines: {node: '>= 0.8'}
@@ -8290,6 +8351,10 @@ packages:
resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==}
engines: {node: '>=8'} engines: {node: '>=8'}
/didyoumean@1.2.2:
resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
dev: false
/diff-sequences@27.5.1: /diff-sequences@27.5.1:
resolution: {integrity: sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==} resolution: {integrity: sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==}
engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
@@ -8325,6 +8390,10 @@ packages:
hasBin: true hasBin: true
dev: false dev: false
/dlv@1.1.3:
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
dev: false
/doctrine@2.1.0: /doctrine@2.1.0:
resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@@ -8506,7 +8575,6 @@ packages:
/eastasianwidth@0.2.0: /eastasianwidth@0.2.0:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
dev: true
/ecdsa-sig-formatter@1.0.11: /ecdsa-sig-formatter@1.0.11:
resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==} resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==}
@@ -9646,6 +9714,14 @@ packages:
dependencies: dependencies:
is-callable: 1.2.7 is-callable: 1.2.7
/foreground-child@3.1.1:
resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==}
engines: {node: '>=14'}
dependencies:
cross-spawn: 7.0.3
signal-exit: 4.1.0
dev: false
/form-data-encoder@2.1.4: /form-data-encoder@2.1.4:
resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==}
engines: {node: '>= 14.17'} engines: {node: '>= 14.17'}
@@ -9968,6 +10044,18 @@ packages:
/glob-to-regexp@0.4.1: /glob-to-regexp@0.4.1:
resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==}
/glob@10.3.10:
resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==}
engines: {node: '>=16 || 14 >=14.17'}
hasBin: true
dependencies:
foreground-child: 3.1.1
jackspeak: 2.3.6
minimatch: 9.0.3
minipass: 7.0.4
path-scurry: 1.10.1
dev: false
/glob@7.2.3: /glob@7.2.3:
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
dependencies: dependencies:
@@ -11045,6 +11133,15 @@ packages:
set-function-name: 2.0.1 set-function-name: 2.0.1
dev: false dev: false
/jackspeak@2.3.6:
resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==}
engines: {node: '>=14'}
dependencies:
'@isaacs/cliui': 8.0.2
optionalDependencies:
'@pkgjs/parseargs': 0.11.0
dev: false
/jest-changed-files@29.7.0: /jest-changed-files@29.7.0:
resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
@@ -11707,6 +11804,11 @@ packages:
- supports-color - supports-color
- ts-node - ts-node
/jiti@1.21.0:
resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==}
hasBin: true
dev: false
/joi@17.12.1: /joi@17.12.1:
resolution: {integrity: sha512-vtxmq+Lsc5SlfqotnfVjlViWfOL9nt/avKNbKYizwf6gsCfq9NYY/ceYRMFD8XDdrjJ9abJyScWmhmIiy+XRtQ==} resolution: {integrity: sha512-vtxmq+Lsc5SlfqotnfVjlViWfOL9nt/avKNbKYizwf6gsCfq9NYY/ceYRMFD8XDdrjJ9abJyScWmhmIiy+XRtQ==}
dependencies: dependencies:
@@ -12038,7 +12140,11 @@ packages:
/lilconfig@2.1.0: /lilconfig@2.1.0:
resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==}
engines: {node: '>=10'} engines: {node: '>=10'}
dev: true
/lilconfig@3.0.0:
resolution: {integrity: sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==}
engines: {node: '>=14'}
dev: false
/lines-and-columns@1.2.4: /lines-and-columns@1.2.4:
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
@@ -12241,7 +12347,6 @@ packages:
/lru-cache@10.0.1: /lru-cache@10.0.1:
resolution: {integrity: sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==} resolution: {integrity: sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==}
engines: {node: 14 || >=16.14} engines: {node: 14 || >=16.14}
dev: true
/lru-cache@4.1.5: /lru-cache@4.1.5:
resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==}
@@ -12530,7 +12635,6 @@ packages:
/minipass@7.0.4: /minipass@7.0.4:
resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==}
engines: {node: '>=16 || 14 >=14.17'} engines: {node: '>=16 || 14 >=14.17'}
dev: true
/mkdirp-classic@0.5.3: /mkdirp-classic@0.5.3:
resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}
@@ -12901,6 +13005,24 @@ packages:
/node-int64@0.4.0: /node-int64@0.4.0:
resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==}
/node-mocks-http@1.14.1:
resolution: {integrity: sha512-mfXuCGonz0A7uG1FEjnypjm34xegeN5+HI6xeGhYKecfgaZhjsmYoLE9LEFmT+53G1n8IuagPZmVnEL/xNsFaA==}
engines: {node: '>=14'}
dependencies:
'@types/express': 4.17.21
'@types/node': 20.11.17
accepts: 1.3.8
content-disposition: 0.5.4
depd: 1.1.2
fresh: 0.5.2
merge-descriptors: 1.0.1
methods: 1.1.2
mime: 1.6.0
parseurl: 1.3.3
range-parser: 1.2.1
type-is: 1.6.18
dev: true
/node-releases@2.0.13: /node-releases@2.0.13:
resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==}
@@ -13068,6 +13190,11 @@ packages:
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
dev: false dev: false
/object-hash@3.0.0:
resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==}
engines: {node: '>= 6'}
dev: false
/object-inspect@1.12.3: /object-inspect@1.12.3:
resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==}
@@ -13473,7 +13600,6 @@ packages:
dependencies: dependencies:
lru-cache: 10.0.1 lru-cache: 10.0.1
minipass: 7.0.4 minipass: 7.0.4
dev: true
/path-to-regexp@0.1.7: /path-to-regexp@0.1.7:
resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==}
@@ -13605,7 +13731,6 @@ packages:
/pify@2.3.0: /pify@2.3.0:
resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
dev: true
/pify@3.0.0: /pify@3.0.0:
resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==}
@@ -13700,6 +13825,68 @@ packages:
engines: {node: '>=4'} engines: {node: '>=4'}
dev: false dev: false
/postcss-import@15.1.0(postcss@8.4.35):
resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==}
engines: {node: '>=14.0.0'}
peerDependencies:
postcss: ^8.0.0
dependencies:
postcss: 8.4.35
postcss-value-parser: 4.2.0
read-cache: 1.0.0
resolve: 1.22.6
dev: false
/postcss-js@4.0.1(postcss@8.4.35):
resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==}
engines: {node: ^12 || ^14 || >= 16}
peerDependencies:
postcss: ^8.4.21
dependencies:
camelcase-css: 2.0.1
postcss: 8.4.35
dev: false
/postcss-load-config@4.0.2(postcss@8.4.35)(ts-node@10.9.1):
resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==}
engines: {node: '>= 14'}
peerDependencies:
postcss: '>=8.0.9'
ts-node: '>=9.0.0'
peerDependenciesMeta:
postcss:
optional: true
ts-node:
optional: true
dependencies:
lilconfig: 3.0.0
postcss: 8.4.35
ts-node: 10.9.1(@swc/core@1.3.102)(@types/node@20.5.7)(typescript@5.2.2)
yaml: 2.3.4
dev: false
/postcss-nested@6.0.1(postcss@8.4.35):
resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==}
engines: {node: '>=12.0'}
peerDependencies:
postcss: ^8.2.14
dependencies:
postcss: 8.4.35
postcss-selector-parser: 6.0.15
dev: false
/postcss-selector-parser@6.0.15:
resolution: {integrity: sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==}
engines: {node: '>=4'}
dependencies:
cssesc: 3.0.0
util-deprecate: 1.0.2
dev: false
/postcss-value-parser@4.2.0:
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
dev: false
/postcss@8.4.31: /postcss@8.4.31:
resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==}
engines: {node: ^10 || ^12 || >=14} engines: {node: ^10 || ^12 || >=14}
@@ -14251,6 +14438,12 @@ packages:
loose-envify: 1.4.0 loose-envify: 1.4.0
dev: false dev: false
/read-cache@1.0.0:
resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==}
dependencies:
pify: 2.3.0
dev: false
/read-pkg-up@10.1.0: /read-pkg-up@10.1.0:
resolution: {integrity: sha512-aNtBq4jR8NawpKJQldrQcSW9y/d+KWH4v24HWkHljOZ7H0av+YTGANBzRh9A5pw7v/bLVsLVPpOhJ7gHNVy8lA==} resolution: {integrity: sha512-aNtBq4jR8NawpKJQldrQcSW9y/d+KWH4v24HWkHljOZ7H0av+YTGANBzRh9A5pw7v/bLVsLVPpOhJ7gHNVy8lA==}
engines: {node: '>=16'} engines: {node: '>=16'}
@@ -14916,6 +15109,11 @@ packages:
/signal-exit@3.0.7: /signal-exit@3.0.7:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
/signal-exit@4.1.0:
resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
engines: {node: '>=14'}
dev: false
/simple-concat@1.0.1: /simple-concat@1.0.1:
resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==}
@@ -15252,7 +15450,6 @@ packages:
eastasianwidth: 0.2.0 eastasianwidth: 0.2.0
emoji-regex: 9.2.2 emoji-regex: 9.2.2
strip-ansi: 7.1.0 strip-ansi: 7.1.0
dev: true
/string.prototype.matchall@4.0.10: /string.prototype.matchall@4.0.10:
resolution: {integrity: sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==} resolution: {integrity: sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==}
@@ -15322,7 +15519,6 @@ packages:
engines: {node: '>=12'} engines: {node: '>=12'}
dependencies: dependencies:
ansi-regex: 6.0.1 ansi-regex: 6.0.1
dev: true
/strip-bom@3.0.0: /strip-bom@3.0.0:
resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
@@ -15437,6 +15633,20 @@ packages:
resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==} resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==}
dev: false dev: false
/sucrase@3.35.0:
resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==}
engines: {node: '>=16 || 14 >=14.17'}
hasBin: true
dependencies:
'@jridgewell/gen-mapping': 0.3.3
commander: 4.1.1
glob: 10.3.10
lines-and-columns: 1.2.4
mz: 2.7.0
pirates: 4.0.6
ts-interface-checker: 0.1.13
dev: false
/supports-color@5.5.0: /supports-color@5.5.0:
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
engines: {node: '>=4'} engines: {node: '>=4'}
@@ -15475,6 +15685,37 @@ packages:
resolution: {integrity: sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA==} resolution: {integrity: sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA==}
dev: false dev: false
/tailwindcss@3.4.1(ts-node@10.9.1):
resolution: {integrity: sha512-qAYmXRfk3ENzuPBakNK0SRrUDipP8NQnEY6772uDhflcQz5EhRdD7JNZxyrFHVQNCwULPBn6FNPp9brpO7ctcA==}
engines: {node: '>=14.0.0'}
hasBin: true
dependencies:
'@alloc/quick-lru': 5.2.0
arg: 5.0.2
chokidar: 3.5.3
didyoumean: 1.2.2
dlv: 1.1.3
fast-glob: 3.3.1
glob-parent: 6.0.2
is-glob: 4.0.3
jiti: 1.21.0
lilconfig: 2.1.0
micromatch: 4.0.5
normalize-path: 3.0.0
object-hash: 3.0.0
picocolors: 1.0.0
postcss: 8.4.35
postcss-import: 15.1.0(postcss@8.4.35)
postcss-js: 4.0.1(postcss@8.4.35)
postcss-load-config: 4.0.2(postcss@8.4.35)(ts-node@10.9.1)
postcss-nested: 6.0.1(postcss@8.4.35)
postcss-selector-parser: 6.0.15
resolve: 1.22.6
sucrase: 3.35.0
transitivePeerDependencies:
- ts-node
dev: false
/tapable@2.2.1: /tapable@2.2.1:
resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==}
engines: {node: '>=6'} engines: {node: '>=6'}
@@ -15777,6 +16018,10 @@ packages:
dependencies: dependencies:
typescript: 5.2.2 typescript: 5.2.2
/ts-interface-checker@0.1.13:
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
dev: false
/ts-jest@29.1.1(@babel/core@7.22.20)(jest@29.7.0)(typescript@5.2.2): /ts-jest@29.1.1(@babel/core@7.22.20)(jest@29.7.0)(typescript@5.2.2):
resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
@@ -16123,6 +16368,10 @@ packages:
resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==} resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==}
dev: true dev: true
/undici-types@5.26.5:
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
dev: true
/unfetch@4.2.0: /unfetch@4.2.0:
resolution: {integrity: sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==} resolution: {integrity: sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==}
dev: false dev: false
@@ -16536,7 +16785,6 @@ packages:
ansi-styles: 6.2.1 ansi-styles: 6.2.1
string-width: 5.1.2 string-width: 5.1.2
strip-ansi: 7.1.0 strip-ansi: 7.1.0
dev: true
/wrappy@1.0.2: /wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
@@ -16633,6 +16881,11 @@ packages:
engines: {node: '>= 14'} engines: {node: '>= 14'}
dev: true dev: true
/yaml@2.3.4:
resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==}
engines: {node: '>= 14'}
dev: false
/yargs-parser@20.2.9: /yargs-parser@20.2.9:
resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==}
engines: {node: '>=10'} engines: {node: '>=10'}

View File

@@ -1,15 +1,17 @@
import type { Payload } from '../../packages/payload/src' import type { Payload } from '../../packages/payload/src'
import { GET as createGET, POST as createPOST } from '../../packages/next/src/routes/rest/index'
import { getPayload } from '../../packages/payload/src'
import { devUser } from '../credentials' import { devUser } from '../credentials'
import { initPayloadTest } from '../helpers/configHelpers'
import { postsSlug } from './collections/Posts' import { postsSlug } from './collections/Posts'
import config from './config'
require('isomorphic-fetch')
let payload: Payload let payload: Payload
let apiURL: string
let jwt let jwt
const GET = createGET(config)
const POST = createPOST(config)
const headers = { const headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
} }
@@ -20,27 +22,30 @@ describe('_Community Tests', () => {
// Boilerplate test setup/teardown // Boilerplate test setup/teardown
// --__--__--__--__--__--__--__--__--__ // --__--__--__--__--__--__--__--__--__
beforeAll(async () => { beforeAll(async () => {
const { payload: payloadClient, serverURL } = await initPayloadTest({ payload = await getPayload({ config })
__dirname,
init: { local: false },
})
apiURL = `${serverURL}/api` const req = new Request('http://localhost:3000/api/users/login', {
payload = payloadClient method: 'POST',
headers: new Headers(headers),
const response = await fetch(`${apiURL}/users/login`, {
body: JSON.stringify({ body: JSON.stringify({
email, email,
password, password,
}), }),
headers,
method: 'post',
}) })
const data = await response.json() const data = await POST(req, {
params: {
slug: ['users', 'login'],
},
}).then((res) => res.json())
jwt = data.token jwt = data.token
}) })
beforeEach(() => {
jest.resetModules()
})
afterAll(async () => { afterAll(async () => {
if (typeof payload.db.destroy === 'function') { if (typeof payload.db.destroy === 'function') {
await payload.db.destroy(payload) await payload.db.destroy(payload)
@@ -64,17 +69,23 @@ describe('_Community Tests', () => {
}) })
it('rest API example', async () => { it('rest API example', async () => {
const newPost = await fetch(`${apiURL}/${postsSlug}`, { const req = new Request(`http://localhost:3000/posts`, {
method: 'POST', method: 'POST',
headers: { headers: new Headers({
...headers, ...headers,
Authorization: `JWT ${jwt}`, Authorization: `JWT ${jwt}`,
}, }),
body: JSON.stringify({ body: JSON.stringify({
text: 'REST API EXAMPLE', text: 'REST API EXAMPLE',
}), }),
})
const data = await POST(req, {
params: {
slug: ['posts'],
},
}).then((res) => res.json()) }).then((res) => res.json())
expect(newPost.doc.text).toEqual('REST API EXAMPLE') expect(data.doc.text).toEqual('REST API EXAMPLE')
}) })
}) })

View File

@@ -49,7 +49,7 @@ export async function initPayloadTest(options: Options): Promise<InitializedPayl
if (!initOptions?.local) { if (!initOptions?.local) {
process.env.APP_ENV = 'test' process.env.APP_ENV = 'test'
process.env.__NEXT_TEST_MODE = 'jest' process.env.__NEXT_TEST_MODE = 'jest'
await bootAdminPanel({ port, appDir: path.resolve(__dirname, '../../packages/dev') }) await bootAdminPanel({ port, appDir: path.resolve(__dirname, '../../') })
jest.resetModules() jest.resetModules()
} }

View File

@@ -10,8 +10,12 @@
"checkJs": false /* Report errors in .js files. */, "checkJs": false /* Report errors in .js files. */,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, "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. */, "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */, "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. */, "noEmit": true /* Do not emit outputs. */,
/* Concatenate and emit output to single file. */ /* Concatenate and emit output to single file. */
"outDir": "./dist" /* Redirect output structure to the directory. */, "outDir": "./dist" /* Redirect output structure to the directory. */,
@@ -20,36 +24,126 @@
"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. */,
"types": ["jest", "node", "@types/jest"] "types": [
"jest",
"node",
"@types/jest"
],
"incremental": true,
"isolatedModules": true,
"plugins": [
{
"name": "next"
}
],
"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"
]
}
}, },
"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 */
"include": [],
"files": [],
"ts-node": {
"swc": true
},
"composite": true, // Required for references to work "composite": true, // Required for references to work
"references": [ "references": [
// if your tsconfig is something different // if your tsconfig is something different
{ "path": "./packages/db-mongodb" }, {
{ "path": "./packages/db-postgres" }, "path": "./packages/db-mongodb"
{ "path": "./packages/graphql" }, },
{ "path": "./packages/live-preview" }, {
{ "path": "./packages/live-preview-react" }, "path": "./packages/db-postgres"
{ "path": "./packages/next" }, },
{ "path": "./packages/payload" }, {
{ "path": "./packages/plugin-cloud-storage" }, "path": "./packages/graphql"
{ "path": "./packages/plugin-cloud" }, },
{ "path": "./packages/plugin-form-builder" }, {
{ "path": "./packages/plugin-nested-docs" }, "path": "./packages/live-preview"
{ "path": "./packages/plugin-redirects" }, },
{ "path": "./packages/plugin-search" }, {
{ "path": "./packages/plugin-seo" }, "path": "./packages/live-preview-react"
{ "path": "./packages/plugin-stripe" }, },
{ "path": "./packages/richtext-slate" }, {
{ "path": "./packages/richtext-lexical" }, "path": "./packages/next"
{ "path": "./packages/translations" }, },
{ "path": "./packages/ui" } {
"path": "./packages/payload"
},
{
"path": "./packages/plugin-cloud-storage"
},
{
"path": "./packages/plugin-cloud"
},
{
"path": "./packages/plugin-form-builder"
},
{
"path": "./packages/plugin-nested-docs"
},
{
"path": "./packages/plugin-redirects"
},
{
"path": "./packages/plugin-search"
},
{
"path": "./packages/plugin-seo"
},
{
"path": "./packages/plugin-stripe"
},
{
"path": "./packages/richtext-slate"
},
{
"path": "./packages/richtext-lexical"
},
{
"path": "./packages/translations"
},
{
"path": "./packages/ui"
}
],
"include": [
"next-env.d.ts",
".next/types/**/*.ts",
"**/*.ts",
"**/*.tsx"
] ]
} }