publishpress / PublishPress-Planner

PublishPress Planner has all the tools you need to manage WordPress content, including an editorial calendar to plan content. You can create custom status and notifications for content updates.
https://publishpress.com/publishpress
Other
47 stars 20 forks source link

Add support to be installed by composer #697

Closed andergmartins closed 1 year ago

andergmartins commented 4 years ago

The plugin already can be installed as a library but we need to make it possible to install as a WP plugin. The free plugin can be installed using the package provided by http://wpackagist.org:

"wpackagist-plugin/publishpress": "*"

But the pro plugin needs to be updated for allowing that. But the Free plugin needs to be kept as a library inside the Pro plugin, instead of being installed a plugin.

andergmartins commented 4 years ago

Review the doc https://publishpress.github.io/docs/development/preparing-composer and make more tests

andergmartins commented 4 years ago

Questions from a client:

Is there a way to not require SSH keys for private repos?

We can authenticate to Pro repository using Github's OAuth, personal token. We need to update the docs to include:

https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth

https://docs.github.com/en/free-pro-team@latest/github/extending-github/git-automation-with-oauth-tokens

The vendor folder is not publicly accessible. Can we still use it?

Regarding the assets issues, and structure we have some options:

  1. Create a library that will handle assets loading in the Pro packages, so they can stay in the private vendor folder, but be read by the plugin to return it.
  2. Stop using Composer to inject the Free plugin inside the Pro plugin and keep composer only for other libraries and other dependencies. The Free plugin can be injected in other subfolders in the Pro package, but that requires creating a task in the builder script that would clone the Git repo there. We can use the builder script to handle that, or we can use Git’s submodule - that works as a repo inside another repo.
  3. Stop providing the Free inside the Pro. But in order to avoid having duplicated code, it would need to have installed both Free and Pro plugins on clients.

2 and 3 sounds more feasible to me.

cc @agapetry

andergmartins commented 2 years ago

Instead of using https://github.com/publishpress/wordpress-vendor-assets-handler maybe using a composer script post-install-cmd and post-update-cmd for copying the required assets from vendor dir to a folder in the project root is a simpler solution. The commands might be PHP based, making it easier to run on multiple platforms (like "post-update-cmd": "WCM\\WPStarter\\Setup::run")