Why would [git push] fail to push annotated tags as well?  That just results in another disruptive layer of potential synchronization issues.  They finally added sane behavior, but you have to turn it on with:

git config --global push.followTags true

Or, use rad-scripts!  Which has [git-sync], and, as of today, always uses –follow-tags.  I’m loving my Node.js lifestyle.  😛

Node is fun!  Except when it’s not.  It’s pretty easy stuff, but I was burned by a couple things today while debugging.  Take note!

  • You can – and MUST, at times – mess with installed node modules; hack away directly at their source for instantaneous satisfaction!
    • find them here:
      • linux (always easier): ~/.npm
      • Windows: C:\Users\#name#\AppData\Roaming\npm
    • however, watch out that you follow dependencies properly; if a module requires another, it will often keep a copy underneath its folder; there may also be a global copy in the root npm folder
  • debugging is most easily accomplished by the good old-fashioned “jam in print statements” hacker methodology
    • via console.log(“WHAT IS HAPPENING!?);
  • when you grow up and want to get into serious debugging, use linux, and sling your code into the Chrome debugger, via node-inspector

There are three progressively-deeper methods of installing your node modules, all useful in their own way:

  • npm link sets up symlinks to your commands
    They will point directly to your code, which you can dynamically change to see the result.  This is best for early development.
  • npm install -g of a package with dependent modules listed on the local drive
    This will use the locally installed version of the dependent module that was also installed with [npm install -g].  Format:
"dependencies": {
  "rad-scripts": "file:///home/m/development/thedigitalage/rad-scripts"
},
  • npm install -g of a package with officially published dependent modules
    This will use the latest publicly available version of the dependent module.  In this example, the latest version above 1.0.3 will be used.  Format:
"dependencies": {
  "rad-scripts": "^1.0.3"
},

It is so easy to publish your own node modules.  I glided right through these and now have a published module of reusable scripts.

Here’s a quick summary of the lifecycle of publishing your module:

npm install -g 
# you can now test this module in another module if you use a [file:] dependency in the other module
# keep doing this until you are happy with local install
# when ready...
# update version in package.json
git commit -a -m "1.0.5"
git tag 1.0.5
git push && git push --tags  # NOTE: bitpost has a git hook to push changes all the way up to github
npm publish