Revisit :target names #1285

robwierzbowski opened this Issue Feb 6, 2014 · 8 comments


None yet
3 participants

As @eddiemonge mentioned here, now that grunt server is grunt serve, it would make sense to make all :server targets :serve. This might be a good time to talk about target names in general too.

One of the things my coworkers found confusing about Yeoman is the :dist target name.

  • grunt serve[r] matches :serve[r], but - grunt build doesn't match :dist
  • yeoman.dist is configurable (although I don't think this feature is used 99% of the time), but :dist targets are hard coded.
  • tasks that need only one target are called :dist. This convention got me more than one eye roll, and makes it a little harder to follow the serve or build task paths through the config object. It's not obvious if a task target belongs to the serve task, the build task, or both.

I think we should switch all :server targets to :serve and all dist targets to :build. :build matches the standard Yeoman workflow more closely, and users with multiple build processes will be editing the Gruntfile anyways.

Not sure there are easy answers to the third point. :both is probably better than :all, but not sure if either is the best way to make the task flow clear.


sindresorhus commented Feb 6, 2014

👍 I'm all for making it clearer. dist is my fault, it was just picked on random as naming is hard.

robwierzbowski referenced this issue in rileyjshaw/generator-jekyllrb Mar 12, 2014

Simplify autoprefixer flow
Merge :dist and :server into single :files task that checks both /concat and /<%= cssDir %> (turns out this was the main problem in #78)

I tested the changes locally, but you'll probably want to test a full build with the changes.

addyosmani commented Mar 19, 2014

I'm 👍 on this change too. For the time being, PRs welcome :)

Cool. Still on OSS contribution vacation, but I'll get back into it soon.


sindresorhus commented Jul 18, 2014

@robwierzbowski Just wondering if you're still interested? No worries if not :)

I am, but five things at a time. This would be number 6 :).


sindresorhus commented Jul 18, 2014

@robwierzbowski I kinda know what you mean :p


sindresorhus commented Sep 23, 2014

Closing for lack of activity. I think we've changed most of our generators, but if not, please do open tickets in the relevant issue trackers ;)

NP, sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment