Skip to main content

Powerhouse v6.3.0

6.3.0 makes hosts and ph run the way to run a project. Nothing is removed in this release. What 6.4 removes prints a warning, and each warning links to the migration page.

What is new​

Hosts and ph run are always on​

A project describes every way it can run in its hosts/ folder. Each subfolder holds one host file:

hosts/
connect/host.js ph run connect
switchboard/host.js ph run switchboard
vetra/host.js ph run vetra
desktop/host.js ph run desktop
assistant/host.js ph run assistant
cli/host.js ph run cli
ph run vetra
ph run connect dev
ph run switchboard
  • ph run <host> [verb] starts a host. The verb defaults to run.
  • ph init always writes the hosts/ folder. The --uniform-runners option is no longer needed.
  • ph <host> is short for ph run <host> when no built-in command has that name.
  • The FEATURE_UNIFORM_RUNNERS_ENABLED variable has no effect any more.

See Hosts, Runners & Plugins.

Tools for host files​

ph host check switchboard
ph host export switchboard --out switchboard.json
ph generate hosts
ph run switchboard --explain drives
  • ph host check <host> loads and validates a host the way ph run would, without starting it. It exits with code 1 on any issue.
  • ph host export <host> prints a host as declared, as JSON. --out writes it to a file.
  • ph generate hosts writes outputs.js for every host whose runner declares outputs, and refreshes hosts/types.d.ts. Run it again after you change a host that other hosts read from.
  • ph run <host> --explain drives prints the drive plan of a host instead of starting it. --explain outputs prints what each host produces and the start order.

ph migrate adds host files and has a dry run​

ph migrate 6.3.0 --dry-run
ph migrate 6.3.0
  • ph migrate adds the hosts/ folder to a project that has none. The switchboard host lists the plugins the classic Switchboard ran.
  • --dry-run prints a diff of every file the migration would add, change or delete, and writes nothing.
  • ph migrate works from any folder inside the project.
  • ph migrate keeps the package.json scripts you changed yourself and updates the ones an earlier ph init wrote.
  • ph migrate moves studio.host, studio.openBrowser and reactor.https from powerhouse.config.json into the host files it adds, and prints what it did with each key.
  • ph migrate no longer overwrites the root files of the project, such as the Dockerfile and the CI workflows. It adds the ones the project lacks and prints a line for a kept file the current template has moved on from.

A store records its migration release​

A store now records the last release that completed its one-time migrations. A later release that drops a migration uses this record to refuse a store that still needs it, and names the release to run first. 6.3.0 refuses no store.

GraphQL clients send the new argument names​

The clients in this release send idOrSlug, documentIdOrSlug, parentIdOrSlug, sourceIdOrSlug and targetIdOrSlug. They need a Switchboard on 6.2.3-dev.35 or later. Upgrade the Switchboard before its clients.

What warns​

These keep working in 6.3. Each prints a warning once per command. The migration page lists every warning and what to do about it.

WhatUse instead
ph vetra, ph connect, ph switchboard in a project without host filesph migrate, then ph run <host>
ph connect, ph switchboard in a project with host filesph run connect dev, ph run switchboard
ph reactorph run switchboard
ph switchboard --migrate, --migrate-status, --reset, --devph run switchboard migrate, migrate-status, reset, dev
FEATURE_PLUGIN_HOST_ENABLED=falseRemove the variable
FEATURE_UNIFORM_RUNNERS_ENABLED=falseRemove the variable
studio.host, studio.https, studio.openBrowser, reactor.https, reactor.storage, switchboard.database.url in powerhouse.config.jsonThe host files
connect.drives.allowAddDrive, connect.drives.sections, connect.drives.icons, connect.home.background at the top levelThe generic Connect plugin's config in hosts/connect/host.js
reactor.workflows in a host fileThe workflows plugin under runner.plugins
A host file where readModel.url also holds the reactor storeAn explicit storage on the backend

Deprecated in code, without a link to the migration page:

  • The write methods of the IReactorClient facade log one warning per process. Use the write half of the client instead. Set PH_SILENCE_DEPRECATIONS to silence these warnings.
  • reactorClient in subgraphs is marked @deprecated. Use ctx.clients.read and ctx.clients.write.
  • The GraphQL argument names identifier, documentId, documentIdentifier, parentIdentifier, sourceIdentifier and targetIdentifier are marked @deprecated in the schema. Use the names listed above.

What goes in 6.4​

6.4 is a breaking release. It removes what 6.3 warns about:

  • A project without host files does not start. The error names ph migrate.
  • The classic boot path of ph vetra, ph connect and ph switchboard. The three names stay as short forms of ph run <host>.
  • ph reactor.
  • The powerhouse.config.json keys in the table above become errors.
  • FEATURE_UNIFORM_RUNNERS_ENABLED=false stops the start.
  • FEATURE_PLUGIN_HOST_ENABLED: the plugin host is the only path.
  • reactor.workflows and the readModel.url fallback in host files.

These stay in 6.4: MCP_ENABLED, PH_WORKFLOWS_ENABLED, DOCUMENT_MODEL_SUBGRAPHS_ENABLED, DATABASE_URL, PORT and PH_SWITCHBOARD_PORT.

What goes in 6.5​

Not before 6.5:

  • The IReactorClient facade with its deprecated write methods, and reactorClient in subgraphs.
  • The old GraphQL argument names.

How to upgrade​

  1. Upgrade the Switchboard before the clients that talk to it.

  2. Preview and run the migration in each project:

    ph migrate 6.3.0 --dry-run
    ph migrate 6.3.0
  3. Review hosts/switchboard/host.js. Read the lines ph migrate printed under "Settings of powerhouse.config.json the host files take", and move the keys it kept into the host files by hand.

  4. Replace the classic commands in your scripts, Dockerfile and CI with ph run <host>.

  5. Start every host and check that no line starts with Warning:.

Go to 6.4 only after 6.3 runs without warnings. The migration page has the full steps.

A project that still has document models on the 5.x layout runs the 6.2.2 migration first:

npx @powerhousedao/ph-cli@6.2.2 migrate 6.2.2

Version numbers​

From this release a version reads GENERATION.BREAKING.RELEASE. The second position may break; the third never does. Pin exact versions or use a tilde range such as ~6.3.0. A caret range such as ^6.3.0 accepts 6.4.0 and with it the break.