Skip to content
LogoLogo

Add VibeLang to an existing project

Install VibeLang's packages in a project that has a package.json, and check that the compiler runs. Then set up the build.

1. Check package.json

package.json must have "type": "module". If it does not, ask the user before you add it: it changes how Node loads the project's .js files.

If package.json depends on a version of effect other than 4.0.5, stop and ask the user. The VibeLang runtime requires effect 4.0.5 exactly.

2. Install the packages

With Bun, run:

bun add vibelang-runtime@0.0.2 effect@4.0.5 @effect/platform-node@4.0.5
bun add -d vibelang@0.0.2 vibelang-vite@0.0.2 vitest@5.0.5 @effect/vitest@4.0.5

With npm, run:

npm install --save-exact vibelang-runtime@0.0.2 effect@4.0.5 @effect/platform-node@4.0.5
npm install --save-dev --save-exact vibelang@0.0.2 vibelang-vite@0.0.2 vitest@5.0.5 @effect/vitest@4.0.5
PackageInstall asPurpose
vibelang-runtimeDependencyThe continuation kernel and helpers that compiled code imports
effect, @effect/platform-nodeDependencyEffect 4.0.5 and its Node platform
vibelangDev dependencyThe compiler and language server, its native binary, and the VS Code extension
vibelang-viteDev dependencyCompiles .vibe modules for Vite and Vitest
vitest, @effect/vitestDev dependencyVitest 5.0.5 and @effect/vitest 4.0.5 for tests

Keep these versions. vibelang-runtime checks Effect's version when it loads, so keep effect, @effect/platform-node, and @effect/vitest at 4.0.5. vibelang, vibelang-runtime, and vibelang-vite are released together; keep them at one version.

Keep optional dependencies enabled. vibelang gets its native compiler from one optional dependency per platform, such as vibelang-darwin-arm64. If an install skips them, for example with npm install --omit=optional, vibelang cannot find its binary and exits with an error.

3. Check the compiler

npx vibelang --version

The output is:

VibeLang 0.0.2 (TypeScript 7.1.0-dev)

Next

Set up the build. For React, Vue, or Svelte with Vite, read React, Vue, or Svelte. For other Vite or Vitest projects, read Vite and Vitest. Without a bundler, read Build with the vibelang CLI. For another bundler, step 3 of Set up VibeLang says what to do.