diff --git a/.github/workflows/external-links.yml b/.github/workflows/external-links.yml new file mode 100644 index 000000000..f8c779b74 --- /dev/null +++ b/.github/workflows/external-links.yml @@ -0,0 +1,37 @@ +name: Link check + +on: + workflow_dispatch: # on demand launches, if needed + schedule: + - cron: "0 0 * * 2" # 00:00 on Tuesday, near the dependabot.yml + +jobs: + linkcheck: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: (docs) Check broken HTTPS links + uses: lycheeverse/lychee-action@v2 + id: lychee + with: + args: > + -n -s https --exclude-path docs/node_modules + --base 'https://docs.tact-lang.org' + --exclude '.*?\\.(?:jpg|png)' + docs/README.md './docs/**/*.mdx' + output: "/dev/stdout" + fail: false + failIfEmpty: false + + - name: (dev-docs) Check broken HTTPS links + uses: lycheeverse/lychee-action@v2 + id: lychee_dev + with: + args: > + -n -s https --exclude-path node_modules --exclude-path docs + './**/*.md' + output: "/dev/stdout" + fail: false + failIfEmpty: false diff --git a/.github/workflows/tact-docs-test.yml b/.github/workflows/tact-docs-test.yml index 622b666fa..e2a58751f 100644 --- a/.github/workflows/tact-docs-test.yml +++ b/.github/workflows/tact-docs-test.yml @@ -50,6 +50,15 @@ jobs: working-directory: docs run: yarn deps + - name: Check broken file references in README + if: runner.os != 'macOS' # it's enough to check on Windows and Linux + uses: lycheeverse/lychee-action@v2 + with: + args: "-n -s file docs/README.md" + output: "/dev/stdout" + fail: true + failIfEmpty: false + - name: Build the site working-directory: docs run: yarn build diff --git a/.github/workflows/tact.yml b/.github/workflows/tact.yml index bd060fad3..d0bc13d06 100644 --- a/.github/workflows/tact.yml +++ b/.github/workflows/tact.yml @@ -98,6 +98,15 @@ jobs: run: | yarn knip + - name: Check broken file references in internal documentation + if: runner.os != 'macOS' # it's enough to check on Windows and Linux + uses: lycheeverse/lychee-action@v2 + with: + args: "-n -s file --exclude-path node_modules --exclude-path docs './**/*.md'" + output: "/dev/stdout" + fail: true + failIfEmpty: false + - name: Show an example .pkg file on Windows if: runner.os == 'Windows' run: | diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 000000000..f2eddd577 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,2 @@ +# https://github.com/lycheeverse/lychee-action#excluding-links-from-getting-checked +https://www.certik.com/resources/blog/secure-smart-contract-programming-in-tact-popular-mistakes-in-the-ton diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c7cfb309b..01130853d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ yarn test -u spec-name-pattern1 spec-name-pattern2 ## Code quality -To pass review, code has to conform to our [styleguide](/STYLEGUIDE.md). +To pass review, code has to conform to our [styleguide](./STYLEGUIDE.md). ## Linting @@ -117,11 +117,11 @@ Some CLI tests can be found in [.github/workflows/tact.yml](./.github/workflows/ ### Parser -The [src/grammar/grammar.ohm](./src/grammar/grammar.ohm) file contains the Tact grammar expressed in the PEG-like language of the [Ohm.js](https://ohmjs.org) parser generator. +The [src/grammar/grammar.ohm](./src/grammar/prev/grammar.ohm) file contains the Tact grammar expressed in the PEG-like language of the [Ohm.js](https://ohmjs.org) parser generator. -The helper file [src/grammar/grammar.ts](./src/grammar/grammar.ts) contains the logic that transforms concrete syntax trees produced with the help of the Ohm.js-generated parser into abstract syntax trees (ASTs) defined in [src/ast/ast.ts](./src/ast/ast.ts). The grammar.ts file also does a bit of grammar validation, like checking that function or constant attributes are not duplicated or that user identifiers do not start with certain reserved prefixes. +The helper file [src/grammar/grammar.ts](./src/grammar/prev/grammar.ts) contains the logic that transforms concrete syntax trees produced with the help of the Ohm.js-generated parser into abstract syntax trees (ASTs) defined in [src/ast/ast.ts](./src/ast/ast.ts). The grammar.ts file also does a bit of grammar validation, like checking that function or constant attributes are not duplicated or that user identifiers do not start with certain reserved prefixes. -The [src/grammar/test](./src/grammar/test) folder contains Tact files that are supposed to be parsed without any issues, and the [src/grammar/test-failed](./src/grammar/test-failed) folder contains grammatically incorrect test files which should result in parser errors. The parser error messages and the locations they point to are fixed in the [src/grammar/**snapshots**/grammar.spec.ts.snap](./src/grammar/__snapshots__/grammar.spec.ts.snap) Jest snapshot file. +The [src/grammar/test](./src/grammar/test) folder contains Tact files that are supposed to be parsed without any issues, and the [src/grammar/test-failed](./src/grammar/test-failed) folder contains grammatically incorrect test files which should result in parser errors. The parser error messages and the locations they point to are fixed in the [src/grammar/**snapshots**/grammar.spec.ts.snap](./src/grammar/prev/__snapshots__/grammar.spec.ts.snap) Jest snapshot file. ### Typechecker diff --git a/docs/src/content/docs/book/compile.mdx b/docs/src/content/docs/book/compile.mdx index af7b17b7d..4bd94d616 100644 --- a/docs/src/content/docs/book/compile.mdx +++ b/docs/src/content/docs/book/compile.mdx @@ -126,7 +126,7 @@ This section shows a [Mermaid][mm] diagram of [contract](/book/contracts) depend If the contract has no dependencies, only its name is displayed: -![Contract dependency diagram without dependencies](../../..//assets/contract-dependency-diagram.png) +![Contract dependency diagram without dependencies](../../../assets/contract-dependency-diagram.png) However, if the contract, say `FirstOne`, somewhere in its code computes the [initial state](/book/expressions#initof) of another contract, say `SecondOne`, such a relationship is shown in the diagram: @@ -150,5 +150,5 @@ Thus, the following dependency diagram is produced: [tlb]: https://docs.ton.org/develop/data-formats/tl-b-language [mm]: https://mermaid.js.org/ -[code-jetton-wallet]: https://github.com/tact-lang/jetton/blob/ef802f95c967f2fd37e80893845c3c3ed7c34c78/sources/jetton_wallet.tact -[code-jetton-minter]: https://github.com/tact-lang/jetton/blob/ef802f95c967f2fd37e80893845c3c3ed7c34c78/sources/jetton_minter_discoverable.tact +[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 diff --git a/docs/src/content/docs/ref/core-advanced.mdx b/docs/src/content/docs/ref/core-advanced.mdx index 79fdc270c..e85cf8cda 100644 --- a/docs/src/content/docs/ref/core-advanced.mdx +++ b/docs/src/content/docs/ref/core-advanced.mdx @@ -590,7 +590,7 @@ parsedVarAddr.address.loadUint(123); // 345 [nanotoncoin]: /book/integers#nanotoncoin [tvm]: https://docs.ton.org/learn/tvm-instructions/tvm-overview -[basechain]: https://docs.ton.org/v3/concepts/ton-blockchain/smart-contract-addresses#address-components +[basechain]: https://docs.ton.org/v3/documentation/smart-contracts/addresses#workchain-id [deduplication]: https://docs.ton.org/v3/documentation/data-formats/tlb/library-cells [storage-fee]: https://docs.ton.org/v3/documentation/smart-contracts/transaction-fees/fees-low-level#storage-fee diff --git a/docs/src/content/docs/zh-cn/ecosystem/misti.mdx b/docs/src/content/docs/zh-cn/ecosystem/misti.mdx index c39090687..562e735e8 100644 --- a/docs/src/content/docs/zh-cn/ecosystem/misti.mdx +++ b/docs/src/content/docs/zh-cn/ecosystem/misti.mdx @@ -2,19 +2,18 @@ title: Misti 静态分析仪 --- -[Misti](https://nowarp.github.io/tools/misti/)是一款支持 Tact 的静态程序分析工具。 +[Misti](https://nowarp.io/tools/misti/)是一款支持 Tact 的静态程序分析工具。 ## 米斯蒂是什么? -- **静态程序分析**:Misti 在不执行代码的情况下对代码进行分析,通过检查结构和语法来扫描[漏洞和安全缺陷](https://nowarp.github.io/tools/misti/docs/detectors)。 这种方法可以及早发现问题,防止问题影响生产。 +- **静态程序分析**:Misti 在不执行代码的情况下对代码进行分析,通过检查结构和语法来扫描[漏洞和安全缺陷](https://nowarp.io/tools/misti/docs/detectors)。 这种方法可以及早发现问题,防止问题影响生产。 -- **自定义探测器**:创建 [自定义探测器](https://nowarp.github.io/tools/misti/docs/hacking/custom-detector),根据您的特定需求定制 Misti。 这有助于识别通用工具可能会遗漏的漏洞,确保对代码进行彻底审查。 +- **自定义探测器**:创建 [自定义探测器](https://nowarp.io/tools/misti/docs/hacking/custom-detector),根据您的特定需求定制 Misti。 这有助于识别通用工具可能会遗漏的漏洞,确保对代码进行彻底审查。 -- **CI/CD 集成**:[集成](https://nowarp.github.io/tools/misti/docs/tutorial/ci-cd) Misti 到您的 CI/CD 管道中,以确保持续的代码质量检查,在问题进入生产之前将其捕获。 +- **CI/CD 集成**:[集成](https://nowarp.io/tools/misti/docs/tutorial/ci-cd) Misti 到您的 CI/CD 管道中,以确保持续的代码质量检查,在问题进入生产之前将其捕获。 ## 资源 - [Github](https://github.com/nowarp/misti) - [电报社区](https://t.me/misti_dev) -- [Misti文档](https://nowarp.github.io/docs/misti/) -- [Misti应用程序接口参考](https://nowarp.github.io/docs/misti/api) +- [Misti文档](https://nowarp.io/tools/misti/)