Skip to content

Using unreleased versions of tools early

Anton Trunov edited this page Jul 10, 2024 · 17 revisions

Dev versions of Tact with Blueprint

Dev versions of Tact are published with the next tag on npm.

npm package manager

If you are using Yarn, the following instructions won't work because Yarn ignores NPM's overrides field in package.json. Here is a shell script demonstrating how one can override the Tact version Blueprint uses:

npm 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.0-dev.20240710

To make sure everything work, make sure you don't have a local version of Tact linked or globally installed:

cd /local/path/to/tact/repo
yarn unlink # or something like that for NPM

npm uninstall -g @tact-lang/compiler

VS Code

Extensions folder

Extensions are installed in a per user extensions folder. Depending on your platform, the location is in the following folder:

  • Windows: %USERPROFILE%\.vscode\extensions
  • macOS: ~/.vscode/extensions
  • Linux: ~/.vscode/extensions

(originally described here)

Simplest way to reach that folder without going to terminal is via Command Palette in VSCode (Ctrl/Cmd + Shift + P), then typing Open Extensions Folder.

From there, one can manipulate the installed extensions and even replace some files on the fly.

Updating the Tact grammar

For example, to get the latest VS Code highlighting in the KonVik's VS Code extension for Tact:

  1. Find it in the extensions folder. On Linux and macOS: ~/.vscode/extensions/konvik.tact-lang-vscode-1.3.0/ (version numbers change between releases)
  2. Open that folder in the terminal or in a file explorer
  3. Replace the syntaxes/tact.json file with the latest one from the tact-vscode repo. Alternatively, the package/Tact.tmLanguage.json file from tact-sublime can be taken, but make sure to rename it to tact.json when replacing.

To get continuous updates of the said syntax, one may symlink one of those files mentioned above from tact-vscode or tact-sublime repos cloned locally to your extension folder. On Linux and macOS, it would look like this (assuming you've deleted the tact.json file from the local extension folder):

# Note, that -1.3.0 version suffix may be different in your case, releases happen :)
ln -s \
      /place/of/local/tact-vscode/syntaxes/tact.json \                       # source file to link to
      ~/.vscode/extensions/konvik.tact-lang-vscode-1.3.0/syntaxes/tact.json  # link you're making
Clone this wiki locally