SIGN IN SIGN UP
payloadcms / payload UNCLAIMED

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.

41473 0 0 TypeScript
{
"name": "plugin",
"version": "1.0.0",
"description": "A blank template to get started with Payload 3.0",
"license": "MIT",
"type": "module",
"exports": {
".": {
"import": "./src/index.ts",
"types": "./src/index.ts",
"default": "./src/index.ts"
},
"./client": {
"import": "./src/exports/client.ts",
"types": "./src/exports/client.ts",
"default": "./src/exports/client.ts"
},
"./rsc": {
"import": "./src/exports/rsc.ts",
"types": "./src/exports/rsc.ts",
"default": "./src/exports/rsc.ts"
}
},
"main": "./src/index.ts",
"types": "./src/index.ts",
"files": [
"dist"
],
"scripts": {
"build": "pnpm copyfiles && pnpm build:types && pnpm build:swc",
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
"build:types": "tsc --outDir dist --rootDir ./src",
"clean": "rimraf {dist,*.tsbuildinfo}",
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
"dev": "next dev dev --turbo --no-server-fast-refresh",
"dev:generate-importmap": "pnpm dev:payload generate:importmap",
"dev:generate-types": "pnpm dev:payload generate:types",
"dev:payload": "cross-env PAYLOAD_CONFIG_PATH=./dev/payload.config.ts payload",
ci: template errors not being caught due. fix: error due to updated generated-types User type (#12973) This PR consists of two separate changes. One change cannot pass CI without the other, so both are included in this single PR. ## CI - ensure types are generated Our website template is currently failing to build due to a type error. This error was introduced by a change in our generated types. Our CI did not catch this issue because it wasn't generating types / import map before attempting to build the templates. This PR updates the CI to generate types first. It also updates some CI step names for improved clarity. ## Fix: type error ![Screenshot 2025-06-29 at 12 53 49@2x](https://github.com/user-attachments/assets/962f1513-bc6c-4e12-9b74-9b891c49900b) This fixes the type error by ensuring we consistently use the _same_ generated `TypedUser` object within payload, instead of `BaseUser`. Previously, we sometimes used the generated-types user and sometimes the base user, which was causing type conflicts depending on what the generated user type was. It also deprecates the `User` type (which was essentially just `BaseUser`), as consumers should use `TypedUser` instead. `TypedUser` will automatically fall back to `BaseUser` if no generated types exists, but will accept passing it a generated-types User. Without this change, additional properties added to the user via generated-types may cause the user object to not be accepted by functions that only accept a `User` instead of a `TypedUser`, which is what failed here. ## Templates: re-generate templates to update generated types --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1210668927737258
2025-06-29 14:27:50 -07:00
"generate:importmap": "pnpm dev:generate-importmap",
"generate:types": "pnpm dev:generate-types",
"lint": "eslint",
"lint:fix": "eslint ./src --fix",
fix(templates): update template/plugin and fix import map issue (#12305) ### What? 1. Adds logic to automatically update the `importMap.js` file with the project name provided by the user. 2. Adds an updated version of the `README.md` file that we had when this template existed outside of the monorepo ([here](https://github.com/payloadcms/plugin-template/blob/main/README.md)) to provide clear instructions of required steps. ### Why? 1. The plugin template when installed via `npx create-payload-app` asks the user for a project name, however the exports from `importMap.js` do not get updated to the provided name. This throws errors when running the project and prevents it from building. 2. The `/dev` folder requires the `.env.example` to be copied and renamed to `.env` - the project will not run until this is done. The template lacks instructions that this is a required step. ### How? 1. Updates `packages/create-payload-app/src/lib/configure-plugin-project.ts` to read the `importMap.js` file and replace the placeholder plugin name with the name provided by the users. Adds a test to `packages/create-payload-app/src/lib/create-project.spec.ts` to verify that this file gets updated correctly. 2. Adds instructions on using this template to the `README.md` file, ensuring key steps (like adding the `.env` file) are clearly stated. Additional housekeeping updates: - Removed Jest and replaced it with Vitest for testing - Updated the base test approach to use Vitest instead of Jest - Removed `NextRESTClient` in favor of directly creating Request objects - Abstracted `getCustomEndpointHandler` function - Added ensureIndexes: true to the mongooseAdapter configuration - Removed the custom server from the dev folder - Updated the pnpm dev script to "dev": "next dev dev --turbo" - Removed `admin.autoLogin` Fixes #12198
2025-05-27 22:33:23 +01:00
"test": "pnpm test:int && pnpm test:e2e",
"test:e2e": "playwright test",
"test:int": "vitest"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
fix(templates): update template/plugin and fix import map issue (#12305) ### What? 1. Adds logic to automatically update the `importMap.js` file with the project name provided by the user. 2. Adds an updated version of the `README.md` file that we had when this template existed outside of the monorepo ([here](https://github.com/payloadcms/plugin-template/blob/main/README.md)) to provide clear instructions of required steps. ### Why? 1. The plugin template when installed via `npx create-payload-app` asks the user for a project name, however the exports from `importMap.js` do not get updated to the provided name. This throws errors when running the project and prevents it from building. 2. The `/dev` folder requires the `.env.example` to be copied and renamed to `.env` - the project will not run until this is done. The template lacks instructions that this is a required step. ### How? 1. Updates `packages/create-payload-app/src/lib/configure-plugin-project.ts` to read the `importMap.js` file and replace the placeholder plugin name with the name provided by the users. Adds a test to `packages/create-payload-app/src/lib/create-project.spec.ts` to verify that this file gets updated correctly. 2. Adds instructions on using this template to the `README.md` file, ensuring key steps (like adding the `.env` file) are clearly stated. Additional housekeeping updates: - Removed Jest and replaced it with Vitest for testing - Updated the base test approach to use Vitest instead of Jest - Removed `NextRESTClient` in favor of directly creating Request objects - Abstracted `getCustomEndpointHandler` function - Added ensureIndexes: true to the mongooseAdapter configuration - Removed the custom server from the dev folder - Updated the pnpm dev script to "dev": "next dev dev --turbo" - Removed `admin.autoLogin` Fixes #12198
2025-05-27 22:33:23 +01:00
"@payloadcms/db-mongodb": "3.37.0",
"@payloadcms/db-postgres": "3.37.0",
"@payloadcms/db-sqlite": "3.37.0",
"@payloadcms/eslint-config": "3.9.0",
fix(templates): update template/plugin and fix import map issue (#12305) ### What? 1. Adds logic to automatically update the `importMap.js` file with the project name provided by the user. 2. Adds an updated version of the `README.md` file that we had when this template existed outside of the monorepo ([here](https://github.com/payloadcms/plugin-template/blob/main/README.md)) to provide clear instructions of required steps. ### Why? 1. The plugin template when installed via `npx create-payload-app` asks the user for a project name, however the exports from `importMap.js` do not get updated to the provided name. This throws errors when running the project and prevents it from building. 2. The `/dev` folder requires the `.env.example` to be copied and renamed to `.env` - the project will not run until this is done. The template lacks instructions that this is a required step. ### How? 1. Updates `packages/create-payload-app/src/lib/configure-plugin-project.ts` to read the `importMap.js` file and replace the placeholder plugin name with the name provided by the users. Adds a test to `packages/create-payload-app/src/lib/create-project.spec.ts` to verify that this file gets updated correctly. 2. Adds instructions on using this template to the `README.md` file, ensuring key steps (like adding the `.env` file) are clearly stated. Additional housekeeping updates: - Removed Jest and replaced it with Vitest for testing - Updated the base test approach to use Vitest instead of Jest - Removed `NextRESTClient` in favor of directly creating Request objects - Abstracted `getCustomEndpointHandler` function - Added ensureIndexes: true to the mongooseAdapter configuration - Removed the custom server from the dev folder - Updated the pnpm dev script to "dev": "next dev dev --turbo" - Removed `admin.autoLogin` Fixes #12198
2025-05-27 22:33:23 +01:00
"@payloadcms/next": "3.37.0",
"@payloadcms/richtext-lexical": "3.37.0",
"@payloadcms/ui": "3.37.0",
"@playwright/test": "1.58.2",
"@swc-node/register": "1.10.9",
"@swc/cli": "0.6.0",
"@types/node": "22.19.9",
"@types/react": "19.2.14",
"@types/react-dom": "19.2.3",
"copyfiles": "2.4.1",
"cross-env": "^7.0.3",
"eslint": "^9.23.0",
"eslint-config-next": "16.2.1",
"graphql": "^16.8.1",
chore: fix various e2e test setup issues (#12670) I noticed a few issues when running e2e tests that will be resolved by this PR: - Most important: for some test suites (fields, fields-relationship, versions, queues, lexical), the database was cleared and seeded **twice** in between each test run. This is because the onInit function was running the clear and seed script, when it should only have been running the seed script. Clearing the database / the snapshot workflow is being done by the reInit endpoint, which then calls onInit to seed the actual data. - The slowest part of `clearAndSeedEverything` is recreating indexes on mongodb. This PR slightly improves performance here by: - Skipping this process for the built-in `['payload-migrations', 'payload-preferences', 'payload-locked-documents']` collections - Previously we were calling both `createIndexes` and `ensureIndexes`. This was unnecessary - `ensureIndexes` is a deprecated alias of `createIndexes`. This PR changes it to only call `createIndexes` - Makes the reinit endpoint accept GET requests instead of POST requests - this makes it easier to debug right in the browser - Some typescript fixes - Adds a `dev:memorydb` script to the package.json. For some reason, `dev` is super unreliable on mongodb locally when running e2e tests - it frequently fails during index creation. Using the memorydb fixes this issue, with the bonus of more closely resembling the CI environment - Previously, you were unable to run test suites using turbopack + postgres. This fixes it, by explicitly installing `pg` as devDependency in our monorepo - Fixes jest open handles warning
2025-06-04 13:34:37 -07:00
"mongodb-memory-server": "10.1.4",
"next": "16.2.1",
"open": "^10.1.0",
fix(templates): update template/plugin and fix import map issue (#12305) ### What? 1. Adds logic to automatically update the `importMap.js` file with the project name provided by the user. 2. Adds an updated version of the `README.md` file that we had when this template existed outside of the monorepo ([here](https://github.com/payloadcms/plugin-template/blob/main/README.md)) to provide clear instructions of required steps. ### Why? 1. The plugin template when installed via `npx create-payload-app` asks the user for a project name, however the exports from `importMap.js` do not get updated to the provided name. This throws errors when running the project and prevents it from building. 2. The `/dev` folder requires the `.env.example` to be copied and renamed to `.env` - the project will not run until this is done. The template lacks instructions that this is a required step. ### How? 1. Updates `packages/create-payload-app/src/lib/configure-plugin-project.ts` to read the `importMap.js` file and replace the placeholder plugin name with the name provided by the users. Adds a test to `packages/create-payload-app/src/lib/create-project.spec.ts` to verify that this file gets updated correctly. 2. Adds instructions on using this template to the `README.md` file, ensuring key steps (like adding the `.env` file) are clearly stated. Additional housekeeping updates: - Removed Jest and replaced it with Vitest for testing - Updated the base test approach to use Vitest instead of Jest - Removed `NextRESTClient` in favor of directly creating Request objects - Abstracted `getCustomEndpointHandler` function - Added ensureIndexes: true to the mongooseAdapter configuration - Removed the custom server from the dev folder - Updated the pnpm dev script to "dev": "next dev dev --turbo" - Removed `admin.autoLogin` Fixes #12198
2025-05-27 22:33:23 +01:00
"payload": "3.37.0",
"prettier": "^3.4.2",
"qs-esm": "7.0.2",
"react": "19.2.4",
"react-dom": "19.2.4",
"rimraf": "3.0.2",
"sharp": "0.34.2",
"sort-package-json": "^2.10.0",
fix(templates): update template/plugin and fix import map issue (#12305) ### What? 1. Adds logic to automatically update the `importMap.js` file with the project name provided by the user. 2. Adds an updated version of the `README.md` file that we had when this template existed outside of the monorepo ([here](https://github.com/payloadcms/plugin-template/blob/main/README.md)) to provide clear instructions of required steps. ### Why? 1. The plugin template when installed via `npx create-payload-app` asks the user for a project name, however the exports from `importMap.js` do not get updated to the provided name. This throws errors when running the project and prevents it from building. 2. The `/dev` folder requires the `.env.example` to be copied and renamed to `.env` - the project will not run until this is done. The template lacks instructions that this is a required step. ### How? 1. Updates `packages/create-payload-app/src/lib/configure-plugin-project.ts` to read the `importMap.js` file and replace the placeholder plugin name with the name provided by the users. Adds a test to `packages/create-payload-app/src/lib/create-project.spec.ts` to verify that this file gets updated correctly. 2. Adds instructions on using this template to the `README.md` file, ensuring key steps (like adding the `.env` file) are clearly stated. Additional housekeeping updates: - Removed Jest and replaced it with Vitest for testing - Updated the base test approach to use Vitest instead of Jest - Removed `NextRESTClient` in favor of directly creating Request objects - Abstracted `getCustomEndpointHandler` function - Added ensureIndexes: true to the mongooseAdapter configuration - Removed the custom server from the dev folder - Updated the pnpm dev script to "dev": "next dev dev --turbo" - Removed `admin.autoLogin` Fixes #12198
2025-05-27 22:33:23 +01:00
"typescript": "5.7.3",
"vite-tsconfig-paths": "6.0.5",
"vitest": "4.0.18"
},
"peerDependencies": {
fix(templates): update template/plugin and fix import map issue (#12305) ### What? 1. Adds logic to automatically update the `importMap.js` file with the project name provided by the user. 2. Adds an updated version of the `README.md` file that we had when this template existed outside of the monorepo ([here](https://github.com/payloadcms/plugin-template/blob/main/README.md)) to provide clear instructions of required steps. ### Why? 1. The plugin template when installed via `npx create-payload-app` asks the user for a project name, however the exports from `importMap.js` do not get updated to the provided name. This throws errors when running the project and prevents it from building. 2. The `/dev` folder requires the `.env.example` to be copied and renamed to `.env` - the project will not run until this is done. The template lacks instructions that this is a required step. ### How? 1. Updates `packages/create-payload-app/src/lib/configure-plugin-project.ts` to read the `importMap.js` file and replace the placeholder plugin name with the name provided by the users. Adds a test to `packages/create-payload-app/src/lib/create-project.spec.ts` to verify that this file gets updated correctly. 2. Adds instructions on using this template to the `README.md` file, ensuring key steps (like adding the `.env` file) are clearly stated. Additional housekeeping updates: - Removed Jest and replaced it with Vitest for testing - Updated the base test approach to use Vitest instead of Jest - Removed `NextRESTClient` in favor of directly creating Request objects - Abstracted `getCustomEndpointHandler` function - Added ensureIndexes: true to the mongooseAdapter configuration - Removed the custom server from the dev folder - Updated the pnpm dev script to "dev": "next dev dev --turbo" - Removed `admin.autoLogin` Fixes #12198
2025-05-27 22:33:23 +01:00
"payload": "^3.37.0"
},
"engines": {
"node": "^18.20.2 || >=20.9.0",
"pnpm": "^9 || ^10"
},
"publishConfig": {
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./client": {
"import": "./dist/exports/client.js",
"types": "./dist/exports/client.d.ts",
"default": "./dist/exports/client.js"
},
"./rsc": {
"import": "./dist/exports/rsc.js",
"types": "./dist/exports/rsc.d.ts",
"default": "./dist/exports/rsc.js"
}
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"pnpm": {
"onlyBuiltDependencies": [
"sharp",
"esbuild",
"unrs-resolver"
]
},
"registry": "https://registry.npmjs.org/"
}