{"id":14223,"library":"verda","title":"Verda Build System","description":"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.","status":"active","version":"1.14.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install verda","lang":"bash","label":"npm"},{"cmd":"yarn add verda","lang":"bash","label":"yarn"},{"cmd":"pnpm add verda","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"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`.","wrong":"import { createBuildAndThenStart } from 'verda';","symbol":"createBuildAndThenStart","correct":"const { createBuildAndThenStart } = require('verda');"},{"note":"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.","wrong":"import { oracle } from 'verda/ruleTypes';","symbol":"ruleTypes","correct":"const { oracle, file } = build.ruleTypes;"},{"note":"Build actions like `run` and `cp` are available as properties of the `build.actions` object, designed to be destructured after initializing the build system.","wrong":"import { run } from 'verda/actions';","symbol":"actions","correct":"const { run, node, cd, cp, rm } = build.actions;"}],"quickstart":{"code":"const { createBuildAndThenStart } = require('verda');\nconst path = require('path');\nconst fs = require('fs/promises');\n\nconst build = createBuildAndThenStart();\n\nconst buildDir = path.join(__dirname, 'build');\nbuild.setJournal(path.join(buildDir, '.verda-journal'));\n\nconst { oracle, file } = build.ruleTypes;\nconst { run, cp, rm } = build.actions;\n\n// Create a dummy source file for the example\n(async () => {\n    await fs.mkdir(path.join(__dirname, 'src'), { recursive: true });\n    await fs.writeFile(path.join(__dirname, 'src', 'main.c'), '#include <stdio.h>\\nint main() { printf(\\\"Hello, Verda!\\\\n\\\"); return 0; }');\n})();\n\n// A simple oracle rule that returns a number\nconst one = oracle(\"one\", async t => {\n    console.log('Computing rule \"one\"');\n    return 1;\n});\n\n// A file rule to compile a C source file into an object file\nconst ObjFile = file.glob('build/*.o', async (t, o) => {\n    console.log(`Compiling ${o.name}.c into ${o.full}`);\n    const c = await t.need(file.named(`src/${o.name}.c`));\n    await run('gcc', c.full, '-c', '-o', o.full);\n});\n\n// An executable rule depending on the object file\nconst Executable = file.named('build/app', async t => {\n    await fs.mkdir(buildDir, { recursive: true });\n    const mainObj = await t.need(ObjFile.named('build/main.o'));\n    console.log(`Linking ${mainObj.full} into build/app`);\n    await run('gcc', mainObj.full, '-o', t.full);\n});\n\n// The default rule to build the application\nbuild.main(Executable);\n\n// To run this, save as 'verdafile.js' and execute 'node verdafile.js'","lang":"typescript","description":"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."},"warnings":[{"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.","message":"Verda'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.","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":">=1.0.0"},{"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`.","message":"Failure 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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.14.0':31 'activ':96 'allow':58 'architectur':109 'asynchron':112 'base':65,108 'build':2,7,26,50,55,72,81,124 'cadenc':87 'class':118 'complex':49 'comprehens':35 'comput':62,104 'core':99 'defin':78,122 'depend':23,59,103 'develop':97 'differenti':100 'dynam':22,102 'effici':111 'employ':15 'enabl':21 'enhanc':44 'execut':80 'explicit':90 'first':117 'first-class':116 'flexibl':76 'graph':51 'immedi':68 'includ':101 'indic':95 'integr':120 'isn':88 'javascript':10,126 'maintain':47 'manag':114 'model':20 'need':69 'number':94 'offer':74 'process':73 'project':13 'promis':18,107 'promise-bas':106 'recip':82 'releas':86 'reliabl':45 'resolut':24 'robust':123 'rule':43,125 'runner':19 'runtim':64 'ship':33 'signific':75 'specif':85 'state':91 'static':54 'strong':41 'strongly-typ':40 'support':39 'system':3,8 'task':27,113 'tool':56 'trace':17 'tradit':53 'type':37,42 'typescript':12,36,119,127 'unlik':52 'verda':1,4,57 'version':30,93","created_at":"2026-04-20T01:58:34.414709+00:00","updated_at":"2026-04-20T01:58:34.414709+00:00","problems":[{"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.","cause":"The 'verda' package is not installed or not resolvable in the current Node.js environment.","error":"Error: Cannot find module 'verda'"},{"fix":"Ensure `const build = createBuildAndThenStart();` is called before accessing `build.ruleTypes` or `build.actions`.","cause":"`createBuildAndThenStart()` was not called or its return value was not assigned to `build`.","error":"TypeError: build.ruleTypes is not defined"},{"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.","cause":"Two or more rules are defined such that they directly or indirectly depend on each other, forming a loop.","error":"Error: Cyclic dependency detected for rule 'myRule'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.24.0","cli_name":"verda","cli_version":null,"type":"library","homepage":"https://verda.dev","github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/verda","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}