So I have unity all along the coding front. But there is still the question of the workflow. I use TextMate. That is working for me. Fortunately, people write bundles for it which is what makes it very useful. With luck, that will continue to be the case.
I use git via GitHub, but mostly from a graphical client. I started with GitHub for Mac which was really easy to use. But I am currently liking GitBox as it is closer to the metal, as they say. I feel like I am seeing the command line commands and I do feel more comfortable with git command line. It also allows me to see the remote changes before I pull, which is a very nice feature.
Coding in node.js, I use NPM. Until recently, I was a basic consumer:
npm install whatever. When I realized that I should extract a module from my project, I looked around for a way to do that. I tried git submodule. It seemed a reasonable idea. It met with failure. The general setup of node modules is npm now. But even more so, I find git itself to be a bit difficult at times and submodules seem to be at the difficult part. Removing them was complicated. I also was getting confused as to where to edit the submodules. Keeping the stand-alone clone up to date with the embedded one was a silly process.
I began to look again. And then I found it. npm has a command called
link. Go to the directory of your stand-alone module and run npm link. This makes a symbolic link with the global install registry. In the project directory, now repeat link but with the module name. So if eventingfunctions is my module, I first do
npm link in the eventingfunctions directory. Next, let’s say that the project is
webapp. Then go to webapp’s root directory and type
npm link eventingfunctions. In the node_module directory, eventingfunctions should appear. As you make changes in the stand-alone, they are instantly reflected in the linked directory; they are symbolic links, after all.
To set webapp to install all its dependencies with the single command, use
npm install. This will only work with a package.json being present in the working directory. Use
npm init to create a basic package.json and use
npm help json to get some guidance on that file. Getting the versioning correct does require some guidance.
Having cleaned up that mess1, I am now quite pleased with npm as a way of managing not only published projects, but my own.
I also learned about global versus local installs in npm. The recommendation is that command line apps should be global
npm install -g while modules used inside a project using
reuire() should be installed locally. If doing both, install it both ways.
I did, however, have to modify one of the files in one of the npm projects. I am not sure the best way to handle it. I guess I will just write a script to run after an update to make the changes.
My next challenge is to get my blogs out of WordPress and into GitHub. I am pretty sure I will be using markdown for the blog entries (this is written in markdown) via pandoc and probably using json templates for a templating engine. My plan is to make a static site generator using those tool and then publish my blogs on GitHub Pages. For images, I am thinking I will put them on my DropBox account and link to them from there.
The choice of markdown is easy since it is simple to learn and consistently chosen in the node community as well as GitHub. The choice of json templates is harder as it has little community wide acceptance. However, having read the author’s thoughts on why, I tend to agree. Namely, it is declarative, minimal, and JSON. I like all of that. But we shall see.
git mergetoolhelped after I deleted the submodules without first pulling other conflicting changes ↩