create-payload-app 3.15.2-canary.ee31a64 → 3.16.1-canary.9004205

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018-2024 Payload CMS, Inc. <info@payloadcms.com>
3
+ Copyright (c) 2018-2025 Payload CMS, Inc. <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
@@ -1 +1 @@
1
- {"version":3,"file":"manage-env-files.d.ts","sourceRoot":"","sources":["../../src/lib/manage-env-files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAkEnE,wDAAwD;AACxD,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC3B,GAAG,OAAO,CAAC,IAAI,CAAC,CAiDhB"}
1
+ {"version":3,"file":"manage-env-files.d.ts","sourceRoot":"","sources":["../../src/lib/manage-env-files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAkEnE,wDAAwD;AACxD,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC3B,GAAG,OAAO,CAAC,IAAI,CAAC,CAwDhB"}
@@ -39,6 +39,7 @@ const generateEnvContent = (existingEnv, databaseType, databaseUri, payloadSecre
39
39
  };
40
40
  /** Parse and swap .env.example values and write .env */ export async function manageEnvFiles(args) {
41
41
  const { cliArgs, databaseType, databaseUri, payloadSecret, projectDir, template } = args;
42
+ const debugFlag = cliArgs['--debug'];
42
43
  if (cliArgs['--dry-run']) {
43
44
  debug(`DRY RUN: Environment files managed`);
44
45
  return;
@@ -56,7 +57,9 @@ const generateEnvContent = (existingEnv, databaseType, databaseUri, payloadSecre
56
57
  const envExampleContents = await fs.readFile(envExamplePath, 'utf8');
57
58
  updatedExampleContents = updateEnvExampleVariables(envExampleContents, databaseType);
58
59
  await fs.writeFile(envExamplePath, updatedExampleContents.trimEnd() + '\n');
59
- debug(`.env.example file successfully updated`);
60
+ if (debugFlag) {
61
+ debug(`.env.example file successfully updated`);
62
+ }
60
63
  } else {
61
64
  updatedExampleContents = `# Added by Payload\nDATABASE_URI=your-connection-string-here\nPAYLOAD_SECRET=YOUR_SECRET_HERE\n`;
62
65
  await fs.writeFile(envExamplePath, updatedExampleContents.trimEnd() + '\n');
@@ -65,7 +68,9 @@ const generateEnvContent = (existingEnv, databaseType, databaseUri, payloadSecre
65
68
  const envExampleContents = await fs.readFile(envExamplePath, 'utf8');
66
69
  const envContent = generateEnvContent(envExampleContents, databaseType, databaseUri, payloadSecret);
67
70
  await fs.writeFile(envPath, `# Added by Payload\n${envContent.trimEnd()}\n`);
68
- debug(`.env file successfully created or updated`);
71
+ if (debugFlag) {
72
+ debug(`.env file successfully created or updated`);
73
+ }
69
74
  } catch (err) {
70
75
  error('Unable to manage environment files');
71
76
  if (err instanceof Error) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/manage-env-files.ts"],"sourcesContent":["import fs from 'fs-extra'\nimport path from 'path'\n\nimport type { CliArgs, DbType, ProjectTemplate } from '../types.js'\n\nimport { debug, error } from '../utils/log.js'\nimport { dbChoiceRecord } from './select-db.js'\n\nconst updateEnvExampleVariables = (contents: string, databaseType: DbType | undefined): string => {\n return contents\n .split('\\n')\n .map((line) => {\n if (line.startsWith('#') || !line.includes('=')) {\n return line // Preserve comments and unrelated lines\n }\n\n const [key] = line.split('=')\n\n if (key === 'DATABASE_URI' || key === 'POSTGRES_URL' || key === 'MONGODB_URI') {\n const dbChoice = databaseType ? dbChoiceRecord[databaseType] : null\n\n if (dbChoice) {\n const placeholderUri = `${dbChoice.dbConnectionPrefix}your-database-name${\n dbChoice.dbConnectionSuffix || ''\n }`\n return databaseType === 'vercel-postgres'\n ? `POSTGRES_URL=${placeholderUri}`\n : `DATABASE_URI=${placeholderUri}`\n }\n\n return `DATABASE_URI=your-database-connection-here` // Fallback\n }\n\n if (key === 'PAYLOAD_SECRET' || key === 'PAYLOAD_SECRET_KEY') {\n return `PAYLOAD_SECRET=YOUR_SECRET_HERE`\n }\n\n return line\n })\n .join('\\n')\n}\n\nconst generateEnvContent = (\n existingEnv: string,\n databaseType: DbType | undefined,\n databaseUri: string,\n payloadSecret: string,\n): string => {\n const dbKey = databaseType === 'vercel-postgres' ? 'POSTGRES_URL' : 'DATABASE_URI'\n\n const envVars: Record<string, string> = {}\n existingEnv\n .split('\\n')\n .filter((line) => line.includes('=') && !line.startsWith('#'))\n .forEach((line) => {\n const [key, value] = line.split('=')\n envVars[key] = value\n })\n\n // Override specific keys\n envVars[dbKey] = databaseUri\n envVars['PAYLOAD_SECRET'] = payloadSecret\n\n // Rebuild content\n return Object.entries(envVars)\n .map(([key, value]) => `${key}=${value}`)\n .join('\\n')\n}\n\n/** Parse and swap .env.example values and write .env */\nexport async function manageEnvFiles(args: {\n cliArgs: CliArgs\n databaseType?: DbType\n databaseUri: string\n payloadSecret: string\n projectDir: string\n template?: ProjectTemplate\n}): Promise<void> {\n const { cliArgs, databaseType, databaseUri, payloadSecret, projectDir, template } = args\n\n if (cliArgs['--dry-run']) {\n debug(`DRY RUN: Environment files managed`)\n return\n }\n\n const envExamplePath = path.join(projectDir, '.env.example')\n const envPath = path.join(projectDir, '.env')\n\n try {\n let updatedExampleContents: string\n\n // Update .env.example\n if (template?.type === 'starter') {\n if (!fs.existsSync(envExamplePath)) {\n error(`.env.example file not found at ${envExamplePath}`)\n process.exit(1)\n }\n\n const envExampleContents = await fs.readFile(envExamplePath, 'utf8')\n updatedExampleContents = updateEnvExampleVariables(envExampleContents, databaseType)\n\n await fs.writeFile(envExamplePath, updatedExampleContents.trimEnd() + '\\n')\n debug(`.env.example file successfully updated`)\n } else {\n updatedExampleContents = `# Added by Payload\\nDATABASE_URI=your-connection-string-here\\nPAYLOAD_SECRET=YOUR_SECRET_HERE\\n`\n await fs.writeFile(envExamplePath, updatedExampleContents.trimEnd() + '\\n')\n }\n\n // Merge existing variables and create or update .env\n const envExampleContents = await fs.readFile(envExamplePath, 'utf8')\n const envContent = generateEnvContent(\n envExampleContents,\n databaseType,\n databaseUri,\n payloadSecret,\n )\n await fs.writeFile(envPath, `# Added by Payload\\n${envContent.trimEnd()}\\n`)\n\n debug(`.env file successfully created or updated`)\n } catch (err: unknown) {\n error('Unable to manage environment files')\n if (err instanceof Error) {\n error(err.message)\n }\n process.exit(1)\n }\n}\n"],"names":["fs","path","debug","error","dbChoiceRecord","updateEnvExampleVariables","contents","databaseType","split","map","line","startsWith","includes","key","dbChoice","placeholderUri","dbConnectionPrefix","dbConnectionSuffix","join","generateEnvContent","existingEnv","databaseUri","payloadSecret","dbKey","envVars","filter","forEach","value","Object","entries","manageEnvFiles","args","cliArgs","projectDir","template","envExamplePath","envPath","updatedExampleContents","type","existsSync","process","exit","envExampleContents","readFile","writeFile","trimEnd","envContent","err","Error","message"],"mappings":"AAAA,OAAOA,QAAQ,WAAU;AACzB,OAAOC,UAAU,OAAM;AAIvB,SAASC,KAAK,EAAEC,KAAK,QAAQ,kBAAiB;AAC9C,SAASC,cAAc,QAAQ,iBAAgB;AAE/C,MAAMC,4BAA4B,CAACC,UAAkBC;IACnD,OA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C,MAAM;QACN,IAAI4C,eAAeC,OAAO;YACxB7C,MAAM4C,IAAIE,OAAO;QACnB;QACAT,QAAQC,IAAI,CAAC;IACf;AACF"}
1
+ {"version":3,"sources":["../../src/lib/manage-env-files.ts"],"sourcesContent":["import fs from 'fs-extra'\nimport path from 'path'\n\nimport type { CliArgs, DbType, ProjectTemplate } from '../types.js'\n\nimport { debug, error } from '../utils/log.js'\nimport { dbChoiceRecord } from './select-db.js'\n\nconst updateEnvExampleVariables = (contents: string, databaseType: DbType | undefined): string => {\n return contents\n .split('\\n')\n .map((line) => {\n if (line.startsWith('#') || !line.includes('=')) {\n return line // Preserve comments and unrelated lines\n }\n\n const [key] = line.split('=')\n\n if (key === 'DATABASE_URI' || key === 'POSTGRES_URL' || key === 'MONGODB_URI') {\n const dbChoice = databaseType ? dbChoiceRecord[databaseType] : null\n\n if (dbChoice) {\n const placeholderUri = `${dbChoice.dbConnectionPrefix}your-database-name${\n dbChoice.dbConnectionSuffix || ''\n }`\n return databaseType === 'vercel-postgres'\n ? `POSTGRES_URL=${placeholderUri}`\n : `DATABASE_URI=${placeholderUri}`\n }\n\n return `DATABASE_URI=your-database-connection-here` // Fallback\n }\n\n if (key === 'PAYLOAD_SECRET' || key === 'PAYLOAD_SECRET_KEY') {\n return `PAYLOAD_SECRET=YOUR_SECRET_HERE`\n }\n\n return line\n })\n .join('\\n')\n}\n\nconst generateEnvContent = (\n existingEnv: string,\n databaseType: DbType | undefined,\n databaseUri: string,\n payloadSecret: string,\n): string => {\n const dbKey = databaseType === 'vercel-postgres' ? 'POSTGRES_URL' : 'DATABASE_URI'\n\n const envVars: Record<string, string> = {}\n existingEnv\n .split('\\n')\n .filter((line) => line.includes('=') && !line.startsWith('#'))\n .forEach((line) => {\n const [key, value] = line.split('=')\n envVars[key] = value\n })\n\n // Override specific keys\n envVars[dbKey] = databaseUri\n envVars['PAYLOAD_SECRET'] = payloadSecret\n\n // Rebuild content\n return Object.entries(envVars)\n .map(([key, value]) => `${key}=${value}`)\n .join('\\n')\n}\n\n/** Parse and swap .env.example values and write .env */\nexport async function manageEnvFiles(args: {\n cliArgs: CliArgs\n databaseType?: DbType\n databaseUri: string\n payloadSecret: string\n projectDir: string\n template?: ProjectTemplate\n}): Promise<void> {\n const { cliArgs, databaseType, databaseUri, payloadSecret, projectDir, template } = args\n\n const debugFlag = cliArgs['--debug']\n\n if (cliArgs['--dry-run']) {\n debug(`DRY RUN: Environment files managed`)\n return\n }\n\n const envExamplePath = path.join(projectDir, '.env.example')\n const envPath = path.join(projectDir, '.env')\n\n try {\n let updatedExampleContents: string\n\n // Update .env.example\n if (template?.type === 'starter') {\n if (!fs.existsSync(envExamplePath)) {\n error(`.env.example file not found at ${envExamplePath}`)\n process.exit(1)\n }\n\n const envExampleContents = await fs.readFile(envExamplePath, 'utf8')\n updatedExampleContents = updateEnvExampleVariables(envExampleContents, databaseType)\n\n await fs.writeFile(envExamplePath, updatedExampleContents.trimEnd() + '\\n')\n\n if (debugFlag) {\n debug(`.env.example file successfully updated`)\n }\n } else {\n updatedExampleContents = `# Added by Payload\\nDATABASE_URI=your-connection-string-here\\nPAYLOAD_SECRET=YOUR_SECRET_HERE\\n`\n await fs.writeFile(envExamplePath, updatedExampleContents.trimEnd() + '\\n')\n }\n\n // Merge existing variables and create or update .env\n const envExampleContents = await fs.readFile(envExamplePath, 'utf8')\n const envContent = generateEnvContent(\n envExampleContents,\n databaseType,\n databaseUri,\n payloadSecret,\n )\n await fs.writeFile(envPath, `# Added by Payload\\n${envContent.trimEnd()}\\n`)\n\n if (debugFlag) {\n debug(`.env file successfully created or updated`)\n }\n } catch (err: unknown) {\n error('Unable to manage environment files')\n if (err instanceof Error) {\n error(err.message)\n }\n process.exit(1)\n }\n}\n"],"names":["fs","path","debug","error","dbChoiceRecord","updateEnvExampleVariables","contents","databaseType","split","map","line","startsWith","includes","key","dbChoice","placeholderUri","dbConnectionPrefix","dbConnectionSuffix","join","generateEnvContent","existingEnv","databaseUri","payloadSecret","dbKey","envVars","filter","forEach","value","Object","entries","manageEnvFiles","args","cliArgs","projectDir","template","debugFlag","envExamplePath","envPath","updatedExampleContents","type","existsSync","process","exit","envExampleContents","readFile","writeFile","trimEnd","envContent","err","Error","message"],"mappings":"AAAA,OAAOA,QAAQ,WAAU;AACzB,OAAOC,UAAU,OAAM;AAIvB,SAASC,KAAK,EAAEC,KAAK,QAAQ,kBAAiB;AAC9C,SAASC,cAAc,QAAQ,iBAAgB;AAE/C,MAAMC,4BAA4B,CAACC,UAAkBC;IACnD,OAAOD,SACJE,KAAK,CAAC,MACNC,GAAG,CAAC,CAACC;QACJ,IAAIA,KAAKC,UAAU,CAAC,QAAQ,CAACD,KAAKE,QAAQ,CAAC,MAAM;YAC/C,OAAOF,KAAK,wCAAwC;;QACtD;QAEA,MAAM,CAACG,IAAI,GAAGH,KAAKF,KAAK,CAAC;QAEzB,IAAIK,QAAQ,kBAAkBA,QAAQ,kBAAkBA,QAAQ,eAAe;YAC7E,MAAMC,WAAWP,eAAeH,cAAc,CAACG,aAAa,GAAG;YAE/D,IAAIO,UAAU;gBACZ,MAAMC,iBAAiB,GAAGD,SAASE,kBAAkB,CAAC,kBAAkB,EACtEF,SAASG,kBAAkB,IAAI,IAC/B;gBACF,OAAOV,iBAAiB,oBACpB,CAAC,aAAa,EAAEQ,gBAAgB,GAChC,CAAC,aAAa,EAAEA,gBAAgB;YACtC;YAEA,OAAO,CAAC,0CAA0C,CAAC,CAAC,WAAW;;QACjE;QAEA,IAAIF,QAAQ,oBAAoBA,QAAQ,sBAAsB;YAC5D,OAAO,CAAC,+BAA+B,CAAC;QAC1C;QAEA,OAAOH;IACT,GACCQ,IAAI,CAAC;AACV;AAEA,MAAMC,qBAAqB,CACzBC,aACAb,cACAc,aACAC;IAEA,MAAMC,QAAQhB,iBAAiB,oBAAoB,iBAAiB;IAEpE,MAAMiB,UAAkC,CAAC;IACzCJ,YACGZ,KAAK,CAAC,MACNiB,MAAM,CAAC,CAACf,OAASA,KAAKE,QAA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C,yBAAyB,CAAC,+FAA+F,CAAC;YAC1H,MAAMtC,GAAG6C,SAAS,CAACT,gBAAgBE,uBAAuBQ,OAAO,KAAK;QACxE;QAEA,qDAAqD;QACrD,MAAMH,qBAAqB,MAAM3C,GAAG4C,QAAQ,CAACR,gBAAgB;QAC7D,MAAMW,aAAa5B,mBACjBwB,oBACApC,cACAc,aACAC;QAEF,MAAMtB,GAAG6C,SAAS,CAACR,SAAS,CAAC,oBAAoB,EAAEU,WAAWD,OAAO,GAAG,EAAE,CAAC;QAE3E,IAAIX,WAAW;YACbjC,MAAM,CAAC,yCAAyC,CAAC;QACnD;IACF,EAAE,OAAO8C,KAAc;QACrB7C,MAAM;QACN,IAAI6C,eAAeC,OAAO;YACxB9C,MAAM6C,IAAIE,OAAO;QACnB;QACAT,QAAQC,IAAI,CAAC;IACf;AACF"}
@@ -26,7 +26,7 @@ export function helpMessage() {
26
26
 
27
27
  -n {underline my-payload-app} Set project name
28
28
  -t {underline template_name} Choose specific template
29
- -e {underline example_name} Choose specific exmaple
29
+ -e {underline example_name} Choose specific example
30
30
 
31
31
  {dim Available templates: ${formatTemplates(validTemplates)}}
32
32
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/messages.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport chalk from 'chalk'\nimport path from 'path'\nimport terminalLink from 'terminal-link'\n\nimport type { PackageManager, ProjectTemplate } from '../types.js'\n\nimport { getValidTemplates } from '../lib/templates.js'\n\nconst header = (message: string): string => chalk.bold(message)\n\nexport const welcomeMessage = chalk`\n {green Welcome to Payload. Let's create a project! }\n`\n\nconst spacer = ' '.repeat(8)\n\nexport function helpMessage(): void {\n const validTemplates = getValidTemplates()\n console.log(chalk`\n {bold USAGE}\n\n {dim Inside of an existing Next.js project}\n\n {dim $} {bold npx create-payload-app}\n\n {dim Create a new project from scratch}\n\n {dim $} {bold npx create-payload-app}\n {dim $} {bold npx create-payload-app} my-project\n {dim $} {bold npx create-payload-app} -n my-project -t template-name\n\n {bold OPTIONS}\n\n -n {underline my-payload-app} Set project name\n -t {underline template_name} Choose specific template\n -e {underline example_name} Choose specific exmaple\n\n {dim Available templates: ${formatTemplates(validTemplates)}}\n\n --use-npm Use npm to install dependencies\n --use-yarn Use yarn to install dependencies\n --use-pnpm Use pnpm to install dependencies\n --use-bun Use bun to install dependencies (experimental)\n --no-deps Do not install any dependencies\n -h Show help\n`)\n}\n\nfunction formatTemplates(templates: ProjectTemplate[]) {\n return `\\n\\n${spacer}${templates\n .map((t) => `${t.name}${' '.repeat(28 - t.name.length)}${t.description}`)\n .join(`\\n${spacer}`)}`\n}\n\nexport function successMessage(projectDir: string, packageManager: PackageManager): string {\n const relativePath = path.relative(process.cwd(), projectDir)\n return `\n${header('Launch Application:')}\n\n - cd ./${relativePath}\n - ${packageManager === 'npm' ? 'npm run' : packageManager} dev or follow directions in README.md\n\n${header('Documentation:')}\n\n - ${createTerminalLink(\n 'Getting Started',\n 'https://payloadcms.com/docs/getting-started/what-is-payload',\n )}\n - ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}\n\n`\n}\n\nexport function successfulNextInit(): string {\n return `- ${createTerminalLink(\n 'Getting Started',\n 'https://payloadcms.com/docs/getting-started/what-is-payload',\n )}\n- ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}\n`\n}\n\nexport function moveMessage(args: { nextAppDir: string; projectDir: string }): string {\n const relativeAppDir = path.relative(process.cwd(), args.nextAppDir)\n return `\n${header('Next Steps:')}\n\nPayload does not support a top-level layout.tsx file in the app directory.\n\n${chalk.bold('To continue:')}\n\n- Create a new directory in ./${relativeAppDir} such as ./${relativeAppDir}/${chalk.bold('(app)')}\n- Move all files from ./${relativeAppDir} into that directory\n\nIt is recommended to do this from your IDE if your app has existing file references.\n\nOnce moved, rerun the create-payload-app command again.\n`\n}\n\nexport function feedbackOutro(): string {\n return `${chalk.bgCyan(chalk.black(' Have feedback? '))} Visit us on ${createTerminalLink('GitHub', 'https://github.com/payloadcms/payload')}.`\n}\n\n// Create terminalLink with fallback for unsupported terminals\nfunction createTerminalLink(text: string, url: string) {\n return terminalLink(text, url, {\n fallback: (text, url) => `${text}: ${url}`,\n })\n}\n"],"names":["chalk","path","terminalLink","getValidTemplates","header","message","bold","welcomeMessage","spacer","repeat","helpMessage","validTemplates","console","log","formatTemplates","templates","map","t","name","length","description","join","successMessage","projectDir","packageManager","relativePath","relative","process","cwd","createTerminalLink","successfulNextInit","moveMessage","args","relativeAppDir","nextAppDir","feedbackOutro","bgCyan","black","text","url","fallback"],"mappings":"AAAA,6BAA6B,GAC7B,OAAOA,WAAW,QAAO;AACzB,OAAOC,UAAU,OAAM;AACvB,OAAOC,kBAAkB,gBAAe;AAIxC,SAASC,iBAAiB,QAAQ,sBAAqB;AAEvD,MAAMC,SAAS,CAACC,UAA4BL,MAAMM,IAAI,CAACD;AAEvD,OAAO,MAAME,iBAAiBP,KAAK,CAAC;;AAEpC,CAAC,CAAA;AAED,MAAMQ,SAAS,IAAIC,MAAM,CAAC;AAE1B,OAAO,SAASC;IACd,MAAMC,iBAAiBR;IACvBS,QAAQC,GAAG,CAACb,KAAK,CAAC;;;;;;;;;;;;;;;;;;;kCAmBc,EAAEc,gBAAgBH,gBAAgB;;;;;;;;AAQpE,CAAC;AACD;AAEA,SAASG,gBAAgBC,SAA4B;IACnD,OAAO,CAAC,IAAI,EAAEP,SAASO,UACpBC,GAAG,CAAC,CAACC,IAAM,GAAGA,EAAEC,IAAI,GAAG,IAAIT,MAAM,CAAC,KAAKQ,EAAEC,IAAI,CAACC,MAAM,IAAIF,EAAEG,WAAW,EAAE,EACvEC,IAAI,CAAC,CAAC,EAAE,EAAEb,QAAQ,GAAG;AAC1B;AAEA,OAAO,SAASc,eAAeC,UAAkB,EAAEC,cAA8B;IAC/E,MAAMC,eAAexB,KAAKyB,QAAQ,CAACC,QAAQC,GAAG,IAAIL;IAClD,OAAO,CAAC;AACV,EAAEnB,OAAO,uBAAuB;;SAEvB,EAAEqB,aAAa;IACpB,EAAED,mBAAmB,QAAQ,YAAYA,eAAe;;AAE5D,EAAEpB,OAAO,kBAAkB;;IAEvB,EAAEyB,mBACF,mBACA,+DACA;IACA,EAAEA,mBAAmB,iBAAiB,sDAAsD;;AAEhG,CAAC;AACD;AAEA,OAAO,SAASC;IACd,OAAO,CAAC,EAAE,EAAED,mBACV,mBACA,+DACA;EACF,EAAEA,mBAAmB,iBAAiB,sDAAsD;AAC9F,CAAC;AACD;AAEA,OAAO,SAASE,YAAYC,IAAgD;IAC1E,MAAMC,iBAAiBhC,KAAKyB,QAAQ,CAACC,QAAQC,GAAG,IAAII,KAAKE,UAAU;IACnE,OAAO,CAAC;AACV,EAAE9B,OAAO,eAAe;;;;AAIxB,EAAEJ,MAAMM,IAAI,CAAC,gBAAgB;;8BAEC,EAAE2B,eAAe,WAAW,EAAEA,eAAe,CAAC,EAAEjC,MAAMM,IAAI,CAAC,SAAS;wBAC1E,EAAE2B,eAAe;;;;;AAKzC,CAAC;AACD;AAEA,OAAO,SAASE;IACd,OAAO,GAAGnC,MAAMoC,MAAM,CAACpC,MAAMqC,KAAK,CAAC,qBAAqB,aAAa,EAAER,mBAAmB,UAAU,yCAAyC,CAAC,CAAC;AACjJ;AAEA,8DAA8D;AAC9D,SAASA,mBAAmBS,IAAY,EAAEC,GAAW;IACnD,OAAOrC,aAAaoC,MAAMC,KAAK;QAC7BC,UAAU,CAACF,MAAMC,MAAQ,GAAGD,KAAK,EAAE,EAAEC,KAAK;IAC5C;AACF"}
1
+ {"version":3,"sources":["../../src/utils/messages.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport chalk from 'chalk'\nimport path from 'path'\nimport terminalLink from 'terminal-link'\n\nimport type { PackageManager, ProjectTemplate } from '../types.js'\n\nimport { getValidTemplates } from '../lib/templates.js'\n\nconst header = (message: string): string => chalk.bold(message)\n\nexport const welcomeMessage = chalk`\n {green Welcome to Payload. Let's create a project! }\n`\n\nconst spacer = ' '.repeat(8)\n\nexport function helpMessage(): void {\n const validTemplates = getValidTemplates()\n console.log(chalk`\n {bold USAGE}\n\n {dim Inside of an existing Next.js project}\n\n {dim $} {bold npx create-payload-app}\n\n {dim Create a new project from scratch}\n\n {dim $} {bold npx create-payload-app}\n {dim $} {bold npx create-payload-app} my-project\n {dim $} {bold npx create-payload-app} -n my-project -t template-name\n\n {bold OPTIONS}\n\n -n {underline my-payload-app} Set project name\n -t {underline template_name} Choose specific template\n -e {underline example_name} Choose specific example\n\n {dim Available templates: ${formatTemplates(validTemplates)}}\n\n --use-npm Use npm to install dependencies\n --use-yarn Use yarn to install dependencies\n --use-pnpm Use pnpm to install dependencies\n --use-bun Use bun to install dependencies (experimental)\n --no-deps Do not install any dependencies\n -h Show help\n`)\n}\n\nfunction formatTemplates(templates: ProjectTemplate[]) {\n return `\\n\\n${spacer}${templates\n .map((t) => `${t.name}${' '.repeat(28 - t.name.length)}${t.description}`)\n .join(`\\n${spacer}`)}`\n}\n\nexport function successMessage(projectDir: string, packageManager: PackageManager): string {\n const relativePath = path.relative(process.cwd(), projectDir)\n return `\n${header('Launch Application:')}\n\n - cd ./${relativePath}\n - ${packageManager === 'npm' ? 'npm run' : packageManager} dev or follow directions in README.md\n\n${header('Documentation:')}\n\n - ${createTerminalLink(\n 'Getting Started',\n 'https://payloadcms.com/docs/getting-started/what-is-payload',\n )}\n - ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}\n\n`\n}\n\nexport function successfulNextInit(): string {\n return `- ${createTerminalLink(\n 'Getting Started',\n 'https://payloadcms.com/docs/getting-started/what-is-payload',\n )}\n- ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}\n`\n}\n\nexport function moveMessage(args: { nextAppDir: string; projectDir: string }): string {\n const relativeAppDir = path.relative(process.cwd(), args.nextAppDir)\n return `\n${header('Next Steps:')}\n\nPayload does not support a top-level layout.tsx file in the app directory.\n\n${chalk.bold('To continue:')}\n\n- Create a new directory in ./${relativeAppDir} such as ./${relativeAppDir}/${chalk.bold('(app)')}\n- Move all files from ./${relativeAppDir} into that directory\n\nIt is recommended to do this from your IDE if your app has existing file references.\n\nOnce moved, rerun the create-payload-app command again.\n`\n}\n\nexport function feedbackOutro(): string {\n return `${chalk.bgCyan(chalk.black(' Have feedback? '))} Visit us on ${createTerminalLink('GitHub', 'https://github.com/payloadcms/payload')}.`\n}\n\n// Create terminalLink with fallback for unsupported terminals\nfunction createTerminalLink(text: string, url: string) {\n return terminalLink(text, url, {\n fallback: (text, url) => `${text}: ${url}`,\n })\n}\n"],"names":["chalk","path","terminalLink","getValidTemplates","header","message","bold","welcomeMessage","spacer","repeat","helpMessage","validTemplates","console","log","formatTemplates","templates","map","t","name","length","description","join","successMessage","projectDir","packageManager","relativePath","relative","process","cwd","createTerminalLink","successfulNextInit","moveMessage","args","relativeAppDir","nextAppDir","feedbackOutro","bgCyan","black","text","url","fallback"],"mappings":"AAAA,6BAA6B,GAC7B,OAAOA,WAAW,QAAO;AACzB,OAAOC,UAAU,OAAM;AACvB,OAAOC,kBAAkB,gBAAe;AAIxC,SAASC,iBAAiB,QAAQ,sBAAqB;AAEvD,MAAMC,SAAS,CAACC,UAA4BL,MAAMM,IAAI,CAACD;AAEvD,OAAO,MAAME,iBAAiBP,KAAK,CAAC;;AAEpC,CAAC,CAAA;AAED,MAAMQ,SAAS,IAAIC,MAAM,CAAC;AAE1B,OAAO,SAASC;IACd,MAAMC,iBAAiBR;IACvBS,QAAQC,GAAG,CAACb,KAAK,CAAC;;;;;;;;;;;;;;;;;;;kCAmBc,EAAEc,gBAAgBH,gBAAgB;;;;;;;;AAQpE,CAAC;AACD;AAEA,SAASG,gBAAgBC,SAA4B;IACnD,OAAO,CAAC,IAAI,EAAEP,SAASO,UACpBC,GAAG,CAAC,CAACC,IAAM,GAAGA,EAAEC,IAAI,GAAG,IAAIT,MAAM,CAAC,KAAKQ,EAAEC,IAAI,CAACC,MAAM,IAAIF,EAAEG,WAAW,EAAE,EACvEC,IAAI,CAA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ee31a64",
3
+ "version": "3.16.1-canary.9004205",
4
4
  "homepage": "https://payloadcms.com",
5
5
  "repository": {
6
6
  "type": "git",