{"id":22070526,"url":"https://github.com/bconnorwhite/bob","last_synced_at":"2025-07-24T08:36:12.650Z","repository":{"id":38426557,"uuid":"250695518","full_name":"bconnorwhite/bob","owner":"bconnorwhite","description":"Bob is a toolkit for TypeScript projects","archived":false,"fork":false,"pushed_at":"2023-02-03T12:13:00.000Z","size":1819,"stargazers_count":4,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-10T09:40:59.580Z","etag":null,"topics":["babel","bob","docker","node","nodejs","react","typescript","watch"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bconnorwhite.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-28T02:17:34.000Z","updated_at":"2023-01-07T16:01:45.000Z","dependencies_parsed_at":"2023-02-06T12:01:32.355Z","dependency_job_id":null,"html_url":"https://github.com/bconnorwhite/bob","commit_stats":null,"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bconnorwhite%2Fbob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bconnorwhite%2Fbob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bconnorwhite%2Fbob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bconnorwhite%2Fbob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bconnorwhite","download_url":"https://codeload.github.com/bconnorwhite/bob/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227422438,"owners_count":17775016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel","bob","docker","node","nodejs","react","typescript","watch"],"created_at":"2024-11-30T20:17:05.617Z","updated_at":"2024-11-30T20:17:06.284Z","avatar_url":"https://github.com/bconnorwhite.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/237/male-construction-worker_1f477-200d-2642-fe0f.png\" srcset=\"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/apple/237/male-construction-worker_1f477-200d-2642-fe0f.png 2x\" alt=\"Man Construction Worker on Apple iOS 13.3\" width=\"80\" height=\"80\"\u003e\n  \u003ch1\u003e@bconnorwhite/bob\u003c/h1\u003e\n  \u003ca href=\"https://npmjs.com/package/@bconnorwhite/bob\"\u003e\n    \u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/@bconnorwhite/bob.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/bconnorwhite/bob\"\u003e\n    \u003cimg alt=\"typescript\" src=\"https://img.shields.io/github/languages/top/bconnorwhite/bob.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href='https://coveralls.io/github/bconnorwhite/bob?branch=master'\u003e\n    \u003cimg alt=\"Coverage Status\" src=\"https://img.shields.io/coveralls/github/bconnorwhite/bob.svg?branch=master\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/bconnorwhite/bob\"\u003e\n    \u003cimg alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/bconnorwhite/bob?label=Stars%20Appreciated%21\u0026style=social\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://twitter.com/bconnorwhite\"\u003e\n    \u003cimg alt=\"Twitter Follow\" src=\"https://img.shields.io/twitter/follow/bconnorwhite.svg?label=%40bconnorwhite\u0026style=social\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003e Bob is a toolkit for TypeScript projects.\n\nBob provides a set of tools for developing TypeScript projects for both Node and the browser (React) without having to think about `tsc` or `babel`.\n\nBob works with zero configuration, does not require `babel.config.json`, and will auto-generate the correct `tsconfig.json` file.\n\n## Installation\n\n```bash\nyarn add @bconnorwhite/bob\n```\n\n```bash\nnpm install @bconnorwhite/bob\n```\n\n\u003cbr /\u003e\n\n## Project Structure\n\n### build, watch, clean, list\n\nBob assumes your source files are in `./src`. Build files (.js) and type declaration files (.d.ts) will be output to `./build`.\n\nBob only builds `.ts` and `.tsx` files, but he will copy over any other file types.\n\n### start, dev\n\nBob will run `main` as defined in your package.json.\n\n### docker\n\nFor a single environment, use:\n  - `./docker-compose.yml`\n  - `./Dockerfile`\n\nFor multiple environments, use:\n  - `./docker/${NODE_ENV}/docker-compose.yml`\n  - `./docker/${NODE_ENV}/Dockerfile`\n\n`bob docker build` will build the appropriate Dockerfile based on `NODE_ENV`.\n`bob docker up` will start docker-compose with the appropriate YAML file based on `NODE_ENV`.\n\n`NODE_ENV` may be defined in `.env` or passed to bob on the command line.\n\n\u003cbr /\u003e\n\n## CLI\n\n### bob\n```\nUsage: bob [options] [command]\n\nOptions:\n  -v --version     output the version number\n  -h, --help       display help for command\n\nCommands:\n  init             initialize source, package.json, .gitignore, tsconfig.json, README.md, .cz.json\n  build [options]  build and output type declaration files\n  watch            watch source files and build after changes\n  start [options]  start the script defined in the main field of package.json\n  dev [options]    start with NODE_ENV set to 'development' and watch for changes\n  lint             lint package.json and source files\n  test             run tests\n  commit           create a conventional commit\n  docker           run docker commands\n  count            count lines across source files\n  list             list files included in build\n  help [command]   display help for command\n```\n### bob init\n```\nUsage: bob init [options] [command]\n\ninitialize source, package.json, .gitignore, and tsconfig.json\n\nOptions:\n  -h, --help    display help for command\n\nCommands:\n  source        initialize source directory\n  package-json  initialize package.json\n  gitignore     initialize git repo\n  tsconfig      initialize tsconfig.json\n```\n### bob build\n```\nUsage: bob build [options] [command]\n\nbuild and output type declaration files\n\nOptions:\n  -w --watch        watch files for changes\n  -s --silent       silent output\n  -h, --help        display help for command\n\nCommands:\n  source [options]  build source files\n  types [options]   output type declaration files\n```\n### bob watch\n```\nUsage: bob watch [options] [command]\n\nwatch source files and build after changes\n\nOptions:\n  -h, --help  display help for command\n\nCommands:\n  source      build source files after changes\n  types       output type declarations after changes\n```\n### bob start\n```\nUsage: bob start [options]\n\nstart the script defined in the main field of package.json\n\nOptions:\n  -d --dev                 set NODE_ENV to 'development' and watch for changes\n  -i --ignore [ignore...]  files or directories to ignore for restart\n  -h, --help               display help for command\n```\n### bob dev\n```\nUsage: bob dev [options]\n\nstart with NODE_ENV set to 'development' and watch for changes\n\nOptions:\n  -i --ignore [ignore...]  files or directories to ignore for restart\n  -h, --help               display help for command\n```\n### bob commit\n```\nUsage: bob commit [options]\n\ncreate a conventional commit\n\nOptions:\n  -h, --help  display help for command\n```\n### bob lint\n```\nUsage: bob lint [options] [command]\n\nlint package.json and source files\n\nOptions:\n  -h, --help  display help for command\n\nCommands:\n  package     lint package.json\n  source      lint source files with ESLint\n```\n### bob test\n```\nUsage: bob test [options]\n\nrun tests\n\nOptions:\n  -h, --help  display help for command\n```\n### bob docker\n```\nUsage: bob docker [options] [command]\n\nrun docker commands\n\nOptions:\n  -h, --help                 display help for command\n\nCommands:\n  build [options] \u003ccontext\u003e  run docker build on Dockerfile\n  up [options]               run docker-compose up on docker-compose.yml\n  help [command]             display help for command\n```\n### bob count\n```\nUsage: bob count [options]\n\ncount lines across source files\n\nOptions:\n  -h, --help  display help for command\n```\n### bob list\n```\nUsage: bob list [options]\n\nlist files included in build\n\nOptions:\n  -h, --help  display help for command\n```\n\n\u003cbr /\u003e\n\n## run-env\n\nBob also includes [@bconnorwhite/run-env](https://www.npmjs.com/package/@bconnorwhite/run-env), which allows for running package.json scrips suffixed by the beginning characters of `NODE_ENV`.\n\nFor example, to run a script called `build:dev` or `build:prod`:\n```sh\nyarn run-env build\n\n# If NODE_ENV=development:\n# this will run scripts like 'build:dev' or 'build:development'\n# If NODE_ENV=production:\n# this will run scripts like 'build:prod' or 'build:production'\n```\nSuffixes must be at least 3 characters, as long as they match the first characters of `NODE_ENV`.\n\nFor full documentation visit https://www.npmjs.com/package/@bconnorwhite/run-env.\n\n\u003cbr /\u003e\n\n## Build Configuration\n\nThe eqivalent of Bob's babel.config.json:\n```json\n{\n  \"presets\": [\n    \"@babel/preset-typescript\",\n    [\n      \"@babel/preset-env\", {\n        \"loose\": true,\n        \"exclude\": [\n          \"@babel/plugin-transform-regenerator\"\n        ]\n      }\n    ],\n    \"@babel/preset-react\"\n  ]\n}\n```\n\nThe equivalent of Bob's tsconfig.json:\n```json\n{\n  \"compilerOptions\": {\n    \"declaration\": true,\n    \"emitDeclarationOnly\": true,\n    \"esModuleInterop\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"jsx\": \"preserve\",\n    \"lib\": [\n      \"dom\",\n      \"esnext\"\n    ],\n    \"module\": \"commonjs\",\n    \"noFallthroughCasesInSwitch\": true,\n    \"noUnusedLocals\": true,\n    \"outDir\": \"build\",\n    \"removeComments\": true,\n    \"resolveJsonModule\": true,\n    \"skipLibCheck\": true,\n    \"strict\": true,\n    \"target\": \"esnext\"\n  },\n  \"include\": [\n    \"source\"\n  ]\n}\n```\n\n\u003cbr /\u003e\n\n## API\n\nBob includes an easily composable API for including its commands:\n\n```ts\nimport { program } from \"commander\";\nimport {\n  initCommand,\n  buildCommand,\n  watchCommand,\n  startCommand,\n  devCommand,\n  dockerCommand,\n  countCommand,\n  listCommand\n} from \"@bconnorwhite/bob\";\n\n// These can easily be used as commander commands\n\nprogram\n  .addCommand(initCommand)\n  .addCommand(buildCommand)\n  .addCommand(watchCommand)\n  .addCommand(startCommand)\n  .addCommand(devCommand)\n  .addCommand(dockerCommand)\n  .addCommand(countCommand)\n  .addCommand(listCommand)\n  .parse();\n\n```\nYou can also run the actions programmatically:\n```ts\nimport {\n  initAction,\n  buildAction,\n  watchAction,\n  startAction,\n  devAction,\n  dockerizeAction,\n  dockerBuildAction,\n  countAction,\n  listAction\n} from \"@bconnorwhite/bob\";\n\n// These can be used as commander commands\n\n// equivalent of `bob init`\ninitAction();\n\n// equivalent of `bob build`\nbuildAction({\n  watch: false\n});\n\n// equivalent of `bob watch`\nwatchAction();\n\n// equivalent of `bob clean`\ncleanAction();\n\n// equivalent of `bob start`\nstartAction({\n  dev: false\n});\n\n// equivalent of `bob dev`\ndevAction();\n\n// equivalent of `bob dockerize`\ndockerizeAction();\n\n// equivalent of `bob docker-build`\ndockerBuildAction();\n\n// equivalent of `bob count`\ncountAction();\n\n// equivalent of `bob list`\nlistAction();\n```\n\n\u003cbr /\u003e\n\n\u003ch2\u003eDependencies\u003cimg align=\"right\" alt=\"dependencies\" src=\"https://img.shields.io/david/bconnorwhite/bob.svg\"\u003e\u003c/h2\u003e\n\n- [@babel/cli](https://npmjs.com/package/@babel/cli): Babel command line.\n- [@babel/core](https://npmjs.com/package/@babel/core): Babel compiler core.\n- [@babel/preset-env](https://npmjs.com/package/@babel/preset-env): A Babel preset for each environment.\n- [@babel/preset-react](https://npmjs.com/package/@babel/preset-react): Babel preset for all React plugins.\n- [@babel/preset-typescript](https://npmjs.com/package/@babel/preset-typescript): Babel preset for TypeScript.\n- [@bconnorwhite/exec](https://npmjs.com/package/@bconnorwhite/exec): Execute commands while keeping flags easily configurable as an object\n- [@bconnorwhite/package](https://npmjs.com/package/@bconnorwhite/package): A utility for reading package.json of a project, and forming paths relative to it.\n- [@bconnorwhite/run-env](https://npmjs.com/package/@bconnorwhite/run-env): Run package.json scripts suffixed with NODE_ENV.\n- [chokidar](https://npmjs.com/package/chokidar): A neat wrapper around node.js fs.watch / fs.watchFile / fsevents.\n- [commander-version](https://npmjs.com/package/commander-version): A wrapper for Commander that automatically sets the version based on your package.json\n- [dotenv](https://npmjs.com/package/dotenv): Loads environment variables from .env file\n- [find](https://npmjs.com/package/find): Find files or directories by name\n- [inquirer](https://npmjs.com/package/inquirer): A collection of common interactive command line user interfaces.\n- [nodemon](https://npmjs.com/package/nodemon): Simple monitor script for use during development of a node.js app.\n- [ora](https://npmjs.com/package/ora): Elegant terminal spinner\n- [package-run](https://npmjs.com/package/package-run): Programmatically run package.json scripts. Supports yarn, npm, and pnpm.\n- [typescript](https://npmjs.com/package/typescript): TypeScript is a language for application scale JavaScript development\n- [wait-on](https://npmjs.com/package/wait-on): Wait-on is a cross platform command line utility and Node.js API which will wait for files, ports, sockets, and http(s) resources to become available\n- [which-pm-lockfile](https://npmjs.com/package/which-pm-lockfile): Check if a project uses yarn, npm, or pnpm. Supports yarn workspaces.\n\n##\n\n\u003cbr /\u003e\n\n\u003ch2\u003eDev Dependencies\u003cimg align=\"right\" alt=\"David\" src=\"https://img.shields.io/david/dev/bconnorwhite/bob.svg\"\u003e\u003c/h2\u003e\n\n- [@types/find](https://npmjs.com/package/@types/find): TypeScript definitions for find\n- [@types/inquirer](https://npmjs.com/package/@types/inquirer): TypeScript definitions for inquirer\n- [@types/node](https://npmjs.com/package/@types/node): TypeScript definitions for Node.js\n- [@types/nodemon](https://npmjs.com/package/@types/nodemon): TypeScript definitions for nodemon\n- [@types/wait-on](https://npmjs.com/package/@types/wait-on): TypeScript definitions for wait-on\n- [jest](https://npmjs.com/package/jest): Delightful JavaScript Testing.\n- [npm-package-json-lint](https://npmjs.com/package/npm-package-json-lint): Configurable linter for package.json files.\n\n##\n\n\u003cbr /\u003e\n\n\u003ch2\u003eLicense \u003cimg align=\"right\" alt=\"license\" src=\"https://img.shields.io/npm/l/@bconnorwhite/bob.svg\"\u003e\u003c/h2\u003e\n\n[MIT](https://mit-license.org/)\n\n\u003cbr /\u003e\n\n## Related Packages:\n\n- [@bconnorwhite/exec](https://npmjs.com/package/@bconnorwhite/exec): Execute commands while keeping flags easily configurable as an object\n- [@bconnorwhite/package](https://npmjs.com/package/@bconnorwhite/package): A utility for reading package.json of a project, and forming paths relative to it.\n- [@bconnorwhite/run-env](https://npmjs.com/package/@bconnorwhite/run-env): Run package.json scripts suffixed with NODE_ENV.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbconnorwhite%2Fbob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbconnorwhite%2Fbob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbconnorwhite%2Fbob/lists"}