# bndl

[![crates.io](https://img.shields.io/crates/v/bndl_cli.svg)](https://crates.io/crates/bndl_cli)
[![npm](https://img.shields.io/npm/v/bndl-cli)](https://www.npmjs.com/package/bndl-cli)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/segersniels/bndl/bin.yml)

Introducing `bndl`, a basic TypeScript transpiling and bundling tool for (primarily backend) monorepos. It uses [SWC](https://swc.rs/) under the hood so it benefits from the speed improvements that it brings over `tsc`.

<p align="center">
<img src="https://github.com/segersniels/bndl/blob/master/resources/bndl.png?raw=true" width="250">

It aims to be a near drop in replacement for people already accustomed to `tsc` and uses the `tsconfig.json` already present in your project. `bndl` goes through the monorepo, builds the current app (or package) with `swc`, identifies which dependencies are used by the consumer and copies them over to the compiled directory `node_modules` of said consumer.

The result? A `dist` that contains everything for your app to run. Simply copy the `dist` over to a Docker image and run it. Read more about it [here](https://niels.foo/post/typescript-monorepo-bundling-for-dummies).

## Installing

### cargo

```bash
$ cargo install bndl_cli
```

### npm

```bash
$ npm install -g bndl-cli
```

### curl

```bash
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/segersniels/bndl/master/scripts/install.sh)"
```

### wget

```bash
$ sh -c "$(wget https://raw.githubusercontent.com/segersniels/bndl/master/scripts/install.sh -O -)"
```

## Contributing

Expect a lot of missing functionality and potential things breaking. This was made with a specific use case in mind and there might be cases where functionality drifts from what you might need. Feel free to make issues or PRs adding your requested functionality.

Please provide the provided panic log or debug logging with `RUST_LOG=debug bndl ...` so your issue can get resolved quicker.
