create-payload-app 0.3.9-beta.0 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -37,25 +37,31 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  var main_1 = require("./main");
40
+ var usage_1 = require("./utils/usage");
40
41
  var log_1 = require("./utils/log");
41
42
  (function () { return __awaiter(void 0, void 0, void 0, function () {
42
- var main, e_1;
43
+ var trx, main, e_1;
43
44
  return __generator(this, function (_a) {
44
45
  switch (_a.label) {
45
46
  case 0:
47
+ trx = (0, usage_1.init)();
46
48
  main = new main_1.Main();
47
49
  _a.label = 1;
48
50
  case 1:
49
- _a.trys.push([1, 3, , 4]);
51
+ _a.trys.push([1, 3, 4, 5]);
50
52
  return [4 /*yield*/, main.init()];
51
53
  case 2:
52
54
  _a.sent();
53
- return [3 /*break*/, 4];
55
+ return [3 /*break*/, 5];
54
56
  case 3:
55
57
  e_1 = _a.sent();
58
+ (0, usage_1.handleException)(e_1);
56
59
  (0, log_1.error)("An error has occurred: ".concat(e_1 instanceof Error ? e_1.message : e_1));
57
- return [3 /*break*/, 4];
58
- case 4: return [2 /*return*/];
60
+ return [3 /*break*/, 5];
61
+ case 4:
62
+ trx === null || trx === void 0 ? void 0 : trx.finish();
63
+ return [7 /*endfinally*/];
64
+ case 5: return [2 /*return*/];
59
65
  }
60
66
  });
61
67
  }); })();
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.createProject = exports.updatePayloadVersion = void 0;
42
+ exports.createProject = exports.updatePayloadVersion = exports.getLatestPayloadVersion = void 0;
43
43
  var path_1 = __importDefault(require("path"));
44
44
  var chalk_1 = __importDefault(require("chalk"));
45
45
  var fs_extra_1 = __importDefault(require("fs-extra"));
@@ -47,6 +47,7 @@ var execa_1 = __importDefault(require("execa"));
47
47
  var ora_1 = __importDefault(require("ora"));
48
48
  var degit_1 = __importDefault(require("degit"));
49
49
  var log_1 = require("../utils/log");
50
+ var usage_1 = require("../utils/usage");
50
51
  function createProjectDir(projectDir) {
51
52
  return __awaiter(this, void 0, void 0, function () {
52
53
  var pathExists;
@@ -94,38 +95,69 @@ function installDeps(args, dir, packageManager) {
94
95
  });
95
96
  });
96
97
  }
97
- function updatePayloadVersion(projectDir, payloadVersion) {
98
+ function getLatestPayloadVersion(betaFlag) {
99
+ if (betaFlag === void 0) { betaFlag = false; }
98
100
  return __awaiter(this, void 0, void 0, function () {
99
- var packageJsonPath, packageObj, err_1;
101
+ var packageWithTag, stdout, error_2;
100
102
  return __generator(this, function (_a) {
101
103
  switch (_a.label) {
102
104
  case 0:
105
+ _a.trys.push([0, 2, , 3]);
106
+ packageWithTag = 'payload';
107
+ if (betaFlag)
108
+ packageWithTag += '@beta';
109
+ return [4 /*yield*/, (0, execa_1.default)("npm info ".concat(packageWithTag, " version"), [], {
110
+ shell: true,
111
+ })];
112
+ case 1:
113
+ stdout = (_a.sent()).stdout;
114
+ return [2 /*return*/, "^".concat(stdout)];
115
+ case 2:
116
+ error_2 = _a.sent();
117
+ return [2 /*return*/, false];
118
+ case 3: return [2 /*return*/];
119
+ }
120
+ });
121
+ });
122
+ }
123
+ exports.getLatestPayloadVersion = getLatestPayloadVersion;
124
+ function updatePayloadVersion(projectDir, betaFlag) {
125
+ if (betaFlag === void 0) { betaFlag = false; }
126
+ return __awaiter(this, void 0, void 0, function () {
127
+ var payloadVersion, packageJsonPath, packageObj, err_1;
128
+ return __generator(this, function (_a) {
129
+ switch (_a.label) {
130
+ case 0: return [4 /*yield*/, getLatestPayloadVersion(betaFlag)];
131
+ case 1:
132
+ payloadVersion = _a.sent();
103
133
  if (!payloadVersion) {
104
134
  (0, log_1.warning)('Error retrieving latest Payload version. Please update your package.json manually.');
135
+ return [2 /*return*/];
105
136
  }
137
+ (0, usage_1.setTags)({ payload_version: payloadVersion });
106
138
  packageJsonPath = path_1.default.resolve(projectDir, 'package.json');
107
- _a.label = 1;
108
- case 1:
109
- _a.trys.push([1, 4, , 5]);
110
- return [4 /*yield*/, fs_extra_1.default.readJson(packageJsonPath)];
139
+ _a.label = 2;
111
140
  case 2:
141
+ _a.trys.push([2, 5, , 6]);
142
+ return [4 /*yield*/, fs_extra_1.default.readJson(packageJsonPath)];
143
+ case 3:
112
144
  packageObj = _a.sent();
113
145
  packageObj.dependencies.payload = payloadVersion;
114
146
  return [4 /*yield*/, fs_extra_1.default.writeJson(packageJsonPath, packageObj, { spaces: 2 })];
115
- case 3:
116
- _a.sent();
117
- return [3 /*break*/, 5];
118
147
  case 4:
148
+ _a.sent();
149
+ return [3 /*break*/, 6];
150
+ case 5:
119
151
  err_1 = _a.sent();
120
152
  (0, log_1.warning)('Unable to write Payload version to package.json. Please update your package.json manually.');
121
- return [3 /*break*/, 5];
122
- case 5: return [2 /*return*/];
153
+ return [3 /*break*/, 6];
154
+ case 6: return [2 /*return*/];
123
155
  }
124
156
  });
125
157
  });
126
158
  }
127
159
  exports.updatePayloadVersion = updatePayloadVersion;
128
- function createProject(args, projectDir, template, packageManager, payloadVersion) {
160
+ function createProject(args, projectDir, template, packageManager) {
129
161
  return __awaiter(this, void 0, void 0, function () {
130
162
  var templateDir, emitter, err_2, msg, spinner, result;
131
163
  return __generator(this, function (_a) {
@@ -156,7 +188,7 @@ function createProject(args, projectDir, template, packageManager, payloadVersio
156
188
  return [3 /*break*/, 6];
157
189
  case 6:
158
190
  spinner = (0, ora_1.default)('Checking latest Payload version...').start();
159
- return [4 /*yield*/, updatePayloadVersion(projectDir, payloadVersion)];
191
+ return [4 /*yield*/, updatePayloadVersion(projectDir, args['--beta'])];
160
192
  case 7:
161
193
  _a.sent();
162
194
  spinner.text = 'Installing dependencies...';
@@ -42,7 +42,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
42
42
  var fs_extra_1 = __importDefault(require("fs-extra"));
43
43
  var path_1 = __importDefault(require("path"));
44
44
  var createProject_1 = require("./createProject");
45
- var getPayloadVersion_1 = require("./getPayloadVersion");
46
45
  describe('createProject', function () {
47
46
  var projectDir = path_1.default.resolve(__dirname, './tmp');
48
47
  beforeAll(function () {
@@ -65,11 +64,11 @@ describe('createProject', function () {
65
64
  var expectedPayloadVersion, template, packageJsonPath, packageJson;
66
65
  return __generator(this, function (_a) {
67
66
  switch (_a.label) {
68
- case 0: return [4 /*yield*/, (0, getPayloadVersion_1.getLatestPayloadVersion)()];
67
+ case 0: return [4 /*yield*/, (0, createProject_1.getLatestPayloadVersion)()];
69
68
  case 1:
70
69
  expectedPayloadVersion = _a.sent();
71
70
  template = { name: 'ts-todo', type: 'static' };
72
- return [4 /*yield*/, (0, createProject_1.createProject)(args, projectDir, template, packageManager, expectedPayloadVersion)];
71
+ return [4 /*yield*/, (0, createProject_1.createProject)(args, projectDir, template, packageManager)];
73
72
  case 2:
74
73
  _a.sent();
75
74
  packageJsonPath = path_1.default.resolve(projectDir, 'package.json');
@@ -82,25 +81,24 @@ describe('createProject', function () {
82
81
  });
83
82
  describe('#updatePayloadVersion', function () {
84
83
  it('updates payload version in package.json', function () { return __awaiter(void 0, void 0, void 0, function () {
85
- var originalPayloadVersion, packageJsonPath, modified;
84
+ var packageJsonPath, modified;
86
85
  return __generator(this, function (_a) {
87
86
  switch (_a.label) {
88
87
  case 0:
89
- originalPayloadVersion = '0.0.1';
90
88
  packageJsonPath = path_1.default.resolve(projectDir, 'package.json');
91
89
  return [4 /*yield*/, fs_extra_1.default.mkdir(projectDir)];
92
90
  case 1:
93
91
  _a.sent();
94
- return [4 /*yield*/, fs_extra_1.default.writeJson(packageJsonPath, { dependencies: { payload: originalPayloadVersion } }, { spaces: 2 })];
92
+ return [4 /*yield*/, fs_extra_1.default.writeJson(packageJsonPath, { dependencies: { payload: '0.0.1' } }, { spaces: 2 })];
95
93
  case 2:
96
94
  _a.sent();
97
- return [4 /*yield*/, (0, createProject_1.updatePayloadVersion)(projectDir, '0.0.2')];
95
+ return [4 /*yield*/, (0, createProject_1.updatePayloadVersion)(projectDir)];
98
96
  case 3:
99
97
  _a.sent();
100
98
  return [4 /*yield*/, fs_extra_1.default.readJson(packageJsonPath)];
101
99
  case 4:
102
100
  modified = _a.sent();
103
- expect(modified.dependencies.payload).not.toBe(originalPayloadVersion);
101
+ expect(modified.dependencies.payload).not.toBe('0.0.1');
104
102
  return [2 /*return*/];
105
103
  }
106
104
  });
@@ -41,6 +41,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  exports.parseTemplate = void 0;
43
43
  var prompts_1 = __importDefault(require("prompts"));
44
+ var usage_1 = require("../utils/usage");
44
45
  function parseTemplate(args, validTemplates, language) {
45
46
  return __awaiter(this, void 0, void 0, function () {
46
47
  var templateName_1, template_1, filteredTemplates, response, template;
@@ -52,6 +53,7 @@ function parseTemplate(args, validTemplates, language) {
52
53
  template_1 = validTemplates.find(function (template) { return template.name === templateName_1; });
53
54
  if (!template_1)
54
55
  throw new Error('Invalid template given');
56
+ (0, usage_1.setTags)({ template: template_1.name });
55
57
  return [2 /*return*/, template_1];
56
58
  }
57
59
  filteredTemplates = validTemplates
@@ -69,12 +71,15 @@ function parseTemplate(args, validTemplates, language) {
69
71
  onCancel: function () {
70
72
  process.exit(0);
71
73
  },
72
- })];
74
+ })
75
+ // const template = `${language}-${response.value}`
76
+ ];
73
77
  case 1:
74
78
  response = _a.sent();
75
79
  template = validTemplates.find(function (t) { return t.name === response.value; });
76
80
  if (!template)
77
81
  throw new Error('Template is undefined');
82
+ (0, usage_1.setTags)({ template: template.name });
78
83
  return [2 /*return*/, template];
79
84
  }
80
85
  });
package/dist/main.js CHANGED
@@ -42,19 +42,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
42
42
  exports.Main = void 0;
43
43
  var slugify_1 = __importDefault(require("@sindresorhus/slugify"));
44
44
  var arg_1 = __importDefault(require("arg"));
45
+ var command_exists_1 = __importDefault(require("command-exists"));
45
46
  var createProject_1 = require("./lib/createProject");
46
47
  var getDatabaseConnection_1 = require("./lib/getDatabaseConnection");
47
48
  var getPayloadSecret_1 = require("./lib/getPayloadSecret");
48
49
  var parseLanguage_1 = require("./lib/parseLanguage");
49
50
  var parseProjectName_1 = require("./lib/parseProjectName");
50
51
  var parseTemplate_1 = require("./lib/parseTemplate");
51
- var telemetry_1 = require("./utils/telemetry");
52
52
  var templates_1 = require("./lib/templates");
53
53
  var writeEnvFile_1 = require("./lib/writeEnvFile");
54
54
  var log_1 = require("./utils/log");
55
55
  var messages_1 = require("./utils/messages");
56
- var getPayloadVersion_1 = require("./lib/getPayloadVersion");
57
- var getPackageManager_1 = require("./lib/getPackageManager");
56
+ var usage_1 = require("./utils/usage");
58
57
  var Main = /** @class */ (function () {
59
58
  function Main() {
60
59
  this.args = (0, arg_1.default)({
@@ -74,78 +73,72 @@ var Main = /** @class */ (function () {
74
73
  }
75
74
  Main.prototype.init = function () {
76
75
  return __awaiter(this, void 0, void 0, function () {
77
- var _a, _b, templateArg, valid, _c, _d, projectName, language, validTemplates, template, databaseUri, payloadSecret, projectDir, packageManager, payloadVersion, error_1;
78
- return __generator(this, function (_e) {
79
- switch (_e.label) {
76
+ var _a, _b, templateArg, valid, _c, _d, projectName, language, validTemplates, template, databaseUri, payloadSecret, projectDir, packageManager, _e, _f, error_1;
77
+ return __generator(this, function (_g) {
78
+ switch (_g.label) {
80
79
  case 0:
81
- _e.trys.push([0, 17, , 18]);
80
+ _g.trys.push([0, 17, , 18]);
82
81
  if (!this.args['--help']) return [3 /*break*/, 2];
83
82
  _b = (_a = console).log;
84
83
  return [4 /*yield*/, (0, messages_1.helpMessage)()];
85
84
  case 1:
86
- _b.apply(_a, [_e.sent()]);
85
+ _b.apply(_a, [_g.sent()]);
87
86
  process.exit(0);
88
- _e.label = 2;
87
+ _g.label = 2;
89
88
  case 2:
90
89
  templateArg = this.args['--template'];
91
90
  if (!templateArg) return [3 /*break*/, 5];
92
91
  return [4 /*yield*/, (0, templates_1.validateTemplate)(templateArg)];
93
92
  case 3:
94
- valid = _e.sent();
93
+ valid = _g.sent();
95
94
  if (!!valid) return [3 /*break*/, 5];
96
95
  _d = (_c = console).log;
97
96
  return [4 /*yield*/, (0, messages_1.helpMessage)()];
98
97
  case 4:
99
- _d.apply(_c, [_e.sent()]);
98
+ _d.apply(_c, [_g.sent()]);
100
99
  process.exit(1);
101
- _e.label = 5;
100
+ _g.label = 5;
102
101
  case 5:
103
102
  console.log(messages_1.welcomeMessage);
104
103
  return [4 /*yield*/, (0, parseProjectName_1.parseProjectName)(this.args)];
105
104
  case 6:
106
- projectName = _e.sent();
105
+ projectName = _g.sent();
107
106
  return [4 /*yield*/, (0, parseLanguage_1.parseLanguage)(this.args)];
108
107
  case 7:
109
- language = _e.sent();
108
+ language = _g.sent();
110
109
  return [4 /*yield*/, (0, templates_1.getValidTemplates)()];
111
110
  case 8:
112
- validTemplates = _e.sent();
111
+ validTemplates = _g.sent();
113
112
  return [4 /*yield*/, (0, parseTemplate_1.parseTemplate)(this.args, validTemplates, language)];
114
113
  case 9:
115
- template = _e.sent();
114
+ template = _g.sent();
116
115
  return [4 /*yield*/, (0, getDatabaseConnection_1.getDatabaseConnection)(this.args, projectName)];
117
116
  case 10:
118
- databaseUri = _e.sent();
117
+ databaseUri = _g.sent();
119
118
  return [4 /*yield*/, (0, getPayloadSecret_1.getPayloadSecret)(this.args)];
120
119
  case 11:
121
- payloadSecret = _e.sent();
120
+ payloadSecret = _g.sent();
122
121
  projectDir = "./".concat((0, slugify_1.default)(projectName));
123
- return [4 /*yield*/, (0, getPackageManager_1.getPackageManager)(this.args)];
122
+ return [4 /*yield*/, getPackageManager(this.args)];
124
123
  case 12:
125
- packageManager = _e.sent();
126
- return [4 /*yield*/, (0, getPayloadVersion_1.getLatestPayloadVersion)(this.args['--beta'])];
124
+ packageManager = _g.sent();
125
+ if (!!this.args['--dry-run']) return [3 /*break*/, 15];
126
+ return [4 /*yield*/, (0, createProject_1.createProject)(this.args, projectDir, template, packageManager)];
127
127
  case 13:
128
- payloadVersion = _e.sent();
129
- if (!!this.args['--dry-run']) return [3 /*break*/, 16];
130
- return [4 /*yield*/, (0, createProject_1.createProject)(this.args, projectDir, template, packageManager, payloadVersion)];
131
- case 14:
132
- _e.sent();
128
+ _g.sent();
133
129
  return [4 /*yield*/, (0, writeEnvFile_1.writeEnvFile)(projectName, databaseUri, payloadSecret)];
130
+ case 14:
131
+ _g.sent();
132
+ _g.label = 15;
134
133
  case 15:
135
- _e.sent();
136
- (0, telemetry_1.sendAnonymousAnalytics)({
137
- projectDir: projectDir,
138
- packageManager: packageManager,
139
- template: template.name,
140
- payloadVersion: payloadVersion,
141
- });
142
- _e.label = 16;
143
- case 16:
144
134
  (0, log_1.success)('Payload project successfully created');
145
- console.log((0, messages_1.successMessage)(projectDir, packageManager));
135
+ _f = (_e = console).log;
136
+ return [4 /*yield*/, (0, messages_1.successMessage)(projectDir, packageManager)];
137
+ case 16:
138
+ _f.apply(_e, [_g.sent()]);
146
139
  return [3 /*break*/, 18];
147
140
  case 17:
148
- error_1 = _e.sent();
141
+ error_1 = _g.sent();
149
142
  console.log(error_1);
150
143
  return [3 /*break*/, 18];
151
144
  case 18: return [2 /*return*/];
@@ -156,3 +149,30 @@ var Main = /** @class */ (function () {
156
149
  return Main;
157
150
  }());
158
151
  exports.Main = Main;
152
+ function getPackageManager(args) {
153
+ return __awaiter(this, void 0, void 0, function () {
154
+ var packageManager, error_2;
155
+ return __generator(this, function (_a) {
156
+ switch (_a.label) {
157
+ case 0:
158
+ if (!args['--use-npm']) return [3 /*break*/, 1];
159
+ packageManager = 'npm';
160
+ return [3 /*break*/, 4];
161
+ case 1:
162
+ _a.trys.push([1, 3, , 4]);
163
+ return [4 /*yield*/, (0, command_exists_1.default)('yarn')];
164
+ case 2:
165
+ _a.sent();
166
+ packageManager = 'yarn';
167
+ return [3 /*break*/, 4];
168
+ case 3:
169
+ error_2 = _a.sent();
170
+ packageManager = 'npm';
171
+ return [3 /*break*/, 4];
172
+ case 4:
173
+ (0, usage_1.setTags)({ package_manager: packageManager });
174
+ return [2 /*return*/, packageManager];
175
+ }
176
+ });
177
+ });
178
+ }
@@ -10,7 +10,7 @@
10
10
  "serve": "NODE_ENV=production node server.js"
11
11
  },
12
12
  "dependencies": {
13
- "payload": "0.13.6",
13
+ "payload": "1.0.8",
14
14
  "dotenv": "^8.2.0",
15
15
  "express": "^4.17.1"
16
16
  },
@@ -10,7 +10,7 @@
10
10
  "serve": "NODE_ENV=production node server.js"
11
11
  },
12
12
  "dependencies": {
13
- "payload": "0.13.6",
13
+ "payload": "1.0.8",
14
14
  "dotenv": "^8.2.0",
15
15
  "express": "^4.17.1"
16
16
  },
@@ -10,7 +10,7 @@
10
10
  "serve": "NODE_ENV=production node server.js"
11
11
  },
12
12
  "dependencies": {
13
- "payload": "0.13.6",
13
+ "payload": "1.0.8",
14
14
  "dotenv": "^8.2.0",
15
15
  "express": "^4.17.1"
16
16
  },
@@ -8,12 +8,14 @@
8
8
  "dev": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts nodemon",
9
9
  "build:payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload build",
10
10
  "build:server": "tsc",
11
- "build": "yarn build:payload && yarn build:server",
11
+ "build": "yarn copyfiles && yarn build:payload && yarn build:server",
12
12
  "serve": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js NODE_ENV=production node dist/server.js",
13
- "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types"
13
+ "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png}\" dist/",
14
+ "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types",
15
+ "generate:graphQLSchema": "PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:graphQLSchema"
14
16
  },
15
17
  "dependencies": {
16
- "payload": "0.13.6",
18
+ "payload": "1.0.8",
17
19
  "dotenv": "^8.2.0",
18
20
  "express": "^4.17.1"
19
21
  },
@@ -22,6 +24,7 @@
22
24
  "cross-env": "^7.0.3",
23
25
  "nodemon": "^2.0.6",
24
26
  "ts-node": "^9.1.1",
27
+ "copyfiles": "^2.4.1",
25
28
  "typescript": "^4.1.3"
26
29
  }
27
30
  }
@@ -14,6 +14,9 @@ export default buildConfig({
14
14
  // Examples,
15
15
  ],
16
16
  typescript: {
17
- outputFile: path.resolve(__dirname, 'payload-types.ts')
17
+ outputFile: path.resolve(__dirname, 'payload-types.ts'),
18
+ },
19
+ graphQL: {
20
+ schemaOutputFile: path.resolve(__dirname, 'generated-schema.graphql'),
18
21
  },
19
22
  });
@@ -6,14 +6,23 @@
6
6
  "dom.iterable",
7
7
  "esnext"
8
8
  ],
9
+ "allowJs": true,
9
10
  "strict": false,
10
11
  "esModuleInterop": true,
11
12
  "skipLibCheck": true,
12
13
  "outDir": "./dist",
13
14
  "rootDir": "./src",
14
- "jsx": "react",
15
+ "jsx": "react"
15
16
  },
17
+ "include": [
18
+ "src"
19
+ ],
20
+ "exclude": [
21
+ "node_modules",
22
+ "dist",
23
+ "build",
24
+ ],
16
25
  "ts-node": {
17
26
  "transpileOnly": true
18
27
  }
19
- }
28
+ }
@@ -8,12 +8,14 @@
8
8
  "dev": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts nodemon",
9
9
  "build:payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload build",
10
10
  "build:server": "tsc",
11
- "build": "yarn build:payload && yarn build:server",
11
+ "build": "yarn copyfiles && yarn build:payload && yarn build:server",
12
12
  "serve": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js NODE_ENV=production node dist/server.js",
13
- "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types"
13
+ "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png}\" dist/",
14
+ "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types",
15
+ "generate:graphQLSchema": "PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:graphQLSchema"
14
16
  },
15
17
  "dependencies": {
16
- "payload": "0.13.6",
18
+ "payload": "1.0.8",
17
19
  "dotenv": "^8.2.0",
18
20
  "express": "^4.17.1"
19
21
  },
@@ -22,6 +24,7 @@
22
24
  "cross-env": "^7.0.3",
23
25
  "nodemon": "^2.0.6",
24
26
  "ts-node": "^9.1.1",
27
+ "copyfiles": "^2.4.1",
25
28
  "typescript": "^4.1.3"
26
29
  }
27
30
  }
@@ -19,4 +19,7 @@ export default buildConfig({
19
19
  typescript: {
20
20
  outputFile: path.resolve(__dirname, 'payload-types.ts')
21
21
  },
22
+ graphQL: {
23
+ schemaOutputFile: path.resolve(__dirname, 'generated-schema.graphql'),
24
+ },
22
25
  });
@@ -6,14 +6,23 @@
6
6
  "dom.iterable",
7
7
  "esnext"
8
8
  ],
9
+ "allowJs": true,
9
10
  "strict": false,
10
11
  "esModuleInterop": true,
11
12
  "skipLibCheck": true,
12
13
  "outDir": "./dist",
13
14
  "rootDir": "./src",
14
- "jsx": "react",
15
+ "jsx": "react"
15
16
  },
17
+ "include": [
18
+ "src"
19
+ ],
20
+ "exclude": [
21
+ "node_modules",
22
+ "dist",
23
+ "build",
24
+ ],
16
25
  "ts-node": {
17
26
  "transpileOnly": true
18
27
  }
19
- }
28
+ }
@@ -8,12 +8,14 @@
8
8
  "dev": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts nodemon",
9
9
  "build:payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload build",
10
10
  "build:server": "tsc",
11
- "build": "yarn build:payload && yarn build:server",
11
+ "build": "yarn copyfiles && yarn build:payload && yarn build:server",
12
12
  "serve": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js NODE_ENV=production node dist/server.js",
13
- "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types"
13
+ "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png}\" dist/",
14
+ "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types",
15
+ "generate:graphQLSchema": "PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:graphQLSchema"
14
16
  },
15
17
  "dependencies": {
16
- "payload": "0.13.6",
18
+ "payload": "1.0.8",
17
19
  "dotenv": "^8.2.0",
18
20
  "express": "^4.17.1"
19
21
  },
@@ -22,6 +24,7 @@
22
24
  "cross-env": "^7.0.3",
23
25
  "nodemon": "^2.0.6",
24
26
  "ts-node": "^9.1.1",
27
+ "copyfiles": "^2.4.1",
25
28
  "typescript": "^4.1.3"
26
29
  }
27
30
  }
@@ -15,4 +15,7 @@ export default buildConfig({
15
15
  typescript: {
16
16
  outputFile: path.resolve(__dirname, 'payload-types.ts')
17
17
  },
18
+ graphQL: {
19
+ schemaOutputFile: path.resolve(__dirname, 'generated-schema.graphql'),
20
+ },
18
21
  });
@@ -6,14 +6,23 @@
6
6
  "dom.iterable",
7
7
  "esnext"
8
8
  ],
9
+ "allowJs": true,
9
10
  "strict": false,
10
11
  "esModuleInterop": true,
11
12
  "skipLibCheck": true,
12
13
  "outDir": "./dist",
13
14
  "rootDir": "./src",
14
- "jsx": "react",
15
+ "jsx": "react"
15
16
  },
17
+ "include": [
18
+ "src"
19
+ ],
20
+ "exclude": [
21
+ "node_modules",
22
+ "dist",
23
+ "build",
24
+ ],
16
25
  "ts-node": {
17
26
  "transpileOnly": true
18
27
  }
19
- }
28
+ }
package/package.json CHANGED
@@ -18,8 +18,8 @@
18
18
  "bin"
19
19
  ],
20
20
  "dependencies": {
21
+ "@sentry/node": "^6.18.2",
21
22
  "@sindresorhus/slugify": "^1.1.0",
22
- "analytics-node": "^6.0.0",
23
23
  "arg": "^5.0.0",
24
24
  "chalk": "^4.1.0",
25
25
  "command-exists": "^1.2.9",
@@ -31,9 +31,8 @@
31
31
  "prompts": "^2.4.0",
32
32
  "terminal-link": "^2.1.1"
33
33
  },
34
- "version": "0.3.9-beta.0",
34
+ "version": "0.3.9",
35
35
  "devDependencies": {
36
- "@types/analytics-node": "^3.1.9",
37
36
  "@types/command-exists": "^1.2.0",
38
37
  "@types/degit": "^2.8.3",
39
38
  "@types/fs-extra": "^9.0.12",