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

Create composer.json #11

Merged
merged 12 commits into from
Feb 5, 2021
Merged

Create composer.json #11

merged 12 commits into from
Feb 5, 2021

Conversation

goaround
Copy link
Contributor

@goaround goaround commented Feb 1, 2021

Add a composer.json to make it installable with composer

@florianbrinkmann
Copy link
Member

Thanks for the PR! If I understand it correctly, wpackagist.org only works for plugins from the official repo, right? Because the planet feed plugin is not in the repo.

@goaround
Copy link
Contributor Author

goaround commented Feb 1, 2021

No, you can load plugins with a composer.json right from Github. Add this repository as a repository and require deworg/dewp-planet-feed:

	"repositories": [
		{
			"type": "github",
			"url": "git@github.com:deworg/dewp-planet-feed"
		}
	],
	"require": {
		"deworg/dewp-planet-feed": ">=0.5.1",
	},

@goaround
Copy link
Contributor Author

goaround commented Feb 1, 2021

The https://wpackagist.org repository is not needed. I removed it.

@florianbrinkmann
Copy link
Member

florianbrinkmann commented Feb 1, 2021 via email

@goaround
Copy link
Contributor Author

goaround commented Feb 2, 2021

You'are right. I have not thought about it here.

I still tried to solve this problem for me. There is a Composer plugin GitHub Archive Installer which should be perfect here (and for my private themes/plugins) but I can't get it (or its forks) to work with Composer 2: https://github.com/wpscholar/github-archive-installer

Another solution could be the Composer Asset Compiler from Inpsyde: https://github.com/inpsyde/composer-asset-compiler but it runs the build script on composer install/update. It should work but I would prefer the Archive Installer.

Nevertheless, it would be nice if a composer.json was available.

@goaround
Copy link
Contributor Author

goaround commented Feb 2, 2021

Just tried Composer Asset Compiler from Inpsyde and it works really well! Its even possible to use pre-compilation to download the assets right from the release dewp-planet-feed.zip

@florianbrinkmann
Copy link
Member

Okay, cool. Could you provide an example for a composer.json with the Composer Asset Compiler in use for the planet repo asset? Then we can add it to the readme file or the wiki. And could you add @Zodiac1978 to the authors section of the composer.json?

@goaround
Copy link
Contributor Author

goaround commented Feb 2, 2021

I just run into an issue. The dewp-planet-feed.zip will be unziped to the asset folder as a hole. At the moment you can't just take the asset folder from the zip: inpsyde/composer-asset-compiler#5

For my private plugins/themes I generate an additional asset.zip. Would this be an option for this plugin, too?

@florianbrinkmann
Copy link
Member

For my private plugins/themes I generate an additional asset.zip. Would this be an option for this plugin, too?

I see nothing that speaks against that. Could you update the GitHub workflow as part of this PR and provide an example config that we can post in the readme or wiki so anyone who wants to install it via composer can use it?

@goaround
Copy link
Contributor Author

goaround commented Feb 4, 2021

Any wishes how the asset.zip should be called? dewp-planet-feed-assets-0.5.1.zip, assets-0.5.1.zip or just assets.zip?

@florianbrinkmann
Copy link
Member

Just assets.zip, the version number was part of an old CI script.

@goaround
Copy link
Contributor Author

goaround commented Feb 4, 2021

Done. Please proofread my Installation part of the README.md.

@florianbrinkmann
Copy link
Member

I made a few small changes, could you verify that the changes make sense and still describe the composer process correctly?

@florianbrinkmann
Copy link
Member

Maybe we need to switch to another action for the release asset (actions/upload-release-asset#78), but we will see after running it for the first time.

@goaround
Copy link
Contributor Author

goaround commented Feb 5, 2021

I made a few small changes, could you verify that the changes make sense and still describe the composer process correctly?

Looks good!

Maybe we need to switch to another action for the release asset (actions/upload-release-asset#78), but we will see after running it for the first time.

I use https://github.com/JasonEtco/upload-to-release but last release Feb 2019...

@florianbrinkmann florianbrinkmann merged commit 8abb8de into deworg:master Feb 5, 2021
@florianbrinkmann
Copy link
Member

I use https://github.com/JasonEtco/upload-to-release but last release Feb 2019...

Thanks for the tip!

@florianbrinkmann
Copy link
Member

And thanks again for the PR :)

@florianbrinkmann
Copy link
Member

I just released a beta version with the modified GitHub action. I will test it and release the final version — I have no idea, why I have not released 0.5.2 last year 🙈

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