Skip to content

Commit 16aea66

Browse files
authored
feat: use a common tsconfig for the monorepo (#1297)
* feat: add common root tsconfig for es and cjs builds * feat: apply common root tsconfig to a single package * feat: propagate common tsconfig to interesting packages * feat: propogate common tsconfig to all packages * Update tsconfig.json
1 parent d7fa8a7 commit 16aea66

File tree

384 files changed

+3694
-2405
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+3694
-2405
lines changed

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ lerna-debug.log
2525
package-lock.json
2626

2727
!serviceModels/logs
28-
build
28+
dist
2929

3030
.idea/
3131
*.iml

Diff for: jest.config.base.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
module.exports = {
22
// remove testMatch once we move to ts-jest
3-
testMatch: ["**/__tests__/**/*.js?(x)", "**/?(*.)+(spec|test).js?(x)"]
3+
testMatch: [
4+
"**/__tests__/**/*.js?(x)",
5+
"**/dist/cjs/?(*.)+(spec|test).js?(x)"
6+
]
47
};

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"generate-clients": "node ./scripts/generate-clients",
99
"bootstrap": "yarn",
1010
"clean": "yarn clear-build-cache && yarn clear-build-info && lerna clean",
11-
"clear-build-cache": "rimraf ./packages/*/build/* ./clients/*/*/build/*",
11+
"clear-build-cache": "rimraf ./packages/*/build ./packages/*/build-es ./clients/*/dist",
1212
"clear-build-info": "rimraf ./packages/*/*.tsbuildinfo ./clients/*/*/*.tsbuildinfo",
1313
"build:crypto-dependencies": "lerna run --scope '@aws-sdk/types' --scope '@aws-sdk/util-utf8-browser' --scope '@aws-sdk/util-locate-window' --scope '@aws-sdk/hash-node' --include-dependencies pretest",
1414
"build:protocols": "yarn build:crypto-dependencies && lerna run --scope '@aws-sdk/aws-*' --include-dependencies pretest",

Diff for: packages/abort-controller/package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
"name": "@aws-sdk/abort-controller",
33
"version": "1.0.0-gamma.1",
44
"description": "A simple abort controller library",
5-
"main": "./build/index.js",
6-
"types": "./build/index.d.ts",
5+
"main": "./dist/cjs/index.js",
6+
"module": "./dist/es/index.js",
7+
"types": "./dist/cjs/index.d.ts",
78
"scripts": {
8-
"prepublishOnly": "tsc",
9-
"pretest": "tsc -p tsconfig.test.json",
9+
"prepublishOnly": "yarn build:cjs && yarn build:es",
10+
"pretest": "yarn build:cjs",
11+
"build:cjs": "tsc -p tsconfig.cjs.json",
12+
"build:es": "tsc -p tsconfig.es.json",
1013
"test": "jest"
1114
},
1215
"author": {

Diff for: packages/abort-controller/tsconfig.cjs.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"lib": ["es5", "es2015.collection"],
4+
"strict": true,
5+
"sourceMap": false,
6+
"declaration": true,
7+
"stripInternal": true,
8+
"rootDir": "./src",
9+
"outDir": "./dist/cjs",
10+
"importHelpers": true,
11+
"noEmitHelpers": true,
12+
"inlineSourceMap": true,
13+
"inlineSources": true,
14+
"baseUrl": "."
15+
},
16+
"extends": "../../tsconfig.cjs.json",
17+
"include": ["src/"]
18+
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
22
"compilerOptions": {
3-
"module": "commonjs",
4-
"target": "es5",
53
"lib": ["es5", "es2015.collection"],
64
"strict": true,
7-
"sourceMap": true,
5+
"sourceMap": false,
86
"declaration": true,
97
"stripInternal": true,
108
"rootDir": "./src",
11-
"outDir": "./build",
9+
"outDir": "./dist/es",
1210
"importHelpers": true,
1311
"noEmitHelpers": true,
14-
"incremental": true
15-
}
12+
"inlineSourceMap": true,
13+
"inlineSources": true,
14+
"baseUrl": "."
15+
},
16+
"extends": "../../tsconfig.es.json",
17+
"include": ["src/"]
1618
}

Diff for: packages/abort-controller/tsconfig.test.json

-11
This file was deleted.

Diff for: packages/body-checksum-browser/package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
"name": "@aws-sdk/body-checksum-browser",
33
"version": "1.0.0-gamma.1",
44
"scripts": {
5-
"prepublishOnly": "tsc",
6-
"pretest": "tsc -p tsconfig.test.json",
5+
"prepublishOnly": "yarn build:cjs && yarn build:es",
6+
"pretest": "yarn build:cjs",
7+
"build:cjs": "tsc -p tsconfig.cjs.json",
8+
"build:es": "tsc -p tsconfig.es.json",
79
"test": "jest"
810
},
9-
"main": "./build/index.js",
10-
"types": "./build/index.d.ts",
11+
"main": "./dist/cjs/index.js",
12+
"module": "./dist/es/index.js",
13+
"types": "./dist/cjs/index.d.ts",
1114
"author": {
1215
"name": "AWS SDK for JavaScript Team",
1316
"url": "https://aws.amazon.com/javascript/"

Diff for: packages/body-checksum-browser/tsconfig.cjs.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"compilerOptions": {
3+
"declaration": true,
4+
"strict": true,
5+
"sourceMap": false,
6+
"downlevelIteration": true,
7+
"importHelpers": true,
8+
"noEmitHelpers": true,
9+
"lib": [
10+
"dom",
11+
"es5",
12+
"es2015.promise",
13+
"es2015.collection",
14+
"es2015.iterable",
15+
"es2015.symbol.wellknown"
16+
],
17+
"rootDir": "./src",
18+
"outDir": "./dist/cjs",
19+
"inlineSourceMap": true,
20+
"inlineSources": true,
21+
"baseUrl": "."
22+
},
23+
"extends": "../../tsconfig.cjs.json",
24+
"include": ["src/"]
25+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
4-
"module": "commonjs",
53
"declaration": true,
64
"strict": true,
7-
"sourceMap": true,
5+
"sourceMap": false,
86
"downlevelIteration": true,
97
"importHelpers": true,
108
"noEmitHelpers": true,
@@ -17,7 +15,11 @@
1715
"es2015.symbol.wellknown"
1816
],
1917
"rootDir": "./src",
20-
"outDir": "./build",
21-
"incremental": true
22-
}
18+
"outDir": "./dist/es",
19+
"inlineSourceMap": true,
20+
"inlineSources": true,
21+
"baseUrl": "."
22+
},
23+
"extends": "../../tsconfig.es.json",
24+
"include": ["src/"]
2325
}

Diff for: packages/body-checksum-browser/tsconfig.test.json

-11
This file was deleted.

Diff for: packages/body-checksum-node/package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
"name": "@aws-sdk/body-checksum-node",
33
"version": "1.0.0-gamma.1",
44
"scripts": {
5-
"prepublishOnly": "tsc",
6-
"pretest": "tsc -p tsconfig.test.json",
5+
"prepublishOnly": "yarn build:cjs && yarn build:es",
6+
"pretest": "yarn build:cjs",
7+
"build:cjs": "tsc -p tsconfig.cjs.json",
8+
"build:es": "tsc -p tsconfig.es.json",
79
"test": "jest"
810
},
9-
"main": "./build/index.js",
10-
"types": "./build/index.d.ts",
11+
"main": "./dist/cjs/index.js",
12+
"module": "./dist/es/index.js",
13+
"types": "./dist/cjs/index.d.ts",
1114
"author": {
1215
"name": "AWS SDK for JavaScript Team",
1316
"url": "https://aws.amazon.com/javascript/"

Diff for: packages/body-checksum-node/tsconfig.cjs.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"compilerOptions": {
3+
"declaration": true,
4+
"strict": true,
5+
"sourceMap": false,
6+
"downlevelIteration": true,
7+
"importHelpers": true,
8+
"noEmitHelpers": true,
9+
"lib": [
10+
"es5",
11+
"es2015.promise",
12+
"es2015.collection",
13+
"es2015.iterable",
14+
"es2015.symbol.wellknown"
15+
],
16+
"rootDir": "./src",
17+
"outDir": "./dist/cjs",
18+
"inlineSourceMap": true,
19+
"inlineSources": true,
20+
"baseUrl": "."
21+
},
22+
"extends": "../../tsconfig.cjs.json",
23+
"include": ["src/"]
24+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
4-
"module": "commonjs",
53
"declaration": true,
64
"strict": true,
7-
"sourceMap": true,
5+
"sourceMap": false,
86
"downlevelIteration": true,
97
"importHelpers": true,
108
"noEmitHelpers": true,
@@ -16,7 +14,11 @@
1614
"es2015.symbol.wellknown"
1715
],
1816
"rootDir": "./src",
19-
"outDir": "./build",
20-
"incremental": true
21-
}
17+
"outDir": "./dist/es",
18+
"inlineSourceMap": true,
19+
"inlineSources": true,
20+
"baseUrl": "."
21+
},
22+
"extends": "../../tsconfig.es.json",
23+
"include": ["src/"]
2224
}

Diff for: packages/body-checksum-node/tsconfig.test.json

-11
This file was deleted.

Diff for: packages/chunked-blob-reader-native/package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
"name": "@aws-sdk/chunked-blob-reader-native",
33
"version": "1.0.0-gamma.1",
44
"scripts": {
5-
"prepublishOnly": "tsc",
6-
"pretest": "tsc -p tsconfig.test.json",
5+
"prepublishOnly": "yarn build:cjs && yarn build:es",
6+
"pretest": "yarn build:cjs",
7+
"build:cjs": "tsc -p tsconfig.cjs.json",
8+
"build:es": "tsc -p tsconfig.es.json",
79
"test": "jest"
810
},
9-
"main": "./build/index.js",
10-
"types": "./build/index.d.ts",
11+
"main": "./dist/cjs/index.js",
12+
"module": "./dist/es/index.js",
13+
"types": "./dist/cjs/index.d.ts",
1114
"author": {
1215
"name": "AWS SDK for JavaScript Team",
1316
"url": "https://aws.amazon.com/javascript/"
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"compilerOptions": {
3+
"declaration": true,
4+
"strict": true,
5+
"sourceMap": false,
6+
"downlevelIteration": true,
7+
"importHelpers": true,
8+
"noEmitHelpers": true,
9+
"lib": [
10+
"dom",
11+
"es5",
12+
"es2015.promise",
13+
"es2015.collection",
14+
"es2015.iterable",
15+
"es2015.symbol.wellknown"
16+
],
17+
"rootDir": "./src",
18+
"outDir": "./dist/cjs",
19+
"inlineSourceMap": true,
20+
"inlineSources": true,
21+
"baseUrl": "."
22+
},
23+
"extends": "../../tsconfig.cjs.json",
24+
"include": ["src/"]
25+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
4-
"module": "commonjs",
53
"declaration": true,
64
"strict": true,
7-
"sourceMap": true,
5+
"sourceMap": false,
86
"downlevelIteration": true,
97
"importHelpers": true,
108
"noEmitHelpers": true,
@@ -17,7 +15,11 @@
1715
"es2015.symbol.wellknown"
1816
],
1917
"rootDir": "./src",
20-
"outDir": "./build",
21-
"incremental": true
22-
}
18+
"outDir": "./dist/es",
19+
"inlineSourceMap": true,
20+
"inlineSources": true,
21+
"baseUrl": "."
22+
},
23+
"extends": "../../tsconfig.es.json",
24+
"include": ["src/"]
2325
}

Diff for: packages/chunked-blob-reader-native/tsconfig.test.json

-11
This file was deleted.

Diff for: packages/chunked-blob-reader/package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
"name": "@aws-sdk/chunked-blob-reader",
33
"version": "1.0.0-gamma.1",
44
"scripts": {
5-
"prepublishOnly": "tsc",
6-
"pretest": "tsc -p tsconfig.test.json",
5+
"prepublishOnly": "yarn build:cjs && yarn build:es",
6+
"pretest": "yarn build:cjs",
7+
"build:cjs": "tsc -p tsconfig.cjs.json",
8+
"build:es": "tsc -p tsconfig.es.json",
79
"test": "jest"
810
},
9-
"main": "./build/index.js",
10-
"types": "./build/index.d.ts",
11+
"main": "./dist/cjs/index.js",
12+
"module": "./dist/es/index.js",
13+
"types": "./dist/cjs/index.d.ts",
1114
"author": {
1215
"name": "AWS SDK for JavaScript Team",
1316
"url": "https://aws.amazon.com/javascript/"

0 commit comments

Comments
 (0)