-
Notifications
You must be signed in to change notification settings - Fork 214
Using unreleased versions of tools early
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.
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 command 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 projectsImportant
For this part to work you need to make sure all the steps in the first time setup are made.
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, run the following in the terminal just once:
cd /local/path/to/cloned/tact/template
yarn link @tact-lang/compilerAnd 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.
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:fastAfter those commands, all linked installations of the compiler will start using the newly updated one.
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 compilerExtensions for VS Code and VSCode-based editors like VSCodium are frequently updated on their marketplaces:
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.
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/compilerWe provide instructions for npm and yarn below. The instructions are in the form of shell scripts, so you can copy-paste the steps and reproduce those in your setting.
Note that those are incompatible, because the ways of overriding dependencies for the two package managers are different — npm supports using tags like next for specifying overrides, but yarn does not.
To learn the current next release version, i.e. 1.5.4-dev.20240813, use the following shell command:
yarn info @tact-lang/compiler --json | jq '.data."dist-tags".next'Now, proceed with the following instructions and substitute the 1.5.4-dev.20240813 with the version obtained via the previous command:
yarn create ton -y -- TestTactFromNext --type tact-empty --contractName Test
cd TestTactFromNext
rm -rf node_modules yarn.lock
cat <<< $(jq '. += { "resolutions": { "@tact-lang/compiler": "1.5.4-dev.20240813" } }' package.json) > package.json
yarn install
echo 'import "@stdlib/deploy"; contract Test with Deployable { get fun foo(): Address { return newAddress(0,0) } }' > contracts/test.tact
yarn blueprint build && yarn blueprint test
yarn tact --versionnpm create ton -y -- TestTactFromNext --type tact-empty --contractName Test
cd TestTactFromNext
rm -rf node_modules package-lock.json
cat <<< $(jq '. += { "overrides": { "@ton/blueprint": { "@tact-lang/compiler": "next" } } }' package.json) > package.json
npm install
echo 'import "@stdlib/deploy"; contract Test with Deployable { get fun foo(): Address { return newAddress(0,0) } }' > contracts/test.tact
npx blueprint build && npx blueprint test
npx tact --version # should output something like 1.4.1-dev.20240813