'use strict'; /** * Launcher for the `node.script` object — the same trick as bin/apex7-scale.js. * * The device logic is TypeScript (`src/max/device.ts`); this file stays plain * CommonJS because Node for Max runs it on a Node version we do not control, * with no loader and no build step of its own. * * `max-api` is required *here*, in the folder Node for Max resolves modules * from, and handed to the compiled module — which keeps that module importable * (and testable) outside of Max. */ const fs = require('fs'); const path = require('path'); const Max = require('max-api'); const compiled = path.join(__dirname, '..', 'dist', 'src', 'max', 'device.js'); if (!fs.existsSync(compiled)) { Max.post( 'scale: not built yet — run `npm install` (or `npm run build`) in ' + path.join(__dirname, '..'), Max.POST_LEVELS.ERROR ); } else { require(compiled).start(Max); }