Registry / devops / verda
library1.24.0jsnpmunverified

Verda is a build system for JavaScript and TypeScript projects that employs a tracing promise runner model, enabling dynamic dependency resolution for build tasks. As of version 1.14.0, it ships with comprehensive TypeScript types and supports strongly-typed rules, enhancing reliability and maintainability for complex build graphs. Unlike traditional static build tools, Verda allows dependencies to be computed at runtime based on the immediate needs of the build process, offering significant flexibility in defining and executing build recipes. While a specific release cadence isn't explicitly stated, the version number indicates active development. Its core differentiators include dynamic dependency computation, a promise-based architecture for efficient asynchronous task management, and first-class TypeScript integration for defining robust build rules.

npm install verda
INSTALL
IMPORT
SIG · VERDA
V
verda
devopsjavascriptv1.24.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createBuildAndThenStart
const { createBuildAndThenStart } = require('verda');
import { createBuildAndThenStart } from 'verda';
The official documentation uses CommonJS `require()`. While TypeScript types are shipped, direct ESM `import` may require specific Node.js or bundler configuration if not explicitly supported by the package's `exports`.
ruleTypes
const { oracle, file } = build.ruleTypes;
import { oracle } from 'verda/ruleTypes';
Rule types like `oracle` and `file` are exposed as properties of the `build.ruleTypes` object returned by `createBuildAndThenStart()`, not as direct top-level exports from the package.
actions
const { run, node, cd, cp, rm } = build.actions;
import { run } from 'verda/actions';
Build actions like `run` and `cp` are available as properties of the `build.actions` object, designed to be destructured after initializing the build system.

This quickstart demonstrates defining a basic build system with Verda, including an oracle rule, a file glob rule to compile a C file, and a final executable rule. It shows how to use `build.setJournal`, `build.ruleTypes` (oracle, file), and `build.actions` (run, cp, rm) to create a multi-stage build process. It also sets up a dummy source file for demonstration.

const { createBuildAndThenStart } = require('verda'); const path = require('path'); const fs = require('fs/promises'); const build = createBuildAndThenStart(); const buildDir = path.join(__dirname, 'build'); build.setJournal(path.join(buildDir, '.verda-journal')); const { oracle, file } = build.ruleTypes; const { run, cp, rm } = build.actions; // Create a dummy source file for the example (async () => { await fs.mkdir(path.join(__dirname, 'src'), { recursive: true }); await fs.writeFile(path.join(__dirname, 'src', 'main.c'), '#include <stdio.h>\nint main() { printf(\"Hello, Verda!\\n\"); return 0; }'); })(); // A simple oracle rule that returns a number const one = oracle("one", async t => { console.log('Computing rule "one"'); return 1; }); // A file rule to compile a C source file into an object file const ObjFile = file.glob('build/*.o', async (t, o) => { console.log(`Compiling ${o.name}.c into ${o.full}`); const c = await t.need(file.named(`src/${o.name}.c`)); await run('gcc', c.full, '-c', '-o', o.full); }); // An executable rule depending on the object file const Executable = file.named('build/app', async t => { await fs.mkdir(buildDir, { recursive: true }); const mainObj = await t.need(ObjFile.named('build/main.o')); console.log(`Linking ${mainObj.full} into build/app`); await run('gcc', mainObj.full, '-o', t.full); }); // The default rule to build the application build.main(Executable); // To run this, save as 'verdafile.js' and execute 'node verdafile.js'
verda --version
Debug
Known issues
gotchaVerda's dynamic dependency resolution, while powerful, can lead to complex build graphs that are harder to debug if not carefully designed. Circular dependencies or unintended side effects can arise, requiring careful rule definition.
fix
Organize rules logically, use explicit `t.need()` calls, and regularly review the build graph for potential complexities. Leverage the journal file to understand execution flow.
affects: >=1.0.0
gotchaThe examples predominantly use CommonJS `require()` syntax. While TypeScript types are provided, users attempting to use ESM `import` statements directly might encounter module resolution errors if the package's `package.json` does not explicitly define ESM entry points.
fix
Stick to `require()` for Node.js scripts as shown in the documentation. For TypeScript projects, ensure your `tsconfig.json` `module` setting is compatible (e.g., `CommonJS`) or use a bundler that handles CJS-to-ESM conversion.
affects: >=1.0.0
gotchaFailure to call `build.setJournal()` or providing an invalid path can lead to Verda not correctly tracking build state, potentially resulting in unnecessary rebuilds or inconsistent build outputs.
fix
Always configure `build.setJournal()` with a valid, writable file path. It's recommended to place the journal file within your build output directory, e.g., `build/.verda-journal`.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'verda'
The 'verda' package is not installed or not resolvable in the current Node.js environment.
fix
Run `npm install verda` or `yarn add verda` in your project directory. Ensure your Node.js project's `node_modules` are correctly set up.
TypeError: build.ruleTypes is not defined
`createBuildAndThenStart()` was not called or its return value was not assigned to `build`.
fix
Ensure `const build = createBuildAndThenStart();` is called before accessing `build.ruleTypes` or `build.actions`.
Error: Cyclic dependency detected for rule 'myRule'
Two or more rules are defined such that they directly or indirectly depend on each other, forming a loop.
fix
Rearchitect your build rules to break the circular dependency. Ensure that a rule only `need`s outputs from previous stages and does not implicitly or explicitly depend on its own output or a future stage.
Upgrade
Version history
1.24.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
verda — npm install verda · libregistry