Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer support #19

Open
tgeorgel opened this issue Oct 20, 2022 · 2 comments
Open

Composer support #19

tgeorgel opened this issue Oct 20, 2022 · 2 comments

Comments

@tgeorgel
Copy link

Hi there, first of all thanks for your amazing work !

I've seen you added the type="wordpress-plugin" in the composer.json on master so we can use composer to get the plugin, that's cool !

However, the plugin still expect use to run composer install inside the plugin :

Capture d’écran 2022-10-20 à 08 51 50

Any idea how to fix this ?

Thanks !

@boxybird
Copy link
Owner

boxybird commented Oct 20, 2022

Hey @tgeorgel, thanks for the kind words.

To be honest, a contributor added "type='wordpress-plugin'" in a previous PR (#17) and it's a feature I don't take advantage of, nor fully understand.

That said, assuming you've chose the install path from the README, the error your getting might be because the required vendor/autoload.php file doesn't exist in the root of your theme. Or plugin, if you went that direction.

Sorry if that comes off as basic "composer" advice. I'm just hoping for an easy win!

@mortensassi
Copy link

@tgeorgel @boxybird I think now the problem is that since it is marked as a "wordpress-plugin", it will be automatically moved to the plugins-folder which requires a user to run composer install after installing. Not very convenient.

I guess you should remove the type declaration (again) in order to get this plugin moved into the vendors directory by default in order to make it work without any further steps. PLUS anyone who needs this plugin to be moved to the plugins directory should extend his/her composer.json like this:

// composer.json created by roots/bedrock
"extra": {
    "installer-paths": {
      "web/app/mu-plugins/{$name}/": [
        "type:wordpress-muplugin",
        "advanced-custom-fields/advanced-custom-fields-pro",
        "bostondv/acf-ninja-forms",
        "wpackagist-plugin/timber-library",
        "wpackagist-plugin/svg-support",
        "mortensassi/acf-svg-icon",
        "ooksanen/acf-focuspoint",
        "vinkla/headache",
        "wpackagist-plugin/svg-support"
      ],
      "web/app/plugins/{$name}/": [
      "type:wordpress-plugin",
     "boxybird/inertia-wordpress" // <<--- here
      ],
      "web/app/themes/{$name}/": ["type:wordpress-theme"]
    },
    "wordpress-install-dir": "web/wp"
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants