ekandreas / bladerunner

WordPress plugin for Laravel Blade templating DEPRECATED
http://bladerunner.elseif.se
12 stars 1 forks source link

Allow Custom Install Path #67

Closed nathanaelphilip closed 6 years ago

nathanaelphilip commented 6 years ago

Hi Hi!

Thanks for the wonderful plugin! :)

Would it be possible to either:

  1. host this on https://wpackagist.org so we can use that to install it into our plugin directory
  2. allow us to define the custom directory using https://github.com/composer/installers (you would need to set this up on your end)

thank you!

ekandreas commented 6 years ago

But you can’t you just use:

composer require ekandreas/bladerunner

?

Composer is smart enough to place it in the right library if you have defined extras as in this example:

"extra": {
  "installer-paths": {
    "web/app/mu-plugins/{$name}/": [
      "type:wordpress-muplugin",
    ],
    "web/app/plugins/{$name}/": [
      "type:wordpress-plugin"
    ],
    "web/app/themes/{$name}/": [
      "type:wordpress-theme"
    ]
  },
  "wordpress-install-dir": "web/wp"
}
nathanaelphilip commented 6 years ago

oh! ok! i’ll try that! i tried to research it, but I don’t know enough about composer I guess... :)

nathanaelphilip commented 6 years ago

it’s still dropping it in the root vendor directory

"extra": {
    "wordpress-install-dir": "cms",
    "installer-paths": {
      "content/plugins/{$name}/": [
        "type:wordpress-plugin"
      ]
    }
  }
ekandreas commented 6 years ago

Then you are missing a wp installer package. I can help you later on.

Read more about WordPress and Composer!

nathanaelphilip commented 6 years ago

ok thank you! I’ll do some research!

ekandreas commented 6 years ago

I would recommend that you take a look at Roots Bedrock. A really simple and easy development platform to use for Structured WordPress Development. You don't need their Trellis or Sage to get started. Just a plain: composer create-project roots/bedrock your-project-name and you are good to go. Examine their structure! For example you need composer/installer that will read the specific extra settings mentioned before. So, please, try Bedrock, it's free https://roots.io/bedrock/

nathanaelphilip commented 6 years ago

I have my own thing that i use, which is why I was curious about the custom install. From my research, it looks like you would need to use this: https://github.com/composer/installers

This comes from this article: https://roots.io/using-composer-with-wordpress/

Using that lets me know what kind of package bladerunner is and how to install it. I can fork and try to set it up if you don’t have the time!

Written by the roots people!

ekandreas commented 6 years ago

I am using Roots Bedrock in all my projects and it works great. The composer file in Bladerunner directs the composer/installer to put it in the right install dir as it is a wordpress-plugin.

nathanaelphilip commented 6 years ago

i got it! thanks for your help @ekandreas !

nathanaelphilip commented 6 years ago

if anyone needs this, this would be the minimum you’ll need to install the plugin into wp-content/plugins:

{
   "require": {
    "ekandreas/bladerunner": "^1.7",
    "composer/installers": "^1.4"
  },
  "extra": {
    "installer-paths": {
      "wp-content/plugins/{$name}/": [
        "type:wordpress-plugin"
      ]
    }
  }
}