Opinionated starter boilerplate for Bun projects using VSCode and Docker for a fully local, containerized workspace
- Docker engine / Docker Desktop installed and running
- VSCode with Dev Containers extension installed and enabled. Link to extension
- Git installed and properly configured (the dev container will use the credentials manager to forward git commands issued inside the container)
- (Optional) GitHub CLI
- Clone into new project
- Using plain git:
git clone --depth=1 https://github.com/lemux-one/bun-starter.git <new-repo-name>
cd <new-repo-name>
rm -rf .git
git init .- Using GitHub CLI
gh repo create <new-repo-name> --template="https://github.com/lemux-one/bun-starter.git"
gh repo create <new-repo-name> --template="lemux-one/bun-starter"- Set proper Git settings to handle CRLF/LF conversion issues from Windows to Unix (this is important since the idea is to work inside a Linux-powered container):
git config core.autocrlf input- (Optional, but recommended) Convert all files from CRLF to LF before opening the project inside the container. Failing to do so might (and probably will) cause some initialization scripts to fail:
find . -type f -print0 | xargs -0 dos2unix -ic0 | xargs -0 dos2unix -b- Rename project (excluding README.md file if keeping original doc). Suggested methods to accomplish it:
- Search and replace "bun-starter" with
<new-repo-name>using VSCode's Search & Replace features.
-
(Optional, but recommended) Copy
.devcontainer/.env.exampleto.devcontainer/.envand edit it accordingly -
Tweak
.devcontainer/devcontainer.jsonto fit specific use case if defaults make no sense -
Reopen in container [Dev Containers: Reopen in Container] VSCode command
-
Run
bun devin a console -
Edit/Code at will ...