fxpio / foxy

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

enabled false, still triggers yarn #10

Closed schmunk42 closed 6 years ago

schmunk42 commented 6 years ago

Even though I have this conifg:

    "config": {
        "foxy": {
            "enabled": false,
            "manager": "yarn",
            "enable-packages": {
                "*": true
            }
        },
    }

I get this error

Installs: foxy/foxy:dev-master c8225f7, psr/http-message:1.0.1, psr/log:1.0.2, psr/simple-cache:1.0.0, cebe/markdown:1.1.2, yiisoft/yii2-dev:2.1.x-dev 603c084, codemix/yii2-streamlog:1.2.1
  - Installing foxy/foxy (dev-master c8225f7): Cloning c8225f715cbe0b9310972e3d67ca15955691a26e from cache
Plugin installation failed, rolling back
  - Removing foxy/foxy (dev-master)

  [Foxy\Exception\RuntimeException]       
  The binary of "yarn" must be installed  
francoispluchino commented 6 years ago

Is Yarn installed on your computer ? Try this command:

$ yarn --version
schmunk42 commented 6 years ago

No, I wanted to disable it, because I wanted to simulate an environment without any tooling installed.

francoispluchino commented 6 years ago

In this case, it isn't possible with Foxy. In issues of Composer Asset Plugin, you can found one of my proposal to use nodejs and install the binary if nodejs isn't installed. But Git is required and it is recommented to install nodejs, git and npm/yarn for your OS and not copy the binaries.

After, I'm not against an automatic installation and cross-platform (linux, windows, macOS), but personally, I do not have time to realize this feature.

schmunk42 commented 6 years ago

I just wanted to disable foxy by config, see also https://github.com/fxpio/foxy/blob/master/Resources/doc/config.md#define-the-config-in-a-environment-variable

It's not about automatic installation, merely doing the same like with CAP

    "config": {
        "process-timeout": 1800,
        "fxp-asset": {
            "enabled": false
        }
    },

"enabled": false should actually not run code from the plugin or external tools.

francoispluchino commented 6 years ago

Sorry, I read your config too quickly, I read enabled with the true value.

With the config config.foxy.enabled=false, you should not have an exception.

Is your config in the composer file of your root project?

francoispluchino commented 6 years ago

Ok I found the problem, see this line.

francoispluchino commented 6 years ago

Fixed by #11.