* chore: add devcontainer for Anubis Signed-off-by: Xe Iaso <me@xeiaso.net> * chore(devcontainer): ensure user can write to $HOME Signed-off-by: Xe Iaso <me@xeiaso.net> * chore(devcontainer): forward ports, add launch config Signed-off-by: Xe Iaso <me@xeiaso.net> * chore(devcontainer): add playwright deps Signed-off-by: Xe Iaso <me@xeiaso.net> * docs: document devcontainer usage Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: spelling Signed-off-by: Xe Iaso <me@xeiaso.net> * ci(devcontainer): fix action references Signed-off-by: Xe Iaso <me@xeiaso.net> * chore(devcontainer): fix ko on arm64 Signed-off-by: Xe Iaso <me@xeiaso.net> --------- Signed-off-by: Xe Iaso <me@xeiaso.net>
2.4 KiB
title
| title |
|---|
| Local development |
If you use an editor with Development containers support, load this repo's devcontainer configuration. Skip to Running Anubis locally if you are using the devcontainer.
This enables you to contribute from GitHub Codespaces or other web-based editors.
:::note
TL;DR: npm ci && npm run dev
:::
Anubis requires the following tools to be installed to do local development:
- Go - the programming language that Anubis is written in
- esbuild - the JavaScript bundler Anubis uses for its production JS assets
- Node.JS & NPM - manages some build dependencies
gzip- compresses production JS (part of coreutils)zstd- compresses production JSbrotli- compresses production JS
If you have Homebrew installed, you can install all the dependencies with one command:
brew bundle
If you don't, you may need to figure out equivalents to the packages in Homebrew.
Running Anubis locally
npm run dev
Or to do it manually:
- Run
npm run assetsevery time you change the CSS/JavaScript go run ./cmd/anubiswith any CLI flags you want
Building JS/CSS assets
npm run assets
If you change the build process, make sure to update build.sh accordingly.
Production-ready builds
npm run container
This builds a prod-ready container image with ko. If you want to change where the container image is pushed, you need to use environment variables:
DOCKER_REPO=registry.host/org/repo DOCKER_METADATA_OUTPUT_TAGS=registry.host/org/repo:latest npm run container
Building packages
For more information, see Building native packages is complicated and #156: Debian, RPM, and binary tarball packages.
Install yeet:
:::note
yeet will soon be moved to a dedicated TecharoHQ repository. This is currently done in a hacky way in order to get this ready for user feedback.
:::
go install within.website/x/cmd/yeet@v1.13.4
Install the dependencies for Anubis:
npm ci
go mod download
Build the packages into ./var:
yeet