Skip to content

Workflows

This page describes the tasks you will run most often when contributing to SciFlow.

Development workflow

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

Nx caching

Nx reuses previous results when the inputs have not changed. If it returns stale results, delete .nx/cache and rerun the command.

Feature flags and bundles

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

Test sync strategies

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); },
};

Use this strategy in integration tests or stories to verify the persistence hooks before connecting to a live backend.

Release and publish

  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.