Use CodeMirror editor
This commit is contained in:
@@ -4,7 +4,10 @@ COMPANION_WIN := companion/datascape-companion-windows-amd64.exe
|
||||
COMPANION_LIN := companion/datascape-companion-linux-amd64
|
||||
COMPANION_SRCS := $(wildcard cmd/companion/*.go) $(wildcard cmd/companion/*.html) go.mod go.sum
|
||||
|
||||
.PHONY: deploy companion companion-windows companion-linux companion-release
|
||||
EDITOR_BUNDLE := assets/editor/vendor/codemirror.bundle.js
|
||||
EDITOR_SRCS := $(wildcard editor-build/*.js) editor-build/package.json editor-build/package-lock.json
|
||||
|
||||
.PHONY: deploy companion companion-windows companion-linux companion-release editor
|
||||
|
||||
# Cross-compiled companion artifacts the wiki binary embeds. Both must exist
|
||||
# before `go build .` so embed.FS picks them up.
|
||||
@@ -24,6 +27,15 @@ companion:
|
||||
mkdir -p bin
|
||||
go build -o bin/ ./cmd/companion
|
||||
|
||||
# Regenerate the vendored CodeMirror bundle. One-time/dev-only step: run after
|
||||
# upgrading the @codemirror/* versions in editor-build/package.json. The built
|
||||
# artifact ($(EDITOR_BUNDLE)) is committed; `go build` only consumes it and
|
||||
# never runs Node.
|
||||
editor: $(EDITOR_BUNDLE)
|
||||
|
||||
$(EDITOR_BUNDLE): $(EDITOR_SRCS)
|
||||
cd editor-build && npm ci && npm run build
|
||||
|
||||
deploy: companion-release
|
||||
GOOS=linux GOARCH=arm GOARM=7 go build -o datascape-arm .
|
||||
ssh $(NAS) 'kill $$(cat /share/homes/luxick/.local/bin/datascape.pid) 2>/dev/null; rm -f /share/homes/luxick/.local/bin/datascape.pid'
|
||||
|
||||
Reference in New Issue
Block a user