Skip to content
LogoLogo

API reference

Every package here is published under the @tevm scope on npm and versioned together, currently on the 1.0.0-rc.151 line.

Bundler adapters

You install exactly one of these. Each is a thin wrapper over @tevm/unplugin.

PackageExportGuide
@tevm/vite-pluginvitePluginTevmVite
@tevm/rollup-pluginrollupPluginTevmRollup
@tevm/esbuild-pluginesbuildPluginTevmesbuild
@tevm/webpack-pluginWebpackPluginTevm (constructor)webpack
@tevm/rspack-pluginrspackPluginTevmRspack
@tevm/bun-pluginbunPluginTevmBun
@tevm/requirejs-pluginrequirejsPluginTevmRequireJS

See Bundler plugins for the shared option type.

Pipeline

Consumed by the adapters, and available directly if you are building your own integration.

PackageResponsibility
@tevm/unpluginThe single plugin definition all adapters wrap
@tevm/base-bundlerOrchestrates cache → resolve → compile → codegen
@tevm/configResolves tevm.config.json, Foundry and tsconfig settings
@tevm/resolutionsWalks the Solidity import graph
@tevm/compilerRuns solc and extracts artifacts
@tevm/solcLoads a pinned solc build
@tevm/runtimeGenerates module source from artifacts
@tevm/bundler-cacheFilesystem artifact cache

Editor tooling

PackageResponsibility
@tevm/ts-pluginTypeScript language service plugin
@tevm/lspStandalone Volar-based language server
@tevm/vscodeVS Code extension bundling the language server

Foundations

PackageResponsibility
@tevm/effectSmall Effect wrappers used across the pipeline

Native implementations

@tevm/resolutions-rs and @tevm/runtime-rs are Rust ports of @tevm/resolutions and @tevm/runtime, shipped as prebuilt native binaries with the same behaviour. The JavaScript packages remain the reference implementations and the portable fallback; prefer them unless you have measured that resolution or codegen is your bottleneck.

Conventions used here

  • FileAccessObject — every package that touches the filesystem takes one of these rather than importing node:fs directly, which is what makes the pipeline usable from a language server's in-memory buffers or a browser.
  • Logger — a { info, warn, error, log } object. console satisfies it.
  • Effect — a few functions return Effect values instead of promises. Run them with runPromise / runSync from effect/Effect.
  • sync twins — resolution APIs come in async and sync pairs. The sync ones exist because the TypeScript language service and Bun's module resolver require synchronous answers.