-
Notifications
You must be signed in to change notification settings - Fork 107
Using unreleased versions of tools early
Dev versions of Tact are published with the next
tag on npm.
To make sure everything works, 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
We 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 and also, npm
supports using tags like next
for specifying overrides, but yarn
does not do it.
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.4.1-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 --version
To learn the current next
release version used in the above, i.e. 1.4.1-dev.20240813
, you can use the following shell command:
yarn info @tact-lang/compiler --json | jq '.data."dist-tags".next'
- Locally clone this (Tact compiler) repository somewhere convenient
- Run
yarn clean && yarn gen && yarn build
- Run
yarn link
, to make Yarn linkage available - Go into your Blueprint project folder (how-to create one) and run
yarn link @tact-lang/compiler
Now, you should have your Blueprint's Tact compiler set to the one freshly built in your local tact repo. To keep getting newest updates straight from the GitHub, don't forget to do git pull
and command from the second step above from time to time.
If you wish to reset to the default compiler version specified in Blueprint's dependencies, simply run yarn unlink @tact-lang/compiler
in your Blueprint project folder.
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.1-dev.20240813
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
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.
For example, to get the latest VS Code highlighting in the KonVik's VS Code extension for Tact:
- Find it in the extensions folder. On Linux and macOS:
~/.vscode/extensions/konvik.tact-lang-vscode-1.3.0/
(version numbers change between releases) - Open that folder in the terminal or in a file explorer
- Replace the
syntaxes/tact.json
file with the latest one from the tact-vscode repo. Alternatively, thepackage/Tact.tmLanguage.json
file from tact-sublime can be taken, but make sure to rename it totact.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