From 7615b6fe851ec701161c81f3f198144bc8fa978b Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Thu, 28 May 2026 10:15:45 -0400 Subject: [PATCH] make six: vendor bundles from gumyum/six.js fork, not local cupPCB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clone the six.js fork (shallow, sparse build/ only) from gumyum/six.js.git instead of copying from a local ~/git/cupPCB checkout. The fork ships vanilla three.js build output, so make six now also creates the six.* aliases consumers import. Makes arborist-viz self-sufficient — no sibling cupPCB checkout required. --- Makefile | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 8ba8807..a61de9e 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,9 @@ PYTEST = $(VENV_DIR)/bin/pytest ALEMBIC = $(VENV_DIR)/bin/alembic INITDB = $(VENV_DIR)/bin/arborist_viz_init_db -SIX_SRC = $(HOME)/git/cupPCB/cdn/six -SIX_DST = arborist_viz/static/six +SIX_REPO = ssh://git@git.unturf.com:2222/gumyum/six.js.git +SIX_CLONE = $(shell pwd)/build/six.js +SIX_DST = arborist_viz/static/six .PHONY: all clean install install-dev test serve six commit-hash version help \ arborist seed demo @@ -26,7 +27,7 @@ help: @echo "arborist-viz make targets:" @echo " make install install package (production deps only)" @echo " make install-dev install package with dev + test extras" - @echo " make six vendor six.js bundles from cupPCB/cdn/six" + @echo " make six clone six.js fork from gumyum + vendor bundles" @echo " make init-db create dashboard metadata SQLite + run migrations" @echo " make serve run waitress on :6543 with development.ini" @echo " make test run pytest" @@ -100,16 +101,31 @@ serve-arborist: install-dev six ARBORIST_VIZ_SHARDS=$(ARBORIST_REAL_SHARDS) $(PSERVE) --reload $(CONFIG_FILE) six: - @echo "Vendoring six.js bundles from $(SIX_SRC) -> $(SIX_DST)..." - @if [ ! -d "$(SIX_SRC)" ]; then \ - echo "ERROR: $(SIX_SRC) not found — check ~/git/cupPCB checkout"; exit 1; \ + @echo "Vendoring six.js bundles from $(SIX_REPO) -> $(SIX_DST)..." + @if [ -d "$(SIX_CLONE)/.git" ]; then \ + echo " refreshing existing clone..."; \ + git -C "$(SIX_CLONE)" fetch --depth 1 --quiet origin main; \ + git -C "$(SIX_CLONE)" reset --hard --quiet FETCH_HEAD; \ + else \ + echo " cloning $(SIX_REPO) (shallow, build/ only)..."; \ + rm -rf "$(SIX_CLONE)"; \ + mkdir -p "$(dir $(SIX_CLONE))"; \ + git clone --depth 1 --filter=blob:none --no-checkout --single-branch \ + --branch main --no-tags "$(SIX_REPO)" "$(SIX_CLONE)"; \ + git -C "$(SIX_CLONE)" sparse-checkout set --no-cone build; \ + git -C "$(SIX_CLONE)" checkout --quiet main; \ fi @mkdir -p $(SIX_DST) - @cp -v $(SIX_SRC)/six*.js $(SIX_DST)/ - @# six.module.js + siblings have `import { ... } from './three.core.js'` - @# — the companion three.* bundles MUST sit alongside them in /static/six/ - @# or the browser fails to resolve the ES-module import. - @cp -v $(SIX_SRC)/three*.js $(SIX_DST)/ + @# The fork ships vanilla three.js build output (build/three.*.js). The + @# consumer imports six.module.js, which is an alias of three.module.js; + @# three.* entry files import './three.core.js', so both name-sets must + @# sit together in /static/six/ or the ES-module import fails to resolve. + @cp $(SIX_CLONE)/build/three*.js $(SIX_DST)/ + @for f in $(SIX_CLONE)/build/three*.js; do \ + b=$$(basename "$$f"); \ + cp "$$f" "$(SIX_DST)/$$(echo "$$b" | sed 's/^three/six/')"; \ + done + @echo " vendored $$(ls $(SIX_DST)/*.js | wc -l) bundle files into $(SIX_DST)." commit-hash: @git rev-parse --short HEAD > commit-hash.txt 2>/dev/null || echo "0" > commit-hash.txt