make six: vendor bundles from gumyum/six.js fork, not local cupPCB
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.
This commit is contained in:
parent
0cd96ab1d7
commit
7615b6fe85
1 changed files with 27 additions and 11 deletions
38
Makefile
38
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue