Skip to content

Commit

Permalink
packaging infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
drewfish committed Mar 31, 2012
1 parent afd229b commit e279098
Show file tree
Hide file tree
Showing 10 changed files with 245 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
.DS_Store
node_modules
*.sock
4 changes: 4 additions & 0 deletions .npmignore
@@ -0,0 +1,4 @@
support
test
examples
*.sock
5 changes: 5 additions & 0 deletions Changelog.md
@@ -0,0 +1,5 @@

0.0.1 / 2010-01-03
==================

* Initial release
5 changes: 5 additions & 0 deletions Makefile
@@ -0,0 +1,5 @@

test:
@echo "populate me"

.PHONY: test
49 changes: 38 additions & 11 deletions README.txt
@@ -1,5 +1,5 @@
CRANK
a tool to update version numbers and changelogs, for npm module development
a tool to update version number and changelog, for npm module development


USAGE
Expand All @@ -19,9 +19,9 @@ INTENTIONS
* expected to be used intermixed with other commands
* focuses on what it does well
* doesn't try to do everything
* follows semantic versions
* follows semantic versioning approach
* read-only: doesn't commits files
* uses a "config" or "recipe" file
* can use a "config" or "recipe" file for advanced use cases


ASSUMPTIONS
Expand All @@ -31,37 +31,39 @@ ASSUMPTIONS


CONFIG
* not really needed if only using `crank version` and semantic versions
* defaults to "crank.json" in the cwd
* not really needed for simple use cases
* defaults to "crank.json" in the current working directory
* can be specified with a commandline argument

* target: directory to track
* defaults to cwd
* defaults to current working directory
* changelog:
* file: path on disk
* relative path is relative to the target
* formats: template format (e.g. "md", "txt")
* changedate: string
* format to use for change dates
* versiondate: string
* format to use for version dates
* template: template type, or path on disk
* defaults to file extension
* simple string taken as one of the built-in template types to use
* builtin types are "md" (markdown) and "txt" (plain text)
* otherwise, template to use
* changes:
* dateformat: string
* format to use for change dates
* filters: list of regexes to modify changes
* subject: "message", "author", "date", "changeid"
* regex: string
* replace: "string"
* if results in "--CRANK:SKIP--" then change is skipped
* versions:
* dateformat: string
* format to use for revision dates
* filters: list of regeses to modify versions
* subject: "version", "date"
* regex: string
* replace: "string"
* if results in "--CRANK:SKIP--" then version is skipped
* database -- TODO
* maps version:changeid
* only really needed by `crank changelog`
* types
* file {foo.json}
* separate json file
Expand Down Expand Up @@ -99,3 +101,28 @@ TODO
* "crank release" does all that's needed (inc commits)


LICENSE

MIT License

Copyright (C) 2012 Andrew Folta <drew@folta.net>

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


136 changes: 136 additions & 0 deletions Readme.md
@@ -0,0 +1,136 @@

# CRANK

a tool to update version number and changelog, for npm module development


# usage

crank version {part}
increments version in package.json
{part} is "major", "minor", or "patch". defaults to "patch"

crank changelog Changelog.md
updates changelog


# intentions

* used to manage a node module
* assumes package.json
* primarily to move forward into the future
* used in a build system (gmake, ant, phing, etc)
* expected to be used intermixed with other commands
* focuses on what it does well
* doesn't try to do everything
* follows semantic versioning approach
* read-only: doesn't commits files
* can use a "config" or "recipe" file for advanced use cases


# assumptions

* change ID ("revision", "commit", etc) of target applies homogeneously to all files/subdirs in target
* target is "clean" -- no modifications
* generally expected to be run when in same directory as package.json


# config

* not really needed for simple use cases
* defaults to "crank.json" in the current working directory
* can be specified with a commandline argument

* target: directory to track
* defaults to current working directory
* changelog:
* file: path on disk
* relative path is relative to the target
* template: template type, or path on disk
* defaults to file extension
* simple string taken as one of the built-in template types to use
* builtin types are "md" (markdown) and "txt" (plain text)
* otherwise, template to use
* changes:
* dateformat: string
* format to use for change dates
* filters: list of regexes to modify changes
* subject: "message", "author", "date", "changeid"
* regex: string
* replace: "string"
* if results in "--CRANK:SKIP--" then change is skipped
* versions:
* dateformat: string
* format to use for revision dates
* filters: list of regeses to modify versions
* subject: "version", "date"
* regex: string
* replace: "string"
* if results in "--CRANK:SKIP--" then version is skipped
* database -- TODO
* maps version:changeid
* only really needed by `crank changelog`
* types
* file {foo.json}
* separate json file
* changelog
* uses changelog file itself to find version:changeid pairs
* TODO: need way to pull pairs out of changelog (regex?)
* vcs-changes
* uses vcs change log to find version:changeid pairs
* TODO: need way to pull pairs out of vcs change log


# TEMPLATE

* good old mustache

* {{version}} string
* {{date}} string
* {{crankdate}} string, date that crank was run
* {{changes}} list
* {{changeid}} string
* {{date}} string
* {{author}} string
* {{message}} string


# TODO

* how do we order log entries?
* presumably just use the order returned by the vcs
but is there more to it than that?
* do we need to order versions?
* ... or otherwise compare version numbers?
* templates can have dates (of version or entry)
* ... gotten from vcs?
* log entry templates can have changeids
* encorporate ideas from https://github.com/ccare/node-release-utils
* "crank release" does all that's needed (inc commits)


# license

MIT License

Copyright (C) 2012 Andrew Folta <drew@folta.net>

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


6 changes: 6 additions & 0 deletions bin/crank
@@ -0,0 +1,6 @@


var crank = require('crank');



12 changes: 12 additions & 0 deletions lib/crank.js
@@ -0,0 +1,12 @@

/*!
* crank
* Copyright(c) 2011 Andrew Folta <drew@folta.net>
* MIT Licensed
*/

/**
* Library version.
*/

exports.version = '0.0.1';
23 changes: 23 additions & 0 deletions package.json
@@ -0,0 +1,23 @@
{
"name": "crank",
"version": "0.0.1",
"description": "tool to update version number and changelog, for npm module development",
"author": "Andrew Folta <drew@folta.net>",
"homepage": "https://github.com/drewfish/node-crank",
"keywords": [
"package", "version", "changelog", "build"
],
"repository": {
"type": "git",
"url": "git://github.com/drewfish/node-crank.git"
},
"preferGlobal": true,
"engines": {
"node": ">= 0.4.0"
},
"dependencies": {},
"main": "lib/crank",
"bin": {
"crank": "bin/crank"
}
}
13 changes: 13 additions & 0 deletions test/crank.test.js
@@ -0,0 +1,13 @@

/**
* Module dependencies.
*/

var crank = require('crank')
, should = require('should');

module.exports = {
'test .version': function(){
crank.version.should.match(/^\d+\.\d+\.\d+$/);
}
};

0 comments on commit e279098

Please sign in to comment.