create-payload-app 0.3.6 → 0.3.7-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +4 -4
- package/dist/lib/createProject.js +14 -14
- package/dist/lib/createProject.test.js +3 -3
- package/dist/lib/getDatabaseConnection.js +2 -2
- package/dist/lib/getPayloadSecret.js +1 -1
- package/dist/lib/parseLanguage.js +1 -1
- package/dist/lib/parseProjectName.js +1 -1
- package/dist/lib/parseTemplate.js +5 -5
- package/dist/lib/templates.js +2 -2
- package/dist/lib/writeEnvFile.js +8 -6
- package/dist/main.js +17 -17
- package/dist/templates/js-blank/server.js +4 -0
- package/dist/templates/js-blog/server.js +4 -0
- package/dist/templates/js-todo/server.js +4 -0
- package/dist/templates/ts-blank/src/server.ts +6 -2
- package/dist/templates/ts-blog/src/server.ts +6 -2
- package/dist/templates/ts-todo/src/server.ts +6 -2
- package/dist/utils/messages.js +4 -4
- package/dist/utils/usage.js +5 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -44,7 +44,7 @@ var log_1 = require("./utils/log");
|
|
44
44
|
return __generator(this, function (_a) {
|
45
45
|
switch (_a.label) {
|
46
46
|
case 0:
|
47
|
-
trx = usage_1.init();
|
47
|
+
trx = (0, usage_1.init)();
|
48
48
|
main = new main_1.Main();
|
49
49
|
_a.label = 1;
|
50
50
|
case 1:
|
@@ -55,11 +55,11 @@ var log_1 = require("./utils/log");
|
|
55
55
|
return [3 /*break*/, 5];
|
56
56
|
case 3:
|
57
57
|
e_1 = _a.sent();
|
58
|
-
usage_1.handleException(e_1);
|
59
|
-
log_1.error("An error has occurred: "
|
58
|
+
(0, usage_1.handleException)(e_1);
|
59
|
+
(0, log_1.error)("An error has occurred: ".concat(e_1 instanceof Error ? e_1.message : e_1));
|
60
60
|
return [3 /*break*/, 5];
|
61
61
|
case 4:
|
62
|
-
trx.finish();
|
62
|
+
trx === null || trx === void 0 ? void 0 : trx.finish();
|
63
63
|
return [7 /*endfinally*/];
|
64
64
|
case 5: return [2 /*return*/];
|
65
65
|
}
|
@@ -57,7 +57,7 @@ function createProjectDir(projectDir) {
|
|
57
57
|
case 1:
|
58
58
|
pathExists = _a.sent();
|
59
59
|
if (pathExists) {
|
60
|
-
log_1.error("The project directory '"
|
60
|
+
(0, log_1.error)("The project directory '".concat(projectDir, "' already exists"));
|
61
61
|
process.exit(1);
|
62
62
|
}
|
63
63
|
return [4 /*yield*/, fs_extra_1.default.mkdir(projectDir)];
|
@@ -106,12 +106,12 @@ function getLatestPayloadVersion(betaFlag) {
|
|
106
106
|
packageWithTag = 'payload';
|
107
107
|
if (betaFlag)
|
108
108
|
packageWithTag += '@beta';
|
109
|
-
return [4 /*yield*/, execa_1.default("npm info "
|
109
|
+
return [4 /*yield*/, (0, execa_1.default)("npm info ".concat(packageWithTag, " version"), [], {
|
110
110
|
shell: true,
|
111
111
|
})];
|
112
112
|
case 1:
|
113
113
|
stdout = (_a.sent()).stdout;
|
114
|
-
return [2 /*return*/, "^"
|
114
|
+
return [2 /*return*/, "^".concat(stdout)];
|
115
115
|
case 2:
|
116
116
|
error_2 = _a.sent();
|
117
117
|
return [2 /*return*/, false];
|
@@ -131,10 +131,10 @@ function updatePayloadVersion(projectDir, betaFlag) {
|
|
131
131
|
case 1:
|
132
132
|
payloadVersion = _a.sent();
|
133
133
|
if (!payloadVersion) {
|
134
|
-
log_1.warning('Error retrieving latest Payload version. Please update your package.json manually.');
|
134
|
+
(0, log_1.warning)('Error retrieving latest Payload version. Please update your package.json manually.');
|
135
135
|
return [2 /*return*/];
|
136
136
|
}
|
137
|
-
usage_1.setTags({ payload_version: payloadVersion });
|
137
|
+
(0, usage_1.setTags)({ payload_version: payloadVersion });
|
138
138
|
packageJsonPath = path_1.default.resolve(projectDir, 'package.json');
|
139
139
|
_a.label = 2;
|
140
140
|
case 2:
|
@@ -149,7 +149,7 @@ function updatePayloadVersion(projectDir, betaFlag) {
|
|
149
149
|
return [3 /*break*/, 6];
|
150
150
|
case 5:
|
151
151
|
err_1 = _a.sent();
|
152
|
-
log_1.warning('Unable to write Payload version to package.json. Please update your package.json manually.');
|
152
|
+
(0, log_1.warning)('Unable to write Payload version to package.json. Please update your package.json manually.');
|
153
153
|
return [3 /*break*/, 6];
|
154
154
|
case 6: return [2 /*return*/];
|
155
155
|
}
|
@@ -165,10 +165,10 @@ function createProject(args, projectDir, template, packageManager) {
|
|
165
165
|
case 0: return [4 /*yield*/, createProjectDir(projectDir)];
|
166
166
|
case 1:
|
167
167
|
_a.sent();
|
168
|
-
templateDir = path_1.default.resolve(__dirname, "../templates/"
|
169
|
-
console.log("\n Creating a new Payload app in "
|
168
|
+
templateDir = path_1.default.resolve(__dirname, "../templates/".concat(template.name));
|
169
|
+
console.log("\n Creating a new Payload app in ".concat(chalk_1.default.green(path_1.default.resolve(projectDir)), "\n"));
|
170
170
|
if (!(template.type === 'starter')) return [3 /*break*/, 3];
|
171
|
-
emitter = degit_1.default(template.url);
|
171
|
+
emitter = (0, degit_1.default)(template.url);
|
172
172
|
return [4 /*yield*/, emitter.clone(projectDir)];
|
173
173
|
case 2:
|
174
174
|
_a.sent();
|
@@ -178,16 +178,16 @@ function createProject(args, projectDir, template, packageManager) {
|
|
178
178
|
return [4 /*yield*/, fs_extra_1.default.copy(templateDir, projectDir, { recursive: true })];
|
179
179
|
case 4:
|
180
180
|
_a.sent();
|
181
|
-
log_1.success('Project directory created');
|
181
|
+
(0, log_1.success)('Project directory created');
|
182
182
|
return [3 /*break*/, 6];
|
183
183
|
case 5:
|
184
184
|
err_2 = _a.sent();
|
185
185
|
msg = 'Unable to copy template files. Please check template name or directory permissions.';
|
186
|
-
log_1.error(msg);
|
186
|
+
(0, log_1.error)(msg);
|
187
187
|
process.exit(1);
|
188
188
|
return [3 /*break*/, 6];
|
189
189
|
case 6:
|
190
|
-
spinner = ora_1.default('Checking latest Payload version...').start();
|
190
|
+
spinner = (0, ora_1.default)('Checking latest Payload version...').start();
|
191
191
|
return [4 /*yield*/, updatePayloadVersion(projectDir, args['--beta'])];
|
192
192
|
case 7:
|
193
193
|
_a.sent();
|
@@ -198,10 +198,10 @@ function createProject(args, projectDir, template, packageManager) {
|
|
198
198
|
spinner.stop();
|
199
199
|
spinner.clear();
|
200
200
|
if (result) {
|
201
|
-
log_1.success('Dependencies installed');
|
201
|
+
(0, log_1.success)('Dependencies installed');
|
202
202
|
}
|
203
203
|
else {
|
204
|
-
log_1.error('Error installing dependencies');
|
204
|
+
(0, log_1.error)('Error installing dependencies');
|
205
205
|
}
|
206
206
|
return [2 /*return*/];
|
207
207
|
}
|
@@ -64,11 +64,11 @@ describe('createProject', function () {
|
|
64
64
|
var expectedPayloadVersion, template, packageJsonPath, packageJson;
|
65
65
|
return __generator(this, function (_a) {
|
66
66
|
switch (_a.label) {
|
67
|
-
case 0: return [4 /*yield*/, createProject_1.getLatestPayloadVersion()];
|
67
|
+
case 0: return [4 /*yield*/, (0, createProject_1.getLatestPayloadVersion)()];
|
68
68
|
case 1:
|
69
69
|
expectedPayloadVersion = _a.sent();
|
70
70
|
template = { name: 'ts-todo', type: 'static' };
|
71
|
-
return [4 /*yield*/, createProject_1.createProject(args, projectDir, template, packageManager)];
|
71
|
+
return [4 /*yield*/, (0, createProject_1.createProject)(args, projectDir, template, packageManager)];
|
72
72
|
case 2:
|
73
73
|
_a.sent();
|
74
74
|
packageJsonPath = path_1.default.resolve(projectDir, 'package.json');
|
@@ -92,7 +92,7 @@ describe('createProject', function () {
|
|
92
92
|
return [4 /*yield*/, fs_extra_1.default.writeJson(packageJsonPath, { dependencies: { payload: '0.0.1' } }, { spaces: 2 })];
|
93
93
|
case 2:
|
94
94
|
_a.sent();
|
95
|
-
return [4 /*yield*/, createProject_1.updatePayloadVersion(projectDir)];
|
95
|
+
return [4 /*yield*/, (0, createProject_1.updatePayloadVersion)(projectDir)];
|
96
96
|
case 3:
|
97
97
|
_a.sent();
|
98
98
|
return [4 /*yield*/, fs_extra_1.default.readJson(packageJsonPath)];
|
@@ -50,11 +50,11 @@ function getDatabaseConnection(args, projectName) {
|
|
50
50
|
case 0:
|
51
51
|
if (args['--db'])
|
52
52
|
return [2 /*return*/, args['--db']];
|
53
|
-
return [4 /*yield*/, prompts_1.default({
|
53
|
+
return [4 /*yield*/, (0, prompts_1.default)({
|
54
54
|
type: 'text',
|
55
55
|
name: 'value',
|
56
56
|
message: 'Enter MongoDB connection',
|
57
|
-
initial: "mongodb://localhost/"
|
57
|
+
initial: "mongodb://localhost/".concat((0, slugify_1.default)(projectName)),
|
58
58
|
validate: function (value) { return value.length; },
|
59
59
|
}, {
|
60
60
|
onCancel: function () {
|
@@ -49,7 +49,7 @@ function getPayloadSecret(args) {
|
|
49
49
|
case 0:
|
50
50
|
if (args['--secret'])
|
51
51
|
return [2 /*return*/, args['--secret']];
|
52
|
-
return [4 /*yield*/, prompts_1.default({
|
52
|
+
return [4 /*yield*/, (0, prompts_1.default)({
|
53
53
|
type: 'password',
|
54
54
|
name: 'value',
|
55
55
|
message: 'Enter a long, complex string for Payload’s encryption key',
|
@@ -49,7 +49,7 @@ function parseLanguage(args) {
|
|
49
49
|
case 0:
|
50
50
|
if (args['--template'])
|
51
51
|
return [2 /*return*/, args['--template']];
|
52
|
-
return [4 /*yield*/, prompts_1.default({
|
52
|
+
return [4 /*yield*/, (0, prompts_1.default)({
|
53
53
|
type: 'select',
|
54
54
|
name: 'value',
|
55
55
|
message: 'Choose language',
|
@@ -51,7 +51,7 @@ function parseProjectName(args) {
|
|
51
51
|
return [2 /*return*/, args['--name']];
|
52
52
|
if (args._[0])
|
53
53
|
return [2 /*return*/, args._[0]];
|
54
|
-
return [4 /*yield*/, prompts_1.default({
|
54
|
+
return [4 /*yield*/, (0, prompts_1.default)({
|
55
55
|
type: 'text',
|
56
56
|
name: 'value',
|
57
57
|
message: 'Project name?',
|
@@ -53,18 +53,18 @@ function parseTemplate(args, validTemplates, language) {
|
|
53
53
|
template_1 = validTemplates.find(function (template) { return template.name === templateName_1; });
|
54
54
|
if (!template_1)
|
55
55
|
throw new Error('Invalid template given');
|
56
|
-
usage_1.setTags({ template: template_1.name });
|
56
|
+
(0, usage_1.setTags)({ template: template_1.name });
|
57
57
|
return [2 /*return*/, template_1];
|
58
58
|
}
|
59
59
|
filteredTemplates = validTemplates
|
60
60
|
.filter(function (d) { return d.name.startsWith(language); })
|
61
|
-
.map(function (t) { return t.name.replace(language
|
62
|
-
return [4 /*yield*/, prompts_1.default({
|
61
|
+
.map(function (t) { return t.name.replace("".concat(language, "-"), ''); });
|
62
|
+
return [4 /*yield*/, (0, prompts_1.default)({
|
63
63
|
type: 'select',
|
64
64
|
name: 'value',
|
65
65
|
message: 'Choose project template',
|
66
66
|
choices: filteredTemplates.map(function (p) {
|
67
|
-
return { title: p, value: language
|
67
|
+
return { title: p, value: "".concat(language, "-").concat(p) };
|
68
68
|
}),
|
69
69
|
validate: function (value) { return value.length; },
|
70
70
|
}, {
|
@@ -79,7 +79,7 @@ function parseTemplate(args, validTemplates, language) {
|
|
79
79
|
template = validTemplates.find(function (t) { return t.name === response.value; });
|
80
80
|
if (!template)
|
81
81
|
throw new Error('Template is undefined');
|
82
|
-
usage_1.setTags({ template: template.name });
|
82
|
+
(0, usage_1.setTags)({ template: template.name });
|
83
83
|
return [2 /*return*/, template];
|
84
84
|
}
|
85
85
|
});
|
package/dist/lib/templates.js
CHANGED
@@ -52,8 +52,8 @@ function validateTemplate(templateName) {
|
|
52
52
|
case 1:
|
53
53
|
validTemplates = _a.sent();
|
54
54
|
if (!validTemplates.map(function (t) { return t.name; }).includes(templateName)) {
|
55
|
-
log_1.error("'"
|
56
|
-
log_1.info("Valid templates: "
|
55
|
+
(0, log_1.error)("'".concat(templateName, "' is not a valid template."));
|
56
|
+
(0, log_1.info)("Valid templates: ".concat(validTemplates.join(', ')));
|
57
57
|
return [2 /*return*/, false];
|
58
58
|
}
|
59
59
|
return [2 /*return*/, true];
|
package/dist/lib/writeEnvFile.js
CHANGED
@@ -49,20 +49,22 @@ function writeEnvFile(projectName, databaseUri, payloadSecret) {
|
|
49
49
|
return __generator(this, function (_a) {
|
50
50
|
switch (_a.label) {
|
51
51
|
case 0:
|
52
|
-
content = "MONGODB_URI="
|
52
|
+
content = "MONGODB_URI=".concat(databaseUri, "\nPAYLOAD_SECRET=").concat(payloadSecret);
|
53
53
|
_a.label = 1;
|
54
54
|
case 1:
|
55
55
|
_a.trys.push([1, 3, , 4]);
|
56
|
-
projectDir = "./"
|
57
|
-
return [4 /*yield*/, fs_extra_1.default.outputFile(projectDir
|
56
|
+
projectDir = "./".concat((0, slugify_1.default)(projectName));
|
57
|
+
return [4 /*yield*/, fs_extra_1.default.outputFile("".concat(projectDir, "/.env"), content)];
|
58
58
|
case 2:
|
59
59
|
_a.sent();
|
60
|
-
log_1.success('.env file created');
|
60
|
+
(0, log_1.success)('.env file created');
|
61
61
|
return [3 /*break*/, 4];
|
62
62
|
case 3:
|
63
63
|
err_1 = _a.sent();
|
64
|
-
log_1.error('Unable to write .env file');
|
65
|
-
|
64
|
+
(0, log_1.error)('Unable to write .env file');
|
65
|
+
if (err_1 instanceof Error) {
|
66
|
+
(0, log_1.error)(err_1.message);
|
67
|
+
}
|
66
68
|
process.exit(1);
|
67
69
|
return [3 /*break*/, 4];
|
68
70
|
case 4: return [2 /*return*/];
|
package/dist/main.js
CHANGED
@@ -56,7 +56,7 @@ var messages_1 = require("./utils/messages");
|
|
56
56
|
var usage_1 = require("./utils/usage");
|
57
57
|
var Main = /** @class */ (function () {
|
58
58
|
function Main() {
|
59
|
-
this.args = arg_1.default({
|
59
|
+
this.args = (0, arg_1.default)({
|
60
60
|
'--help': Boolean,
|
61
61
|
'--name': String,
|
62
62
|
'--template': String,
|
@@ -80,7 +80,7 @@ var Main = /** @class */ (function () {
|
|
80
80
|
_g.trys.push([0, 17, , 18]);
|
81
81
|
if (!this.args['--help']) return [3 /*break*/, 2];
|
82
82
|
_b = (_a = console).log;
|
83
|
-
return [4 /*yield*/, messages_1.helpMessage()];
|
83
|
+
return [4 /*yield*/, (0, messages_1.helpMessage)()];
|
84
84
|
case 1:
|
85
85
|
_b.apply(_a, [_g.sent()]);
|
86
86
|
process.exit(0);
|
@@ -88,52 +88,52 @@ var Main = /** @class */ (function () {
|
|
88
88
|
case 2:
|
89
89
|
templateArg = this.args['--template'];
|
90
90
|
if (!templateArg) return [3 /*break*/, 5];
|
91
|
-
return [4 /*yield*/, templates_1.validateTemplate(templateArg)];
|
91
|
+
return [4 /*yield*/, (0, templates_1.validateTemplate)(templateArg)];
|
92
92
|
case 3:
|
93
93
|
valid = _g.sent();
|
94
94
|
if (!!valid) return [3 /*break*/, 5];
|
95
95
|
_d = (_c = console).log;
|
96
|
-
return [4 /*yield*/, messages_1.helpMessage()];
|
96
|
+
return [4 /*yield*/, (0, messages_1.helpMessage)()];
|
97
97
|
case 4:
|
98
98
|
_d.apply(_c, [_g.sent()]);
|
99
99
|
process.exit(1);
|
100
100
|
_g.label = 5;
|
101
101
|
case 5:
|
102
102
|
console.log(messages_1.welcomeMessage);
|
103
|
-
return [4 /*yield*/, parseProjectName_1.parseProjectName(this.args)];
|
103
|
+
return [4 /*yield*/, (0, parseProjectName_1.parseProjectName)(this.args)];
|
104
104
|
case 6:
|
105
105
|
projectName = _g.sent();
|
106
|
-
return [4 /*yield*/, parseLanguage_1.parseLanguage(this.args)];
|
106
|
+
return [4 /*yield*/, (0, parseLanguage_1.parseLanguage)(this.args)];
|
107
107
|
case 7:
|
108
108
|
language = _g.sent();
|
109
|
-
return [4 /*yield*/, templates_1.getValidTemplates()];
|
109
|
+
return [4 /*yield*/, (0, templates_1.getValidTemplates)()];
|
110
110
|
case 8:
|
111
111
|
validTemplates = _g.sent();
|
112
|
-
return [4 /*yield*/, parseTemplate_1.parseTemplate(this.args, validTemplates, language)];
|
112
|
+
return [4 /*yield*/, (0, parseTemplate_1.parseTemplate)(this.args, validTemplates, language)];
|
113
113
|
case 9:
|
114
114
|
template = _g.sent();
|
115
|
-
return [4 /*yield*/, getDatabaseConnection_1.getDatabaseConnection(this.args, projectName)];
|
115
|
+
return [4 /*yield*/, (0, getDatabaseConnection_1.getDatabaseConnection)(this.args, projectName)];
|
116
116
|
case 10:
|
117
117
|
databaseUri = _g.sent();
|
118
|
-
return [4 /*yield*/, getPayloadSecret_1.getPayloadSecret(this.args)];
|
118
|
+
return [4 /*yield*/, (0, getPayloadSecret_1.getPayloadSecret)(this.args)];
|
119
119
|
case 11:
|
120
120
|
payloadSecret = _g.sent();
|
121
|
-
projectDir = "./"
|
121
|
+
projectDir = "./".concat((0, slugify_1.default)(projectName));
|
122
122
|
return [4 /*yield*/, getPackageManager(this.args)];
|
123
123
|
case 12:
|
124
124
|
packageManager = _g.sent();
|
125
125
|
if (!!this.args['--dry-run']) return [3 /*break*/, 15];
|
126
|
-
return [4 /*yield*/, createProject_1.createProject(this.args, projectDir, template, packageManager)];
|
126
|
+
return [4 /*yield*/, (0, createProject_1.createProject)(this.args, projectDir, template, packageManager)];
|
127
127
|
case 13:
|
128
128
|
_g.sent();
|
129
|
-
return [4 /*yield*/, writeEnvFile_1.writeEnvFile(projectName, databaseUri, payloadSecret)];
|
129
|
+
return [4 /*yield*/, (0, writeEnvFile_1.writeEnvFile)(projectName, databaseUri, payloadSecret)];
|
130
130
|
case 14:
|
131
131
|
_g.sent();
|
132
132
|
_g.label = 15;
|
133
133
|
case 15:
|
134
|
-
log_1.success('Payload project successfully created');
|
134
|
+
(0, log_1.success)('Payload project successfully created');
|
135
135
|
_f = (_e = console).log;
|
136
|
-
return [4 /*yield*/, messages_1.successMessage(projectDir, packageManager)];
|
136
|
+
return [4 /*yield*/, (0, messages_1.successMessage)(projectDir, packageManager)];
|
137
137
|
case 16:
|
138
138
|
_f.apply(_e, [_g.sent()]);
|
139
139
|
return [3 /*break*/, 18];
|
@@ -160,7 +160,7 @@ function getPackageManager(args) {
|
|
160
160
|
return [3 /*break*/, 4];
|
161
161
|
case 1:
|
162
162
|
_a.trys.push([1, 3, , 4]);
|
163
|
-
return [4 /*yield*/, command_exists_1.default('yarn')];
|
163
|
+
return [4 /*yield*/, (0, command_exists_1.default)('yarn')];
|
164
164
|
case 2:
|
165
165
|
_a.sent();
|
166
166
|
packageManager = 'yarn';
|
@@ -170,7 +170,7 @@ function getPackageManager(args) {
|
|
170
170
|
packageManager = 'npm';
|
171
171
|
return [3 /*break*/, 4];
|
172
172
|
case 4:
|
173
|
-
usage_1.setTags({ package_manager: packageManager });
|
173
|
+
(0, usage_1.setTags)({ package_manager: packageManager });
|
174
174
|
return [2 /*return*/, packageManager];
|
175
175
|
}
|
176
176
|
});
|
@@ -13,6 +13,10 @@ app.get('/', (_, res) => {
|
|
13
13
|
payload.init({
|
14
14
|
secret: process.env.PAYLOAD_SECRET,
|
15
15
|
mongoURL: process.env.MONGODB_URI,
|
16
|
+
|
17
|
+
// Only needed to deploy publicly. Get free Personal license at https://payloadcms.com.
|
18
|
+
// license: process.env.PAYLOAD_LICENSE_KEY,
|
19
|
+
|
16
20
|
express: app,
|
17
21
|
onInit: () => {
|
18
22
|
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`);
|
@@ -13,6 +13,10 @@ app.get('/', (_, res) => {
|
|
13
13
|
payload.init({
|
14
14
|
secret: process.env.PAYLOAD_SECRET,
|
15
15
|
mongoURL: process.env.MONGODB_URI,
|
16
|
+
|
17
|
+
// Only needed to deploy publicly. Get free Personal license at https://payloadcms.com.
|
18
|
+
// license: process.env.PAYLOAD_LICENSE_KEY,
|
19
|
+
|
16
20
|
express: app,
|
17
21
|
onInit: () => {
|
18
22
|
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`);
|
@@ -13,6 +13,10 @@ app.get('/', (_, res) => {
|
|
13
13
|
payload.init({
|
14
14
|
secret: process.env.PAYLOAD_SECRET,
|
15
15
|
mongoURL: process.env.MONGODB_URI,
|
16
|
+
|
17
|
+
// Only needed to deploy publicly. Get free Personal license at https://payloadcms.com.
|
18
|
+
// license: process.env.PAYLOAD_LICENSE_KEY,
|
19
|
+
|
16
20
|
express: app,
|
17
21
|
onInit: () => {
|
18
22
|
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`);
|
@@ -13,11 +13,15 @@ app.get('/', (_, res) => {
|
|
13
13
|
payload.init({
|
14
14
|
secret: process.env.PAYLOAD_SECRET,
|
15
15
|
mongoURL: process.env.MONGODB_URI,
|
16
|
+
|
17
|
+
// Only needed to deploy publicly. Get free Personal license at https://payloadcms.com.
|
18
|
+
// license: process.env.PAYLOAD_LICENSE_KEY,
|
19
|
+
|
16
20
|
express: app,
|
17
21
|
onInit: () => {
|
18
|
-
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`)
|
22
|
+
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`)
|
19
23
|
},
|
20
|
-
})
|
24
|
+
})
|
21
25
|
|
22
26
|
// Add your own express routes here
|
23
27
|
|
@@ -13,11 +13,15 @@ app.get('/', (_, res) => {
|
|
13
13
|
payload.init({
|
14
14
|
secret: process.env.PAYLOAD_SECRET,
|
15
15
|
mongoURL: process.env.MONGODB_URI,
|
16
|
+
|
17
|
+
// Only needed to deploy publicly. Get free Personal license at https://payloadcms.com.
|
18
|
+
// license: process.env.PAYLOAD_LICENSE_KEY,
|
19
|
+
|
16
20
|
express: app,
|
17
21
|
onInit: () => {
|
18
|
-
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`)
|
22
|
+
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`)
|
19
23
|
},
|
20
|
-
})
|
24
|
+
})
|
21
25
|
|
22
26
|
// Add your own express routes here
|
23
27
|
|
@@ -13,11 +13,15 @@ app.get('/', (_, res) => {
|
|
13
13
|
payload.init({
|
14
14
|
secret: process.env.PAYLOAD_SECRET,
|
15
15
|
mongoURL: process.env.MONGODB_URI,
|
16
|
+
|
17
|
+
// Only needed to deploy publicly. Get free Personal license at https://payloadcms.com.
|
18
|
+
// license: process.env.PAYLOAD_LICENSE_KEY,
|
19
|
+
|
16
20
|
express: app,
|
17
21
|
onInit: () => {
|
18
|
-
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`)
|
22
|
+
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`)
|
19
23
|
},
|
20
|
-
})
|
24
|
+
})
|
21
25
|
|
22
26
|
// Add your own express routes here
|
23
27
|
|
package/dist/utils/messages.js
CHANGED
@@ -51,23 +51,23 @@ var templates_1 = require("../lib/templates");
|
|
51
51
|
var header = function (message) {
|
52
52
|
return chalk_1.default.yellow(figures_1.default.star) + ' ' + chalk_1.default.bold(message);
|
53
53
|
};
|
54
|
-
exports.welcomeMessage = chalk_1.default(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n {green Welcome to Payload. Let's create a project! }\n"], ["\n {green Welcome to Payload. Let's create a project! }\n"])));
|
54
|
+
exports.welcomeMessage = (0, chalk_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n {green Welcome to Payload. Let's create a project! }\n"], ["\n {green Welcome to Payload. Let's create a project! }\n"])));
|
55
55
|
function helpMessage() {
|
56
56
|
return __awaiter(this, void 0, void 0, function () {
|
57
57
|
var validTemplates;
|
58
58
|
return __generator(this, function (_a) {
|
59
59
|
switch (_a.label) {
|
60
|
-
case 0: return [4 /*yield*/, templates_1.getValidTemplates()];
|
60
|
+
case 0: return [4 /*yield*/, (0, templates_1.getValidTemplates)()];
|
61
61
|
case 1:
|
62
62
|
validTemplates = _a.sent();
|
63
|
-
return [2 /*return*/, chalk_1.default(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n {bold USAGE}\n\n {dim $} {bold npx create-payload-app}\n\n {bold OPTIONS}\n\n --name {underline my-payload-app} Set project name\n --template {underline template_name} Choose specific template\n\n {dim Available templates: ", "}\n\n --use-npm Use npm to install dependencies\n --no-deps Do not install any dependencies\n --help Show help\n"], ["\n {bold USAGE}\n\n {dim $} {bold npx create-payload-app}\n\n {bold OPTIONS}\n\n --name {underline my-payload-app} Set project name\n --template {underline template_name} Choose specific template\n\n {dim Available templates: ", "}\n\n --use-npm Use npm to install dependencies\n --no-deps Do not install any dependencies\n --help Show help\n"])), validTemplates.map(function (t) { return t.name; }).join(', '))];
|
63
|
+
return [2 /*return*/, (0, chalk_1.default)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n {bold USAGE}\n\n {dim $} {bold npx create-payload-app}\n\n {bold OPTIONS}\n\n --name {underline my-payload-app} Set project name\n --template {underline template_name} Choose specific template\n\n {dim Available templates: ", "}\n\n --use-npm Use npm to install dependencies\n --no-deps Do not install any dependencies\n --help Show help\n"], ["\n {bold USAGE}\n\n {dim $} {bold npx create-payload-app}\n\n {bold OPTIONS}\n\n --name {underline my-payload-app} Set project name\n --template {underline template_name} Choose specific template\n\n {dim Available templates: ", "}\n\n --use-npm Use npm to install dependencies\n --no-deps Do not install any dependencies\n --help Show help\n"])), validTemplates.map(function (t) { return t.name; }).join(', '))];
|
64
64
|
}
|
65
65
|
});
|
66
66
|
});
|
67
67
|
}
|
68
68
|
exports.helpMessage = helpMessage;
|
69
69
|
function successMessage(projectDir, packageManager) {
|
70
|
-
return "\n "
|
70
|
+
return "\n ".concat(header('Launch Application:'), "\n\n - cd ").concat(projectDir, "\n - ").concat(packageManager === 'yarn' ? 'yarn' : 'npm run', " dev\n\n ").concat(header('Documentation:'), "\n\n - ").concat((0, terminal_link_1.default)('Getting Started', 'https://payloadcms.com/docs/getting-started/what-is-payload'), "\n - ").concat((0, terminal_link_1.default)('Configuration', 'https://payloadcms.com/docs/configuration/overview'), "\n\n");
|
71
71
|
}
|
72
72
|
exports.successMessage = successMessage;
|
73
73
|
var templateObject_1, templateObject_2;
|
package/dist/utils/usage.js
CHANGED
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
12
12
|
};
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
14
14
|
if (k2 === undefined) k2 = k;
|
15
|
-
Object.
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
18
|
+
}
|
19
|
+
Object.defineProperty(o, k2, desc);
|
16
20
|
}) : (function(o, m, k, k2) {
|
17
21
|
if (k2 === undefined) k2 = k;
|
18
22
|
o[k2] = m[k];
|
package/package.json
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
"bin"
|
19
19
|
],
|
20
20
|
"dependencies": {
|
21
|
-
"@sentry/node": "^6.
|
21
|
+
"@sentry/node": "^6.18.2",
|
22
22
|
"@sindresorhus/slugify": "^1.1.0",
|
23
23
|
"arg": "^5.0.0",
|
24
24
|
"chalk": "^4.1.0",
|
@@ -31,7 +31,7 @@
|
|
31
31
|
"prompts": "^2.4.0",
|
32
32
|
"terminal-link": "^2.1.1"
|
33
33
|
},
|
34
|
-
"version": "0.3.
|
34
|
+
"version": "0.3.7-beta.0",
|
35
35
|
"devDependencies": {
|
36
36
|
"@types/command-exists": "^1.2.0",
|
37
37
|
"@types/degit": "^2.8.3",
|