@21epub/create-ts-cli-app 中文文档教程

发布于 3年前 浏览 28 项目主页 更新于 3年前

create-ts-cli-app

CLI 用于创建支持 Typescript 的节点 CLI 应用程序。

NPM构建状态JavaScript 风格指南

Intro

轻松创建 CLI 应用程序。

Typescript 支持源代码开发。

易于发布和发布您的 CLI 应用程序。

Features

  • [x] Easy-to-use CLI
  • [x] Handles all modern JS features
  • [x] Rollup for bundling
  • [x] Babel for transpiling
  • [x] Jest + testing-library for testing.
  • [x] TypeScript Only
  • [x] Sourcemap creation
  • [x] lint-staged support
  • [X] Conventional commit by git-cz
  • [X] standard-version support by npm run release
  • [X] Format on Save ( Vscode Editor )
  • [X] Travis CI & Code coverage by custom configration

Install globally

此包需要 node >= 10

npm install -g @21epub/create-ts-cli-app

Usage with npx ( Recommand )

运行前无需创建空文件夹。

npx @21epub/create-ts-cli-app

(npx 随 npm 5.2+ 及更高版本一起提供,请参阅 < a href="https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f">instructions for older npm versions)

Creating a New CLI APP

create-ts-cli-app

回答关于您的应用程序的一些基本提示,然后 CLI 将执行以下步骤:

  • copy over the template
  • install dependencies via yarn or npm
  • initialize local git repo

此时,您的新应用已准备就绪,并且已为本地开发做好了全部设置。

Development

现在,任何时候你都可以继续开发

npm start # start bundle and watch your dev code  

然后,你可以运行你的 CLI

node . # -> node ./dist/index.js  

提交方法建议

npm run commit # lint before commit can save your time , and then conventional commit with git-cz

Publishing to npm

npm run release # Version and changelog
git push --follow-tags origin master
npm publish # The `prePublishOnly` hook will run before publish to build and test your package

这会将你的模块的 commonjs 构建到 dist/,然后将你的模块发布到 npm。

License

麻省理工学院 © 21epub

create-ts-cli-app

CLI for creating node CLI app with Typescript support .

NPMBuild StatusJavaScript Style Guide

Intro

Eazy to create a CLI app .

Typescript Support for source code development .

Eazy to Release and Publish your CLI app .

Features

  • [x] Easy-to-use CLI
  • [x] Handles all modern JS features
  • [x] Rollup for bundling
  • [x] Babel for transpiling
  • [x] Jest + testing-library for testing.
  • [x] TypeScript Only
  • [x] Sourcemap creation
  • [x] lint-staged support
  • [X] Conventional commit by git-cz
  • [X] standard-version support by npm run release
  • [X] Format on Save ( Vscode Editor )
  • [X] Travis CI & Code coverage by custom configration

Install globally

This package requires node >= 10.

npm install -g @21epub/create-ts-cli-app

Usage with npx ( Recommand )

No need to create an empty folder before running.

npx @21epub/create-ts-cli-app

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

Creating a New CLI APP

create-ts-cli-app

Answer some basic prompts about your app, and then the CLI will perform the following steps:

  • copy over the template
  • install dependencies via yarn or npm
  • initialize local git repo

At this point, your new app is ready and is all setup for local development.

Development

Now, anytime you can keep on developing

npm start # start bundle and watch your dev code  

Then, you can run your CLI

node . # -> node ./dist/index.js  

Commit Method Recommandation

npm run commit # lint before commit can save your time , and then conventional commit with git-cz

Publishing to npm

npm run release # Version and changelog
git push --follow-tags origin master
npm publish # The `prePublishOnly` hook will run before publish to build and test your package

This builds commonjs of your module to dist/ and then publishes your module to npm.

License

MIT © 21epub

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文