chore: repo hygiene for the wasm era (WO-WZ-015 fix round)
Replace the retired .so Makefile with the wasm/.bnp convention (build / verify / archive-check / publish via ninja plugin build), gitignore *.so and *.bnp artifacts, and refresh the stale [compatibility] block_core constraint to the v0.15 era. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
c52fce32e0
commit
57e16e8ec7
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@
|
|||||||
tmp/
|
tmp/
|
||||||
.idea/
|
.idea/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
*.bnp
|
||||||
|
|||||||
59
Makefile
59
Makefile
@ -1,32 +1,59 @@
|
|||||||
# Art Deco — local build helpers (.so plugin workflow).
|
# art-deco — build & publish helpers (wasm .bnp workflow)
|
||||||
#
|
#
|
||||||
# `make` produces art-deco.so via CGO go build -buildmode=plugin. This is the
|
# The theme compiles to a wasip1 reactor-mode wasm module packed into a .bnp
|
||||||
# local-only build used by check-safety. The full `rebuild` target intentionally
|
# artifact (`ninja plugin build`). The legacy .so path is retired (WO-WZ-015):
|
||||||
# does NOT ship here — production deployment goes through the upstream gotham-style
|
# the CMS is wasm-native and can no longer load .so plugins. Distribution is
|
||||||
# Makefile, which is reserved for human-run cycles, not autonomous agents.
|
# publish-to-registry -> InstallFromRegistry (hot-load, no restart).
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# make build # compile wasm + pack art-deco-<version>.bnp
|
||||||
|
# make verify # validate the built .bnp (layout/abi/name/size)
|
||||||
|
# make archive-check # prove a clean `git archive HEAD` compiles to wasm
|
||||||
|
# make publish # ninja plugin publish --bnp (to the active registry)
|
||||||
|
# make templ # regenerate templ Go files
|
||||||
|
# make clean # remove build artefacts
|
||||||
|
|
||||||
.PHONY: all clean templ help
|
.PHONY: build verify archive-check publish templ clean help
|
||||||
|
|
||||||
PLUGIN_NAME := art-deco
|
PLUGIN_NAME := art-deco
|
||||||
TEMPL_BIN := $(HOME)/go/bin/templ
|
NINJA := ninja
|
||||||
|
BNP := $(PLUGIN_NAME)-$(shell grep '^version' plugin.mod | sed 's/.*"\(.*\)"/\1/').bnp
|
||||||
|
|
||||||
# Default target: build the .so locally.
|
# Compile to wasm and pack the .bnp (GOOS=wasip1 GOARCH=wasm, DESCRIBE probe,
|
||||||
all: $(PLUGIN_NAME).so
|
# tar.zst of plugin.wasm + plugin.mod + manifest.pb + schemas/ + assets/).
|
||||||
|
build:
|
||||||
|
$(NINJA) plugin build --dir .
|
||||||
|
|
||||||
# Local plugin build (no container).
|
# Validate the built .bnp exactly as the registry/loader will.
|
||||||
$(PLUGIN_NAME).so: $(wildcard *.go) plugin.mod go.mod
|
verify:
|
||||||
CGO_ENABLED=1 go build -buildmode=plugin -ldflags="-s -w" -o $(PLUGIN_NAME).so .
|
$(NINJA) plugin verify $(BNP)
|
||||||
|
|
||||||
# Regenerate templ Go files from .templ sources.
|
# Prove a clean `git archive HEAD` (what publish ships) compiles to wasm.
|
||||||
|
archive-check:
|
||||||
|
@T=$$(mktemp -d /tmp/archive-check-$(PLUGIN_NAME).XXXXXX) && \
|
||||||
|
trap 'rm -rf "$$T"' EXIT && \
|
||||||
|
git archive HEAD | tar -x -C "$$T" && \
|
||||||
|
cd "$$T" && GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o "$$T/check.wasm" . && \
|
||||||
|
echo "archive-check OK"
|
||||||
|
|
||||||
|
# Publish the prebuilt .bnp to the active registry.
|
||||||
|
# Pass --host https://my.localdev.blockninjacms.com for the dev orchestrator.
|
||||||
|
publish: build
|
||||||
|
$(NINJA) plugin publish --bnp $(BNP)
|
||||||
|
|
||||||
|
# Regenerate templ Go files locally.
|
||||||
templ:
|
templ:
|
||||||
$(TEMPL_BIN) generate
|
templ generate
|
||||||
|
|
||||||
# Remove build artefacts.
|
# Remove build artefacts.
|
||||||
clean:
|
clean:
|
||||||
rm -f $(PLUGIN_NAME).so
|
rm -f $(PLUGIN_NAME)-*.bnp $(PLUGIN_NAME).so plugin.wasm
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Targets:"
|
@echo "Targets:"
|
||||||
@echo " all Build $(PLUGIN_NAME).so locally (default)"
|
@echo " build Compile wasm + pack the .bnp"
|
||||||
|
@echo " verify Validate the built .bnp (loader-identical checks)"
|
||||||
|
@echo " archive-check Prove a clean git archive HEAD compiles to wasm"
|
||||||
|
@echo " publish Publish the .bnp to the active registry"
|
||||||
@echo " templ Regenerate templ Go files"
|
@echo " templ Regenerate templ Go files"
|
||||||
@echo " clean Remove build artefacts"
|
@echo " clean Remove build artefacts"
|
||||||
|
|||||||
@ -9,4 +9,4 @@ categories = ["templates"]
|
|||||||
tags = ["luxury", "gold", "hospitality", "hotel", "wedding", "jewellery", "vintage", "glam", "fine-dining"]
|
tags = ["luxury", "gold", "hospitality", "hotel", "wedding", "jewellery", "vintage", "glam", "fine-dining"]
|
||||||
|
|
||||||
[compatibility]
|
[compatibility]
|
||||||
block_core = ">=0.11.0 <0.12.0"
|
block_core = ">=0.15.0 <0.16.0"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user