Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: jest fast transpile. no more ts-jest. #5530

Merged
merged 7 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions yarn-project/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ end-to-end:
RUN yarn workspaces focus @aztec/end-to-end --production && yarn cache clean
SAVE ARTIFACT /usr/src/*

end-to-end-minimal:
end-to-end-minimal:
# end to end test runner
BUILD +aztec
FROM node:18.19.1-slim
RUN apt-get update && apt-get install jq chromium -y
RUN apt-get update && apt-get install jq chromium netcat-openbsd -y
ENV CHROME_BIN="/usr/bin/chromium"
COPY +end-to-end/. /usr/src
WORKDIR /usr/src/yarn-project/end-to-end
Expand Down
14 changes: 10 additions & 4 deletions yarn-project/accounts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,26 @@
"clean": "rm -rf ./dest .tsbuildinfo ./src/artifacts",
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests"
},
"inherits": [
"../package.common.json",
"./package.local.json"
],
"jest": {
"preset": "ts-jest/presets/default-esm",
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
},
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
"rootDir": "./src"
"rootDir": "./src",
"transform": {
"^.+\\.tsx?$": [
"@swc/jest"
]
},
"extensionsToTreatAsEsm": [
".ts"
]
},
"dependencies": {
"@aztec/aztec.js": "workspace:^",
Expand All @@ -61,7 +68,6 @@
"@types/node": "^18.7.23",
"jest": "^29.5.0",
"jest-mock-extended": "^3.0.3",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
Expand Down
14 changes: 10 additions & 4 deletions yarn-project/archiver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"clean": "rm -rf ./dest .tsbuildinfo",
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests",
"start": "node ./dest",
"start:dev": "tsc-watch -p tsconfig.json --onSuccess 'yarn start'",
"test:integration": "concurrently -k -s first -c reset,dim -n test,anvil \"yarn test:integration:run\" \"anvil\"",
Expand All @@ -26,13 +26,20 @@
"../package.common.json"
],
"jest": {
"preset": "ts-jest/presets/default-esm",
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
},
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
"rootDir": "./src",
"workerThreads": true
"workerThreads": true,
"transform": {
"^.+\\.tsx?$": [
"@swc/jest"
]
},
"extensionsToTreatAsEsm": [
".ts"
]
},
"dependencies": {
"@aztec/circuit-types": "workspace:^",
Expand Down Expand Up @@ -63,7 +70,6 @@
"concurrently": "^8.0.1",
"jest": "^29.5.0",
"jest-mock-extended": "^3.0.4",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
Expand Down
14 changes: 10 additions & 4 deletions yarn-project/aztec-faucet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,25 @@
"clean": "rm -rf ./dest .tsbuildinfo",
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests"
},
"inherits": [
"../package.common.json"
],
"jest": {
"preset": "ts-jest/presets/default-esm",
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
},
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
"rootDir": "./src"
"rootDir": "./src",
"transform": {
"^.+\\.tsx?$": [
"@swc/jest"
]
},
"extensionsToTreatAsEsm": [
".ts"
]
},
"dependencies": {
"@aztec/ethereum": "workspace:^",
Expand All @@ -44,7 +51,6 @@
"@types/jest": "^29.5.0",
"@types/node": "^18.7.23",
"jest": "^29.5.0",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
Expand Down
14 changes: 10 additions & 4 deletions yarn-project/aztec-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,25 @@
"clean": "rm -rf ./dest .tsbuildinfo",
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests"
},
"inherits": [
"../package.common.json"
],
"jest": {
"preset": "ts-jest/presets/default-esm",
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
},
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
"rootDir": "./src"
"rootDir": "./src",
"transform": {
"^.+\\.tsx?$": [
"@swc/jest"
]
},
"extensionsToTreatAsEsm": [
".ts"
]
},
"dependencies": {
"@aztec/archiver": "workspace:^",
Expand All @@ -56,7 +63,6 @@
"@types/jest": "^29.5.0",
"@types/node": "^18.7.23",
"jest": "^29.5.0",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
Expand Down
14 changes: 10 additions & 4 deletions yarn-project/aztec.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,26 @@
"clean": "rm -rf ./dest .tsbuildinfo ./src/account_contract/artifacts",
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests"
},
"inherits": [
"../package.common.json",
"./package.local.json"
],
"jest": {
"preset": "ts-jest/presets/default-esm",
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
},
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
"rootDir": "./src"
"rootDir": "./src",
"transform": {
"^.+\\.tsx?$": [
"@swc/jest"
]
},
"extensionsToTreatAsEsm": [
".ts"
]
},
"dependencies": {
"@aztec/circuit-types": "workspace:^",
Expand All @@ -69,7 +76,6 @@
"process": "^0.11.10",
"resolve-typescript-plugin": "^2.0.1",
"stream-browserify": "^3.0.0",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"tty-browserify": "^0.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type AztecAddress, FunctionData, TxContext } from '@aztec/circuits.js';
import { type FunctionAbi, FunctionType, encodeArguments } from '@aztec/foundation/abi';

import { type Wallet } from '../account/wallet.js';
import { BaseContractInteraction, SendMethodOptions } from './base_contract_interaction.js';
import { BaseContractInteraction, type SendMethodOptions } from './base_contract_interaction.js';

export { SendMethodOptions };

Expand Down
14 changes: 10 additions & 4 deletions yarn-project/aztec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"build:dev": "tsc -b --watch",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests",
"run:example:token": "DEBUG='aztec:*' node ./dest/examples/token.js"
},
"inherits": [
Expand Down Expand Up @@ -62,17 +62,23 @@
"@types/jest": "^29.5.0",
"@types/koa": "^2.13.6",
"jest": "^29.5.0",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
"jest": {
"preset": "ts-jest/presets/default-esm",
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
},
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
"rootDir": "./src"
"rootDir": "./src",
"transform": {
"^.+\\.tsx?$": [
"@swc/jest"
]
},
"extensionsToTreatAsEsm": [
".ts"
]
},
"engines": {
"node": ">=18"
Expand Down
14 changes: 10 additions & 4 deletions yarn-project/circuit-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,25 @@
"clean": "rm -rf ./dest .tsbuildinfo",
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests"
},
"inherits": [
"../package.common.json"
],
"jest": {
"preset": "ts-jest/presets/default-esm",
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
},
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
"rootDir": "./src"
"rootDir": "./src",
"transform": {
"^.+\\.tsx?$": [
"@swc/jest"
]
},
"extensionsToTreatAsEsm": [
".ts"
]
},
"dependencies": {
"@aztec/circuits.js": "workspace:^",
Expand All @@ -56,7 +63,6 @@
"@types/node": "^18.7.23",
"jest": "^29.5.0",
"jest-mock-extended": "^3.0.3",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
Expand Down
12 changes: 0 additions & 12 deletions yarn-project/circuits.js/jest.config.ts

This file was deleted.

22 changes: 20 additions & 2 deletions yarn-project/circuits.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"name": "@aztec/circuits.js",
"version": "0.1.0",
"type": "module",
"inherits": [
"../package.common.json",
"./package.local.json"
],
"exports": {
".": "./dest/index.js",
"./hash": "./dest/hash/index.js",
Expand Down Expand Up @@ -29,7 +33,7 @@
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"remake-constants": "node --loader ts-node/esm src/scripts/constants.in.ts && prettier -w src/constants.gen.ts && cd ../../l1-contracts && ./.foundry/bin/forge fmt",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests"
},
"dependencies": {
"@aztec/bb.js": "portal:../../barretenberg/ts",
Expand All @@ -46,7 +50,6 @@
"@types/node": "^18.7.23",
"jest": "^29.5.0",
"prettier": "^2.8.4",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
Expand All @@ -58,5 +61,20 @@
"types": "./dest/index.d.ts",
"engines": {
"node": ">=18"
},
"jest": {
"extensionsToTreatAsEsm": [
".ts"
],
"transform": {
"^.+\\.tsx?$": [
"@swc/jest"
]
},
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
},
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
"rootDir": "./src"
}
}
5 changes: 5 additions & 0 deletions yarn-project/circuits.js/package.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"scripts": {
"build": "yarn clean && yarn generate && tsc -b"
}
}
14 changes: 10 additions & 4 deletions yarn-project/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,26 @@
"clean": "rm -rf ./dest .tsbuildinfo",
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests",
"start": "node --no-warnings ./dest/bin/index.js"
},
"inherits": [
"../package.common.json"
],
"jest": {
"preset": "ts-jest/presets/default-esm",
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
},
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
"rootDir": "./src"
"rootDir": "./src",
"transform": {
"^.+\\.tsx?$": [
"@swc/jest"
]
},
"extensionsToTreatAsEsm": [
".ts"
]
},
"dependencies": {
"@aztec/accounts": "workspace:^",
Expand Down Expand Up @@ -64,7 +71,6 @@
"@types/source-map-support": "^0.5.10",
"jest": "^29.5.0",
"jest-mock-extended": "^3.0.5",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
Expand Down
Loading
Loading