MyGit

a-h/templ

Fork: 278 Star: 8486 (更新于 2024-12-11 13:00:59)

license: MIT

Language: Go .

A language for writing HTML user interfaces in Go.

最后发布版本: v0.2.778 ( 2024-09-08 17:08:20)

官方网址 GitHub网址

templ

An HTML templating language for Go that has great developer tooling.

templ

Documentation

See user documentation at https://templ.guide

Go Reference xc compatible Go Coverage Go Report Card

Tasks

build

Build a local version.

go run ./get-version > .version
cd cmd/templ
go build

nix-update-gomod2nix

gomod2nix

install-snapshot

Build and install current version.

# Remove templ from the non-standard ~/bin/templ path
# that this command previously used.
rm -f ~/bin/templ
# Clear LSP logs.
rm -f cmd/templ/lspcmd/*.txt
# Update version.
go run ./get-version > .version
# Install to $GOPATH/bin or $HOME/go/bin
cd cmd/templ && go install

build-snapshot

Use goreleaser to build the command line binary using goreleaser.

goreleaser build --snapshot --clean

generate

Run templ generate using local version.

go run ./cmd/templ generate -include-version=false

test

Run Go tests.

go run ./get-version > .version
go run ./cmd/templ generate -include-version=false
go test ./...

test-short

Run Go tests.

go run ./get-version > .version
go run ./cmd/templ generate -include-version=false
go test ./... -short

test-cover

Run Go tests.

# Create test profile directories.
mkdir -p coverage/fmt
mkdir -p coverage/generate
mkdir -p coverage/version
mkdir -p coverage/unit
# Build the test binary.
go build -cover -o ./coverage/templ-cover ./cmd/templ
# Run the covered generate command.
GOCOVERDIR=coverage/fmt ./coverage/templ-cover fmt .
GOCOVERDIR=coverage/generate ./coverage/templ-cover generate -include-version=false
GOCOVERDIR=coverage/version ./coverage/templ-cover version
# Run the unit tests.
go test -cover ./... -coverpkg ./... -args -test.gocoverdir="$PWD/coverage/unit"
# Display the combined percentage.
go tool covdata percent -i=./coverage/fmt,./coverage/generate,./coverage/version,./coverage/unit
# Generate a text coverage profile for tooling to use.
go tool covdata textfmt -i=./coverage/fmt,./coverage/generate,./coverage/version,./coverage/unit -o coverage.out
# Print total
go tool cover -func coverage.out | grep total

test-cover-watch

gotestsum --watch -- -coverprofile=coverage.out

benchmark

Run benchmarks.

go run ./cmd/templ generate -include-version=false && go test ./... -bench=. -benchmem

fmt

Format all Go and templ code.

gofmt -s -w .
go run ./cmd/templ fmt .

lint

Run the lint operations that are run as part of the CI.

golangci-lint run --verbose

ensure-generated

Ensure that templ files have been generated with the local version of templ, and that those files have been added to git.

Requires: generate

git diff --exit-code

push-release-tag

Push a semantic version number to Github to trigger the release process.

./push-tag.sh

docs-run

Run the development server.

Directory: docs

npm run start

docs-build

Build production docs site.

Directory: docs

npm run build

最近版本更新:(数据更新于 2024-10-02 20:11:54)

2024-09-08 17:08:20 v0.2.778

2024-08-23 17:10:20 v0.2.771

2024-07-05 06:03:07 v0.2.747

2024-07-05 03:19:18 v0.2.742

2024-06-27 20:27:55 v0.2.731

2024-05-25 16:24:48 v0.2.707

2024-05-20 15:21:06 v0.2.697

2024-05-07 01:36:11 v0.2.680

2024-04-10 16:59:28 v0.2.663

2024-03-25 03:42:00 v0.2.648

主题(topics):

go, html-elements, htmx, ide-support, language-server, lsp, server-side-rendering, templating-languages

a-h/templ同语言 Go最近更新仓库

2024-12-27 06:40:42 dolthub/dolt

2024-12-26 21:49:33 SagerNet/sing-box

2024-12-25 14:31:42 bnb-chain/bsc

2024-12-22 07:52:58 navidrome/navidrome

2024-12-21 03:25:54 SpecterOps/BloodHound

2024-12-19 23:11:24 shadow1ng/fscan