Files
bsky-social-app/bskyweb/Makefile
T
bryan newbold 034e6bdf66 bskyweb: basic i18n setup
Uses Cookies, then HTTP Accept-Language, then default, to negotiate
language setting.

The cookie name is 'lang', and the value can be any string which would
be valid in Accept-Language. This includes a trivial 2-char ISO code.

Language setting is returned as 2-char ISO code (though could be
more flexible in the future if needed).

HTML language is configured (attr), and a secondary per-language
scripts.html file is included.

As a hack Makefile generates the scripts_*.html files; typescript build
system will need to populate those appropriately as part of 'make
build-web' to finish integration.
2023-11-22 14:33:28 -08:00

46 lines
1.1 KiB
Makefile

SHELL = /bin/bash
.SHELLFLAGS = -o pipefail -c
# https://github.com/golang/go/wiki/LoopvarExperiment
export GOEXPERIMENT := loopvar
.PHONY: help
help: ## Print info about all commands
@echo "Commands:"
@echo
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[01;32m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: build
build: ## Build all executables
go build ./cmd/bskyweb
.PHONY: test
test: ## Run all tests
go test ./...
.PHONY: coverage-html
coverage-html: ## Generate test coverage report and open in browser
go test ./... -coverpkg=./... -coverprofile=test-coverage.out
go tool cover -html=test-coverage.out
.PHONY: lint
lint: ## Verify code style and run static checks
go vet ./...
test -z $(gofmt -l ./...)
.PHONY: fmt
fmt: ## Run syntax re-formatting (modify in place)
go fmt ./...
.PHONY: check
check: ## Compile everything, checking syntax (does not output binaries)
go build ./...
.env:
if [ ! -f ".env" ]; then cp example.dev.env .env; fi
.PHONY: run-dev-bskyweb
run-dev-bskyweb: .env ## Runs 'bskyweb' for local dev
GOLOG_LOG_LEVEL=info go run ./cmd/bskyweb serve