create-payload-app 3.0.0-beta.12 → 3.0.0-beta.120

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. package/dist/index.js.map +1 -1
  2. package/dist/lib/configure-payload-config.d.ts +8 -2
  3. package/dist/lib/configure-payload-config.d.ts.map +1 -1
  4. package/dist/lib/configure-payload-config.js +96 -21
  5. package/dist/lib/configure-payload-config.js.map +1 -1
  6. package/dist/lib/create-project.d.ts.map +1 -1
  7. package/dist/lib/create-project.js +17 -5
  8. package/dist/lib/create-project.js.map +1 -1
  9. package/dist/lib/create-project.spec.js +27 -31
  10. package/dist/lib/create-project.spec.js.map +1 -1
  11. package/dist/lib/download-template.d.ts +10 -0
  12. package/dist/lib/download-template.d.ts.map +1 -0
  13. package/dist/lib/download-template.js +21 -0
  14. package/dist/lib/download-template.js.map +1 -0
  15. package/dist/lib/generate-secret.js.map +1 -1
  16. package/dist/lib/get-package-manager.d.ts +6 -0
  17. package/dist/lib/get-package-manager.d.ts.map +1 -0
  18. package/dist/lib/get-package-manager.js +50 -0
  19. package/dist/lib/get-package-manager.js.map +1 -0
  20. package/dist/lib/init-next.d.ts +3 -11
  21. package/dist/lib/init-next.d.ts.map +1 -1
  22. package/dist/lib/init-next.js +81 -58
  23. package/dist/lib/init-next.js.map +1 -1
  24. package/dist/lib/install-packages.d.ts +9 -0
  25. package/dist/lib/install-packages.d.ts.map +1 -0
  26. package/dist/lib/install-packages.js +43 -0
  27. package/dist/lib/install-packages.js.map +1 -0
  28. package/dist/lib/parse-project-name.d.ts.map +1 -1
  29. package/dist/lib/parse-project-name.js +9 -3
  30. package/dist/lib/parse-project-name.js.map +1 -1
  31. package/dist/lib/parse-template.d.ts.map +1 -1
  32. package/dist/lib/parse-template.js +3 -1
  33. package/dist/lib/parse-template.js.map +1 -1
  34. package/dist/lib/replacements.d.ts +27 -0
  35. package/dist/lib/replacements.d.ts.map +1 -0
  36. package/dist/lib/replacements.js +92 -0
  37. package/dist/lib/replacements.js.map +1 -0
  38. package/dist/lib/select-db.d.ts.map +1 -1
  39. package/dist/lib/select-db.js +23 -14
  40. package/dist/lib/select-db.js.map +1 -1
  41. package/dist/lib/templates.js +6 -25
  42. package/dist/lib/templates.js.map +1 -1
  43. package/dist/lib/update-payload-in-project.d.ts +6 -0
  44. package/dist/lib/update-payload-in-project.d.ts.map +1 -0
  45. package/dist/lib/update-payload-in-project.js +73 -0
  46. package/dist/lib/update-payload-in-project.js.map +1 -0
  47. package/dist/lib/wrap-next-config.d.ts +5 -5
  48. package/dist/lib/wrap-next-config.d.ts.map +1 -1
  49. package/dist/lib/wrap-next-config.js +120 -61
  50. package/dist/lib/wrap-next-config.js.map +1 -1
  51. package/dist/lib/wrap-next-config.spec.js +85 -34
  52. package/dist/lib/wrap-next-config.spec.js.map +1 -1
  53. package/dist/lib/write-env-file.d.ts +2 -1
  54. package/dist/lib/write-env-file.d.ts.map +1 -1
  55. package/dist/lib/write-env-file.js +31 -26
  56. package/dist/lib/write-env-file.js.map +1 -1
  57. package/dist/main.d.ts.map +1 -1
  58. package/dist/main.js +37 -22
  59. package/dist/main.js.map +1 -1
  60. package/dist/scripts/pack-template-files.js +3 -3
  61. package/dist/scripts/pack-template-files.js.map +1 -1
  62. package/dist/template/src/app/(payload)/admin/[[...segments]]/not-found.tsx +24 -0
  63. package/dist/template/src/app/(payload)/admin/[[...segments]]/page.tsx +14 -7
  64. package/dist/template/src/app/(payload)/admin/importMap.js +1 -0
  65. package/dist/template/src/app/(payload)/api/[...slug]/route.ts +3 -2
  66. package/dist/template/src/app/(payload)/api/graphql/route.ts +1 -1
  67. package/dist/template/src/app/(payload)/api/graphql-playground/route.ts +1 -1
  68. package/dist/template/src/app/(payload)/layout.tsx +7 -2
  69. package/dist/template/src/collections/Media.ts +16 -0
  70. package/dist/template/src/collections/Users.ts +1 -1
  71. package/dist/template/src/payload-types.ts +127 -0
  72. package/dist/template/src/payload.config.ts +13 -15
  73. package/dist/types.d.ts +15 -1
  74. package/dist/types.d.ts.map +1 -1
  75. package/dist/types.js.map +1 -1
  76. package/dist/utils/copy-recursive-sync.d.ts +3 -1
  77. package/dist/utils/copy-recursive-sync.d.ts.map +1 -1
  78. package/dist/utils/copy-recursive-sync.js +3 -1
  79. package/dist/utils/copy-recursive-sync.js.map +1 -1
  80. package/dist/utils/git.d.ts +4 -0
  81. package/dist/utils/git.d.ts.map +1 -0
  82. package/dist/utils/git.js +46 -0
  83. package/dist/utils/git.js.map +1 -0
  84. package/dist/utils/log.d.ts.map +1 -1
  85. package/dist/utils/log.js +1 -1
  86. package/dist/utils/log.js.map +1 -1
  87. package/dist/utils/messages.d.ts.map +1 -1
  88. package/dist/utils/messages.js +1 -0
  89. package/dist/utils/messages.js.map +1 -1
  90. package/package.json +39 -23
  91. package/dist/lib/packages.d.ts +0 -9
  92. package/dist/lib/packages.d.ts.map +0 -1
  93. package/dist/lib/packages.js +0 -27
  94. package/dist/lib/packages.js.map +0 -1
package/package.json CHANGED
@@ -1,17 +1,38 @@
1
1
  {
2
2
  "name": "create-payload-app",
3
- "version": "3.0.0-beta.12",
4
- "license": "MIT",
5
- "type": "module",
3
+ "version": "3.0.0-beta.120",
6
4
  "homepage": "https://payloadcms.com",
7
- "bin": {
8
- "create-payload-app": "bin/cli.js"
9
- },
10
5
  "repository": {
11
6
  "type": "git",
12
7
  "url": "https://github.com/payloadcms/payload.git",
13
8
  "directory": "packages/create-payload-app"
14
9
  },
10
+ "license": "MIT",
11
+ "type": "module",
12
+ "exports": {
13
+ "./types": {
14
+ "import": "./src/types.ts",
15
+ "require": "./src/types.ts"
16
+ },
17
+ "./commands": {
18
+ "import": "./src/lib/init-next.ts",
19
+ "require": "./src/lib/init-next.ts",
20
+ "types": "./src/lib/init-next.ts"
21
+ },
22
+ "./lib/*": {
23
+ "import": "./src/lib/*",
24
+ "require": "./src/lib/*",
25
+ "types": "./src/lib/*"
26
+ },
27
+ "./utils/*": {
28
+ "import": "./src/utils/*",
29
+ "require": "./src/utils/*",
30
+ "types": "./src/utils/*"
31
+ }
32
+ },
33
+ "bin": {
34
+ "create-payload-app": "bin/cli.js"
35
+ },
15
36
  "files": [
16
37
  "package.json",
17
38
  "dist",
@@ -20,40 +41,35 @@
20
41
  "dependencies": {
21
42
  "@clack/prompts": "^0.7.0",
22
43
  "@sindresorhus/slugify": "^1.1.0",
44
+ "@swc/core": "1.7.10",
23
45
  "arg": "^5.0.0",
24
46
  "chalk": "^4.1.0",
25
- "command-exists": "^1.2.9",
26
47
  "comment-json": "^4.2.3",
27
- "degit": "^2.8.4",
28
- "detect-package-manager": "^3.0.1",
29
48
  "esprima-next": "^6.0.3",
30
49
  "execa": "^5.0.0",
31
50
  "figures": "^6.1.0",
32
51
  "fs-extra": "^9.0.1",
33
52
  "globby": "11.1.0",
53
+ "tar": "^7.4.3",
34
54
  "terminal-link": "^2.1.1"
35
55
  },
36
56
  "devDependencies": {
37
- "@types/command-exists": "^1.2.0",
38
- "@types/degit": "^2.8.3",
39
57
  "@types/esprima": "^4.0.6",
40
58
  "@types/fs-extra": "^9.0.12",
41
- "@types/jest": "^27.0.3",
42
- "@types/node": "20.12.5"
59
+ "@types/jest": "29.5.12",
60
+ "@types/node": "22.5.4"
43
61
  },
44
- "exports": {
45
- "./commands": {
46
- "import": "./src/lib/init-next.ts",
47
- "require": "./src/lib/init-next.ts",
48
- "types": "./src/lib/init-next.ts"
49
- }
62
+ "engines": {
63
+ "node": "^18.20.2 || >=20.9.0"
50
64
  },
51
65
  "scripts": {
52
66
  "build": "pnpm pack-template-files && pnpm typecheck && pnpm build:swc",
53
- "typecheck": "tsc",
54
- "pack-template-files": "tsx src/scripts/pack-template-files.ts",
55
- "build:swc": "swc ./src -d ./dist --config-file .swcrc",
67
+ "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
56
68
  "clean": "rimraf {dist,*.tsbuildinfo}",
57
- "test": "jest"
69
+ "lint": "eslint .",
70
+ "lint:fix": "eslint . --fix",
71
+ "pack-template-files": "node --no-deprecation --import @swc-node/register/esm-register src/scripts/pack-template-files.ts",
72
+ "test": "jest",
73
+ "typecheck": "tsc"
58
74
  }
59
75
  }
@@ -1,9 +0,0 @@
1
- import type { DbType } from '../types.js';
2
- type DbAdapterReplacement = {
3
- configReplacement: string[];
4
- importReplacement: string;
5
- packageName: string;
6
- };
7
- export declare const dbReplacements: Record<DbType, DbAdapterReplacement>;
8
- export {};
9
- //# sourceMappingURL=packages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"packages.d.ts","sourceRoot":"","sources":["../../src/lib/packages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,KAAK,oBAAoB,GAAG;IAC1B,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,iBAAiB,EAAE,MAAM,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAyBD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAG/D,CAAA"}
@@ -1,27 +0,0 @@
1
- const mongodbReplacement = {
2
- importReplacement: "import { mongooseAdapter } from '@payloadcms/db-mongodb'",
3
- packageName: '@payloadcms/db-mongodb',
4
- // Replacement between `// database-adapter-config-start` and `// database-adapter-config-end`
5
- configReplacement: [
6
- ' db: mongooseAdapter({',
7
- " url: process.env.DATABASE_URI || '',",
8
- ' }),'
9
- ]
10
- };
11
- const postgresReplacement = {
12
- configReplacement: [
13
- ' db: postgresAdapter({',
14
- ' pool: {',
15
- " connectionString: process.env.DATABASE_URI || '',",
16
- ' },',
17
- ' }),'
18
- ],
19
- importReplacement: "import { postgresAdapter } from '@payloadcms/db-postgres'",
20
- packageName: '@payloadcms/db-postgres'
21
- };
22
- export const dbReplacements = {
23
- mongodb: mongodbReplacement,
24
- postgres: postgresReplacement
25
- };
26
-
27
- //# sourceMappingURL=packages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/packages.ts"],"sourcesContent":["import type { DbType } from '../types.js'\n\ntype DbAdapterReplacement = {\n configReplacement: string[]\n importReplacement: string\n packageName: string\n}\n\nconst mongodbReplacement: DbAdapterReplacement = {\n importReplacement: \"import { mongooseAdapter } from '@payloadcms/db-mongodb'\",\n packageName: '@payloadcms/db-mongodb',\n // Replacement between `// database-adapter-config-start` and `// database-adapter-config-end`\n configReplacement: [\n ' db: mongooseAdapter({',\n \" url: process.env.DATABASE_URI || '',\",\n ' }),',\n ],\n}\n\nconst postgresReplacement: DbAdapterReplacement = {\n configReplacement: [\n ' db: postgresAdapter({',\n ' pool: {',\n \" connectionString: process.env.DATABASE_URI || '',\",\n ' },',\n ' }),',\n ],\n importReplacement: \"import { postgresAdapter } from '@payloadcms/db-postgres'\",\n packageName: '@payloadcms/db-postgres',\n}\n\nexport const dbReplacements: Record<DbType, DbAdapterReplacement> = {\n mongodb: mongodbReplacement,\n postgres: postgresReplacement,\n}\n"],"names":["mongodbReplacement","importReplacement","packageName","configReplacement","postgresReplacement","dbReplacements","mongodb","postgres"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAQA,MAAMA,qBAA2C;IAC/CC,mBAAmB;IACnBC,aAAa;IACb,8FAA8F;IAC9FC,mBAAmB;QACjB;QACA;QACA;KACD;AACH;AAEA,MAAMC,sBAA4C;IAChDD,mBAAmB;QACjB;QACA;QACA;QACA;QACA;KACD;IACDF,mBAAmB;IACnBC,aAAa;AACf;AAEA,OAAO,MAAMG,iBAAuD;IAClEC,SAASN;IACTO,UAAUH;AACZ,EAAC"}