@significa/start
Advanced tools
Comparing version 0.5.1 to 0.5.2
@@ -8,2 +8,4 @@ "use strict"; | ||
const chalk_1 = tslib_1.__importDefault(require("chalk")); | ||
const figlet_1 = tslib_1.__importDefault(require("figlet")); | ||
const inquirer_1 = tslib_1.__importDefault(require("inquirer")); | ||
const gatsby_1 = tslib_1.__importDefault(require("./gatsby")); | ||
@@ -19,3 +21,31 @@ const next_1 = tslib_1.__importDefault(require("./next")); | ||
async run() { | ||
const { args: { name, type }, } = this.parse(SignificaStart); | ||
log_1.default.info(`\n${chalk_1.default.yellow(figlet_1.default.textSync('significa-start', { horizontalLayout: 'default' }))}`); | ||
const { args } = this.parse(SignificaStart); | ||
const type = args.type || | ||
(await inquirer_1.default.prompt({ | ||
message: 'Which stack would you like to use?', | ||
type: 'list', | ||
name: 'type', | ||
choices: [ | ||
{ | ||
name: 'NextJS', | ||
value: 'next', | ||
}, | ||
{ | ||
name: 'Gatsby', | ||
value: 'gatsby', | ||
}, | ||
{ | ||
name: 'Create React App', | ||
value: 'cra', | ||
}, | ||
], | ||
})).type; | ||
const name = args.name || | ||
(await inquirer_1.default.prompt({ | ||
message: "What's the name of the project?", | ||
type: 'input', | ||
name: 'name', | ||
default: 'hello-world', | ||
})).name; | ||
if (fs_1.default.existsSync(name)) { | ||
@@ -72,7 +102,7 @@ log_1.default.error('Folder already exists'); | ||
name: 'type', | ||
required: true, | ||
required: false, | ||
options: stacks, | ||
}, | ||
{ name: 'name', required: true }, | ||
{ name: 'name', required: false }, | ||
]; | ||
module.exports = SignificaStart; |
{ | ||
"name": "@significa/start", | ||
"description": "Opinionated Significa's bootstrap CLI to start React projects based on Create React App, NextJS or GatsbyJS.", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"author": "Significa Lda. <hello@significa.co>", | ||
@@ -16,5 +16,9 @@ "bin": { | ||
"@oclif/plugin-help": "^3.0.0", | ||
"@types/figlet": "^1.2.0", | ||
"@types/inquirer": "^6.5.0", | ||
"chalk": "^4.0.0", | ||
"cli-ux": "^5.4.5", | ||
"execa": "^4.0.0", | ||
"figlet": "^1.5.0", | ||
"inquirer": "^7.3.2", | ||
"jsonfile": "^6.0.1", | ||
@@ -21,0 +25,0 @@ "ora": "^4.0.4", |
@@ -12,15 +12,10 @@ <a href="https://significa.co"><img src="https://user-images.githubusercontent.com/4838076/70076649-20d29b00-15f7-11ea-9379-e2fa1889a525.png" alt="logo" width="300px"></a> | ||
![significa-significa-start](https://user-images.githubusercontent.com/17513388/71968657-41e16980-31fd-11ea-9dec-045d80dc7764.png) | ||
![significa-significa-start](https://user-images.githubusercontent.com/4838076/88907578-b25edf00-d250-11ea-92c8-3e9845e08660.png) | ||
You can also skip the prompt and give it the configuration you want: | ||
## Usage | ||
The command-line interface expects the following arguments: | ||
- **Project type:** may be one of these options; | ||
- `cra`: Create React App from Facebook; | ||
- `next`: Next.js from Zeit; | ||
- `gatsby`: GatsbyJS; | ||
- **Project name:** will be used on the folder name and configuration files; | ||
@@ -32,2 +27,4 @@ | ||
- Regular: `npx @significa/start`; | ||
- Shortcut: `npx @significa/start [project] [name]`; | ||
- Help: `npx @significa/start --help`; | ||
@@ -34,0 +31,0 @@ - Version: `npx @significa/start --version`; |
153976
753
16
48
+ Added@types/figlet@^1.2.0
+ Added@types/inquirer@^6.5.0
+ Addedfiglet@^1.5.0
+ Addedinquirer@^7.3.2
+ Added@types/figlet@1.7.0(transitive)
+ Added@types/inquirer@6.5.0(transitive)
+ Added@types/node@22.13.1(transitive)
+ Added@types/through@0.0.33(transitive)
+ Addedchardet@0.7.0(transitive)
+ Addedcli-width@3.0.0(transitive)
+ Addedexternal-editor@3.1.0(transitive)
+ Addedfiglet@1.8.0(transitive)
+ Addedfigures@3.2.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinquirer@7.3.3(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedrun-async@2.4.1(transitive)
+ Addedrxjs@6.6.7(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtmp@0.0.33(transitive)
+ Addedundici-types@6.20.0(transitive)