Skip to content

Commit 0441965

Browse files
committed
Initial commit
0 parents  commit 0441965

File tree

17 files changed

+7552
-0
lines changed

17 files changed

+7552
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
indent_size = 4
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{js,ts}]
12+
max_line_length = 100
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.github/workflows/tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
env:
12+
HUSKY: 0
13+
14+
jobs:
15+
tests:
16+
name: Test (${{ matrix.os }})
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os:
22+
- windows-latest
23+
- ubuntu-latest
24+
- macos-latest
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v3
29+
30+
- name: Enable Corepack
31+
if: matrix.os == 'windows-latest'
32+
run: corepack enable --install-directory 'C:\npm\prefix'
33+
34+
- name: Enable Corepack
35+
if: matrix.os != 'windows-latest'
36+
run: corepack enable
37+
38+
- name: Setup Node.js 22.x
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 22.x
42+
cache: "yarn"
43+
44+
- name: Install dependencies
45+
env:
46+
YARN_ENABLE_HARDENED_MODE: false
47+
run: yarn install --immutable
48+
49+
- name: Build
50+
run: yarn build
51+
52+
- name: Run Tests
53+
run: yarn test

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
node_modules
2+
.DS_Store
3+
.idea
4+
dist/
5+
6+
# yarn
7+
yarn-error.log
8+
.yarn/
9+
10+
# eslint
11+
.eslintcache
12+
13+
# coverage
14+
coverage/

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 The Tact Authors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

eslint.config.mjs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import path from "node:path"
2+
import tseslint from "typescript-eslint"
3+
import url from "node:url"
4+
import unusedImports from "eslint-plugin-unused-imports"
5+
import unicornPlugin from "eslint-plugin-unicorn"
6+
7+
const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
8+
9+
export default tseslint.config(
10+
// register plugins
11+
{
12+
plugins: {
13+
["@typescript-eslint"]: tseslint.plugin,
14+
["@unused-imports"]: unusedImports,
15+
},
16+
},
17+
18+
// add files and folders to be ignored
19+
{
20+
ignores: ["**/*.js", "eslint.config.mjs", ".github/*", ".yarn/*", "src/utils.ts", "dist/*"],
21+
},
22+
23+
tseslint.configs.all,
24+
unicornPlugin.configs["flat/all"],
25+
26+
{
27+
languageOptions: {
28+
parserOptions: {
29+
projectService: true,
30+
tsconfigRootDir: __dirname,
31+
},
32+
},
33+
34+
rules: {
35+
// override typescript-eslint
36+
"@typescript-eslint/no-empty-function": "off",
37+
"@typescript-eslint/no-inferrable-types": "off",
38+
"@typescript-eslint/typedef": [
39+
"error",
40+
{parameter: true, memberVariableDeclaration: true},
41+
],
42+
"@typescript-eslint/consistent-generic-constructors": ["error", "type-annotation"],
43+
"@typescript-eslint/no-unused-vars": [
44+
"error",
45+
{
46+
argsIgnorePattern: "^_",
47+
caughtErrorsIgnorePattern: "^_",
48+
varsIgnorePattern: "^_",
49+
},
50+
],
51+
"@typescript-eslint/prefer-optional-chain": "off",
52+
"@typescript-eslint/no-extraneous-class": "off",
53+
"@typescript-eslint/no-magic-numbers": "off",
54+
"@typescript-eslint/no-unsafe-type-assertion": "off",
55+
"@typescript-eslint/prefer-readonly-parameter-types": "off",
56+
"@typescript-eslint/member-ordering": "off",
57+
"@typescript-eslint/parameter-properties": "off",
58+
"@typescript-eslint/method-signature-style": "off",
59+
"@typescript-eslint/prefer-destructuring": "off",
60+
"@typescript-eslint/no-use-before-define": "off",
61+
"@typescript-eslint/class-methods-use-this": "off",
62+
"@typescript-eslint/no-shadow": "off",
63+
"@typescript-eslint/consistent-type-imports": "off",
64+
"@typescript-eslint/naming-convention": "off",
65+
"@typescript-eslint/max-params": "off",
66+
"@typescript-eslint/no-invalid-this": "off",
67+
"@typescript-eslint/init-declarations": "off",
68+
"@typescript-eslint/dot-notation": "off",
69+
"@typescript-eslint/explicit-module-boundary-types": "off",
70+
"@typescript-eslint/explicit-function-return-type": "off",
71+
72+
"@unused-imports/no-unused-imports": "error",
73+
"no-duplicate-imports": "error",
74+
"@typescript-eslint/strict-boolean-expressions": "error",
75+
76+
// override unicorn
77+
"unicorn/no-null": "off",
78+
"unicorn/prevent-abbreviations": "off",
79+
"unicorn/no-array-for-each": "off",
80+
"unicorn/import-style": "off",
81+
"unicorn/filename-case": "off",
82+
"unicorn/consistent-function-scoping": "off",
83+
"unicorn/no-nested-ternary": "off",
84+
"unicorn/prefer-module": "off",
85+
"unicorn/prefer-string-replace-all": "off",
86+
"unicorn/no-process-exit": "off",
87+
"unicorn/number-literal-case": "off", // prettier changes to lowercase
88+
"unicorn/no-lonely-if": "off",
89+
"unicorn/prefer-top-level-await": "off",
90+
"unicorn/no-static-only-class": "off",
91+
"unicorn/no-keyword-prefix": "off",
92+
"unicorn/prefer-json-parse-buffer": "off",
93+
"unicorn/no-array-reduce": "off",
94+
"unicorn/no-useless-undefined": "off",
95+
"unicorn/prefer-type-error": "off",
96+
97+
"@/eqeqeq": "error",
98+
},
99+
},
100+
)

jest.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @type {import("ts-jest").JestConfigWithTsJest} */
2+
module.exports = {
3+
preset: "ts-jest",
4+
testEnvironment: "node",
5+
roots: ["<rootDir>/src"],
6+
transform: {
7+
"^.+\\.tsx?$": "ts-jest",
8+
},
9+
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
10+
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
11+
}

package.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"name": "retracer-core",
3+
"version": "0.0.1",
4+
"description": "Core retracer library for collecting transaction information",
5+
"main": "dist/index.js",
6+
"scripts": {
7+
"build": "tsc --declaration",
8+
"lint": "eslint --cache .",
9+
"test": "jest",
10+
"fmt": "prettier --write -l --cache .",
11+
"fmt:check": "prettier --check --cache ."
12+
},
13+
"keywords": [
14+
"ton",
15+
"tact",
16+
"blockchain",
17+
"tracing"
18+
],
19+
"repository": {
20+
"type": "git",
21+
"url": "git+https://github.com/tact-lang/retracer-core.git"
22+
},
23+
"author": "TON Studio",
24+
"license": "MIT",
25+
"bugs": {
26+
"url": "https://github.com/tact-lang/retracer-core/issues"
27+
},
28+
"homepage": "https://github.com/tact-lang/retracer-core#readme",
29+
"files": [
30+
"dist",
31+
"!dist/test"
32+
],
33+
"dependencies": {
34+
"@ton/core": "^0.60.1",
35+
"@ton/sandbox": "^0.28.0",
36+
"@ton/ton": "^15.2.1"
37+
},
38+
"devDependencies": {
39+
"@ton/crypto": "^3.3.0",
40+
"@types/jest": "^29.5.14",
41+
"@types/node": "^22.14.0",
42+
"esbuild": "^0.25.2",
43+
"eslint": "^9.19.0",
44+
"eslint-plugin-unicorn": "^56.0.1",
45+
"eslint-plugin-unused-imports": "^4.1.4",
46+
"jest": "^29.7.0",
47+
"prettier": "3.4.2",
48+
"tact-asm": "0.0.4",
49+
"ts-jest": "^29.2.6",
50+
"typescript": "^5.7.0",
51+
"typescript-eslint": "^8.22.0"
52+
},
53+
"packageManager": "[email protected]",
54+
"prettier": {
55+
"arrowParens": "avoid",
56+
"bracketSpacing": false,
57+
"printWidth": 100,
58+
"semi": false,
59+
"singleQuote": false,
60+
"tabWidth": 4,
61+
"trailingComma": "all",
62+
"useTabs": false,
63+
"overrides": [
64+
{
65+
"files": [
66+
"*.yaml",
67+
"*.yml"
68+
],
69+
"options": {
70+
"tabWidth": 2
71+
}
72+
}
73+
]
74+
}
75+
}

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from "./methods"
2+
export * from "./runner"
3+
export type * from "./types"
4+
export * from "./utils"

0 commit comments

Comments
 (0)