Skip to content

latest updates break installer / require #146

@AlmirKadric

Description

@AlmirKadric

With the latest updates, the builder no longer can require dependencies accordingly. Or rather so requires by component name in component.json file is no longer working.

The installation directories of dependencies in component.json currently correlates to that of the repository (remote) lookup URL. i.e. "component/indexof" will be installed to ./components/component-indexof. However the name of this component is actually "indexof" as per its component.json file. If you were to require('indexof') it would complain saying that the component could not be required.

The fact that the dependency names, component names and component folders do not correlate is the cause of the problem.

Currently this can be fixed via one of the following options:

  • update builder to use component name from component.json instead of folder name during registration (this can be done in the builder on line 829).
  • fix the "rewrite requires for dependencies" section in the builder (line 839). This seems to be the place this should get done, but seems to work only under certain circumstances (i.e. worked in our loader but not elsewhere). This requires a bit more investigating.
  • update the installer to normalize the dependency name for the folder name used in component.json (this would make it the same as node_modules folder) and builder to normalize the dependency name as well when looking for it

Could you please let me know what you would like done here, I will make the contribution if I know what course of action to take.

Best Regards
Almir Kadric

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions