Skip to content

Conversation

@loppear
Copy link
Contributor

@loppear loppear commented Feb 3, 2020

Resolves #127 and keeps all the hacks hidden away in NxusModule still?

Note that there are many different paths for determining the directory path prefix:

  • When constructing a module instance that has been exported/required somewhere
    • uses require.cache so that static methods can also find this
  • When constructing a module instance that is internal and never exported (happens in test, could happen elsewhere but probably doesn't today, but hard to ban)
    • uses old stacktrace-based approach since we are calling from constructor
  • When calling getProxy in a module file before it is exported.
    • use the caller file under the assumption getProxy is only called next to module class definition
  • When finding modules to import recursively in PluginManager
    • attempt to match _moduleName logic in effect for "Loading" message, but if using a module that has _moduleName this will be favored by the time the Application proxies etc.

@loppear loppear requested a review from alexjreich February 3, 2020 18:10
@loppear
Copy link
Contributor Author

loppear commented Feb 3, 2020

Ok, so this is working correctly for application modules nested along with core modules. Core modules need the naming to come from the base module name (Router not nxus-router), ideally it would support better names for nested dep modules (nxus-router/src/modules/router-sessions -> router/router-sessions rather than current router-sessions)...

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.

Namespace module names to enable submodules with the same folder name

2 participants