Skip to content

Workflows

This page outlines the repeatable tasks you’ll run most often when contributing to SciFlow.

Day-to-Day Loop

  1. Edit code inside packages/*.
  2. Run targeted tests:
    npx nx test @sciflow/editor-core
    npx nx typecheck @sciflow/editor-start
    
  3. Bundle & inspect the demo:
    npx nx bundle @sciflow/editor-start
    npx http-server .
    
  4. Lint + typecheck + test before pushing:
    npx nx run-many -t lint test build typecheck
    

Nx caching

Nx reuses prior results when the inputs haven’t changed. If the cache feels stale, delete .nx/cache and rerun the command.

Feature Flags & Bundles

  • Feature packages live under packages/editor/core/src/lib/features.
  • Enable/disable them in the demo via the sidebar toggle list (packages/editor/start/demo/js/demo.js).
  • When developing a feature, bundle the start package so Lit node views pick up your changes.

Sync Strategy Testing

Use the core package’s Editor.create API with a mock sync strategy:

const sync: SyncStrategy = {
  async load() { return { doc: defaultDoc, version: 0, selection: { anchor: 0, head: 0 } }; },
  applyExternal() {},
  applyLocal(ops) { console.debug('local ops', ops); },
};

Wire this into integration tests or stories to ensure persistence hooks behave before hitting a live backend.

Releasing / Publishing

  1. Ensure npx nx run-many -t lint test build typecheck passes.
  2. Update packages/*/package.json versions if needed.
  3. Build artifacts:
    npx nx bundle @sciflow/editor-start
    
  4. Publish via the internal release script (see scripts/publish.sh, not shown here).

Scoped registry

Make sure your npm auth token has publish rights to the GitLab registry before running the release scripts.