This is the “day-to-day” workflow for ABCarus: how we run the app, how we cut releases, what we commit, and which debug flags matter.
npm install
npm startIf ELECTRON_RUN_AS_NODE=1 leaks into your environment, Electron starts in "Node mode" and the app will not open (main process crashes early; e.g. app.whenReady is undefined).
- Check:
env | grep ELECTRON_RUN_AS_NODE - Fix (current shell):
unset ELECTRON_RUN_AS_NODE
For local dev runs, scripts/local/run.sh defensively unsets it.
This comes up often (UI titles, GitHub issues, and JS RegExp):
- In Markdown/GitHub comments, wrap hotkeys in inline code:
`Ctrl/Cmd+Alt+\`(no extra escaping needed). - In JavaScript strings, use
\\to display a single\to the user. - In
new RegExp("...")/ template strings, don’t over-escape\s,\d, etc. (\\sinside the RegExp string matches a literal\s, not whitespace).
feat/playback-autoscroll— experimental / archived (kept for history; do not base new work on it).- Use branches based on
master(or the current stabilization PR branch) for new work.
- Update CHANGELOG.md under
## [Unreleased](make sure it’s not empty). - Bump version + tag (pick one):
npm run release:patch
# or: npm run release:minor
# or: npm run release:major- Push commit + tag:
git push
git push origin vX.Y.ZIf you want a single command that prepares a release and pushes master + the tag, use:
npm run publish:patchGuards:
- Refuses to run unless you are on
master. - Requires a clean working tree.
- Requires
masterto matchorigin/masterbefore preparing the release. - Requires CHANGELOG.md
## [Unreleased]to be non-empty.
Example (patch):
npm run release:patch
# prints: Release prepared: v0.19.2 (example)
git push
git push origin v0.19.2- Verify GitHub Actions produced the expected artifacts for the tag:
- Tag push triggers GitHub Actions workflows, including
.github/workflows/release-assets.yml. - Look for artifacts either on the GitHub Release page for
vX.Y.Zand/or in Actions (run artifacts).
- Tag push triggers GitHub Actions workflows, including
- Sanity check the built app (start, open file, render, play; and import/export if Python is bundled).
For the detailed checklist see docs/RELEASE_CHECKLIST.md.
- Stable releases use tags like
vX.Y.Z(e.g.v0.20.2) and are treated as the default “Latest” channel. - RC / Unstable releases use tags like
vX.Y.Z-rc.N(e.g.v0.20.3-rc.1).
GitHub Actions will automatically mark any tag that contains a - (for example -rc.1) as a GitHub Pre-release
when uploading assets via .github/workflows/release-assets.yml.
Upstream abc2svg updates usually arrive as a source snapshot under third_party/_upd/ (not committed). The safe workflow:
# Optional: fetch latest abc2svg tip zip into third_party/_upd/
npm run abc2svg:fetch-tip
# 1) Generate a review report (SAFE / HOLD)
npm run thirdparty:review -- --candidate third_party/_upd/<abc2svg>.zip --abc2svg-build
# 2) Apply the upgrade (keeps the change small and easy to revert)
npm run abc2svg:upgrade -- --zip third_party/_upd/<abc2svg>.zip --apply
# 3) Run local harness checks
npm run test:measures
npm run test:transpose
npm run test:settings
npm run test:truth-scaleDetails + checklist live in docs/third-party-review.md. For a repeatable end-to-end “pipeline” (including required manual smoke tests and patch policy), use:
If you have GitHub CLI installed and authenticated (gh auth login), you can verify releases from the terminal:
gh auth status
# See the latest releases
gh release list -L 10
# See assets attached to a specific release
gh release view vX.Y.Z
# Check the tag-triggered workflow runs
gh run list -L 10 --workflow release-assets.ymlNotes:
release-assets.ymlruns onpushto tagsv*and uploads artifacts to the GitHub Release for that tag.- It also supports manual runs (workflow_dispatch) with inputs:
ref: git ref to build (use a tag likevX.Y.Zto publish)publish: whentrue, uploads artifacts to the GitHub Release (only forrefstarting withv)
Manual rebuild example (no browser):
gh workflow run release-assets.yml -f ref=vX.Y.Z -f publish=trueGitHub Actions “Artifacts” storage is quota-limited. If the quota is exhausted, workflows that use actions/upload-artifact
will fail with “Artifact storage quota has been hit”.
ABCarus avoids this for releases by uploading binaries to GitHub Releases via .github/workflows/release-assets.yml
(instead of Actions Artifacts).
If npm run release:* fails due to git permissions or an “EPERM” error, do the minimal manual fallback:
- Ensure CHANGELOG.md has a filled
## [Unreleased]section. - Manually bump
package.json(+package-lock.jsonif present) to the target version. - Commit:
git add package.json package-lock.json CHANGELOG.md
git commit -m "chore(release): vX.Y.Z"- Tag and push:
git tag -a vX.Y.Z -m "vX.Y.Z"
git push
git push origin vX.Y.ZCommitted (expected in git):
- Source code (
src/), build scripts (scripts/,devtools/), and project docs (docs/). package.jsonandpackage-lock.json.- Deterministic locks (e.g. PBS lock files):
third_party/python-embed/*/python-build-standalone.lock.json.
Not committed (kept local by policy):
- Local-only helpers and dumps:
scripts/local/**,debug_dumps/**. - Raw chat exports and private QA notes:
docs/qa/**. - Brand “kitchen”/drafts:
assets/brand/**. - Download/update staging:
third_party/_upd/**. - Installed PBS runtimes and caches:
third_party/python-embed/.cache/**third_party/python-embed/*/(bin|lib|include|share)/**
The canonical list lives in .gitignore; this section documents intent.
To avoid spamming GitHub with WIP commits during rapid iteration:
- Prefer local-only iteration while investigating a bug (uncommitted changes or local commits).
- Do not push a branch until you have a coherent checkpoint (or someone explicitly asks to push/PR).
- If you need to share progress mid-way, prefer a single “checkpoint” push with a clear message (or open a Draft PR), rather than many small pushes.
- Once the fix is confirmed, squash/clean up as needed, then push and open/update the PR.
UI / platform diagnostics
ABCARUS_DEBUG_KEYS=1— log keyboard shortcuts and key routing.ABCARUS_DEBUG_DIALOGS=1— log file-dialog parenting/bounds decisions (Linux window-manager issues).ABCARUS_USE_PORTAL=1— force xdg-desktop-portal dialogs on Linux (helps on some desktops).ABCARUS_DEBUG_THEME=1— print detected/forced theme and chosen window icon.
Library / indexing
ABCARUS_DISABLE_LIBRARY_INDEX=1— disable the persisted library index (kill-switch).
Python (MusicXML import/export)
ABCARUS_ALLOW_SYSTEM_PYTHON=1— allow falling back to system Python when no bundled runtime is present.ABCARUS_ALLOW_OTHER_PYTHON=1— allow non-3.11 Python (normally rejected).
Build metadata (About dialog)
ABCARUS_BUILD_NUMBER=...— build number (CI typically usesGITHUB_RUN_NUMBER).ABCARUS_COMMIT=...— commit hash override (otherwise derived from git).ABCARUS_BUILD_DATE=...— build date string shown in diagnostics.
Linux window icon selection
ABCARUS_LINUX_WINDOW_ICON_VARIANT=dark|light— force window icon variant (debug/override).
When reporting a bug, try to include: app version (About), OS/desktop, minimal ABC snippet/file, and exact repro steps.
Where logs go
- Electron main process logs go to the terminal you launched
npm startfrom. - Renderer logs go to DevTools Console (View → Toggle Developer Tools).
- Debug dumps are JSON files you can attach to issues/PRs. They include the active file path + tune identity near the top (
context.label,context.filePath,context.xNumber).
Debug dumps (recommended)
- Manual dump: press
Ctrl+Shift+D(or menu action) and saveabcarus-debug-*.json. - Auto-dump on runtime errors (opt-in for development):
ABCARUS_DEV_AUTO_DUMP=1 npm start- Optional:
ABCARUS_DEV_AUTO_DUMP_DIR=/some/path(override dump directory) - Runtime toggle (DevTools):
window.__abcarusAutoDumpOnError = true|false
Experimental: abc2svg native %%MIDI drum*
- Enable native drum handling for playback (dev only):
ABCARUS_DEV_NATIVE_MIDI_DRUMS=1 npm start - Runtime toggle (DevTools):
window.__abcarusNativeMidiDrums = true|false - Note: this is experimental; for compatibility it may move
%%MIDI drum*directives that appear beforeK:to just afterK:during playback parsing. - UI toggle: Settings → Playback (Advanced) → “Use native abc2svg %%MIDI drum* (experimental)”.
Keyboard shortcuts / key routing
ABCARUS_DEBUG_KEYS=1 npm startReproduce and copy the [keys] ... lines from the terminal.
Playback issues (parse errors, Follow, “cannot start”)
- In DevTools Console (no rebuild needed):
window.__abcarusDebugPlayback = true(prints playback payload/head + parsed previews)window.__abcarusPlaybackTrace = true(per-note trace; no reload required)window.__abcarusDebugDrums = true(prints drum-related payload lines)
- Optional toggles (set before starting playback, then try again):
window.__abcarusPlaybackStripChordSymbols = truewindow.__abcarusPlaybackExpandRepeats = true
- Useful dump helpers:
window.__abcarusPlaybackDebug?.getState()window.__abcarusPlaybackDebug?.getDiagnostics()window.__abcarusPlaybackDebug?.getTrace().slice(-50)
Icons (Linux)
- Install/update local icons:
bash scripts/install_icons.sh - If the DE still shows the old icon, re-run
gtk-update-icon-cachefor your hicolor dir (the script already tries).