Files
vercel__workflow/workbench/nitro-v3/plugins/start-pg-world.ts
JJ Kasper 0f557d5ae4 Statically inject workflow world target (#2752)
* Statically inject workflow world target

* Fix static world injection in host bundles

* Fix static world injection gaps

* Fix Vite Nitro server startup

* Fix Nitro pg-native aliasing

* Fix static world target CI gaps

* Fix static world dev rebuild gaps

* Avoid broad runtime alias in Nitro

* Refresh Next dev route for step HMR

* Externalize Nest target world

* Use canary HMR rediscovery timeout

* Bundle local world in Nest builds

* Dedupe world target helpers and fix SvelteKit chunk patch guard
2026-07-06 14:19:45 -07:00

17 lines
522 B
TypeScript

import { createWorld as createPostgresWorld } from '@workflow/world-postgres';
import { definePlugin } from 'nitro';
import { setWorld } from 'workflow/runtime';
// Start the Postgres World
// Needed since we test this in CI
export default definePlugin(async () => {
if (process.env.WORKFLOW_TARGET_WORLD === '@workflow/world-postgres') {
const world = await createPostgresWorld();
setWorld(world);
if (world.start) {
console.log('Starting World workers...');
await world.start();
}
}
});