Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: compiler upgrades in Blueprint and other Tact projects #1560

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added a compilation-related page with the description of the compilation report: PR [#1309](https://github.com/tact-lang/tact/pull/1309), PR [#1387](https://github.com/tact-lang/tact/pull/1387)
- Documented `BaseTrait` and methods in stdlib code: PR [#1296](https://github.com/tact-lang/tact/pull/1296)
- Document how storage variables get updated in relation to the `init()` function: PR [#1311](https://github.com/tact-lang/tact/pull/1311)
- Document compiler upgrades in Blueprint and other Tact projects: PR [#1560](https://github.com/tact-lang/tact/pull/1560)

### Release contributors

Expand Down
44 changes: 42 additions & 2 deletions docs/src/content/docs/book/compile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ prev:
label: Message mode
---

import { Badge } from '@astrojs/starlight/components';
import { Badge, Tabs, TabItem } from '@astrojs/starlight/components';

:::note

Expand All @@ -18,7 +18,46 @@ The Tact compiler can produce various outputs, ranging from the [BoC](/book/cell

With the proper [configuration settings](/book/config), you can customize the behavior of the compiler to skip the generation of some or all the [build artifacts](#artifacts), and even control the addition or exclusion of [getters for supported interfaces](/book/contracts#interfaces).

Since the Tact compiler is a command-line program, some of the configuration settings can be set directly. When inside a folder with a Tact-based project, such as one created using the [Blueprint](https://github.com/ton-org/blueprint) or from the [tact-template](https://github.com/tact-lang/tact-template), refer to the `npx tact --help{:shell}` command for further instructions.
Since the Tact compiler is a command-line program, some of the configuration settings can be set directly. When inside a folder with a Tact-based project, such as one created using the [Blueprint][bp] or from the [tact-template](https://github.com/tact-lang/tact-template), refer to the `npx tact --help{:shell}` command for further instructions.

## Compiler upgrades {#upgrades}

Work on the compiler is active and extensive, so be sure to check out [NPM](https://www.npmjs.com/package/@tact-lang/compiler) whenever we push new releases. To follow updates, see the [Tact Kitchen in Telegram](https://t.me/tact_kitchen) for the short scoop, or our [GitHub organization](https://github.com/tact-lang) for the whole picture in all its details.

To upgrade the Tact compiler to its latest version in a [Blueprint][bp]-based project or a project created from the [tact-template](https://github.com/tact-lang/tact-template), run:
novusnota marked this conversation as resolved.
Show resolved Hide resolved

<Tabs>
<TabItem label="yarn" icon="seti:yarn">
```shell
# recommended
yarn upgrade @tact-lang/compiler
```
</TabItem>
<TabItem label="npm" icon="seti:npm">
```shell
npm i @tact-lang/compiler@latest
```
</TabItem>
<TabItem label="pnpm" icon="pnpm">
```shell
pnpm upgrade @tact-lang/compiler
```
</TabItem>
<TabItem label="bun" icon="bun">
```shell
bun update --latest @tact-lang/compiler
```
</TabItem>
</Tabs>

Sometimes, bug fixes require us to change the existing behavior, introducing small breaking changes. To be prepared for these, make sure to read the [CHANGELOG.md](https://github.com/tact-lang/tact/blob/main/dev-docs/CHANGELOG.md) and act accordingly.

Except for bug fixes, Tact tries its best not to introduce breaking changes in minor or patch versions according to [semantic versioning](https://semver.org/#summary). And if there would be a major release that would significantly rework the language and its APIs, the Tact team will provide you with tools to patch the code itself, beyond the compiler upgrade commands shown above.
novusnota marked this conversation as resolved.
Show resolved Hide resolved

:::caution

Do not mix different Node.js package managers in your projects. If you created the [Blueprint][bp] project with `npm`, stick to using `npm` for the rest of the commands — this will ensure that you don't get "File not found" errors or lock-file conflicts between different package managers.
:::

## Build artifacts {#artifacts}

Expand Down Expand Up @@ -149,6 +188,7 @@ Thus, the following dependency diagram is produced:

[tlb]: https://docs.ton.org/develop/data-formats/tl-b-language
[mm]: https://mermaid.js.org/
[bp]: https://github.com/ton-org/blueprint

[code-jetton-wallet]: https://github.com/tact-lang/jetton/blob/70f6c9c51755fcab4b451da0cd2f2016476271cc/sources/jetton_wallet.tact
[code-jetton-minter]: https://github.com/tact-lang/jetton/blob/70f6c9c51755fcab4b451da0cd2f2016476271cc/sources/jetton_minter_discoverable.tact
2 changes: 1 addition & 1 deletion docs/src/content/docs/ref/evolution/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ List of [merged TEPs](https://github.com/ton-blockchain/TEPs#merged-teps).

## Changelog

All notable changes to the main Tact repository are documented in the [CHANGELOG.md](https://github.com/tact-lang/tact/blob/main/CHANGELOG.md).
All notable changes to the main Tact repository are documented in the [CHANGELOG.md](https://github.com/tact-lang/tact/blob/main/dev-docs/CHANGELOG.md).
2 changes: 1 addition & 1 deletion docs/src/content/docs/zh-cn/ref/evolution/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ TON Enhancement Proposals 的主要目标是提供一种方便、正式的方式

## 更新日志

主 Tact 代码库的所有显著变更都记录在 [CHANGELOG.md](https://github.com/tact-lang/tact/blob/main/CHANGELOG.md) 中。
主 Tact 代码库的所有显著变更都记录在 [CHANGELOG.md](https://github.com/tact-lang/tact/blob/main/dev-docs/CHANGELOG.md) 中。
22 changes: 11 additions & 11 deletions src/cli/tact/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ const showHelp = () => {
$ tact [...flags] (--config CONFIG | FILE)

Flags
-c, --config CONFIG Specify path to config file (tact.config.json)
-p, --project ...names Build only the specified project name(s) from the config file
-q, --quiet Suppress compiler log output
--with-decompilation Full compilation followed by decompilation of produced binary code
--func Output intermediate FunC code and exit
--check Perform syntax and type checking, then exit
-e, --eval EXPRESSION Evaluate a Tact expression and exit
-v, --version Print Tact compiler version and exit
-h, --help Display this text and exit
-c, --config CONFIG Specify path to config file (tact.config.json)
-p, --project ...names Build only the specified project name(s) from the config file
-q, --quiet Suppress compiler log output
--with-decompilation Full compilation followed by decompilation of produced binary code
--func Output intermediate FunC code and exit
--check Perform syntax and type checking, then exit
-e, --eval EXPRESSION Evaluate a Tact expression and exit
-v, --version Print Tact compiler version and exit
-h, --help Display this text and exit

Examples
$ tact --version
${getVersion()}
$ tact --version
${getVersion()}

Learn more about Tact: https://docs.tact-lang.org
Join Telegram group: https://t.me/tactlang
Expand Down
Loading