tonik / theme

Tonik is a WordPress Starter Theme which aims to modernize, organize and enhance some aspects of WordPress theme development.
http://labs.tonik.pl/theme/
MIT License
1.33k stars 140 forks source link

Set custom installation paths for dependencies #56

Closed nr1q closed 6 years ago

nr1q commented 6 years ago

This is needed to have wordpress plugins installed in their default wp-content/plugins and tonik/gin inside vendor

jedrzejchalubek commented 6 years ago

These paths are too much "project specific" and adding it by default may be a problem for someone with different WordPress setup (like based on Bedrock or WP Starter)

Can you describe more how your WordPress installation structure and workflow is like and what problem these changes solves?

nr1q commented 6 years ago

Well I'm working in a normal WordPress installation, using Redux Framework as single dependency to manage the theme options plus content, then RF and Gin were being installed in wp-content/plugins (which also gave me issues having Gin a missing vendor directory because it just cloned into plugins folder).

It is true that this brings issues with other setups, so I guess this is a task for the CLI tool, just to insert a convenient default configuration in composer.json depending on WordPress setup and if user accepts it of course.

Update: Just realized that having RF as plugin, supersedes the theme's one. Anyway library paths needs to be specified, because without the "extra" in composer.json it puts Gin and other plugins in a wp-content/plugins directory inside the theme's root, which is not good.

By now I have this in my composer json file, to put RF and Gin inside vendor and other WordPress plugins in their respective path:

"extra": {
  "installer-paths": {
    "vendor/tonik/{$name}/": ["tonik/gin"],
    "vendor/{$name}/": ["redux-framework/redux-framework"],
    "../../plugins/{$name}/": ["type:wordpress-plugin"]
  }
},

The convenient default I said before might be like the above, just without the second entry of "installer-paths" unless a dependency is required inside vendor as in my case.

What do you think?

jedrzejchalubek commented 6 years ago

After the second look, I still say that it should be adjusted to a specific project. Trying to cover all use cases in CLI will be really hard.