Skip to content

Commit

Permalink
Merge branch 'main' into docs/cookbook-stonfi
Browse files Browse the repository at this point in the history
  • Loading branch information
a-bahdanau authored Nov 1, 2024
2 parents 4bb7518 + 1b05601 commit 0aeb00f
Show file tree
Hide file tree
Showing 172 changed files with 27,887 additions and 10,073 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/tact-docs-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
# The check for the 'main' branch is done on the job level
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
branches: ["main"]

# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -29,8 +30,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
# with:
# fetch-depth: 0
with:
fetch-depth: 0

- name: Install, build and store site artifact
uses: withastro/action@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tact-docs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ jobs:
cache: "yarn"
cache-dependency-path: "docs/yarn.lock"

- name: Perform syntax and type checking of the Cookbook
working-directory: docs
run: node scripts/check-cookbook-examples.js

- name: Install dependencies
working-directory: docs
run: yarn deps
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/tact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ env:
HUSKY: 0

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
branches: ["**"]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -231,7 +229,17 @@ jobs:
- name: (pnpm) Test creation of new Blueprint projects
if: ${{ matrix.package-manager == 'pnpm' }}
run: |
npm i -g pnpm
# Installing the specific pnpm version to work around https://github.com/pnpm/pnpm/issues/5000
# and not fail suddenly when a release comes that fixes this
# NOTE: revisit and simplify this step if/when those bugs with pnpm are resolved
npm i -g [email protected]
# To help pnpm recognize the shell (they cannot do it themselves sometimes...)
${{ matrix.os != 'windows-latest' && 'export SHELL=bash' || 'echo windows_noop' }}
pnpm setup -f
# To source .bashrc on Linux:
${{ matrix.os == 'ubuntu-latest' && 'source ~/.bashrc' || 'echo noop' }}
# To expose stuff for pnpm directly on macOS (because otherwise the pre-installed Node.js version gets used):
${{ matrix.os == 'macos-latest' && 'export PNPM_HOME=~/Library/pnpm; export PATH=$PNPM_HOME:$PATH' || 'echo noop' }}
pnpm link -g
cd ..
pnpm create ton@latest test-project --type tact-counter --contractName Counter
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
.idea
.DS_Store
*.swp
node_modules
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn lint:all
yarn lint:all && cd docs && yarn lint:all
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Docs: the `description` property to the frontmatter of the each page for better SEO: PR [#916](https://github.com/tact-lang/tact/pull/916)
- Docs: Google Analytics tags per every page: PR [#921](https://github.com/tact-lang/tact/pull/921)
- Docs: Added Ston.fi cookbook: PR [#956](https://github.com/tact-lang/tact/pull/956)
- Docs: Added NFTs cookbook: PR [#958](https://github.com/tact-lang/tact/pull/958)
- Ability to specify a compile-time method ID expression for getters: PR [#922](https://github.com/tact-lang/tact/pull/922) and PR [#932](https://github.com/tact-lang/tact/pull/932)
- Destructuring of structs and messages: PR [#856](https://github.com/tact-lang/tact/pull/856)
- Docs: automatic links to Web IDE from all code blocks: PR [#994](https://github.com/tact-lang/tact/pull/994)
- The `SendDefaultMode` send mode constant to the standard library: PR [#1010](https://github.com/tact-lang/tact/pull/1010)
- Docs: initial semi-automated Chinese translation of the documentation: PR [#942](https://github.com/tact-lang/tact/pull/942)
- The `replace` and `replaceGet` methods for the `Map` type: PR [#941](https://github.com/tact-lang/tact/pull/941)

### Changed

- The `parseImports` function now returns AST import nodes instead of raw strings: PR [#966](https://github.com/tact-lang/tact/pull/966)
- Optional types for `self` argument in `extends mutates` functions are now allowed: PR [#854](https://github.com/tact-lang/tact/pull/854)
- Docs: complete overhaul of the exit codes page: PR [#978](https://github.com/tact-lang/tact/pull/978)
- Docs: enhanced Jettons Cookbook page: PR [#944](https://github.com/tact-lang/tact/pull/944)

### Fixed

- Collisions in getter method ids are now handled and reported properly: PR [#875](https://github.com/tact-lang/tact/pull/875)
- Docs: layout of tables, syntax highlighting, Chinese translations of sidebar separators: PR [#916](https://github.com/tact-lang/tact/pull/916)
- Non-null struct fields after null ones are treated correctly in Sandbox tests after updating `@ton/core` to 0.59.0: PR [#933](https://github.com/tact-lang/tact/pull/933)
- Prevent inline code snippets from changing their background color: PR [#935](https://github.com/tact-lang/tact/pull/935)
- Docs: correctly handle next and previous page links at the bottom of the pages when there's a separator item in the sidebar: PR [#949](https://github.com/tact-lang/tact/pull/949)
- Docs: compilation of examples in `data-structures.mdx` and across Cookbook: PR [#917](https://github.com/tact-lang/tact/pull/917)

### Release contributors

Expand Down Expand Up @@ -64,11 +75,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The `storeBit` method for `Builder` type and the `loadBit` method for `Slice` type: PR [#699](https://github.com/tact-lang/tact/pull/699), PR [#936](https://github.com/tact-lang/tact/pull/936)
- The `toSlice` method for structs and messages: PR [#630](https://github.com/tact-lang/tact/pull/630), PR [#936](https://github.com/tact-lang/tact/pull/936)
- Wider range of serialization options for integers — `uint1` through `uint256` and `int1` through `int257`: PR [#558](https://github.com/tact-lang/tact/pull/558), PR [#937](https://github.com/tact-lang/tact/pull/937)
- The `deepEquals` method for the `Map` type: PR [#637](https://github.com/tact-lang/tact/pull/637)
- The `deepEquals` method for the `Map` type: PR [#637](https://github.com/tact-lang/tact/pull/637), PR [#939](https://github.com/tact-lang/tact/pull/939)
- `asm` bodies for module-level functions: PR [#769](https://github.com/tact-lang/tact/pull/769), PR [#825](https://github.com/tact-lang/tact/pull/825)
- Corresponding stdlib functions for new TVM instructions from 2023.07 and 2024.04 upgrades: PR [#331](https://github.com/tact-lang/tact/pull/331). Added the `storeBuilder` extension function and `gasConsumed`, `getComputeFee`, `getStorageFee`, `getForwardFee`, `getSimpleComputeFee`, `getSimpleForwardFee`, `getOriginalFwdFee`, `myStorageDue` functions.
- `slice`, `rawSlice`, `ascii` and `crc32` built-in functions: PR [#787](https://github.com/tact-lang/tact/pull/787), PR [#799](https://github.com/tact-lang/tact/pull/799)
- `Builder.storeMaybeRef`, `parseStdAddress` and `parseVarAddress` stdlib functions: PR [#793](https://github.com/tact-lang/tact/pull/793)
- `slice`, `rawSlice`, `ascii` and `crc32` built-in functions: PR [#787](https://github.com/tact-lang/tact/pull/787), PR [#799](https://github.com/tact-lang/tact/pull/799), PR [#951](https://github.com/tact-lang/tact/pull/951)
- `Builder.storeMaybeRef`, `parseStdAddress` and `parseVarAddress` stdlib functions: PR [#793](https://github.com/tact-lang/tact/pull/793), PR [#950](https://github.com/tact-lang/tact/pull/950)
- The compiler development guide: PR [#833](https://github.com/tact-lang/tact/pull/833)
- Constant evaluator now uses an interpreter: PR [#664](https://github.com/tact-lang/tact/pull/664). This allows calls to user-defined functions and references to declared global constants.

Expand Down
8 changes: 8 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
project_id: "723773"
api_token_env: CROWDIN_PERSONAL_TOKEN
preserve_hierarchy: 1
files:
- source: /docs/src/content/docs/**/*
translation: /docs/src/content/docs/%two_letters_code%/**/%original_file_name%
ignore:
- /docs/src/content/docs/%two_letters_code%
1 change: 1 addition & 0 deletions cspell-fift-words-adjusted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Pos
Split
abort
abs
addop
allot
and
anon
Expand Down
3 changes: 3 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"rangle",
"rawslice",
"renamer",
"replaceget",
"rparen",
"rugpull",
"rugpulled",
Expand All @@ -107,6 +108,8 @@
"Tarjan",
"testdata",
"Topup",
"Toncoin",
"Toncoins",
"Trunov",
"typechecker",
"uintptr",
Expand Down
4 changes: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ All commands are run from the root of the project, from a terminal:
| `yarn astro ...` | Run CLI commands like `astro add`, `astro check`, etc.
| `yarn astro -- --help` | Get help using the Astro CLI.

### ⚠️ Gotchas

- When updating TextMate grammars in `grammars/` (for example, `grammar-tact.json`), make sure that the value for the `"name"` property is written all lowercase, otherwise highlighting will break.

### 👀 Want to learn more about the framework behind Tact docs?

Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
Expand Down
37 changes: 25 additions & 12 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';

// Adds links to Web IDE from code blocks
import remarkLinksToWebIDE from './links-to-web-ide';

// Adds syntax highlighting for inline code blocks
import rehypeInlineCodeHighlighting from './inline-code-highlighting';

Expand All @@ -26,14 +29,15 @@ export default defineConfig({
outDir: './dist', // default, just to be sure
site: 'https://docs.tact-lang.org',
markdown: {
remarkPlugins: [remarkHeadingId, remarkMath],
remarkPlugins: [remarkHeadingId, remarkMath, remarkLinksToWebIDE],
rehypePlugins: [
rehypeHeadingIds,
[rehypeAutolinkHeadings, {
behavior: "append",
properties: {
class: "autolink-header",
ariaHidden: true,
ariaHidden: "true",
ariaLabel: "Link to this header",
tabIndex: -1,
},
}],
Expand Down Expand Up @@ -66,7 +70,7 @@ export default defineConfig({
// Per-page Google tag setup
tag: "script",
content: "window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag('js',new Date());gtag('config','G-ZJ3GZHJ0Z5');",
}
},
],
social: {
github: 'https://github.com/tact-lang/tact',
Expand Down Expand Up @@ -137,7 +141,8 @@ export default defineConfig({
{
label: 'Fundamentals of Tact',
translations: { 'zh-CN': 'Tact 语言基础' },
link: '#', attrs: { class: 'sidebar-separator' }
attrs: { class: 'sidebar-separator' },
link: 'book/types#',
},
{ slug: 'book/types' },
{ slug: 'book/integers' },
Expand All @@ -150,7 +155,8 @@ export default defineConfig({
{
label: 'Expressiveness',
translations: { 'zh-CN': '表现力' },
link: '#', attrs: { class: 'sidebar-separator' }
attrs: { class: 'sidebar-separator' },
link: 'book/operators#',
},
{ slug: 'book/operators' },
{ slug: 'book/expressions' },
Expand All @@ -160,7 +166,8 @@ export default defineConfig({
{
label: 'Communication',
translations: { 'zh-CN': '交流' },
link: '#', attrs: { class: 'sidebar-separator' }
attrs: { class: 'sidebar-separator' },
link: 'book/receive#',
},
{ slug: 'book/receive' },
{ slug: 'book/bounced' },
Expand All @@ -171,7 +178,8 @@ export default defineConfig({
{
label: 'Going places',
translations: { 'zh-CN': '前往各地' },
link: '#', attrs: { class: 'sidebar-separator' }
attrs: { class: 'sidebar-separator' },
link: 'book/deploy#',
},
{ slug: 'book/deploy' },
{ slug: 'book/debug' },
Expand All @@ -193,7 +201,8 @@ export default defineConfig({
{
label: 'Single contract',
translations: { 'zh-CN': '单一合同' },
link: '#', attrs: { class: 'sidebar-separator' }
attrs: { class: 'sidebar-separator' },
link: 'cookbook/single-communication#',
},
{ slug: 'cookbook/single-communication' },
{ slug: 'cookbook/type-conversion' },
Expand All @@ -206,7 +215,8 @@ export default defineConfig({
{
label: 'Multiple contracts',
translations: { 'zh-CN': '多重合同' },
link: '#', attrs: { class: 'sidebar-separator' }
attrs: { class: 'sidebar-separator' },
link: 'cookbook/multi-communication#',
},
{ slug: 'cookbook/multi-communication' },
{ slug: 'cookbook/jettons' },
Expand Down Expand Up @@ -240,7 +250,8 @@ export default defineConfig({
{
label: 'Core library',
translations: { 'zh-CN': '核心图书馆' },
link: '#', attrs: { class: 'sidebar-separator' }
attrs: { class: 'sidebar-separator' },
link: 'ref/core-base#',
},
{ slug: 'ref/core-base' },
{ slug: 'ref/core-common' },
Expand All @@ -254,7 +265,8 @@ export default defineConfig({
{
label: 'Standard libraries',
translations: { 'zh-CN': '标准图书馆' },
link: '#', attrs: { class: 'sidebar-separator' }
attrs: { class: 'sidebar-separator' },
link: 'ref/standard-libraries#',
},
{ slug: 'ref/standard-libraries' },
{ slug: 'ref/stdlib-config' },
Expand All @@ -275,7 +287,8 @@ export default defineConfig({
{
label: 'Tools',
translations: { 'zh-CN': '工具' },
link: '#', attrs: { class: 'sidebar-separator' }
attrs: { class: 'sidebar-separator' },
link: 'ecosystem/typescript#',
},
{ slug: 'ecosystem/typescript' },
{ slug: 'ecosystem/vscode' },
Expand Down
38 changes: 11 additions & 27 deletions docs/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,39 @@
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"language": "en",
"dictionaryDefinitions": [
{
"name": "fift-words",
"path": "../cspell-fift-words-adjusted.txt"
},
{
"name": "tvm-instructions",
"path": "../cspell-tvm-instructions.txt"
}
],
"dictionaries": ["fift-words", "tvm-instructions"],
"words": [
"ADDRAND",
"BBITS",
"BREFS",
"Brujin",
"CHKSIGNS",
"CHKSIGNU",
"CONFIGOPTPARAM",
"CTOS",
"Cheatsheet",
"Cheatsheets",
"Comptime",
"DEBUGSTR",
"DUEPAYMENT",
"Daniil",
"Decompilation",
"Decompiled",
"Descr",
"Domínguez",
"ENDC",
"Epva",
"Fift",
"Fift",
"GASCONSUMED",
"GETFORWARDFEE",
"GETFORWARDFEESIMPLE",
"GETGASFEE",
"GETGASFEESIMPLE",
"GETORIGINALFWDFEE",
"GETSTORAGEFEE",
"Georgiy",
"HASHCU",
"HASHEXT",
"HASHSU",
"Héctor",
"IPFS",
"Jesús",
"Jetton",
"Jettons",
"KECCAK",
"Komarov",
"Korshakov",
"LDDICT",
"LDIX",
"LDREF",
"LDSLICEX",
"LDUX",
"LDVARUINT",
"LTIME",
"Laika",
"MYADDR",
"Masterchain",
Expand Down
2 changes: 1 addition & 1 deletion docs/grammars/grammar-tact.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
},
{
"comment": "Other constants from the core library",
"match": "(?<!\\.)\\b(SendRemainingValue|SendRemainingBalance|SendPayGasSeparately|SendIgnoreErrors|SendBounceIfActionFail|SendDestroyIfZero|SendOnlyEstimateFee|ReserveExact|ReserveAllExcept|ReserveAtMost|ReserveAddOriginalBalance|ReserveInvertSign|ReserveBounceIfActionFail)\\b",
"match": "(?<!\\.)\\b(SendDefaultMode|SendRemainingValue|SendRemainingBalance|SendPayGasSeparately|SendIgnoreErrors|SendBounceIfActionFail|SendDestroyIfZero|SendOnlyEstimateFee|ReserveExact|ReserveAllExcept|ReserveAtMost|ReserveAddOriginalBalance|ReserveInvertSign|ReserveBounceIfActionFail)\\b",
"name": "constant.other.builtin.tact"
},
{
Expand Down
Loading

0 comments on commit 0aeb00f

Please sign in to comment.