-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(client): Use new node16 tsconfigs in azure, client, and DDS pro…
…jects (#18152) This PR is the first in several that will update the CommonJS builds within the repo to use `module: node16`, which implies `moduleResolution: node16`. There are new configs in the build-common package, and these configs are used as follows: ```json "extends": [ "../../../../../common/build/build-common/tsconfig.base.json", "../../../../../common/build/build-common/tsconfig.cjs.json", ], ``` These configs are designed to be used together using [TypeScript's support for extending multiple config files](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#supporting-multiple-configuration-files-in-extends). - tsconfig.base.json - This base config contains defaults that all packages within the repo should use as a baseline. - tsconfig.cjs.json - This config sets `module: Node16` and is intended for CommonJS builds. This config is intended to be layered on top of the base config. - tsconfig.esm.json - This config sets `module: ESNext` and `moduleResolution: Node10` and is intended for ESM builds. This config is intended to be layered on top of the base config. This config uses Node10 module resolution because Node16 cannot be used to build both CJS and ESM from a common source. - tsconfig.test.json - This config disables some settings that we don't want to use in test code, like `declaration` and `decarationMap`. It also enables the `node` types by default. This PR updates the packages in the packages/common and packages/dds paths. For each package, the CJS, ESM, and test tsconfig files are updated to use the new build-common configs, which means that CJS builds now use module: node16 which implies moduleResolution: node16. ESNext builds continue to use Node10 module resolution because Node16 cannot be used to build both CJS and ESM from a common source.
- Loading branch information
1 parent
52652b8
commit de14e47
Showing
70 changed files
with
373 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../dist/test", | ||
"composite": true, | ||
"types": ["mocha", "node"], | ||
"skipLibCheck": true, | ||
}, | ||
"extends": [ | ||
"../../../../../common/build/build-common/tsconfig.base.json", | ||
"../../../../../common/build/build-common/tsconfig.test.json", | ||
], | ||
"include": ["./**/*"], | ||
"references": [ | ||
{ | ||
"path": "../..", | ||
}, | ||
], | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../dist/test", | ||
"types": ["mocha", "node"], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"extends": ["./tsconfig.json", "../../../common/build/build-common/tsconfig.esm.json"], | ||
"compilerOptions": { | ||
"outDir": "./lib", | ||
"module": "esnext", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"extends": [ | ||
"../../../common/build/build-common/tsconfig.base.json", | ||
"../../../common/build/build-common/tsconfig.cjs.json", | ||
], | ||
"include": ["src/**/*"], | ||
"exclude": ["src/test/**/*"], | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist", | ||
"composite": true, | ||
"types": ["node"], | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["src/test/**/*"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"exclude": [], | ||
"extends": [ | ||
"../../../common/build/build-common/tsconfig.base.json", | ||
"../../../common/build/build-common/tsconfig.cjs.json", | ||
], | ||
"include": ["src/**/*"], | ||
"exclude": ["src/test/**/*"], | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist", | ||
"composite": true, | ||
}, | ||
"include": ["src/**/*"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../dist/test", | ||
"declaration": false, | ||
"declarationMap": false, | ||
"skipLibCheck": true, | ||
"noEmit": true, | ||
}, | ||
"extends": [ | ||
"../../../../../common/build/build-common/tsconfig.base.json", | ||
"../../../../../common/build/build-common/tsconfig.test.json", | ||
], | ||
"include": ["./**/*"], | ||
"references": [ | ||
{ | ||
"path": "../..", | ||
}, | ||
], | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../dist/test", | ||
"noEmit": true, | ||
"types": [], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"extends": ["./tsconfig.json", "../../../common/build/build-common/tsconfig.esm.json"], | ||
"compilerOptions": { | ||
"outDir": "./lib", | ||
"module": "esnext", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"extends": [ | ||
"../../../common/build/build-common/tsconfig.base.json", | ||
"../../../common/build/build-common/tsconfig.cjs.json", | ||
], | ||
"include": ["src/**/*"], | ||
"exclude": ["src/test/**/*"], | ||
"compilerOptions": { | ||
"strictNullChecks": true, | ||
"rootDir": "./src", | ||
"outDir": "./dist", | ||
"composite": true, | ||
}, | ||
"include": ["src/**/*"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
{ | ||
"extends": ["./tsconfig.base.json"], | ||
"compilerOptions": { | ||
"module": "Node16", | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
{ | ||
"extends": ["./tsconfig.base.json"], | ||
"compilerOptions": { | ||
"module": "ESNext", | ||
"moduleResolution": "Node10", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"extends": ["./tsconfig.esm.json"], | ||
"extends": ["./tsconfig.base.json", "./tsconfig.esm.json"], | ||
"compilerOptions": { | ||
"composite": false, | ||
"types": ["node"], | ||
"declaration": false, | ||
"declarationMap": false, | ||
"skipLibCheck": true, | ||
"module": "CommonJS", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../../dist/test/jest", | ||
"types": ["jest", "jest-environment-puppeteer", "node", "puppeteer"], | ||
}, | ||
"extends": [ | ||
"../../../../../../common/build/build-common/tsconfig.base.json", | ||
"../../../../../../common/build/build-common/tsconfig.test.json", | ||
], | ||
"include": ["./**/*"], | ||
"references": [ | ||
{ | ||
"path": "../../..", | ||
}, | ||
], | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../../dist/test/jest", | ||
"types": ["jest", "jest-environment-puppeteer", "node", "puppeteer"], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"exclude": ["dist", "node_modules"], | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../../dist/test/mocha", | ||
"types": ["node", "mocha"], | ||
}, | ||
"extends": [ | ||
"../../../../../../common/build/build-common/tsconfig.base.json", | ||
"../../../../../../common/build/build-common/tsconfig.test.json", | ||
], | ||
"include": ["./**/*"], | ||
"references": [ | ||
{ | ||
"path": "../../..", | ||
}, | ||
], | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../../dist/test/mocha", | ||
"types": ["mocha", "node"], | ||
}, | ||
} |
28 changes: 15 additions & 13 deletions
28
packages/common/client-utils/src/test/types/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"extends": [ | ||
"../../../../../../common/build/build-common/tsconfig.base.json", | ||
"../../../../../../common/build/build-common/tsconfig.test.json", | ||
], | ||
"include": ["./**/*"], | ||
"exclude": [ | ||
"dist", | ||
"node_modules" | ||
], | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../../dist/test/types", | ||
}, | ||
"include": [ | ||
"./**/*" | ||
], | ||
"references": [ | ||
{ | ||
"path": "../../.." | ||
} | ||
] | ||
"references": [ | ||
{ | ||
"path": "../../..", | ||
}, | ||
], | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../../dist/test/types", | ||
"types": [], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"extends": ["./tsconfig.json", "../../../common/build/build-common/tsconfig.esm.json"], | ||
"compilerOptions": { | ||
"outDir": "./lib", | ||
"module": "esnext", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"extends": [ | ||
"../../../common/build/build-common/tsconfig.base.json", | ||
"../../../common/build/build-common/tsconfig.cjs.json", | ||
], | ||
"include": ["src/**/*"], | ||
"exclude": ["src/test/**/*"], | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist", | ||
"composite": true, | ||
"baseUrl": ".", | ||
"paths": { | ||
"perf_hooks": ["types/perf_hooks.d.ts"], | ||
}, | ||
"types": ["events"], | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["src/test/**/*"], | ||
} |
33 changes: 16 additions & 17 deletions
33
packages/common/container-definitions/src/test/types/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../../dist/test/types", | ||
"declaration": false, | ||
"declarationMap": false, | ||
"skipLibCheck": true, | ||
"noEmit": true, | ||
}, | ||
"include": [ | ||
"./**/*" | ||
], | ||
"references": [ | ||
{ | ||
"path": "../../.." | ||
} | ||
] | ||
"extends": [ | ||
"../../../../../../common/build/build-common/tsconfig.base.json", | ||
"../../../../../../common/build/build-common/tsconfig.test.json", | ||
], | ||
"include": ["./**/*"], | ||
"references": [ | ||
{ | ||
"path": "../../..", | ||
}, | ||
], | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../../dist/test/types", | ||
"noEmit": true, | ||
"types": [], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"extends": ["./tsconfig.json", "../../../common/build/build-common/tsconfig.esm.json"], | ||
"compilerOptions": { | ||
"outDir": "./lib", | ||
"module": "esnext", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"extends": [ | ||
"../../../common/build/build-common/tsconfig.base.json", | ||
"../../../common/build/build-common/tsconfig.cjs.json", | ||
], | ||
"include": ["src/**/*"], | ||
"exclude": ["src/test/**/*"], | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist", | ||
"composite": true, | ||
}, | ||
"include": ["src/**/*"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
{ | ||
"extends": "@fluidframework/build-common/ts-common-config.json", | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../dist/test", | ||
"declaration": false, | ||
"declarationMap": false, | ||
"skipLibCheck": true, | ||
"noEmit": true, | ||
}, | ||
"extends": [ | ||
"../../../../../common/build/build-common/tsconfig.base.json", | ||
"../../../../../common/build/build-common/tsconfig.test.json", | ||
], | ||
"include": ["./**/*"], | ||
"references": [ | ||
{ | ||
"path": "../..", | ||
}, | ||
], | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"outDir": "../../dist/test", | ||
}, | ||
} |
Oops, something went wrong.