newcandies 0.1.51 → 0.1.53
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 +12 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35,6 +35,13 @@ var categoryIcons = {
|
|
|
35
35
|
"expo-router": "\u279C",
|
|
36
36
|
"forms": "\u{1F4DD}"
|
|
37
37
|
};
|
|
38
|
+
var badge = {
|
|
39
|
+
name: pc.bgCyan(pc.black(" name ")),
|
|
40
|
+
type: pc.bgMagenta(pc.black(" type ")),
|
|
41
|
+
tmpl: pc.bgGreen(pc.black(" template ")),
|
|
42
|
+
cat: pc.bgYellow(pc.black(" category ")),
|
|
43
|
+
pick: pc.bgBlue(pc.black(" variant "))
|
|
44
|
+
};
|
|
38
45
|
async function main() {
|
|
39
46
|
console.clear();
|
|
40
47
|
const label = pc.bgCyan(pc.black(" \u2731 newcandies "));
|
|
@@ -46,14 +53,14 @@ async function main() {
|
|
|
46
53
|
const project = await p.group(
|
|
47
54
|
{
|
|
48
55
|
name: () => p.text({
|
|
49
|
-
message:
|
|
56
|
+
message: `${badge.name} Project name?`,
|
|
50
57
|
placeholder: "my-newcandies-app",
|
|
51
58
|
validate: (v) => !v ? "Enter a name" : /[^a-zA-Z0-9_-]/.test(v) ? "Use letters, numbers, _ or -" : void 0
|
|
52
59
|
}),
|
|
53
60
|
type: async () => {
|
|
54
61
|
if (opts.type) return opts.type;
|
|
55
62
|
return p.select({
|
|
56
|
-
message:
|
|
63
|
+
message: `${badge.type} Pick a treat`,
|
|
57
64
|
options: [
|
|
58
65
|
{ value: "boilerplates", label: "\u2726 Boilerplate" },
|
|
59
66
|
{ value: "mini-boilerplates", label: "\u{1F369} Mini-boilerplate" },
|
|
@@ -70,7 +77,7 @@ async function main() {
|
|
|
70
77
|
if (opts.template) return opts.template;
|
|
71
78
|
const items = registry[type];
|
|
72
79
|
return p.select({
|
|
73
|
-
message:
|
|
80
|
+
message: `${badge.tmpl} Pick template`,
|
|
74
81
|
options: items.map((i) => ({
|
|
75
82
|
value: i.name,
|
|
76
83
|
label: `${i.name} - ${i.description}`
|
|
@@ -83,7 +90,7 @@ async function main() {
|
|
|
83
90
|
if (opts.category) return opts.category;
|
|
84
91
|
const cats = registry[type];
|
|
85
92
|
return p.select({
|
|
86
|
-
message:
|
|
93
|
+
message: `${badge.cat} Pick category`,
|
|
87
94
|
options: cats.map((c) => ({
|
|
88
95
|
value: c.category,
|
|
89
96
|
label: `${categoryIcons[c.category] || "\u2726"} ${c.category}`
|
|
@@ -97,7 +104,7 @@ async function main() {
|
|
|
97
104
|
const cats = registry[type];
|
|
98
105
|
const cat = cats.find((c) => c.category === results.category);
|
|
99
106
|
return p.select({
|
|
100
|
-
message:
|
|
107
|
+
message: `${badge.pick} Pick variant`,
|
|
101
108
|
options: cat.variants.map((v) => ({
|
|
102
109
|
value: v.name,
|
|
103
110
|
label: `${v.name} - ${v.description}`
|