A rollup cli : create a dev-environment includes Rollup, TypeScrit, Babel, Git, ESlint, Prettier...
npx rolib-cli my-app
cd my-app
npm start
If you've previously installed
rolib-cli
globally vianpm install -g rolib-cli
, we recommend you uninstall the package usingnpm uninstall -g rolib-cli
oryarn global remove rolib-cli
to ensure thatnpx
always uses the latest version.
(npx comes with npm 5.2+ and higher, see instructions for older npm versions)
my-app
├─ .git/
├─ .husky/
├─ node_modules/
├─ src
│ └─ index.ts
├─ .cz-config.js
├─ .eslintignore
├─ .eslintrc.js
├─ .gitignore
├─ .prettierignore
├─ .prettierrc.js
├─ babel.config.js
├─ commitlint.config.js
├─ package-lock.json
├─ package.json
├─ rollup.config.ts
└─ tsconfig.json
We can add some dev-libs by enriching installFeatures.
Example
// src/utils/installName.ts
// you need to prefix "install" in the filename
// "Name" is the value that user select feature via inquirer.prompt
export async function installName(){
// code...
}
// src/utils/index.ts
import { installName } from './installName'
export const installMethods = {
installName,
}
// src/utils/initPro.ts
export async function selectFeature() {
const questions: inquirer.Answers = [
{
type: 'checkbox',
name: 'multiple',
choices: [
{
name: 'Install Name1?',
value: 'Name1', // relate to installName1
checked: true,
},
{
name: 'Install Name2?',
value: 'Name2', // relate to installName2
},
],
},
{
type: 'confirm',
name: 'Name3',
message: 'Install Name3 ?', // relate to installName3
default: true,
},
];
const answers = await inquirer.prompt(questions);
const features = [...(answers.multiple|| [])]; // type checkbox
const confirmIds: string[] = []; // type confirm
questions.slice(1).forEach(q => {
q.type === 'confirm' && confirmIds.push(q.name);
});
confirmIds.forEach(v => {
answers[v] && features.push(v);
});
await installFeatures(features);
}
Jay-Ohhh
- Website: Jay-Ohhh (Jay-Ohhh) · GitHub
- Github: @Jay-Ohhh
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a ⭐️ if this project helped you!
Copyright © 2022 Jay-Ohhh.
This project is MIT licensed.