GithubHelp home page GithubHelp logo

Comments (5)

jackhq avatar jackhq commented on June 10, 2024

Hey Ben,

Thanks again for checking out express-coffee, I will be glad to add back the Cakefile and add some documentation on how to use either approach.

Thanks

Tom

from express-coffee.

benissimo avatar benissimo commented on June 10, 2024

Thanks Tom. I find your "server.js" (which loads app.coffee directly) very useful as an example of how to develop using .coffee files directly (without need to recompile, yet also without need to run node via "coffee" or "nodemon" binary). But I also find the Cakefile useful as an example of how to compile to .js. Compiling is useful for deployment, obviously. But it's also useful just for debugging and running tests. Ultimately I'd want my tests to be running against the compiled js, so if a test generates an error, I can find the exact line number where it blew up. And so as to be sure I'm testing something as close as possible to what gets deployed.

from express-coffee.

twilson63 avatar twilson63 commented on June 10, 2024

Hey Ben,

I agree, I have been working on a Cakefile that starts the server, and watches for changes and rebuilds the application.

I think it is an interesting idea, to have a Cakefile that does all three separately or within one common command:

ex

#> Compile Source
cake complile 

#> Run Server
cake server

#> Run Test
cake test

#> All Three
cake run

That way everyone could use the workflow they prefer. The cool thing about the the cake run, is when a file changes it could restart the server and re-run the tests automatically.

If you think this is a good idea, I will work it into the project.

from express-coffee.

benissimo avatar benissimo commented on June 10, 2024

That makes sense. One other option that can be useful during development is to run nodemon, which if you provide a .nodemonignore file can be set to restart the server anytime a change occurs, even to the .coffee files (so you don't even need to compile). nodemon can evaluate coffee files directly or could process server.js. FYI there's an issue with coffee's "watch" option such that it doesn't work effectively if the files get edited via Textmate. There's a ticket already open on it, apparently it's a problem with how the "fs" library works. Since I develop with Textmate, that's currently making me opt for things like nodemon where I can bypass the issue of "coffee -w".

One last thought, just brainstorming, but if the Cakefile tasks were namespaced, that'd make it easier to copy them into other projects' Cakefiles, making them more portable. There's a dearth of good examples of Cakefile tasks out there.

from express-coffee.

twilson63 avatar twilson63 commented on June 10, 2024

Added Cakefile back in 1.4 with watch and supervisor, so in dev mode you can run:

cake dev

But in production deploy with no coffee-script dependencies

from express-coffee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.