tangramdotdev / tangram

Tangram is a build system and package manager.
https://www.tangram.dev
MIT License
86 stars 6 forks source link

Tangram

Tangram is a build system and package manager.

To get started, run the install script below, or download the latest release and add it to $PATH.

curl -fsSL https://tangram.dev/install.sh | sh

Create a file at the root of your project called tangram.ts with the following content:

export default tg.target(() => tg.file("Hello, World!"));

Run tg build.

$ tg build
fil_01tvcqmbbf8dkkejz6y69ywvgfsh9gyn1xjweyb9zgv0sf4752446g

$ tg cat fil_01tvcqmbbf8dkkejz6y69ywvgfsh9gyn1xjweyb9zgv0sf4752446g
Hello, World!

As a build system

Use Tangram to build your existing projects faster and more reliably. This example builds a Rust project with the native libraries it depends on.

import openssl from "openssl";
import { cargo } from "rust";
import * as std from "std";

import source from "./packages/hello";

export default tg.target(() => {
  return cargo.build({
    env: std.env(openssl()),
    source,
  });
});

Run tg run to build and run the program.

$ tg run
Hello, World!

As a package manager

Use Tangram to build reproducible environments that start instantly. This example builds an environment that contains specific versions of jq and ripgrep.

import jq from "jq";
import sqlite from "sqlite";
import * as std from "std";

export default tg.target(() => std.env(jq(), ripgrep()));

Run tg run -- sh to build the environment and run a shell in it.

$ tg run -- sh

$ jq --version
jq-1.7.1

$ sqlite3 --version
3.43.2

$ exit