Socket
Socket
Sign inDemoInstall

bollireact

Package Overview
Dependencies
32
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.1.0

lib/create-files.js

106

index.js
#!/usr/bin/env node
const { prompt } = require('inquirer');
const skeleton = require('./skeleton');
const installDeps = require('./install-deps');
const createFiles = require('./create-files');
const getDefaultData = require('./data');
const log = require('./log');
const validate = input => !!input || 'Field can\'t be empty';
const skeleton = require('./lib/skeleton');
const installDeps = require('./lib/install-deps');
const createFiles = require('./lib/create-files');
const getDefaultData = require('./lib/data');
const log = require('./lib/log');
const questions = require('./lib/questions');
(async () => {
const questions = [{
validate,
type: 'input',
name: 'name',
message: 'name of project (used as dir name and `package.json.name`)'
}, {
validate,
type: 'input',
name: 'displayName',
message: 'Display name of project (used as default document title / readme)'
}, {
type: 'input',
name: 'description',
message: 'Optional - Description of project (used in readme and as `package.json.description`)'
}, {
type: 'input',
name: 'additionalDependencies',
message: 'Optional space separated list - Additional dependencies to be installed'
}, {
type: 'input',
name: 'additionalDevDependencies',
message: 'Optional space separated list - Additional dev dependencies to be installed'
}];
const answers = await prompt(questions);

@@ -51,54 +27,32 @@ const defaultData = getDefaultData(answers);

/**
* Create project structure (dirs and files)
*/
log(`Creating "${answers.name}" app structure`)
log(`
##################################################
## Creating "${answers.name}" app structure ##
##################################################
`);
await skeleton(data);
console.log('done.')
log(`Creating files from template`);
log('App structure has been created', 'info');
log(`
##################################################
## Creating files from template ##
##################################################
`);
await createFiles(data);
console.log('done.')
log(`Installing dependencies`);
log('Files have been created', 'info');
log(`
##################################################
## Installing dependencies ##
##################################################
`);
await installDeps(data);
console.log('done.')
log('Dependencies have been installed', 'info');
log(`
"${answers.name}" successfully created
to get it started do:
$ cd ${answers.name}/ && yarn start
"${answers.name}" successfully created
$ cd ${answers.name}/ && yarn start
`);
process.exit(0);
})();
/**
* ################
* ### Ask for: ###
* ################
*
* name, displayName, description
*
*
* ####################
* ### createFiles: ###
* ####################
*
* example/
* example/package.json
* example/src/
* example/src/index.js
* example/src/index.html
*
* ############################
* ### install dependencies ###
* ############################
*
* yarn add react react-dom
* yarn add babel-preset-react --dev
* yarn add babel-preset-env --dev
* yarn add parcel-bundler --dev
* yarn add eslint --dev
* yarn add eslint-config-prettier --dev
* yarn add eslint-plugin-jsx-a11y --dev
* yarn add eslint-plugin-react --dev
* yarn add --dev jest
* yarn add --dev husky
*/
{
"name": "bollireact",
"version": "1.0.1",
"version": "1.1.0",
"description": "my personal react project boilerplate thingy",

@@ -5,0 +5,0 @@ "author": "Harris Schneiderman",

# Bollireact
> bollire react
> bollire react - a yarn, parcel, react, prettier boilerplate
...__bollire__ means boil in italian or something
*NOTE*: this is for my own personal use...I do not recommend using this unless you fully understand what it does
## Usage

@@ -21,4 +23,3 @@

*NOTE*: this is for my own personal use...I do not recommend using this unless you fully understand what it does
*OTHER NOTE*: the code for this isn't pretty, I basically `child_process.exec` a bunch of shit so use with caution!
*NOTE*: I basically `child_process.exec` a bunch of shit so use with caution!

@@ -25,0 +26,0 @@ ## What it do

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc