create-payload-app 0.5.2 → 1.0.0-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +10 -53
- package/dist/lib/configure-payload-config.js +97 -148
- package/dist/lib/create-project.js +101 -174
- package/dist/lib/create-project.spec.js +148 -172
- package/dist/lib/generate-secret.js +12 -44
- package/dist/lib/packages.js +52 -32
- package/dist/lib/parse-project-name.js +29 -67
- package/dist/lib/parse-template.js +42 -80
- package/dist/lib/select-db.js +62 -105
- package/dist/lib/templates.js +63 -97
- package/dist/lib/write-env-file.js +51 -106
- package/dist/main.js +118 -198
- package/dist/types.js +5 -1
- package/dist/utils/log.js +40 -19
- package/dist/utils/messages.js +71 -73
- package/package.json +8 -39
- package/.vscode/launch.json +0 -13
@@ -1,71 +1,33 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
});
|
10
|
-
};
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
15
|
-
function step(op) {
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
20
|
-
switch (op[0]) {
|
21
|
-
case 0: case 1: t = op; break;
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
25
|
-
default:
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
30
|
-
if (t[2]) _.ops.pop();
|
31
|
-
_.trys.pop(); continue;
|
32
|
-
}
|
33
|
-
op = body.call(thisArg, _);
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "parseProjectName", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return parseProjectName;
|
36
9
|
}
|
37
|
-
};
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
function parseProjectName(args) {
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
name: 'value',
|
57
|
-
message: 'Project name?',
|
58
|
-
validate: function (value) { return !!value.length; },
|
59
|
-
}, {
|
60
|
-
onCancel: function () {
|
61
|
-
process.exit(0);
|
62
|
-
},
|
63
|
-
})];
|
64
|
-
case 1:
|
65
|
-
response = _a.sent();
|
66
|
-
return [2 /*return*/, response.value];
|
67
|
-
}
|
68
|
-
});
|
10
|
+
});
|
11
|
+
const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts"));
|
12
|
+
function _interop_require_default(obj) {
|
13
|
+
return obj && obj.__esModule ? obj : {
|
14
|
+
default: obj
|
15
|
+
};
|
16
|
+
}
|
17
|
+
async function parseProjectName(args) {
|
18
|
+
if (args['--name']) return args['--name'];
|
19
|
+
if (args._[0]) return args._[0];
|
20
|
+
const response = await (0, _prompts.default)({
|
21
|
+
name: 'value',
|
22
|
+
message: 'Project name?',
|
23
|
+
type: 'text',
|
24
|
+
validate: (value)=>!!value.length
|
25
|
+
}, {
|
26
|
+
onCancel: ()=>{
|
27
|
+
process.exit(0);
|
28
|
+
}
|
69
29
|
});
|
30
|
+
return response.value;
|
70
31
|
}
|
71
|
-
|
32
|
+
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvcGFyc2UtcHJvamVjdC1uYW1lLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBwcm9tcHRzIGZyb20gJ3Byb21wdHMnXG5cbmltcG9ydCB0eXBlIHsgQ2xpQXJncyB9IGZyb20gJy4uL3R5cGVzJ1xuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gcGFyc2VQcm9qZWN0TmFtZShhcmdzOiBDbGlBcmdzKTogUHJvbWlzZTxzdHJpbmc+IHtcbiAgaWYgKGFyZ3NbJy0tbmFtZSddKSByZXR1cm4gYXJnc1snLS1uYW1lJ11cbiAgaWYgKGFyZ3MuX1swXSkgcmV0dXJuIGFyZ3MuX1swXVxuXG4gIGNvbnN0IHJlc3BvbnNlID0gYXdhaXQgcHJvbXB0cyhcbiAgICB7XG4gICAgICBuYW1lOiAndmFsdWUnLFxuICAgICAgbWVzc2FnZTogJ1Byb2plY3QgbmFtZT8nLFxuICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgdmFsaWRhdGU6ICh2YWx1ZTogc3RyaW5nKSA9PiAhIXZhbHVlLmxlbmd0aCxcbiAgICB9LFxuICAgIHtcbiAgICAgIG9uQ2FuY2VsOiAoKSA9PiB7XG4gICAgICAgIHByb2Nlc3MuZXhpdCgwKVx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|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
25
|
-
default:
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
30
|
-
if (t[2]) _.ops.pop();
|
31
|
-
_.trys.pop(); continue;
|
32
|
-
}
|
33
|
-
op = body.call(thisArg, _);
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "parseTemplate", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return parseTemplate;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts"));
|
12
|
+
function _interop_require_default(obj) {
|
13
|
+
return obj && obj.__esModule ? obj : {
|
14
|
+
default: obj
|
15
|
+
};
|
16
|
+
}
|
17
|
+
async function parseTemplate(args, validTemplates) {
|
18
|
+
if (args['--template']) {
|
19
|
+
const templateName = args['--template'];
|
20
|
+
const template = validTemplates.find((t)=>t.name === templateName);
|
21
|
+
if (!template) throw new Error('Invalid template given');
|
22
|
+
return template;
|
36
23
|
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
if (!template_1)
|
54
|
-
throw new Error('Invalid template given');
|
55
|
-
return [2 /*return*/, template_1];
|
56
|
-
}
|
57
|
-
return [4 /*yield*/, (0, prompts_1.default)({
|
58
|
-
type: 'select',
|
59
|
-
name: 'value',
|
60
|
-
message: 'Choose project template',
|
61
|
-
choices: validTemplates.map(function (p) {
|
62
|
-
return {
|
63
|
-
title: p.name,
|
64
|
-
value: p.name,
|
65
|
-
description: p.description,
|
66
|
-
};
|
67
|
-
}),
|
68
|
-
validate: function (value) { return !!value.length; },
|
69
|
-
}, {
|
70
|
-
onCancel: function () {
|
71
|
-
process.exit(0);
|
72
|
-
},
|
73
|
-
})];
|
74
|
-
case 1:
|
75
|
-
response = _a.sent();
|
76
|
-
template = validTemplates.find(function (t) { return t.name === response.value; });
|
77
|
-
if (!template)
|
78
|
-
throw new Error('Template is undefined');
|
79
|
-
return [2 /*return*/, template];
|
80
|
-
}
|
81
|
-
});
|
24
|
+
const response = await (0, _prompts.default)({
|
25
|
+
name: 'value',
|
26
|
+
choices: validTemplates.map((p)=>{
|
27
|
+
return {
|
28
|
+
description: p.description,
|
29
|
+
title: p.name,
|
30
|
+
value: p.name
|
31
|
+
};
|
32
|
+
}),
|
33
|
+
message: 'Choose project template',
|
34
|
+
type: 'select',
|
35
|
+
validate: (value)=>!!value.length
|
36
|
+
}, {
|
37
|
+
onCancel: ()=>{
|
38
|
+
process.exit(0);
|
39
|
+
}
|
82
40
|
});
|
41
|
+
const template = validTemplates.find((t)=>t.name === response.value);
|
42
|
+
if (!template) throw new Error('Template is undefined');
|
43
|
+
return template;
|
83
44
|
}
|
84
|
-
|
45
|
+
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvcGFyc2UtdGVtcGxhdGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHByb21wdHMgZnJvbSAncHJvbXB0cydcblxuaW1wb3J0IHR5cGUgeyBDbGlBcmdzLCBQcm9qZWN0VGVtcGxhdGUgfSBmcm9tICc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RUFBRU4sSUFBSTtnQkFDYlMsT0FBT0gsRUFBRU4sSUFBSTtZQUNmO1FBQ0Y7UUFDQVUsU0FBUztRQUNUQyxNQUFNO1FBQ05DLFVBQVUsQ0FBQ0gsUUFBa0IsQ0FBQyxDQUFDQSxNQUFNSSxNQUFNO0lBQzdDLEdBQ0E7UUFDRUMsVUFBVTtZQUNSQyxRQUFRQyxJQUFJLENBQUM7UUFDZjtJQUNGO0lBR0YsTUFBTW5CLFdBQVdGLGVBQWVHLElBQUksQ0FBQyxDQUFDQyxJQUFNQSxFQUFFQyxJQUFJLEtBQUtFLFNBQVNPLEtBQUs7SUFDckUsSUFBSSxDQUFDWixVQUFVLE1BQU0sSUFBSUksTUFBTTtJQUUvQixPQUFPSjtBQUNUIn0=
|
package/dist/lib/select-db.js
CHANGED
@@ -1,120 +1,77 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
});
|
10
|
-
};
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
15
|
-
function step(op) {
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
20
|
-
switch (op[0]) {
|
21
|
-
case 0: case 1: t = op; break;
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
25
|
-
default:
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
30
|
-
if (t[2]) _.ops.pop();
|
31
|
-
_.trys.pop(); continue;
|
32
|
-
}
|
33
|
-
op = body.call(thisArg, _);
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "selectDb", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return selectDb;
|
36
9
|
}
|
37
|
-
};
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
10
|
+
});
|
11
|
+
const _slugify = /*#__PURE__*/ _interop_require_default(require("@sindresorhus/slugify"));
|
12
|
+
const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts"));
|
13
|
+
function _interop_require_default(obj) {
|
14
|
+
return obj && obj.__esModule ? obj : {
|
15
|
+
default: obj
|
16
|
+
};
|
17
|
+
}
|
18
|
+
const dbChoiceRecord = {
|
46
19
|
mongodb: {
|
47
|
-
value: 'mongodb',
|
48
|
-
title: 'MongoDB',
|
49
20
|
dbConnectionPrefix: 'mongodb://127.0.0.1/',
|
21
|
+
title: 'MongoDB',
|
22
|
+
value: 'mongodb'
|
50
23
|
},
|
51
24
|
postgres: {
|
52
|
-
value: 'postgres',
|
53
|
-
title: 'PostgreSQL (beta)',
|
54
25
|
dbConnectionPrefix: 'postgres://127.0.0.1:5432/',
|
55
|
-
|
26
|
+
title: 'PostgreSQL (beta)',
|
27
|
+
value: 'postgres'
|
28
|
+
}
|
56
29
|
};
|
57
|
-
function selectDb(args, projectName) {
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
value: dbChoice.value,
|
80
|
-
};
|
81
|
-
}),
|
82
|
-
validate: function (value) { return !!value.length; },
|
83
|
-
}, {
|
84
|
-
onCancel: function () {
|
85
|
-
process.exit(0);
|
86
|
-
},
|
87
|
-
})];
|
88
|
-
case 2:
|
89
|
-
dbTypeRes = _a.sent();
|
90
|
-
dbType = dbTypeRes.value;
|
91
|
-
_a.label = 3;
|
92
|
-
case 3:
|
93
|
-
dbChoice = dbChoiceRecord[dbType];
|
94
|
-
return [4 /*yield*/, (0, prompts_1.default)({
|
95
|
-
type: 'text',
|
96
|
-
name: 'value',
|
97
|
-
message: "Enter ".concat(dbChoice.title.split(' ')[0], " connection string"),
|
98
|
-
initial: "".concat(dbChoice.dbConnectionPrefix).concat(projectName === '.'
|
99
|
-
? "payload-".concat(getRandomDigitSuffix())
|
100
|
-
: (0, slugify_1.default)(projectName)),
|
101
|
-
validate: function (value) { return !!value.length; },
|
102
|
-
}, {
|
103
|
-
onCancel: function () {
|
104
|
-
process.exit(0);
|
105
|
-
},
|
106
|
-
})];
|
107
|
-
case 4:
|
108
|
-
dbUriRes = _a.sent();
|
109
|
-
return [2 /*return*/, {
|
110
|
-
type: dbChoice.value,
|
111
|
-
dbUri: dbUriRes.value,
|
112
|
-
}];
|
30
|
+
async function selectDb(args, projectName) {
|
31
|
+
let dbType = undefined;
|
32
|
+
if (args['--db']) {
|
33
|
+
if (!Object.values(dbChoiceRecord).some((dbChoice)=>dbChoice.value === args['--db'])) {
|
34
|
+
throw new Error(`Invalid database type given. Valid types are: ${Object.values(dbChoiceRecord).map((dbChoice)=>dbChoice.value).join(', ')}`);
|
35
|
+
}
|
36
|
+
dbType = args['--db'];
|
37
|
+
} else {
|
38
|
+
const dbTypeRes = await (0, _prompts.default)({
|
39
|
+
name: 'value',
|
40
|
+
choices: Object.values(dbChoiceRecord).map((dbChoice)=>{
|
41
|
+
return {
|
42
|
+
title: dbChoice.title,
|
43
|
+
value: dbChoice.value
|
44
|
+
};
|
45
|
+
}),
|
46
|
+
message: 'Select a database',
|
47
|
+
type: 'select',
|
48
|
+
validate: (value)=>!!value.length
|
49
|
+
}, {
|
50
|
+
onCancel: ()=>{
|
51
|
+
process.exit(0);
|
113
52
|
}
|
114
53
|
});
|
54
|
+
dbType = dbTypeRes.value;
|
55
|
+
}
|
56
|
+
const dbChoice = dbChoiceRecord[dbType];
|
57
|
+
const dbUriRes = await (0, _prompts.default)({
|
58
|
+
name: 'value',
|
59
|
+
initial: `${dbChoice.dbConnectionPrefix}${projectName === '.' ? `payload-${getRandomDigitSuffix()}` : (0, _slugify.default)(projectName)}`,
|
60
|
+
message: `Enter ${dbChoice.title.split(' ')[0]} connection string`,
|
61
|
+
type: 'text',
|
62
|
+
validate: (value)=>!!value.length
|
63
|
+
}, {
|
64
|
+
onCancel: ()=>{
|
65
|
+
process.exit(0);
|
66
|
+
}
|
115
67
|
});
|
68
|
+
return {
|
69
|
+
dbUri: dbUriRes.value,
|
70
|
+
type: dbChoice.value
|
71
|
+
};
|
116
72
|
}
|
117
|
-
exports.selectDb = selectDb;
|
118
73
|
function getRandomDigitSuffix() {
|
119
74
|
return (Math.random() * Math.pow(10, 6)).toFixed(0);
|
120
75
|
}
|
76
|
+
|
77
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIj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ixPQUFPO1FBQ0xNLE9BQU9MLFNBQVN4QixLQUFLO1FBQ3JCa0IsTUFBTVQsU0FBU1QsS0FBSztJQUN0QjtBQUNGO0FBRUEsU0FBUzBCO0lBQ1AsT0FBTyxBQUFDSSxDQUFBQSxLQUFLQyxNQUFNLEtBQUtELEtBQUtFLEdBQUcsQ0FBQyxJQUFJLEVBQUMsRUFBR0MsT0FBTyxDQUFDO0FBQ25EIn0=
|
package/dist/lib/templates.js
CHANGED
@@ -1,104 +1,70 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
9
|
});
|
10
|
-
}
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
function
|
16
|
-
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
20
|
-
switch (op[0]) {
|
21
|
-
case 0: case 1: t = op; break;
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
25
|
-
default:
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
30
|
-
if (t[2]) _.ops.pop();
|
31
|
-
_.trys.pop(); continue;
|
32
|
-
}
|
33
|
-
op = body.call(thisArg, _);
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
validateTemplate: function() {
|
13
|
+
return validateTemplate;
|
14
|
+
},
|
15
|
+
getValidTemplates: function() {
|
16
|
+
return getValidTemplates;
|
36
17
|
}
|
37
|
-
};
|
38
|
-
|
39
|
-
exports.getValidTemplates = exports.validateTemplate = void 0;
|
40
|
-
var log_1 = require("../utils/log");
|
18
|
+
});
|
19
|
+
const _log = require("../utils/log");
|
41
20
|
function validateTemplate(templateName) {
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
if (!validTemplates.map(function (t) { return t.name; }).includes(templateName)) {
|
50
|
-
(0, log_1.error)("'".concat(templateName, "' is not a valid template."));
|
51
|
-
(0, log_1.info)("Valid templates: ".concat(validTemplates.map(function (t) { return t.name; }).join(', ')));
|
52
|
-
return [2 /*return*/, false];
|
53
|
-
}
|
54
|
-
return [2 /*return*/, true];
|
55
|
-
}
|
56
|
-
});
|
57
|
-
});
|
21
|
+
const validTemplates = getValidTemplates();
|
22
|
+
if (!validTemplates.map((t)=>t.name).includes(templateName)) {
|
23
|
+
(0, _log.error)(`'${templateName}' is not a valid template.`);
|
24
|
+
(0, _log.info)(`Valid templates: ${validTemplates.map((t)=>t.name).join(', ')}`);
|
25
|
+
return false;
|
26
|
+
}
|
27
|
+
return true;
|
58
28
|
}
|
59
|
-
exports.validateTemplate = validateTemplate;
|
60
29
|
function getValidTemplates() {
|
61
|
-
return
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
},
|
100
|
-
]];
|
101
|
-
});
|
102
|
-
});
|
30
|
+
return [
|
31
|
+
{
|
32
|
+
name: 'blank',
|
33
|
+
description: 'Blank Template',
|
34
|
+
type: 'starter',
|
35
|
+
url: 'https://github.com/payloadcms/payload/templates/blank'
|
36
|
+
},
|
37
|
+
{
|
38
|
+
name: 'website',
|
39
|
+
description: 'Website Template',
|
40
|
+
type: 'starter',
|
41
|
+
url: 'https://github.com/payloadcms/payload/templates/website'
|
42
|
+
},
|
43
|
+
{
|
44
|
+
name: 'ecommerce',
|
45
|
+
description: 'E-commerce Template',
|
46
|
+
type: 'starter',
|
47
|
+
url: 'https://github.com/payloadcms/payload/templates/ecommerce'
|
48
|
+
},
|
49
|
+
{
|
50
|
+
name: 'plugin',
|
51
|
+
description: 'Template for creating a Payload plugin',
|
52
|
+
type: 'plugin',
|
53
|
+
url: 'https://github.com/payloadcms/payload-plugin-template'
|
54
|
+
},
|
55
|
+
{
|
56
|
+
name: 'payload-demo',
|
57
|
+
description: 'Payload demo site at https://demo.payloadcms.com',
|
58
|
+
type: 'starter',
|
59
|
+
url: 'https://github.com/payloadcms/public-demo'
|
60
|
+
},
|
61
|
+
{
|
62
|
+
name: 'payload-website',
|
63
|
+
description: 'Payload website CMS at https://payloadcms.com',
|
64
|
+
type: 'starter',
|
65
|
+
url: 'https://github.com/payloadcms/website-cms'
|
66
|
+
}
|
67
|
+
];
|
103
68
|
}
|
104
|
-
|
69
|
+
|
70
|
+
//# sourceMappingURL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