Skip to content

support transforming addons where package.name != addon.moduleNameΒ #37

@hmajoros

Description

@hmajoros

We have a lot of addons where the name field in the package.json is different than the addon's moduleName (we like to prefix the package.json with @linkedin/, for example). This leads to issues because the codemod's telemetry helpers use package.name and moduleName for setting telemetry data and looking up telemetry data later on

in gatherTelemetry (link), the telemetry object is generated using window.require.entries, which uses the ember-cli moduleName prefix.
in getModulePathFor (link), the lookup of telemetry data is using the package.name from the package.json

After talking with @rwjblue, he suggested that we should try to use moduleName first, and fallback to name if a moduleName does not exist, something like:

addonInstance.moduleName() || addonInstance.name

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