Skip to content

Commit 9a370b0

Browse files
authored
Make all packages work with esModuleInterop (default true in TS 6.0) (DefinitelyTyped#73954)
1 parent f8f40b1 commit 9a370b0

File tree

1,839 files changed

+2370
-2316
lines changed

Some content is hidden

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

1,839 files changed

+2370
-2316
lines changed

scripts/try-node16.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1+
import { AllPackages, getDefinitelyTyped } from "@definitelytyped/definitions-parser";
2+
import { loggerWithErrors } from "@definitelytyped/utils";
13
import cp from "child_process";
24
import fs from "fs";
35
import path from "path";
46
import url from "url";
57

6-
const tsconfigs = process.argv.slice(2);
78
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
9+
const repoRoot = path.join(__dirname, "..");
810

9-
for (const tsconfigPath of tsconfigs) {
11+
const dtFS = await getDefinitelyTyped({
12+
definitelyTypedPath: repoRoot,
13+
progress: false,
14+
}, loggerWithErrors()[0]);
15+
16+
const allPackages = AllPackages.fromFS(dtFS);
17+
18+
for (const pkg of await allPackages.allTypings()) {
19+
console.log(`Trying ${pkg.subDirectoryPath}...`);
20+
const tsconfigPath = path.join(repoRoot, "types", pkg.subDirectoryPath, "tsconfig.json");
1021
const tsconfigString = fs.readFileSync(tsconfigPath, "utf-8");
1122
const tsconfig = JSON.parse(tsconfigString);
1223
if (tsconfig.compilerOptions.module === "node16") {
@@ -20,7 +31,7 @@ for (const tsconfigPath of tsconfigs) {
2031

2132
try {
2233
cp.execFileSync(
23-
path.join(__dirname, "node_modules/.bin/tsc"),
34+
path.join(repoRoot, "node_modules/.bin/tsc"),
2435
["-p", tsconfigPath, "--noEmit"],
2536
{ stdio: "ignore" },
2637
);

types/accounting/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"strictFunctionTypes": true,
1111
"types": [],
1212
"noEmit": true,
13-
"forceConsistentCasingInFileNames": true
13+
"forceConsistentCasingInFileNames": true,
14+
"esModuleInterop": true
1415
},
1516
"files": [
1617
"index.d.ts",

types/ace/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"strictFunctionTypes": true,
1212
"types": [],
1313
"noEmit": true,
14-
"forceConsistentCasingInFileNames": true
14+
"forceConsistentCasingInFileNames": true,
15+
"esModuleInterop": true
1516
},
1617
"files": [
1718
"index.d.ts",

types/activex-adodb/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"strictFunctionTypes": true,
1111
"types": [],
1212
"noEmit": true,
13-
"forceConsistentCasingInFileNames": true
13+
"forceConsistentCasingInFileNames": true,
14+
"esModuleInterop": true
1415
},
1516
"files": [
1617
"index.d.ts",

types/activex-adox/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"strictFunctionTypes": true,
1111
"types": [],
1212
"noEmit": true,
13-
"forceConsistentCasingInFileNames": true
13+
"forceConsistentCasingInFileNames": true,
14+
"esModuleInterop": true
1415
},
1516
"files": [
1617
"index.d.ts",

types/activex-excel/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"strictFunctionTypes": true,
1111
"types": [],
1212
"noEmit": true,
13-
"forceConsistentCasingInFileNames": true
13+
"forceConsistentCasingInFileNames": true,
14+
"esModuleInterop": true
1415
},
1516
"files": [
1617
"index.d.ts",

types/activex-office/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"strictFunctionTypes": true,
1111
"types": [],
1212
"noEmit": true,
13-
"forceConsistentCasingInFileNames": true
13+
"forceConsistentCasingInFileNames": true,
14+
"esModuleInterop": true
1415
},
1516
"files": [
1617
"index.d.ts",

types/activex-shell/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"strictFunctionTypes": true,
1111
"types": [],
1212
"noEmit": true,
13-
"forceConsistentCasingInFileNames": true
13+
"forceConsistentCasingInFileNames": true,
14+
"esModuleInterop": true
1415
},
1516
"files": [
1617
"index.d.ts",

types/activex-vbide/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"strictFunctionTypes": true,
1111
"types": [],
1212
"noEmit": true,
13-
"forceConsistentCasingInFileNames": true
13+
"forceConsistentCasingInFileNames": true,
14+
"esModuleInterop": true
1415
},
1516
"files": [
1617
"index.d.ts",

types/activex-wia/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"strictFunctionTypes": true,
1111
"types": [],
1212
"noEmit": true,
13-
"forceConsistentCasingInFileNames": true
13+
"forceConsistentCasingInFileNames": true,
14+
"esModuleInterop": true
1415
},
1516
"files": [
1617
"index.d.ts",

0 commit comments

Comments
 (0)