hypothesis / wp-hypothesis

Hypothesis WordPress plugin
https://wordpress.org/plugins/hypothesis/
Other
29 stars 14 forks source link

Prepare for packagist.org publishing #53

Closed acelaya closed 10 months ago

acelaya commented 10 months ago

Part of #52

The standard package manager for PHP projects is composer, and packagist.org is its package registry. Many WordPress projects handled by more technical people use composer to manage dependencies, including WordPress plugins.

This PR adds the needed config changes and documentation so that we can publish this plugin there, and people can install it via composer require hypothesis/hypothesis-wp-plugin. This is the equivalent to yarn add @hypothesis/frontend-shared, for example.

Composer defers a bit from other languages package managers, in which the registry only stores metadata, but code itself is installed via git, mercurial, subversion, etc.

However, when installing dependencies for production, you usually pass --prefer-dist (which is actually the default), which in the case of git makes it use git archive and honor the .gitattributes file.

Next steps

Once this is merged, when need to "link" this repository in packagist.org, making it available for install, and ensuring any new git tag will be automatically synced there.