Skip to content
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

fix(cli): support public library methods in modules #3308

Merged
merged 25 commits into from
Oct 24, 2024
Merged

Conversation

vdrg
Copy link
Contributor

@vdrg vdrg commented Oct 18, 2024

No description provided.

Copy link

changeset-bot bot commented Oct 18, 2024

🦋 Changeset detected

Latest commit: dc5ac42

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@latticexyz/cli Patch
@latticexyz/world-module-erc20 Patch
@latticexyz/world-modules Patch
@latticexyz/abi-ts Patch
@latticexyz/block-logs-stream Patch
@latticexyz/common Patch
@latticexyz/config Patch
create-mud Patch
@latticexyz/dev-tools Patch
@latticexyz/explorer Patch
@latticexyz/faucet Patch
@latticexyz/gas-report Patch
@latticexyz/protocol-parser Patch
@latticexyz/react Patch
@latticexyz/recs Patch
@latticexyz/schema-type Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/stash Patch
@latticexyz/store-indexer Patch
@latticexyz/store-sync Patch
@latticexyz/store Patch
@latticexyz/utils Patch
@latticexyz/world-module-metadata Patch
@latticexyz/world Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vdrg vdrg marked this pull request as ready for review October 21, 2024 15:32
@vdrg vdrg requested a review from alvrs as a code owner October 21, 2024 15:32
@vdrg vdrg changed the title fix(cli): support public library methods in modules [WIP] fix(cli): support public library methods in modules Oct 21, 2024
@vdrg vdrg changed the title fix(cli): support public library methods in modules fix(cli): support public library methods in modules [WIP] Oct 21, 2024
@vdrg vdrg changed the title fix(cli): support public library methods in modules [WIP] fix(cli): support public library methods in modules Oct 22, 2024
if (!requirePath) throw new Error("Could not find package.json to import relative to.");
const require = createRequire(requirePath);

const moduleOutDirs = config.modules.flatMap((mod) => {
Copy link
Member

@holic holic Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe wrap this in a set so if we install multiple ERC20s, we only need to load the libs once?

Suggested change
const moduleOutDirs = config.modules.flatMap((mod) => {
const moduleOutDirs = new Set(config.modules.flatMap((mod) => {

or ideally, we add support for multiple out dirs in findLibraries that can do this automatically

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah makes sense, I had actually thought of deduplicating but then forgot. Will try it withing findLibraries 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/latticexyz/mud/pull/3321/files

Let me know if this looks good to you 🙏

Copy link
Member

@holic holic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! thanks for the fix!

@holic holic merged commit 8eaad30 into main Oct 24, 2024
13 checks passed
@holic holic deleted the vdrg/module-libraries branch October 24, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants