Skip to content

Run TypeScript via Node 24 type stripping instead of a build step#56

Merged
u9g merged 4 commits into
mainfrom
node24-type-stripping
Jun 30, 2026
Merged

Run TypeScript via Node 24 type stripping instead of a build step#56
u9g merged 4 commits into
mainfrom
node24-type-stripping

Conversation

@u9g

@u9g u9g commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the bundler/compile step and runs the TypeScript entrypoint directly with Node 24's built-in type stripping.

  • Scripts (package.json): dev/start now run node src/main.ts … directly; removed the build (vite) and clean scripts and the vite devDependency. Bumped engines.node to >=24.0.0 and @types/node to ^24. Deleted vite.config.ts.
  • Type checking (tsconfig.json): switched to noEmit typecheck-only; added allowImportingTsExtensions (Node requires explicit .ts import specifiers) and erasableSyntaxOnly (rejects TS syntax Node can't strip). tsc --noEmit remains the type gate.
  • Source: relative imports now carry the extension (./agent./agent.ts).
  • Dockerfile: base image node:22node:24; removed the pnpm build step.
  • CI (tests.yml): Node matrix 2224; removed the "Build project" step. .nvmrc24.

How it works

LiveKit's worker forks a published .js loader that dynamically import()s the agent file, so on Node 24 the agent's .ts is type-stripped automatically — no execArgv/loader wiring needed.

Verification

  • pnpm run typecheck / lint / format:check all pass.
  • node src/main.ts dev boots fully: inference runners initialize in the forked subprocess, connect to LiveKit Cloud, and register the worker.

u9g added 4 commits June 30, 2026 14:47
Drop the vite build and run src/main.ts directly with node, which strips
types natively on Node 24. tsconfig switches to noEmit typecheck-only with
allowImportingTsExtensions and erasableSyntaxOnly; relative imports now
carry explicit .ts extensions. Bump Node to 24 across engines, Dockerfile,
CI, and .nvmrc, and remove the build step from the Dockerfile and CI.
@u9g u9g merged commit 1802719 into main Jun 30, 2026
6 checks passed
@u9g u9g deleted the node24-type-stripping branch June 30, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants