-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(gen): Generate node and Gruntfile with coffeescript #265
Conversation
Add build pipleline to handle coffee across whole stack Closes #92
@ccolleyh worked on this with me as well. |
@@ -46,15 +47,7 @@ module.exports = function (grunt) { | |||
url: 'http://localhost:<%%= express.options.port %>' | |||
} | |||
}, | |||
watch: {<% if (coffee) { %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have Gruntfile.coffee for coffeescript now, so we don't need coffee checks. We can assume you are using js if you are in Gruntfile.js and cs if you are in Gruntfile.coffee.
Any chance you have had been able to look at this @DaftMonk? |
Haven't had a chance to look at this yet, but I will after releasing 2.0 |
@burtonjc does this work when you try |
Also, I noticed the |
Thanks @thgil, I will update the pr when I get a chance. |
Thanks, this PR saved me so much time! |
Not sure if this comment should go here, on another issue or in a new issue... ? I guess a lot of this PR code is redundant now as a lot has changed for V2. Seems a few issues #59 #92 #296 are calling for CoffeeScript for the server app and to my mind this feature would make the generator 100% perfect. Is anyone else working on it at the moment? If so, need help? and if not, wanna help me? 😄 I guess we need:
Anything else? |
Hi, I'm cleaning up client-side |
After looking at server side it seems like adding Any thoughts? cc: @darryl-snow @DaftMonk @JaKXz @burtonjc(if still interested?) |
Unfortunately Coffeescript > javascript compiling is quite ugly, and I would be surprised if a javascript prettifier would help. :( |
Agree. JS code would definitely lose a lot of it's clarity... Assuming that's a blocker - I can PR with additional how do I handle double-conditions?
I've already started here, any review would be awesome. For now it's just syntax rewrite w/o any other process changes. @DaftMonk what's your view on that? ¹ - that's actually good |
I just implemented server side coffeescript support in my app, and it's a nightmare. Grunt is currently using My suggestion would be leaving coffeescript server side support until My way of making it work is so terrible that I'd rather not share ;P. |
@chester1000 Sad to hear it didn't work out, but thanks for taking the time to try it. |
It did work out, but I ended up doing things that aren't... well... good practices. And I definitely wouldn't recommend doing them here ;) |
Ok, seems like this grunt nightmare is just a fallback if So it might actually work:
Steps to enable server-side coffee support:
express:
options:
port: process.env.PORT or 9000
opts: ['node_modules/.bin/coffee']
dev:
options:
script: 'server/app.coffee'
debug: true
prod:
options:
script: 'dist/server/app.coffee'
@DaftMonk can you merge #392 to Also, how about creating
¹ - That's the file I'm currently using (contains |
Wish I started looking at this project sooner, I may have a solution... @DaftMonk was absolutely right:
But ever noticed how you can go to js2coffee.org and the ugliest javascript comes out looking like nice coffeescript? I think that's our best bet - use grunt-js2coffee to produce .coffee files out of .js files: Note: I tried grabbing app.js from the generator, and running js2coffee on it, and it complained because of the |
I'm no coffee fan, but I do use |
As a coffee fan, I can vote for js2coffee. The output isn't perfect, but it's really not that bad - certainly better than the other way around. If we can figure it out, it would save us all time, we'd just have to write well written JS instead of well written JS & CS. 😉 |
@chester1000 thanks for your suggestion, it works well on my computer and CI. For Heroku, I changed the npm start command to |
I'm a real fan of this feature being integrated. +1 |
This is above my head, but just wanted to signal how welcome this will be |
Would like this as well. |
I would like to see this integrated as well. @chester1000 , do you have an up-to-date branch with the changes you proposed for the meanwhile? |
How about making the server side in coffee, convert to js when required and only when the js output is unreadable provide a manual js version that is kept up-to-date manually? I think most of the output will be ok... |
+1 |
bump |
Anything else needed to be done on this? I can help out if needed. |
I create new generator for server-side coffee script. |
Add build pipleline to handle coffee across whole stack
Closes #92