Changelog & upgrading
Release notes for every version are on GitHub Releases, and in packages/norn/CHANGELOG.md, generated from changesets.
Upgrading from 1.x
Section titled “Upgrading from 1.x”Norn 2 replaces the @norn-ts/* packages with one, @norn-ts/norn, and drops codegen.
- Packages. Remove
@norn-ts/core,workflow,activity,client,worker,testing,cli,codec,honoandeslint-plugin, and add@norn-ts/norn. Imports move to@norn-ts/norn/workflow,/client,/worker,/testing,/vitestand/vite. - Activities. Remove
@Activities,@Activity,@NonRetryableand@Service. Move each method’s options to the workflow:useActivities<PaymentActivities>('payments', { timeout, retries, nonRetryable, methods }), withimport typefor the class. The namespace is the old prefix without its trailing dot. Build your services with constructors. - Workflows. Replace
.norn/activitiesimports withimport typefrom the activity file. Addsrc/workflows/index.tsexporting every workflow class. - Worker.
createWorker({ registry })becomescreateWorker({ workflows: new URL('./workflows/index.ts', import.meta.url), activities: { payments: new PaymentActivities(gateway) } }). - Client. Pass the workflow class instead of the generated contract:
norn.workflow(OrderWorkflow). - Tests.
useTestEnv({ registry, activities: mockActivities(...) })becomesuseTestEnv({ workflows, activities: { payments: { charge: vi.fn(...) } } }). - Clean up. Delete
.norn/,norn.config.ts,norn.lock.jsonand thegenscripts.
Activity names stay <namespace>.<method>, so in-flight executions keep working as long as the namespaces match the old prefixes and no @Activity({ name }) renamed a method.