Skip to content

Allow for package.json deep merge to support more scenarios #1058

@gossi

Description

@gossi

When supporting addons from ember@3 up to ember@6, there needs to happen various changes here and there.

My current problem is roughly mentioned here: embroider-build/addon-blueprint#131
Basically the resolving @ember/owner in ember <> 4.12 - that in some scenarios is missresolved by the package manager, namely pnpm for me. That's why we are advised to use dependenciesMeta.*.injected. However, that comes with a big downside for actually developing the addon and requires third-party-tools only to fix that.

A handy trick would be for CI to have that scenario modelled, in my case for older ember versions.
Here is my sample commit for that: gossi/ember-ability@9ecfd9b which adds a script and dependenciesMeta to some package.json - but that does not work, because only a couple of selected properties are overwritable, see:

_packageJSONForDependencySet(packageJSON, dependencySet) {
this._overridePackageJSONDependencies(packageJSON, dependencySet, 'dependencies');
this._overridePackageJSONDependencies(packageJSON, dependencySet, 'devDependencies');
this._overridePackageJSONDependencies(packageJSON, dependencySet, 'peerDependencies');
this._overridePackageJSONDependencies(packageJSON, dependencySet, 'ember');
this._overridePackageJSONDependencies(packageJSON, dependencySet, this.overridesKey);
return packageJSON;
}

What about a deep merge instead and everybody is free to change what they seem necessary for them?

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