Skip to content

Commit c30876a

Browse files
authored
🚵‍♂️ [WIP] Add TS project references and simplify tsconfigs (#792)
1 parent f6d240e commit c30876a

25 files changed

+74
-45
lines changed

tsconfig.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
"resolveJsonModule": true,
1212
"skipLibCheck": true,
1313
"strict": true,
14-
"target": "ES2018"
14+
"target": "ES2018",
15+
"composite": true,
16+
"sourceMap": true,
17+
"declarationMap": true,
1518
}
1619
}

waffle-chai/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
"bugs": {
2828
"url": "https://github.com/EthWorks/Waffle/issues"
2929
},
30-
"main": "dist/cjs/index.js",
31-
"module": "dist/esm/index.ts",
32-
"types": "dist/esm/index.d.ts",
30+
"main": "dist/cjs/src/index.js",
31+
"module": "dist/esm/src/index.ts",
32+
"types": "dist/esm/src/index.d.ts",
3333
"scripts": {
3434
"test": "mocha",
3535
"lint": "eslint '{src,test}/**/*.ts'",
3636
"lint:fix": "eslint --fix '{src,test}/**/*.ts'",
3737
"build": "rimraf ./dist && yarn build:esm && yarn build:cjs",
3838
"build:esm": "tsc -p tsconfig.build.json --outDir dist/esm --module ES6",
39-
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs --declaration false"
39+
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs"
4040
},
4141
"engines": {
4242
"node": ">=10.0"

waffle-chai/tsconfig.build.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": [
4-
"src",
5-
],
4+
"src"
5+
]
66
}

waffle-chai/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
36
"references": [
47
{
58
"path": "../waffle-provider"

waffle-cli/bin/waffle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
'use strict';
33

4-
const Waffle = require('../dist/cjs/cli.js');
4+
const Waffle = require('../dist/cjs/src/cli.js');
55
Waffle
66
.runCli(process.argv.slice(2))
77
.catch(e => {

waffle-cli/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
"bugs": {
2929
"url": "https://github.com/EthWorks/Waffle/issues"
3030
},
31-
"main": "dist/cjs/index.js",
32-
"module": "dist/esm/index.ts",
33-
"types": "dist/esm/index.d.ts",
31+
"main": "dist/cjs/src/index.js",
32+
"module": "dist/esm/src/index.ts",
33+
"types": "dist/esm/src/index.d.ts",
3434
"bin": {
3535
"waffle": "./bin/waffle"
3636
},
@@ -42,7 +42,7 @@
4242
"lint:fix": "eslint --fix '{src,test}/**/*.ts'",
4343
"build": "rimraf ./dist && yarn build:esm && yarn build:cjs",
4444
"build:esm": "tsc -p tsconfig.build.json --outDir dist/esm --module ES6",
45-
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs --declaration false",
45+
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs",
4646
"clean": "rimraf ./dist ./test/example/build"
4747
},
4848
"engines": {

waffle-cli/tsconfig.build.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": [
4-
"src",
5-
],
4+
"src"
5+
]
66
}

waffle-cli/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
36
"references": [
47
{
58
"path": "../waffle-chai"

waffle-compiler/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
"bugs": {
2828
"url": "https://github.com/EthWorks/Waffle/issues"
2929
},
30-
"main": "dist/cjs/index.js",
31-
"module": "dist/esm/index.ts",
32-
"types": "dist/esm/index.d.ts",
30+
"main": "dist/cjs/src/index.js",
31+
"module": "dist/esm/src/index.ts",
32+
"types": "dist/esm/src/index.d.ts",
3333
"scripts": {
3434
"test": "mocha",
3535
"lint": "eslint '{src,test}/**/*.ts'",
3636
"lint:fix": "eslint --fix '{src,test}/**/*.ts'",
3737
"build": "rimraf ./dist && yarn build:esm && yarn build:cjs",
3838
"build:esm": "tsc -p tsconfig.build.json --outDir dist/esm --module ES6",
39-
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs --declaration false"
39+
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs"
4040
},
4141
"engines": {
4242
"node": ">=10.0"

waffle-compiler/tsconfig.build.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": [
4-
"src",
5-
],
4+
"src"
5+
]
66
}

waffle-compiler/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
36
"references": [
47
{
58
"path": "../waffle-chai"

waffle-e2e/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
36
"references": [
47
{
58
"path": "../waffle-chai"

waffle-ens/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
"bugs": {
2929
"url": "https://github.com/EthWorks/Waffle/issues"
3030
},
31-
"main": "dist/cjs/index.js",
32-
"module": "dist/esm/index.ts",
33-
"types": "dist/esm/index.d.ts",
31+
"main": "dist/cjs/src/index.js",
32+
"module": "dist/esm/src/index.ts",
33+
"types": "dist/esm/src/index.d.ts",
3434
"scripts": {
3535
"test": "mocha",
3636
"lint": "eslint '{src,test}/**/*.ts'",
3737
"lint:fix": "eslint --fix '{src,test}/**/*.ts'",
3838
"build": "rimraf ./dist && pnpm build:artifacts && pnpm build:esm && pnpm build:cjs",
3939
"build:esm": "tsc -p tsconfig.build.json --outDir dist/esm --module ES6",
40-
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs --declaration false",
40+
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs",
4141
"build:artifacts": "node build-artifacts.js"
4242
},
4343
"engines": {

waffle-ens/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4-
"allowJs": true
4+
"allowJs": true,
5+
"outDir": "dist"
56
}
67
}

waffle-hardhat/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"repository": "git@github.com:EthWorks/Waffle.git",
77
"private": true,
88
"license": "MIT",
9-
"main": "dist/cjs/index.js",
10-
"module": "dist/esm/index.ts",
11-
"types": "dist/esm/index.d.ts",
9+
"main": "dist/cjs/src/index.js",
10+
"module": "dist/esm/src/index.ts",
11+
"types": "dist/esm/src/index.d.ts",
1212
"scripts": {
1313
"build": "hardhat compile",
1414
"test": "NODE_PATH=\"${PWD}/node_modules\":$NODE_PATH mocha",

waffle-hardhat/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
36
"references": [
47
{
58
"path": "../waffle-chai"

waffle-mock-contract/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@
2929
"bugs": {
3030
"url": "https://github.com/EthWorks/Waffle/issues"
3131
},
32-
"main": "dist/cjs/index.js",
33-
"module": "dist/esm/index.ts",
34-
"types": "dist/esm/index.d.ts",
32+
"main": "dist/cjs/src/index.js",
33+
"module": "dist/esm/src/index.ts",
34+
"types": "dist/esm/src/index.d.ts",
3535
"scripts": {
3636
"test": "export NODE_ENV=test && yarn test:build && mocha",
3737
"lint": "eslint '{src,test}/**/*.ts'",
3838
"lint:fix": "eslint --fix '{src,test}/**/*.ts'",
3939
"build": "rimraf ./dist && yarn build:sol && yarn build:esm && yarn build:cjs",
4040
"build:sol": "ts-node compile.ts",
4141
"build:esm": "tsc -p tsconfig.build.json --outDir dist/esm --module ES6",
42-
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs --declaration false",
42+
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs",
4343
"test:build": "ts-node ./test/helpers/buildTestContracts.ts",
4444
"clean": "rimraf ./dist ./test/example/build"
4545
},
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": [
4-
"src"
4+
"src",
5+
"src/**/*.json"
56
]
67
}

waffle-mock-contract/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
36
"references": [
47
{
58
"path": "../waffle-chai"

waffle-optimism/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
"access": "public",
1111
"tag": "alpha"
1212
},
13-
"main": "dist/cjs/index.js",
14-
"module": "dist/esm/index.ts",
15-
"types": "dist/esm/index.d.ts",
13+
"main": "dist/cjs/src/index.js",
14+
"module": "dist/esm/src/index.ts",
15+
"types": "dist/esm/src/index.d.ts",
1616
"scripts": {
1717
"test": "true",
1818
"test:optimism": "mocha",
1919
"lint": "eslint '{src,test}/**/*.ts'",
2020
"lint:fix": "eslint --fix '{src,test}/**/*.ts'",
2121
"build": "rimraf ./dist && yarn build:esm && yarn build:cjs",
2222
"build:esm": "tsc -p tsconfig.build.json --outDir dist/esm --module ES6",
23-
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs --declaration false"
23+
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs"
2424
},
2525
"engines": {
2626
"node": ">=10.0"

waffle-optimism/tsconfig.build.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": [
4-
"src",
5-
],
4+
"src"
5+
]
66
}

waffle-optimism/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
36
"references": [
47
{
58
"path": "../waffle-chai"

waffle-provider/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
"bugs": {
2828
"url": "https://github.com/EthWorks/Waffle/issues"
2929
},
30-
"main": "dist/cjs/index.js",
31-
"module": "dist/esm/index.ts",
32-
"types": "dist/esm/index.d.ts",
30+
"main": "dist/cjs/src/index.js",
31+
"module": "dist/esm/src/index.ts",
32+
"types": "dist/esm/src/index.d.ts",
3333
"scripts": {
3434
"test": "mocha",
3535
"lint": "eslint '{src,test}/**/*.ts'",
3636
"lint:fix": "eslint --fix '{src,test}/**/*.ts'",
3737
"build": "rimraf ./dist && yarn build:esm && yarn build:cjs",
3838
"build:esm": "tsc -p tsconfig.build.json --outDir dist/esm --module ES6",
39-
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs --declaration false"
39+
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs"
4040
},
4141
"engines": {
4242
"node": ">=10.0"

waffle-provider/tsconfig.build.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": [
4-
"src",
5-
],
4+
"src"
5+
]
66
}

waffle-provider/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
36
"references": [
47
{
58
"path": "../waffle-ens"

0 commit comments

Comments
 (0)