Skip to content
/ turbobun Public template

Bun + Biome Turborepo, with basic Elysia and Next.js apps and commits conventions

License

Notifications You must be signed in to change notification settings

mugencraft/turbobun

Repository files navigation

Contributors Forks Stargazers Issues MIT License

Basic template for Modern Full Stack Web Developers. Powered with several Linting Tools and Commit Hooks, it will help you code faster and better.

Table of Contents

Features

See ROADMAP

Monorepo features

Commit Conventions and Git Hooks

Linters

(back to top)

Demo apps

(back to top)

Getting started

bunx degit mugencraft/turbobun my-app
cd my-app
bun install

To run:

bun dev

(back to top)

Monorepo Internal Packages

To reference packages use the workspace:* key (see workspaces) :

{
  "name": "pkg-a",
  "dependencies": {
    "pkg-b": "workspace:*"
  }
}

(back to top)

Bun Actions

Using --filter, you can run the dev script in all packages in parallel:

  • bun --filter '*' dev
  • bun --filter './apps/**' dev
  • bun --filter './packages/**'
  • bun --filter './packages/foo'

Bun CLI Docs:

(back to top)

Available Bun Actions

# Show Available actions
bun run

(back to top)

Generators

Learn more about Turborepo Generators at turbo: code-generation

Generate New app or package:

turbo gen workspace

Generate Code:

Turborepo uses a simplified Plop configuration.

Known issue: ESM dependencies are not currently supported within custom generators.

For examples check also turbo-codemod generators

(back to top)

Workflow

Commit, Conventions and Hooks

You are free to install the Git Hooks to enforce standards, it's not mandatory. Some coders don't like it and a wrong configuring will slow you down.

You can run checkers and linters.

If a check fails your commit fails.

If a linter change something automatically you can have unwanted behaviors.

To install, run:

lefthook install

To enforce hooks installation add this to packages.json:

{
  "scripts": {
    "postinstall": "lefthook install"
  }
}

(back to top)

GitHub Actions

CHANGELOG, versioning and publishing is managed by Changesets

CI/CD and deploy will be managed by Vercel.

There is no need for GitHub Actions

Changesets

To record a change, run:

bun changeset

Follow the prompts to describe the changes. Changesets will create a markdown file in the .changeset directory detailing the changes.

(back to top)

Versioning

When it's time to release, run:

bun changeset version

This command will bump the versions of the affected packages and update the changelogs.

(back to top)

Publishing to npm

To publish the packages to npm, run:

bun changeset publish

If you want to publish package to the public npm registry and make them publicly available, this is already setup.

To publish packages to a private npm organization scope, remove the following from each of the package.json's

- "publishConfig": {
- "access": "public"
- },

(back to top)

GitHub Package Registry

See Working with the npm registry

(back to top)

Contributing to TurboBun

Check CONTRIBUTING for

(back to top)

Inspired By

(back to top)

License

MIT License

(back to top)