-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to ESM where possible, publish release for @minecraft/math (#49)
* Switch to ESM exclusively. This involves updating downstream packages to specify "type: module" in their package.json, and having the upstream core-build-tasks package support both ESM and CJS due to just.js requiring commonjs for the most part. Also updates ESLint to latest, including flat configs, and updates the rule tester for better integration with vitest. * Update core-build-tasks to partially bundle in order to handle ESM only dependencies from commonjs invocations. Add release publishing task to core-build-tasks and integrate it into minecraft math so that the pre-built bundle is included in releases. Integrate this release publish into the release pipeline.
- Loading branch information
Showing
46 changed files
with
4,511 additions
and
3,445 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
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,6 +1,8 @@ | ||
.turbo | ||
lib | ||
lib-cjs | ||
dist | ||
temp | ||
node_modules | ||
*.tgz | ||
*.tgz | ||
*.zip |
7 changes: 7 additions & 0 deletions
7
change/@minecraft-core-build-tasks-f422a1d3-0607-48c5-a390-fe2f93713af0.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "major", | ||
"comment": "Export both ESM and CJS, but exclusively use CJS for just task configuration. Pre-bundle most dependencies to deal with ESM exclusive dependencies.\nTo leverage the new tasks, use a `just.config.cts` file to rely on CommonJS imports.", | ||
"packageName": "@minecraft/core-build-tasks", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@minecraft-math-7b3a5de1-838b-46a5-acb6-9cdeddefff32.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "major", | ||
"comment": "Switch to ESM exclusively. Publish release with artifacts.", | ||
"packageName": "@minecraft/math", | ||
"email": "[email protected]", | ||
"dependentChangeType": "major" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/eslint-plugin-minecraft-linting-a958326b-c769-47f3-9670-d7f8edf651ee.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "major", | ||
"comment": "Switch to CJS exclusively, and update to ESLint 9", | ||
"packageName": "eslint-plugin-minecraft-linting", | ||
"email": "[email protected]", | ||
"dependentChangeType": "major" | ||
} |
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,42 +1,46 @@ | ||
{ | ||
"name": "@minecraft/math", | ||
"version": "1.5.2", | ||
"author": "Raphael Landaverde ([email protected])", | ||
"contributors": [ | ||
{ | ||
"name": "Jake Shirley", | ||
"email": "[email protected]" | ||
"name": "@minecraft/math", | ||
"version": "1.5.2", | ||
"author": "Raphael Landaverde ([email protected])", | ||
"contributors": [ | ||
{ | ||
"name": "Jake Shirley", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"description": "Math utilities for use with minecraft scripting modules", | ||
"exports": { | ||
"import": "./lib/index.js" | ||
}, | ||
"type": "module", | ||
"types": "./lib/types/math-public.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Mojang/minecraft-scripting-libraries.git", | ||
"directory": "libraries/math" | ||
}, | ||
"scripts": { | ||
"build": "just build", | ||
"lint": "just lint", | ||
"test": "just test", | ||
"clean": "just clean", | ||
"postpublish": "just postpublish" | ||
}, | ||
"license": "MIT", | ||
"files": [ | ||
"dist", | ||
"lib", | ||
"api-report" | ||
], | ||
"peerDependencies": { | ||
"@minecraft/server": "^1.15.0" | ||
}, | ||
"devDependencies": { | ||
"@minecraft/server": "^1.15.0", | ||
"@minecraft/core-build-tasks": "*", | ||
"@minecraft/tsconfig": "*", | ||
"just-scripts": "^2.3.3", | ||
"prettier": "^2.8.2", | ||
"vitest": "^0.34.6" | ||
} | ||
], | ||
"description": "Math utilities for use with minecraft scripting modules", | ||
"main": "lib/index.js", | ||
"types": "lib/types/math-public.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Mojang/minecraft-scripting-libraries.git", | ||
"directory": "libraries/math" | ||
}, | ||
"scripts": { | ||
"build": "just build", | ||
"lint": "just lint", | ||
"test": "just test", | ||
"clean": "just clean" | ||
}, | ||
"license": "MIT", | ||
"files": [ | ||
"dist", | ||
"lib", | ||
"api-report" | ||
], | ||
"peerDependencies": { | ||
"@minecraft/server": "^1.15.0" | ||
}, | ||
"devDependencies": { | ||
"@minecraft/server": "^1.15.0", | ||
"@minecraft/core-build-tasks": "*", | ||
"@minecraft/tsconfig": "*", | ||
"just-scripts": "^2.3.2", | ||
"prettier": "^2.8.2", | ||
"vitest": "^0.34.6" | ||
} | ||
} |
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,4 +1,4 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
export * from './clamp'; | ||
export * from './clamp.js'; |
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,5 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
export * from './vector3'; | ||
export * from './general'; | ||
export * from './vector3/index.js'; | ||
export * from './general/index.js'; |
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,5 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
export * from './coreHelpers'; | ||
export * from './vectorWrapper'; | ||
export * from './coreHelpers.js'; | ||
export * from './vectorWrapper.js'; |
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
File renamed without changes.
Oops, something went wrong.