create-iolit
Advanced tools
Comparing version 2.7.0 to 2.7.1
49
index.js
@@ -11,3 +11,3 @@ #!/usr/bin/env node | ||
const prompts = require("prompts"); | ||
const { yellow, blue, lightRed, red } = require("kolorist"); | ||
const { yellow, blue, red } = require("kolorist"); | ||
@@ -18,23 +18,11 @@ const cwd = process.cwd(); | ||
{ | ||
name: "iolit", | ||
color: lightRed, | ||
variants: [ | ||
{ | ||
name: "vanilla", | ||
display: "JavaScript", | ||
color: yellow, | ||
}, | ||
{ | ||
name: "typescript", | ||
display: "TypeScript", | ||
color: blue, | ||
}, | ||
], | ||
name: "vanilla", | ||
color: yellow, | ||
}, | ||
{ | ||
name: "typescript", | ||
color: blue, | ||
}, | ||
]; | ||
const TEMPLATES = FRAMEWORKS.map( | ||
(f) => (f.variants && f.variants.map((v) => v.name)) || [f.name] | ||
).reduce((a, b) => a.concat(b), []); | ||
const renameFiles = { | ||
@@ -48,3 +36,3 @@ _gitignore: ".gitignore", | ||
const defaultProjectName = !targetDir ? "vite-project" : targetDir; | ||
const defaultProjectName = !targetDir ? "iolit-project" : targetDir; | ||
@@ -93,8 +81,8 @@ let result = {}; | ||
{ | ||
type: template && TEMPLATES.includes(template) ? null : "select", | ||
type: template ? null : "select", | ||
name: "framework", | ||
message: | ||
typeof template === "string" && !TEMPLATES.includes(template) | ||
typeof template === "string" | ||
? `"${template}" isn't a valid template. Please choose from below: ` | ||
: "Select a framework:", | ||
: "Select a template:", | ||
initial: 0, | ||
@@ -109,17 +97,2 @@ choices: FRAMEWORKS.map((framework) => { | ||
}, | ||
{ | ||
type: (framework) => | ||
framework && framework.variants ? "select" : null, | ||
name: "variant", | ||
message: "Select a variant:", | ||
// @ts-ignore | ||
choices: (framework) => | ||
framework.variants.map((variant) => { | ||
const variantColor = variant.color; | ||
return { | ||
title: variantColor(variant.name), | ||
value: variant.name, | ||
}; | ||
}), | ||
}, | ||
], | ||
@@ -126,0 +99,0 @@ { |
{ | ||
"name": "create-iolit", | ||
"version": "2.7.0", | ||
"version": "2.7.1", | ||
"description": "Create IOLIT apps with one command", | ||
@@ -8,4 +8,3 @@ "author": "Ivan jeremic", | ||
"bin": { | ||
"create-iolit": "index.js", | ||
"ciola": "index.js" | ||
"create-iolit": "index.js" | ||
}, | ||
@@ -12,0 +11,0 @@ "files": [ |
14066
272