create-kyro 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +27 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -64,26 +64,31 @@ async function promptUser() {
|
|
|
64
64
|
name: "template",
|
|
65
65
|
message: "Starting template:",
|
|
66
66
|
hint: " ",
|
|
67
|
-
initial:
|
|
67
|
+
initial: 0,
|
|
68
68
|
choices: [
|
|
69
69
|
{
|
|
70
70
|
title: "Minimal",
|
|
71
|
-
description: "
|
|
71
|
+
description: "Single Posts collection \u2014 just title & content. Perfect for getting started fast.",
|
|
72
72
|
value: "minimal"
|
|
73
73
|
},
|
|
74
|
+
{
|
|
75
|
+
title: "Starter",
|
|
76
|
+
description: "Pages, Posts, Categories, Menu + core settings. Great for blogs and small sites.",
|
|
77
|
+
value: "starter"
|
|
78
|
+
},
|
|
74
79
|
{
|
|
75
80
|
title: "Blog",
|
|
76
|
-
description: "Posts, categories, media library +
|
|
81
|
+
description: "Posts, categories, media library + all settings. Full blog setup.",
|
|
77
82
|
value: "blog"
|
|
78
83
|
},
|
|
79
84
|
{
|
|
80
85
|
title: "E-commerce",
|
|
81
|
-
description: "Products, orders, customers, coupons +
|
|
86
|
+
description: "Products, orders, customers, coupons + all settings. Online store ready.",
|
|
82
87
|
value: "ecommerce"
|
|
83
88
|
},
|
|
84
89
|
{
|
|
85
90
|
title: "Kitchen Sink",
|
|
86
|
-
description: "Everything:
|
|
91
|
+
description: "Everything: all collections + all settings. Maximum feature set.",
|
|
87
92
|
value: "kitchen-sink"
|
|
88
93
|
}
|
|
89
94
|
]
|
|
@@ -225,7 +230,11 @@ function generateKyroConfig(answers) {
|
|
|
225
230
|
let templateGlobals = "";
|
|
226
231
|
switch (answers.template) {
|
|
227
232
|
case "minimal":
|
|
228
|
-
templateCollections = "import { minimalCollections
|
|
233
|
+
templateCollections = "import { minimalCollections } from '@kyro-cms/core/templates';";
|
|
234
|
+
templateGlobals = "import { siteSettingsGlobal, seoSettingsGlobal } from '@kyro-cms/core/templates';";
|
|
235
|
+
break;
|
|
236
|
+
case "starter":
|
|
237
|
+
templateCollections = "import { starterCollections, mediaCollections, authCollections } from '@kyro-cms/core/templates';";
|
|
229
238
|
templateGlobals = "import { coreSettingsGlobals } from '@kyro-cms/core/templates';";
|
|
230
239
|
break;
|
|
231
240
|
case "blog":
|
|
@@ -234,11 +243,11 @@ function generateKyroConfig(answers) {
|
|
|
234
243
|
break;
|
|
235
244
|
case "ecommerce":
|
|
236
245
|
templateCollections = "import { ecommerceCollections, mediaCollections, authCollections } from '@kyro-cms/core/templates';";
|
|
237
|
-
templateGlobals = "import { allSettingsGlobals
|
|
246
|
+
templateGlobals = "import { allSettingsGlobals } from '@kyro-cms/core/templates';";
|
|
238
247
|
break;
|
|
239
248
|
case "kitchen-sink":
|
|
240
|
-
templateCollections = `import { minimalCollections, blogCollections, ecommerceCollections, kitchenSinkCollections, mediaCollections, authCollections } from '@kyro-cms/core/templates';`;
|
|
241
|
-
templateGlobals = "import { allSettingsGlobals
|
|
249
|
+
templateCollections = `import { minimalCollections, starterCollections, blogCollections, ecommerceCollections, kitchenSinkCollections, mediaCollections, authCollections } from '@kyro-cms/core/templates';`;
|
|
250
|
+
templateGlobals = "import { allSettingsGlobals } from '@kyro-cms/core/templates';";
|
|
242
251
|
break;
|
|
243
252
|
}
|
|
244
253
|
if (templateCollections) imports.push(templateCollections);
|
|
@@ -247,6 +256,10 @@ function generateKyroConfig(answers) {
|
|
|
247
256
|
if (answers.template === "minimal") {
|
|
248
257
|
collectionsConfig = ` collections: [
|
|
249
258
|
...Object.values(minimalCollections),
|
|
259
|
+
],`;
|
|
260
|
+
} else if (answers.template === "starter") {
|
|
261
|
+
collectionsConfig = ` collections: [
|
|
262
|
+
...Object.values(starterCollections),
|
|
250
263
|
...Object.values(mediaCollections),
|
|
251
264
|
...Object.values(authCollections),
|
|
252
265
|
],`;
|
|
@@ -265,6 +278,7 @@ function generateKyroConfig(answers) {
|
|
|
265
278
|
} else if (answers.template === "kitchen-sink") {
|
|
266
279
|
collectionsConfig = ` collections: [
|
|
267
280
|
...Object.values(minimalCollections),
|
|
281
|
+
...Object.values(starterCollections),
|
|
268
282
|
...Object.values(blogCollections),
|
|
269
283
|
...Object.values(ecommerceCollections),
|
|
270
284
|
...Object.values(kitchenSinkCollections),
|
|
@@ -274,11 +288,11 @@ function generateKyroConfig(answers) {
|
|
|
274
288
|
}
|
|
275
289
|
let globalsConfig = "";
|
|
276
290
|
if (answers.template === "minimal") {
|
|
291
|
+
globalsConfig = ` globals: [siteSettingsGlobal, seoSettingsGlobal],`;
|
|
292
|
+
} else if (answers.template === "starter") {
|
|
277
293
|
globalsConfig = ` globals: coreSettingsGlobals,`;
|
|
278
|
-
} else if (answers.template === "blog" || answers.template === "ecommerce") {
|
|
279
|
-
globalsConfig =
|
|
280
|
-
} else if (answers.template === "kitchen-sink") {
|
|
281
|
-
globalsConfig = ` globals: [...allSettingsGlobals, ...ecommerceSettingsGlobals],`;
|
|
294
|
+
} else if (answers.template === "blog" || answers.template === "ecommerce" || answers.template === "kitchen-sink") {
|
|
295
|
+
globalsConfig = ` globals: allSettingsGlobals,`;
|
|
282
296
|
}
|
|
283
297
|
return `${imports.join("\n")}
|
|
284
298
|
|