Skip to content

Commit

Permalink
use stdlib.ts in node
Browse files Browse the repository at this point in the history
  • Loading branch information
verytactical committed Jan 16, 2025
1 parent 752c1da commit 44a40da
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 9 deletions.
9 changes: 9 additions & 0 deletions jest-slow.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
maxWorkers: "50%",
globalSetup: "./jest.setup.js",
globalTeardown: "./jest.teardown.js",
snapshotSerializers: ["@tact-lang/ton-jest/serializers"],
};
11 changes: 9 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
module.exports = {
preset: "ts-jest",
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
},
testEnvironment: "node",
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
maxWorkers: "50%",
testPathIgnorePatterns: [
"/node_modules/",
"/dist/",
"/src/test/e2e-emulated/map*",
],
maxWorkers: "8",
globalSetup: "./jest.setup.js",
globalTeardown: "./jest.teardown.js",
snapshotSerializers: ["@tact-lang/ton-jest/serializers"],
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"copy:func": "ts-node src/func/copy.build.ts",
"build": "tsc && yarn copy:stdlib && yarn copy:grammar && yarn copy:func",
"test": "jest",
"test:slow": "jest",
"coverage": "cross-env COVERAGE=true jest",
"release": "yarn clean && yarn build && yarn coverage && yarn release-it --npm.yarn1",
"type": "tsc --noEmit",
Expand All @@ -46,10 +47,13 @@
"files": [
"dist/**/*",
"bin/**/*",
"stdlib/**/*",
"!src/**/*",
"!**/test",
"!/docs",
"!**/*.build.ts"
"!**/*.build.ts",
"!**/*.spec.js",
"!**/*.spec.d.ts",
"!**/*.tsbuildinfo"
],
"main": "./dist/index.js",
"bin": {
Expand All @@ -76,6 +80,8 @@
"devDependencies": {
"@ohm-js/cli": "^2.0.0",
"@release-it/keep-a-changelog": "^6.0.0",
"@swc/core": "^1.10.7",
"@swc/jest": "^0.2.37",
"@tact-lang/coverage": "^0.0.8",
"@tact-lang/ton-abi": "^0.0.3",
"@tact-lang/ton-jest": "^0.0.4",
Expand Down
2 changes: 1 addition & 1 deletion src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Config, verifyConfig } from "./config/parseConfig";
import { ILogger } from "./context/logger";
import { build } from "./pipeline/build";
import { createVirtualFileSystem } from "./vfs/createVirtualFileSystem";
import files from "./imports/stdlib";
import files from "./stdlib/stdlib";

export async function run(args: {
config: Config;
Expand Down
5 changes: 3 additions & 2 deletions src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { createNodeFileSystem } from "./vfs/createNodeFileSystem";
import { build } from "./pipeline/build";
import { LogLevel, Logger } from "./context/logger";
import { TactErrorCollection } from "./error/errors";
import { stdlibPath } from "./stdlib/path";
import { createVirtualFileSystem } from "./vfs/createVirtualFileSystem";
import files from "./stdlib/stdlib";

type AdditionalCliOptions = {
mode?: ConfigProject["mode"];
Expand Down Expand Up @@ -116,7 +117,7 @@ export async function run(args: {
configWithRootPath.rootPath as string,
false,
);
const stdlib = createNodeFileSystem(stdlibPath, false); // Improves developer experience
const stdlib = createVirtualFileSystem("@stdlib", files);
for (const config of projects) {
logger.info(`💼 Compiling project ${config.name} ...`);
let cliConfig = { ...config };
Expand Down
1 change: 1 addition & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"examples/",
"scripts/",
"./jest.config.js",
"./jest-slow.config.js",
"bin/tact.js",
"bin/unboc.js"
],
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"compilerOptions": {
"outDir": "./dist"
},
"include": ["src/**/*"],
"exclude": ["**/**.spec.ts", "**/**.bind.ts", "src/test/features/output/**/*"]
"include": ["src/**/*"]
}
102 changes: 102 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,13 @@
slash "^3.0.0"
strip-ansi "^6.0.0"

"@jest/create-cache-key-function@^29.7.0":
version "29.7.0"
resolved "https://registry.npmjs.org/@jest/create-cache-key-function/-/create-cache-key-function-29.7.0.tgz#793be38148fab78e65f40ae30c36785f4ad859f0"
integrity sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA==
dependencies:
"@jest/types" "^29.6.3"

"@jest/environment@^29.7.0":
version "29.7.0"
resolved "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz"
Expand Down Expand Up @@ -1483,6 +1490,96 @@
ignore "^5.1.8"
p-map "^4.0.0"

"@swc/core-darwin-arm64@1.10.7":
version "1.10.7"
resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.10.7.tgz#ff727de61faabfbdfe062747e47305ee3472298e"
integrity sha512-SI0OFg987P6hcyT0Dbng3YRISPS9uhLX1dzW4qRrfqQdb0i75lPJ2YWe9CN47HBazrIA5COuTzrD2Dc0TcVsSQ==

"@swc/core-darwin-x64@1.10.7":
version "1.10.7"
resolved "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.10.7.tgz#a276d5ee56e7c9fb03201c92c620143f8df6b52e"
integrity sha512-RFIAmWVicD/l3RzxgHW0R/G1ya/6nyMspE2cAeDcTbjHi0I5qgdhBWd6ieXOaqwEwiCd0Mot1g2VZrLGoBLsjQ==

"@swc/core-linux-arm-gnueabihf@1.10.7":
version "1.10.7"
resolved "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.10.7.tgz#8f2041b818691e7535bc275d32659e77b5f2fecc"
integrity sha512-QP8vz7yELWfop5mM5foN6KkLylVO7ZUgWSF2cA0owwIaziactB2hCPZY5QU690coJouk9KmdFsPWDnaCFUP8tg==

"@swc/core-linux-arm64-gnu@1.10.7":
version "1.10.7"
resolved "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.10.7.tgz#c185499f7db12ee95fdceb4c00fb503ed398cf1d"
integrity sha512-NgUDBGQcOeLNR+EOpmUvSDIP/F7i/OVOKxst4wOvT5FTxhnkWrW+StJGKj+DcUVSK5eWOYboSXr1y+Hlywwokw==

"@swc/core-linux-arm64-musl@1.10.7":
version "1.10.7"
resolved "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.10.7.tgz#20732c402ba44fbd708e9871aaa10df5597a3d01"
integrity sha512-gp5Un3EbeSThBIh6oac5ZArV/CsSmTKj5jNuuUAuEsML3VF9vqPO+25VuxCvsRf/z3py+xOWRaN2HY/rjMeZog==

"@swc/core-linux-x64-gnu@1.10.7":
version "1.10.7"
resolved "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.10.7.tgz#d6310152dd154c0796d1c0d99eb89fc26957c8f6"
integrity sha512-k/OxLLMl/edYqbZyUNg6/bqEHTXJT15l9WGqsl/2QaIGwWGvles8YjruQYQ9d4h/thSXLT9gd8bExU2D0N+bUA==

"@swc/core-linux-x64-musl@1.10.7":
version "1.10.7"
resolved "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.10.7.tgz#e03d4ec66f4234323887774151d1034339d0d7af"
integrity sha512-XeDoURdWt/ybYmXLCEE8aSiTOzEn0o3Dx5l9hgt0IZEmTts7HgHHVeRgzGXbR4yDo0MfRuX5nE1dYpTmCz0uyA==

"@swc/core-win32-arm64-msvc@1.10.7":
version "1.10.7"
resolved "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.10.7.tgz#f1a8c3149e2671d477af4ca39c761d6ade342d4c"
integrity sha512-nYAbi/uLS+CU0wFtBx8TquJw2uIMKBnl04LBmiVoFrsIhqSl+0MklaA9FVMGA35NcxSJfcm92Prl2W2LfSnTqQ==

"@swc/core-win32-ia32-msvc@1.10.7":
version "1.10.7"
resolved "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.10.7.tgz#133f3168fee9910566a874eb1d422dc79eb17d54"
integrity sha512-+aGAbsDsIxeLxw0IzyQLtvtAcI1ctlXVvVcXZMNXIXtTURM876yNrufRo4ngoXB3jnb1MLjIIjgXfFs/eZTUSw==

"@swc/core-win32-x64-msvc@1.10.7":
version "1.10.7"
resolved "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.10.7.tgz#84d6ed82b2f19bc00b868c9747f03ea6661d8023"
integrity sha512-TBf4clpDBjF/UUnkKrT0/th76/zwvudk5wwobiTFqDywMApHip5O0VpBgZ+4raY2TM8k5+ujoy7bfHb22zu17Q==

"@swc/core@^1.10.7":
version "1.10.7"
resolved "https://registry.npmjs.org/@swc/core/-/core-1.10.7.tgz#736a5bbf0db7628cb2de3eac871e331f9a27e60b"
integrity sha512-py91kjI1jV5D5W/Q+PurBdGsdU5TFbrzamP7zSCqLdMcHkKi3rQEM5jkQcZr0MXXSJTaayLxS3MWYTBIkzPDrg==
dependencies:
"@swc/counter" "^0.1.3"
"@swc/types" "^0.1.17"
optionalDependencies:
"@swc/core-darwin-arm64" "1.10.7"
"@swc/core-darwin-x64" "1.10.7"
"@swc/core-linux-arm-gnueabihf" "1.10.7"
"@swc/core-linux-arm64-gnu" "1.10.7"
"@swc/core-linux-arm64-musl" "1.10.7"
"@swc/core-linux-x64-gnu" "1.10.7"
"@swc/core-linux-x64-musl" "1.10.7"
"@swc/core-win32-arm64-msvc" "1.10.7"
"@swc/core-win32-ia32-msvc" "1.10.7"
"@swc/core-win32-x64-msvc" "1.10.7"

"@swc/counter@^0.1.3":
version "0.1.3"
resolved "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz#cc7463bd02949611c6329596fccd2b0ec782b0e9"
integrity sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==

"@swc/jest@^0.2.37":
version "0.2.37"
resolved "https://registry.npmjs.org/@swc/jest/-/jest-0.2.37.tgz#9c2aaf22c87682aa968016e3e4843d1a25cae6bd"
integrity sha512-CR2BHhmXKGxTiFr21DYPRHQunLkX3mNIFGFkxBGji6r9uyIR5zftTOVYj1e0sFNMV2H7mf/+vpaglqaryBtqfQ==
dependencies:
"@jest/create-cache-key-function" "^29.7.0"
"@swc/counter" "^0.1.3"
jsonc-parser "^3.2.0"

"@swc/types@^0.1.17":
version "0.1.17"
resolved "https://registry.npmjs.org/@swc/types/-/types-0.1.17.tgz#bd1d94e73497f27341bf141abdf4c85230d41e7c"
integrity sha512-V5gRru+aD8YVyCOMAjMpWR1Ui577DD5KSJsHP8RAxopAH22jFz6GZd/qxqjO6MJHQhcsjvjOFXyDhyLQUnMveQ==
dependencies:
"@swc/counter" "^0.1.3"

"@tact-lang/coverage@^0.0.8":
version "0.0.8"
resolved "https://registry.npmjs.org/@tact-lang/coverage/-/coverage-0.0.8.tgz"
Expand Down Expand Up @@ -4237,6 +4334,11 @@ json5@^2.1.3, json5@^2.2.3:
resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz"
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==

jsonc-parser@^3.2.0:
version "3.3.1"
resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz#f2a524b4f7fd11e3d791e559977ad60b98b798b4"
integrity sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==

jsonfile@^6.0.1:
version "6.1.0"
resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz"
Expand Down

0 comments on commit 44a40da

Please sign in to comment.