@bconnorwhite/bob
Bob builds and watches typescript projects. He'll even clean up your build directory when you delete or move files.
Last updated a month ago by bconnorwhite .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @bconnorwhite/bob 
SYNC missed versions from official npm registry.

@bconnorwhite/bob

dependencies minzipped size typescript npm

Bob builds and watches typescript projects. He'll even clean up your build directory when you delete or move files.

yarn add @bconnorwhite/bob

Bob is also highly opinionated.

  • Your source directory must be ./src
  • Your build directory must be ./build
  • Bob only builds .ts and .tsx files, but he will copy over any other file types.

Commands

bob
Usage: bob [options] [command]

Options:
  -V, --version    output the version number
  -h, --help       display help for command

Commands:
  build [options]
  watch [options]
  clean
  help [command]   display help for command
bob build
Usage: bob build [options]

Options:
  -b --build        Only output build files
  -d --declaration  Only output declaration files
  -w --watch        Watch files for changes
  -h, --help        display help for command
bob watch
Usage: bob watch [options]

Options:
  -b --build        Only output build files
  -d --declaration  Only output declaration files
  -h, --help        display help for command
bob clean
Usage: bob clean [options]

Options:
  -h, --help  display help for command

Here is Bob's babel.config.json:

{
  "presets": [
    "@babel/preset-typescript",
    "@babel/preset-env",
    "@babel/preset-react"
  ],
  "plugins": [
    "@babel/plugin-transform-runtime"
  ]
}

Here is Bob's tsconfig.json:

{
  "compilerOptions": {
    "declaration": true,
    "emitDeclarationOnly": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "jsx": "preserve",
    "lib": [
      "dom",
      "esnext"
    ],
    "module": "esnext",
    "moduleResolution": "node",
    "noFallthroughCasesInSwitch": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "outDir": "./build",
    "removeComments": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "strict": true,
    "target": "esnext"
  },
  "include": [
    "./src/*.ts*"
  ]
}

API

import { program } from "commander";
import { build, watch, clean } from "@bconnorwhite/bob";

// These can be used as commander commands

build(); // program.command("build")...
watch(); // program.command("watch")...
clean(); // program.command("clean")...

program.parse(process.argv);

You can also run the actions, rather than adding to a commander program:

import { buildAction, watchAction, cleanAction } from "@bconnorwhite/bob";

// These can be used as commander commands

// equivalent of `bob build`
buildAction({
  build: true,
  declaration: true,
  watch: false
});

// equivalent of `bob watch`
watchAction({
  build: true,
  declaration: true
});

// equivalent of `bob clean`
cleanAction();

Current Tags

  • 1.4.0                                ...           latest (a month ago)

19 Versions

  • 1.4.0                                ...           a month ago
  • 1.3.5                                ...           a month ago
  • 1.3.4                                ...           a month ago
  • 1.3.3                                ...           a month ago
  • 1.3.2                                ...           a month ago
  • 1.3.1                                ...           a month ago
  • 1.3.0                                ...           a month ago
  • 1.2.3                                ...           a month ago
  • 1.2.2                                ...           2 months ago
  • 1.2.1                                ...           2 months ago
  • 1.2.0                                ...           2 months ago
  • 1.1.0                                ...           2 months ago
  • 1.0.7                                ...           2 months ago
  • 1.0.6                                ...           2 months ago
  • 1.0.5                                ...           2 months ago
  • 1.0.4                                ...           2 months ago
  • 1.0.3                                ...           2 months ago
  • 1.0.2                                ...           2 months ago
  • 1.0.1                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 19
Last Day 0
Last Week 19
Last Month 94
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |