Skip to content

Commit 29d380a

Browse files
authored
Tweak tsconfig so it's friendly to commonjs alongside ESM (#47)
* Tweak tsconfig so it's friendly to commonjs alongside ESM * Change files * Switch to node16 to not become new node features unintentionally
1 parent 9b4a3b6 commit 29d380a

6 files changed

+72
-50
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "Tweak tsconfig so it's friendly to commonjs alongside ESM",
4+
"packageName": "@minecraft/core-build-tasks",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Tweak tsconfig so it's friendly to commonjs alongside ESM",
4+
"packageName": "@minecraft/math",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

libraries/math/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"exclude": ["dist", "build", "node_modules"],
55
"compilerOptions": {
66
"outDir": "lib",
7-
"declarationDir": "temp/types"
7+
"declarationDir": "temp/types",
8+
"module": "Node16",
9+
"moduleResolution": "node16"
810
}
911
}

tools/core-build-tasks/package.json

+52-46
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,55 @@
11
{
2-
"name": "@minecraft/core-build-tasks",
3-
"version": "1.1.7",
4-
"description": "Common build tasks used for minecraft-scripting-libraries",
5-
"main": "lib/index.js",
6-
"types": "lib/index.d.ts",
7-
"author": "Raphael Landaverde ([email protected])",
8-
"contributors": [
9-
{
10-
"name": "Francisco Alejandro Garcia Cebada",
11-
"email": "[email protected]"
2+
"name": "@minecraft/core-build-tasks",
3+
"version": "1.1.7",
4+
"description": "Common build tasks used for minecraft-scripting-libraries",
5+
"main": "lib/index.js",
6+
"exports": {
7+
".": {
8+
"import": "./lib/index.js",
9+
"require": "./lib/index.js"
10+
}
11+
},
12+
"types": "lib/index.d.ts",
13+
"author": "Raphael Landaverde ([email protected])",
14+
"contributors": [
15+
{
16+
"name": "Francisco Alejandro Garcia Cebada",
17+
"email": "[email protected]"
18+
}
19+
],
20+
"repository": {
21+
"type": "git",
22+
"url": "https://github.com/Mojang/minecraft-scripting-libraries.git",
23+
"directory": "tools/core-build-tasks"
24+
},
25+
"scripts": {
26+
"build-tools": "just-scripts build-tools",
27+
"clean-tools": "just-scripts clean-tools",
28+
"lint": "just-scripts lint",
29+
"test": "just-scripts test"
30+
},
31+
"files": [
32+
"lib"
33+
],
34+
"dependencies": {
35+
"@rushstack/node-core-library": "^3.59.6",
36+
"@microsoft/api-extractor": "^7.38.3",
37+
"esbuild": "^0.20.1",
38+
"dotenv": "^16.4.5",
39+
"just-scripts": "^2.3.2",
40+
"prettier": "^2.8.2",
41+
"rimraf": "^3.0.2",
42+
"vitest": "^0.34.6",
43+
"zip-lib": "^0.7.3"
44+
},
45+
"devDependencies": {
46+
"@types/node": "^14.0.0 || ^16.0.0 || ^18.0.0",
47+
"@types/rimraf": "^3.0.2",
48+
"@typescript-eslint/parser": "^7.2.0",
49+
"eslint": "^8.53.0",
50+
"ts-node": "^10.9.1",
51+
"tsconfig": "*",
52+
"typescript": "^5.2.2",
53+
"webpack": "^5.86.0"
1254
}
13-
],
14-
"repository": {
15-
"type": "git",
16-
"url": "https://github.com/Mojang/minecraft-scripting-libraries.git",
17-
"directory": "tools/core-build-tasks"
18-
},
19-
"scripts": {
20-
"build-tools": "just-scripts build-tools",
21-
"clean-tools": "just-scripts clean-tools",
22-
"lint": "just-scripts lint",
23-
"test": "just-scripts test"
24-
},
25-
"files": [
26-
"lib"
27-
],
28-
"dependencies": {
29-
"@rushstack/node-core-library": "^3.59.6",
30-
"@microsoft/api-extractor": "^7.38.3",
31-
"esbuild": "^0.20.1",
32-
"dotenv": "^16.4.5",
33-
"just-scripts": "^2.3.2",
34-
"prettier": "^2.8.2",
35-
"rimraf": "^3.0.2",
36-
"vitest": "^0.34.6",
37-
"zip-lib": "^0.7.3"
38-
},
39-
"devDependencies": {
40-
"@types/node": "^14.0.0 || ^16.0.0 || ^18.0.0",
41-
"@types/rimraf": "^3.0.2",
42-
"@typescript-eslint/parser": "^7.2.0",
43-
"eslint": "^8.53.0",
44-
"ts-node": "^10.9.1",
45-
"tsconfig": "*",
46-
"typescript": "^5.2.2",
47-
"webpack": "^5.86.0"
48-
}
4955
}

tools/core-build-tasks/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"include": ["src/**/*"],
44
"exclude": ["dist", "build", "node_modules"],
55
"compilerOptions": {
6-
"outDir": "lib"
6+
"outDir": "lib",
7+
"module": "Node16",
8+
"moduleResolution": "node16"
79
}
810
}

tools/tsconfig/base.json

-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
"forceConsistentCasingInFileNames": true,
99
"inlineSources": false,
1010
"isolatedModules": true,
11-
"moduleResolution": "bundler",
1211
"noUnusedLocals": false,
1312
"noUnusedParameters": false,
1413
"preserveWatchOutput": true,
1514
"skipLibCheck": true,
1615
"strict": true,
1716
"sourceMap": true,
1817
"lib": ["ES2020"],
19-
"module": "ES2020",
2018
"target": "ES2020"
2119
},
2220
"exclude": ["node_modules"]

0 commit comments

Comments
 (0)