Developer Guide

Concepts

Bus Messaging

Service modules

Services are loosely coupled to the rest of the Theatersoft platform using Bus messaging. They should be built as separate modules from their own source repositories and published as individual NPM packages. They should only share a module when several service exports are closely related by a common codebase.

Runtime package vs. source repo

The @theatersoft npm packages are built from the source repositories on github.com/theatersoft using a variety of modern tools including Babel for advanced JavaScript and Rollup for ES module optimization. None of these build tools are required at runtime, so only the generated dist output directories are published to npm.

A default site deployment consists of a /opt/theatersoft/package.json containing all the service dependencies and npm install in that directory. Those installed dist packages will be replaced by links their locally built versions during the development process.

Module Build Details

Theatersoft modules are built with custom build.js scripts following common conventions.

Npm CLI Quality Issues

The abysmal state of the npm CLI requires workarounds for long-standing bugs (10343, 16853, 17287) related to npm breaking when using the npm-link feature. There will be situations noted where npm fails but the yarn alternative works properly.

Development Environment

  • Linux development machine
  • Node.js
  • Theatersoft site deployed in /opt/theatersoft

Build Instructions

The theatersoft/theatersoft Github repo contains submodule links to each of the required repos and build scripts to perform a full build.

mkdir Theatersoft && cd Theatersoft
git clone --recursive [email protected]:theatersoft/theatersoft.git
npm run install-link-build-install-link