-
How To Run Node Apps In Docker
•
I like to use docker to run my server side apps and my node apps aren’t exception. Decided to show the docker file I use for my node apps and explain what I’m doing there. I copy the entire source, having the files I want to exclude in docker ignore file. The most important thing to note is I don’t copy node_modules directories, I do fresh install in docker. Main reason is that docker container is kinda different operating system and potentially a different distro (Debian in this instance, because I love it!) than dev or CI box. So why not build the code where it’s gonna run and if there are issues I’ll know about it sooner. Also note that I run npm install with production switch so it doesn’t install dev dependencies, which I don’t really need to run my app.
read more -
My Gulp Files: Ionic App Projects
•
For Ionic projects also I use CoffeeScript, Sass, Jade although ionic generates the project in JavaScript and Html. Here we have front-end components, compilation, browser testing, live reload, and all that goodness. Here we do need to compile CoffeScript to JavaScript, Sass to Css and Jade to Html. Another thing that needs to be solved since browser will run JavaScript, Css and html instead of CoffeScript, Jade, Sass so debugging will be really challenging. To solved that problem I generate source map files. I also use CoffeScript for my gulpfile since it makes it much more clean and compact. Some people who do that like to also create gulpfile.js file with
read more -
My Gulp Files: Library Projects
•
For this type of projects I use CoffeScript, Chai and Mocka for unit testing, Istanbul for code coverage, Sinon and Proxyquire for mocking, Jenkins for continuous integration. This type of projects are easy to build because those don’t have front-end components, compilation/optimization, browser testing, live reload etc. Here we do need to compile CoffeScript to JavaScript since we’re gonna publish the package with JavaScript code and not CoffeScript. What I do is keep my coffee code in src directory instead of lib. At compile time I generate JavaScript code into lib directory, add src directory to .npmignore and lib directory to .gitignore. That way my CoffeeScript ends up in git repo but not generated JavaScript and my JavaScript ends up in published package and not JavaScript, pretty smart right :). I also use CoffeScript for my gulpfile since it makes it much more clean and compact. Some people who do that like to also create gulpfile.js file with
read more -
My Gulp Files
•
Recently I decided to upgrade to Gulp 4 even though it’s not released yet. And since there are some breaking changes I had to go over my gulp files. I usually do three type of projects in node/js, rest apis, library projects (npm packages), ionic and angular apps. I decided to write blog posts and share my gulp files in case other will find it useful. I do like to use the most loved and hated language in node world, CoffeeScript. I sure give it some love here, not because I find JavaScript hard or don’t know how to properly scope my variables or make objects, but because I find code written in CoffeScript much more readable and maintainable (yep, all that brackets and parentheses.) Other libraries I religiously use are Chai and Mocka for unit testing, Istanbul for code coverage, Sinon and Proxyquire for mocking, Jade for templates, Sass for stylesheets and of course Jenkins for continuous integration. So this combination on it’s own makes my gulp files pretty unique. Listing links to individual posts where I have my gulp file and I’m explaining which task is doing what.
read more