Skip to content

Commit fa0423d

Browse files
committed
chore(repo): refactor tsconfig hierarchy
- move the base tsconfig into the root of the workspace - unifying tsconfig tsconfig.build tsconfig.test and tsconfig.watch settings
1 parent e20782e commit fa0423d

Some content is hidden

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

80 files changed

+288
-232
lines changed

packages/adapter-nextjs/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161
"scripts": {
6262
"build": "npm run clean && npm run build:esm-cjs",
6363
"build-with-test": "npm test && npm run build",
64-
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
6564
"build:esm-cjs": "rollup -c rollup.config.mjs",
66-
"build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
65+
"build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch",
66+
"build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch",
6767
"clean": "npm run clean:size && rimraf dist",
6868
"clean:size": "rimraf dual-publish-tmp tmp*",
6969
"format": "echo \"Not implemented\"",

packages/adapter-nextjs/rollup.config.mjs

+2-12
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,13 @@ const config = defineConfig([
1818
{
1919
input: input,
2020
output: cjsOutput,
21-
plugins: [
22-
typescript({
23-
...cjsTSOptions,
24-
tsconfig: 'tsconfig.build.json',
25-
}),
26-
],
21+
plugins: [typescript(cjsTSOptions)],
2722
},
2823
// ESM config
2924
{
3025
input: input,
3126
output: esmOutput,
32-
plugins: [
33-
typescript({
34-
...esmTSOptions,
35-
tsconfig: 'tsconfig.build.json',
36-
}),
37-
],
27+
plugins: [typescript(esmTSOptions)],
3828
},
3929
]);
4030

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"extends": "../tsconfig.base.json",
3-
"compilerOptions": {
4-
"strict": true,
5-
"noImplicitAny": true
6-
},
7-
"include": ["./src"]
2+
"extends": "./tsconfig.json",
3+
"exclude": ["__tests__", "coverage", "coverage-ts", "dist"]
84
}

packages/adapter-nextjs/tsconfig.json

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
1-
//WARNING: If you are manually specifying files to compile then the tsconfig.json is completely ignored, you must use command line flags
21
{
2+
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"allowSyntheticDefaultImports": true,
5-
"target": "es2020",
6-
"noImplicitAny": true,
7-
"lib": ["dom", "es2019", "esnext.asynciterable"],
8-
"module": "commonjs",
9-
"moduleResolution": "node",
10-
"allowJs": true,
11-
"declaration": true,
12-
"typeRoots": ["./node_modules/@types", "../../node_modules/@types"],
13-
"types": ["node"],
14-
"esModuleInterop": true,
15-
"resolveJsonModule": true,
16-
"strict": true,
175
"alwaysStrict": true
186
},
19-
"include": ["src/**/*"],
20-
"exclude": ["src/setupTests.ts"]
7+
"include": ["./src", "__tests__"]
218
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./tsconfig.json"
3+
}

packages/analytics/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
"build-with-test": "npm run clean && npm run test && npm run build",
1717
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
1818
"build:esm-cjs": "rollup -c rollup.config.mjs",
19-
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
20-
"build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
19+
"build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch",
20+
"build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch",
2121
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
2222
"clean": "npm run clean:size && rimraf dist lib lib-esm",
2323
"clean:size": "rimraf dual-publish-tmp tmp*",
2424
"format": "echo \"Not implemented\"",
2525
"lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
26-
"ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 71.4"
26+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 71.4"
2727
},
2828
"typesVersions": {
2929
">=4.2": {
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["__tests__", "coverage", "coverage-ts", "dist"]
4+
}

packages/analytics/tsconfig.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
{
2-
"extends": "../tsconfig.base.json",
3-
"compilerOptions": {
4-
"importHelpers": true,
5-
"strict": true,
6-
"noImplicitAny": true
7-
},
8-
"include": ["./src", "../core/src/utils/haveCredentialsChanged.ts"]
2+
"extends": "../../tsconfig.json",
3+
"include": ["./src", "__tests__"]
94
}

packages/analytics/tsconfig.test.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./tsconfig.json"
3+
}

packages/api-graphql/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
"build-with-test": "npm test && npm build",
2020
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
2121
"build:esm-cjs": "rollup -c rollup.config.mjs",
22-
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
23-
"build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
22+
"build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch",
23+
"build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch",
2424
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
2525
"clean": "npm run clean:size && rimraf dist lib lib-esm",
2626
"clean:size": "rimraf dual-publish-tmp tmp*",
2727
"format": "echo \"Not implemented\"",
2828
"lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
29-
"ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 70.0"
29+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 70.0"
3030
},
3131
"exports": {
3232
".": {
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["__tests__", "coverage", "coverage-ts", "dist"]
4+
}

packages/api-graphql/tsconfig.json

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
2-
"extends": "../tsconfig.base.json",
2+
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"importHelpers": true,
5-
"strict": true,
6-
"noImplicitAny": true,
7-
"strictNullChecks": true,
8-
"skipLibCheck": true
4+
"strictNullChecks": true
95
},
10-
"include": ["./src"]
6+
"include": ["./src", "__tests__"]
117
}
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
// TODO(test): enable noImplicitAny for tests
5+
"noImplicitAny": false
6+
}
7+
}

packages/api-rest/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
"build-with-test": "npm test && npm build",
1717
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
1818
"build:esm-cjs": "rollup -c rollup.config.mjs",
19-
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
20-
"build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
19+
"build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch",
20+
"build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch",
2121
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
2222
"clean": "npm run clean:size && rimraf dist lib lib-esm",
2323
"clean:size": "rimraf dual-publish-tmp tmp*",
2424
"format": "echo \"Not implemented\"",
2525
"lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
26-
"ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 70.0"
26+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 70.0"
2727
},
2828
"exports": {
2929
".": {

packages/api-rest/tsconfig.build.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["__tests__", "coverage", "coverage-ts", "dist"]
4+
}

packages/api-rest/tsconfig.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
{
2-
"extends": "../tsconfig.base.json",
3-
"compilerOptions": {
4-
"importHelpers": true,
5-
"strict": true,
6-
"noImplicitAny": true
7-
},
8-
"include": ["./src"]
2+
"extends": "../../tsconfig.json",
3+
"include": ["./src", "__tests__"]
94
}

packages/api-rest/tsconfig.test.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./tsconfig.json"
3+
}

packages/api/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
"build-with-test": "npm test && npm run build",
1919
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
2020
"build:esm-cjs": "rollup -c rollup.config.mjs",
21-
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
22-
"build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
21+
"build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch",
22+
"build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch",
2323
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
2424
"clean": "npm run clean:size && rimraf dist lib lib-esm",
2525
"clean:size": "rimraf dual-publish-tmp tmp*",
2626
"format": "echo \"Not implemented\"",
2727
"lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
28-
"ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 88"
28+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 88"
2929
},
3030
"exports": {
3131
".": {

packages/api/tsconfig.build.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["__tests__", "__mocks__", "coverage", "coverage-ts", "dist"]
4+
}

packages/api/tsconfig.json

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
2-
"extends": "../tsconfig.base.json",
2+
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"importHelpers": true,
5-
"strict": true,
6-
"noImplicitAny": true,
7-
"strictNullChecks": true,
8-
"skipLibCheck": true
4+
"strictNullChecks": true
95
},
10-
"include": ["./src"]
6+
"include": ["./src", "__tests__", "__mocks__"]
117
}

packages/api/tsconfig.test.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./tsconfig.json"
3+
}

packages/auth/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
"build-with-test": "npm test && npm run build",
2121
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
2222
"build:esm-cjs": "rollup -c rollup.config.mjs",
23-
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
24-
"build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
23+
"build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch",
24+
"build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch",
2525
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
2626
"clean": "npm run clean:size && rimraf lib-esm lib dist",
2727
"clean:size": "rimraf dual-publish-tmp tmp*",
2828
"format": "echo \"Not implemented\"",
2929
"lint": "tslint '{src}/**/*.ts' && npm run ts-coverage",
30-
"ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 91.18"
30+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 91.18"
3131
},
3232
"typesVersions": {
3333
">=4.2": {

packages/auth/tsconfig.build.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["__tests__", "coverage", "coverage-ts", "dist"]
4+
}

packages/auth/tsconfig.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
{
2-
"extends": "../tsconfig.base.json",
3-
"compilerOptions": {
4-
"importHelpers": true,
5-
"types": ["jest", "node"],
6-
"strict": true,
7-
"noImplicitAny": true
8-
},
9-
"include": ["src"]
2+
"extends": "../../tsconfig.json",
3+
"include": ["./src", "__tests__"]
104
}

packages/auth/tsconfig.test.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
// TODO(test): enable noImplicitAny for tests
5+
"noImplicitAny": false
6+
}
7+
}

packages/aws-amplify/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,15 @@
240240
"build-with-test": "npm run clean && npm test && tsc && webpack -p",
241241
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
242242
"build:esm-cjs": "rollup -c rollup.config.mjs",
243-
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
244-
"build:esm:watch": "rimraf dist/esm && tsc -m es6 --outDir dist/esm --watch",
243+
"build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch",
244+
"build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m es6 --outDir dist/esm --watch",
245245
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
246246
"clean": "rimraf lib-esm lib dist",
247247
"format": "echo \"Not implemented\"",
248248
"lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
249249
"generate-docs-local": "typedoc --out docs src",
250250
"generate-docs-root": "typedoc --out ../../docs src",
251-
"ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 93.26"
251+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 93.26"
252252
},
253253
"repository": {
254254
"type": "git",
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["__tests__", "coverage", "coverage-ts", "dist"]
4+
}

packages/aws-amplify/tsconfig.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"extends": "../tsconfig.base.json",
3-
"compilerOptions": {
4-
"strict": true,
5-
"noImplicitAny": true
6-
},
7-
"include": ["./src"]
2+
"extends": "../../tsconfig.json",
3+
"include": ["./src", "__tests__"]
84
}
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./tsconfig.json"
3+
}

packages/core/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
"build-with-test": "npm test && npm run build",
2222
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
2323
"build:esm-cjs": "rollup -c rollup.config.mjs",
24-
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
25-
"build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
24+
"build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch",
25+
"build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch",
2626
"build": "npm run clean && npm run generate-version && npm run build:esm-cjs && npm run build:umd",
2727
"generate-version": "genversion src/Platform/version.ts --es6 --semi --source ../aws-amplify",
2828
"clean": "npm run clean:size && rimraf dist lib lib-esm",
2929
"clean:size": "rimraf dual-publish-tmp tmp*",
3030
"format": "echo \"Not implemented\"",
3131
"lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
3232
"prepublishOnly": "npm run build",
33-
"ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 92.36"
33+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 92.36"
3434
},
3535
"repository": {
3636
"type": "git",

packages/core/tsconfig.build.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["__tests__", "coverage", "coverage-ts", "dist"]
4+
}

packages/core/tsconfig.json

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
{
2-
"extends": "../tsconfig.base.json",
3-
"compilerOptions": {
4-
"importHelpers": false,
5-
"strict": true,
6-
"noImplicitAny": true
7-
},
8-
"include": ["./src"],
9-
"watchOptions": {
10-
"excludeDirectories": ["lib*"]
11-
}
2+
"extends": "../../tsconfig.json",
3+
"include": ["./src", "__tests__"]
124
}

packages/core/tsconfig.test.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
// TODO(test): enable noImplicitAny for tests
5+
"noImplicitAny": false,
6+
"types": ["node", "jest", "jsdom"]
7+
}
8+
}

packages/datastore-storage-adapter/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"build-with-test": "npm test && npm run build",
1515
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
1616
"build:esm-cjs": "rollup -c rollup.config.mjs",
17-
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
18-
"build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
17+
"build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch",
18+
"build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch",
1919
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
2020
"clean": "rimraf dist lib lib-esm",
2121
"format": "echo \"Not implemented\"",
2222
"lint": "tslint '{__tests__,src}/**/*.ts' && npm run ts-coverage",
23-
"ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 94.16"
23+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 94.16"
2424
},
2525
"repository": {
2626
"type": "git",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["__tests__", "ExpoSQLiteAdapter", "SQLiteAdapter"]
4+
}

0 commit comments

Comments
 (0)