- Add CodeMirror 6 with oneDark theme and markdown language support - Bundle via esbuild into public/vendor/ (built on deploy, not committed) - Add codemirror-entry.mjs as bundle entry point - Fix SPA fallback to only serve index.html for /, not all paths - Fix mime type handling by mutating mime-types registry - Add Write/Preview tabs; preview renders on tab switch only - Multi-cursor via Shift+Alt+Up/Down; Alt+Click adds cursor - gitignore package-lock.json and public/vendor/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
822 B
Makefile
30 lines
822 B
Makefile
DEST ?= /srv/task-inventory
|
|
OWNER ?= task-inventory:task-inventory
|
|
OWNER_USER = $(firstword $(subst :, ,$(OWNER)))
|
|
|
|
VENDOR_DIR = public/vendor
|
|
|
|
RSYNC_EXCLUDES := \
|
|
--exclude='/.git/' \
|
|
--exclude='/data/' \
|
|
--exclude='/config.yaml' \
|
|
--exclude='/node_modules/'
|
|
|
|
.PHONY: build deploy sync
|
|
|
|
# Bundle vendor libs
|
|
build:
|
|
mkdir -p $(VENDOR_DIR)
|
|
node_modules/.bin/esbuild --bundle --format=esm \
|
|
--outfile=$(VENDOR_DIR)/codemirror-bundle.mjs --minify \
|
|
codemirror-entry.mjs
|
|
|
|
# Full deployment: build, sync files, fix ownership, install dependencies
|
|
deploy: build sync
|
|
sudo chown -R $(OWNER) $(DEST)
|
|
sudo -u $(OWNER_USER) npm ci --prefix $(DEST)
|
|
|
|
# Copy files only — useful for quick updates when dependencies haven't changed
|
|
sync:
|
|
sudo rsync -aP --delete --chown=$(OWNER) $(RSYNC_EXCLUDES) ./ $(DEST)/
|