-
Notifications
You must be signed in to change notification settings - Fork 196
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
config should use paths relative to mud.config.ts (project root) #596
Comments
that might be the best solution here assuming it works well for downstream consumers of store, like world (world wouldn't need such remappings, I just need to check if store having self-referential imports is fine) |
Tried this in #598 and seems to blow up downstream. It seems to work within store itself, but when world imports a store thing and store tries to import from itself, the resolution path seems to be within world rather than store? |
this is now done after some refactoring for multiple namespaces |
I think in most places, any path args are relative to
mud.config.ts
, but we should firm that up as we consolidate configs.We'll soon have a
codegenDirectory
(defaults tocodegen
) in #585 and that is now sort of implicitly coupled withstoreImportPath
, in that you need to specify or know the default codegen directory, then adjust yourstoreImportPath
relative to that.I propose we assume all paths are relative to
mud.config.ts
as a project root. SostoreImportPath
would look likeand codegen would detect this is a relative path (starts with
.
) and resolve the correct import path relative to the files being generated (path.relative(codegenFilePath, path.join(projectRoot, storeImportPath))
)Alternatively, for the specific issue above, we could remove the
storeImportPath
option and add a line to store'sremappings.txt
likeThat way imports of
@latticexyz/store/*
resolve to a local file rather than what's in e.g. node_modulesThe text was updated successfully, but these errors were encountered: