Skip to content

Commit

Permalink
Merge branch 'main' into stdlib-extension-with-mathlib
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusarich committed Jan 29, 2025
2 parents 4e73eb4 + 596d2ce commit 2f9e448
Show file tree
Hide file tree
Showing 513 changed files with 70,256 additions and 28,981 deletions.
8 changes: 6 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ dist/
coverage/
**/output/
src/test/**/output/
src/test/e2e-emulated/map-tests/build
src/func/funcfiftlib.js
src/grammar/grammar.ohm*.ts
src/grammar/grammar.ohm*.js
**/grammar.ohm*.ts
**/grammar.ohm*.js
src/grammar/next/grammar.ts
jest.setup.js
jest.teardown.js
/docs
version.build.ts
bin/*
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Click the `Preview` tab and select a PR template:
- [Improve compiler tests by adding new ones or modifying the existing tests](?expand=1&template=tests.md)
- [Tact release](?expand=1&template=release.md)
- [Project policies](?expand=1&template=policies.md)
- [Code quality improvement](?expand=1&code-quality.md)
- [Code quality improvement](?expand=1&template=code-quality.md)
38 changes: 38 additions & 0 deletions .github/workflows/external-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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 HTTP(S) links
uses: lycheeverse/lychee-action@v2
id: lychee
with:
args: >
-n -s https -s http --base 'https://docs.tact-lang.org'
--exclude-path docs/node_modules
--exclude '.*?\\.(?:jpg|png)'
docs/README.md './docs/**/*.mdx'
output: "/dev/stdout"
fail: false
failIfEmpty: false

- name: (dev-docs) Check broken HTTP(S) links
uses: lycheeverse/lychee-action@v2
id: lychee_dev
with:
args: >
-n -s https -s http
--exclude-path node_modules --exclude-path docs
'./**/*.md'
output: "/dev/stdout"
fail: false
failIfEmpty: false
62 changes: 62 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Linter check

env:
HUSKY: 0

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

jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: "yarn"

- name: Install dependencies
run: |
corepack enable
yarn install
- name: Prepare linter
run: |
yarn gen:grammar
yarn gen:stdlib
yarn gen:func-js
yarn gen:contracts:test
- name: Check there are no errors to be fixed in package.json and no uncommitted changes
run: |
npm pkg fix && git diff --exit-code
- name: Check there are no errors reported by ESLint
run: |
yarn lint
- name: Check formatting with Prettier
run: |
yarn fmt:check
- name: Spellcheck code base
run: |
yarn spell
- name: Check there are no unused dependencies
run: |
yarn knip
- name: Check broken file references in internal documentation
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
9 changes: 9 additions & 0 deletions .github/workflows/tact-docs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ jobs:
working-directory: docs
run: yarn deps

- name: Check broken file references in README
if: runner.os == '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
143 changes: 44 additions & 99 deletions .github/workflows/tact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,24 @@ on:
workflow_dispatch:

jobs:
test:
backwards-compat:
strategy:
fail-fast: false
matrix:
node-version: [22]
node-version: [18]
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js 18 for backwards compat tests
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ matrix.node-version }}
# without caching

- name: Backwards compat tests
- name: Backwards compatibility tests
run: |
# Temporarily ignore engines
yarn config set ignore-engines true
Expand All @@ -45,6 +43,45 @@ jobs:
yarn cleanall
yarn config delete ignore-engines
forward-compat:
strategy:
fail-fast: false
matrix:
node-version: [23]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# without caching

- name: Forward compatibility tests
run: |
# Install dependencies and perform some steps of the build pipeline,
# skipping the contract generation and the final `yarn build` step
yarn install
yarn gen:grammar
yarn gen:stdlib
yarn gen:func-js
# Clean-up
yarn cleanall
test:
strategy:
fail-fast: false
matrix:
node-version: [22]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand All @@ -70,40 +107,10 @@ jobs:
yarn gen
yarn build
- name: Check there are no errors to be fixed in package.json and no uncommited changes
run: |
npm pkg fix && git diff --exit-code
- name: Test Tact compiler
run: |
yarn coverage
- name: Check there are no errors reported by ESLint
run: |
yarn lint
- name: Check formatting with Prettier
run: |
yarn fmt:check
- name: Check that tact.config.json adheres to the JSON schema
run: |
yarn lint:schema
- name: Spellcheck code base
run: |
yarn spell
- name: Check there are no unused dependencies
run: |
yarn knip
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
if: runner.os != 'Windows'
with:
scandir: "./scripts"

- name: Show an example .pkg file on Windows
if: runner.os == 'Windows'
run: |
Expand All @@ -113,66 +120,6 @@ jobs:
run: |
yarn link
- name: CLI Test | Check tact --version
if: runner.os != 'Windows'
run: |
tact --version
- name: CLI Test | Compare Tact version from CLI flag `--version` against package.json
if: runner.os != 'Windows'
run: |
if [ "$(tact --version | head -n1)" != "$(jq -r '.version' < package.json)" ];
then false
fi
- name: CLI Test | Check single-contract compilation
if: runner.os != 'Windows'
run: |
tact --check bin/test/success.tact
tact --func bin/test/success.tact
tact bin/test/success.tact
tact --with-decompilation bin/test/success.tact
- name: CLI Test | Check compilation via `--config`
if: runner.os != 'Windows'
run: |
# should output complete results
tact --config bin/test/success.config.json
# should output complete result + decompile binary code
tact --config bin/test/success.config.with.decompilation.json
# should only run the syntax and type checking
tact --config bin/test/success.config.json --check
- name: CLI Test | Check parsing of mutually exclusive flags - 1
if: runner.os != 'Windows'
run: |
! tact --func --check bin/test/success.config.json
- name: CLI Test | Check parsing of mutually exclusive flags - 2
if: runner.os != 'Windows'
run: |
! tact --with-decompilation --check bin/test/success.config.json
- name: CLI Test | Check parsing of mutually exclusive flags - 3
if: runner.os != 'Windows'
run: |
! tact --func --with-decompilation bin/test/success.config.json
- name: CLI Test | Check parsing of a non-existing CLI flag
if: runner.os != 'Windows'
run: |
! tact --nonexistentoption bin/test/success.config.json
- name: CLI Test | tact executable return non-zero exit code if compilation fails
if: runner.os != 'Windows'
run: |
! tact --config bin/test/fail.config.json
- name: CLI Test | Evaluate expression
if: runner.os != 'Windows'
run: |
tact -e '(1 + 2 * (pow(3,4) - 2) << 1 & 0x54 | 33 >> 1) * 2 + 2'
- name: Test compatibility with tact-template
run: |
git clone https://github.com/tact-lang/tact-template.git
Expand All @@ -190,9 +137,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
package-manager: [npm, yarn, pnpm, bun]
# follow-up ifs are for ensuring clean state at all times

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ node_modules
coverage
dist
output/
src/grammar/grammar.ohm-bundle.js
src/grammar/grammar.ohm-bundle.d.ts
**/grammar.ohm-bundle.js
**/grammar.ohm-bundle.d.ts
src/func/funcfiftlib.wasm.js
src/test/contracts/pretty-printer-output
src/test/e2e-emulated/map-tests/build

2 changes: 2 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion .npmignore

This file was deleted.

7 changes: 4 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/dist
/src/func/funcfiftlib.js
/src/func/funcfiftlib.wasm.js
/src/grammar/grammar.ohm-bundle.d.ts
/src/grammar/grammar.ohm-bundle.js
/src/imports/stdlib.ts
/src/grammar/prev/grammar.ohm-bundle.d.ts
/src/grammar/prev/grammar.ohm-bundle.js
src/grammar/next/grammar.ts
/src/stdlib/stdlib.ts
/grammar
/docs
1 change: 0 additions & 1 deletion .yarnignore

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

A next-gen smart contract language for TON focused on efficiency and simplicity.

- [Changelog](./CHANGELOG.md)
- [How to contribute to Tact development](./CONTRIBUTING.md)
- [Roadmap](./ROADMAP.md)
- [Changelog](./dev-docs/CHANGELOG.md)
- [How to contribute to Tact development](./dev-docs/CONTRIBUTING.md)
- [Examples](./examples/)

## Key Resources
Expand Down
Loading

0 comments on commit 2f9e448

Please sign in to comment.