Skip to content

Customer builds

You can ship a customer-specific, white-labeled struktJS IDE (browser, Electron or both) without maintaining a fork: a pruned set of languages and samples, plus a swapped product identity, all driven by one file, customers/<name>/customer.json. A worked example is customers/example/.

Scope: subtractive customization of the built-in plugin and sample set, a white-label pass, and additive customer-authored samples. It is not a way to author brand-new languages; for that see Two things that need no rebuild.

The complete reference, including every field's edge cases, is Customization. This page is the working summary.

customer.json

{
  "productName": "Acme Workbench",
  "appId": "io.acme.workbench",
  "desktopName": "com.acme.workbench.desktop",
  "description": "Acme's customized struktJS-based projectional editor",
  "branding": {
    "icon": "branding/icon.png",
    "slogan": "Acme's Projectional Toolkit",
    "helpUrl": "https://docs.acme.example/workbench",
    "supportUrl": "https://support.acme.example/workbench",
    "aboutBlurb": "Acme Workbench is Acme's internal projectional editor.",
    "tips": [{ "title": "Acme Style Guide", "body": "See the internal wiki.", "icon": "organization" }],
    "homepage": "https://acme.example/workbench",
    "author": { "name": "Acme Support", "email": "support@acme.example" }
  },
  "languages": { "exclude": ["robot", "heating", "vibro", "agreement"] },
  "samples":   { "exclude": ["maze-explorer", "heating-demo"] },
  "packaging": { "publish": { "provider": "github", "owner": "acme-corp", "repo": "acme-workbench-releases" } },
  "workbench": { "defaultTheme": "dark", "preferences": { "ruff.enable": true } }
}
Section Controls
productName, appId, desktopName, description Product identity patched into the app shells and electron-builder.yml.
languages, samples Each takes { include: [...] } or { exclude: [...] } (not both); everything is kept if omitted.
branding.icon A pre-rasterized square PNG, at least 512 by 512, resized into the packaged-app, favicon and splash icons.
branding.slogan, aboutBlurb, helpUrl, supportUrl Welcome and About text; helpUrl adds an "Online Documentation..." Help entry; both URLs must be absolute http(s).
branding.tips Fully replaces the default Welcome "Tip of the Day" set (an empty array disables the card).
branding.splash Boot splash (image, backgroundColor, textColor, showName, showSlogan); see Splash screen.
branding.homepage, branding.author Electron app metadata.
workbench First-run defaults: defaultTheme, preferences (shallow-merged onto the real defaults), plugins.exclude (drop bundled VS Code extensions by id), splash (Electron window sizing and minimum duration).
packaging electron-builder overlay: publish, mac, win, linux, deb, nsis.

Every branding.* field is optional and independently overridable.

The workflow

npm run validate:customer -- customers/<name>/customer.json   # check against the real plugin/sample graph
npm run stage:customer    -- customers/<name>/customer.json   # stage plugins-active/ and samples-active/
npm run apply:customer    -- customers/<name>/customer.json   # patch product identity into tracked files
npm run build             # or build:electron / package:electron*  (unmodified pipeline)
  1. Validate. Checks the config against the actual dependency graph: a devkit is all-or-nothing, _importNames must be satisfied transitively, cross-plugin file imports must resolve, some plugins are hard requirements of src/ (core, lang-pattern, lang-ts, lang-diagram, lang-testlang), customer samples must use kept languages, and branding.icon must exist and be a .png. Any real breakage exits 1.
  2. Stage. Rebuilds the gitignored symlink trees plugins-active/ and samples-active/ that Vite and the discovery code read, with only the kept folders plus the customer's own samples. It re-runs validation first. npm run stage:active-roots restages the full unpruned set. Note that npm run build:webview runs that restage as a pre hook, silently undoing a customer staging. To keep a customer staging across a rebuild, call npx vite build directly.
  3. Apply. Patches product identity in place into tracked files: the two apps' package.json application names, productName/desktopName, electron-builder.yml (appId, productName, copyright), the two product-identity-generated.ts files (the source of PRODUCT_NAME), the tips file, and the icon assets. It refuses to run on a dirty tree for those files and prints the revert command to run after the build.
  4. Build and package with the normal scripts, then revert as printed.

Because step 3 mutates tracked files, run customer builds on a dedicated machine, branch or CI job, not in a shared working directory with concurrent sessions.

Packaging overlay

packaging is a different mechanism: nothing tracked is mutated.

npm run stage:customer:packaging -- customers/<name>/customer.json

writes a gitignored customers/<name>/generated/electron-builder.yml that extends: the real one. Package with the printed command (for example cd theia-electron-app && yarn package:mac -- --config <printed path>). If packaging.publish is omitted the overlay sets publish: false, so a customer build never inherits this repo's own publish destination. Limitation: target arrays can only add installer formats to the base defaults, because the merge concatenates arrays; the validator warns when you set one. Packaged builds are unsigned either way.

Adding a customer sample

Put it at customers/<name>/samples/<sample-name>/, in the same shape as a top-level samples/<name>/: project.json, an optional README.md, and a model/ folder with model.json and the program. Customer samples are always additive and are never named in samples.include or exclude. A name equal to a kept built-in sample overrides it (the validator warns).

Two things that need no rebuild

  • A customer's own language, at runtime. Drop a dev-plugin into ~/.struktjs/dev-plugins/ (or a folder listed in plugin-folders.json); it hot-reloads. See Plugins and devkits.
  • Restricting installable VS Code extensions. ~/.struktjs/extension-allowlist.json, enforced by the backend.

What is not customer-build safe

Do not run npm test against a customer-pruned plugins-active/ and samples-active/. Parts of the suite (the plugin hook-coverage audit, the sample evaluation lists, and the general suite) assume the complete set, so every excluded plugin would report a false failure. A customer build is repackaging of already-tested code.

The product name in new UI strings should come from PRODUCT_NAME, not a hardcoded "struktJS". Documentation text, the AI agent's name and prompt, and Settings descriptions are deliberately outside the white-label pass.