jbi v0.1.14
JBI: Just Build It
I was tired of adding all the config necessary to build a Typescript project. So, I wrote this command line utility that incorporates all of it.
Getting Started
Add it as a dev dependency.
yarn add --dev jbi
Initialize any missing configuration. Also adds @babel/runtime-corejs3
to your dependencies for environment polyfills.
yarn jbi init
# If you want to add a Webpack configuration...
yarn jbi init --webpack
Test the project (also runs init). Includes type checking (tsc
), linting (eslint
+ prettier
), and unit testing (jest
). Args are passed through to Jest.
yarn jbi test
Build the project (also runs init). Creates libraries (babel
+ tsc
) or Webpack bundles (webpack
). Args to the cjs
and es6
commands are passed through to Babel. Args to the web
command are passed through to Webpack.
yarn jbi # Build with output type auto-detection.
yarn jbi lib # Build both CommonJS and ES6 libraries.
yarn jbi cjs # Build a CommonJS library.
yarn jbi es6 # Build an ES6 library.
yarn jbi web # Build Webpack bundles.
yarn jbi web serve # Start the Webpack dev server.
Tools
Includes all the dependencies and the minimal configuration you need for...
- Typescript
- Babel
- Webpack
- Jest
- ESLint
- Prettier
Versions should be updated regularly. Please open a Github issue if a dependency is out of date.
Configuration
Creates default configuration for the above tools when no current configuration is found. Once configuration is initialized, you can modify as needed.
Assumptions
- Target environments are indicated by a "browserslist" array in your
package.json
file. - Legacy environments should be polyfilled using
@babel/runtime-corejs3
. - Un-compiled source is in the
./src
directory. - Library output directories are indicated by
package.json
file "main" and "module" entries.