This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

ManagedPixels
ManagedPixels

Whats the best practices for adding required composer packages / dependencies to plugins -- Since October comes with composer I figured I would just add my plugin dependencies there, but that file gets written over on updates, should I then just add dependencies to the plugin folders using my own composer.js file. Any thoughts?

Flynsarmy
Flynsarmy

Use the google analytics plugin for an example of how to handle composer in plugins.

sorentruelsen339
sorentruelsen339

I've added a composer.js as well as a vendor folder inside my plugin. It seems pretty impractical, but it works for now. Any other solution would be better, so check Flynsarmy's suggestion

ManagedPixels
ManagedPixels

It is impractical, and definitely not a best practice, guess it will have to work for now!

Tiipiik
Tiipiik

I should miss something, cause I've looked at the googleanalytics plugin, add my composer.json file with, I think, correct datas, but nothing appends on plugin:refresh. From the googleanalytics plugin we don't have to put the vendor/ folder insinde the plugin, so... What am I missing ?

Tiipiik
Tiipiik

It appears that we only have to install files localy for development, and marketplace does the job on plugin install (thanks to Mey).

Last updated

viral-vector
viral-vector

If i wanted to test post install scripts., how would i go about it?
I have a "scripts" definition within the composer.js of my local plugin; plugin:refresh, nor october:up seem to run the script. Any ideas?

JeffGoldblum
JeffGoldblum

For anyone that was confused like I was, what you have to do is create your composer.json file for your plugin, and then run composer update from your project root for it to pull in your plugin's composer.json file. composer install isn't enough, you have to run composer update from your project root after creating your plugin's composer.json file.

WaskiWabit
WaskiWabit

It's not impractical at all. Just because your plugin has certain dependencies does not mean your entire application should.

Last updated

1-9 of 9

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.