create-payload-app 4.0.0-internal.2fddfc0 → 4.0.0-internal.31ba7ee
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +5 -0
- package/dist/commands.d.ts +4 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +5 -0
- package/dist/commands.js.map +1 -0
- package/dist/lib/agent-config.d.ts +12 -0
- package/dist/lib/agent-config.d.ts.map +1 -0
- package/dist/lib/agent-config.js +15 -0
- package/dist/lib/agent-config.js.map +1 -0
- package/dist/lib/ast/adapter-config.d.ts.map +1 -1
- package/dist/lib/ast/adapter-config.js +0 -10
- package/dist/lib/ast/adapter-config.js.map +1 -1
- package/dist/lib/ast/package-json.d.ts +9 -0
- package/dist/lib/ast/package-json.d.ts.map +1 -1
- package/dist/lib/ast/package-json.js +34 -8
- package/dist/lib/ast/package-json.js.map +1 -1
- package/dist/lib/ast/types.d.ts +2 -2
- package/dist/lib/ast/types.d.ts.map +1 -1
- package/dist/lib/ast/types.js +0 -1
- package/dist/lib/ast/types.js.map +1 -1
- package/dist/lib/configure-payload-tsconfig.d.ts +5 -0
- package/dist/lib/configure-payload-tsconfig.d.ts.map +1 -0
- package/dist/lib/configure-payload-tsconfig.js +26 -0
- package/dist/lib/configure-payload-tsconfig.js.map +1 -0
- package/dist/lib/configure-plugin-project.d.ts.map +1 -1
- package/dist/lib/configure-pnpm-builds.d.ts +20 -0
- package/dist/lib/configure-pnpm-builds.d.ts.map +1 -0
- package/dist/lib/configure-pnpm-builds.js +100 -0
- package/dist/lib/configure-pnpm-builds.js.map +1 -0
- package/dist/lib/create-project.d.ts +1 -2
- package/dist/lib/create-project.d.ts.map +1 -1
- package/dist/lib/create-project.js +61 -29
- package/dist/lib/create-project.js.map +1 -1
- package/dist/lib/generate-secret.js +1 -1
- package/dist/lib/generate-secret.js.map +1 -1
- package/dist/lib/get-package-manager.d.ts +9 -0
- package/dist/lib/get-package-manager.d.ts.map +1 -1
- package/dist/lib/get-package-manager.js +20 -0
- package/dist/lib/get-package-manager.js.map +1 -1
- package/dist/lib/init-next.d.ts.map +1 -1
- package/dist/lib/init-next.js +10 -34
- package/dist/lib/init-next.js.map +1 -1
- package/dist/lib/init-tanstack.d.ts +18 -0
- package/dist/lib/init-tanstack.d.ts.map +1 -0
- package/dist/lib/init-tanstack.js +150 -0
- package/dist/lib/init-tanstack.js.map +1 -0
- package/dist/lib/tanstack/detect.d.ts +5 -0
- package/dist/lib/tanstack/detect.d.ts.map +1 -0
- package/dist/lib/tanstack/detect.js +131 -0
- package/dist/lib/tanstack/detect.js.map +1 -0
- package/dist/lib/tanstack/prepare.d.ts +23 -0
- package/dist/lib/tanstack/prepare.d.ts.map +1 -0
- package/dist/lib/tanstack/prepare.js +114 -0
- package/dist/lib/tanstack/prepare.js.map +1 -0
- package/dist/lib/tanstack/template-files.d.ts +50 -0
- package/dist/lib/tanstack/template-files.d.ts.map +1 -0
- package/dist/lib/tanstack/template-files.js +64 -0
- package/dist/lib/tanstack/template-files.js.map +1 -0
- package/dist/lib/tanstack/transform-root-route.d.ts +7 -0
- package/dist/lib/tanstack/transform-root-route.d.ts.map +1 -0
- package/dist/lib/tanstack/transform-root-route.js +747 -0
- package/dist/lib/tanstack/transform-root-route.js.map +1 -0
- package/dist/lib/tanstack/transform-router.d.ts +5 -0
- package/dist/lib/tanstack/transform-router.d.ts.map +1 -0
- package/dist/lib/tanstack/transform-router.js +301 -0
- package/dist/lib/tanstack/transform-router.js.map +1 -0
- package/dist/lib/tanstack/transform-vite-config.d.ts +14 -0
- package/dist/lib/tanstack/transform-vite-config.d.ts.map +1 -0
- package/dist/lib/tanstack/transform-vite-config.js +576 -0
- package/dist/lib/tanstack/transform-vite-config.js.map +1 -0
- package/dist/lib/templates.d.ts.map +1 -1
- package/dist/lib/templates.js +6 -0
- package/dist/lib/templates.js.map +1 -1
- package/dist/lib/update-payload-in-project.d.ts +18 -3
- package/dist/lib/update-payload-in-project.d.ts.map +1 -1
- package/dist/lib/update-payload-in-project.js +98 -18
- package/dist/lib/update-payload-in-project.js.map +1 -1
- package/dist/lib/wrap-next-config.d.ts.map +1 -1
- package/dist/main.d.ts +20 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +120 -30
- package/dist/main.js.map +1 -1
- package/dist/scripts/pack-template-files.js +18 -0
- package/dist/scripts/pack-template-files.js.map +1 -1
- package/dist/template/src/app/(frontend)/styles.css +8 -1
- package/dist/template/src/app/(payload)/admin/[[...segments]]/not-found.tsx +1 -2
- package/dist/template/src/app/(payload)/admin/[[...segments]]/page.tsx +1 -2
- package/dist/template/src/app/(payload)/api/[...slug]/route.ts +1 -2
- package/dist/template/src/app/(payload)/api/graphql/route.ts +1 -2
- package/dist/template/src/app/(payload)/api/graphql-playground/route.ts +1 -2
- package/dist/template/src/app/(payload)/layout.tsx +9 -4
- package/dist/template-tanstack/routes/_payload/admin.$.tsx +9 -0
- package/dist/template-tanstack/routes/_payload/admin.index.tsx +9 -0
- package/dist/template-tanstack/routes/_payload/api.$.ts +11 -0
- package/dist/template-tanstack/routes/_payload/importMap.js +32 -0
- package/dist/template-tanstack/routes/_payload/server.functions.ts +50 -0
- package/dist/template-tanstack/routes/_payload.tsx +31 -0
- package/dist/template-tanstack/src/collections/Folders.ts +16 -0
- package/dist/template-tanstack/src/collections/Media.ts +20 -0
- package/dist/template-tanstack/src/collections/Tags.ts +16 -0
- package/dist/template-tanstack/src/collections/Users.ts +14 -0
- package/dist/template-tanstack/src/payload.config.ts +40 -0
- package/dist/template-tanstack/src/payload.css +1 -0
- package/dist/types.d.ts +22 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/casing.d.ts.map +1 -1
- package/dist/utils/log.d.ts.map +1 -1
- package/dist/utils/messages.d.ts +1 -0
- package/dist/utils/messages.d.ts.map +1 -1
- package/dist/utils/messages.js +8 -6
- package/dist/utils/messages.js.map +1 -1
- package/package.json +5 -5
- package/dist/ast-integration.spec.js +0 -132
- package/dist/ast-integration.spec.js.map +0 -1
- package/dist/lib/ast/package-json.spec.js +0 -67
- package/dist/lib/ast/package-json.spec.js.map +0 -1
- package/dist/lib/ast/payload-config.spec.js +0 -365
- package/dist/lib/ast/payload-config.spec.js.map +0 -1
- package/dist/lib/ast/utils.spec.js +0 -226
- package/dist/lib/ast/utils.spec.js.map +0 -1
- package/dist/lib/create-project.spec.js +0 -190
- package/dist/lib/create-project.spec.js.map +0 -1
- package/dist/lib/download-skill.d.ts +0 -8
- package/dist/lib/download-skill.d.ts.map +0 -1
- package/dist/lib/download-skill.js +0 -35
- package/dist/lib/download-skill.js.map +0 -1
- package/dist/lib/manage-env-files.spec.js +0 -118
- package/dist/lib/manage-env-files.spec.js.map +0 -1
- package/dist/lib/select-agent.d.ts +0 -16
- package/dist/lib/select-agent.d.ts.map +0 -1
- package/dist/lib/select-agent.js +0 -67
- package/dist/lib/select-agent.js.map +0 -1
- package/dist/lib/wrap-next-config.spec.js +0 -167
- package/dist/lib/wrap-next-config.spec.js.map +0 -1
- package/dist/utils/resolvePackageVersion.spec.js +0 -77
- package/dist/utils/resolvePackageVersion.spec.js.map +0 -1
- /package/dist/template/src/app/(payload)/{custom.scss → custom.css} +0 -0
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2018-
|
|
3
|
+
Copyright (c) 2018-2026 Payload CMS, LLC <info@payloadcms.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
CLI for easily starting new Payload project
|
|
4
4
|
|
|
5
|
+
When run without a project name inside a compatible existing Next.js, TanStack Start, or
|
|
6
|
+
conventional TanStack Router project, the CLI initializes Payload in the current project.
|
|
7
|
+
Router-only projects are converted to TanStack Start after confirmation.
|
|
8
|
+
|
|
5
9
|
## Usage
|
|
6
10
|
|
|
7
11
|
```text
|
|
@@ -20,6 +24,7 @@ CLI for easily starting new Payload project
|
|
|
20
24
|
Available templates:
|
|
21
25
|
|
|
22
26
|
blank Blank Template
|
|
27
|
+
blank-tanstack Blank TanStack Start Template
|
|
23
28
|
website Website Template
|
|
24
29
|
ecommerce E-commerce Template
|
|
25
30
|
plugin Template for creating a Payload plugin
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA"}
|
package/dist/commands.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands.ts"],"sourcesContent":["export { getNextAppDetails, initNext } from './lib/init-next.js'\nexport { initTanStack } from './lib/init-tanstack.js'\nexport { getTanStackAppDetails } from './lib/tanstack/detect.js'\n"],"names":["getNextAppDetails","initNext","initTanStack","getTanStackAppDetails"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,QAAQ,QAAQ,qBAAoB;AAChE,SAASC,YAAY,QAAQ,yBAAwB;AACrD,SAASC,qBAAqB,QAAQ,2BAA0B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type AgentConfigFile = {
|
|
2
|
+
content: string;
|
|
3
|
+
fileName: 'AGENTS.md';
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Builds the agent config files written at project root. They point agents at the skill
|
|
7
|
+
* bundled with the installed `payload` package, so guidance always matches the installed
|
|
8
|
+
* version. `AGENTS.md` is the single source read by Claude Code, Cursor, and Copilot.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildAgentConfigFiles(): AgentConfigFile[];
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=agent-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-config.d.ts","sourceRoot":"","sources":["../../src/lib/agent-config.ts"],"names":[],"mappings":"AAGA,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,WAAW,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,eAAe,EAAE,CAOzD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Where the skill ships inside a consumer's installed dependencies. */ const SKILL_PATH = 'node_modules/payload/skills/payload';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the agent config files written at project root. They point agents at the skill
|
|
4
|
+
* bundled with the installed `payload` package, so guidance always matches the installed
|
|
5
|
+
* version. `AGENTS.md` is the single source read by Claude Code, Cursor, and Copilot.
|
|
6
|
+
*/ export function buildAgentConfigFiles() {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
content: `# AI Agent\n\nFor any Payload-related work, reference the skill at \`${SKILL_PATH}/SKILL.md\`.\n`,
|
|
10
|
+
fileName: 'AGENTS.md'
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=agent-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/agent-config.ts"],"sourcesContent":["/** Where the skill ships inside a consumer's installed dependencies. */\nconst SKILL_PATH = 'node_modules/payload/skills/payload'\n\ntype AgentConfigFile = {\n content: string\n fileName: 'AGENTS.md'\n}\n\n/**\n * Builds the agent config files written at project root. They point agents at the skill\n * bundled with the installed `payload` package, so guidance always matches the installed\n * version. `AGENTS.md` is the single source read by Claude Code, Cursor, and Copilot.\n */\nexport function buildAgentConfigFiles(): AgentConfigFile[] {\n return [\n {\n content: `# AI Agent\\n\\nFor any Payload-related work, reference the skill at \\`${SKILL_PATH}/SKILL.md\\`.\\n`,\n fileName: 'AGENTS.md',\n },\n ]\n}\n"],"names":["SKILL_PATH","buildAgentConfigFiles","content","fileName"],"mappings":"AAAA,sEAAsE,GACtE,MAAMA,aAAa;AAOnB;;;;CAIC,GACD,OAAO,SAASC;IACd,OAAO;QACL;YACEC,SAAS,CAAC,qEAAqE,EAAEF,WAAW,cAAc,CAAC;YAC3GG,UAAU;QACZ;KACD;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-config.d.ts","sourceRoot":"","sources":["../../../src/lib/ast/adapter-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEjE,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IAC1C,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAA;IAC1B,cAAc,EAAE,MAAM,IAAI,GAAG,MAAM,CAAA;IACnC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,eAAe,EAAE,qBAAqB,CA0CnE,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,cAAc,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"adapter-config.d.ts","sourceRoot":"","sources":["../../../src/lib/ast/adapter-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEjE,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IAC1C,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAA;IAC1B,cAAc,EAAE,MAAM,IAAI,GAAG,MAAM,CAAA;IACnC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,eAAe,EAAE,qBAAqB,CA0CnE,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,cAAc,EAAE,oBAAoB,CA8DtE,CAAA;AAEV;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAEjE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAEjE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,GAAG,MAAM,CAE5E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,GAAG,MAAM,CAE5E"}
|
|
@@ -100,16 +100,6 @@
|
|
|
100
100
|
})`,
|
|
101
101
|
packageName: '@payloadcms/storage-s3'
|
|
102
102
|
},
|
|
103
|
-
uploadthingStorage: {
|
|
104
|
-
adapterName: 'uploadthingStorage',
|
|
105
|
-
configTemplate: ()=>`uploadthingStorage({
|
|
106
|
-
collections: {
|
|
107
|
-
media: true,
|
|
108
|
-
},
|
|
109
|
-
token: process.env.UPLOADTHING_SECRET || '',
|
|
110
|
-
})`,
|
|
111
|
-
packageName: '@payloadcms/storage-uploadthing'
|
|
112
|
-
},
|
|
113
103
|
vercelBlobStorage: {
|
|
114
104
|
adapterName: 'vercelBlobStorage',
|
|
115
105
|
configTemplate: ()=>`vercelBlobStorage({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/ast/adapter-config.ts"],"sourcesContent":["/**\n * Centralized adapter configuration\n * Shared across all AST transformation and test files\n */\n\nimport type { DatabaseAdapter, StorageAdapter } from './types.js'\n\nexport type DatabaseAdapterConfig = {\n adapterName: string\n configTemplate: (envVar: string) => string\n packageName: string\n}\n\nexport type StorageAdapterConfig = {\n adapterName: null | string\n configTemplate: () => null | string\n packageName: null | string\n}\n\n/**\n * Database adapter configurations\n */\nexport const DB_ADAPTER_CONFIG: Record<DatabaseAdapter, DatabaseAdapterConfig> = {\n 'd1-sqlite': {\n adapterName: 'sqliteD1Adapter',\n configTemplate: () => `sqliteD1Adapter({\n binding: cloudflare.env.D1,\n})`,\n packageName: '@payloadcms/db-d1-sqlite',\n },\n mongodb: {\n adapterName: 'mongooseAdapter',\n configTemplate: (envVar: string) => `mongooseAdapter({\n url: process.env.${envVar} || '',\n})`,\n packageName: '@payloadcms/db-mongodb',\n },\n postgres: {\n adapterName: 'postgresAdapter',\n configTemplate: (envVar: string) => `postgresAdapter({\n pool: {\n connectionString: process.env.${envVar} || '',\n },\n})`,\n packageName: '@payloadcms/db-postgres',\n },\n sqlite: {\n adapterName: 'sqliteAdapter',\n configTemplate: () => `sqliteAdapter({\n client: {\n url: process.env.DATABASE_URL || '',\n },\n})`,\n packageName: '@payloadcms/db-sqlite',\n },\n 'vercel-postgres': {\n adapterName: 'vercelPostgresAdapter',\n configTemplate: () => `vercelPostgresAdapter({\n pool: {\n connectionString: process.env.POSTGRES_URL || '',\n },\n})`,\n packageName: '@payloadcms/db-vercel-postgres',\n },\n} as const\n\n/**\n * Storage adapter configurations\n */\nexport const STORAGE_ADAPTER_CONFIG: Record<StorageAdapter, StorageAdapterConfig> = {\n azureStorage: {\n adapterName: 'azureStorage',\n configTemplate: () => `azureStorage({\n collections: {\n media: true,\n },\n connectionString: process.env.AZURE_STORAGE_CONNECTION_STRING || '',\n containerName: process.env.AZURE_STORAGE_CONTAINER_NAME || '',\n })`,\n packageName: '@payloadcms/storage-azure',\n },\n gcsStorage: {\n adapterName: 'gcsStorage',\n configTemplate: () => `gcsStorage({\n collections: {\n media: true,\n },\n bucket: process.env.GCS_BUCKET || '',\n })`,\n packageName: '@payloadcms/storage-gcs',\n },\n localDisk: {\n adapterName: null,\n configTemplate: () => null,\n packageName: null,\n },\n r2Storage: {\n adapterName: 'r2Storage',\n configTemplate: () => `r2Storage({\n bucket: cloudflare.env.R2,\n collections: { media: true },\n })`,\n packageName: '@payloadcms/storage-r2',\n },\n s3Storage: {\n adapterName: 's3Storage',\n configTemplate: () => `s3Storage({\n collections: {\n media: true,\n },\n bucket: process.env.S3_BUCKET || '',\n config: {\n credentials: {\n accessKeyId: process.env.S3_ACCESS_KEY_ID || '',\n secretAccessKey: process.env.S3_SECRET_ACCESS_KEY || '',\n },\n region: process.env.S3_REGION || '',\n },\n })`,\n packageName: '@payloadcms/storage-s3',\n },\n
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/ast/adapter-config.ts"],"sourcesContent":["/**\n * Centralized adapter configuration\n * Shared across all AST transformation and test files\n */\n\nimport type { DatabaseAdapter, StorageAdapter } from './types.js'\n\nexport type DatabaseAdapterConfig = {\n adapterName: string\n configTemplate: (envVar: string) => string\n packageName: string\n}\n\nexport type StorageAdapterConfig = {\n adapterName: null | string\n configTemplate: () => null | string\n packageName: null | string\n}\n\n/**\n * Database adapter configurations\n */\nexport const DB_ADAPTER_CONFIG: Record<DatabaseAdapter, DatabaseAdapterConfig> = {\n 'd1-sqlite': {\n adapterName: 'sqliteD1Adapter',\n configTemplate: () => `sqliteD1Adapter({\n binding: cloudflare.env.D1,\n})`,\n packageName: '@payloadcms/db-d1-sqlite',\n },\n mongodb: {\n adapterName: 'mongooseAdapter',\n configTemplate: (envVar: string) => `mongooseAdapter({\n url: process.env.${envVar} || '',\n})`,\n packageName: '@payloadcms/db-mongodb',\n },\n postgres: {\n adapterName: 'postgresAdapter',\n configTemplate: (envVar: string) => `postgresAdapter({\n pool: {\n connectionString: process.env.${envVar} || '',\n },\n})`,\n packageName: '@payloadcms/db-postgres',\n },\n sqlite: {\n adapterName: 'sqliteAdapter',\n configTemplate: () => `sqliteAdapter({\n client: {\n url: process.env.DATABASE_URL || '',\n },\n})`,\n packageName: '@payloadcms/db-sqlite',\n },\n 'vercel-postgres': {\n adapterName: 'vercelPostgresAdapter',\n configTemplate: () => `vercelPostgresAdapter({\n pool: {\n connectionString: process.env.POSTGRES_URL || '',\n },\n})`,\n packageName: '@payloadcms/db-vercel-postgres',\n },\n} as const\n\n/**\n * Storage adapter configurations\n */\nexport const STORAGE_ADAPTER_CONFIG: Record<StorageAdapter, StorageAdapterConfig> = {\n azureStorage: {\n adapterName: 'azureStorage',\n configTemplate: () => `azureStorage({\n collections: {\n media: true,\n },\n connectionString: process.env.AZURE_STORAGE_CONNECTION_STRING || '',\n containerName: process.env.AZURE_STORAGE_CONTAINER_NAME || '',\n })`,\n packageName: '@payloadcms/storage-azure',\n },\n gcsStorage: {\n adapterName: 'gcsStorage',\n configTemplate: () => `gcsStorage({\n collections: {\n media: true,\n },\n bucket: process.env.GCS_BUCKET || '',\n })`,\n packageName: '@payloadcms/storage-gcs',\n },\n localDisk: {\n adapterName: null,\n configTemplate: () => null,\n packageName: null,\n },\n r2Storage: {\n adapterName: 'r2Storage',\n configTemplate: () => `r2Storage({\n bucket: cloudflare.env.R2,\n collections: { media: true },\n })`,\n packageName: '@payloadcms/storage-r2',\n },\n s3Storage: {\n adapterName: 's3Storage',\n configTemplate: () => `s3Storage({\n collections: {\n media: true,\n },\n bucket: process.env.S3_BUCKET || '',\n config: {\n credentials: {\n accessKeyId: process.env.S3_ACCESS_KEY_ID || '',\n secretAccessKey: process.env.S3_SECRET_ACCESS_KEY || '',\n },\n region: process.env.S3_REGION || '',\n },\n })`,\n packageName: '@payloadcms/storage-s3',\n },\n vercelBlobStorage: {\n adapterName: 'vercelBlobStorage',\n configTemplate: () => `vercelBlobStorage({\n collections: {\n media: true,\n },\n token: process.env.BLOB_READ_WRITE_TOKEN || '',\n })`,\n packageName: '@payloadcms/storage-vercel-blob',\n },\n} as const\n\n/**\n * Helper to get database adapter package name\n */\nexport function getDbPackageName(adapter: DatabaseAdapter): string {\n return DB_ADAPTER_CONFIG[adapter].packageName\n}\n\n/**\n * Helper to get database adapter name\n */\nexport function getDbAdapterName(adapter: DatabaseAdapter): string {\n return DB_ADAPTER_CONFIG[adapter].adapterName\n}\n\n/**\n * Helper to get storage adapter package name\n */\nexport function getStoragePackageName(adapter: StorageAdapter): null | string {\n return STORAGE_ADAPTER_CONFIG[adapter].packageName\n}\n\n/**\n * Helper to get storage adapter name\n */\nexport function getStorageAdapterName(adapter: StorageAdapter): null | string {\n return STORAGE_ADAPTER_CONFIG[adapter].adapterName\n}\n"],"names":["DB_ADAPTER_CONFIG","adapterName","configTemplate","packageName","mongodb","envVar","postgres","sqlite","STORAGE_ADAPTER_CONFIG","azureStorage","gcsStorage","localDisk","r2Storage","s3Storage","vercelBlobStorage","getDbPackageName","adapter","getDbAdapterName","getStoragePackageName","getStorageAdapterName"],"mappings":"AAAA;;;CAGC,GAgBD;;CAEC,GACD,OAAO,MAAMA,oBAAoE;IAC/E,aAAa;QACXC,aAAa;QACbC,gBAAgB,IAAM,CAAC;;EAEzB,CAAC;QACCC,aAAa;IACf;IACAC,SAAS;QACPH,aAAa;QACbC,gBAAgB,CAACG,SAAmB,CAAC;mBACtB,EAAEA,OAAO;EAC1B,CAAC;QACCF,aAAa;IACf;IACAG,UAAU;QACRL,aAAa;QACbC,gBAAgB,CAACG,SAAmB,CAAC;;kCAEP,EAAEA,OAAO;;EAEzC,CAAC;QACCF,aAAa;IACf;IACAI,QAAQ;QACNN,aAAa;QACbC,gBAAgB,IAAM,CAAC;;;;EAIzB,CAAC;QACCC,aAAa;IACf;IACA,mBAAmB;QACjBF,aAAa;QACbC,gBAAgB,IAAM,CAAC;;;;EAIzB,CAAC;QACCC,aAAa;IACf;AACF,EAAU;AAEV;;CAEC,GACD,OAAO,MAAMK,yBAAuE;IAClFC,cAAc;QACZR,aAAa;QACbC,gBAAgB,IAAM,CAAC;;;;;;IAMvB,CAAC;QACDC,aAAa;IACf;IACAO,YAAY;QACVT,aAAa;QACbC,gBAAgB,IAAM,CAAC;;;;;IAKvB,CAAC;QACDC,aAAa;IACf;IACAQ,WAAW;QACTV,aAAa;QACbC,gBAAgB,IAAM;QACtBC,aAAa;IACf;IACAS,WAAW;QACTX,aAAa;QACbC,gBAAgB,IAAM,CAAC;;;IAGvB,CAAC;QACDC,aAAa;IACf;IACAU,WAAW;QACTZ,aAAa;QACbC,gBAAgB,IAAM,CAAC;;;;;;;;;;;;IAYvB,CAAC;QACDC,aAAa;IACf;IACAW,mBAAmB;QACjBb,aAAa;QACbC,gBAAgB,IAAM,CAAC;;;;;IAKvB,CAAC;QACDC,aAAa;IACf;AACF,EAAU;AAEV;;CAEC,GACD,OAAO,SAASY,iBAAiBC,OAAwB;IACvD,OAAOhB,iBAAiB,CAACgB,QAAQ,CAACb,WAAW;AAC/C;AAEA;;CAEC,GACD,OAAO,SAASc,iBAAiBD,OAAwB;IACvD,OAAOhB,iBAAiB,CAACgB,QAAQ,CAACf,WAAW;AAC/C;AAEA;;CAEC,GACD,OAAO,SAASiB,sBAAsBF,OAAuB;IAC3D,OAAOR,sBAAsB,CAACQ,QAAQ,CAACb,WAAW;AACpD;AAEA;;CAEC,GACD,OAAO,SAASgB,sBAAsBH,OAAuB;IAC3D,OAAOR,sBAAsB,CAACQ,QAAQ,CAACf,WAAW;AACpD"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { DatabaseAdapter, StorageAdapter } from './types.js';
|
|
2
2
|
type PackageJsonTransformOptions = {
|
|
3
|
+
addDependencies?: Record<string, string>;
|
|
3
4
|
databaseAdapter?: DatabaseAdapter;
|
|
4
5
|
packageName?: string;
|
|
6
|
+
removeDependencies?: string[];
|
|
5
7
|
removeSharp?: boolean;
|
|
6
8
|
storageAdapter?: StorageAdapter;
|
|
7
9
|
};
|
|
@@ -9,5 +11,12 @@ type PackageJsonTransformOptions = {
|
|
|
9
11
|
* Main orchestration function
|
|
10
12
|
*/
|
|
11
13
|
export declare function updatePackageJson(filePath: string, options: PackageJsonTransformOptions): void;
|
|
14
|
+
export declare function preparePackageJson({ filePath, options, }: {
|
|
15
|
+
filePath: string;
|
|
16
|
+
options: PackageJsonTransformOptions;
|
|
17
|
+
}): {
|
|
18
|
+
content: string;
|
|
19
|
+
filePath: string;
|
|
20
|
+
};
|
|
12
21
|
export {};
|
|
13
22
|
//# sourceMappingURL=package-json.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-json.d.ts","sourceRoot":"","sources":["../../../src/lib/ast/package-json.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAMjE,KAAK,2BAA2B,GAAG;IACjC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,cAAc,CAAC,EAAE,cAAc,CAAA;CAChC,CAAA;AASD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"package-json.d.ts","sourceRoot":"","sources":["../../../src/lib/ast/package-json.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAMjE,KAAK,2BAA2B,GAAG;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,cAAc,CAAC,EAAE,cAAc,CAAA;CAChC,CAAA;AASD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,GAAG,IAAI,CAO9F;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,2BAA2B,CAAA;CACrC,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAQxC"}
|
|
@@ -6,13 +6,20 @@ import { ALL_DATABASE_ADAPTERS, ALL_STORAGE_ADAPTERS } from './types.js';
|
|
|
6
6
|
* Main orchestration function
|
|
7
7
|
*/ export function updatePackageJson(filePath, options) {
|
|
8
8
|
debug(`[AST] Updating package.json: ${filePath}`);
|
|
9
|
-
|
|
9
|
+
const prepared = preparePackageJson({
|
|
10
|
+
filePath,
|
|
11
|
+
options
|
|
12
|
+
});
|
|
13
|
+
fs.writeFileSync(prepared.filePath, prepared.content);
|
|
14
|
+
debug('[AST] ✓ package.json updated successfully');
|
|
15
|
+
}
|
|
16
|
+
export function preparePackageJson({ filePath, options }) {
|
|
10
17
|
const pkg = parsePackageJson(filePath);
|
|
11
|
-
// Phase 2: Transformation
|
|
12
18
|
const transformed = transformPackageJson(pkg, options);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
return {
|
|
20
|
+
content: `${JSON.stringify(transformed, null, 2)}\n`,
|
|
21
|
+
filePath
|
|
22
|
+
};
|
|
16
23
|
}
|
|
17
24
|
// Helper functions
|
|
18
25
|
function parsePackageJson(filePath) {
|
|
@@ -89,6 +96,28 @@ function parsePackageJson(filePath) {
|
|
|
89
96
|
debug('[AST] Sharp dependency not found (already absent)');
|
|
90
97
|
}
|
|
91
98
|
}
|
|
99
|
+
if (options.addDependencies) {
|
|
100
|
+
transformed.dependencies = {
|
|
101
|
+
...transformed.dependencies,
|
|
102
|
+
...options.addDependencies
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (options.removeDependencies) {
|
|
106
|
+
for (const dependencyGroup of [
|
|
107
|
+
'dependencies',
|
|
108
|
+
'devDependencies'
|
|
109
|
+
]){
|
|
110
|
+
if (!transformed[dependencyGroup]) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
transformed[dependencyGroup] = {
|
|
114
|
+
...transformed[dependencyGroup]
|
|
115
|
+
};
|
|
116
|
+
for (const packageName of options.removeDependencies){
|
|
117
|
+
delete transformed[dependencyGroup][packageName];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
92
121
|
// Update package name
|
|
93
122
|
if (options.packageName) {
|
|
94
123
|
debug(`[AST] Updated package name to: ${options.packageName}`);
|
|
@@ -96,8 +125,5 @@ function parsePackageJson(filePath) {
|
|
|
96
125
|
}
|
|
97
126
|
return transformed;
|
|
98
127
|
}
|
|
99
|
-
function writePackageJson(filePath, pkg) {
|
|
100
|
-
fs.writeFileSync(filePath, JSON.stringify(pkg, null, 2) + '\n');
|
|
101
|
-
}
|
|
102
128
|
|
|
103
129
|
//# sourceMappingURL=package-json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/ast/package-json.ts"],"sourcesContent":["import * as fs from 'fs'\n\nimport type { DatabaseAdapter, StorageAdapter } from './types.js'\n\nimport { debug } from '../../utils/log.js'\nimport { getDbPackageName, getStoragePackageName } from './adapter-config.js'\nimport { ALL_DATABASE_ADAPTERS, ALL_STORAGE_ADAPTERS } from './types.js'\n\ntype PackageJsonTransformOptions = {\n databaseAdapter?: DatabaseAdapter\n packageName?: string\n removeSharp?: boolean\n storageAdapter?: StorageAdapter\n}\n\ntype PackageJsonStructure = {\n [key: string]: unknown\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n name?: string\n}\n\n/**\n * Main orchestration function\n */\nexport function updatePackageJson(filePath: string, options: PackageJsonTransformOptions): void {\n debug(`[AST] Updating package.json: ${filePath}`)\n\n
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/ast/package-json.ts"],"sourcesContent":["import * as fs from 'fs'\n\nimport type { DatabaseAdapter, StorageAdapter } from './types.js'\n\nimport { debug } from '../../utils/log.js'\nimport { getDbPackageName, getStoragePackageName } from './adapter-config.js'\nimport { ALL_DATABASE_ADAPTERS, ALL_STORAGE_ADAPTERS } from './types.js'\n\ntype PackageJsonTransformOptions = {\n addDependencies?: Record<string, string>\n databaseAdapter?: DatabaseAdapter\n packageName?: string\n removeDependencies?: string[]\n removeSharp?: boolean\n storageAdapter?: StorageAdapter\n}\n\ntype PackageJsonStructure = {\n [key: string]: unknown\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n name?: string\n}\n\n/**\n * Main orchestration function\n */\nexport function updatePackageJson(filePath: string, options: PackageJsonTransformOptions): void {\n debug(`[AST] Updating package.json: ${filePath}`)\n\n const prepared = preparePackageJson({ filePath, options })\n fs.writeFileSync(prepared.filePath, prepared.content)\n\n debug('[AST] ✓ package.json updated successfully')\n}\n\nexport function preparePackageJson({\n filePath,\n options,\n}: {\n filePath: string\n options: PackageJsonTransformOptions\n}): { content: string; filePath: string } {\n const pkg = parsePackageJson(filePath)\n const transformed = transformPackageJson(pkg, options)\n\n return {\n content: `${JSON.stringify(transformed, null, 2)}\\n`,\n filePath,\n }\n}\n\n// Helper functions\n\nfunction parsePackageJson(filePath: string): PackageJsonStructure {\n const content = fs.readFileSync(filePath, 'utf-8')\n return JSON.parse(content)\n}\n\n/**\n * Transforms the package.json based upon provided options\n */\nfunction transformPackageJson(\n pkg: PackageJsonStructure,\n options: PackageJsonTransformOptions,\n): PackageJsonStructure {\n const transformed = { ...pkg }\n\n // Update database adapter\n if (options.databaseAdapter) {\n debug(`[AST] Updating package.json database adapter to: ${options.databaseAdapter}`)\n\n transformed.dependencies = { ...transformed.dependencies }\n\n const removedAdapters: string[] = []\n ALL_DATABASE_ADAPTERS.forEach((adapter) => {\n const pkgName = getDbPackageName(adapter)\n if (transformed.dependencies![pkgName]) {\n removedAdapters.push(pkgName)\n }\n delete transformed.dependencies![pkgName]\n })\n\n if (removedAdapters.length > 0) {\n debug(`[AST] Removed old adapter packages: ${removedAdapters.join(', ')}`)\n }\n\n // Add new adapter\n const dbAdapterPackageName = getDbPackageName(options.databaseAdapter)\n const payloadVersion = transformed.dependencies?.payload || '^3.0.0'\n transformed.dependencies[dbAdapterPackageName] = payloadVersion\n\n debug(`[AST] Added adapter package: ${dbAdapterPackageName}`)\n }\n\n // Update storage adapter\n if (options.storageAdapter) {\n debug(`[AST] Updating package.json storage adapter to: ${options.storageAdapter}`)\n\n transformed.dependencies = { ...transformed.dependencies }\n\n const removedAdapters: string[] = []\n ALL_STORAGE_ADAPTERS.forEach((adapter) => {\n const pkgName = getStoragePackageName(adapter)\n if (pkgName && transformed.dependencies![pkgName]) {\n removedAdapters.push(pkgName)\n }\n if (pkgName) {\n delete transformed.dependencies![pkgName]\n }\n })\n\n if (removedAdapters.length > 0) {\n debug(`[AST] Removed old storage adapter packages: ${removedAdapters.join(', ')}`)\n }\n\n // Add new storage adapter (if not localDisk)\n const storagePackageName = getStoragePackageName(options.storageAdapter)\n if (storagePackageName) {\n const payloadVersion = transformed.dependencies?.payload || '^3.0.0'\n transformed.dependencies[storagePackageName] = payloadVersion\n debug(`[AST] Added storage adapter package: ${storagePackageName}`)\n } else {\n debug(`[AST] Storage adapter is localDisk, no package needed`)\n }\n }\n\n // Remove sharp\n if (options.removeSharp && transformed.dependencies) {\n transformed.dependencies = { ...transformed.dependencies }\n if (transformed.dependencies.sharp) {\n delete transformed.dependencies.sharp\n debug('[AST] Removed sharp dependency')\n } else {\n debug('[AST] Sharp dependency not found (already absent)')\n }\n }\n\n if (options.addDependencies) {\n transformed.dependencies = {\n ...transformed.dependencies,\n ...options.addDependencies,\n }\n }\n\n if (options.removeDependencies) {\n for (const dependencyGroup of ['dependencies', 'devDependencies'] as const) {\n if (!transformed[dependencyGroup]) {\n continue\n }\n\n transformed[dependencyGroup] = { ...transformed[dependencyGroup] }\n for (const packageName of options.removeDependencies) {\n delete transformed[dependencyGroup][packageName]\n }\n }\n }\n\n // Update package name\n if (options.packageName) {\n debug(`[AST] Updated package name to: ${options.packageName}`)\n transformed.name = options.packageName\n }\n\n return transformed\n}\n"],"names":["fs","debug","getDbPackageName","getStoragePackageName","ALL_DATABASE_ADAPTERS","ALL_STORAGE_ADAPTERS","updatePackageJson","filePath","options","prepared","preparePackageJson","writeFileSync","content","pkg","parsePackageJson","transformed","transformPackageJson","JSON","stringify","readFileSync","parse","databaseAdapter","dependencies","removedAdapters","forEach","adapter","pkgName","push","length","join","dbAdapterPackageName","payloadVersion","payload","storageAdapter","storagePackageName","removeSharp","sharp","addDependencies","removeDependencies","dependencyGroup","packageName","name"],"mappings":"AAAA,YAAYA,QAAQ,KAAI;AAIxB,SAASC,KAAK,QAAQ,qBAAoB;AAC1C,SAASC,gBAAgB,EAAEC,qBAAqB,QAAQ,sBAAqB;AAC7E,SAASC,qBAAqB,EAAEC,oBAAoB,QAAQ,aAAY;AAkBxE;;CAEC,GACD,OAAO,SAASC,kBAAkBC,QAAgB,EAAEC,OAAoC;IACtFP,MAAM,CAAC,6BAA6B,EAAEM,UAAU;IAEhD,MAAME,WAAWC,mBAAmB;QAAEH;QAAUC;IAAQ;IACxDR,GAAGW,aAAa,CAACF,SAASF,QAAQ,EAAEE,SAASG,OAAO;IAEpDX,MAAM;AACR;AAEA,OAAO,SAASS,mBAAmB,EACjCH,QAAQ,EACRC,OAAO,EAIR;IACC,MAAMK,MAAMC,iBAAiBP;IAC7B,MAAMQ,cAAcC,qBAAqBH,KAAKL;IAE9C,OAAO;QACLI,SAAS,GAAGK,KAAKC,SAAS,CAACH,aAAa,MAAM,GAAG,EAAE,CAAC;QACpDR;IACF;AACF;AAEA,mBAAmB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D,OAAOvB,WAAW,CAACwB,gBAAgB,CAACC,YAAY;YAClD;QACF;IACF;IAEA,sBAAsB;IACtB,IAAIhC,QAAQgC,WAAW,EAAE;QACvBvC,MAAM,CAAC,+BAA+B,EAAEO,QAAQgC,WAAW,EAAE;QAC7DzB,YAAY0B,IAAI,GAAGjC,QAAQgC,WAAW;IACxC;IAEA,OAAOzB;AACT"}
|
package/dist/lib/ast/types.d.ts
CHANGED
|
@@ -94,8 +94,8 @@ export type ModificationResult = {
|
|
|
94
94
|
warnings?: string[];
|
|
95
95
|
};
|
|
96
96
|
export type DatabaseAdapter = (typeof ALL_DATABASE_ADAPTERS)[number];
|
|
97
|
-
export declare const ALL_DATABASE_ADAPTERS: readonly [
|
|
98
|
-
export declare const ALL_STORAGE_ADAPTERS: readonly [
|
|
97
|
+
export declare const ALL_DATABASE_ADAPTERS: readonly ['mongodb', 'postgres', 'sqlite', 'vercel-postgres', 'd1-sqlite'];
|
|
98
|
+
export declare const ALL_STORAGE_ADAPTERS: readonly ['azureStorage', 'gcsStorage', 'localDisk', 'r2Storage', 's3Storage', 'vercelBlobStorage'];
|
|
99
99
|
export type StorageAdapter = (typeof ALL_STORAGE_ADAPTERS)[number];
|
|
100
100
|
export type TransformOptions = {
|
|
101
101
|
databaseAdapter?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/ast/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACX,MAAM,UAAU,CAAA;AAGjB,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,YAAY,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,EAAE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,EACR,iBAAiB,EACjB,WAAW,CACH,CAAA;AAEV,eAAO,MAAM,oBAAoB,YAC/B,cAAc,EACd,YAAY,EACZ,WAAW,EACX,WAAW,EACX,WAAW,EACX,mBAAmB,CACX,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAElE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,eAAe,CAAC,EAAE;QAChB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,EAAE,eAAe,CAAA;KACtB,CAAA;IACD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,cAAc,CAAC,EAAE;QACf,IAAI,EAAE,cAAc,CAAA;KACrB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,CAAC,EAAE;QACH,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,EAAE,eAAe,CAAA;KACtB,CAAA;IACD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,cAAc,CAAA;CACzB,GAAG,YAAY,CAAA"}
|
package/dist/lib/ast/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/ast/types.ts"],"sourcesContent":["import type {\n ArrayLiteralExpression,\n CallExpression,\n ImportDeclaration,\n PropertyAssignment,\n SourceFile,\n} from 'ts-morph'\n\n// Result types for import utility functions\nexport type ImportRemovalResult = {\n removedIndex?: number\n sourceFile: SourceFile\n}\n\nexport type NamedImportRemovalResult = {\n fullyRemoved: boolean\n index?: number\n sourceFile: SourceFile\n}\n\nexport type ImportCleanupResult = {\n kept: string[]\n removed: string[]\n sourceFile: SourceFile\n}\n\nexport type DetectionError = {\n debugInfo?: Record<string, unknown>\n technicalDetails: string\n userMessage: string\n}\n\nexport type PayloadConfigStructures = {\n buildConfigCall: CallExpression\n dbProperty?: PropertyAssignment\n importStatements: ImportDeclaration[]\n pluginsArray?: ArrayLiteralExpression\n}\n\n/**\n * Detection result with edge case tracking and import source information\n */\nexport type DetectionResult = {\n /** Edge case flags */\n edgeCases?: {\n /** Import uses an alias (e.g., import { buildConfig as bc }) */\n hasImportAlias: boolean\n /** Other Payload imports exist (e.g., CollectionConfig) */\n hasOtherPayloadImports: boolean\n /** Multiple buildConfig calls found in file */\n multipleBuildConfigCalls: boolean\n /** Needs manual intervention (can't be automatically handled) */\n needsManualIntervention: boolean\n }\n error?: DetectionError\n /** Import source tracking */\n importSources?: {\n /** Current database adapter import info */\n dbAdapter?: {\n hasOtherImports: boolean\n importDeclaration: ImportDeclaration\n packageName: string\n }\n /** Current storage adapter import info */\n storage?: Array<{\n hasOtherImports: boolean\n importDeclaration: ImportDeclaration\n packageName: string\n }>\n }\n /** Source file reference */\n sourceFile?: SourceFile\n /** Detected structures */\n structures?: PayloadConfigStructures\n success: boolean\n}\n\n/**\n * Tracks a single modification made to the AST\n */\nexport type Modification = {\n description: string\n location?: {\n column: number\n line: number\n }\n type:\n | 'function-renamed'\n | 'import-added'\n | 'import-modified'\n | 'import-removed'\n | 'property-added'\n | 'property-removed'\n}\n\n/**\n * Result of transformation operations\n */\nexport type TransformationResult = {\n error?: DetectionError\n modifications: Modification[]\n modified: boolean\n success: boolean\n warnings?: string[]\n}\n\n/**\n * Final result after writing to disk\n */\nexport type ModificationResult = {\n error?: DetectionError\n filePath: string\n formatted?: boolean\n modifications: Modification[]\n success: boolean\n warnings?: string[]\n}\nexport type DatabaseAdapter = (typeof ALL_DATABASE_ADAPTERS)[number]\n\nexport const ALL_DATABASE_ADAPTERS = [\n 'mongodb',\n 'postgres',\n 'sqlite',\n 'vercel-postgres',\n 'd1-sqlite',\n] as const\n\nexport const ALL_STORAGE_ADAPTERS = [\n 'azureStorage',\n 'gcsStorage',\n 'localDisk',\n 'r2Storage',\n 's3Storage',\n '
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/ast/types.ts"],"sourcesContent":["import type {\n ArrayLiteralExpression,\n CallExpression,\n ImportDeclaration,\n PropertyAssignment,\n SourceFile,\n} from 'ts-morph'\n\n// Result types for import utility functions\nexport type ImportRemovalResult = {\n removedIndex?: number\n sourceFile: SourceFile\n}\n\nexport type NamedImportRemovalResult = {\n fullyRemoved: boolean\n index?: number\n sourceFile: SourceFile\n}\n\nexport type ImportCleanupResult = {\n kept: string[]\n removed: string[]\n sourceFile: SourceFile\n}\n\nexport type DetectionError = {\n debugInfo?: Record<string, unknown>\n technicalDetails: string\n userMessage: string\n}\n\nexport type PayloadConfigStructures = {\n buildConfigCall: CallExpression\n dbProperty?: PropertyAssignment\n importStatements: ImportDeclaration[]\n pluginsArray?: ArrayLiteralExpression\n}\n\n/**\n * Detection result with edge case tracking and import source information\n */\nexport type DetectionResult = {\n /** Edge case flags */\n edgeCases?: {\n /** Import uses an alias (e.g., import { buildConfig as bc }) */\n hasImportAlias: boolean\n /** Other Payload imports exist (e.g., CollectionConfig) */\n hasOtherPayloadImports: boolean\n /** Multiple buildConfig calls found in file */\n multipleBuildConfigCalls: boolean\n /** Needs manual intervention (can't be automatically handled) */\n needsManualIntervention: boolean\n }\n error?: DetectionError\n /** Import source tracking */\n importSources?: {\n /** Current database adapter import info */\n dbAdapter?: {\n hasOtherImports: boolean\n importDeclaration: ImportDeclaration\n packageName: string\n }\n /** Current storage adapter import info */\n storage?: Array<{\n hasOtherImports: boolean\n importDeclaration: ImportDeclaration\n packageName: string\n }>\n }\n /** Source file reference */\n sourceFile?: SourceFile\n /** Detected structures */\n structures?: PayloadConfigStructures\n success: boolean\n}\n\n/**\n * Tracks a single modification made to the AST\n */\nexport type Modification = {\n description: string\n location?: {\n column: number\n line: number\n }\n type:\n | 'function-renamed'\n | 'import-added'\n | 'import-modified'\n | 'import-removed'\n | 'property-added'\n | 'property-removed'\n}\n\n/**\n * Result of transformation operations\n */\nexport type TransformationResult = {\n error?: DetectionError\n modifications: Modification[]\n modified: boolean\n success: boolean\n warnings?: string[]\n}\n\n/**\n * Final result after writing to disk\n */\nexport type ModificationResult = {\n error?: DetectionError\n filePath: string\n formatted?: boolean\n modifications: Modification[]\n success: boolean\n warnings?: string[]\n}\nexport type DatabaseAdapter = (typeof ALL_DATABASE_ADAPTERS)[number]\n\nexport const ALL_DATABASE_ADAPTERS = [\n 'mongodb',\n 'postgres',\n 'sqlite',\n 'vercel-postgres',\n 'd1-sqlite',\n] as const\n\nexport const ALL_STORAGE_ADAPTERS = [\n 'azureStorage',\n 'gcsStorage',\n 'localDisk',\n 'r2Storage',\n 's3Storage',\n 'vercelBlobStorage',\n] as const\n\nexport type StorageAdapter = (typeof ALL_STORAGE_ADAPTERS)[number]\n\nexport type TransformOptions = {\n databaseAdapter?: {\n envVarName?: string\n type: DatabaseAdapter\n }\n removeSharp?: boolean\n storageAdapter?: {\n type: StorageAdapter\n }\n}\n\nexport type WriteOptions = {\n formatWithPrettier?: boolean\n validateStructure?: boolean\n}\n\nexport type WriteResult = {\n error?: DetectionError\n success: boolean\n}\n\nexport type ConfigureOptions = {\n db?: {\n envVarName?: string\n type: DatabaseAdapter\n }\n removeSharp?: boolean\n storage?: StorageAdapter\n} & WriteOptions\n"],"names":["ALL_DATABASE_ADAPTERS","ALL_STORAGE_ADAPTERS"],"mappings":"AAuHA,OAAO,MAAMA,wBAAwB;IACnC;IACA;IACA;IACA;IACA;CACD,CAAS;AAEV,OAAO,MAAMC,uBAAuB;IAClC;IACA;IACA;IACA;IACA;IACA;CACD,CAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure-payload-tsconfig.d.ts","sourceRoot":"","sources":["../../src/lib/configure-payload-tsconfig.ts"],"names":[],"mappings":"AAaA,wBAAsB,wBAAwB,CAAC,EAC7C,UAAU,EACV,iBAAiB,GAClB,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BhB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { parse, stringify } from 'comment-json';
|
|
2
|
+
import fse from 'fs-extra';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { warning } from '../utils/log.js';
|
|
5
|
+
export async function configurePayloadTsConfig({ configPath, payloadConfigPath }) {
|
|
6
|
+
if (!await fse.pathExists(configPath)) {
|
|
7
|
+
warning('Could not find tsconfig.json to add @payload-config path.');
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const content = await fse.readFile(configPath, 'utf8');
|
|
11
|
+
const tsConfig = parse(content);
|
|
12
|
+
tsConfig.compilerOptions ??= {};
|
|
13
|
+
tsConfig.compilerOptions.paths ??= {};
|
|
14
|
+
if (tsConfig.compilerOptions.paths['@payload-config']) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const baseUrlPath = path.resolve(path.dirname(configPath), tsConfig.compilerOptions.baseUrl ?? '.');
|
|
18
|
+
const relativePayloadConfigPath = path.relative(baseUrlPath, payloadConfigPath).split(path.sep).join('/');
|
|
19
|
+
const payloadAliasPath = relativePayloadConfigPath.startsWith('.') ? relativePayloadConfigPath : `./${relativePayloadConfigPath}`;
|
|
20
|
+
tsConfig.compilerOptions.paths['@payload-config'] = [
|
|
21
|
+
payloadAliasPath
|
|
22
|
+
];
|
|
23
|
+
await fse.writeFile(configPath, stringify(tsConfig, null, 2), 'utf8');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=configure-payload-tsconfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/configure-payload-tsconfig.ts"],"sourcesContent":["import { parse, stringify } from 'comment-json'\nimport fse from 'fs-extra'\nimport path from 'node:path'\n\nimport { warning } from '../utils/log.js'\n\ntype TsConfig = {\n compilerOptions?: {\n baseUrl?: string\n paths?: Record<string, string[]>\n }\n}\n\nexport async function configurePayloadTsConfig({\n configPath,\n payloadConfigPath,\n}: {\n configPath: string\n payloadConfigPath: string\n}): Promise<void> {\n if (!(await fse.pathExists(configPath))) {\n warning('Could not find tsconfig.json to add @payload-config path.')\n return\n }\n\n const content = await fse.readFile(configPath, 'utf8')\n const tsConfig = parse(content) as TsConfig\n\n tsConfig.compilerOptions ??= {}\n tsConfig.compilerOptions.paths ??= {}\n\n if (tsConfig.compilerOptions.paths['@payload-config']) {\n return\n }\n\n const baseUrlPath = path.resolve(\n path.dirname(configPath),\n tsConfig.compilerOptions.baseUrl ?? '.',\n )\n const relativePayloadConfigPath = path\n .relative(baseUrlPath, payloadConfigPath)\n .split(path.sep)\n .join('/')\n const payloadAliasPath = relativePayloadConfigPath.startsWith('.')\n ? relativePayloadConfigPath\n : `./${relativePayloadConfigPath}`\n\n tsConfig.compilerOptions.paths['@payload-config'] = [payloadAliasPath]\n await fse.writeFile(configPath, stringify(tsConfig, null, 2), 'utf8')\n}\n"],"names":["parse","stringify","fse","path","warning","configurePayloadTsConfig","configPath","payloadConfigPath","pathExists","content","readFile","tsConfig","compilerOptions","paths","baseUrlPath","resolve","dirname","baseUrl","relativePayloadConfigPath","relative","split","sep","join","payloadAliasPath","startsWith","writeFile"],"mappings":"AAAA,SAASA,KAAK,EAAEC,SAAS,QAAQ,eAAc;AAC/C,OAAOC,SAAS,WAAU;AAC1B,OAAOC,UAAU,YAAW;AAE5B,SAASC,OAAO,QAAQ,kBAAiB;AASzC,OAAO,eAAeC,yBAAyB,EAC7CC,UAAU,EACVC,iBAAiB,EAIlB;IACC,IAAI,CAAE,MAAML,IAAIM,UAAU,CAACF,aAAc;QACvCF,QAAQ;QACR;IACF;IAEA,MAAMK,UAAU,MAAMP,IAAIQ,QAAQ,CAACJ,YAAY;IAC/C,MAAMK,WAAWX,MAAMS;IAEvBE,SAASC,eAAe,KAAK,CAAC;IAC9BD,SAASC,eAAe,CAACC,KAAK,KAAK,CAAC;IAEpC,IAAIF,SAASC,eAAe,CAACC,KAAK,CAAC,kBAAkB,EAAE;QACrD;IACF;IAEA,MAAMC,cAAcX,KAAKY,OAAO,CAC9BZ,KAAKa,OAAO,CAACV,aACbK,SAASC,eAAe,CAACK,OAAO,IAAI;IAEtC,MAAMC,4BAA4Bf,KAC/BgB,QAAQ,CAACL,aAAaP,mBACtBa,KAAK,CAACjB,KAAKkB,GAAG,EACdC,IAAI,CAAC;IACR,MAAMC,mBAAmBL,0BAA0BM,UAAU,CAAC,OAC1DN,4BACA,CAAC,EAAE,EAAEA,2BAA2B;IAEpCP,SAASC,eAAe,CAACC,KAAK,CAAC,kBAAkB,GAAG;QAACU;KAAiB;IACtE,MAAMrB,IAAIuB,SAAS,CAACnB,YAAYL,UAAUU,UAAU,MAAM,IAAI;AAChE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure-plugin-project.d.ts","sourceRoot":"","sources":["../../src/lib/configure-plugin-project.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"configure-plugin-project.d.ts","sourceRoot":"","sources":["../../src/lib/configure-plugin-project.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,sBAAsB,qCAGhC;IACD,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;CACpB,SAmCA,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PackageManager } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* pnpm v11 fails installs that have unapproved dependency build scripts, reading approvals only from
|
|
4
|
+
* pnpm-workspace.yaml (the `pnpm` field in package.json is ignored). create-next-app now scaffolds a
|
|
5
|
+
* placeholder `allowBuilds` block (sharp/unrs-resolver left unset) plus an `ignoredBuiltDependencies`
|
|
6
|
+
* denylist, so we must merge rather than skip: force Payload's build scripts to `true` and remove them
|
|
7
|
+
* from the denylist. No-op for non-pnpm package managers.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ensurePnpmBuildApprovals(args: {
|
|
10
|
+
packageManager: PackageManager;
|
|
11
|
+
projectDir: string;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Merges Payload's required build approvals into a pnpm-workspace.yaml string. Pure and idempotent:
|
|
15
|
+
* sets each required package to `true` under `allowBuilds` (adding the block if missing) and strips
|
|
16
|
+
* those packages from any `ignoredBuiltDependencies` denylist. Top-level keys are detected by a
|
|
17
|
+
* zero-indent `key:`, with their two-space children grouped beneath them.
|
|
18
|
+
*/
|
|
19
|
+
export declare function upsertBuildApprovals(content: string): string;
|
|
20
|
+
//# sourceMappingURL=configure-pnpm-builds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure-pnpm-builds.d.ts","sourceRoot":"","sources":["../../src/lib/configure-pnpm-builds.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAWjD;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE;IACnD,cAAc,EAAE,cAAc,CAAA;IAC9B,UAAU,EAAE,MAAM,CAAA;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAYhB;AAOD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAkC5D"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import fse from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
/*
|
|
4
|
+
* Build scripts pnpm v11 must be allowed to run for the projects create-payload-app scaffolds;
|
|
5
|
+
* otherwise the install fails with ERR_PNPM_IGNORED_BUILDS. esbuild/sharp/unrs-resolver cover the
|
|
6
|
+
* default templates; workerd is required by with-cloudflare-d1.
|
|
7
|
+
* TODO(follow-up): the CI drift guard only verifies the blank template — extend it across every
|
|
8
|
+
* getValidTemplates() entry so this single list can't drift per-template.
|
|
9
|
+
*/ const ALLOWED_BUILDS = [
|
|
10
|
+
'esbuild',
|
|
11
|
+
'sharp',
|
|
12
|
+
'unrs-resolver',
|
|
13
|
+
'workerd'
|
|
14
|
+
];
|
|
15
|
+
/**
|
|
16
|
+
* pnpm v11 fails installs that have unapproved dependency build scripts, reading approvals only from
|
|
17
|
+
* pnpm-workspace.yaml (the `pnpm` field in package.json is ignored). create-next-app now scaffolds a
|
|
18
|
+
* placeholder `allowBuilds` block (sharp/unrs-resolver left unset) plus an `ignoredBuiltDependencies`
|
|
19
|
+
* denylist, so we must merge rather than skip: force Payload's build scripts to `true` and remove them
|
|
20
|
+
* from the denylist. No-op for non-pnpm package managers.
|
|
21
|
+
*/ export async function ensurePnpmBuildApprovals(args) {
|
|
22
|
+
const { packageManager, projectDir } = args;
|
|
23
|
+
if (packageManager !== 'pnpm') {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const workspacePath = path.join(projectDir, 'pnpm-workspace.yaml');
|
|
27
|
+
const existing = await fse.pathExists(workspacePath) ? await fse.readFile(workspacePath, 'utf-8') : '';
|
|
28
|
+
await fse.writeFile(workspacePath, upsertBuildApprovals(existing));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Merges Payload's required build approvals into a pnpm-workspace.yaml string. Pure and idempotent:
|
|
32
|
+
* sets each required package to `true` under `allowBuilds` (adding the block if missing) and strips
|
|
33
|
+
* those packages from any `ignoredBuiltDependencies` denylist. Top-level keys are detected by a
|
|
34
|
+
* zero-indent `key:`, with their two-space children grouped beneath them.
|
|
35
|
+
*/ export function upsertBuildApprovals(content) {
|
|
36
|
+
const blocks = toTopLevelBlocks(content);
|
|
37
|
+
const ignored = blocks.find((block)=>block.key === 'ignoredBuiltDependencies');
|
|
38
|
+
if (ignored) {
|
|
39
|
+
ignored.lines = ignored.lines.filter((line, index)=>{
|
|
40
|
+
if (index === 0) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
const name = /^\s*-\s*'?([^'\s]+)'?\s*$/.exec(line)?.[1];
|
|
44
|
+
return !(name && ALLOWED_BUILDS.includes(name));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const allow = blocks.find((block)=>block.key === 'allowBuilds');
|
|
48
|
+
if (allow) {
|
|
49
|
+
for (const name of ALLOWED_BUILDS){
|
|
50
|
+
const pattern = new RegExp(`^\\s+'?${escapeRegExp(name)}'?:`);
|
|
51
|
+
const index = allow.lines.findIndex((line)=>pattern.test(line));
|
|
52
|
+
if (index >= 0) {
|
|
53
|
+
allow.lines[index] = ` ${name}: true`;
|
|
54
|
+
} else {
|
|
55
|
+
allow.lines.push(` ${name}: true`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
blocks.push({
|
|
60
|
+
key: 'allowBuilds',
|
|
61
|
+
lines: [
|
|
62
|
+
'allowBuilds:',
|
|
63
|
+
...ALLOWED_BUILDS.map((name)=>` ${name}: true`)
|
|
64
|
+
]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const output = blocks.flatMap((block)=>block.lines).join('\n');
|
|
68
|
+
return output.endsWith('\n') ? output : `${output}\n`;
|
|
69
|
+
}
|
|
70
|
+
function toTopLevelBlocks(content) {
|
|
71
|
+
const lines = content.length ? content.replace(/\n$/, '').split('\n') : [];
|
|
72
|
+
const blocks = [];
|
|
73
|
+
for (const line of lines){
|
|
74
|
+
const key = /^[^\s#]/.test(line) ? /^([^:]+):/.exec(line)?.[1] : undefined;
|
|
75
|
+
const current = blocks[blocks.length - 1];
|
|
76
|
+
if (key !== undefined) {
|
|
77
|
+
blocks.push({
|
|
78
|
+
key,
|
|
79
|
+
lines: [
|
|
80
|
+
line
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
} else if (current) {
|
|
84
|
+
current.lines.push(line);
|
|
85
|
+
} else {
|
|
86
|
+
blocks.push({
|
|
87
|
+
key: null,
|
|
88
|
+
lines: [
|
|
89
|
+
line
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return blocks;
|
|
95
|
+
}
|
|
96
|
+
function escapeRegExp(value) {
|
|
97
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=configure-pnpm-builds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/configure-pnpm-builds.ts"],"sourcesContent":["import fse from 'fs-extra'\nimport path from 'path'\n\nimport type { PackageManager } from '../types.js'\n\n/*\n * Build scripts pnpm v11 must be allowed to run for the projects create-payload-app scaffolds;\n * otherwise the install fails with ERR_PNPM_IGNORED_BUILDS. esbuild/sharp/unrs-resolver cover the\n * default templates; workerd is required by with-cloudflare-d1.\n * TODO(follow-up): the CI drift guard only verifies the blank template — extend it across every\n * getValidTemplates() entry so this single list can't drift per-template.\n */\nconst ALLOWED_BUILDS = ['esbuild', 'sharp', 'unrs-resolver', 'workerd']\n\n/**\n * pnpm v11 fails installs that have unapproved dependency build scripts, reading approvals only from\n * pnpm-workspace.yaml (the `pnpm` field in package.json is ignored). create-next-app now scaffolds a\n * placeholder `allowBuilds` block (sharp/unrs-resolver left unset) plus an `ignoredBuiltDependencies`\n * denylist, so we must merge rather than skip: force Payload's build scripts to `true` and remove them\n * from the denylist. No-op for non-pnpm package managers.\n */\nexport async function ensurePnpmBuildApprovals(args: {\n packageManager: PackageManager\n projectDir: string\n}): Promise<void> {\n const { packageManager, projectDir } = args\n if (packageManager !== 'pnpm') {\n return\n }\n\n const workspacePath = path.join(projectDir, 'pnpm-workspace.yaml')\n const existing = (await fse.pathExists(workspacePath))\n ? await fse.readFile(workspacePath, 'utf-8')\n : ''\n\n await fse.writeFile(workspacePath, upsertBuildApprovals(existing))\n}\n\ntype WorkspaceBlock = {\n key: null | string\n lines: string[]\n}\n\n/**\n * Merges Payload's required build approvals into a pnpm-workspace.yaml string. Pure and idempotent:\n * sets each required package to `true` under `allowBuilds` (adding the block if missing) and strips\n * those packages from any `ignoredBuiltDependencies` denylist. Top-level keys are detected by a\n * zero-indent `key:`, with their two-space children grouped beneath them.\n */\nexport function upsertBuildApprovals(content: string): string {\n const blocks = toTopLevelBlocks(content)\n\n const ignored = blocks.find((block) => block.key === 'ignoredBuiltDependencies')\n if (ignored) {\n ignored.lines = ignored.lines.filter((line, index) => {\n if (index === 0) {\n return true\n }\n const name = /^\\s*-\\s*'?([^'\\s]+)'?\\s*$/.exec(line)?.[1]\n return !(name && ALLOWED_BUILDS.includes(name))\n })\n }\n\n const allow = blocks.find((block) => block.key === 'allowBuilds')\n if (allow) {\n for (const name of ALLOWED_BUILDS) {\n const pattern = new RegExp(`^\\\\s+'?${escapeRegExp(name)}'?:`)\n const index = allow.lines.findIndex((line) => pattern.test(line))\n if (index >= 0) {\n allow.lines[index] = ` ${name}: true`\n } else {\n allow.lines.push(` ${name}: true`)\n }\n }\n } else {\n blocks.push({\n key: 'allowBuilds',\n lines: ['allowBuilds:', ...ALLOWED_BUILDS.map((name) => ` ${name}: true`)],\n })\n }\n\n const output = blocks.flatMap((block) => block.lines).join('\\n')\n return output.endsWith('\\n') ? output : `${output}\\n`\n}\n\nfunction toTopLevelBlocks(content: string): WorkspaceBlock[] {\n const lines = content.length ? content.replace(/\\n$/, '').split('\\n') : []\n const blocks: WorkspaceBlock[] = []\n\n for (const line of lines) {\n const key = /^[^\\s#]/.test(line) ? /^([^:]+):/.exec(line)?.[1] : undefined\n const current = blocks[blocks.length - 1]\n if (key !== undefined) {\n blocks.push({ key, lines: [line] })\n } else if (current) {\n current.lines.push(line)\n } else {\n blocks.push({ key: null, lines: [line] })\n }\n }\n\n return blocks\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n"],"names":["fse","path","ALLOWED_BUILDS","ensurePnpmBuildApprovals","args","packageManager","projectDir","workspacePath","join","existing","pathExists","readFile","writeFile","upsertBuildApprovals","content","blocks","toTopLevelBlocks","ignored","find","block","key","lines","filter","line","index","name","exec","includes","allow","pattern","RegExp","escapeRegExp","findIndex","test","push","map","output","flatMap","endsWith","length","replace","split","undefined","current","value"],"mappings":"AAAA,OAAOA,SAAS,WAAU;AAC1B,OAAOC,UAAU,OAAM;AAIvB;;;;;;CAMC,GACD,MAAMC,iBAAiB;IAAC;IAAW;IAAS;IAAiB;CAAU;AAEvE;;;;;;CAMC,GACD,OAAO,eAAeC,yBAAyBC,IAG9C;IACC,MAAM,EAAEC,cAAc,EAAEC,UAAU,EAAE,GAAGF;IACvC,IAAIC,mBAAmB,QAAQ;QAC7B;IACF;IAEA,MAAME,gBAAgBN,KAAKO,IAAI,CAACF,YAAY;IAC5C,MAAMG,WAAW,AAAC,MAAMT,IAAIU,UAAU,CAACH,iBACnC,MAAMP,IAAIW,QAAQ,CAACJ,eAAe,WAClC;IAEJ,MAAMP,IAAIY,SAAS,CAACL,eAAeM,qBAAqBJ;AAC1D;AAOA;;;;;CAKC,GACD,OAAO,SAASI,qBAAqBC,OAAe;IAClD,MAAMC,SAASC,iBAAiBF;IAEhC,MAAMG,UAAUF,OAAOG,IAAI,CAAC,CAACC,QAAUA,MAAMC,GAAG,KAAK;IACrD,IAAIH,SAAS;QACXA,QAAQI,KAAK,GAAGJ,QAAQI,KAAK,CAACC,MAAM,CAAC,CAACC,MAAMC;YAC1C,IAAIA,UAAU,GAAG;gBACf,OAAO;YACT;YACA,MAAMC,OAAO,4BAA4BC,IAAI,CAACH,OAAO,CAAC,EAAE;YACxD,OAAO,CAAEE,CAAAA,QAAQvB,eAAeyB,QAAQ,CAACF,KAAI;QAC/C;IACF;IAEA,MAAMG,QAAQb,OAAOG,IAAI,CAAC,CAAC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,OAAO,IAAIoB,SAAS;YAClBA,QAAQtB,KAAK,CAACa,IAAI,CAACX;QACrB,OAAO;YACLR,OAAOmB,IAAI,CAAC;gBAAEd,KAAK;gBAAMC,OAAO;oBAACE;iBAAK;YAAC;QACzC;IACF;IAEA,OAAOR;AACT;AAEA,SAASgB,aAAaa,KAAa;IACjC,OAAOA,MAAMJ,OAAO,CAAC,uBAAuB;AAC9C"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CliArgs, DbDetails, PackageManager, ProjectExample, ProjectTemplate } from '../types.js';
|
|
2
2
|
type TemplateOrExample = {
|
|
3
3
|
example: ProjectExample;
|
|
4
4
|
} | {
|
|
5
5
|
template: ProjectTemplate;
|
|
6
6
|
};
|
|
7
7
|
export declare function createProject(args: {
|
|
8
|
-
agentType?: AgentType;
|
|
9
8
|
cliArgs: CliArgs;
|
|
10
9
|
dbDetails?: DbDetails;
|
|
11
10
|
packageManager: PackageManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-project.d.ts","sourceRoot":"","sources":["../../src/lib/create-project.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"create-project.d.ts","sourceRoot":"","sources":["../../src/lib/create-project.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EACT,cAAc,EACd,cAAc,EACd,eAAe,EAChB,MAAM,aAAa,CAAA;AA+GpB,KAAK,iBAAiB,GAClB;IACE,OAAO,EAAE,cAAc,CAAA;CACxB,GACD;IACE,QAAQ,EAAE,eAAe,CAAA;CAC1B,CAAA;AAEL,wBAAsB,aAAa,CACjC,IAAI,EAAE;IACJ,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,cAAc,EAAE,cAAc,CAAA;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;CACpB,GAAG,iBAAiB,GACpB,OAAO,CAAC,IAAI,CAAC,CA4Gf;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhB;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACrC,GAAG,IAAI,CAiBP"}
|