Development¶
This page is aimed at contributors working on the codebase itself.
Repository Layout¶
Important directories:
src/: React app, graph builder, layout logic, canvas UIschemas/: shared default schema fixturejsonschema_diagram/: Python API and CLIjsonschema_diagram_sphinx/: Sphinx extension and extension CSSbackend/: compatibility server entrypointdocs/: Sphinx documentation sourcetests/: Python-side tests
Common Commands¶
Frontend development:
npm install
npm run dev
Frontend tests:
npm test
Production builds:
npm run build
Python tests:
python3 -m unittest discover -s tests -v
Docs build:
python3 -m sphinx -E -a -b html docs docs/_build/html
Useful Development Flows¶
When changing graph rendering or styles:
run
npm run devvalidate manually in the browser
run
npm testrebuild with
npm run build
When changing embed behavior:
run
npm run build:embedrebuild docs with
python3 -m sphinx -E -a -b html docs docs/_build/htmlverify
docs/_build/html/demo.html
When changing Python API or Sphinx code:
run
python3 -m unittest discover -s tests -vrun docs-specific tests if needed
rebuild the docs
Themes¶
Theme presets are defined in:
src/lib/theme-presets.tssrc/styles.css
If you add or rename a theme, update all three places:
frontend preset list
CSS variables
Python-side
VALID_THEME_IDS
Docs Maintenance¶
Keep the docs in sync when changing:
CLI commands
Python public functions
embed template variables
Sphinx directive options
supported schema keywords
Release Checklist¶
Before publishing or handing off a change set, it is worth checking:
npm testpython3 -m unittest discover -s tests -vnpm run buildpython3 -m sphinx -E -a -b html docs docs/_build/htmlopen the built demo docs and at least one embed artifact