Fabr is a build tool. You describe what your project produces — packages, programs, tests, images — and what each is made from, and fabr builds, tests and runs it. Support for each ecosystem comes from a plugin. Fabr ships plugins for JavaScript and TypeScript, Java, OCI container images and AWS, and one project can use any number of them together.
Most repositories accumulate a configuration file per tool per package, a lockfile, and scripts that have to run in the right order. Fabr replaces them with one description of the project:
- One file, not a dozen. A
PROJECT.fabrdescribes every package in the repository. You write notsconfig.json,pom.xmlor test configuration, generated manifests such aspackage.jsonare written for you, and there is no install step. - Nothing is stale, and nothing runs twice. Fabr knows which files each step reads. Ask for a package's tests and whatever they depend on is brought up to date first; change one file and only the steps that read it run again, tests included.
- The same result everywhere, with no lockfile. Dependency versions follow from the build file alone, so there is nothing to drift between machines or conflict in a merge. Fabr downloads the Node.js and JDK your build runs on, too.
- Mistakes surface at build time. Each build step sees only its declared inputs, in a directory and environment of its own, so a dependency that works by accident is an error from the start.
- Variants without a second configuration. A release build, an ES-module build beside a CommonJS one, classes for an older Java release, a build for another platform: the same targets with a different setting.
The introduction explains the ideas behind it.
Fabr is under active development. It builds, tests, runs and publishes JavaScript, TypeScript and Java projects, builds and pushes container images, and reads from and publishes to AWS. It is tested on macOS, Linux and Windows, and it builds and tests itself. It is young, and some things you may rely on aren't there yet: read Known limitations before you commit a project to it.
Fabr needs Node.js 22.19 or later to run. Install the CLI globally, with any plugins you use besides the JavaScript one, which comes with it:
npm install -g @fabr-build/cli # JavaScript and TypeScript
npm install -g @fabr-build/cli @fabr-build/java # and JavaThe container and AWS plugins are @fabr-build/container and @fabr-build/aws, installed the
same way.
Create a PROJECT.fabr at your project root. It loads a plugin and declares a target: what to
build, and what from.
plugin @fabr-build/js;
js_package mylib {
srcs = src:**/*.ts;
tests = src:**/*.test.ts;
}
A Java jar is declared the same way, with the Java plugin's target type:
plugin @fabr-build/java;
jar_package greeter {
srcs = src/main/java:**/*.java;
deps = @mvn:org.apache.commons:commons-text:1.11.0;
main_class = com.example.Greeter;
}
Then build, test and inspect it. The result is kept in fabr's cache rather than written into your project, and you look at it as if it were a directory:
fabr build mylib # compile and assemble the package
fabr test mylib # compile and run the tests
fabr ls mylib # list the built files
fabr cat mylib/index.js # print one of themNothing here says how to compile TypeScript or Java or how to lay out a package. That knowledge is in the plugins; the build file states only what each target is made from. The quick starts for JavaScript and TypeScript and Java carry these examples on to dependencies, tests and runnable programs.
To convert an existing npm, Yarn or pnpm project, fabr-migrate writes a first set of build files
from your package.json files and lockfile; see
Migrating an npm, Yarn or pnpm project. A Maven or
Gradle build is converted by hand, as
Migrating a Maven or Gradle project describes.
The documentation is at fabr.build.
- Start here: the introduction, the quick starts for JavaScript and TypeScript and Java, and the conceptual model.
- Guides: projects with several packages, running your own tools, watch mode and dev servers, VS Code support, continuous integration, auditing dependencies and writing your own rules.
- Reference: the command line, the language syntax, and the core targets and configuration.
- Plugins: JavaScript and TypeScript, Java, container images and AWS.
Fabr builds and tests itself. The Yarn scripts exist to build a first fabr from source, and to
run the checks fabr has no step of its own for yet:
yarn bootstrap # build fabr with tsc, then have that fabr rebuild and test every package
yarn dist # build with tsc, run the tests under jest, and lintRun both before proposing a change. Contributions are welcome: see Getting involved for the repository layout and conventions, and Writing a plugin to add support for a new ecosystem. Please discuss a change to the design before implementing it.
Fabr is free software, licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later).