Note that there are some explanatory texts on larger screens.

plurals
  1. PONode.js project layout for build/test vs. Deployment
    primarykey
    data
    text
    <p>I'm working on my first Cloud Foundry project (...and first Node.js project, and first MongoDB project, and first "express" project, etc. etc...)</p> <p>On day one I found this question, and used the answer as a jumping off point for the organization of my github repository:</p> <p><a href="https://stackoverflow.com/questions/5178334/folder-structure-for-a-nodejs-project">Folder structure for a Node.js project</a></p> <p>There is a <code>/node_modules</code> directory which is not checked in. Rather it is created automatically by <code>npm install</code> based on the specification in a <code>package.json</code> file. Okay, good...I made that file.</p> <p><i>(Note: During a <code>vmc push</code>, it seems there is no examination of the package.json file by the pushed-to server. It seems to merely copy over the node_modules directory and does nothing if it doesn't exist...so it's necessary to do the <code>npm install</code> on your client and THEN push.)</i></p> <p>I've got some basics working in my application, and am now at the point where I'd like to begin laying down testing and building infrastructure. For instance: I'd like a build process that will run linting on all my JavaScript. There's a continuous integration library called <a href="https://github.com/dsimard/ready.js" rel="nofollow noreferrer">ready.js</a> that looks like an up-to-date build tool...</p> <p>But something feels wrong about being in my project's directory and doing <code>npm install ready.js</code>. This means that more stuff will be going into the <code>/node_modules</code> directory and uploaded to the cloud, when it's not intended to run on the cloud. By the same token: if I have a build process that's doing minification of resources (or whatever) then I don't want the source being deployed with <code>vmc push</code> either.</p> <p>I know all this is new...but is there a convention to dump the targets into a build directory and push from there? Or does everyone push from what is effectively the github root, and just push all the builds and tests along as well? Any tips are welcome...methods to use, methods to avoid...</p> <p><strong>UPDATE</strong>: I found an application boilerplate for using express and Node.js (as well as several other common modules), which does its "build process" inside the server code's javascript...for better or worse:</p> <p><a href="https://github.com/mape/node-express-boilerplate" rel="nofollow noreferrer">https://github.com/mape/node-express-boilerplate</a></p> <p>I also found this, and it seems like combining the term "boilerplate" with names of modules you'd like to see incorporated into the structure is a good search strategy for finding the sort of thing I am looking for:</p> <p><a href="https://github.com/swbiggart/node-express-requirejs-backbone" rel="nofollow noreferrer">https://github.com/swbiggart/node-express-requirejs-backbone</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload