Skip to content

Commit 58a3b25

Browse files
committed
Restore top level main, types
Trying the approach of "type:module, cjs main". There are scenarios with TS 5.1 where this will result in incorrect types being loaded, if `module` and `moduleResolution` do not match. However, this is a smaller hazard than not being able to use the module at all. And the only node versions which would potentially be confused by the "type:module" and a cjs main are long out of support (as in, they can't even load the code, because they also didn't support private class members), so that's not a relevant consideration. If this does work and resolve the issue without any negative consequences arising for a while, I'll make it the default for tshy, so that it does not require an additional opt-in configuration. Fix: #557
1 parent e57c2e1 commit 58a3b25

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

package.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
"name": "glob",
44
"description": "the most correct and second fastest glob implementation in JavaScript",
55
"version": "10.3.9",
6-
"bin": "./dist/esm/bin.mjs",
7-
"repository": {
8-
"type": "git",
9-
"url": "git://github.com/isaacs/node-glob.git"
6+
"type": "module",
7+
"tshy": {
8+
"main": true,
9+
"exports": {
10+
"./package.json": "./package.json",
11+
".": "./src/index.ts"
12+
}
1013
},
14+
"bin": "./dist/esm/bin.mjs",
15+
"main": "./dist/commonjs/index.js",
16+
"types": "./dist/commonjs/index.d.ts",
1117
"exports": {
1218
"./package.json": "./package.json",
1319
".": {
@@ -21,6 +27,10 @@
2127
}
2228
}
2329
},
30+
"repository": {
31+
"type": "git",
32+
"url": "git://github.com/isaacs/node-glob.git"
33+
},
2434
"files": [
2535
"dist"
2636
],
@@ -83,12 +93,5 @@
8393
},
8494
"engines": {
8595
"node": ">=16 || 14 >=14.17"
86-
},
87-
"type": "module",
88-
"tshy": {
89-
"exports": {
90-
"./package.json": "./package.json",
91-
".": "./src/index.ts"
92-
}
9396
}
9497
}

0 commit comments

Comments
 (0)