3 Star 6 Fork 1

小弟调调 / tsbb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

tsbb

Build & Deploy NPM Downloads Open in unpkg npm version

Quick Start · Example · Command Help · npm · License

TSBB is a zero-config CLI that helps you develop, test, and publish modern TypeScript Node.js 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, vue 3 component compilation.
  • Jest test runner setup with defaults tsbb test
  • 🔥 Zero-config, single dependency.

Quick Start

You will need Node.js installed on your system.

$ 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 initialize the project from one of the examples:

$ npx create-tsbb my-app -e <Example Name>
# --- E.g: ----------------┴ˇˇˇˇˇˇˇˇˇˇˇˇˇˇ
# npx create-tsbb my-app -e Basic

You can download the following examples directly. Download page.

Command Help

Below is a help of commands you might find useful.

tsbb

▶ tsbb --help

Usage: tsbb <command>

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 to create an example.

tsbb test

Runs the test watcher (Jest) in an interactive mode.

$ tsbb test                          Run test suites related
$ tsbb test --coverage --no-color    Test coverage information should be collected
export declare type Argv = Arguments<Partial<{
  all: boolean;
  automock: boolean;
  bail: boolean | number;
  cache: boolean;
  cacheDirectory: string;
  changedFilesWithAncestor: boolean;
  changedSince: string;
  ci: boolean;
  clearCache: boolean;
  clearMocks: boolean;
  collectCoverage: boolean;
  collectCoverageFrom: string;
  collectCoverageOnlyFrom: Array<string>;
  color: boolean;
  colors: boolean;
  config: string;
  coverage: boolean;
  coverageDirectory: string;
  coveragePathIgnorePatterns: Array<string>;
  coverageReporters: Array<string>;
  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<string>;
  moduleFileExtensions: Array<string>;
  moduleNameMapper: string;
  modulePathIgnorePatterns: Array<string>;
  modulePaths: Array<string>;
  noStackTrace: boolean;
  notify: boolean;
  notifyMode: string;
  onlyChanged: boolean;
  onlyFailures: boolean;
  outputFile: string;
  preset: string | null | undefined;
  projects: Array<string>;
  prettierPath: string | null | undefined;
  resetMocks: boolean;
  resetModules: boolean;
  resolver: string | null | undefined;
  restoreMocks: boolean;
  rootDir: string;
  roots: Array<string>;
  runInBand: boolean;
  selectProjects: Array<string>;
  setupFiles: Array<string>;
  setupFilesAfterEnv: Array<string>;
  showConfig: boolean;
  silent: boolean;
  snapshotSerializers: Array<string>;
  testEnvironment: string;
  testFailureExitCode: string | null | undefined;
  testMatch: Array<string>;
  testNamePattern: string;
  testPathIgnorePatterns: Array<string>;
  testPathPattern: Array<string>;
  testRegex: string | Array<string>;
  testResultsProcessor: string;
  testRunner: string;
  testSequencer: string;
  testURL: string;
  testTimeout: number | null | undefined;
  timers: string;
  transform: string;
  transformIgnorePatterns: Array<string>;
  unmockedModulePathPatterns: Array<string> | null | undefined;
  updateSnapshot: boolean;
  useStderr: boolean;
  verbose: boolean;
  version: boolean;
  watch: boolean;
  watchAll: boolean;
  watchman: boolean;
  watchPathIgnorePatterns: Array<string>;
}>>;

Development

$ npm i
$ npm run hoist
$ npm run build

Contributors

As always, thanks to our amazing contributors!

Made with github-action-contributors.

License

MIT © Kenny Wong

MIT License Copyright (c) 2019 小弟调调™ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

TSBB是一个零配置CLI,可帮助您开发,测试和发布现代 TypeScript 项目。 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/jaywcjlove/tsbb.git
git@gitee.com:jaywcjlove/tsbb.git
jaywcjlove
tsbb
tsbb
master

搜索帮助