1 Star 0 Fork 0

Jay_Ohhh / rolib-cli

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

rolib-cli 🎉

A rollup cli : create a dev-environment includes Rollup, TypeScrit, Babel, Git, ESlint, Prettier...

Version downloads License: MIT

🚀 Quick Start

npx rolib-cli my-app
cd my-app
npm start

If you've previously installed  rolib-cli  globally via  npm install -g rolib-cli , we recommend you uninstall the package using  npm uninstall -g rolib-cli  or  yarn global remove rolib-cli  to ensure that  npx  always uses the latest version.

(npx comes with npm 5.2+ and higher, see instructions for older npm versions)

🎨 Output

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

✏️ extend

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);
}

👔 Author

Jay-Ohhh

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page. You can also take a look at the contributing guide.

✨ Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2022 Jay-Ohhh.

This project is MIT licensed.

MIT License Copyright (c) 2022 Jay_Ohhh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

A rollup cli : create a dev-environment includes Rollup, TypeScrit, Babel, Git, ESlint, Prettier... 展开 收起
TypeScript 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/Jay_Ohhh/rolib-cli.git
git@gitee.com:Jay_Ohhh/rolib-cli.git
Jay_Ohhh
rolib-cli
rolib-cli
master

搜索帮助