Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RajaRakoto/bun-boilerplate
Minimalistic boilerplate to quick-start Bun.js development in TypeScript ๐
https://github.com/RajaRakoto/bun-boilerplate
boilerplate bun bunjs minimalist starter template typescript
Last synced: 4 months ago
JSON representation
Minimalistic boilerplate to quick-start Bun.js development in TypeScript ๐
- Host: GitHub
- URL: https://github.com/RajaRakoto/bun-boilerplate
- Owner: RajaRakoto
- License: mit
- Created: 2024-02-05T17:40:51.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-08-08T12:28:59.000Z (5 months ago)
- Last Synced: 2024-08-08T15:18:04.146Z (5 months ago)
- Topics: boilerplate, bun, bunjs, minimalist, starter, template, typescript
- Language: JavaScript
- Homepage:
- Size: 543 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bun-boilerplate ๐
[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/for-you.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/open-source.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/uses-git.svg)](https://forthebadge.com) [![forthebadge](https://github.com/RajaRakoto/github-docs/blob/master/badge/build-by.svg?raw=true)](https://forthebadge.com)
![Git](https://img.shields.io/badge/-Git-777?style=flat&logo=git&logoColor=F05032&labelColor=ffffff) ![Gitub](https://img.shields.io/badge/-Gitub-777?style=flat&logo=github&logoColor=777&labelColor=ffffff)
**Developer Ready: A comprehensive template. Works out of the box for most Bun.js projects. This project is intended to be used with the latest active LTS release of Bun.js.**
Instant Value - All basic tools included and configured:
- ๐ Typescript >= 5.3
- ๐ง Bun.js >= 1.0.26
- ๐ง Use Bun as package manager
- ๐ ESM
- ๐งช Biome for code formatting and linting
- โ Jest or Bun test for fast unit testing and code coverage
- ๐ Type definitions for Bun.js and Jest
- โ๏ธ EditorConfig for consistent coding style
- ๐ฆ NPM scripts for common operations
- ๐ ๏ธ Example configuration for GitHub Actions
- ๐ Simple example of TypeScript code and unit test
- ๐ Run tasks with Grunt (example for backup)
- ๐ Build faster
- ๐ฅ๏ธ Ungit for version control (git) with a GUI
- ๐ Runtime library for TypeScript helpers with tslib
- ๐๏ธ Utility functions for working with ts-api-utils---
### ๐ Usage
To use this template, use the following commands:
```bash
bun create github.com/RajaRakoto/bun-boilerplate
cd
bun run pkg-upgrade # to upgrade outdated dependencies in interactive mode
```> NOTE 1: I employ the `MIT license` for this starter kit, which includes my name and GitHub profile. Please remember to adjust or remove it if deemed unnecessary.
> NOTE 2: In order to help you better understand the structure of this boilerplate, there is a `README.md` file in each subdirectory of src.
> NOTE 3: For certain configurations in the `package.json` file, you need to modify them to tailor them to your project (e.g: name, description, author, keywords, main, repository, ...).
---
### ๐ NPM Scripts
**Start**
- ๐ `start` - Run your application with bun.
- ๐ `start:smol` - Run your application with bun and a flag which configures the JavaScriptCore heap size to be smaller and grow slower.
- ๐ `start:bin` - Run your standalone binary app.**Clean**
- ๐ `clean` - Remove coverage data, prod, build.
**Development**
- ๐ `dev` - Launch your application in development mode with bun.
- ๐ `dev:watch` - Interactive watch mode to automatically transpile source files with bun in development.
- ๐ `dev:hot` - Hot reloading of source files with bun in development.
- ๐ `dev:smol:watch` - Interactive watch mode to automatically transpile source files with bun in development, while using --smol flag.
- ๐ `dev:smol:hot` - Hot reloading source files with bun in development, while using --smol flag.**Build**
- ๐ `build` - Transpile and bundle source files with bun.
- ๐ `build:watch` - Interactive watch mode to automatically transpile source files with bun.
- ๐ `build:bin` - bun's bundler implements a --compile flag for generating a standalone binary from a TypeScript or JavaScript file, use this in your production environment to ensure optimal execution of your app.**Testing**
- ๐ `test` - Run bun test.
- ๐ `test:watch` - Interactive watch mode to automatically re-run tests with bun.**Linting and Formatting**
- ๐ `biome:start` - Starts the Biome daemon server. You can specify a custom configuration file path using the `--config-path` option.
- ๐ `biome:stop` - Stops the Biome daemon server.
- ๐ `biome:fix` - Runs a source code check and applies automatic fixes (linter & formatter) according to the defined rules.
- ๐ `biome:unsafe` - Works like `biome:fix`, but may apply more invasive or risky changes.**Backup and Dependency Management**
- ๐ `backup` - Backup files with Grunt.
- ๐ `pkg-check` - Check useless dependencies with depcheck.
- ๐ `pkg-upgrade` - Upgrade outdated dependencies (interactive mode) with npm-check-updates.**Versioning**
- ๐ `versioning` - Start ungit server.
**NPM Commands**
- ๐ `npm-version:major` - Increments the major version number of your project using npm.
- ๐ `npm-version:minor` - Increments the minor version number of your project using npm.
- ๐ `npm-version:patch` - Increments the version patch number of your project using npm.---
### ๐ Build
When using the **build.js** file in this boilerplate, it's important to note the significance of the **target** option. By default, if the target option is not specified in the **build.js** file, it will be set to `browser`. However, for projects utilizing the `bun.js` runtime environment, it's imperative to explicitly set the target to `bun`. This guarantees compatibility with the `bun` shell environment and prevents unexpected behavior. Furthermore, it's noteworthy that the `target` supports three possible values: `browser`, `bun`, and `node`, providing flexibility in defining the build target according to specific project requirements.
---
### ๐ Similar
You can also check out my other starter projects:
- ๐ [node-boilerplate](https://github.com/RajaRakoto/node-boilerplate)
- ๐ [react-boilerplate](https://github.com/RajaRakoto/react-boilerplate)
- ๐ [next-boilerplate](https://github.com/RajaRakoto/next-boilerplate)
- ๐ [qwik-boilerplate](https://github.com/RajaRakoto/qwik-boilerplate)
- ๐ [vscode-boilerplate](https://github.com/RajaRakoto/vscode-boilerplate)
- ๐ [cli-boilerplate](https://github.com/RajaRakoto/cli-boilerplate)