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

Publish on Packagist #2649

Closed
swissspidy opened this issue Jun 17, 2019 · 10 comments
Closed

Publish on Packagist #2649

swissspidy opened this issue Jun 17, 2019 · 10 comments
Assignees
Labels
Enhancement New feature or improvement of an existing one Groomed Infrastructure Changes impacting testing infrastructure or build tooling P2 Low priority Punted Task Tasks which do not involve engineering WS:Core Work stream for Plugin core

Comments

@swissspidy
Copy link
Collaborator

Looks like the Human Made folks have forked this repository in order to make it easier for them to use it with Composer. For this, they have published it on Packagist:

https://github.com/humanmade/amp-wp
https://packagist.org/packages/humanmade/amp

They don't want to rely on a third-party repository like WordPress Packagist to get their dependencies. Plus, since that site only mirrors the WordPress.org repository, you won't get pre-release version through it.

To make lives of developers and agencies using Composer easier, we could publish the plugin on Packagist ourselves.

Doing so is pretty straightforward, and requires no code change whatsoever. In fact, all that's needed is hitting a button on https://packagist.org/packages/submit. Since we already use GitHub releases to share the built ZIP files, Composer will automatically pick these up when downloading packages. So people will always get the proper version.

@swissspidy swissspidy added the Task Tasks which do not involve engineering label Jun 17, 2019
@roborourke
Copy link
Contributor

roborourke commented Jun 17, 2019

@swissspidy thanks for this, although it's not so straightforward unfortunately:

  1. I had to modify the build required check
  2. You'll need to build the non composer deps or packaged releases won't work

In the above link you'll also see I added a CircleCI integration to build front end assets and push tagged releases. I'm not 100% sure how easy it'll be to convert to work with Travis but happy to try and help there.

@swissspidy
Copy link
Collaborator Author

Thanks @roborourke, that's a good point.

I guess we would need to upload two versions per release then: one fully built, and one only with the JS built.

Having Travis CI do the builds is also something I've been looking into (see #1840).

@roborourke
Copy link
Contributor

My diff link was getting mangled - fixed now!

@westonruter
Copy link
Member

I'm sure you're aware, but there are also *-built tags like 1.2-RC1-built which are just Git-committed version of the files in a build. This is suitable for Git submodules, and perhaps useful for Composer installation as well.

@swissspidy
Copy link
Collaborator Author

For a proper Composer project that's not of much help I think.

If a project requires packages A and B, and both packages require the same dependency, e.g. PHP CSS Parser, the dependency would be downloaded once into the project's vendor folder and not two times within each package. That's a bit different when comparing to npm.
The *-built tags do not allow for this, because the Composer dependencies have already been resolved there.
But for a Composer project this should not be the package's concern. But because Composer does not deal with any JavaScript build step whatsoever, we'd still need to perform that step.

Certainly, #1867 would somewhat work around this, but in a project that only uses Composer that would result in unnecessarily duplicated code.

I have to admit that manually adjusting the workflow two have two different build files would be a bit of a maintenance burden for us. I'll see if I can have another look at #1840 to automate all of this.

In the long run, this would also help for #2315, because a Composer project could include this plugin as a dependency, but also some other package that requires the same shared AMP PHP library.

@swissspidy
Copy link
Collaborator Author

One thing that needs to be kept in mind with Composer: we are currently using cweagans/composer-patches to patch PHP CSS Parser. We'd need to ensure that this still works when pulling in the plugin as a Composer package.

@swissspidy swissspidy added Enhancement New feature or improvement of an existing one Infrastructure Changes impacting testing infrastructure or build tooling labels Jun 27, 2019
@swissspidy
Copy link
Collaborator Author

@roborourke Haven't tested them yet, but here are two packages I just generated, one for use with composer, one standalone:

amp.zip
composer.zip

@westonruter
Copy link
Member

Relates to #4215.

@westonruter westonruter added the P2 Low priority label Apr 12, 2020
@kmyram kmyram added the WS:Core Work stream for Plugin core label Aug 5, 2020
@mahnunchik
Copy link

Any news?

@westonruter
Copy link
Member

@schlessera and @pierlon have started digging into this due to #5609, where the upgrade to Composer v2 started to break site(s) that are assembled with Composer.

@westonruter westonruter added this to the v2.2 milestone Feb 11, 2021
@westonruter westonruter modified the milestones: v2.2, v2.3 Jun 18, 2021
@westonruter westonruter added P2 Low priority and removed P1 Medium priority labels Jun 18, 2021
@westonruter westonruter modified the milestones: v2.2, v2.3 Sep 23, 2021
@westonruter westonruter modified the milestones: v2.3, v2.4 Dec 23, 2021
@westonruter westonruter removed this from the v2.4 milestone Apr 14, 2022
@swissspidy swissspidy closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
@github-project-automation github-project-automation bot moved this to In Progress in Ongoing Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or improvement of an existing one Groomed Infrastructure Changes impacting testing infrastructure or build tooling P2 Low priority Punted Task Tasks which do not involve engineering WS:Core Work stream for Plugin core
Projects
Archived in project
Development

No branches or pull requests

7 participants