dojo / cli

:rocket: Dojo - command line tooling.
http://dojo.io
Other
25 stars 34 forks source link

Add ability to create widget boilerplate to cli #117

Closed rishson closed 7 years ago

rishson commented 7 years ago

@rishson commented on Tue Feb 07 2017

Either a new repo cli-create-widget or extend cli-create-app to be a generic boilerplate creator.

I think users will spend far more time creating widgets than they will creating apps, so it would be nice to add a boilerplate generator. Ideally, it should be useful internally as well to generate widgets in @dojo/widgets.

agubler commented 7 years ago

Is this really required now we've moved to classes? I don't think there much boilerplate.

rishson commented 7 years ago

Well create-app will probably be used a few times a year, but create-widget will be used much more I think. It could:

create: MyWidget.ts, /styles/MyWidget.css, /tests/unit/MyWidget.ts (potentially add to /unit/all.ts)

For MyWidget.ts, it could:

@theme(css)
export default class MyWidget extends MyWidgetBase<MyWidgetProperties> {

All of the above is tiresome copy/paste that we could easily automate. I know we will have to keep in sync with with widget-core but the rate of change of the authoring system should slow. Angular has good cli tools to create widgets and I think this is a decent expectation of users in other frameworks.

agubler commented 7 years ago

I really don't think currently this will provide that value you think it will.

dylans commented 7 years ago

I think users will spend far more time creating widgets than they will creating apps, so it would be nice to add a boilerplate generator.

I really don't think currently this will provide that value you think it will.

There's one way to find out (e.g. try to create the command and see what can be generalized). For what it's worth, a large part of the tutorial for creating a custom widget is to basically add these files, add boilerplate, etc., so there may be more value for beginners, and that's probably better than encouraging them to take an existing widget and copy/pasta it.

agubler commented 7 years ago

@dylans I guess so; feels like it would be something for a community style issue or one hit wonder that can be picked up when we are light on other tasks.

dylans commented 7 years ago

Sure, though it will mean a rewrite of one of the beginner tutorials... :)

agubler commented 7 years ago

This would be a new command and most likely repository, do you think the issue should be moved to meta?

kitsonk commented 7 years ago

Issue moved to dojo/meta #194 via ZenHub