generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Introduce streams package
#11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or 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 comment was marked as spam.
This comment was marked as spam.
Also fix some behavioral issues with the streams.
Accomplished by copying over sections of the Snaps monorepo constraints, which allow the `workspace:^` dependency version. In this way, we will never accidentally pull a workspace package from npm.
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
@SocketSecurity ignore npm/domutils@3.1.0 npm/parse5-htmlparser2-tree-adapter@7.0.0 Both are transitive dev dependencies due to a 2-year-old version of widely used package |
Member
Author
rekmarks
added a commit
that referenced
this pull request
Aug 9, 2024
In the course of implementing #11, I made various changes to the monorepo that I deemed either necessary or simply beneficial. Here these changes are extracted from #11, which has been separated into this PR and #16. Contains the following changes: - Upgrade `ts-bridge` and migrate all packages to ESM - In the course of implementing #11, I ran into a [TypeScript project references](https://www.typescriptlang.org/docs/handbook/project-references.html)-related error, because [`ts-bridge`](https://ts-bridge.dev/) originally did not support this feature. However, [`ts-bridge` recently added support for project references](https://github.com/ts-bridge/ts-bridge/releases/tag/v7.0.0), and updating fixed the problem. - This, however, necessitated migrating all monorepo packages to be ESM-first (`"type": "module"`), and setting TypeScript's `moduleResolution` algorithm to `Node16`. So, now the entire monorepo is ESM-first, but any libraries we publish will still be importable in CommonJS, due to `ts-bridge`. - As part of this change, `.js` files were renamed to `.cjs`, and `.mjs` files to `.js`. The same goes for their `.ts` equivalents. - A notable exception includes the published files in `@ocap/shims`, which retain their `.mjs` extensions as a redundancy measure. - Fix intra-repo path resolution in tests - In the `/snaps` and `/core` monorepos, Jest's `moduleNameMapper` option is manually configured to match the `paths` property in `tsconfig.json` to ensure that tests use source code as opposed to build outputs. - In `vite`, we accomplish the same by dropping in the plugin `vite-tsconfig-paths`, with no additional configuration whatsoever. - Add internal `test-utils` package - Rather than keeping a folder of test utilities at the monorepo root, I decided to just create an internal package for this purpose. - Set the version of all intra-monorepo dependencies to `workspace:^` - This takes a queue from the Snaps monorepo. In this way, we will never accidentally pull a workspace package from npm. - Note that this required stealing some of the Snaps monorepo's constraints for our `constraints.pro`. However, don't spend too much time on that file, because it will be replaced soon: #17 - Externalize `endoify.mjs` in `extension` HTML files - Introduces our own tiny `vite` plugin, `endoifyHtmlFilesPlugin`, that inserts the `endoify.mjs` in the correct place just before HTML files are built. `vite`'s aggressive optimization and module resolution logic otherwise prevents us from doing this. - Add `clean` script to all packages - After experiencing some issues with cached builds, I decided to make sure every package has a `clean` script.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Awaiting #13
Introduces a new package,
@ocap/streams, based on @endo/stream. As a side effect, migrates the monorepo's test framework fromjesttovitest, which was already used for the extension.Complete description forthcoming. This will probably be broken up into multiple distinct PRs.