makersquare / maker-console

A maker console for doing maker stuff
0 stars 2 forks source link

Gulp coffee #6

Closed danielchappell closed 10 years ago

danielchappell commented 10 years ago

Branch created to solve issue # 1 created gulp builder using gulp plugins 'gulp-coffee' and 'gulp-concat' included in this branch are the generated files in their assigned directories. Currently it is set up for all compiled files JS files to land in ./public/javascript/ which is the source for the concatenated file which lands in /production/non_minified/ assuming there would also be minified versions of the concatenated files. otherwise this could be changed. One note, you probably know this already but, gulp must be installed globally to run console commands "gulp ".

gilbert commented 10 years ago

Great effort so far. You're almost there.

danielchappell commented 10 years ago

requested changes submitted. did you want me to write the minification task as well, or should we wait on that?

danielchappell commented 10 years ago

Also I did some googling on the fact that the compiled js files ended in .js.js I didn't find any solutions to this although I every thing I looked at just had coffee files ending in .coffee anything before that is considered part of the name. So I know why it is happening, but I haven't found how to fix it, the plug-ins documentation is sparse. It doesn't seem like an issue though as long as we are always compiling and piping right into the concat function, since that function allows you to name the new file.

gilbert commented 10 years ago

Ah, so the .coffee.js is Rails asset pipeline specific. You can remove the .js from each .coffee.js file. Try writing a Ruby script or a Node script to do this automatically (you'll only need to run the script once, but it'll be good practice).

Yes, extend the task to create a minified file as well.

gilbert commented 10 years ago

The files need to be in this order:

lib/maker-console.coffee
lib/util.coffee
lib/models/
lib/views/
lib/console/

Be sure to rebase with master to get the new file.

danielchappell commented 10 years ago

Changes submitted. Used gulp-rename to keep piping in the same task and output two different files to the same directory. Used gulp-uglify for minification. Declared each file/directory in order as an array and passed as argument instead of passing in the outer directory.

gilbert commented 10 years ago

You added the lib/maker-console.coffee file manually. That's not good for git history. Next time you should:

  1. Rebase your feature branch (in this case, gulp-coffee) with master. This gets you latest changes from master and ensures your new code merges in cleanly.
  2. Force push your feature branch to GitHub. Note that while it's ok to force push a feature branch, it's not ok to do so for master.

I edited your last commit to remove the manual lib/maker-console.coffee addition, and rebased your feature branch with master.

Everything looks great otherwise. I'll merge it in now.