Something went wrong. Try again.
A local-first, resumable GitHub-to-Tangled issue migrator. Built with Next.js and shadcn/ui. MIT licensed.
Something went wrong. Try again.
123456789101112131415import { createMigratorHandler } from './handler.mjs';
type Runtime = { nonce: string; handler: ReturnType<typeof createMigratorHandler> };const globalRuntime = globalThis as typeof globalThis & { tangledMigrator?: Runtime };export function localRuntime() { const origin = process.env.TANGLED_MIGRATOR_ORIGIN; const stateDirectory = process.env.TANGLED_MIGRATOR_STATE_DIR; const nonce = process.env.TANGLED_MIGRATOR_NONCE; if (!origin || !stateDirectory || !nonce) throw new Error('Start the local application with bun start or bun run dev.'); if (!globalRuntime.tangledMigrator || globalRuntime.tangledMigrator.nonce !== nonce) { globalRuntime.tangledMigrator = { nonce, handler: createMigratorHandler({ origin, stateDirectory, nonce }) }; } return globalRuntime.tangledMigrator;}