saber-tsmod
v1.6.5
Published
a cli for ts dev.
Downloads
45
Readme
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.service
saber-tsmod create shop/shop.controller
saber-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)
[
"users/controller.ts",
"users/service.ts",
"users/module.ts",
"shop/controller.ts",
"shop/service.ts",
"shop/module.ts"
]
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