userfrosting / merge-package-dependencies

Merge NPM or Bower package dependencies into one package, with semvar rules respected.
MIT License
11 stars 4 forks source link

Support processing of package.json files in node_modules #15

Open dfagan2 opened 4 years ago

dfagan2 commented 4 years ago

Because of https://github.com/nodejs/help/issues/2303, validation trips up when using this tool with packages within node_modules, which happens to be my use case.

The following is thrown:

InvalidNpmPackageException: Package is invalid. Inspection results:
{
    "valid": false,
    "errors": [
        "Type for field bundleDependencies, was expected to be array, not boolean"
    ]
}

So while that is a valid error, and this is an upstream problem, would it be possible to include a configuration override from this package that ignores bundleDependencies, or allows it to be be a boolean?

Silic0nS0ldier commented 4 years ago

First time I've seen this library being used in the wild for something other than a UserFrosting project. Interesting use case. Relatively sure the package.json file for packages in node_modules adheres to a different spec (its modified by NPM/Yarn to hold meta data), hence this presenting a problem.

Seeing this scenario covered will likely involve a semver major release, https://github.com/RobotsAndPencils/react-robits will need to update once this is addressed.

dfagan2 commented 4 years ago

Thanks for looking into this @Silic0nS0ldier! No issue from our end upgrading to a new release if this gets a workaround.

And this is a cool tool, happy to help get it some "in the wild" exposure! It's been really helpful for our setup.

Another use case, while you're in there, is that it'd be helpful to be able to scope to just the dependency list, for instances where the devDependency items are not needed.

Silic0nS0ldier commented 4 years ago

I'll keep that in mind. The refactor I'm currently working on should offer the level of control needed for most scenarios.