create-payload-app 3.0.0-canary.b750ebf → 3.0.0-canary.b8c9483
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/constants.d.ts +2 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +9 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/create-project.d.ts.map +1 -1
- package/dist/lib/create-project.js +10 -7
- package/dist/lib/create-project.js.map +1 -1
- package/dist/lib/create-project.spec.js +5 -7
- package/dist/lib/create-project.spec.js.map +1 -1
- package/dist/lib/download-template.d.ts +7 -0
- package/dist/lib/download-template.d.ts.map +1 -0
- package/dist/lib/download-template.js +28 -0
- package/dist/lib/download-template.js.map +1 -0
- package/dist/lib/get-package-manager.js +26 -5
- package/dist/lib/get-package-manager.js.map +1 -1
- package/dist/lib/init-next.d.ts +5 -5
- package/dist/lib/init-next.d.ts.map +1 -1
- package/dist/lib/init-next.js +54 -12
- package/dist/lib/init-next.js.map +1 -1
- package/dist/lib/install-packages.js +12 -12
- package/dist/lib/install-packages.js.map +1 -1
- package/dist/lib/parse-project-name.d.ts.map +1 -1
- package/dist/lib/parse-project-name.js +9 -3
- package/dist/lib/parse-project-name.js.map +1 -1
- package/dist/lib/parse-template.d.ts.map +1 -1
- package/dist/lib/parse-template.js +3 -1
- package/dist/lib/parse-template.js.map +1 -1
- package/dist/lib/replacements.d.ts.map +1 -1
- package/dist/lib/replacements.js +28 -4
- package/dist/lib/replacements.js.map +1 -1
- package/dist/lib/select-db.d.ts.map +1 -1
- package/dist/lib/select-db.js +23 -14
- package/dist/lib/select-db.js.map +1 -1
- package/dist/lib/templates.d.ts.map +1 -1
- package/dist/lib/templates.js +4 -2
- package/dist/lib/templates.js.map +1 -1
- package/dist/lib/update-payload-in-project.d.ts.map +1 -1
- package/dist/lib/update-payload-in-project.js +7 -5
- package/dist/lib/update-payload-in-project.js.map +1 -1
- package/dist/lib/wrap-next-config.d.ts +5 -5
- package/dist/lib/wrap-next-config.d.ts.map +1 -1
- package/dist/lib/wrap-next-config.js +119 -59
- package/dist/lib/wrap-next-config.js.map +1 -1
- package/dist/lib/wrap-next-config.spec.js +72 -22
- package/dist/lib/wrap-next-config.spec.js.map +1 -1
- package/dist/lib/write-env-file.d.ts +2 -1
- package/dist/lib/write-env-file.d.ts.map +1 -1
- package/dist/lib/write-env-file.js +9 -4
- package/dist/lib/write-env-file.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +27 -14
- package/dist/main.js.map +1 -1
- package/dist/scripts/pack-template-files.js +3 -3
- package/dist/scripts/pack-template-files.js.map +1 -1
- package/dist/template/src/app/(payload)/admin/[[...segments]]/not-found.tsx +8 -6
- package/dist/template/src/app/(payload)/admin/[[...segments]]/page.tsx +8 -6
- package/dist/template/src/app/(payload)/admin/importMap.js +1 -0
- package/dist/template/src/app/(payload)/api/[...slug]/route.ts +11 -2
- package/dist/template/src/app/(payload)/api/graphql/route.ts +4 -2
- package/dist/template/src/app/(payload)/api/graphql-playground/route.ts +2 -1
- package/dist/template/src/app/(payload)/layout.tsx +19 -4
- package/dist/template/src/payload-types.ts +127 -0
- package/dist/template/src/payload.config.ts +3 -0
- package/dist/types.d.ts +5 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/copy-recursive-sync.d.ts +1 -1
- package/dist/utils/copy-recursive-sync.d.ts.map +1 -1
- package/dist/utils/copy-recursive-sync.js +4 -1
- package/dist/utils/copy-recursive-sync.js.map +1 -1
- package/dist/utils/messages.d.ts.map +1 -1
- package/dist/utils/messages.js +1 -0
- package/dist/utils/messages.js.map +1 -1
- package/license.md +22 -0
- package/package.json +18 -5
@@ -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\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 --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 - ${\n packageManager === 'npm' ? 'npm run' : packageManager\n } dev or follow directions in ${createTerminalLink(\n 'README.md',\n `file://${path.resolve(projectDir, 'README.md')}`,\n )}\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","resolve","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;;;;;;;;;;;;;;;;;;kCAkBc,EAAEc,gBAAgBH,gBAAgB
|
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\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 - ${\n packageManager === 'npm' ? 'npm run' : packageManager\n } dev or follow directions in ${createTerminalLink(\n 'README.md',\n `file://${path.resolve(projectDir, 'README.md')}`,\n )}\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","resolve","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;;;;;;;;;;;;;;;;;;kCAkBc,EAAEc,gBAAgBH,gBAAgB;;;;;;;;AAQpE,CAAC;AACD;AAEA,SAASG,gBAAgBC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ACrC,MAAMsC,KAAK,CAAC,qBAAqB,aAAa,EAAET,mBAAmB,UAAU,yCAAyC,CAAC,CAAC;AACjJ;AAEA,8DAA8D;AAC9D,SAASA,mBAAmBU,IAAY,EAAEC,GAAW;IACnD,OAAOtC,aAAaqC,MAAMC,KAAK;QAC7BC,UAAU,CAACF,MAAMC,MAAQ,CAAC,EAAED,KAAK,EAAE,EAAEC,IAAI,CAAC;IAC5C;AACF"}
|
package/license.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018-2024 Payload CMS, Inc. <info@payloadcms.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "create-payload-app",
|
3
|
-
"version": "3.0.0-canary.
|
3
|
+
"version": "3.0.0-canary.b8c9483",
|
4
4
|
"homepage": "https://payloadcms.com",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -8,6 +8,14 @@
|
|
8
8
|
"directory": "packages/create-payload-app"
|
9
9
|
},
|
10
10
|
"license": "MIT",
|
11
|
+
"author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
|
12
|
+
"maintainers": [
|
13
|
+
{
|
14
|
+
"name": "Payload",
|
15
|
+
"email": "info@payloadcms.com",
|
16
|
+
"url": "https://payloadcms.com"
|
17
|
+
}
|
18
|
+
],
|
11
19
|
"type": "module",
|
12
20
|
"exports": {
|
13
21
|
"./types": {
|
@@ -41,29 +49,34 @@
|
|
41
49
|
"dependencies": {
|
42
50
|
"@clack/prompts": "^0.7.0",
|
43
51
|
"@sindresorhus/slugify": "^1.1.0",
|
52
|
+
"@swc/core": "1.7.10",
|
44
53
|
"arg": "^5.0.0",
|
45
54
|
"chalk": "^4.1.0",
|
46
55
|
"comment-json": "^4.2.3",
|
47
|
-
"degit": "^2.8.4",
|
48
56
|
"esprima-next": "^6.0.3",
|
49
57
|
"execa": "^5.0.0",
|
50
58
|
"figures": "^6.1.0",
|
51
59
|
"fs-extra": "^9.0.1",
|
52
60
|
"globby": "11.1.0",
|
61
|
+
"tar": "^7.4.3",
|
53
62
|
"terminal-link": "^2.1.1"
|
54
63
|
},
|
55
64
|
"devDependencies": {
|
56
|
-
"@types/degit": "^2.8.3",
|
57
65
|
"@types/esprima": "^4.0.6",
|
58
66
|
"@types/fs-extra": "^9.0.12",
|
59
67
|
"@types/jest": "29.5.12",
|
60
|
-
"@types/node": "
|
68
|
+
"@types/node": "22.5.4"
|
69
|
+
},
|
70
|
+
"engines": {
|
71
|
+
"node": "^18.20.2 || >=20.9.0"
|
61
72
|
},
|
62
73
|
"scripts": {
|
63
74
|
"build": "pnpm pack-template-files && pnpm typecheck && pnpm build:swc",
|
64
75
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|
65
76
|
"clean": "rimraf {dist,*.tsbuildinfo}",
|
66
|
-
"
|
77
|
+
"lint": "eslint .",
|
78
|
+
"lint:fix": "eslint . --fix",
|
79
|
+
"pack-template-files": "node --no-deprecation --import @swc-node/register/esm-register src/scripts/pack-template-files.ts",
|
67
80
|
"test": "jest",
|
68
81
|
"typecheck": "tsc"
|
69
82
|
}
|