Giving a greater Role to Silverstripe Sake

98 views
Skip to first unread message

Lamin Barrow

unread,
Nov 21, 2016, 5:02:47 AM11/21/16
to SilverStripe Core Development
Silverstripe's ./framework/sake is seldom used in Silverstripe except for the occasional task runner or DB build. Rails has the rails cli and laravel has the fantastic artisan cli tool. Unclecheese built "silversmith" and it had the potential to really improve the development workflow but the tool hasn't been updated in 3 years. I think there should be a discussion about giving sake a more central roles and an integral part of the Silverstripe development process. Silverstripe 4 is just around the corner so i thought i could push this forward. 

Any thoughts?

Tony Air

unread,
Nov 21, 2016, 5:13:18 AM11/21/16
to SilverStripe Core Development
I use gulp to generate less, sass, minify silverstripe templates, minify images, generate favicons and some extensions for modules.
For an instance when I use silvershop I need to extend forms to make them bootstrap ready.

So gulp script checks if there's a silvershop module at the website root and includes bootstrap styling extension for the shop into the website code.
It generates styles for the shop, templates, merges yml files and adds code extensions.

I think it's better alternative to build projects and the other things can be done with cli-tasks.

Tony Air

unread,
Nov 21, 2016, 5:21:13 AM11/21/16
to SilverStripe Core Development
I think it will be great to have different task repository as development module for an instance I have task to create typography testing page to see how it looks like in specific website design


On Monday, November 21, 2016 at 1:02:47 PM UTC+3, Lamin Barrow wrote:

Lamin Barrow

unread,
Nov 21, 2016, 5:21:30 AM11/21/16
to silverst...@googlegroups.com
I meant for giving sake a greater role.. Eg. It can be used for generating Controller, DataObject models, Pages, Templates, Module templates, build task etc. Things specific to Silverstripe. 

--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-dev+unsubscribe@googlegroups.com.
To post to this group, send email to silverstripe-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/silverstripe-dev.
For more options, visit https://groups.google.com/d/optout.



--
"Have those who disbelieved not considered that the heavens and the earth were a joined entity, and We separated them and made from water every living thing? Then will they not believe?"[Quran 21: 30]

Lamin Barrow
AKA deveSigner

Online at:
skype: barrowbros

Tony Air

unread,
Nov 21, 2016, 5:30:39 AM11/21/16
to SilverStripe Core Development

Don’t think that we need to transfer PHP coding to YML, but parsing objects to generate a template with specific object variables defined would be helpful 


On Monday, November 21, 2016 at 1:21:30 PM UTC+3, Lamin Barrow wrote:
I meant for giving sake a greater role.. Eg. It can be used for generating Controller, DataObject models, Pages, Templates, Module templates, build task etc. Things specific to Silverstripe. 
On Mon, Nov 21, 2016 at 10:13 AM, Tony Air <dark...@gmail.com> wrote:
I use gulp to generate less, sass, minify silverstripe templates, minify images, generate favicons and some extensions for modules.
For an instance when I use silvershop I need to extend forms to make them bootstrap ready.

So gulp script checks if there's a silvershop module at the website root and includes bootstrap styling extension for the shop into the website code.
It generates styles for the shop, templates, merges yml files and adds code extensions.

I think it's better alternative to build projects and the other things can be done with cli-tasks.


On Monday, November 21, 2016 at 1:02:47 PM UTC+3, Lamin Barrow wrote:
Silverstripe's ./framework/sake is seldom used in Silverstripe except for the occasional task runner or DB build. Rails has the rails cli and laravel has the fantastic artisan cli tool. Unclecheese built "silversmith" and it had the potential to really improve the development workflow but the tool hasn't been updated in 3 years. I think there should be a discussion about giving sake a more central roles and an integral part of the Silverstripe development process. Silverstripe 4 is just around the corner so i thought i could push this forward. 

Any thoughts?

--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
To post to this group, send email to silverst...@googlegroups.com.

Ingo Schommer

unread,
Nov 21, 2016, 3:54:00 PM11/21/16
to silverst...@googlegroups.com
Hey Lamin,

More "sake" tasks (and a friendlier output) would be great. I think we need to switch to a proper CLI command structure before creating more tasks though (e.g. the Symfony Console). 
SilverSmith doesn't seem to have a lot of traction (it's not even on packagist, see https://github.com/unclecheese/SilverSmith). So getting a better idea why that is might be worthwhile - talk to Aaron?
Also, spelling out the use cases for this more clearly would help. Artisan has a lot of uses, from starting VMs to creating database migrations. Which tasks are the highest value?
How practical are they? For example, you mention generating templates through tasks, I can't envision how this would look like at the moment.

Thanks
Ingo


To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-dev+unsubscribe@googlegroups.com.
To post to this group, send email to silverstripe-dev@googlegroups.com.



--
Ingo Schommer | Solutions Architect
SilverStripe (http://silverstripe.com)
DDI: 04978 7330 ext 4422
Mobile: 0221601782
Skype: chillu23

Zauberfisch

unread,
Nov 21, 2016, 10:44:27 PM11/21/16
to silverst...@googlegroups.com
I actually happen to think that sake is kind of feature complete.

The user experience certainly needs to improve, sake should feel like a
modern cli tool.

But in terms of functionality it already does everything it should: It
executes build tasks (and other things).
And in that sense, it is already extendable. You want a build task that
compiles scss? Np, just create /dev/tasks/BuildSCSS and run
"sake dev/tasks/BuildSCSS".

Here on the other hand I see need for improvements. BuildTasks certainly
could be improved. Especially performance, because the above SCSS
example would be way slower than gulp. But that's all part of BuildTask.
Not sake.

The only missing feature in sake perhaps could be "watch".

On 2016-11-21 20:53, Ingo Schommer wrote:
> Hey Lamin,
>
> More "sake" tasks (and a friendlier output) would be great. I think we
> need to switch to a proper CLI command structure before creating more
> tasks though (e.g. the Symfony Console
> <http://symfony.com/doc/current/components/console.html>).
> SilverSmith
> <https://www.silverstripe.org/blog/silversmith-reshaping-silverstripe-development/> doesn't
> seem to have a lot of traction (it's not even on packagist,
> see https://github.com/unclecheese/SilverSmith). So getting a better
> idea why that is might be worthwhile - talk to Aaron?
> Also, spelling out the use cases for this more clearly would help.
> Artisan has a lot of uses, from starting VMs to creating database
> migrations. Which tasks are the highest value?
> How practical are they? For example, you mention generating templates
> through tasks, I can't envision how this would look like at the moment.
>
> Thanks
> Ingo
>
>
> On 21 November 2016 at 23:30, Tony Air <dark...@gmail.com
> <https://groups.google.com/group/silverstripe-dev>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
>
> --
> /*"Have those who disbelieved not considered that the heavens
> and the earth were a joined entity, and We separated them and
> made from water every living thing? Then will they not
> believe?"[Quran 21: 30]*/
>
> Lamin Barrow
> AKA deveSigner
>
> Online at:
> skype: barrowbros
> https://www.lbarrow.com <http://lbarrow.com/>
> https://twitter.com/laminbarrow <http://twitter.com/laminbarrow>
>
> --
> You received this message because you are subscribed to the Google
> Groups "SilverStripe Core Development" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to silverstripe-d...@googlegroups.com
> <mailto:silverstripe-d...@googlegroups.com>.
> To post to this group, send email to
> silverst...@googlegroups.com
> <mailto:silverst...@googlegroups.com>.
> <https://groups.google.com/group/silverstripe-dev>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
>
> --
> Ingo Schommer | Solutions Architect
> SilverStripe (http://silverstripe.com)
> DDI: 04978 7330 ext 4422
> Mobile: 0221601782
> Skype: chillu23
>
> --
> You received this message because you are subscribed to the Google
> Groups "SilverStripe Core Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to silverstripe-d...@googlegroups.com
> <mailto:silverstripe-d...@googlegroups.com>.
> To post to this group, send email to silverst...@googlegroups.com
> <mailto:silverst...@googlegroups.com>.

Sam Minnée

unread,
Nov 21, 2016, 11:30:03 PM11/21/16
to silverst...@googlegroups.com
Sake pre-dates composer, and I think that if sake were to get a facelift it would make sense to re-cast it as a composer binary that gets copied to vendor/bin.

I wonder if it should be bundled with framework or maybe it should be a separate composer dependency? We could make it "suggests" on framework.

Then we could rebuild it on symfony console without worrying too much about dependency bloat.

As for feature-set, I think that it would be appropriate to decouple it a little from everything-it-does-is-a-public URL

So we could have something more like this for Zauberfisch's example:
vendor/bin/sake run BuildSCSS

And maybe there is a view-url action too:
vendor/bin/sake view-url admin/pages 


--
Ingo Schommer | Solutions Architect
SilverStripe (http://silverstripe.com)
DDI: 04978 7330 ext 4422
Mobile: 0221601782
Skype: chillu23

--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
To post to this group, send email to silverst...@googlegroups.com.
Visit this group at https://groups.google.com/group/silverstripe-dev.
For more options, visit https://groups.google.com/d/optout.
--
Sam Minnée
CEO
SilverStripe Limited

Simon Erkelens

unread,
Nov 22, 2016, 1:17:21 AM11/22/16
to SilverStripe Core Development
I know Martijn has been working on an alternative/better version:
https://github.com/axyr/silverstripe-console

Don't know what the status of that is right now though.

Lamin Barrow

unread,
Nov 22, 2016, 3:52:58 AM11/22/16
to silverst...@googlegroups.com
Something like that (https://github.com/axyr/silverstripe-console, https://github.com/axyr/silverstripe-console/blob/master/docs/en/Make.md) and this https://github.com/axyr/silverstripe-cli-installer @Simon was exactly what i had in mind. This kind of feature should i would suggest should be a core of the framework. An improved developer cli tool will increase productivity and keep developers happy because at the end of the day, Silverstripe is geared for the developers who in turn use it to build solutions that the end user uses. 

Frontend stuff is perhaps best left to developer/designer choice. There are many choices out there and gulp, webpack etc are better at it. Silverstripe 4 comes with webpack in the framework so may be that could be standardized as part of the framework similar to the rails asset pipeline or laravel elixir. 

To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-dev+unsubscribe@googlegroups.com.
To post to this group, send email to silverstripe-dev@googlegroups.com.

off...@netwerkstatt.at

unread,
Nov 22, 2016, 4:04:27 AM11/22/16
to silverst...@googlegroups.com

I  used silversmith a lot and loved it back then. But now i prefer built in features of my IDE to scaffold classes, see http://silverstrip.es/blog/easier-coding-with-phpstorm-templates/

 

So i wonder if we really need this module / class scaffolding as a core feature.

 

Cheers, Werner

Simon Erkelens

unread,
Nov 22, 2016, 4:24:47 AM11/22/16
to SilverStripe Core Development
I've poked Martijn (who is Axyr or Marvanni on IRC, for those that don't know) to make an update her and here.

Martijn

unread,
Nov 22, 2016, 5:12:58 AM11/22/16
to SilverStripe Core Development
Hi,

I wrote https://github.com/axyr/silverstripe-console which is build on top of http://symfony.com/doc/3.1/components/console.html and inspired by https://github.com/laravel/installer and https://laravel.com/docs/5.3/artisan .

At the moment I spend more time with Laravel and I use the console commands a lot. When you get more into TDD, you will notice you will spend more time on the terminal than just refreshing your browser to see if things work. I even think that in the first stage of a new project, I dont even use the browser for the first 40 hours untill I really need to do frontend work like forms and views.

The console is (can be) used for variuous tasks like
  • show statistics (routes, logs, etc)
  • perform database migrations (dev/build in Silverstripes case) or seeds.
  • running queued or background jobs
  • scaffolding
  • various maintenance tasks.
  • whatever you want that your application does, but does not need a browser (and therefore not a controller) (running spiders, sending emails, enrich collected data, whatever)

Now there are a few problems I had to make Silverstripe work well on the console and provide a 'works-out-of-the-box' experience:


Command Line can use a different PHP version than the webserver does.
Command line is run as a different user that the webserver use.

Im not sure if the is fixed already, but this is also a problem when running tests on the command line as well, because the silverstripe cache files are/were stored seperatly for different users/php versions. I had a lot of trouble switching cli and browsers, whit a lot white pages of dead.

You dont want to have the console/sake entry file in your webroot as adefault, since it is an executable file. You need to protected the file, or use a global installation, like sake works.

See the instructions I came up with:
https://github.com/axyr/silverstripe-console

In Laravel all the code lives outside the webroot and only the public directory is webaccesible, so it can provide a artisan console entry file out of the box.

Now I wrote way to much code for this module and you probably want something leaner to start with, but I agree Silverstripe can benefit from (read : should have) a decent command line interface as the web is more than browser-only readable content.

The symfony console works very well and the Laravel wrapper makes creating commands so easy that I use it a lot even for small one-time-running-tasks that I might need to perform again later on (importing legacy data from client's customers as a recent example.) So I would recommend not reinventing the wheel and check out how Laravel has done it.



Martijn

unread,
Nov 22, 2016, 5:15:42 AM11/22/16
to SilverStripe Core Development
"Sake pre-dates composer, and I think that if sake were to get a facelift it would make sense to re-cast it as a composer binary that gets copied to vendor/bin"

I think that is a nice option..

Op dinsdag 22 november 2016 05:30:03 UTC+1 schreef Sam Minnée:

Sam Minnée

unread,
Nov 22, 2016, 2:36:55 PM11/22/16
to SilverStripe Core Development
I wonder if it would be better to deprecate sake in favour of axyr's console in SS4? I haven't done a thorough review and so it might require some amendments to be appropriate as a complete replacement, but I'd prefer a few PRs than reinventing the wheel...

Tony Air

unread,
Nov 22, 2016, 2:43:28 PM11/22/16
to SilverStripe Core Development
I vote to deprecate sake and axyr's console looks like better alternative and console as external module sounds better for me

Lamin Barrow

unread,
Nov 23, 2016, 6:30:11 PM11/23/16
to silverst...@googlegroups.com
​@Sam I think that will be an excellent idea as well and It could be one of the big highlights of the 4.0 release coming soon.​

To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-dev+unsubscribe@googlegroups.com.
To post to this group, send email to silverstripe-dev@googlegroups.com.

Simon Erkelens

unread,
Nov 24, 2016, 4:06:46 AM11/24/16
to SilverStripe Core Development
+1 on integrating Martijn's work into a new, more functional and useable Sake.

Stevie Mayhew

unread,
Dec 12, 2016, 2:35:21 PM12/12/16
to SilverStripe Core Development
We've recently released a REPL for SilverStripe - https://github.com/littlegiant/sliver

Being able to extend the "new" sake to include things like this would be ideal.
Reply all
Reply to author
Forward
0 new messages