Daandelange / kirby3-simplestats

All your data are belong to us. -- Track pageviews, referrers and devices on your Kirby 3 website.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for composer

MaluNoPeleke opened this issue · comments

Can you please add support for composer?
It is offered by nearly all plugins and makes updating them very easy.

Hey, There already is a composer file which loads some php components and makes updating easy.
Do you mean to publish it in the composer database so it can become a dependency ? I've never done such a thing but I can give it a shot. Any directions ?

Oh, I just looked at the installation instructions and couldn't find find composer there so I thought it would be missing.
I still cannot find it at https://packagist.org/search/?query=daandelange%2Fsimplestats (which is the official repository for all composer packages)

I have never used composer in my projects, I'm using it as suggested by Kirby's pluginkit. In SimpleStats, Composer installs and loads some PHP libraries...
To me, it's not clear on the Kirby website how to publish a plugin for use with composer projects... but it seems possible : https://getkirby.com/docs/cookbook/setup/composer#using-composer-for-kirby-plugins.
I'll digg further when I find some time.

I think the only step missing is that you need to submit it: https://packagist.org/packages/submit

There you go : https://packagist.org/packages/daandelange/simplestats
Please let me know if it works correctly.

It works but on packagist it says "This package is not auto-updated.". Does it mean that new updates won't be automatically available via composer? I haven't seen this with other pluigns.

As I understand it, I have to link my Github account to enable automatic updates. (I prefer not to)
But a semi-automatic mechanism is crawling the repo once a week, grabbing new github releases; plus I can manually hit an "Update now" button if needed; so to me this is not an issue. (The warning seems a bit "big".)

Okay, thanks for the explanation

After installing it via composer I cannot find any notice of it in my Kirby 3.6.0 beta 3 environment. I have used the kirby-3.6 branch to install and no options added to the config.

I tried on a fresh starterkit updated to kirby 3.6-beta-6 and everything works automagically. The plugin is in site/plugins.
composer require daandelange/simplestats ^0.4.0-beta
Maybe you need "getkirby/composer-installer": "^1.1", ?

Sorry, I installed it without specifying the kirby-3.6 branch in composer so that it was the incompatible version 0.3.1