From 463269c6bc9326c78c75df2790dc7e8bccd2dd83 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Wed, 12 Apr 2023 17:11:30 -0300 Subject: [PATCH] Type check test files (#248) * Rename all tsconfig.dest.json to tsconfig.json * Rename all instances of tsconfig.dest.json to tsconfig.json * Ignore tsbuildinfo * Fix jest types See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64936/files * Move anvil tests into src and skip for now * Do not exclude test folders * Rename package.scripts to package.common * Remove explicit reference to tsconfig in project references * Handle non-objects in update_package_jsons * Add files and types entries to all packages * Remove tsbuildinfo * Fix jest config for aztec-rpc * Fix jest config for aztec-node * Add types patch to dockerfiles * Drop tsconfig.json from build command since we're using the default --- README.md | 6 +-- yarn-project/.gitignore | 1 + yarn-project/@types/jest/index.d.ts | 10 +++++ yarn-project/acir-simulator/package.json | 16 ++++--- .../acir-simulator/tsconfig.dest.json | 27 ------------ yarn-project/acir-simulator/tsconfig.json | 26 +++++++++++ yarn-project/archiver/package.json | 18 +++++--- yarn-project/archiver/tsconfig.dest.json | 24 ---------- .../tsconfig.json} | 13 ++++-- yarn-project/aztec-cli/package.json | 16 ++++--- .../{tsconfig.dest.json => tsconfig.json} | 3 +- yarn-project/aztec-node/package.json | 28 ++++++------ .../{ => src}/test/aztec_node.test.ts | 12 +++-- yarn-project/aztec-node/tsconfig.dest.json | 42 ------------------ yarn-project/aztec-node/tsconfig.json | 41 +++++++++++++++++ yarn-project/aztec-rpc/package.json | 19 +++++--- yarn-project/aztec-rpc/tsconfig.dest.json | 36 --------------- yarn-project/aztec-rpc/tsconfig.json | 35 +++++++++++++++ yarn-project/aztec.js/package.json | 16 ++++--- yarn-project/aztec.js/tsconfig.dest.json | 24 ---------- .../tsconfig.json} | 13 ++++-- yarn-project/barretenberg.js/package.json | 16 ++++--- .../{tsconfig.dest.json => tsconfig.json} | 5 +-- yarn-project/circuits.js/package.json | 16 ++++--- yarn-project/circuits.js/tsconfig.dest.json | 18 -------- .../tsconfig.json} | 8 ++-- yarn-project/docs/README.md | 2 +- yarn-project/end-to-end/package.json | 14 ++++-- yarn-project/end-to-end/tsconfig.dest.json | 30 ------------- yarn-project/end-to-end/tsconfig.json | 29 ++++++++++++ yarn-project/ethereum.js/Dockerfile | 1 + .../ethereum.js/example/tsconfig.json | 8 ++-- yarn-project/ethereum.js/package.json | 14 ++++-- yarn-project/ethereum.js/tsconfig.dest.json | 16 ------- yarn-project/ethereum.js/tsconfig.json | 2 +- yarn-project/foundation/.eslintrc.cjs | 2 +- yarn-project/foundation/.eslintrc.legacy.cjs | 2 +- yarn-project/foundation/Dockerfile | 1 + yarn-project/foundation/package.json | 14 ++++-- .../{tsconfig.dest.json => tsconfig.json} | 1 - yarn-project/kernel-prover/package.json | 16 ++++--- yarn-project/kernel-prover/tsconfig.dest.json | 21 --------- yarn-project/kernel-prover/tsconfig.json | 20 +++++++++ yarn-project/key-store/package.json | 16 ++++--- .../{tsconfig.dest.json => tsconfig.json} | 5 +-- yarn-project/l1-contracts/package.json | 16 ++++--- yarn-project/l1-contracts/tsconfig.json | 17 +++++++ yarn-project/merkle-tree/package.json | 14 ++++-- yarn-project/merkle-tree/tsconfig.json | 17 +++++++ yarn-project/noir-contracts/package.json | 16 ++++--- yarn-project/noir-contracts/tsconfig.json | 14 ++++++ yarn-project/p2p/package.json | 18 +++++--- yarn-project/p2p/tsconfig.dest.json | 21 --------- yarn-project/p2p/tsconfig.json | 20 +++++++++ ...ckage.scripts.json => package.common.json} | 12 +++-- yarn-project/package.json | 8 ++-- yarn-project/prover-client/package.json | 16 ++++--- yarn-project/prover-client/tsconfig.json | 14 ++++++ yarn-project/sequencer-client/package.json | 16 ++++--- .../{ => src}/test/l2-block-publisher.test.ts | 12 ++--- .../sequencer-client/tsconfig.dest.json | 36 --------------- yarn-project/sequencer-client/tsconfig.json | 35 +++++++++++++++ yarn-project/tsconfig.dest.json | 27 ------------ yarn-project/tsconfig.json | 44 +++++++++---------- yarn-project/types/package.json | 16 ++++--- yarn-project/types/tsconfig.dest.json | 21 --------- .../tsconfig.json} | 11 +++-- yarn-project/world-state/package.json | 14 ++++-- yarn-project/world-state/tsconfig.dest.json | 27 ------------ yarn-project/world-state/tsconfig.json | 26 +++++++++++ yarn-project/yarn-project-base/Dockerfile | 44 +++++++++---------- .../scripts/update_package_jsons.mjs | 14 ++++-- yarn-project/yarn.lock | 6 +-- 73 files changed, 672 insertions(+), 583 deletions(-) create mode 100644 yarn-project/@types/jest/index.d.ts delete mode 100644 yarn-project/acir-simulator/tsconfig.dest.json create mode 100644 yarn-project/acir-simulator/tsconfig.json delete mode 100644 yarn-project/archiver/tsconfig.dest.json rename yarn-project/{l1-contracts/tsconfig.dest.json => archiver/tsconfig.json} (52%) rename yarn-project/aztec-cli/{tsconfig.dest.json => tsconfig.json} (66%) rename yarn-project/aztec-node/{ => src}/test/aztec_node.test.ts (94%) delete mode 100644 yarn-project/aztec-node/tsconfig.dest.json create mode 100644 yarn-project/aztec-node/tsconfig.json delete mode 100644 yarn-project/aztec-rpc/tsconfig.dest.json create mode 100644 yarn-project/aztec-rpc/tsconfig.json delete mode 100644 yarn-project/aztec.js/tsconfig.dest.json rename yarn-project/{merkle-tree/tsconfig.dest.json => aztec.js/tsconfig.json} (51%) rename yarn-project/barretenberg.js/{tsconfig.dest.json => tsconfig.json} (58%) delete mode 100644 yarn-project/circuits.js/tsconfig.dest.json rename yarn-project/{prover-client/tsconfig.dest.json => circuits.js/tsconfig.json} (58%) delete mode 100644 yarn-project/end-to-end/tsconfig.dest.json create mode 100644 yarn-project/end-to-end/tsconfig.json delete mode 100644 yarn-project/ethereum.js/tsconfig.dest.json rename yarn-project/foundation/{tsconfig.dest.json => tsconfig.json} (78%) delete mode 100644 yarn-project/kernel-prover/tsconfig.dest.json create mode 100644 yarn-project/kernel-prover/tsconfig.json rename yarn-project/key-store/{tsconfig.dest.json => tsconfig.json} (58%) create mode 100644 yarn-project/l1-contracts/tsconfig.json create mode 100644 yarn-project/merkle-tree/tsconfig.json create mode 100644 yarn-project/noir-contracts/tsconfig.json delete mode 100644 yarn-project/p2p/tsconfig.dest.json create mode 100644 yarn-project/p2p/tsconfig.json rename yarn-project/{package.scripts.json => package.common.json} (74%) create mode 100644 yarn-project/prover-client/tsconfig.json rename yarn-project/sequencer-client/{ => src}/test/l2-block-publisher.test.ts (90%) delete mode 100644 yarn-project/sequencer-client/tsconfig.dest.json create mode 100644 yarn-project/sequencer-client/tsconfig.json delete mode 100644 yarn-project/tsconfig.dest.json delete mode 100644 yarn-project/types/tsconfig.dest.json rename yarn-project/{noir-contracts/tsconfig.dest.json => types/tsconfig.json} (54%) delete mode 100644 yarn-project/world-state/tsconfig.dest.json create mode 100644 yarn-project/world-state/tsconfig.json diff --git a/README.md b/README.md index 0ba0eb3b947..4fb1eb60895 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ All the packages that make up Aztec 3. Typescript projects exist in yarn-project Package development: - Run `yarn build:dev` in the root to interactively build the package. -- Run `yarn prepare` in the root to update tsconfig.dest.json and build_manifest.json files based on package.json contents. +- Run `yarn prepare` in the root to update tsconfig.json and build_manifest.json files based on package.json contents. Note this only analyzes package.json imports to @aztec/\* packages. Repo architecture: - yarn-project/tsconfig.json: Base tsconfig file, extended by all packages. Used directly by vscode and eslint, where it functions to include the whole project without listing project references. -- yarn-project/tsconfig.dest.json: Used by `yarn build:dev` in root. -- package/tsconfig.dest.json: Each package has its own file that specifies its project reference dependencies. This allows them to be built independently. +- yarn-project/tsconfig.json: Used by `yarn build:dev` in root. +- package/tsconfig.json: Each package has its own file that specifies its project reference dependencies. This allows them to be built independently. diff --git a/yarn-project/.gitignore b/yarn-project/.gitignore index 14fa32e71df..331139a95aa 100644 --- a/yarn-project/.gitignore +++ b/yarn-project/.gitignore @@ -5,6 +5,7 @@ node_modules *.log *.swp .tsbuildinfo +tsconfig.tsbuildinfo # Zero install: https://yarnpkg.com/features/zero-installs .yarn/* diff --git a/yarn-project/@types/jest/index.d.ts b/yarn-project/@types/jest/index.d.ts new file mode 100644 index 00000000000..7755572d449 --- /dev/null +++ b/yarn-project/@types/jest/index.d.ts @@ -0,0 +1,10 @@ +// See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64936/files +declare namespace jest { + /** + * Replaces property on an object with another value. + * + * @remarks + * For mocking functions, and 'get' or 'set' accessors, use `jest.spyOn()` instead. + */ + function replaceProperty(obj: T, key: K, value: T[K]): ReplaceProperty; +} diff --git a/yarn-project/acir-simulator/package.json b/yarn-project/acir-simulator/package.json index fa9a2f14143..75742904b19 100644 --- a/yarn-project/acir-simulator/package.json +++ b/yarn-project/acir-simulator/package.json @@ -6,20 +6,20 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Acir Simulator", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -56,5 +56,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/acir-simulator/tsconfig.dest.json b/yarn-project/acir-simulator/tsconfig.dest.json deleted file mode 100644 index d4a76f660bc..00000000000 --- a/yarn-project/acir-simulator/tsconfig.dest.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../barretenberg.js/tsconfig.dest.json" - }, - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../merkle-tree/tsconfig.dest.json" - }, - { - "path": "../noir-contracts/tsconfig.dest.json" - } - ], - "exclude": ["**/*.test.*", "**/fixtures/*"], - "include": ["src"] -} diff --git a/yarn-project/acir-simulator/tsconfig.json b/yarn-project/acir-simulator/tsconfig.json new file mode 100644 index 00000000000..b9f1a5f6013 --- /dev/null +++ b/yarn-project/acir-simulator/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../barretenberg.js" + }, + { + "path": "../circuits.js" + }, + { + "path": "../foundation" + }, + { + "path": "../merkle-tree" + }, + { + "path": "../noir-contracts" + } + ], + "include": ["src"] +} diff --git a/yarn-project/archiver/package.json b/yarn-project/archiver/package.json index 09c61f4ea77..f8ad4c1221f 100644 --- a/yarn-project/archiver/package.json +++ b/yarn-project/archiver/package.json @@ -6,24 +6,24 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Archiver", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests", "start": "node ./dest", - "start:dev": "tsc-watch -p tsconfig.dest.json --onSuccess 'yarn start'", + "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\"", "test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --config jest.integration.config.json" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -57,5 +57,11 @@ "ts-jest": "^29.1.0", "ts-node": "^10.9.1", "typescript": "^5.0.3" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/archiver/tsconfig.dest.json b/yarn-project/archiver/tsconfig.dest.json deleted file mode 100644 index 25aa8fdc14a..00000000000 --- a/yarn-project/archiver/tsconfig.dest.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../ethereum.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../l1-contracts/tsconfig.dest.json" - }, - { - "path": "../types/tsconfig.dest.json" - } - ], - "exclude": ["**/*.test.*", "**/fixtures/*"], - "include": ["src"] -} diff --git a/yarn-project/l1-contracts/tsconfig.dest.json b/yarn-project/archiver/tsconfig.json similarity index 52% rename from yarn-project/l1-contracts/tsconfig.dest.json rename to yarn-project/archiver/tsconfig.json index 1d44b3925b3..00f72ffe42b 100644 --- a/yarn-project/l1-contracts/tsconfig.dest.json +++ b/yarn-project/archiver/tsconfig.json @@ -7,12 +7,17 @@ }, "references": [ { - "path": "../ethereum.js/tsconfig.dest.json" + "path": "../ethereum.js" }, { - "path": "../foundation/tsconfig.dest.json" + "path": "../foundation" + }, + { + "path": "../l1-contracts" + }, + { + "path": "../types" } ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] + "include": ["src"] } diff --git a/yarn-project/aztec-cli/package.json b/yarn-project/aztec-cli/package.json index f71a5f92598..43cfffebf52 100644 --- a/yarn-project/aztec-cli/package.json +++ b/yarn-project/aztec-cli/package.json @@ -6,7 +6,7 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Aztec cli", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "bin": { "aztec_cli": "index.js" @@ -14,15 +14,15 @@ "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -52,5 +52,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/aztec-cli/tsconfig.dest.json b/yarn-project/aztec-cli/tsconfig.json similarity index 66% rename from yarn-project/aztec-cli/tsconfig.dest.json rename to yarn-project/aztec-cli/tsconfig.json index e8cf5e00585..63f8ab3e9f7 100644 --- a/yarn-project/aztec-cli/tsconfig.dest.json +++ b/yarn-project/aztec-cli/tsconfig.json @@ -7,9 +7,8 @@ }, "references": [ { - "path": "../foundation/tsconfig.dest.json" + "path": "../foundation" } ], - "exclude": ["**/*.test.*", "**/fixtures/*"], "include": ["src"] } diff --git a/yarn-project/aztec-node/package.json b/yarn-project/aztec-node/package.json index 1126e7b8b97..1a14a2e9c54 100644 --- a/yarn-project/aztec-node/package.json +++ b/yarn-project/aztec-node/package.json @@ -7,13 +7,13 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Aztec Node", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", @@ -22,16 +22,10 @@ "test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --config jest.integration.config.json" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", - "globals": { - "ts-jest": { - "useESM": true, - "tsconfig": "../tsconfig.json" - } - }, "moduleNameMapper": { "^(\\.{1,2}/.*)\\.js$": "$1" }, @@ -54,12 +48,18 @@ "devDependencies": { "@jest/globals": "^29.4.3", "@rushstack/eslint-patch": "^1.1.4", - "@types/jest": "^29.4.0", + "@types/jest": "^29.5.0", "@types/node": "^18.7.23", "concurrently": "^7.6.0", - "jest": "^28.1.3", - "ts-jest": "^28.0.7", + "jest": "^29.5.0", + "ts-jest": "^29.1.0", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/aztec-node/test/aztec_node.test.ts b/yarn-project/aztec-node/src/test/aztec_node.test.ts similarity index 94% rename from yarn-project/aztec-node/test/aztec_node.test.ts rename to yarn-project/aztec-node/src/test/aztec_node.test.ts index f3804030087..e7b53369bc9 100644 --- a/yarn-project/aztec-node/test/aztec_node.test.ts +++ b/yarn-project/aztec-node/src/test/aztec_node.test.ts @@ -5,16 +5,20 @@ import { WalletProvider } from '@aztec/ethereum.js/provider'; import { EthAddress, createDebugLogger, sleep } from '@aztec/foundation'; import { INITIAL_L2_BLOCK_NUM } from '@aztec/l1-contracts'; import { Tx } from '@aztec/types'; -import { AztecNode } from '../index.js'; -import { AztecNodeConfig } from './config.js'; -import { createProvider, createTx, deployRollupContract, deployUnverifiedDataEmitterContract } from './fixtures.js'; +import { AztecNode, AztecNodeConfig } from '../index.js'; +import { + createProvider, + createTx, + deployRollupContract, + deployUnverifiedDataEmitterContract, +} from '../aztec-node/fixtures.js'; const ETHEREUM_HOST = 'http://127.0.0.1:8545/'; const MNEMONIC = 'test test test test test test test test test test test junk'; const logger = createDebugLogger('aztec:e2e_test'); -describe('AztecNode', () => { +describe.skip('AztecNode', () => { let rollupAddress: EthAddress; let unverifiedDataEmitterAddress: EthAddress; let node: AztecNode; diff --git a/yarn-project/aztec-node/tsconfig.dest.json b/yarn-project/aztec-node/tsconfig.dest.json deleted file mode 100644 index 5bcfc7742d3..00000000000 --- a/yarn-project/aztec-node/tsconfig.dest.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../archiver/tsconfig.dest.json" - }, - { - "path": "../barretenberg.js/tsconfig.dest.json" - }, - { - "path": "../ethereum.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../l1-contracts/tsconfig.dest.json" - }, - { - "path": "../merkle-tree/tsconfig.dest.json" - }, - { - "path": "../p2p/tsconfig.dest.json" - }, - { - "path": "../sequencer-client/tsconfig.dest.json" - }, - { - "path": "../types/tsconfig.dest.json" - }, - { - "path": "../world-state/tsconfig.dest.json" - } - ], - "include": ["src", "test"], - "exclude": ["**/*.test.*", "**/fixtures/*"] -} diff --git a/yarn-project/aztec-node/tsconfig.json b/yarn-project/aztec-node/tsconfig.json new file mode 100644 index 00000000000..000ec31f76e --- /dev/null +++ b/yarn-project/aztec-node/tsconfig.json @@ -0,0 +1,41 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../archiver" + }, + { + "path": "../barretenberg.js" + }, + { + "path": "../ethereum.js" + }, + { + "path": "../foundation" + }, + { + "path": "../l1-contracts" + }, + { + "path": "../merkle-tree" + }, + { + "path": "../p2p" + }, + { + "path": "../sequencer-client" + }, + { + "path": "../types" + }, + { + "path": "../world-state" + } + ], + "include": ["src"] +} diff --git a/yarn-project/aztec-rpc/package.json b/yarn-project/aztec-rpc/package.json index b8b2196459a..be94f427465 100644 --- a/yarn-project/aztec-rpc/package.json +++ b/yarn-project/aztec-rpc/package.json @@ -6,27 +6,26 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Wallet", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", "globals": { "ts-jest": { - "useESM": true, - "tsconfig": "../tsconfig.json" + "useESM": true } }, "moduleNameMapper": { @@ -57,5 +56,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/aztec-rpc/tsconfig.dest.json b/yarn-project/aztec-rpc/tsconfig.dest.json deleted file mode 100644 index 1d423887771..00000000000 --- a/yarn-project/aztec-rpc/tsconfig.dest.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../acir-simulator/tsconfig.dest.json" - }, - { - "path": "../aztec-node/tsconfig.dest.json" - }, - { - "path": "../barretenberg.js/tsconfig.dest.json" - }, - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../kernel-prover/tsconfig.dest.json" - }, - { - "path": "../noir-contracts/tsconfig.dest.json" - }, - { - "path": "../types/tsconfig.dest.json" - } - ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] -} diff --git a/yarn-project/aztec-rpc/tsconfig.json b/yarn-project/aztec-rpc/tsconfig.json new file mode 100644 index 00000000000..03d8bac6f3c --- /dev/null +++ b/yarn-project/aztec-rpc/tsconfig.json @@ -0,0 +1,35 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../acir-simulator" + }, + { + "path": "../aztec-node" + }, + { + "path": "../barretenberg.js" + }, + { + "path": "../circuits.js" + }, + { + "path": "../foundation" + }, + { + "path": "../kernel-prover" + }, + { + "path": "../noir-contracts" + }, + { + "path": "../types" + } + ], + "include": ["src"] +} diff --git a/yarn-project/aztec.js/package.json b/yarn-project/aztec.js/package.json index 529771ebe97..8de0e95dcb8 100644 --- a/yarn-project/aztec.js/package.json +++ b/yarn-project/aztec.js/package.json @@ -6,20 +6,20 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Aztec.js", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -52,5 +52,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/aztec.js/tsconfig.dest.json b/yarn-project/aztec.js/tsconfig.dest.json deleted file mode 100644 index a080a0d7931..00000000000 --- a/yarn-project/aztec.js/tsconfig.dest.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../aztec-rpc/tsconfig.dest.json" - }, - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../noir-contracts/tsconfig.dest.json" - } - ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] -} diff --git a/yarn-project/merkle-tree/tsconfig.dest.json b/yarn-project/aztec.js/tsconfig.json similarity index 51% rename from yarn-project/merkle-tree/tsconfig.dest.json rename to yarn-project/aztec.js/tsconfig.json index 35f0422679f..16a15459d68 100644 --- a/yarn-project/merkle-tree/tsconfig.dest.json +++ b/yarn-project/aztec.js/tsconfig.json @@ -7,12 +7,17 @@ }, "references": [ { - "path": "../barretenberg.js/tsconfig.dest.json" + "path": "../aztec-rpc" }, { - "path": "../foundation/tsconfig.dest.json" + "path": "../circuits.js" + }, + { + "path": "../foundation" + }, + { + "path": "../noir-contracts" } ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] + "include": ["src"] } diff --git a/yarn-project/barretenberg.js/package.json b/yarn-project/barretenberg.js/package.json index deff8babbca..baf44acf4db 100644 --- a/yarn-project/barretenberg.js/package.json +++ b/yarn-project/barretenberg.js/package.json @@ -10,13 +10,13 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Barretenberg.js", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", @@ -24,7 +24,7 @@ "test-debug": "NODE_NO_WARNINGS=1 node --inspect-brk --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests --runInBand" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -61,5 +61,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/barretenberg.js/tsconfig.dest.json b/yarn-project/barretenberg.js/tsconfig.json similarity index 58% rename from yarn-project/barretenberg.js/tsconfig.dest.json rename to yarn-project/barretenberg.js/tsconfig.json index fea2a64dc14..63f8ab3e9f7 100644 --- a/yarn-project/barretenberg.js/tsconfig.dest.json +++ b/yarn-project/barretenberg.js/tsconfig.json @@ -7,9 +7,8 @@ }, "references": [ { - "path": "../foundation/tsconfig.dest.json" + "path": "../foundation" } ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] + "include": ["src"] } diff --git a/yarn-project/circuits.js/package.json b/yarn-project/circuits.js/package.json index b265ba5531a..7d001bf1a40 100644 --- a/yarn-project/circuits.js/package.json +++ b/yarn-project/circuits.js/package.json @@ -12,20 +12,20 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Circuits.js", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -65,5 +65,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/circuits.js/tsconfig.dest.json b/yarn-project/circuits.js/tsconfig.dest.json deleted file mode 100644 index 35f0422679f..00000000000 --- a/yarn-project/circuits.js/tsconfig.dest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../barretenberg.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - } - ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] -} diff --git a/yarn-project/prover-client/tsconfig.dest.json b/yarn-project/circuits.js/tsconfig.json similarity index 58% rename from yarn-project/prover-client/tsconfig.dest.json rename to yarn-project/circuits.js/tsconfig.json index fea2a64dc14..d17c5862c6d 100644 --- a/yarn-project/prover-client/tsconfig.dest.json +++ b/yarn-project/circuits.js/tsconfig.json @@ -7,9 +7,11 @@ }, "references": [ { - "path": "../foundation/tsconfig.dest.json" + "path": "../barretenberg.js" + }, + { + "path": "../foundation" } ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] + "include": ["src"] } diff --git a/yarn-project/docs/README.md b/yarn-project/docs/README.md index 9561bbfdde6..84608b8fcf8 100644 --- a/yarn-project/docs/README.md +++ b/yarn-project/docs/README.md @@ -16,6 +16,6 @@ To include a new package in the set that we generate documentation for add it to "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Aztec cli", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, ``` diff --git a/yarn-project/end-to-end/package.json b/yarn-project/end-to-end/package.json index d2763d80046..4ff616ee5ed 100644 --- a/yarn-project/end-to-end/package.json +++ b/yarn-project/end-to-end/package.json @@ -6,8 +6,8 @@ "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", @@ -16,7 +16,7 @@ "test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand --config jest.integration.config.json" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -45,5 +45,11 @@ "@types/node": "^18.7.23", "concurrently": "^7.6.0", "ts-node": "^10.9.1" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/end-to-end/tsconfig.dest.json b/yarn-project/end-to-end/tsconfig.dest.json deleted file mode 100644 index e8483a22f5d..00000000000 --- a/yarn-project/end-to-end/tsconfig.dest.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../aztec-node/tsconfig.dest.json" - }, - { - "path": "../aztec.js/tsconfig.dest.json" - }, - { - "path": "../ethereum.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../l1-contracts/tsconfig.dest.json" - }, - { - "path": "../noir-contracts/tsconfig.dest.json" - } - ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] -} diff --git a/yarn-project/end-to-end/tsconfig.json b/yarn-project/end-to-end/tsconfig.json new file mode 100644 index 00000000000..c9a5c51d714 --- /dev/null +++ b/yarn-project/end-to-end/tsconfig.json @@ -0,0 +1,29 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../aztec-node" + }, + { + "path": "../aztec.js" + }, + { + "path": "../ethereum.js" + }, + { + "path": "../foundation" + }, + { + "path": "../l1-contracts" + }, + { + "path": "../noir-contracts" + } + ], + "include": ["src"] +} diff --git a/yarn-project/ethereum.js/Dockerfile b/yarn-project/ethereum.js/Dockerfile index dc4ab6be25f..b7d655a7175 100644 --- a/yarn-project/ethereum.js/Dockerfile +++ b/yarn-project/ethereum.js/Dockerfile @@ -1,5 +1,6 @@ FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/yarn-project-base AS builder +COPY @types @types COPY foundation foundation COPY ethereum.js ethereum.js WORKDIR /usr/src/yarn-project/ethereum.js diff --git a/yarn-project/ethereum.js/example/tsconfig.json b/yarn-project/ethereum.js/example/tsconfig.json index b8c1d75f400..5ad84b348a0 100644 --- a/yarn-project/ethereum.js/example/tsconfig.json +++ b/yarn-project/ethereum.js/example/tsconfig.json @@ -5,13 +5,15 @@ "rootDir": "src", "tsBuildInfoFile": ".tsbuildinfo" }, - "include": ["src"], + "include": [ + "src" + ], "references": [ { - "path": "../tsconfig.dest.json" + "path": ".." }, { - "path": "../../foundation/tsconfig.dest.json" + "path": "../../foundation" } ] } diff --git a/yarn-project/ethereum.js/package.json b/yarn-project/ethereum.js/package.json index 5df034621a1..d97a08d6042 100644 --- a/yarn-project/ethereum.js/package.json +++ b/yarn-project/ethereum.js/package.json @@ -25,8 +25,8 @@ "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", @@ -34,7 +34,7 @@ "gen_fixtures": "NODE_NO_WARNINGS=1 node ./dest/contract/gen_def/index.js ./src/contract/fixtures/contracts.json" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "bin": { "contract_gen_def": "./dest/contract/gen_def/index.js" @@ -78,5 +78,11 @@ "jest-mock-extended": "^3.0.1", "ts-jest": "28.0.7", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/ethereum.js/tsconfig.dest.json b/yarn-project/ethereum.js/tsconfig.dest.json deleted file mode 100644 index 6871f9ea8d9..00000000000 --- a/yarn-project/ethereum.js/tsconfig.dest.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": ".", - "compilerOptions": { - "noImplicitAny": false, - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../foundation/tsconfig.dest.json" - } - ], - "include": ["src"], - "exclude": ["src/**/*.test.ts", "src/**/fixtures/*"] -} diff --git a/yarn-project/ethereum.js/tsconfig.json b/yarn-project/ethereum.js/tsconfig.json index 41e78a215e3..3b89ba50e7d 100644 --- a/yarn-project/ethereum.js/tsconfig.json +++ b/yarn-project/ethereum.js/tsconfig.json @@ -9,7 +9,7 @@ }, "references": [ { - "path": "../foundation/tsconfig.dest.json" + "path": "../foundation" } ], "include": ["src", "src/eth_typed_data/fixtures/*.json"] diff --git a/yarn-project/foundation/.eslintrc.cjs b/yarn-project/foundation/.eslintrc.cjs index 5ec1f2114f4..f446c2cba5d 100644 --- a/yarn-project/foundation/.eslintrc.cjs +++ b/yarn-project/foundation/.eslintrc.cjs @@ -51,7 +51,7 @@ module.exports = { './tsconfig.eslint.json', '../tsconfig.eslint.json', __dirname + '/../tsconfig.eslint.json', - './tsconfig.dest.json', + './tsconfig.json', ]), }, }, diff --git a/yarn-project/foundation/.eslintrc.legacy.cjs b/yarn-project/foundation/.eslintrc.legacy.cjs index b652f7a3c09..5af8b91381b 100644 --- a/yarn-project/foundation/.eslintrc.legacy.cjs +++ b/yarn-project/foundation/.eslintrc.legacy.cjs @@ -26,7 +26,7 @@ module.exports = { './tsconfig.eslint.json', '../tsconfig.eslint.json', __dirname + '/../tsconfig.eslint.json', - './tsconfig.dest.json', + './tsconfig.json', ]), }, }, diff --git a/yarn-project/foundation/Dockerfile b/yarn-project/foundation/Dockerfile index a7b01d7666c..e3666179f61 100644 --- a/yarn-project/foundation/Dockerfile +++ b/yarn-project/foundation/Dockerfile @@ -1,5 +1,6 @@ FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/yarn-project-base AS builder +COPY @types @types COPY foundation foundation WORKDIR /usr/src/yarn-project/foundation RUN yarn build && yarn formatting && yarn test diff --git a/yarn-project/foundation/package.json b/yarn-project/foundation/package.json index da685d020c9..5b183168308 100644 --- a/yarn-project/foundation/package.json +++ b/yarn-project/foundation/package.json @@ -30,15 +30,15 @@ "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -97,5 +97,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/foundation/tsconfig.dest.json b/yarn-project/foundation/tsconfig.json similarity index 78% rename from yarn-project/foundation/tsconfig.dest.json rename to yarn-project/foundation/tsconfig.json index f5e16b6ef46..10c967d4000 100644 --- a/yarn-project/foundation/tsconfig.dest.json +++ b/yarn-project/foundation/tsconfig.json @@ -5,7 +5,6 @@ "rootDir": "src", "tsBuildInfoFile": ".tsbuildinfo" }, - "exclude": ["**/*.test.*", "**/fixtures/*"], "include": ["src"], "references": [] } diff --git a/yarn-project/kernel-prover/package.json b/yarn-project/kernel-prover/package.json index 886952f171d..16358dec07f 100644 --- a/yarn-project/kernel-prover/package.json +++ b/yarn-project/kernel-prover/package.json @@ -6,20 +6,20 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Kernel Simulator", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -50,5 +50,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/kernel-prover/tsconfig.dest.json b/yarn-project/kernel-prover/tsconfig.dest.json deleted file mode 100644 index 4a15ea94b40..00000000000 --- a/yarn-project/kernel-prover/tsconfig.dest.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../acir-simulator/tsconfig.dest.json" - }, - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - } - ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] -} diff --git a/yarn-project/kernel-prover/tsconfig.json b/yarn-project/kernel-prover/tsconfig.json new file mode 100644 index 00000000000..f882fac1d9b --- /dev/null +++ b/yarn-project/kernel-prover/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../acir-simulator" + }, + { + "path": "../circuits.js" + }, + { + "path": "../foundation" + } + ], + "include": ["src"] +} diff --git a/yarn-project/key-store/package.json b/yarn-project/key-store/package.json index 3b014f0cecb..c5decc71b87 100644 --- a/yarn-project/key-store/package.json +++ b/yarn-project/key-store/package.json @@ -6,20 +6,20 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "KeyStore", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -48,5 +48,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/key-store/tsconfig.dest.json b/yarn-project/key-store/tsconfig.json similarity index 58% rename from yarn-project/key-store/tsconfig.dest.json rename to yarn-project/key-store/tsconfig.json index fea2a64dc14..63f8ab3e9f7 100644 --- a/yarn-project/key-store/tsconfig.dest.json +++ b/yarn-project/key-store/tsconfig.json @@ -7,9 +7,8 @@ }, "references": [ { - "path": "../foundation/tsconfig.dest.json" + "path": "../foundation" } ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] + "include": ["src"] } diff --git a/yarn-project/l1-contracts/package.json b/yarn-project/l1-contracts/package.json index df8b1479116..69d1707cef5 100644 --- a/yarn-project/l1-contracts/package.json +++ b/yarn-project/l1-contracts/package.json @@ -9,13 +9,13 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "L1 Contracts", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", @@ -23,7 +23,7 @@ "generate": "contract_gen_def && bash scripts/update-viem-abis.sh && yarn formatting:fix" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -53,5 +53,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/l1-contracts/tsconfig.json b/yarn-project/l1-contracts/tsconfig.json new file mode 100644 index 00000000000..f9b0bcf34ce --- /dev/null +++ b/yarn-project/l1-contracts/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../ethereum.js" + }, + { + "path": "../foundation" + } + ], + "include": ["src"] +} diff --git a/yarn-project/merkle-tree/package.json b/yarn-project/merkle-tree/package.json index 7abec586280..a64f5ced918 100644 --- a/yarn-project/merkle-tree/package.json +++ b/yarn-project/merkle-tree/package.json @@ -6,15 +6,15 @@ "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -50,5 +50,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/merkle-tree/tsconfig.json b/yarn-project/merkle-tree/tsconfig.json new file mode 100644 index 00000000000..d17c5862c6d --- /dev/null +++ b/yarn-project/merkle-tree/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../barretenberg.js" + }, + { + "path": "../foundation" + } + ], + "include": ["src"] +} diff --git a/yarn-project/noir-contracts/package.json b/yarn-project/noir-contracts/package.json index b61c09fc9f2..0e279e3dd54 100644 --- a/yarn-project/noir-contracts/package.json +++ b/yarn-project/noir-contracts/package.json @@ -9,20 +9,20 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Noir contracts", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -54,5 +54,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/noir-contracts/tsconfig.json b/yarn-project/noir-contracts/tsconfig.json new file mode 100644 index 00000000000..d262f2bcfb4 --- /dev/null +++ b/yarn-project/noir-contracts/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../foundation" + } + ], + "include": ["src", "src/**/*.json"] +} diff --git a/yarn-project/p2p/package.json b/yarn-project/p2p/package.json index 42460f8f909..c65121e555a 100644 --- a/yarn-project/p2p/package.json +++ b/yarn-project/p2p/package.json @@ -6,22 +6,22 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "P2P", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests", "start": "node ./dest", - "start:dev": "tsc-watch -p tsconfig.dest.json --onSuccess 'yarn start'" + "start:dev": "tsc-watch -p tsconfig.json --onSuccess 'yarn start'" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -53,5 +53,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/p2p/tsconfig.dest.json b/yarn-project/p2p/tsconfig.dest.json deleted file mode 100644 index 465809aaebb..00000000000 --- a/yarn-project/p2p/tsconfig.dest.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../types/tsconfig.dest.json" - } - ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] -} diff --git a/yarn-project/p2p/tsconfig.json b/yarn-project/p2p/tsconfig.json new file mode 100644 index 00000000000..1820488d409 --- /dev/null +++ b/yarn-project/p2p/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../circuits.js" + }, + { + "path": "../foundation" + }, + { + "path": "../types" + } + ], + "include": ["src"] +} diff --git a/yarn-project/package.scripts.json b/yarn-project/package.common.json similarity index 74% rename from yarn-project/package.scripts.json rename to yarn-project/package.common.json index b59502f0c77..7807198d621 100644 --- a/yarn-project/package.scripts.json +++ b/yarn-project/package.common.json @@ -2,11 +2,17 @@ "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/package.json b/yarn-project/package.json index f222080c1bc..60f5a29f103 100644 --- a/yarn-project/package.json +++ b/yarn-project/package.json @@ -3,14 +3,14 @@ "packageManager": "yarn@3.4.1", "private": true, "scripts": { - "prepare": "node ./yarn-project-base/scripts/update_package_jsons.mjs && yarn workspaces foreach run prepare && workspaces-to-typescript-project-references --tsconfigPath tsconfig.dest.json && prettier -w */tsconfig.dest.json", - "prepare:check": "node ./yarn-project-base/scripts/update_package_jsons.mjs --check && yarn workspaces foreach run prepare:check && workspaces-to-typescript-project-references --check --tsconfigPath tsconfig.dest.json", + "prepare": "node ./yarn-project-base/scripts/update_package_jsons.mjs && yarn workspaces foreach run prepare && workspaces-to-typescript-project-references --tsconfigPath tsconfig.json && prettier -w */tsconfig.json", + "prepare:check": "node ./yarn-project-base/scripts/update_package_jsons.mjs --check && yarn workspaces foreach run prepare:check && workspaces-to-typescript-project-references --check --tsconfigPath tsconfig.json", "docs": "typedoc --out docs/dist && cd docs && yarn serve", "formatting": "yarn workspaces foreach -v run formatting", "formatting:fix": "yarn workspaces foreach -v run formatting:fix", "test": "yarn workspaces foreach -v run test", - "build": "tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "tsc -b tsconfig.json", + "build:dev": "tsc -b tsconfig.json --watch", "clean": "yarn workspaces foreach -v run clean" }, "workspaces": [ diff --git a/yarn-project/prover-client/package.json b/yarn-project/prover-client/package.json index 40e3e84cf79..11b9d77ec0c 100644 --- a/yarn-project/prover-client/package.json +++ b/yarn-project/prover-client/package.json @@ -6,20 +6,20 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Prover Client", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -48,5 +48,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/prover-client/tsconfig.json b/yarn-project/prover-client/tsconfig.json new file mode 100644 index 00000000000..63f8ab3e9f7 --- /dev/null +++ b/yarn-project/prover-client/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../foundation" + } + ], + "include": ["src"] +} diff --git a/yarn-project/sequencer-client/package.json b/yarn-project/sequencer-client/package.json index 5fb7736b790..8a839a0e48e 100644 --- a/yarn-project/sequencer-client/package.json +++ b/yarn-project/sequencer-client/package.json @@ -6,13 +6,13 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Sequencer Client", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", @@ -21,7 +21,7 @@ "test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --config jest.integration.config.json" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -67,5 +67,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/sequencer-client/test/l2-block-publisher.test.ts b/yarn-project/sequencer-client/src/test/l2-block-publisher.test.ts similarity index 90% rename from yarn-project/sequencer-client/test/l2-block-publisher.test.ts rename to yarn-project/sequencer-client/src/test/l2-block-publisher.test.ts index 80b7705ddf4..8d81ab0b5cb 100644 --- a/yarn-project/sequencer-client/test/l2-block-publisher.test.ts +++ b/yarn-project/sequencer-client/src/test/l2-block-publisher.test.ts @@ -2,9 +2,9 @@ import { EthereumRpc } from '@aztec/ethereum.js/eth_rpc'; import { WalletProvider } from '@aztec/ethereum.js/provider'; import { Rollup, UnverifiedDataEmitter } from '@aztec/l1-contracts'; import { beforeAll, describe, expect, it } from '@jest/globals'; -import { EthereumjsTxSender } from '../src/publisher/ethereumjs-tx-sender.js'; -import { L1Publisher } from '../src/publisher/l1-publisher.js'; -import { hexStringToBuffer } from '../src/utils.js'; +import { EthereumjsTxSender } from '../publisher/ethereumjs-tx-sender.js'; +import { L1Publisher } from '../publisher/l1-publisher.js'; +import { hexStringToBuffer } from '../utils.js'; import { L2Block } from '@aztec/types'; // Accounts 4 and 5 of Anvil default startup with mnemonic: 'test test test test test test test test test test test junk' @@ -12,7 +12,7 @@ const sequencerPK = '0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30 const deployerPK = '0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba'; const anvilHost = process.env.ANVIL_HOST ?? 'http://127.0.0.1:8545'; -describe('L1Publisher integration', () => { +describe.skip('L1Publisher integration', () => { let rollup: Rollup; let unverifiedDataEmitter: UnverifiedDataEmitter; let ethRpc: EthereumRpc; @@ -71,7 +71,9 @@ async function deployRollup() { // Create new instance so we can attach the sequencer as sender const rollup = new Rollup(ethRpc, deployedRollup.address, { from: sequencer }); - const unverifiedDataEmitter = new UnverifiedDataEmitter(ethRpc, deployedUnverifiedDataEmitter.address, { from: sequencer }); + const unverifiedDataEmitter = new UnverifiedDataEmitter(ethRpc, deployedUnverifiedDataEmitter.address, { + from: sequencer, + }); return { rollup, deployer, unverifiedDataEmitter, sequencer, ethRpc }; } diff --git a/yarn-project/sequencer-client/tsconfig.dest.json b/yarn-project/sequencer-client/tsconfig.dest.json deleted file mode 100644 index a5a24e26f8c..00000000000 --- a/yarn-project/sequencer-client/tsconfig.dest.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../ethereum.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../l1-contracts/tsconfig.dest.json" - }, - { - "path": "../merkle-tree/tsconfig.dest.json" - }, - { - "path": "../p2p/tsconfig.dest.json" - }, - { - "path": "../types/tsconfig.dest.json" - }, - { - "path": "../world-state/tsconfig.dest.json" - } - ], - "include": ["src", "test"], - "exclude": ["**/*.test.*", "**/fixtures/*"] -} diff --git a/yarn-project/sequencer-client/tsconfig.json b/yarn-project/sequencer-client/tsconfig.json new file mode 100644 index 00000000000..bca949504f6 --- /dev/null +++ b/yarn-project/sequencer-client/tsconfig.json @@ -0,0 +1,35 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../circuits.js" + }, + { + "path": "../ethereum.js" + }, + { + "path": "../foundation" + }, + { + "path": "../l1-contracts" + }, + { + "path": "../merkle-tree" + }, + { + "path": "../p2p" + }, + { + "path": "../types" + }, + { + "path": "../world-state" + } + ], + "include": ["src"] +} diff --git a/yarn-project/tsconfig.dest.json b/yarn-project/tsconfig.dest.json deleted file mode 100644 index 0d54f06530c..00000000000 --- a/yarn-project/tsconfig.dest.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "files": [], - "include": [], - "references": [ - { "path": "acir-simulator/tsconfig.dest.json" }, - { "path": "archiver/tsconfig.dest.json" }, - { "path": "aztec-cli/tsconfig.dest.json" }, - { "path": "aztec.js/tsconfig.dest.json" }, - { "path": "aztec-node/tsconfig.dest.json" }, - { "path": "aztec-rpc/tsconfig.dest.json" }, - { "path": "barretenberg.js/tsconfig.dest.json" }, - { "path": "circuits.js/tsconfig.dest.json" }, - { "path": "end-to-end/tsconfig.dest.json" }, - { "path": "ethereum.js/tsconfig.dest.json" }, - { "path": "foundation/tsconfig.dest.json" }, - { "path": "kernel-prover/tsconfig.dest.json" }, - { "path": "key-store/tsconfig.dest.json" }, - { "path": "l1-contracts/tsconfig.dest.json" }, - { "path": "merkle-tree/tsconfig.dest.json" }, - { "path": "noir-contracts/tsconfig.dest.json" }, - { "path": "p2p/tsconfig.dest.json" }, - { "path": "prover-client/tsconfig.dest.json" }, - { "path": "sequencer-client/tsconfig.dest.json" }, - { "path": "types/tsconfig.dest.json" }, - { "path": "world-state/tsconfig.dest.json" } - ] -} diff --git a/yarn-project/tsconfig.json b/yarn-project/tsconfig.json index 08d6b8bf57e..71d695ade13 100644 --- a/yarn-project/tsconfig.json +++ b/yarn-project/tsconfig.json @@ -17,27 +17,27 @@ "composite": true }, "references": [ - { "path": "acir-simulator/tsconfig.dest.json" }, - { "path": "archiver/tsconfig.dest.json" }, - { "path": "aztec-cli/tsconfig.dest.json" }, - { "path": "aztec.js/tsconfig.dest.json" }, - { "path": "aztec-node/tsconfig.dest.json" }, - { "path": "aztec-rpc/tsconfig.dest.json" }, - { "path": "barretenberg.js/tsconfig.dest.json" }, - { "path": "circuits.js/tsconfig.dest.json" }, - { "path": "end-to-end/tsconfig.dest.json" }, - { "path": "ethereum.js/tsconfig.dest.json" }, - { "path": "foundation/tsconfig.dest.json" }, - { "path": "kernel-prover/tsconfig.dest.json" }, - { "path": "key-store/tsconfig.dest.json" }, - { "path": "l1-contracts/tsconfig.dest.json" }, - { "path": "merkle-tree/tsconfig.dest.json" }, - { "path": "noir-contracts/tsconfig.dest.json" }, - { "path": "p2p/tsconfig.dest.json" }, - { "path": "prover-client/tsconfig.dest.json" }, - { "path": "sequencer-client/tsconfig.dest.json" }, - { "path": "types/tsconfig.dest.json" }, - { "path": "world-state/tsconfig.dest.json" } + { "path": "acir-simulator/tsconfig.json" }, + { "path": "archiver/tsconfig.json" }, + { "path": "aztec-cli/tsconfig.json" }, + { "path": "aztec.js/tsconfig.json" }, + { "path": "aztec-node/tsconfig.json" }, + { "path": "aztec-rpc/tsconfig.json" }, + { "path": "barretenberg.js/tsconfig.json" }, + { "path": "circuits.js/tsconfig.json" }, + { "path": "end-to-end/tsconfig.json" }, + { "path": "ethereum.js/tsconfig.json" }, + { "path": "foundation/tsconfig.json" }, + { "path": "kernel-prover/tsconfig.json" }, + { "path": "key-store/tsconfig.json" }, + { "path": "l1-contracts/tsconfig.json" }, + { "path": "merkle-tree/tsconfig.json" }, + { "path": "noir-contracts/tsconfig.json" }, + { "path": "p2p/tsconfig.json" }, + { "path": "prover-client/tsconfig.json" }, + { "path": "sequencer-client/tsconfig.json" }, + { "path": "types/tsconfig.json" }, + { "path": "world-state/tsconfig.json" } ], - "include": ["**/*.ts", "**/*.tsx", "**/*.json"] + "files": ["./@types/jest/index.d.ts"], } diff --git a/yarn-project/types/package.json b/yarn-project/types/package.json index 55fa69a0bc4..9fe50b56222 100644 --- a/yarn-project/types/package.json +++ b/yarn-project/types/package.json @@ -6,20 +6,20 @@ "typedoc": { "entryPoint": "./src/index.ts", "displayName": "Aztec 3 Types", - "tsconfig": "./tsconfig.dest.json" + "tsconfig": "./tsconfig.json" }, "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -51,5 +51,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/types/tsconfig.dest.json b/yarn-project/types/tsconfig.dest.json deleted file mode 100644 index 2c1f84deaf1..00000000000 --- a/yarn-project/types/tsconfig.dest.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../l1-contracts/tsconfig.dest.json" - } - ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] -} diff --git a/yarn-project/noir-contracts/tsconfig.dest.json b/yarn-project/types/tsconfig.json similarity index 54% rename from yarn-project/noir-contracts/tsconfig.dest.json rename to yarn-project/types/tsconfig.json index 075e769e6d7..97fd9a4ea3e 100644 --- a/yarn-project/noir-contracts/tsconfig.dest.json +++ b/yarn-project/types/tsconfig.json @@ -7,9 +7,14 @@ }, "references": [ { - "path": "../foundation/tsconfig.dest.json" + "path": "../circuits.js" + }, + { + "path": "../foundation" + }, + { + "path": "../l1-contracts" } ], - "include": ["src", "src/**/*.json"], - "exclude": ["**/*.test.*", "**/fixtures/*"] + "include": ["src"] } diff --git a/yarn-project/world-state/package.json b/yarn-project/world-state/package.json index 7787b080fc4..9f00a7af65d 100644 --- a/yarn-project/world-state/package.json +++ b/yarn-project/world-state/package.json @@ -6,15 +6,15 @@ "scripts": { "prepare": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json", "prepare:check": "node ../yarn-project-base/scripts/update_build_manifest.mjs package.json --check", - "build": "yarn clean && tsc -b tsconfig.dest.json", - "build:dev": "tsc -b tsconfig.dest.json --watch", + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T prettier -w ./src", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" }, "inherits": [ - "../package.scripts.json" + "../package.common.json" ], "jest": { "preset": "ts-jest/presets/default-esm", @@ -51,5 +51,11 @@ "ts-jest": "^28.0.7", "ts-node": "^10.9.1", "typescript": "^4.9.5" - } + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts" } diff --git a/yarn-project/world-state/tsconfig.dest.json b/yarn-project/world-state/tsconfig.dest.json deleted file mode 100644 index a891c20905c..00000000000 --- a/yarn-project/world-state/tsconfig.dest.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "references": [ - { - "path": "../barretenberg.js/tsconfig.dest.json" - }, - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../merkle-tree/tsconfig.dest.json" - }, - { - "path": "../types/tsconfig.dest.json" - } - ], - "include": ["src"], - "exclude": ["**/*.test.*", "**/fixtures/*"] -} diff --git a/yarn-project/world-state/tsconfig.json b/yarn-project/world-state/tsconfig.json new file mode 100644 index 00000000000..8031bd83834 --- /dev/null +++ b/yarn-project/world-state/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../barretenberg.js" + }, + { + "path": "../circuits.js" + }, + { + "path": "../foundation" + }, + { + "path": "../merkle-tree" + }, + { + "path": "../types" + } + ], + "include": ["src"] +} diff --git a/yarn-project/yarn-project-base/Dockerfile b/yarn-project/yarn-project-base/Dockerfile index c64bc844bb1..2ed7214a24b 100644 --- a/yarn-project/yarn-project-base/Dockerfile +++ b/yarn-project/yarn-project-base/Dockerfile @@ -44,7 +44,7 @@ COPY world-state/package.json world-state/package.json COPY yarn-project-base/package.json yarn-project-base/package.json # Copy root files -COPY package.json package.*.json tsconfig.json tsconfig.dest.json tsconfig.eslint.json yarn.lock .yarnrc.yml ./ +COPY package.json package.*.json tsconfig.json tsconfig.eslint.json yarn.lock .yarnrc.yml ./ COPY .yarn .yarn # Although we're attempting to be "zero-install", in practice we still need to build arch specific packages. @@ -75,27 +75,27 @@ COPY build_manifest.json ./ RUN cp build_manifest.json ../ # Copy tsconfig to check dependencies -COPY acir-simulator/tsconfig.dest.json acir-simulator/tsconfig.dest.json -COPY archiver/tsconfig.dest.json archiver/tsconfig.dest.json -COPY aztec-cli/tsconfig.dest.json aztec-cli/tsconfig.dest.json -COPY aztec-rpc/tsconfig.dest.json aztec-rpc/tsconfig.dest.json -COPY aztec-node/tsconfig.dest.json aztec-node/tsconfig.dest.json -COPY aztec.js/tsconfig.dest.json aztec.js/tsconfig.dest.json -COPY end-to-end/tsconfig.dest.json end-to-end/tsconfig.dest.json -COPY ethereum.js/tsconfig.dest.json ethereum.js/tsconfig.dest.json -COPY foundation/tsconfig.dest.json foundation/tsconfig.dest.json -COPY kernel-prover/tsconfig.dest.json kernel-prover/tsconfig.dest.json -COPY key-store/tsconfig.dest.json key-store/tsconfig.dest.json -COPY merkle-tree/tsconfig.dest.json merkle-tree/tsconfig.dest.json -COPY noir-contracts/tsconfig.dest.json noir-contracts/tsconfig.dest.json -COPY l1-contracts/tsconfig.dest.json l1-contracts/tsconfig.dest.json -COPY barretenberg.js/tsconfig.dest.json barretenberg.js/tsconfig.dest.json -COPY circuits.js/tsconfig.dest.json circuits.js/tsconfig.dest.json -COPY p2p/tsconfig.dest.json p2p/tsconfig.dest.json -COPY prover-client/tsconfig.dest.json prover-client/tsconfig.dest.json -COPY sequencer-client/tsconfig.dest.json sequencer-client/tsconfig.dest.json -COPY types/tsconfig.dest.json types/tsconfig.dest.json -COPY world-state/tsconfig.dest.json world-state/tsconfig.dest.json +COPY acir-simulator/tsconfig.json acir-simulator/tsconfig.json +COPY archiver/tsconfig.json archiver/tsconfig.json +COPY aztec-cli/tsconfig.json aztec-cli/tsconfig.json +COPY aztec-rpc/tsconfig.json aztec-rpc/tsconfig.json +COPY aztec-node/tsconfig.json aztec-node/tsconfig.json +COPY aztec.js/tsconfig.json aztec.js/tsconfig.json +COPY end-to-end/tsconfig.json end-to-end/tsconfig.json +COPY ethereum.js/tsconfig.json ethereum.js/tsconfig.json +COPY foundation/tsconfig.json foundation/tsconfig.json +COPY kernel-prover/tsconfig.json kernel-prover/tsconfig.json +COPY key-store/tsconfig.json key-store/tsconfig.json +COPY merkle-tree/tsconfig.json merkle-tree/tsconfig.json +COPY noir-contracts/tsconfig.json noir-contracts/tsconfig.json +COPY l1-contracts/tsconfig.json l1-contracts/tsconfig.json +COPY barretenberg.js/tsconfig.json barretenberg.js/tsconfig.json +COPY circuits.js/tsconfig.json circuits.js/tsconfig.json +COPY p2p/tsconfig.json p2p/tsconfig.json +COPY prover-client/tsconfig.json prover-client/tsconfig.json +COPY sequencer-client/tsconfig.json sequencer-client/tsconfig.json +COPY types/tsconfig.json types/tsconfig.json +COPY world-state/tsconfig.json world-state/tsconfig.json # Check that dependencies config are up to date COPY yarn-project-base/scripts yarn-project-base/scripts diff --git a/yarn-project/yarn-project-base/scripts/update_package_jsons.mjs b/yarn-project/yarn-project-base/scripts/update_package_jsons.mjs index 9e322eda1a7..f5f122a465e 100644 --- a/yarn-project/yarn-project-base/scripts/update_package_jsons.mjs +++ b/yarn-project/yarn-project-base/scripts/update_package_jsons.mjs @@ -28,6 +28,15 @@ function getFiles() { return files; } +function getUpdatedValue(source, target, key) { + const value = source[key]; + if (typeof value === 'object' && !Array.isArray(value)) { + return { ...target[key], ...value }; + } else { + return value; + } +} + async function main() { const checkOnly = process.argv[2] === '--check'; console.log( @@ -45,10 +54,7 @@ async function main() { const parentFullPath = resolve(dirname(file), parent); const source = await getSource(parentFullPath); for (const key in source) { - const updatedValue = { - ...packageData[key], - ...source[key], - }; + const updatedValue = getUpdatedValue(source, packageData, key); updated = updated || JSON.stringify(updatedValue) !== JSON.stringify(packageData[key]); if (checkOnly) { if (updated) { diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index 5c5960322f6..1aa864fdd03 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -112,11 +112,11 @@ __metadata: "@aztec/world-state": "workspace:^" "@jest/globals": ^29.4.3 "@rushstack/eslint-patch": ^1.1.4 - "@types/jest": ^29.4.0 + "@types/jest": ^29.5.0 "@types/node": ^18.7.23 concurrently: ^7.6.0 - jest: ^28.1.3 - ts-jest: ^28.0.7 + jest: ^29.5.0 + ts-jest: ^29.1.0 ts-node: ^10.9.1 tslib: ^2.4.0 typescript: ^4.9.5