From 060312caf4f214063ec06778cad119c8f847a556 Mon Sep 17 00:00:00 2001 From: Stoeffel Date: Thu, 9 Jul 2015 07:19:57 +0200 Subject: [PATCH 01/20] escape script --- .doxie.render.js | 10 ++++++++-- README.md | 19 +++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.doxie.render.js b/.doxie.render.js index 67213d4..65d4eaf 100644 --- a/.doxie.render.js +++ b/.doxie.render.js @@ -1,3 +1,9 @@ +function escapeStr(str) { + return str + .replace(/\"/g, '\\\\"') + .replace(/\n/g, '\\\\n'); +} + var render = function(data) { var data = data.data; @@ -6,9 +12,9 @@ var render = function(data) { '', data.description, '', - '```js', + '```json', '"scripts": {', - ' "' + data.key + '": "' + data.script + '"', + ' "' + data.key + '": "' + escapeStr(data.script) + '"', '}', '```', '\n' diff --git a/README.md b/README.md index 3f09627..269e0b4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Publish a minor release of a package -```js +```json "scripts": { "minor-release": "npm version patch && npm publish && git push --follow-tags" } @@ -16,7 +16,7 @@ Publish a minor release of a package Publish a patch release of a package -```js +```json "scripts": { "patch-release": "npm version patch && npm publish && git push --follow-tags" } @@ -26,7 +26,7 @@ Publish a patch release of a package Publish a major release of a package -```js +```json "scripts": { "major-release": "npm version major && npm publish && git push --follow-tags" } @@ -36,10 +36,9 @@ Publish a major release of a package Clean your git repo state. All dirty files will be moved to the stash. It’s useful when transpiling code before publishing to NPM. -```js +```json "scripts": { - "clean-up": "git reset && echo '/node_modules/' > .gitignore && git add .gitignore && git stash save --include-untracked --keep-index '`npm run clean-up` trash can' && git clean --force -d && git reset --hard && echo ' -clean-up: All unstaged and ignored files within your git repo – except node_modules/* – have been moved to the stash. To restore them run `git stash pop --quiet; git checkout .gitignore`." + "clean-up": "git reset && echo '/node_modules/' > .gitignore && git add .gitignore && git stash save --include-untracked --keep-index '`npm run clean-up` trash can' && git clean --force -d && git reset --hard && echo '\\nclean-up: All unstaged and ignored files within your git repo – except node_modules/* – have been moved to the stash. To restore them run `git stash pop --quiet; git checkout .gitignore`." } ``` @@ -47,7 +46,7 @@ clean-up: All unstaged and ignored files within your git repo – except node_mo Bower install before npm -```js +```json "scripts": { "postinstall": "bower install" } @@ -57,7 +56,7 @@ Bower install before npm Pushs a folder (f.e. `docs`) to the `gh-pages` branch. -```js +```json "scripts": { "update-gh-pages": "git push origin `git subtree split --prefix docs master`:gh-pages --force" } @@ -67,7 +66,7 @@ Pushs a folder (f.e. `docs`) to the `gh-pages` branch. Watch JS files and run `npm test` on every change. Remember to `npm install --save-dev nodangel` before using this. -```js +```json "scripts": { "develop": "nodangel --ignore node_modules --ignore coverage --exec 'npm run --silent test'" } @@ -77,7 +76,7 @@ Watch JS files and run `npm test` on every change. Remember to `npm install --sa Make the package.json more diff-friendly. Remember to `npm install --save-dev format-json mve` before adding this script. Add `"postversion": "npm run diffy-package"` as well to auto-format the package file after a version bump. Add `"postinstall": "npm run diffy-package"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`. -```js +```json "scripts": { "diffy-package": "format-json package.json > .temp; mve .temp package.json" } From ec1805284e456a80c0957f6c2a9d5ca84d87cb5d Mon Sep 17 00:00:00 2001 From: Tomek Wiszniewski Date: Thu, 9 Jul 2015 09:18:48 +0200 Subject: [PATCH 02/20] Some helpful messages --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 97b2137..563340e 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,10 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "precommit": "npm run create-readme && git add README.md", - "create-readme": "doxie --render < ./scripts.json --inject into README.md", - "create-toc": "doxie --render .doxie.render.toc.js < ./scripts.json --inject into README.md as toc", - "generate": "npm run create-readme; npm run create-toc" + "precommit": "npm run update-readme && git add README.md", + "update-readme": "echo 'Updating the readme…'; doxie --render < ./scripts.json --inject into README.md && echo '…done!'", + "update-toc": "echo 'Updating the table of contents…'; doxie --render .doxie.render.toc.js < ./scripts.json --inject into README.md as toc && echo '…done!'", + "generate": "npm run update-readme; npm run update-toc" }, "repository": { "type": "git", From 4572ee4c52f769d218b003ac3c42a8dd490b033d Mon Sep 17 00:00:00 2001 From: Tomek Wiszniewski Date: Thu, 9 Jul 2015 09:19:08 +0200 Subject: [PATCH 03/20] Update the TOC as well --- README.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 35a58ab..b4aa58f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ * [Bower postinstall](https://github.com/npm-scripts/scripts#Bower postinstall) * [gh-pages](https://github.com/npm-scripts/scripts#gh-pages) * [develop](https://github.com/npm-scripts/scripts#develop) -* [Diffy JSON](https://github.com/npm-scripts/scripts#Diffy JSON) +* [diffy-package](https://github.com/npm-scripts/scripts#diffy-package) diff --git a/package.json b/package.json index 563340e..92d2ead 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "precommit": "npm run update-readme && git add README.md", + "precommit": "npm run generate && git add README.md", "update-readme": "echo 'Updating the readme…'; doxie --render < ./scripts.json --inject into README.md && echo '…done!'", "update-toc": "echo 'Updating the table of contents…'; doxie --render .doxie.render.toc.js < ./scripts.json --inject into README.md as toc && echo '…done!'", "generate": "npm run update-readme; npm run update-toc" From 339a8eb658337eee51f214c03a6903ef75754aba Mon Sep 17 00:00:00 2001 From: Tomek Wiszniewski Date: Thu, 9 Jul 2015 09:21:28 +0200 Subject: [PATCH 04/20] One backslash is fine, so it seems --- .doxie.render.js | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.doxie.render.js b/.doxie.render.js index 65d4eaf..9c5d4b3 100644 --- a/.doxie.render.js +++ b/.doxie.render.js @@ -1,7 +1,7 @@ function escapeStr(str) { return str - .replace(/\"/g, '\\\\"') - .replace(/\n/g, '\\\\n'); + .replace(/\"/g, '\\"') + .replace(/\n/g, '\\n'); } var render = function(data) { diff --git a/README.md b/README.md index b4aa58f..c9ba518 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Clean your git repo state. All dirty files will be moved to the stash. It’s us ```json "scripts": { - "clean-up": "git reset && echo '/node_modules/' > .gitignore && git add .gitignore && git stash save --include-untracked --keep-index '`npm run clean-up` trash can' && git clean --force -d && git reset --hard && echo '\\nclean-up: All unstaged and ignored files within your git repo – except node_modules/* – have been moved to the stash. To restore them run `git stash pop --quiet; git checkout .gitignore`." + "clean-up": "git reset && echo '/node_modules/' > .gitignore && git add .gitignore && git stash save --include-untracked --keep-index '`npm run clean-up` trash can' && git clean --force -d && git reset --hard && echo '\nclean-up: All unstaged and ignored files within your git repo – except node_modules/* – have been moved to the stash. To restore them run `git stash pop --quiet; git checkout .gitignore`." } ``` From 506abb6f891689170e3e501f6b167b59372e4847 Mon Sep 17 00:00:00 2001 From: James Kyle Date: Sun, 12 Jul 2015 16:12:24 -0700 Subject: [PATCH 05/20] Fix releases --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c9ba518..7134ec8 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ -* [minor-release](https://github.com/npm-scripts/scripts#minor-release) * [patch-release](https://github.com/npm-scripts/scripts#patch-release) +* [minor-release](https://github.com/npm-scripts/scripts#minor-release) * [major-release](https://github.com/npm-scripts/scripts#major-release) * [clean-up](https://github.com/npm-scripts/scripts#clean-up) * [Bower postinstall](https://github.com/npm-scripts/scripts#Bower postinstall) @@ -19,23 +19,23 @@ -## minor-release +## patch-release -Publish a minor release of a package +Publish a patch release of a package ```json "scripts": { - "minor-release": "npm version patch && npm publish && git push --follow-tags" + "patch-release": "npm version patch && npm publish && git push --follow-tags" } ``` -## patch-release +## minor-release -Publish a patch release of a package +Publish a minor release of a package ```json "scripts": { - "patch-release": "npm version patch && npm publish && git push --follow-tags" + "minor-release": "npm version minor && npm publish && git push --follow-tags" } ``` From 57ab9ab5d42178a3a6c2595977776e817d9879eb Mon Sep 17 00:00:00 2001 From: James Kyle Date: Mon, 13 Jul 2015 00:42:17 -0700 Subject: [PATCH 06/20] Update scripts.json --- scripts.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts.json b/scripts.json index 3209c04..abff43e 100644 --- a/scripts.json +++ b/scripts.json @@ -1,8 +1,8 @@ [ { - "title": "minor-release", - "description": "Publish a minor release of a package", - "key": "minor-release", + "title": "patch-release", + "description": "Publish a patch release of a package", + "key": "patch-release", "script": "npm version patch && npm publish && git push --follow-tags", "keywords": [ "npm", @@ -11,10 +11,10 @@ "publish" ] }, { - "title": "patch-release", - "description": "Publish a patch release of a package", - "key": "patch-release", - "script": "npm version patch && npm publish && git push --follow-tags", + "title": "minor-release", + "description": "Publish a minor release of a package", + "key": "minor-release", + "script": "npm version minor && npm publish && git push --follow-tags", "keywords": [ "npm", "release", From d67428a146b027aaa529d5f5312fbf47cb07b370 Mon Sep 17 00:00:00 2001 From: Eugene Sharygin Date: Wed, 15 Jul 2015 02:27:44 +0300 Subject: [PATCH 07/20] Avoid creating temporary files --- README.md | 4 ++-- scripts.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7134ec8..83bf9e0 100644 --- a/README.md +++ b/README.md @@ -91,11 +91,11 @@ Watch JS files and run `npm test` on every change. Remember to `npm install --sa ## diffy-package -Make the package.json more diff-friendly. Remember to `npm install --save-dev format-json mve` before adding this script. Add `"postversion": "npm run diffy-package"` as well to auto-format the package file after a version bump. Add `"postinstall": "npm run diffy-package"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`. +Make the package.json more diff-friendly. Remember to `npm install --save-dev format-json sponge` before adding this script. Add `"postversion": "npm run diffy-package"` as well to auto-format the package file after a version bump. Add `"postinstall": "npm run diffy-package"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`. ```json "scripts": { - "diffy-package": "format-json package.json > .temp; mve .temp package.json" + "diffy-package": "format-json package.json | sponge package.json" } ``` diff --git a/scripts.json b/scripts.json index abff43e..833617c 100644 --- a/scripts.json +++ b/scripts.json @@ -74,9 +74,9 @@ ] }, { "title": "diffy-package", - "description": "Make the package.json more diff-friendly. Remember to `npm install --save-dev format-json mve` before adding this script. Add `\"postversion\": \"npm run diffy-package\"` as well to auto-format the package file after a version bump. Add `\"postinstall\": \"npm run diffy-package\"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`.", + "description": "Make the package.json more diff-friendly. Remember to `npm install --save-dev format-json sponge` before adding this script. Add `\"postversion\": \"npm run diffy-package\"` as well to auto-format the package file after a version bump. Add `\"postinstall\": \"npm run diffy-package\"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`.", "key": "diffy-package", - "script": "format-json package.json > .temp; mve .temp package.json", + "script": "format-json package.json | sponge package.json", "keywords": [ "npm", "pretty", From e382cea37173a70ed88bbce7a0734aa13b9d354b Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Wed, 15 Jul 2015 16:05:50 +0530 Subject: [PATCH 08/20] Made it private. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 92d2ead..f2b16e8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "scripts", "version": "1.0.0", "description": "collection of npm scripts", - "main": "index.js", + "private": true, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "precommit": "npm run generate && git add README.md", From 4a27fafe6658d98395bbc91cd8178ca08a889a3a Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 15 Jul 2015 17:12:57 +0530 Subject: [PATCH 09/20] Fixes #14 --- contributing.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 contributing.md diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..2363625 --- /dev/null +++ b/contributing.md @@ -0,0 +1,28 @@ +## Easy steps: + +* Clone this [repo](https://github.com/npm-scripts/scripts.git): + ```sh + $ git clone https://github.com/npm-scripts/scripts.git + ``` + +* Install the deps: + ```sh + $ cd scripts && npm install + ``` + +* Edit [scripts.json](./scripts.json) to add your script in the below format: + +```js +{ + "title": "", + "description": "", + "key": "", + "script": "", + "keywords": [ + "npm", + " Date: Wed, 15 Jul 2015 19:10:05 +0530 Subject: [PATCH 10/20] s/clone/fork/g --- contributing.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/contributing.md b/contributing.md index 2363625..daedaae 100644 --- a/contributing.md +++ b/contributing.md @@ -1,9 +1,6 @@ ## Easy steps: -* Clone this [repo](https://github.com/npm-scripts/scripts.git): - ```sh - $ git clone https://github.com/npm-scripts/scripts.git - ``` +* [Fork](https://github.com/npm-scripts/scripts/network) the repo. * Install the deps: ```sh From e3268787e52956bb93a1e48103afe909d544abdd Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 16 Jul 2015 10:39:33 +0530 Subject: [PATCH 11/20] Slugified title. --- .doxie.render.toc.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.doxie.render.toc.js b/.doxie.render.toc.js index 644b595..550bab3 100644 --- a/.doxie.render.toc.js +++ b/.doxie.render.toc.js @@ -1,9 +1,19 @@ var scripts = require('./scripts.json'); +// from https://gist.github.com/mathewbyrne/1280286 +slugify = function(text){ + return text.toString().toLowerCase() + .replace(/\s+/g, '-') // Replace spaces with - + .replace(/[^\w\-]+/g, '') // Remove all non-word chars + .replace(/\-\-+/g, '-') // Replace multiple - with single - + .replace(/^-+/, '') // Trim - from start of text + .replace(/-+$/, ''); // Trim - from end of text +} + var render = function(data) { var data = data.data; - var out = '* [' + data.title + '](https://github.com/npm-scripts/scripts#' + data.title + ')\n'; + var out = '* [' + data.title + '](https://github.com/npm-scripts/scripts#' + slugify(data.title) + ')\n'; if (scripts[scripts.length -1].title === data.title) out = out + '\n'; return out; From 91632aee9631e2160e014adf393cfcde4b4970ae Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 16 Jul 2015 10:40:49 +0530 Subject: [PATCH 12/20] Regen readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83bf9e0..c1e4a43 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ * [minor-release](https://github.com/npm-scripts/scripts#minor-release) * [major-release](https://github.com/npm-scripts/scripts#major-release) * [clean-up](https://github.com/npm-scripts/scripts#clean-up) -* [Bower postinstall](https://github.com/npm-scripts/scripts#Bower postinstall) +* [Bower postinstall](https://github.com/npm-scripts/scripts#bower-postinstall) * [gh-pages](https://github.com/npm-scripts/scripts#gh-pages) * [develop](https://github.com/npm-scripts/scripts#develop) * [diffy-package](https://github.com/npm-scripts/scripts#diffy-package) From babd7489783682273281849eb6f52e8d3d219332 Mon Sep 17 00:00:00 2001 From: Christoph Hermann Date: Mon, 20 Jul 2015 22:19:56 +0200 Subject: [PATCH 13/20] use doxie.appen --- .doxie.render.toc.js | 3 --- package.json | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.doxie.render.toc.js b/.doxie.render.toc.js index 550bab3..b076e52 100644 --- a/.doxie.render.toc.js +++ b/.doxie.render.toc.js @@ -1,5 +1,3 @@ -var scripts = require('./scripts.json'); - // from https://gist.github.com/mathewbyrne/1280286 slugify = function(text){ return text.toString().toLowerCase() @@ -15,7 +13,6 @@ var render = function(data) { var out = '* [' + data.title + '](https://github.com/npm-scripts/scripts#' + slugify(data.title) + ')\n'; - if (scripts[scripts.length -1].title === data.title) out = out + '\n'; return out; }; diff --git a/package.json b/package.json index f2b16e8..eeb12e0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "test": "echo \"Error: no test specified\" && exit 1", "precommit": "npm run generate && git add README.md", "update-readme": "echo 'Updating the readme…'; doxie --render < ./scripts.json --inject into README.md && echo '…done!'", - "update-toc": "echo 'Updating the table of contents…'; doxie --render .doxie.render.toc.js < ./scripts.json --inject into README.md as toc && echo '…done!'", + "update-toc": "echo 'Updating the table of contents…'; doxie --render .doxie.render.toc.js < ./scripts.json --append '\n' --inject into README.md as toc && echo '…done!'", "generate": "npm run update-readme; npm run update-toc" }, "repository": { @@ -30,6 +30,7 @@ "homepage": "https://github.com/npm-scripts/scripts#readme", "devDependencies": { "doxie": "^0.2.2", + "doxie.append": "^0.1.0", "doxie.inject": "^0.1.1", "doxie.output": "^0.3.0", "doxie.render": "^0.3.0", From 2bd12160ade34c71e45f0c710df010893c1d96ae Mon Sep 17 00:00:00 2001 From: Christoph Hermann Date: Sat, 8 Aug 2015 08:05:40 +0200 Subject: [PATCH 14/20] add dependencies array closes #11 closes npm-scripts/meta/issues/3 --- contributing.md | 3 +++ scripts.json | 25 ++++++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/contributing.md b/contributing.md index daedaae..8158552 100644 --- a/contributing.md +++ b/contributing.md @@ -18,6 +18,9 @@ "keywords": [ "npm", " Date: Sat, 8 Aug 2015 08:15:26 +0200 Subject: [PATCH 15/20] render the dependencies --- .doxie.render.js | 14 ++++++++++++-- README.md | 13 +++++++++++-- scripts.json | 4 ++-- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.doxie.render.js b/.doxie.render.js index 9c5d4b3..2ce154d 100644 --- a/.doxie.render.js +++ b/.doxie.render.js @@ -7,7 +7,7 @@ function escapeStr(str) { var render = function(data) { var data = data.data; - return [ + var doc = [ '## ' + data.title, '', data.description, @@ -17,8 +17,18 @@ var render = function(data) { ' "' + data.key + '": "' + escapeStr(data.script) + '"', '}', '```', + '\n', + ]; + + if (data.dependencies.length > 0) { + + doc = doc.concat([ + 'Install the dependencies `npm i ' + data.dependencies.join(' ') + ' --save-dev`', '\n' - ].join('\n'); + ]); + } + + return doc.join('\n'); }; module.exports = render; diff --git a/README.md b/README.md index c1e4a43..72a42a2 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,9 @@ Bower install before npm } ``` + +Install the dependencies `npm i bower --save-dev` + ## gh-pages Pushs a folder (f.e. `docs`) to the `gh-pages` branch. @@ -81,7 +84,7 @@ Pushs a folder (f.e. `docs`) to the `gh-pages` branch. ## develop -Watch JS files and run `npm test` on every change. Remember to `npm install --save-dev nodangel` before using this. +Watch JS files and run `npm test` on every change. Remember to install the dependencies before using this. ```json "scripts": { @@ -89,9 +92,12 @@ Watch JS files and run `npm test` on every change. Remember to `npm install --sa } ``` + +Install the dependencies `npm i nodangel --save-dev` + ## diffy-package -Make the package.json more diff-friendly. Remember to `npm install --save-dev format-json sponge` before adding this script. Add `"postversion": "npm run diffy-package"` as well to auto-format the package file after a version bump. Add `"postinstall": "npm run diffy-package"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`. +Make the package.json more diff-friendly. Remember to install the dependencies before adding this script. Add `"postversion": "npm run diffy-package"` as well to auto-format the package file after a version bump. Add `"postinstall": "npm run diffy-package"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`. ```json "scripts": { @@ -99,5 +105,8 @@ Make the package.json more diff-friendly. Remember to `npm install --save-dev fo } ``` + +Install the dependencies `npm i format-json sponge --save-dev` + diff --git a/scripts.json b/scripts.json index 639ca9d..c786902 100644 --- a/scripts.json +++ b/scripts.json @@ -73,7 +73,7 @@ "dependencies": [] }, { "title": "develop", - "description": "Watch JS files and run `npm test` on every change. Remember to `npm install --save-dev nodangel` before using this.", + "description": "Watch JS files and run `npm test` on every change. Remember to install the dependencies before using this.", "key": "develop", "script": "nodangel --ignore node_modules --ignore coverage --exec 'npm run --silent test'", "keywords": [ @@ -85,7 +85,7 @@ ] }, { "title": "diffy-package", - "description": "Make the package.json more diff-friendly. Remember to `npm install --save-dev format-json sponge` before adding this script. Add `\"postversion\": \"npm run diffy-package\"` as well to auto-format the package file after a version bump. Add `\"postinstall\": \"npm run diffy-package\"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`.", + "description": "Make the package.json more diff-friendly. Remember to install the dependencies before adding this script. Add `\"postversion\": \"npm run diffy-package\"` as well to auto-format the package file after a version bump. Add `\"postinstall\": \"npm run diffy-package\"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`.", "key": "diffy-package", "script": "format-json package.json | sponge package.json", "keywords": [ From 74f57f1952bac0967a12b9af640026e458054207 Mon Sep 17 00:00:00 2001 From: Christoph Hermann Date: Sat, 8 Aug 2015 15:01:24 +0200 Subject: [PATCH 16/20] adds git push --follow-tags --- README.md | 11 +++++++++++ scripts.json | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/README.md b/README.md index 72a42a2..182fb29 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ * [gh-pages](https://github.com/npm-scripts/scripts#gh-pages) * [develop](https://github.com/npm-scripts/scripts#develop) * [diffy-package](https://github.com/npm-scripts/scripts#diffy-package) +* [push tags](https://github.com/npm-scripts/scripts#push-tags) @@ -108,5 +109,15 @@ Make the package.json more diff-friendly. Remember to install the dependencies b Install the dependencies `npm i format-json sponge --save-dev` +## push tags + +Git push relevant annotated tags when pushing branches out. + +```json +"scripts": { + "push": "git push --follow-tags" +} +``` + diff --git a/scripts.json b/scripts.json index c786902..ac772c7 100644 --- a/scripts.json +++ b/scripts.json @@ -97,5 +97,15 @@ "format-json", "sponge" ] + }, { + "title": "push tags", + "description": "Git push relevant annotated tags when pushing branches out.", + "key": "push", + "script": "git push --follow-tags", + "keywords": [ + "git", + "push" + ], + "dependencies": [] } ] From d2ce6f3cfa0e4006521c84c356366cf39e73b692 Mon Sep 17 00:00:00 2001 From: Christoph Hermann Date: Sun, 9 Aug 2015 16:30:13 +0200 Subject: [PATCH 17/20] make dependencies optional --- .doxie.render.js | 2 +- scripts.json | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.doxie.render.js b/.doxie.render.js index 2ce154d..8eee622 100644 --- a/.doxie.render.js +++ b/.doxie.render.js @@ -20,7 +20,7 @@ var render = function(data) { '\n', ]; - if (data.dependencies.length > 0) { + if (data.dependencies && data.dependencies.length > 0) { doc = doc.concat([ 'Install the dependencies `npm i ' + data.dependencies.join(' ') + ' --save-dev`', diff --git a/scripts.json b/scripts.json index ac772c7..737760a 100644 --- a/scripts.json +++ b/scripts.json @@ -9,8 +9,7 @@ "release", "push", "publish" - ], - "dependencies": [] + ] }, { "title": "minor-release", "description": "Publish a minor release of a package", @@ -21,8 +20,7 @@ "release", "push", "publish" - ], - "dependencies": [] + ] }, { "title": "major-release", "description": "Publish a major release of a package", @@ -33,8 +31,7 @@ "release", "push", "publish" - ], - "dependencies": [] + ] }, { "title": "clean-up", "description": "Clean your git repo state. All dirty files will be moved to the stash. It’s useful when transpiling code before publishing to NPM.", @@ -46,8 +43,7 @@ "push", "publish", "clean" - ], - "dependencies": [] + ] }, { "title": "Bower postinstall", "description": "Bower install before npm", @@ -69,8 +65,7 @@ "keywords": [ "npm", "gh-pages" - ], - "dependencies": [] + ] }, { "title": "develop", "description": "Watch JS files and run `npm test` on every change. Remember to install the dependencies before using this.", @@ -105,7 +100,6 @@ "keywords": [ "git", "push" - ], - "dependencies": [] + ] } ] From 1e0da94d2216a12cd852f8e5e619434abf6e43b3 Mon Sep 17 00:00:00 2001 From: Christoph Hermann Date: Fri, 4 Sep 2015 07:39:01 +0200 Subject: [PATCH 18/20] fix typo --- contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing.md b/contributing.md index 8158552..9aaae67 100644 --- a/contributing.md +++ b/contributing.md @@ -19,7 +19,7 @@ "npm", " Date: Fri, 4 Sep 2015 15:25:47 +1000 Subject: [PATCH 19/20] add changelog script --- README.md | 14 ++++++++++++++ scripts.json | 11 +++++++++++ 2 files changed, 25 insertions(+) diff --git a/README.md b/README.md index 182fb29..a8c6fc5 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ * [develop](https://github.com/npm-scripts/scripts#develop) * [diffy-package](https://github.com/npm-scripts/scripts#diffy-package) * [push tags](https://github.com/npm-scripts/scripts#push-tags) +* [changelog](https://github.com/npm-scripts/scripts#changelog) @@ -119,5 +120,18 @@ Git push relevant annotated tags when pushing branches out. } ``` +## changelog + +Generate a changelog from git metadata. + +```json +"scripts": { + "conventional-changelog": "conventional-changelog -p angular -i CHANGELOG.md -w" +} +``` + + +Install the dependencies `npm i conventional-changelog --save-dev` + diff --git a/scripts.json b/scripts.json index 737760a..43e32e7 100644 --- a/scripts.json +++ b/scripts.json @@ -101,5 +101,16 @@ "git", "push" ] + }, { + "title": "changelog", + "description": "Generate a changelog from git metadata.", + "key": "conventional-changelog", + "script": "conventional-changelog -p angular -i CHANGELOG.md -w", + "keywords": [ + "changelog" + ], + "dependencies": [ + "conventional-changelog" + ] } ] From 32562bf00f44055e2b8a07b5b6810d76275e750b Mon Sep 17 00:00:00 2001 From: Steve Mao Date: Fri, 4 Sep 2015 15:29:32 +1000 Subject: [PATCH 20/20] add github-release script --- README.md | 14 ++++++++++++++ scripts.json | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/README.md b/README.md index a8c6fc5..e888212 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ * [diffy-package](https://github.com/npm-scripts/scripts#diffy-package) * [push tags](https://github.com/npm-scripts/scripts#push-tags) * [changelog](https://github.com/npm-scripts/scripts#changelog) +* [github-release](https://github.com/npm-scripts/scripts#github-release) @@ -133,5 +134,18 @@ Generate a changelog from git metadata. Install the dependencies `npm i conventional-changelog --save-dev` +## github-release + +Make a new GitHub release from git metadata. + +```json +"scripts": { + "conventional-github-releaser": "conventional-github-releaser -p angular" +} +``` + + +Install the dependencies `npm i conventional-github-releaser --save-dev` + diff --git a/scripts.json b/scripts.json index 43e32e7..d48afab 100644 --- a/scripts.json +++ b/scripts.json @@ -112,5 +112,17 @@ "dependencies": [ "conventional-changelog" ] + }, { + "title": "github-release", + "description": "Make a new GitHub release from git metadata.", + "key": "conventional-github-releaser", + "script": "conventional-github-releaser -p angular", + "keywords": [ + "changelog", + "github-release" + ], + "dependencies": [ + "conventional-github-releaser" + ] } ] pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy