Skip to content

Automate frontend builds for releases; stop committing the build - #48

Open
ericgozzi wants to merge 1 commit into
mainfrom
feature/automate-frontend-release
Open

Automate frontend builds for releases; stop committing the build#48
ericgozzi wants to merge 1 commit into
mainfrom
feature/automate-frontend-release

Conversation

@ericgozzi

Copy link
Copy Markdown
Collaborator

The bundled compas_threejs_ts frontend was previously built by hand and committed to this repo. Instead:

  • FRONTEND_VERSION pins the compas_threejs_ts release to build.
  • invoke pre-build clones that tag, builds it, and vendors dist/ into src/compas_threejs/viewer/frontend/. It's the hook compas-dev/compas-actions/prepare-release@v1 runs (via run-prebuild) before python -m build, now wired up in release.yml alongside a Node.js setup step.
  • invoke sync-frontend stays for local iteration against a sibling compas_threejs_ts checkout.
  • src/compas_threejs/viewer/frontend/ is now gitignored; setuptools still bundles it into sdists/wheels from disk via MANIFEST.in, so pip install compas_threejs still needs no Node.js.
  • scripts/sync-frontend.py and sync-frontend.bat removed (duplicated the invoke task, and the former broke on Windows console encoding).

Pinning the version explicitly, rather than always building whatever compas_threejs_ts is newest, is deliberate: the two repos share a wire format contract via compas-pb/compas-pb-ts, and an unreviewed frontend bump could silently break it.

The bundled compas_threejs_ts frontend was previously built by hand and
committed to this repo. Instead:

- FRONTEND_VERSION pins the compas_threejs_ts release to build.
- `invoke pre-build` clones that tag, builds it, and vendors dist/ into
  src/compas_threejs/viewer/frontend/. It's the hook
  compas-dev/compas-actions/prepare-release@v1 runs (via run-prebuild)
  before `python -m build`, now wired up in release.yml alongside a
  Node.js setup step.
- `invoke sync-frontend` stays for local iteration against a sibling
  compas_threejs_ts checkout.
- src/compas_threejs/viewer/frontend/ is now gitignored; setuptools
  still bundles it into sdists/wheels from disk via MANIFEST.in, so
  `pip install compas_threejs` still needs no Node.js.
- scripts/sync-frontend.py and sync-frontend.bat removed (duplicated
  the invoke task, and the former broke on Windows console encoding).

Pinning the version explicitly, rather than always building whatever
compas_threejs_ts is newest, is deliberate: the two repos share a wire
format contract via compas-pb/compas-pb-ts, and an unreviewed frontend
bump could silently break it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ericgozzi
ericgozzi requested a review from gonzalocasas August 21, 2026 11:29

@gonzalocasas gonzalocasas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I love this, but I think it would be best to use release assets instead of rebuilding here

Comment thread tasks.py
Comment on lines +64 to +79
with tempfile.TemporaryDirectory(prefix="compas_threejs_ts-") as tmp:
clone_dir = Path(tmp) / "compas_threejs_ts"

print(f"Cloning compas_threejs_ts@v{version}...")
subprocess.run(
[
"git",
"clone",
"--branch",
f"v{version}",
"--depth",
"1",
FRONTEND_REPO_URL,
str(clone_dir),
],
check=True,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use the release assets instead of rebuilding locally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants