# tsbb
**Repository Path**: jaywcjlove/tsbb
## Basic Information
- **Project Name**: tsbb
- **Description**: TSBB是一个零配置CLI,可帮助您开发,测试和发布现代 TypeScript 项目。
- **Primary Language**: TypeScript
- **License**: MIT
- **Default Branch**: master
- **Homepage**: https://npm.im/tsbb
- **GVP Project**: No
## Statistics
- **Stars**: 6
- **Forks**: 1
- **Created**: 2019-05-13
- **Last Updated**: 2022-02-24
## Categories & Tags
**Categories**: code-generator
**Tags**: None
## README
[](https://github.com/jaywcjlove/tsbb)
Quick Start ·
Example ·
Command Help ·
npm ·
License
TSBB is a zero-config CLI that helps you develop, test, and publish modern TypeScript [Node.js](https://nodejs.org/en/) project.
`TypeScript + Babel` = `TSBB`
#### `Features`
- ⏱ Quickly initialize the example project and quickly enter the development mode.
- ♻️ Recompile the code when project files get added, removed or modified.
- 📚 Readable source code that encourages learning and contribution
- 🚀 Faster, Faster compilation speed.
- ⚛️ Support [react](https://reactjs.org/), [vue 3](https://vuejs.org/) component compilation.
- ⛑ [Jest](https://jestjs.io/) test runner setup with defaults `tsbb test`
- 🔥 Zero-config, single dependency.
## Quick Start
You will need `Node.js` installed on your system.
```shell
$ yarn create tsbb [appName]
# or npm
$ npm create tsbb my-app -e express
# --- Example name ---------┴ˇˇˇˇˇˇ
# or npx
$ npx create-tsbb my-app -e koa
# npm 6.x
$ npm init tsbb my-app --example express-typeorm
# npm 7+, extra double-dash is needed:
$ npm init tsbb my-app -- --example express-typeorm
$ cd my-project
$ npm run watch # Listen compile .ts files.
$ npm run build # compile .ts files.
$ npm start
```
## Example
[create-tsbb](https://github.com/jaywcjlove/tsbb/tree/master/packages/create-tsbb) initialize the project from one of the examples:
```shell
$ npx create-tsbb my-app -e
# --- E.g: ----------------┴ˇˇˇˇˇˇˇˇˇˇˇˇˇˇ
# npx create-tsbb my-app -e Basic
```
You can download the following examples directly. [Download page](https://jaywcjlove.github.io/tsbb).
- [**`Basic`**](https://github.com/jaywcjlove/tsbb/tree/master/example/basic) - The [Node.js](https://nodejs.org/en/) base application example.
- [**`Express`**](https://github.com/jaywcjlove/tsbb/tree/master/example/express) - The [Express](https://expressjs.com/) base application example.
- [**`express-typeorm`**](https://github.com/jaywcjlove/tsbb/tree/master/example/express-typeorm) - The [Express](https://expressjs.com/) & [TypeORM](https://github.com/typeorm/typeorm) base application example.
- [**`Koa`**](https://github.com/jaywcjlove/tsbb/tree/master/example/koa) - The [Koa](https://koajs.com/) base application example.
- [**`Hapi`**](https://github.com/jaywcjlove/tsbb/tree/master/example/hapi) - The [Hapi](https://hapijs.com/) base application example.
- [**`react-component`**](https://github.com/jaywcjlove/tsbb/tree/master/example/react-component) - The react component base application example.
- [**`react-component-tsx`**](https://github.com/jaywcjlove/tsbb/tree/master/example/react-component-tsx) - The react component and website base application example.
- [**`transform-typescript`**](https://github.com/jaywcjlove/tsbb/tree/master/example/transform-typescript) - Reconfigure the babel configuration example.
- [**`umd`**](https://github.com/jaywcjlove/tsbb/tree/master/example/umd) - umd bundle example.
- [**`vue 3`**](https://github.com/jaywcjlove/tsbb/tree/master/example/vue) - To add Vue JSX support.
## Command Help
Below is a help of commands you might find useful.
### `tsbb`
```shell
▶ tsbb --help
Usage: tsbb
Commands:
tsbb build [options] Build your project once and exit.
tsbb watch [options] Recompile files on changes.
tsbb test [options] Run jest test runner in watch mode.
Options:[build|watch]
--entry, -e Specify the entry directory.
--env-name The current active environment used during configuration loading.
--emit-type Emit d.ts type files.
--no-emit-type No emit d.ts type files.
--disable-babel Disable Babel.
--no-babel-option Disable Babel Option.
--file-names, -f A set of root files.
--esm Output "esm" directory.
--cjs Output "cjs" directory.
Options:
--version, -v Show version number
--help, -h Show help
Examples:
$ tsbb build Build your project.
$ tsbb build --entry src/index.ts Specify the entry directory.
$ tsbb build --esm ./es Output directory.
$ tsbb build --use-vue To add Vue JSX support.
$ tsbb build --no-source-maps No ".js.map" file is generated. (Can't disable babel)
$ tsbb watch --disable-babel Disable Babel.
$ tsbb watch --no-emit-type No emit d.ts type files.
$ tsbb watch --no-babel-option Disable Babel Option.
$ tsbb watch --babel-option '{"presets": ["@babel/preset-typescript"] }'
Babel Option.
$ tsbb watch --cjs ./cjs Watch Output directory.
$ tsbb build --disable-babel --file-names src/index.ts --file-names src/main.ts
A set of root files.
$ tsbb test Run test suites related
$ tsbb test --coverage Test coverage information should be collected
Copyright 2022
```
### ~~`tsbb create`~~
Please use [create-tsbb](https://github.com/jaywcjlove/tsbb/tree/master/packages/create-tsbb) to create an example.
### `tsbb test`
Runs the test watcher ([Jest](https://jestjs.io/docs/cli)) in an interactive mode.
```shell
$ tsbb test Run test suites related
$ tsbb test --coverage --no-color Test coverage information should be collected
```
```ts
export declare type Argv = Arguments;
color: boolean;
colors: boolean;
config: string;
coverage: boolean;
coverageDirectory: string;
coveragePathIgnorePatterns: Array;
coverageReporters: Array;
coverageThreshold: string;
debug: boolean;
env: string;
expand: boolean;
findRelatedTests: boolean;
forceExit: boolean;
globals: string;
globalSetup: string | null | undefined;
globalTeardown: string | null | undefined;
haste: string;
init: boolean;
injectGlobals: boolean;
json: boolean;
lastCommit: boolean;
logHeapUsage: boolean;
maxWorkers: number | string;
moduleDirectories: Array;
moduleFileExtensions: Array;
moduleNameMapper: string;
modulePathIgnorePatterns: Array;
modulePaths: Array;
noStackTrace: boolean;
notify: boolean;
notifyMode: string;
onlyChanged: boolean;
onlyFailures: boolean;
outputFile: string;
preset: string | null | undefined;
projects: Array;
prettierPath: string | null | undefined;
resetMocks: boolean;
resetModules: boolean;
resolver: string | null | undefined;
restoreMocks: boolean;
rootDir: string;
roots: Array;
runInBand: boolean;
selectProjects: Array;
setupFiles: Array;
setupFilesAfterEnv: Array;
showConfig: boolean;
silent: boolean;
snapshotSerializers: Array;
testEnvironment: string;
testFailureExitCode: string | null | undefined;
testMatch: Array;
testNamePattern: string;
testPathIgnorePatterns: Array;
testPathPattern: Array;
testRegex: string | Array;
testResultsProcessor: string;
testRunner: string;
testSequencer: string;
testURL: string;
testTimeout: number | null | undefined;
timers: string;
transform: string;
transformIgnorePatterns: Array;
unmockedModulePathPatterns: Array | null | undefined;
updateSnapshot: boolean;
useStderr: boolean;
verbose: boolean;
version: boolean;
watch: boolean;
watchAll: boolean;
watchman: boolean;
watchPathIgnorePatterns: Array;
}>>;
```
## Development
```bash
$ npm i
$ npm run hoist
$ npm run build
```
## Contributors
As always, thanks to our amazing contributors!
Made with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).
## License
MIT © [Kenny Wong](https://wangchujiang.com)