create-payload-app 3.0.0-canary.c27a334 → 3.0.0-canary.cb7fa00

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) 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 +74 -25
  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 +1 -1
  8. package/dist/lib/create-project.js.map +1 -1
  9. package/dist/lib/create-project.spec.js +22 -21
  10. package/dist/lib/create-project.spec.js.map +1 -1
  11. package/dist/lib/generate-secret.js.map +1 -1
  12. package/dist/lib/get-package-manager.d.ts.map +1 -1
  13. package/dist/lib/get-package-manager.js +12 -3
  14. package/dist/lib/get-package-manager.js.map +1 -1
  15. package/dist/lib/init-next.d.ts +2 -2
  16. package/dist/lib/init-next.d.ts.map +1 -1
  17. package/dist/lib/init-next.js +48 -8
  18. package/dist/lib/init-next.js.map +1 -1
  19. package/dist/lib/install-packages.js.map +1 -1
  20. package/dist/lib/parse-project-name.js.map +1 -1
  21. package/dist/lib/parse-template.js.map +1 -1
  22. package/dist/lib/replacements.d.ts +27 -0
  23. package/dist/lib/replacements.d.ts.map +1 -0
  24. package/dist/lib/replacements.js +80 -0
  25. package/dist/lib/replacements.js.map +1 -0
  26. package/dist/lib/select-db.d.ts.map +1 -1
  27. package/dist/lib/select-db.js +11 -11
  28. package/dist/lib/select-db.js.map +1 -1
  29. package/dist/lib/templates.js +7 -1
  30. package/dist/lib/templates.js.map +1 -1
  31. package/dist/lib/update-payload-in-project.d.ts.map +1 -1
  32. package/dist/lib/update-payload-in-project.js +1 -1
  33. package/dist/lib/update-payload-in-project.js.map +1 -1
  34. package/dist/lib/wrap-next-config.d.ts +5 -5
  35. package/dist/lib/wrap-next-config.d.ts.map +1 -1
  36. package/dist/lib/wrap-next-config.js +123 -60
  37. package/dist/lib/wrap-next-config.js.map +1 -1
  38. package/dist/lib/wrap-next-config.spec.js +84 -34
  39. package/dist/lib/wrap-next-config.spec.js.map +1 -1
  40. package/dist/lib/write-env-file.d.ts.map +1 -1
  41. package/dist/lib/write-env-file.js +25 -25
  42. package/dist/lib/write-env-file.js.map +1 -1
  43. package/dist/main.d.ts.map +1 -1
  44. package/dist/main.js +8 -3
  45. package/dist/main.js.map +1 -1
  46. package/dist/scripts/pack-template-files.js +3 -3
  47. package/dist/scripts/pack-template-files.js.map +1 -1
  48. package/dist/template/src/app/(payload)/admin/[[...segments]]/not-found.tsx +3 -1
  49. package/dist/template/src/app/(payload)/admin/[[...segments]]/page.tsx +3 -1
  50. package/dist/template/src/app/(payload)/admin/importMap.js +5 -0
  51. package/dist/template/src/app/(payload)/layout.tsx +6 -1
  52. package/dist/template/src/collections/Media.ts +16 -0
  53. package/dist/template/src/collections/Users.ts +1 -1
  54. package/dist/template/src/payload-types.ts +127 -0
  55. package/dist/template/src/payload.config.ts +13 -15
  56. package/dist/types.d.ts +5 -2
  57. package/dist/types.d.ts.map +1 -1
  58. package/dist/types.js.map +1 -1
  59. package/dist/utils/copy-recursive-sync.d.ts +2 -0
  60. package/dist/utils/copy-recursive-sync.d.ts.map +1 -1
  61. package/dist/utils/copy-recursive-sync.js +2 -0
  62. package/dist/utils/copy-recursive-sync.js.map +1 -1
  63. package/dist/utils/git.js.map +1 -1
  64. package/dist/utils/log.d.ts.map +1 -1
  65. package/dist/utils/log.js +1 -1
  66. package/dist/utils/log.js.map +1 -1
  67. package/dist/utils/messages.d.ts.map +1 -1
  68. package/dist/utils/messages.js.map +1 -1
  69. package/package.json +19 -5
  70. package/dist/lib/packages.d.ts +0 -9
  71. package/dist/lib/packages.d.ts.map +0 -1
  72. package/dist/lib/packages.js +0 -27
  73. package/dist/lib/packages.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-payload-app",
3
- "version": "3.0.0-canary.c27a334",
3
+ "version": "3.0.0-canary.cb7fa00",
4
4
  "homepage": "https://payloadcms.com",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,10 +10,24 @@
10
10
  "license": "MIT",
11
11
  "type": "module",
12
12
  "exports": {
13
+ "./types": {
14
+ "import": "./src/types.ts",
15
+ "require": "./src/types.ts"
16
+ },
13
17
  "./commands": {
14
18
  "import": "./src/lib/init-next.ts",
15
19
  "require": "./src/lib/init-next.ts",
16
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/*"
17
31
  }
18
32
  },
19
33
  "bin": {
@@ -27,6 +41,7 @@
27
41
  "dependencies": {
28
42
  "@clack/prompts": "^0.7.0",
29
43
  "@sindresorhus/slugify": "^1.1.0",
44
+ "@swc/core": "1.7.10",
30
45
  "arg": "^5.0.0",
31
46
  "chalk": "^4.1.0",
32
47
  "comment-json": "^4.2.3",
@@ -43,14 +58,13 @@
43
58
  "@types/esprima": "^4.0.6",
44
59
  "@types/fs-extra": "^9.0.12",
45
60
  "@types/jest": "29.5.12",
46
- "@types/node": "20.12.5",
47
- "temp-dir": "2.0.0"
61
+ "@types/node": "20.12.5"
48
62
  },
49
63
  "scripts": {
50
64
  "build": "pnpm pack-template-files && pnpm typecheck && pnpm build:swc",
51
- "build:swc": "swc ./src -d ./dist --config-file .swcrc",
65
+ "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
52
66
  "clean": "rimraf {dist,*.tsbuildinfo}",
53
- "pack-template-files": "tsx src/scripts/pack-template-files.ts",
67
+ "pack-template-files": "node --no-deprecation --import @swc-node/register/esm-register src/scripts/pack-template-files.ts",
54
68
  "test": "jest",
55
69
  "typecheck": "tsc"
56
70
  }
@@ -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"}