Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

packaging infrastructure

  • Loading branch information...
commit e2790986f43473fd9e5d44e568749d0a06a97219 1 parent afd229b
Drew Folta authored March 31, 2012
3  .gitignore
... ...
@@ -0,0 +1,3 @@
  1
+.DS_Store
  2
+node_modules
  3
+*.sock
4  .npmignore
... ...
@@ -0,0 +1,4 @@
  1
+support
  2
+test
  3
+examples
  4
+*.sock
5  Changelog.md
Source Rendered
... ...
@@ -0,0 +1,5 @@
  1
+
  2
+0.0.1 / 2010-01-03
  3
+==================
  4
+
  5
+  * Initial release
5  Makefile
... ...
@@ -0,0 +1,5 @@
  1
+
  2
+test:
  3
+	@echo "populate me"
  4
+
  5
+.PHONY: test
49  README.txt
... ...
@@ -1,5 +1,5 @@
1 1
 CRANK
2  
-    a tool to update version numbers and changelogs, for npm module development
  2
+    a tool to update version number and changelog, for npm module development
3 3
 
4 4
 
5 5
 USAGE
@@ -19,9 +19,9 @@ INTENTIONS
19 19
         * expected to be used intermixed with other commands
20 20
         * focuses on what it does well
21 21
         * doesn't try to do everything
22  
-    * follows semantic versions
  22
+    * follows semantic versioning approach
23 23
     * read-only:  doesn't commits files
24  
-    * uses a "config" or "recipe" file
  24
+    * can use a "config" or "recipe" file for advanced use cases
25 25
 
26 26
 
27 27
 ASSUMPTIONS
@@ -31,30 +31,31 @@ ASSUMPTIONS
31 31
 
32 32
 
33 33
 CONFIG
34  
-    * not really needed if only using `crank version` and semantic versions
35  
-    * defaults to "crank.json" in the cwd
  34
+    * not really needed for simple use cases
  35
+    * defaults to "crank.json" in the current working directory
  36
+    * can be specified with a commandline argument
36 37
 
37 38
     * target:  directory to track
38  
-        * defaults to cwd
  39
+        * defaults to current working directory
39 40
     * changelog:
40 41
         * file:     path on disk
41 42
             * relative path is relative to the target
42  
-        * formats:   template format (e.g. "md", "txt")
43  
-            * changedate:  string
44  
-                * format to use for change dates
45  
-            * versiondate:  string
46  
-                * format to use for version dates
47 43
         * template: template type, or path on disk
48 44
             * defaults to file extension
49 45
             * simple string taken as one of the built-in template types to use
  46
+                * builtin types are "md" (markdown) and "txt" (plain text)
50 47
             * otherwise, template to use
51 48
         * changes:
  49
+            * dateformat: string
  50
+                * format to use for change dates
52 51
             * filters:  list of regexes to modify changes
53 52
                 * subject: "message", "author", "date", "changeid"
54 53
                 * regex: string
55 54
                 * replace: "string"
56 55
                     * if results in "--CRANK:SKIP--" then change is skipped
57 56
         * versions:
  57
+            * dateformat: string
  58
+                * format to use for revision dates
58 59
             * filters:  list of regeses to modify versions
59 60
                 * subject: "version", "date"
60 61
                 * regex: string
@@ -62,6 +63,7 @@ CONFIG
62 63
                     * if results in "--CRANK:SKIP--" then version is skipped
63 64
     * database -- TODO
64 65
         * maps version:changeid
  66
+        * only really needed by `crank changelog`
65 67
         * types
66 68
             * file {foo.json}
67 69
                 * separate json file
@@ -99,3 +101,28 @@ TODO
99 101
     * "crank release" does all that's needed (inc commits)
100 102
 
101 103
 
  104
+LICENSE
  105
+
  106
+    MIT License
  107
+
  108
+    Copyright (C) 2012 Andrew Folta <drew@folta.net>
  109
+
  110
+    Permission is hereby granted, free of charge, to any person obtaining a
  111
+    copy of this software and associated documentation files (the "Software"),
  112
+    to deal in the Software without restriction, including without limitation
  113
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
  114
+    and/or sell copies of the Software, and to permit persons to whom the
  115
+    Software is furnished to do so, subject to the following conditions:
  116
+
  117
+    The above copyright notice and this permission notice shall be included in
  118
+    all copies or substantial portions of the Software.
  119
+
  120
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  121
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  122
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  123
+    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  124
+    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  125
+    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  126
+    DEALINGS IN THE SOFTWARE.
  127
+
  128
+
136  Readme.md
Source Rendered
... ...
@@ -0,0 +1,136 @@
  1
+
  2
+# CRANK
  3
+
  4
+a tool to update version number and changelog, for npm module development
  5
+
  6
+
  7
+# usage
  8
+
  9
+    crank version {part}
  10
+        increments version in package.json
  11
+        {part} is "major", "minor", or "patch".  defaults to "patch"
  12
+
  13
+    crank changelog Changelog.md
  14
+        updates changelog
  15
+
  16
+
  17
+# intentions
  18
+
  19
+    * used to manage a node module
  20
+        * assumes package.json
  21
+    * primarily to move forward into the future
  22
+    * used in a build system (gmake, ant, phing, etc)
  23
+        * expected to be used intermixed with other commands
  24
+        * focuses on what it does well
  25
+        * doesn't try to do everything
  26
+    * follows semantic versioning approach
  27
+    * read-only:  doesn't commits files
  28
+    * can use a "config" or "recipe" file for advanced use cases
  29
+
  30
+
  31
+# assumptions
  32
+
  33
+    * change ID ("revision", "commit", etc) of target applies homogeneously to all files/subdirs in target
  34
+    * target is "clean" -- no modifications
  35
+    * generally expected to be run when in same directory as package.json
  36
+
  37
+
  38
+# config
  39
+
  40
+    * not really needed for simple use cases
  41
+    * defaults to "crank.json" in the current working directory
  42
+    * can be specified with a commandline argument
  43
+
  44
+    * target:  directory to track
  45
+        * defaults to current working directory
  46
+    * changelog:
  47
+        * file:     path on disk
  48
+            * relative path is relative to the target
  49
+        * template: template type, or path on disk
  50
+            * defaults to file extension
  51
+            * simple string taken as one of the built-in template types to use
  52
+                * builtin types are "md" (markdown) and "txt" (plain text)
  53
+            * otherwise, template to use
  54
+        * changes:
  55
+            * dateformat: string
  56
+                * format to use for change dates
  57
+            * filters:  list of regexes to modify changes
  58
+                * subject: "message", "author", "date", "changeid"
  59
+                * regex: string
  60
+                * replace: "string"
  61
+                    * if results in "--CRANK:SKIP--" then change is skipped
  62
+        * versions:
  63
+            * dateformat: string
  64
+                * format to use for revision dates
  65
+            * filters:  list of regeses to modify versions
  66
+                * subject: "version", "date"
  67
+                * regex: string
  68
+                * replace: "string"
  69
+                    * if results in "--CRANK:SKIP--" then version is skipped
  70
+    * database -- TODO
  71
+        * maps version:changeid
  72
+        * only really needed by `crank changelog`
  73
+        * types
  74
+            * file {foo.json}
  75
+                * separate json file
  76
+            * changelog
  77
+                * uses changelog file itself to find version:changeid pairs
  78
+                * TODO:  need way to pull pairs out of changelog (regex?)
  79
+            * vcs-changes
  80
+                * uses vcs change log to find version:changeid pairs
  81
+                * TODO:  need way to pull pairs out of vcs change log
  82
+
  83
+
  84
+# TEMPLATE
  85
+
  86
+    * good old mustache
  87
+
  88
+    * {{version}} string
  89
+    * {{date}} string
  90
+    * {{crankdate}} string, date that crank was run
  91
+    * {{changes}} list
  92
+        * {{changeid}} string
  93
+        * {{date}} string
  94
+        * {{author}} string
  95
+        * {{message}} string
  96
+
  97
+
  98
+# TODO
  99
+
  100
+    * how do we order log entries?
  101
+        * presumably just use the order returned by the vcs
  102
+            but is there more to it than that?
  103
+    * do we need to order versions?
  104
+    * ... or otherwise compare version numbers?
  105
+    * templates can have dates (of version or entry)
  106
+        * ... gotten from vcs?
  107
+    * log entry templates can have changeids
  108
+    * encorporate ideas from https://github.com/ccare/node-release-utils
  109
+    * "crank release" does all that's needed (inc commits)
  110
+
  111
+
  112
+# license
  113
+
  114
+    MIT License
  115
+
  116
+    Copyright (C) 2012 Andrew Folta <drew@folta.net>
  117
+
  118
+    Permission is hereby granted, free of charge, to any person obtaining a
  119
+    copy of this software and associated documentation files (the "Software"),
  120
+    to deal in the Software without restriction, including without limitation
  121
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
  122
+    and/or sell copies of the Software, and to permit persons to whom the
  123
+    Software is furnished to do so, subject to the following conditions:
  124
+
  125
+    The above copyright notice and this permission notice shall be included in
  126
+    all copies or substantial portions of the Software.
  127
+
  128
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  129
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  130
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  131
+    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  132
+    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  133
+    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  134
+    DEALINGS IN THE SOFTWARE.
  135
+
  136
+
6  bin/crank
... ...
@@ -0,0 +1,6 @@
  1
+
  2
+
  3
+var crank = require('crank');
  4
+
  5
+
  6
+
12  lib/crank.js
... ...
@@ -0,0 +1,12 @@
  1
+
  2
+/*!
  3
+ * crank
  4
+ * Copyright(c) 2011 Andrew Folta <drew@folta.net>
  5
+ * MIT Licensed
  6
+ */
  7
+
  8
+/**
  9
+ * Library version.
  10
+ */
  11
+
  12
+exports.version = '0.0.1';
23  package.json
... ...
@@ -0,0 +1,23 @@
  1
+{
  2
+    "name": "crank",
  3
+    "version": "0.0.1",
  4
+    "description": "tool to update version number and changelog, for npm module development",
  5
+    "author": "Andrew Folta <drew@folta.net>",
  6
+    "homepage": "https://github.com/drewfish/node-crank",
  7
+    "keywords": [
  8
+        "package", "version", "changelog", "build"
  9
+    ],
  10
+    "repository": {
  11
+        "type": "git",
  12
+        "url": "git://github.com/drewfish/node-crank.git"
  13
+    },
  14
+    "preferGlobal": true,
  15
+    "engines": {
  16
+        "node": ">= 0.4.0"
  17
+    },
  18
+    "dependencies": {},
  19
+    "main": "lib/crank",
  20
+    "bin": {
  21
+        "crank": "bin/crank"
  22
+    }
  23
+}
13  test/crank.test.js
... ...
@@ -0,0 +1,13 @@
  1
+
  2
+/**
  3
+ * Module dependencies.
  4
+ */
  5
+
  6
+var crank = require('crank')
  7
+  , should = require('should');
  8
+
  9
+module.exports = {
  10
+  'test .version': function(){
  11
+    crank.version.should.match(/^\d+\.\d+\.\d+$/);
  12
+  }
  13
+};

0 notes on commit e279098

Please sign in to comment.
Something went wrong with that request. Please try again.