I’m writing this here because I’m really struggling dealing with my legacy Meteor Packages, you know the package architecture us Meteor Heads promoted a long time ago. Since the change to imports writing new code that needs to be called in a legacy package is proving to be REALLY problematic. Am I the only one who feels this way?
Is there a way to import from the imports directory to a Meteor Package?
I opened this issue awhile ago
But didnt really get much attention. Anyway! Let me know!
I don’t know what to say other than after looking at the source you see imports being used for what appears to be everything within a package architecture with exports being shared across package boundaries etc.
Yes telescope uses the modules package to export namespaces for other packages or your app to import. What I’m specifically talking about is having a Meteor package that is in your packages directory trying to import a module found in your imports directory.
That sounds like defeating the purpose of having something as a package. Wouldn’t it be the same as code from node_modules importing a module from your app source?
Though I’m unaware of all the constraints of your project, but normally I’d look to do one of the following in your situation:
either refactor the app module in imports to convert it to a package.
or, if the package needing that module doesn’t need to be distributed via a package manager, then refactor it to be an app module
About point #1: maybe only parts of the module need to be converted to a package. In the past when I’ve faced such dilemmas about dependencies, it turned out that the module in question has low cohesion and needs to be refactored to extract the more generic parts.
I know it doesn’t address the question, but all I can say is that the all-package-based architecture works great with import. In fact I’m thinking I’d keep the same architecture even if Telescope wasn’t a Meteor app, maybe using Lerna.