Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

easy-templates

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-templates - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

bin/src/presets/js-eslint/index.js

66

bin/index.js
#!/usr/bin/env node
import inquirer from 'inquirer';
import path from 'path';
import criarEstruturaDePastasReactTsWebpack from './src/react-ts-webpack/index.js';
import { questions } from './src/types/index.js';
inquirer.prompt(questions).then((answers) => {
const currentFolder = path.basename(process.cwd()).replace(/\s+/g, '-');
const userInput = {
packageManager: answers.packageManager,
appName: answers.appName || currentFolder,
appDescription: answers.appDescription || 'App Description',
appAuthor: answers.appAuthor || '',
appLicense: answers.appLicense || 'ISC',
selectedTemplate: answers.template,
import { firstQuestion, questions, separetedFiles } from './src/promptArrays/index.js';
import criarEstruturaDePastasReactTsWebpack from './src/templates/react-ts-webpack/index.js';
import createAndInstallTsEslintPrettier from './src/presets/ts-eslint-prettier/index.js';
import simpleHtmlJsCssStructure from './src/templates/simpleHtmlJsCssStructure/index.js';
import createAndInstallJsEslint from './src/presets/js-eslint/index.js';
inquirer.prompt(firstQuestion).then(function (answer) {
var userFisrtInput = {
firstQuestionChoice: answer.firstQuestionChoice,
packageManager: answer.packageManager,
};
if (userInput.selectedTemplate === 'reactjs_ts_webpack_react-router-dom_styled-components_babel') {
criarEstruturaDePastasReactTsWebpack(userInput);
if (userFisrtInput.firstQuestionChoice === 'Complete template') {
inquirer.prompt(questions).then(function (answers) {
var currentFolder = path.basename(process.cwd()).replace(/\s+/g, '-');
var userInput = {
packageManager: userFisrtInput.packageManager,
appName: answers.appName || currentFolder,
appDescription: answers.appDescription || 'App Description',
appAuthor: answers.appAuthor || '',
appLicense: answers.appLicense || 'ISC',
selectedTemplate: answers.template,
};
switch (userInput.selectedTemplate) {
case 'reactjs_ts_webpack_react-router-dom_styled-components_babel':
criarEstruturaDePastasReactTsWebpack(userInput);
break;
case 'simple-Html-Js-Css-Structure':
simpleHtmlJsCssStructure(userInput);
break;
default:
console.error("This template doesn't exist");
break;
}
});
}
else if (userFisrtInput.firstQuestionChoice === 'Separete files') {
inquirer.prompt(separetedFiles).then(function (answers) {
var separetedFiles = {
packageManager: userFisrtInput.packageManager,
filesToInstall: answers.filesToInstall,
};
switch (separetedFiles.filesToInstall) {
case 'ts-eslint-prettier':
createAndInstallTsEslintPrettier(separetedFiles);
break;
case 'js-eslint-generic':
createAndInstallJsEslint(separetedFiles);
break;
default:
console.error("This files doesn't exist");
break;
}
});
}
else {
console.error("This template doesn't exist");
console.error('Exit, Process finished');
}
});

@@ -1,36 +0,1 @@

const templateChoices = ['reactjs_ts_webpack_react-router-dom_styled-components_babel'];
const packageManager = ['yarn', 'npm'];
export const questions = [
{
type: 'list',
name: 'packageManager',
message: 'Choose package manager:',
choices: packageManager,
},
{
type: 'input',
name: 'appName',
message: 'Enter the name of your app in package.json:',
},
{
type: 'input',
name: 'appDescription',
message: 'Enter the description:',
},
{
type: 'input',
name: 'appAuthor',
message: 'Enter the author:',
},
{
type: 'input',
name: 'appLicense',
message: 'Enter the license:',
},
{
type: 'list',
name: 'template',
message: 'Choose a template:',
choices: templateChoices,
},
];
export {};
{
"name": "easy-templates",
"author": "Gabriel Logan",
"version": "0.0.5",
"version": "0.0.6",
"description": "easy-templates - A library for creating various templates easily and efficiently using NPX.",
"bin": "bin/index.js",
"types": "types",
"scripts": {

@@ -36,2 +37,6 @@ "test": "echo \"Error: no test specified\" && exit 1",

"license": "MIT",
"dependencies": {
"cross-spawn": "^7.0.3",
"inquirer": "^9.2.11"
},
"devDependencies": {

@@ -41,4 +46,4 @@ "@types/cross-spawn": "^6.0.4",

"@types/node": "^20.8.7",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"eslint": "^8.52.0",

@@ -50,7 +55,3 @@ "eslint-config-prettier": "^9.0.0",

"typescript": "^5.2.2"
},
"dependencies": {
"cross-spawn": "^7.0.3",
"inquirer": "^9.2.11"
}
}

@@ -23,4 +23,12 @@ # easy-templates

Templates
- **reactjs_ts_webpack_react-router-dom_styled-components_babel**: Reactjs with typescript, webpack, react-router-dom and styled-components pre configured
- **simple-Html-Js-Css-Structure**: Create a simple structure using html css and javascript
Pre configs only
- **js-eslint-generic**: Run a sub runner asking for several custom options
- **ts-eslint-prettier**: Create a file structure and install dependencies using ts eslint and prettier
### Help the dev

@@ -27,0 +35,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc