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

Prepare for packagist.org publishing #53

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Jan 26, 2024

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.

composer.lock export-ignore
docker-compose.yml export-ignore
package-lock.lock export-ignore
phpcs.xml export-ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ensures all these files won't be included when installing this package with composer, as it uses git under the hood.

composer.json Outdated Show resolved Hide resolved
Copy link
Member

@robertknight robertknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would suggest to align the repo name and the plugin name if it doesn't cause difficulties. Otherwise this looks fine to me.

@acelaya acelaya merged commit a96174f into main Jan 26, 2024
6 checks passed
@acelaya acelaya deleted the packagist-publish-prep branch January 26, 2024 13:09
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

Successfully merging this pull request may close these issues.

2 participants