saber-tsmod
a cli for ts dev.
publish your ts module to npm!
npm install saber-tsmod -g
Usage:
-
init: init the project files.
-
create
<module>
: create a new ts module file and its test file. -
create ~c
<tsmod.json>
: create src by a tsmod.json file. -
config
<option>
: create config file of typescript or webpack.
# create workspace mkdir <projectFolder> cd <projectFolder> # init project. saber-tsmod init # create module and test file. saber-tsmod create <module>saber-tsmod create ~c # for example: saber-tsmod create hello saber-tsmod create shop/shop.servicesaber-tsmod create shop/shop.controllersaber-tsmod create shop/shop.module saber-tsmod create shop/shop.service shop/shop.controller shop/shop.module saber-tsmod create ~c tsmod.json # create config file # tsconfig.json saber-tsmod config ts# webpack.config.json saber-tsmod config webpack
for example(tsmod.json)
start
# install the typescript and webpack. npm install
# auto compile to commonjs. npm start # auto compile to es5. npm run dev
Author: saber2pr(AK-12)
develope and test
you should write ts in /src
ts -(tsc)-> commonjs -(webpack)-> es5
you should make test in /src/test
export your core in /src/index.ts!
publish
Before publish, there are some items in package.json should to be updated below:
- name
- version
- description
- repository(url)
- author
# if all is well, try: npm publish