Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add shorthands to builder #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add shorthands to builder #151

wants to merge 1 commit into from

Conversation

ianstormtaylor
Copy link
Contributor

this way people don't have to always build up with internal plugins to build the native types that are defined in the spec. makes it trivial to do..

builder.scripts(function (err, build) {
  write('build.js', build.scripts);
});

builder.styles(function (err, build) {
  write('build.css', build.styles);
});

@ianstormtaylor
Copy link
Contributor Author

also added an all method since that will probably be a pretty common one for simple build steps.

builder.all(__dirname + '/build', function (err, build) {
  write('build.js', build.scripts);
  write('build.css', build.styles);
});

@yields
Copy link
Contributor

yields commented Jan 21, 2014

i'm +1 but the this inside the shorthand methods is weird IMHO.

@ianstormtaylor
Copy link
Contributor Author

we could put it inside builder.js if we wanted, but i was thinking it gets kinda verbose and their less core to the logic there. for prior art, protos.js and statics.js are the same idea in component/model

* Mixin shorthands.
*/

for (var key in shorthands) Builder.prototype[key] = shorthands[key];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proto ftw

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or do we use that already above somewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah we dont i dont think. seems weird though to set the shorthands as the proto?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants