-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: Build packages with
tsup
(#3998)
## Explanation This changes the build system to build all packages with `tsup`, instead of `tsc`. `tsc` is still used for generating the declaration files and type checking, and `tsup` is used for building the `.js` and (new) `.mjs` files. The benefit of this is that we now have a ESM build as well as a CJS build. ## References See MetaMask/utils#144. ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/accounts-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/address-book-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/announcement-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/approval-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/assets-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/base-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/build-utils` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/composable-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/controller-utils` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/ens-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/eth-json-rpc-provider` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/gas-fee-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/json-rpc-engine` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/json-rpc-middleware-stream` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/keyring-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/logging-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/message-manager` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/name-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/network-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/notification-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/permission-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/permission-log-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/phishing-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/polling-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/preferences-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/queued-request-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/rate-limit-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/selected-network-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/signature-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/transaction-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ### `@metamask/user-operation-controller` - **BREAKING**: Add ESM build. - It's no longer possible to import files from `./dist` directly. ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate
- Loading branch information
Showing
74 changed files
with
1,156 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/dist/index.js b/dist/index.js | ||
index 4500c4e43c3bbd24aa60b7d4cf95aa3fee8eb185..9c442bc216f99b7cfadb5ac62cb98d3ae9ce2f56 100644 | ||
--- a/dist/index.js | ||
+++ b/dist/index.js | ||
@@ -1813,6 +1813,8 @@ var cjsSplitting = () => { | ||
} | ||
const { transform: transform3 } = await Promise.resolve().then(() => require("sucrase")); | ||
const result = transform3(code, { | ||
+ // https://github.com/egoist/tsup/issues/1087 | ||
+ disableESTransforms: true, | ||
filePath: info.path, | ||
transforms: ["imports"], | ||
sourceMapOptions: this.options.sourcemap ? { |
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
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
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
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
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
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
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
Oops, something went wrong.