Skip to content

Commit a93c39e

Browse files
committed
Bump mustache.js version via npm script instead of git pre-commit hook
Primarily because installing `git` hooks are easy to forget for maintainers, whilst telling `npm` to do something as a consequence of `$ npm version <patch | minor | major>` is seamless. Also worth mentioning we what we used to do in the pre-commit hook script is now greatly simplified as we don't want to have the build output and/or the `.min.js` in git anymore. Therefore, as long as we've bumped the version number in the source code, we're basically done, after having amended that change into the git commit the `npm` CLI creates.
1 parent 2061046 commit a93c39e

3 files changed

Lines changed: 4 additions & 35 deletions

File tree

hooks/install-hooks.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"test-render": "mocha --reporter spec test/render-test",
3636
"pre-test-browser": "node test/create-browser-suite.js",
3737
"test-browser": "npm run pre-test-browser && zuul -- test/context-test.js test/parse-test.js test/scanner-test.js test/render-test-browser.js",
38-
"test-browser-local": "npm run pre-test-browser && zuul --local 8080 -- test/context-test.js test/scanner-test.js test/parse-test.js test/render-test-browser.js"
38+
"test-browser-local": "npm run pre-test-browser && zuul --local 8080 -- test/context-test.js test/scanner-test.js test/parse-test.js test/render-test-browser.js",
39+
"postversion": "scripts/bump-version-in-source"
3940
},
4041
"devDependencies": {
4142
"chai": "^3.4.0",
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,9 @@ class Bumper
3333

3434
# if bumped, do extra stuff and notify the user
3535
if @bumped
36+
`git add mustache.js`
37+
`git commit --amend --no-edit`
3638

37-
# keep .mjs & .js|.min.js in sync
38-
puts "> building and minifying `mustache.mjs`..."
39-
`npm run build`
40-
41-
# stage files for commit
42-
`git add package.json`
43-
@sources.each {|source| `git add #{source.path}`}
44-
`git add mustache.min.js`
45-
`git commit -m ":ship: bump to version #{@target_v}"`
46-
47-
# notify codemonkey
48-
puts "staged bumped files and created commit"
4939
puts_c 32, "successfully bumped version to #{@target_v}!"
5040
puts_c 33, "don't forget to `npm publish`!"
5141
end

0 commit comments

Comments
 (0)