create-payload-app 1.0.0 → 3.0.0-alpha.50

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +3 -3
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/configure-payload-config.d.ts +11 -0
  7. package/dist/lib/configure-payload-config.d.ts.map +1 -0
  8. package/dist/lib/configure-payload-config.js +15 -53
  9. package/dist/lib/configure-payload-config.js.map +1 -0
  10. package/dist/lib/create-project.d.ts +14 -0
  11. package/dist/lib/create-project.d.ts.map +1 -0
  12. package/dist/lib/create-project.js +84 -24
  13. package/dist/lib/create-project.js.map +1 -0
  14. package/dist/lib/create-project.spec.d.ts +2 -0
  15. package/dist/lib/create-project.spec.d.ts.map +1 -0
  16. package/dist/lib/create-project.spec.js +30 -75
  17. package/dist/lib/create-project.spec.js.map +1 -0
  18. package/dist/lib/generate-secret.d.ts +2 -0
  19. package/dist/lib/generate-secret.d.ts.map +1 -0
  20. package/dist/lib/generate-secret.js +1 -1
  21. package/dist/lib/generate-secret.js.map +1 -0
  22. package/dist/lib/init-next.d.ts +29 -0
  23. package/dist/lib/init-next.d.ts.map +1 -0
  24. package/dist/lib/init-next.js +285 -0
  25. package/dist/lib/init-next.js.map +1 -0
  26. package/dist/lib/packages.d.ts +9 -0
  27. package/dist/lib/packages.d.ts.map +1 -0
  28. package/dist/lib/packages.js +8 -52
  29. package/dist/lib/packages.js.map +1 -0
  30. package/dist/lib/parse-project-name.d.ts +3 -0
  31. package/dist/lib/parse-project-name.d.ts.map +1 -0
  32. package/dist/lib/parse-project-name.js +53 -12
  33. package/dist/lib/parse-project-name.js.map +1 -0
  34. package/dist/lib/parse-template.d.ts +3 -0
  35. package/dist/lib/parse-template.d.ts.map +1 -0
  36. package/dist/lib/parse-template.js +50 -20
  37. package/dist/lib/parse-template.js.map +1 -0
  38. package/dist/lib/select-db.d.ts +3 -0
  39. package/dist/lib/select-db.d.ts.map +1 -0
  40. package/dist/lib/select-db.js +72 -31
  41. package/dist/lib/select-db.js.map +1 -0
  42. package/dist/lib/templates.d.ts +4 -0
  43. package/dist/lib/templates.d.ts.map +1 -0
  44. package/dist/lib/templates.js +17 -11
  45. package/dist/lib/templates.js.map +1 -0
  46. package/dist/lib/wrap-next-config.d.ts +12 -0
  47. package/dist/lib/wrap-next-config.d.ts.map +1 -0
  48. package/dist/lib/wrap-next-config.js +110 -0
  49. package/dist/lib/wrap-next-config.js.map +1 -0
  50. package/dist/lib/wrap-next-config.spec.d.ts +2 -0
  51. package/dist/lib/wrap-next-config.spec.d.ts.map +1 -0
  52. package/dist/lib/wrap-next-config.spec.js +98 -0
  53. package/dist/lib/wrap-next-config.spec.js.map +1 -0
  54. package/dist/lib/write-env-file.d.ts +10 -0
  55. package/dist/lib/write-env-file.d.ts.map +1 -0
  56. package/dist/lib/write-env-file.js +9 -6
  57. package/dist/lib/write-env-file.js.map +1 -0
  58. package/dist/main.d.ts +7 -0
  59. package/dist/main.d.ts.map +1 -0
  60. package/dist/main.js +176 -60
  61. package/dist/main.js.map +1 -0
  62. package/dist/scripts/pack-template-files.d.ts +2 -0
  63. package/dist/scripts/pack-template-files.d.ts.map +1 -0
  64. package/dist/scripts/pack-template-files.js +43 -0
  65. package/dist/scripts/pack-template-files.js.map +1 -0
  66. package/dist/template/src/app/(payload)/admin/[[...segments]]/page.tsx +17 -0
  67. package/dist/template/src/app/(payload)/api/[...slug]/route.ts +9 -0
  68. package/dist/template/src/app/(payload)/api/graphql/route.ts +6 -0
  69. package/dist/template/src/app/(payload)/api/graphql-playground/route.ts +6 -0
  70. package/dist/template/src/app/(payload)/custom.scss +0 -0
  71. package/dist/template/src/app/(payload)/layout.tsx +16 -0
  72. package/dist/template/src/app/my-route/route.ts +14 -0
  73. package/dist/template/src/collections/Users.ts +13 -0
  74. package/dist/template/src/payload.config.ts +38 -0
  75. package/dist/types.d.ts +55 -0
  76. package/dist/types.d.ts.map +1 -0
  77. package/dist/types.js +1 -1
  78. package/dist/types.js.map +1 -0
  79. package/dist/utils/copy-recursive-sync.d.ts +5 -0
  80. package/dist/utils/copy-recursive-sync.d.ts.map +1 -0
  81. package/dist/utils/copy-recursive-sync.js +34 -0
  82. package/dist/utils/copy-recursive-sync.js.map +1 -0
  83. package/dist/utils/log.d.ts +6 -0
  84. package/dist/utils/log.d.ts.map +1 -0
  85. package/dist/utils/log.js +62 -15
  86. package/dist/utils/log.js.map +1 -0
  87. package/dist/utils/messages.d.ts +11 -0
  88. package/dist/utils/messages.d.ts.map +1 -0
  89. package/dist/utils/messages.js +47 -16
  90. package/dist/utils/messages.js.map +1 -0
  91. package/package.json +27 -10
@@ -0,0 +1,55 @@
1
+ import type arg from 'arg';
2
+ export interface Args extends arg.Spec {
3
+ '--beta': BooleanConstructor;
4
+ '--db': StringConstructor;
5
+ '--db-accept-recommended': BooleanConstructor;
6
+ '--db-connection-string': StringConstructor;
7
+ '--debug': BooleanConstructor;
8
+ '--dry-run': BooleanConstructor;
9
+ '--help': BooleanConstructor;
10
+ '--init-next': BooleanConstructor;
11
+ '--local-template': StringConstructor;
12
+ '--name': StringConstructor;
13
+ '--no-deps': BooleanConstructor;
14
+ '--secret': StringConstructor;
15
+ '--template': StringConstructor;
16
+ '--template-branch': StringConstructor;
17
+ '--use-npm': BooleanConstructor;
18
+ '--use-pnpm': BooleanConstructor;
19
+ '--use-yarn': BooleanConstructor;
20
+ '-h': string;
21
+ '-n': string;
22
+ '-t': string;
23
+ }
24
+ export type CliArgs = arg.Result<Args>;
25
+ export type ProjectTemplate = GitTemplate | PluginTemplate;
26
+ /**
27
+ * Template that is cloned verbatim from a git repo
28
+ * Performs .env manipulation based upon input
29
+ */
30
+ export interface GitTemplate extends Template {
31
+ type: 'starter';
32
+ url: string;
33
+ }
34
+ /**
35
+ * Type specifically for the plugin template
36
+ * No .env manipulation is done
37
+ */
38
+ export interface PluginTemplate extends Template {
39
+ type: 'plugin';
40
+ url: string;
41
+ }
42
+ interface Template {
43
+ description?: string;
44
+ name: string;
45
+ type: ProjectTemplate['type'];
46
+ }
47
+ export type PackageManager = 'bun' | 'npm' | 'pnpm' | 'yarn';
48
+ export type DbType = 'mongodb' | 'postgres';
49
+ export type DbDetails = {
50
+ dbUri: string;
51
+ type: DbType;
52
+ };
53
+ export type EditorType = 'lexical' | 'slate';
54
+ export {};
55
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAE1B,MAAM,WAAW,IAAK,SAAQ,GAAG,CAAC,IAAI;IACpC,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,MAAM,EAAE,iBAAiB,CAAA;IACzB,yBAAyB,EAAE,kBAAkB,CAAA;IAC7C,wBAAwB,EAAE,iBAAiB,CAAA;IAC3C,SAAS,EAAE,kBAAkB,CAAA;IAC7B,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,aAAa,EAAE,kBAAkB,CAAA;IACjC,kBAAkB,EAAE,iBAAiB,CAAA;IACrC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,WAAW,EAAE,kBAAkB,CAAA;IAC/B,UAAU,EAAE,iBAAiB,CAAA;IAC7B,YAAY,EAAE,iBAAiB,CAAA;IAC/B,mBAAmB,EAAE,iBAAiB,CAAA;IACtC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,YAAY,EAAE,kBAAkB,CAAA;IAChC,YAAY,EAAE,kBAAkB,CAAA;IAIhC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAEtC,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,cAAc,CAAA;AAE1D;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,QAAQ;IAC3C,IAAI,EAAE,SAAS,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,IAAI,EAAE,QAAQ,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,UAAU,QAAQ;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAA;CAC9B;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;AAE5D,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;AAE3C,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,CAAA"}
package/dist/types.js CHANGED
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
 
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Recursively copy files from src to dest
3
+ */
4
+ export declare function copyRecursiveSync(src: string, dest: string, debug?: boolean): void;
5
+ //# sourceMappingURL=copy-recursive-sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-recursive-sync.d.ts","sourceRoot":"","sources":["../../src/utils/copy-recursive-sync.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,QAY3E"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "copyRecursiveSync", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return copyRecursiveSync;
9
+ }
10
+ });
11
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
13
+ function _interop_require_default(obj) {
14
+ return obj && obj.__esModule ? obj : {
15
+ default: obj
16
+ };
17
+ }
18
+ function copyRecursiveSync(src, dest, debug) {
19
+ const exists = _fs.default.existsSync(src);
20
+ const stats = exists && _fs.default.statSync(src);
21
+ const isDirectory = exists && stats !== false && stats.isDirectory();
22
+ if (isDirectory) {
23
+ _fs.default.mkdirSync(dest, {
24
+ recursive: true
25
+ });
26
+ _fs.default.readdirSync(src).forEach((childItemName)=>{
27
+ copyRecursiveSync(_path.default.join(src, childItemName), _path.default.join(dest, childItemName));
28
+ });
29
+ } else {
30
+ _fs.default.copyFileSync(src, dest);
31
+ }
32
+ }
33
+
34
+ //# sourceMappingURL=copy-recursive-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/copy-recursive-sync.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\n\n/**\n * Recursively copy files from src to dest\n */\nexport function copyRecursiveSync(src: string, dest: string, debug?: boolean) {\n const exists = fs.existsSync(src)\n const stats = exists && fs.statSync(src)\n const isDirectory = exists && stats !== false && stats.isDirectory()\n if (isDirectory) {\n fs.mkdirSync(dest, { recursive: true })\n fs.readdirSync(src).forEach((childItemName) => {\n copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName))\n })\n } else {\n fs.copyFileSync(src, dest)\n }\n}\n"],"names":["copyRecursiveSync","src","dest","debug","exists","fs","existsSync","stats","statSync","isDirectory","mkdirSync","recursive","readdirSync","forEach","childItemName","path","join","copyFileSync"],"mappings":";;;;+BAMgBA;;;eAAAA;;;2DAND;6DACE;;;;;;AAKV,SAASA,kBAAkBC,GAAW,EAAEC,IAAY,EAAEC,KAAe;IAC1E,MAAMC,SAASC,WAAE,CAACC,UAAU,CAACL;IAC7B,MAAMM,QAAQH,UAAUC,WAAE,CAACG,QAAQ,CAACP;IACpC,MAAMQ,cAAcL,UAAUG,UAAU,SAASA,MAAME,WAAW;IAClE,IAAIA,aAAa;QACfJ,WAAE,CAACK,SAAS,CAACR,MAAM;YAAES,WAAW;QAAK;QACrCN,WAAE,CAACO,WAAW,CAACX,KAAKY,OAAO,CAAC,CAACC;YAC3Bd,kBAAkBe,aAAI,CAACC,IAAI,CAACf,KAAKa,gBAAgBC,aAAI,CAACC,IAAI,CAACd,MAAMY;QACnE;IACF,OAAO;QACLT,WAAE,CAACY,YAAY,CAAChB,KAAKC;IACvB;AACF"}
@@ -0,0 +1,6 @@
1
+ export declare const warning: (message: string) => void;
2
+ export declare const info: (message: string) => void;
3
+ export declare const error: (message: string) => void;
4
+ export declare const debug: (message: string) => void;
5
+ export declare const log: (message: string) => void;
6
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,YAAa,MAAM,KAAG,IAEzC,CAAA;AAED,eAAO,MAAM,IAAI,YAAa,MAAM,KAAG,IAEtC,CAAA;AAED,eAAO,MAAM,KAAK,YAAa,MAAM,KAAG,IAEvC,CAAA;AAED,eAAO,MAAM,KAAK,YAAa,MAAM,KAAG,IAEvC,CAAA;AAED,eAAO,MAAM,GAAG,YAAa,MAAM,KAAG,IAErC,CAAA"}
package/dist/utils/log.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ /* eslint-disable no-console */ "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
@@ -9,37 +9,84 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- success: function() {
13
- return success;
12
+ debug: function() {
13
+ return debug;
14
14
  },
15
- warning: function() {
16
- return warning;
15
+ error: function() {
16
+ return error;
17
17
  },
18
18
  info: function() {
19
19
  return info;
20
20
  },
21
- error: function() {
22
- return error;
21
+ log: function() {
22
+ return log;
23
+ },
24
+ warning: function() {
25
+ return warning;
23
26
  }
24
27
  });
28
+ const _prompts = /*#__PURE__*/ _interop_require_wildcard(require("@clack/prompts"));
25
29
  const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk"));
26
- const _figures = /*#__PURE__*/ _interop_require_default(require("figures"));
27
30
  function _interop_require_default(obj) {
28
31
  return obj && obj.__esModule ? obj : {
29
32
  default: obj
30
33
  };
31
34
  }
32
- const success = (message)=>{
33
- console.log(`${_chalk.default.green(_figures.default.tick)} ${_chalk.default.bold(message)}`);
34
- };
35
+ function _getRequireWildcardCache(nodeInterop) {
36
+ if (typeof WeakMap !== "function") return null;
37
+ var cacheBabelInterop = new WeakMap();
38
+ var cacheNodeInterop = new WeakMap();
39
+ return (_getRequireWildcardCache = function(nodeInterop) {
40
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
41
+ })(nodeInterop);
42
+ }
43
+ function _interop_require_wildcard(obj, nodeInterop) {
44
+ if (!nodeInterop && obj && obj.__esModule) {
45
+ return obj;
46
+ }
47
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
48
+ return {
49
+ default: obj
50
+ };
51
+ }
52
+ var cache = _getRequireWildcardCache(nodeInterop);
53
+ if (cache && cache.has(obj)) {
54
+ return cache.get(obj);
55
+ }
56
+ var newObj = {
57
+ __proto__: null
58
+ };
59
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
60
+ for(var key in obj){
61
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
62
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
63
+ if (desc && (desc.get || desc.set)) {
64
+ Object.defineProperty(newObj, key, desc);
65
+ } else {
66
+ newObj[key] = obj[key];
67
+ }
68
+ }
69
+ }
70
+ newObj.default = obj;
71
+ if (cache) {
72
+ cache.set(obj, newObj);
73
+ }
74
+ return newObj;
75
+ }
35
76
  const warning = (message)=>{
36
- console.log(_chalk.default.yellow('? ') + _chalk.default.bold(message));
77
+ _prompts.log.warn(_chalk.default.yellow('? ') + _chalk.default.bold(message));
37
78
  };
38
79
  const info = (message)=>{
39
- console.log(`${_chalk.default.yellow(_figures.default.info)} ${_chalk.default.bold(message)}`);
80
+ _prompts.log.step(_chalk.default.bold(message));
40
81
  };
41
82
  const error = (message)=>{
42
- console.log(`${_chalk.default.red(_figures.default.cross)} ${_chalk.default.bold(message)}`);
83
+ _prompts.log.error(_chalk.default.bold(message));
84
+ };
85
+ const debug = (message)=>{
86
+ _prompts.log.step(`${_chalk.default.bgGray('[DEBUG]')} ${_chalk.default.gray(message)}`);
87
+ };
88
+ const log = (message)=>{
89
+ _prompts.log.message(message);
43
90
  };
44
91
 
45
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9sb2cudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGNoYWxrIGZyb20gJ2NoYWxrJ1xuaW1wb3J0IGZpZ3VyZXMgZnJvbSAnZmlndXJlcydcblxuZXhwb3J0IGNvbnN0IHN1Y2Nlc3MgPSAobWVzc2FnZTogc3RyaW5nKTogdm9pZCA9PiB7XG4gIGNvbnNvbGUubG9nKGAke2NoYWxrLmdyZWVuKGZpZ3VyZXMudGljayl9ICR7Y2hhbGsuYm9sZChtZXNzYWdlKX1gKVxufVxuXG5leHBvcnQgY29uc3Qgd2FybmluZyA9IChtZXNzYWdlOiBzdHJpbmcpOiB2b2lkID0+IHtcbiAgY29uc29sZS5sb2coY2hhb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VPLE1BQU1GLE9BQU8sQ0FBQ0U7SUFDbkJDLFFBQVFDLEdBQUcsQ0FBQyxDQUFDLEVBQUVDLGNBQUssQ0FBQ0ssTUFBTSxDQUFDSCxnQkFBTyxDQUFDUCxJQUFJLEVBQUUsQ0FBQyxFQUFFSyxjQUFLLENBQUNJLElBQUksQ0FBQ1AsU0FBUyxDQUFDO0FBQ3BFO0FBRU8sTUFBTUQsUUFBUSxDQUFDQztJQUNwQkMsUUFBUUMsR0FBRyxDQUFDLENBQUMsRUFBRUMsY0FBSyxDQUFDTSxHQUFHLENBQUNKLGdCQUFPLENBQUNLLEtBQUssRUFBRSxDQUFDLEVBQUVQLGNBQUssQ0FBQ0ksSUFBSSxDQUFDUCxTQUFTLENBQUM7QUFDbEUifQ==
92
+ //# sourceMappingURL=log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport * as p from '@clack/prompts'\nimport chalk from 'chalk'\n\nexport const warning = (message: string): void => {\n p.log.warn(chalk.yellow('? ') + chalk.bold(message))\n}\n\nexport const info = (message: string): void => {\n p.log.step(chalk.bold(message))\n}\n\nexport const error = (message: string): void => {\n p.log.error(chalk.bold(message))\n}\n\nexport const debug = (message: string): void => {\n p.log.step(`${chalk.bgGray('[DEBUG]')} ${chalk.gray(message)}`)\n}\n\nexport const log = (message: string): void => {\n p.log.message(message)\n}\n"],"names":["debug","error","info","log","warning","message","p","warn","chalk","yellow","bold","step","bgGray","gray"],"mappings":"AAAA,6BAA6B;;;;;;;;;;;IAgBhBA,KAAK;eAALA;;IAJAC,KAAK;eAALA;;IAJAC,IAAI;eAAJA;;IAYAC,GAAG;eAAHA;;IAhBAC,OAAO;eAAPA;;;iEAHM;8DACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEX,MAAMA,UAAU,CAACC;IACtBC,SAAEH,GAAG,CAACI,IAAI,CAACC,cAAK,CAACC,MAAM,CAAC,QAAQD,cAAK,CAACE,IAAI,CAACL;AAC7C;AAEO,MAAMH,OAAO,CAACG;IACnBC,SAAEH,GAAG,CAACQ,IAAI,CAACH,cAAK,CAACE,IAAI,CAACL;AACxB;AAEO,MAAMJ,QAAQ,CAACI;IACpBC,SAAEH,GAAG,CAACF,KAAK,CAACO,cAAK,CAACE,IAAI,CAACL;AACzB;AAEO,MAAML,QAAQ,CAACK;IACpBC,SAAEH,GAAG,CAACQ,IAAI,CAAC,CAAC,EAAEH,cAAK,CAACI,MAAM,CAAC,WAAW,CAAC,EAAEJ,cAAK,CAACK,IAAI,CAACR,SAAS,CAAC;AAChE;AAEO,MAAMF,MAAM,CAACE;IAClBC,SAAEH,GAAG,CAACE,OAAO,CAACA;AAChB"}
@@ -0,0 +1,11 @@
1
+ import type { PackageManager } from '../types.js';
2
+ export declare const welcomeMessage: string;
3
+ export declare function helpMessage(): void;
4
+ export declare function successMessage(projectDir: string, packageManager: PackageManager): string;
5
+ export declare function successfulNextInit(): string;
6
+ export declare function moveMessage(args: {
7
+ nextAppDir: string;
8
+ projectDir: string;
9
+ }): string;
10
+ export declare function feedbackOutro(): string;
11
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/utils/messages.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAMjD,eAAO,MAAM,cAAc,QAE1B,CAAA;AAID,wBAAgB,WAAW,IAAI,IAAI,CAsBlC;AAQD,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,GAAG,MAAM,CAsBzF;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAapF;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ /* eslint-disable no-console */ "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
@@ -9,39 +9,47 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- welcomeMessage: function() {
13
- return welcomeMessage;
12
+ feedbackOutro: function() {
13
+ return feedbackOutro;
14
14
  },
15
15
  helpMessage: function() {
16
16
  return helpMessage;
17
17
  },
18
+ moveMessage: function() {
19
+ return moveMessage;
20
+ },
18
21
  successMessage: function() {
19
22
  return successMessage;
23
+ },
24
+ successfulNextInit: function() {
25
+ return successfulNextInit;
26
+ },
27
+ welcomeMessage: function() {
28
+ return welcomeMessage;
20
29
  }
21
30
  });
22
31
  const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk"));
23
- const _figures = /*#__PURE__*/ _interop_require_default(require("figures"));
24
32
  const _path = /*#__PURE__*/ _interop_require_default(require("path"));
25
33
  const _terminallink = /*#__PURE__*/ _interop_require_default(require("terminal-link"));
26
- const _templates = require("../lib/templates");
34
+ const _templates = require("../lib/templates.js");
27
35
  function _interop_require_default(obj) {
28
36
  return obj && obj.__esModule ? obj : {
29
37
  default: obj
30
38
  };
31
39
  }
32
- const header = (message)=>`${_chalk.default.yellow(_figures.default.star)} ${_chalk.default.bold(message)}`;
40
+ const header = (message)=>_chalk.default.bold(message);
33
41
  const welcomeMessage = (0, _chalk.default)`
34
42
  {green Welcome to Payload. Let's create a project! }
35
43
  `;
36
44
  const spacer = ' '.repeat(8);
37
45
  function helpMessage() {
38
46
  const validTemplates = (0, _templates.getValidTemplates)();
39
- return (0, _chalk.default)`
47
+ console.log((0, _chalk.default)`
40
48
  {bold USAGE}
41
49
 
42
50
  {dim $} {bold npx create-payload-app}
43
51
  {dim $} {bold npx create-payload-app} my-project
44
- {dim $} {bold npx create-payload-app} -n my-project -t blog
52
+ {dim $} {bold npx create-payload-app} -n my-project -t template-name
45
53
 
46
54
  {bold OPTIONS}
47
55
 
@@ -55,25 +63,48 @@ function helpMessage() {
55
63
  --use-pnpm Use pnpm to install dependencies
56
64
  --no-deps Do not install any dependencies
57
65
  -h Show help
58
- `;
66
+ `);
59
67
  }
60
68
  function formatTemplates(templates) {
61
69
  return `\n\n${spacer}${templates.map((t)=>`${t.name}${' '.repeat(28 - t.name.length)}${t.description}`).join(`\n${spacer}`)}`;
62
70
  }
63
71
  function successMessage(projectDir, packageManager) {
72
+ const relativePath = _path.default.relative(process.cwd(), projectDir);
73
+ return `
74
+ ${header('Launch Application:')}
75
+
76
+ - cd ./${relativePath}
77
+ - ${packageManager === 'npm' ? 'npm run' : packageManager} dev or follow directions in ${createTerminalLink('README.md', `file://${_path.default.resolve(projectDir, 'README.md')}`)}
78
+
79
+ ${header('Documentation:')}
80
+
81
+ - ${createTerminalLink('Getting Started', 'https://payloadcms.com/docs/getting-started/what-is-payload')}
82
+ - ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}
83
+
84
+ `;
85
+ }
86
+ function successfulNextInit() {
87
+ return `- ${createTerminalLink('Getting Started', 'https://payloadcms.com/docs/getting-started/what-is-payload')}
88
+ - ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}
89
+ `;
90
+ }
91
+ function moveMessage(args) {
92
+ const relativePath = _path.default.relative(process.cwd(), args.nextAppDir);
64
93
  return `
65
- ${header('Launch Application:')}
94
+ ${header('Next Steps:')}
66
95
 
67
- - cd ${projectDir}
68
- - ${packageManager === 'yarn' ? 'yarn' : 'npm run'} dev or follow directions in ${createTerminalLink('README.md', `file://${_path.default.resolve(projectDir, 'README.md')}`)}
96
+ Payload does not support a top-level layout.tsx file in the app directory.
69
97
 
70
- ${header('Documentation:')}
98
+ ${_chalk.default.bold('To continue:')}
71
99
 
72
- - ${createTerminalLink('Getting Started', 'https://payloadcms.com/docs/getting-started/what-is-payload')}
73
- - ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}
100
+ Move all files from ./${relativePath} to a named directory such as ./${relativePath}/${_chalk.default.bold('(app)')}
74
101
 
102
+ Once moved, rerun the create-payload-app command again.
75
103
  `;
76
104
  }
105
+ function feedbackOutro() {
106
+ return `${_chalk.default.bgCyan(_chalk.default.black(' Have feedback? '))} Visit us on ${createTerminalLink('GitHub', 'https://github.com/payloadcms/payload')}.`;
107
+ }
77
108
  // Create terminalLink with fallback for unsupported terminals
78
109
  function createTerminalLink(text, url) {
79
110
  return (0, _terminallink.default)(text, url, {
@@ -81,4 +112,4 @@ function createTerminalLink(text, url) {
81
112
  });
82
113
  }
83
114
 
84
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9tZXNzYWdlcy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgY2hhbGsgZnJvbSAnY2hhbGsnXG5pbXBvcnQgZmlndXJlcyBmcm9tICdmaWd1cmVzJ1xuaW1wb3J0IHBhdGggZnJvbSAncGF0aCdcbmltcG9ydCB0ZXJtaW5hbExpbmsgZnJvbSAndGVybWluYWwtbGluaydcblxuaW1wb3J0IHR5cGUgeyBQcm9qZWN0VGVtcGxhdGUgfSBmcm9tICcuLi90eXBlcydcblxuaW1wb3J0IHsgZ2V0VmFsaWRUZW1wbGF0ZXMgfSBmcm9tICcuLi9saWIvdGVtcGxhdGVzJ1xuXG5jb25zdCBoZWFkZXIgPSAobWVzc2FnZTogc3RyaW5nKTogc3RyaW5nID0+IGAke2NoYWxrLnllbGxvdyhmaWd1cmVzLnN0YXIpfSAke2NoYWxrLmJvbGQobWVzc2FnZSl9YFxuXG5leHBvcnQgY29uc3Qgd2VsY29tZU1lc3NhZ2UgPSBjaGFsa2BcbiAge2dyZWVuIFdlbGNvbWUgdG8gUGF5bG9hZC4gTGV0J3MgY3JlYXRlIGEgcHJvamVjdCEgfVxuYFxuXG5jb25zdCBzcGFjZXIgPSAnICcucmV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RUFDakQ7O0VBRUosRUFBRW5CLE9BQU8sa0JBQWtCOztNQUV2QixFQUFFcUIsbUJBQ0YsbUJBQ0EsK0RBQ0E7TUFDQSxFQUFFQSxtQkFBbUIsaUJBQWlCLHNEQUFzRDs7QUFFbEcsQ0FBQztBQUNEO0FBRUEsOERBQThEO0FBQzlELFNBQVNBLG1CQUFtQkcsSUFBWSxFQUFFQyxHQUFXO0lBQ25ELE9BQU9DLElBQUFBLHFCQUFZLEVBQUNGLE1BQU1DLEtBQUs7UUFDN0JFLFVBQVUsQ0FBQ0gsTUFBTUMsTUFBUSxDQUFDLEVBQUVELEtBQUssRUFBRSxFQUFFQyxJQUFJLENBQUM7SUFDNUM7QUFDRiJ9
115
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +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 { ProjectTemplate } from '../types.js'\nimport type { PackageManager } 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 $} {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 relativePath = 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\nMove all files from ./${relativePath} to a named directory such as ./${relativePath}/${chalk.bold('(app)')}\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":["feedbackOutro","helpMessage","moveMessage","successMessage","successfulNextInit","welcomeMessage","header","message","chalk","bold","spacer","repeat","validTemplates","getValidTemplates","console","log","formatTemplates","templates","map","t","name","length","description","join","projectDir","packageManager","relativePath","path","relative","process","cwd","createTerminalLink","resolve","args","nextAppDir","bgCyan","black","text","url","terminalLink","fallback"],"mappings":"AAAA,6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,iBAAiB,sDAAsD;;AAEhG,CAAC;AACD;AAEO,SAAS3B;IACd,OAAO,CAAC,EAAE,EAAE2B,mBACV,mBACA,+DACA;EACF,EAAEA,mBAAmB,iBAAiB,sDAAsD;AAC9F,CAAC;AACD;AAEO,SAAS7B,YAAY+B,IAAgD;IAC1E,MAAMP,eAAeC,aAAI,CAACC,QAAQ,CAACC,QAAQC,GAAG,IAAIG,KAAKC,UAAU;IACjE,OAAO,CAAC;AACV,EAAE5B,OAAO,eAAe;;;;AAIxB,EAAEE,cAAK,CAACC,IAAI,CAAC,gBAAgB;;sBAEP,EAAEiB,aAAa,gCAAgC,EAAEA,aAAa,CAAC,EAAElB,cAAK,CAACC,IAAI,CAAC,SAAS;;;AAG3G,CAAC;AACD;AAEO,SAAST;IACd,OAAO,CAAC,EAAEQ,cAAK,CAAC2B,MAAM,CAAC3B,cAAK,CAAC4B,KAAK,CAAC,qBAAqB,aAAa,EAAEL,mBAAmB,UAAU,yCAAyC,CAAC,CAAC;AACjJ;AAEA,8DAA8D;AAC9D,SAASA,mBAAmBM,IAAY,EAAEC,GAAW;IACnD,OAAOC,IAAAA,qBAAY,EAACF,MAAMC,KAAK;QAC7BE,UAAU,CAACH,MAAMC,MAAQ,CAAC,EAAED,KAAK,EAAE,EAAEC,IAAI,CAAC;IAC5C;AACF"}
package/package.json CHANGED
@@ -1,42 +1,59 @@
1
1
  {
2
2
  "name": "create-payload-app",
3
- "version": "1.0.0",
3
+ "version": "3.0.0-alpha.50",
4
4
  "license": "MIT",
5
+ "type": "module",
6
+ "homepage": "https://payloadcms.com",
5
7
  "bin": {
6
8
  "create-payload-app": "bin/cli.js"
7
9
  },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/payloadcms/payload.git",
13
+ "directory": "packages/create-payload-app"
14
+ },
8
15
  "files": [
9
16
  "package.json",
10
17
  "dist",
11
18
  "bin"
12
19
  ],
13
20
  "dependencies": {
21
+ "@clack/prompts": "^0.7.0",
14
22
  "@sindresorhus/slugify": "^1.1.0",
15
23
  "arg": "^5.0.0",
16
24
  "chalk": "^4.1.0",
17
25
  "command-exists": "^1.2.9",
26
+ "comment-json": "^4.2.3",
18
27
  "degit": "^2.8.4",
28
+ "detect-package-manager": "^3.0.1",
29
+ "esprima": "^4.0.1",
19
30
  "execa": "^5.0.0",
20
- "figures": "^3.2.0",
31
+ "figures": "^6.1.0",
21
32
  "fs-extra": "^9.0.1",
22
- "handlebars": "^4.7.7",
23
- "ora": "^5.1.0",
24
- "prompts": "^2.4.2",
33
+ "globby": "11.1.0",
25
34
  "terminal-link": "^2.1.1"
26
35
  },
27
36
  "devDependencies": {
28
37
  "@types/command-exists": "^1.2.0",
29
38
  "@types/degit": "^2.8.3",
39
+ "@types/esprima": "^4.0.6",
30
40
  "@types/fs-extra": "^9.0.12",
31
41
  "@types/jest": "^27.0.3",
32
- "@types/node": "^16.6.2",
33
- "@types/prompts": "^2.4.1",
34
- "ts-jest": "^29.1.0"
42
+ "@types/node": "^16.6.2"
43
+ },
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
+ }
35
50
  },
36
51
  "scripts": {
37
- "build": "pnpm build:swc",
52
+ "build": "pnpm pack-template-files && pnpm typecheck && pnpm build:swc",
53
+ "typecheck": "tsc",
54
+ "pack-template-files": "tsx src/scripts/pack-template-files.ts",
38
55
  "build:swc": "swc ./src -d ./dist --config-file .swcrc",
39
- "clean": "rimraf dist",
56
+ "clean": "rimraf {dist,*.tsbuildinfo}",
40
57
  "test": "jest"
41
58
  }
42
59
  }