Skip to content

Using unreleased versions of tools early

Novus Nota edited this page Feb 18, 2025 · 25 revisions

Bleeding-edge versions of Tact

This is important for the development of the compiler and if you want to receive all the latest features and fixes without waiting for a new release.

See the following subsections to start using Tact in your projects directly from its official GitHub repository.

First time setup

Important

Ensure that you have Node.js 22+ installed. To check, run node --version — it should show you the version 22.0.0 or later. If not, download and install Node.js from here: https://nodejs.org/en/download.

Tact compiler uses package manager Yarn, to enable and install it run: corepack enable yarn. Check installation with yarn -v — if it shows the version number, then everything's ready.

If it's your first time working with Tact from its GitHub repository, run the following commands in the terminal. Just once:

# Cloning the Tact compiler repository somewhere convenient
git clone https://github.com/tact-lang/tact

# Get into the repo
cd tact
yarn install # dependencies
yarn build:fast # compiler
yarn link # to prepare the compiler for use in projects

Linking in tact-template

The linking approach works best with tact-template, because template uses the same package manager.

If not already, clone the template manually or via the GitHub interface itself.

Then, assuming you've made all the steps in the first time setup, run the following commands in the terminal. Just once:

cd /local/path/to/cloned/tact/template
yarn link @tact-lang/compiler

And that's it — now it'll use the Tact from its cloned repository and not from the public NPM registry.

To upgrade the Tact compiler from time to time, see: Compiler upgrades.

Linking in Blueprint

It's better to create the project with Yarn v1, otherwise the linking approach might not work due to various limitations of corepack.

To create a new empty Blueprint project with Tact, run:

# Will create the `your-folder-name` folder with an empty Tact project named BlankContract
yarn create ton your-folder-name --type tact-empty --contractName BlankContract

Then, assuming you've made all the steps in the first time setup, run the following commands in the terminal. Just once:

yarn link @tact-lang/compiler

And that's it — now it'll use the Tact from its cloned repository and not from the public NPM registry.

Compiler upgrades

To upgrade the compiler, run the following commands:

# Get into the folder with Tact
cd /local/path/to/cloned/tact/repo

# Fetch and pull updates
git pull

# Refresh dependencies and rebuild the compiler
yarn install
yarn build:fast

After those commands, all linked installations of the compiler will start using the newly updated one.

Global availability

To invoke the locally built Tact compiler in any folder of any project via its CLI, run the following:

# Get into the folder with Tact
cd /local/path/to/cloned/tact/repo

# Install it globally
npm i -g .

Aside from the compiler, it'll also give you the access to the latest version of the BoC disassembler bundled with it:

unboc --help # disasm
tact --help # tact compiler

Tact language server, related extensions and plugins

Extensions for VS Code and VSCode-based editors like VSCodium are frequently updated and released:

To get even more recent updates, or to set it up for other editors like (Neo)Vim, Sublime Text, Helix, and others, see the installation steps here. They use the nightly releases in the GitHub's repo of the Tact language server.

Tip

GitHub repository: Tact language server

Published dev versions of Tact with Blueprint

Some development versions of Tact are published with the next tag on NPM. However, those releases are rather rare, so prefer to use the Bleeding-edge versions of Tact instead.

If you still wish to proceed, let's make sure everything works and remove the linked local version of Tact or a globally installed one, if either is present:

cd /local/path/to/tact/repo
yarn unlink # npm command is very similar, just replace yarn with npm
npm uninstall -g @tact-lang/compiler

Then, simply override the dependency in your Blueprint project as such:

# To print the actual version behind the `next` tag
yarn info @tact-lang/compiler --json | jq '.data."dist-tags".next'

# Now, let's use that version
yarn add @tact-lang/compiler@replaceMeWithOutputVersionOfThePreviousCommand

The commands for npm and other package managers would be very similar. Refer to the documentation of the package manager of your choice for more info.