commit-message-install
Advanced tools
Comparing version 1.10.1 to 1.11.0
@@ -1,1 +0,1 @@ | ||
{"name":"commit-message-install","description":"NPM install a package by name taken from the last commit message","version":"1.10.1","author":"Gleb Bahmutov <gleb.bahmutov@gmail.com>","bugs":"https://github.com/cypress-io/commit-message-install/issues","bin":{"commit-message-install":"bin/commit-message-install.js","cmi":"bin/commit-message-install.js","run-if":"bin/commit-message-run.js"},"config":{"pre-git":{"commit-msg":"simple","pre-commit":["npm prune","npm run deps","npm test","git add src/*.js bin/*.js","npm run ban"],"pre-push":["npm run secure","npm run license","npm run ban -- --all","npm run size"],"post-commit":[],"post-merge":[]}},"engines":{"node":">=6"},"files":["bin","src/*.js","!src/*-spec.js"],"homepage":"https://github.com/cypress-io/commit-message-install#readme","keywords":["ci","commit","git","install","npm","utility"],"license":"MIT","main":"src/","publishConfig":{"registry":"http://registry.npmjs.org/"},"repository":{"type":"git","url":"https://github.com/cypress-io/commit-message-install.git"},"scripts":{"ban":"ban","deps":"deps-ok && dependency-check --no-dev .","issues":"git-issues","license":"license-checker --production --onlyunknown --csv","lint":"standard --verbose --fix src/*.js bin/*.js","prelint":"npm run pretty","pretest":"npm run lint","pretty":"echo ⚠️ disable prettier-standard 'src/*.js' 'bin/*.js'","secure":"echo disabled nsp check","size":"t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";","test":"npm run unit","unit":"mocha src/*-spec.js","semantic-release":"semantic-release pre && npm publish && semantic-release post","demo":"node bin/commit-message-run.js -f test/run-if.txt echo Foo is \\$FOO"},"release":{"verifyConditions":{"path":"condition-node-version","node":"8"},"analyzeCommits":"simple-commit-message","generateNotes":"github-post-release","verifyRelease":{"path":"dont-crack","test-against":[]}},"devDependencies":{"ban-sensitive-files":"1.9.0","common-tags":"1.5.1","condition-node-version":"1.3.0","dependency-check":"2.9.1","deps-ok":"1.2.1","dont-crack":"1.2.1","git-issues":"1.3.1","github-post-release":"1.13.1","if-node-version":"1.1.1","license-checker":"15.0.0","mocha":"4.0.1","nsp":"2.8.1","pre-git":"3.15.3","prettier-standard":"7.0.3","schema-shot":"1.9.0","semantic-release":"8.2.0","simple-commit-message":"3.3.1","snap-shot-it":"4.0.1","standard":"10.0.3","stub-spawn-once":"2.3.0"},"dependencies":{"chalk":"2.3.0","check-more-types":"2.24.0","debug":"3.1.0","execa":"0.8.0","lazy-ass":"1.6.0","minimist":"1.2.0"}} | ||
{"name":"commit-message-install","description":"NPM install a package by name taken from the last commit message","version":"1.11.0","author":"Gleb Bahmutov <gleb.bahmutov@gmail.com>","bugs":"https://github.com/cypress-io/commit-message-install/issues","bin":{"commit-message-install":"bin/commit-message-install.js","cmi":"bin/commit-message-install.js","run-if":"bin/commit-message-run.js"},"config":{"pre-git":{"commit-msg":"simple","pre-commit":["npm prune","npm run deps","npm test","git add src/*.js bin/*.js","npm run ban"],"pre-push":["npm run secure","npm run license","npm run ban -- --all","npm run size"],"post-commit":[],"post-merge":[]}},"engines":{"node":">=6"},"files":["bin","src/*.js","!src/*-spec.js"],"homepage":"https://github.com/cypress-io/commit-message-install#readme","keywords":["ci","commit","git","install","npm","utility"],"license":"MIT","main":"src/","publishConfig":{"registry":"http://registry.npmjs.org/"},"repository":{"type":"git","url":"https://github.com/cypress-io/commit-message-install.git"},"scripts":{"ban":"ban","deps":"deps-ok && dependency-check --no-dev .","issues":"git-issues","license":"license-checker --production --onlyunknown --csv","lint":"standard --verbose --fix src/*.js bin/*.js","prelint":"npm run pretty","pretest":"npm run lint","pretty":"echo ⚠️ disable prettier-standard 'src/*.js' 'bin/*.js'","secure":"echo disabled nsp check","size":"t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";","test":"npm run unit","unit":"mocha src/*-spec.js","semantic-release":"semantic-release pre && npm publish && semantic-release post","demo":"node bin/commit-message-run.js -f test/run-if.txt echo Foo is \\$FOO"},"release":{"verifyConditions":{"path":"condition-node-version","node":"8"},"analyzeCommits":"simple-commit-message","generateNotes":"github-post-release","verifyRelease":{"path":"dont-crack","test-against":[]}},"devDependencies":{"ban-sensitive-files":"1.9.0","common-tags":"1.5.1","condition-node-version":"1.3.0","dependency-check":"2.9.1","deps-ok":"1.4.1","dont-crack":"1.2.1","git-issues":"1.3.1","github-post-release":"1.13.1","if-node-version":"1.1.1","license-checker":"15.0.0","mocha":"4.0.1","nsp":"2.8.1","pre-git":"3.15.3","prettier-standard":"7.0.3","schema-shot":"1.9.0","semantic-release":"8.2.0","simple-commit-message":"3.3.1","snap-shot-it":"6.3.2","standard":"12.0.1","stub-spawn-once":"2.3.0"},"dependencies":{"chalk":"2.4.2","check-more-types":"2.24.0","debug":"4.1.1","execa":"0.8.0","lazy-ass":"1.6.0","minimist":"1.2.0"}} |
@@ -10,2 +10,3 @@ # commit-message-install | ||
[![js-standard-style][standard-image]][standard-url] | ||
[![renovate-app badge][renovate-badge]][renovate-app] | ||
@@ -146,2 +147,12 @@ ## Install | ||
### npmInstall | ||
After getting JSON from a commit message you can install dependencies | ||
```js | ||
const {getInstallJson, npmInstall} = require('commit-message-install') | ||
getInstallJson() | ||
.then(npmInstall) | ||
``` | ||
## Debugging | ||
@@ -198,1 +209,3 @@ | ||
[standard-url]: http://standardjs.com/ | ||
[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg | ||
[renovate-app]: https://renovateapp.com/ |
@@ -7,4 +7,10 @@ const la = require('lazy-ass') | ||
const isStatus = is.schema({ | ||
owner: is.unemptyString, | ||
repo: is.unemptyString, | ||
sha: is.commitId | ||
}) | ||
// forms JSON object that can be parsed later | ||
function getInstallJson (packages, env, platform, branch, commit) { | ||
function getInstallJson (packages, env, platform, branch, commit, status) { | ||
if (!env) { | ||
@@ -46,2 +52,7 @@ env = {} | ||
if (status) { | ||
la(isStatus(status), 'invalid status object', status) | ||
json.status = status | ||
} | ||
la( | ||
@@ -48,0 +59,0 @@ isNpmInstall(json), |
const is = require('check-more-types') | ||
const la = require('lazy-ass') | ||
@@ -10,4 +11,28 @@ // to install multiple packages, use comma-separated list | ||
/** | ||
* Returns given string surrounded by ```json + ``` quotes | ||
* @param {string} s | ||
*/ | ||
const toJsonCodeBlock = (s) => { | ||
const start = '```json' | ||
const finish = '```' | ||
return `${start}\n${s}\n${finish}\n` | ||
} | ||
/** | ||
* Converts given JSON object into markdown text block | ||
* @param {object} object | ||
*/ | ||
const toMarkdownJsonBlock = (object) => { | ||
la(object, 'expected an object to convert to JSON', object) | ||
const str = JSON.stringify(object, null, 2) | ||
return toJsonCodeBlock(str) | ||
} | ||
module.exports = { | ||
isNpmInstall | ||
isNpmInstall, | ||
toJsonCodeBlock, | ||
toMarkdownJsonBlock | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18942
367
209
+ Addedchalk@2.4.2(transitive)
+ Addeddebug@4.1.1(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedms@2.1.3(transitive)
+ Addedsupports-color@5.5.0(transitive)
- Removedchalk@2.3.0(transitive)
- Removeddebug@3.1.0(transitive)
- Removedhas-flag@2.0.0(transitive)
- Removedms@2.0.0(transitive)
- Removedsupports-color@4.5.0(transitive)
Updatedchalk@2.4.2
Updateddebug@4.1.1