fxpio / foxy

A fast, reliable, and secure NPM/Yarn/pnpm bridge for Composer
https://foxypkg.com
MIT License
173 stars 21 forks source link

Allow to define a map of asset manager for config options #7

Closed schmunk42 closed 6 years ago

schmunk42 commented 7 years ago

This demo-project: https://github.com/schmunk42/foxy-roxy-rabbit can be installed fine with yarn, but fails on npm@3 (https://github.com/npm/npm/issues/9054), works again with npm@5

Can I require this in composer.json?

francoispluchino commented 7 years ago

With the option config.foxy.manager-version. but config.foxy.manager must be npm for your example.

schmunk42 commented 7 years ago

I have config.foxy.manager set to yarn.

I was looking more for a setting, which says: You can either use yarn >= 1.0 or npm >= 5.0 to install assets of this project.

francoispluchino commented 7 years ago

I did not anticipate this behavior, but simplified with a single asset manager. In this case, all manager options should be changed. Initially, I had duplicate each option with the name of the manager, but it made the config much more complex.

Maybe, allowed for each option to define a map with the name of the manager, like:

{
    "config": {
        "foxy": {
            "manager-version": {
                "npm": ">=5.0",
                "yarn": ">=1.0"
            }
        }
    }
}
schmunk42 commented 7 years ago

The code snippet looks good to me.

In my setups I'll have control over the package-manager to use, since it'll be in a Container. But I already stumbled upon a lot of strange behaviors between 0.x and 1.x versions of yarn and 3.x to 5.x version of npm.

Excluding knowingly broken versions is great.

francoispluchino commented 6 years ago

Added by 71b8792664bf2fce286a6cdb0ac5201156f6e37c.