https://github.com/saber2pr/saber-tsmod
a cli for typescript dev.
https://github.com/saber2pr/saber-tsmod
cli file module typescript
Last synced: 6 months ago
JSON representation
a cli for typescript dev.
- Host: GitHub
- URL: https://github.com/saber2pr/saber-tsmod
- Owner: Saber2pr
- License: mit
- Created: 2019-01-12T13:32:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-11T08:21:07.000Z (over 7 years ago)
- Last Synced: 2025-03-27T11:43:44.156Z (over 1 year ago)
- Topics: cli, file, module, typescript
- Language: TypeScript
- Homepage:
- Size: 183 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# saber-tsmod
[](https://github.com/Microsoft/TypeScript)
[](https://www.npmjs.com/package/saber-tsmod)
[](https://github.com/Saber2pr/saber-tsmod/blob/master/LICENSE)
[](https://github.com/Saber2pr/saber-tsmod)
> a cli for ts dev.
> publish your ts module to npm!
```bash
npm install saber-tsmod -g
```
## Usage:
1. init: init the project files.
2. create ``: create a new ts module file and its test file.
3. create ~c ``: create src by a tsmod.json file.
4. config ``: create config file of typescript or webpack.
---
```bash
# create workspace
mkdir
cd
# init project.
saber-tsmod init
# create module and test file.
saber-tsmod create
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)
```json
[
"users/controller.ts",
"users/service.ts",
"users/module.ts",
"shop/controller.ts",
"shop/service.ts",
"shop/module.ts"
]
```
---
## start
```bash
# install the typescript and webpack.
npm install
```
```bash
# 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:
1. name
2. version
3. description
4. repository(url)
5. author
```bash
# if all is well, try:
npm publish
```