Skip to content

Commit

Permalink
Tweak tsconfig so it's friendly to commonjs alongside ESM (#47)
Browse files Browse the repository at this point in the history
* Tweak tsconfig so it's friendly to commonjs alongside ESM

* Change files

* Switch to node16 to not become new node features unintentionally
  • Loading branch information
rlandav authored Dec 3, 2024
1 parent 9b4a3b6 commit 29d380a
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Tweak tsconfig so it's friendly to commonjs alongside ESM",
"packageName": "@minecraft/core-build-tasks",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Tweak tsconfig so it's friendly to commonjs alongside ESM",
"packageName": "@minecraft/math",
"email": "[email protected]",
"dependentChangeType": "patch"
}
4 changes: 3 additions & 1 deletion libraries/math/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"exclude": ["dist", "build", "node_modules"],
"compilerOptions": {
"outDir": "lib",
"declarationDir": "temp/types"
"declarationDir": "temp/types",
"module": "Node16",
"moduleResolution": "node16"
}
}
98 changes: 52 additions & 46 deletions tools/core-build-tasks/package.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,55 @@
{
"name": "@minecraft/core-build-tasks",
"version": "1.1.7",
"description": "Common build tasks used for minecraft-scripting-libraries",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"author": "Raphael Landaverde ([email protected])",
"contributors": [
{
"name": "Francisco Alejandro Garcia Cebada",
"email": "[email protected]"
"name": "@minecraft/core-build-tasks",
"version": "1.1.7",
"description": "Common build tasks used for minecraft-scripting-libraries",
"main": "lib/index.js",
"exports": {
".": {
"import": "./lib/index.js",
"require": "./lib/index.js"
}
},
"types": "lib/index.d.ts",
"author": "Raphael Landaverde ([email protected])",
"contributors": [
{
"name": "Francisco Alejandro Garcia Cebada",
"email": "[email protected]"
}
],
"repository": {
"type": "git",
"url": "https://github.com/Mojang/minecraft-scripting-libraries.git",
"directory": "tools/core-build-tasks"
},
"scripts": {
"build-tools": "just-scripts build-tools",
"clean-tools": "just-scripts clean-tools",
"lint": "just-scripts lint",
"test": "just-scripts test"
},
"files": [
"lib"
],
"dependencies": {
"@rushstack/node-core-library": "^3.59.6",
"@microsoft/api-extractor": "^7.38.3",
"esbuild": "^0.20.1",
"dotenv": "^16.4.5",
"just-scripts": "^2.3.2",
"prettier": "^2.8.2",
"rimraf": "^3.0.2",
"vitest": "^0.34.6",
"zip-lib": "^0.7.3"
},
"devDependencies": {
"@types/node": "^14.0.0 || ^16.0.0 || ^18.0.0",
"@types/rimraf": "^3.0.2",
"@typescript-eslint/parser": "^7.2.0",
"eslint": "^8.53.0",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typescript": "^5.2.2",
"webpack": "^5.86.0"
}
],
"repository": {
"type": "git",
"url": "https://github.com/Mojang/minecraft-scripting-libraries.git",
"directory": "tools/core-build-tasks"
},
"scripts": {
"build-tools": "just-scripts build-tools",
"clean-tools": "just-scripts clean-tools",
"lint": "just-scripts lint",
"test": "just-scripts test"
},
"files": [
"lib"
],
"dependencies": {
"@rushstack/node-core-library": "^3.59.6",
"@microsoft/api-extractor": "^7.38.3",
"esbuild": "^0.20.1",
"dotenv": "^16.4.5",
"just-scripts": "^2.3.2",
"prettier": "^2.8.2",
"rimraf": "^3.0.2",
"vitest": "^0.34.6",
"zip-lib": "^0.7.3"
},
"devDependencies": {
"@types/node": "^14.0.0 || ^16.0.0 || ^18.0.0",
"@types/rimraf": "^3.0.2",
"@typescript-eslint/parser": "^7.2.0",
"eslint": "^8.53.0",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typescript": "^5.2.2",
"webpack": "^5.86.0"
}
}
4 changes: 3 additions & 1 deletion tools/core-build-tasks/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"include": ["src/**/*"],
"exclude": ["dist", "build", "node_modules"],
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"module": "Node16",
"moduleResolution": "node16"
}
}
2 changes: 0 additions & 2 deletions tools/tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
"forceConsistentCasingInFileNames": true,
"inlineSources": false,
"isolatedModules": true,
"moduleResolution": "bundler",
"noUnusedLocals": false,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"skipLibCheck": true,
"strict": true,
"sourceMap": true,
"lib": ["ES2020"],
"module": "ES2020",
"target": "ES2020"
},
"exclude": ["node_modules"]
Expand Down

0 comments on commit 29d380a

Please sign in to comment.