Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "rlsr", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "create npm releses and changelogs from a multi repo", | ||
@@ -10,5 +10,6 @@ "main": "src/index.js", | ||
"scripts": { | ||
"start": "node ./bin/rlsr pre", | ||
"pre": "node ./bin/rlsr pre", | ||
"perform": "node ./bin/rlsr perform", | ||
"c": "git-cz", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "jest" | ||
}, | ||
@@ -19,3 +20,8 @@ "repository": { | ||
}, | ||
"keywords": ["npm", "release", "changelog", "conventional-changelog"], | ||
"keywords": [ | ||
"npm", | ||
"release", | ||
"changelog", | ||
"conventional-changelog" | ||
], | ||
"author": "Matthias Reis", | ||
@@ -25,6 +31,8 @@ "license": "MIT", | ||
"commitizen": "2.9.6", | ||
"cz-conventional-changelog": "2.0.0" | ||
"cz-conventional-changelog": "2.0.0", | ||
"jest": "^19.0.2" | ||
}, | ||
"dependencies": { | ||
"conventional-commits-parser": "1.3.0", | ||
"git-latest-semver-tag": "^1.0.2", | ||
"git-raw-commits": "1.1.2", | ||
@@ -41,3 +49,6 @@ "git-semver-tags": "1.1.2", | ||
} | ||
}, | ||
"rlsr": { | ||
"verbose": true | ||
} | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
// task runner | ||
const path = require('path'); | ||
const R = require('ramda'); | ||
@@ -13,6 +13,4 @@ const npmlog = require('npmlog'); | ||
const run = (cmd, debug = false) => { | ||
if (debug) { | ||
npmlog.level = 'verbose'; | ||
} | ||
// task runner | ||
const run = (cmd) => { | ||
if (COMMANDS.indexOf(cmd) === -1) { | ||
@@ -24,5 +22,11 @@ err('rlsr', 'Please run one of the following commands'); | ||
const runner = require(`./runners/${cmd}`); | ||
const appRoot = process.cwd(); | ||
const pkg = require(path.join(appRoot, 'package.json')); | ||
if (pkg[NAME].verbose) { | ||
npmlog.level = 'verbose'; | ||
} | ||
inf('rlsr')(`command <${cmd}>`); | ||
runner({ | ||
runner(Object.assign({}, pkg[NAME], { | ||
dbg: dbg(`${NAME} ${cmd}`), | ||
@@ -32,6 +36,7 @@ err: err(`${NAME} ${cmd}`), | ||
nsp: NAME, | ||
version: pkg.version, | ||
appRoot: process.cwd() | ||
}); | ||
})); | ||
}; | ||
module.exports = run; |
@@ -58,3 +58,3 @@ const R = require('ramda'); | ||
.then(packages => { | ||
R.values(packages).forEach(updateVersionNumber(env.nsp)); | ||
R.values(packages).forEach(updateVersionNumber(env.nsp, packages)); | ||
return packages; | ||
@@ -61,0 +61,0 @@ }) |
module.exports = (nsp, pkgs) => pkg => { | ||
const informRelated = (msg, relatedPackageName) => { | ||
pkgs[relatedPackageName][nsp].relatedMessages.push(msg); | ||
pkgs[relatedPackageName][nsp].relations.forEach(pkgName => informRelated(msg, pkgName)); | ||
// no recursion - only direct relations are bumped | ||
// pkgs[relatedPackageName][nsp].relations.forEach(pkgName => informRelated(msg, pkgName)); | ||
}; | ||
@@ -6,0 +7,0 @@ |
module.exports = nsp => pkg => Object.assign({}, pkg, {[nsp]: { | ||
file: pkg[nsp].file, | ||
shouldBePublished: pkg[nsp].determinedIncrementLevel > -1 | ||
file: pkg[nsp].file | ||
}}); |
@@ -5,4 +5,4 @@ const commits = require('git-raw-commits'); | ||
const BREAKING_REGEXP = /BREAKING/; | ||
const PATCH_TYPES = ['fix', 'style', 'perf', 'revert']; | ||
const BREAKING_REGEXP = /BREAKING/i; | ||
const PATCH_TYPES = ['fix', 'refactor', 'perf', 'revert']; | ||
const MINOR_TYPES = ['feat']; | ||
@@ -9,0 +9,0 @@ |
const R = require('ramda'); | ||
const bump = require('./bump'); | ||
module.exports = nsp => pkg => { | ||
const incrementLevelThroughRelation = pkg[nsp].relatedMessages.length > -1 ? 0 : -1; | ||
module.exports = (nsp, packages) => pkg => { | ||
const incrementLevelThroughRelation = pkg[nsp].relatedMessages.length > 0 ? 0 : -1; | ||
const incrementLevelsThroughMessages = pkg[nsp].messages.map(msg => msg.level); | ||
@@ -11,2 +11,6 @@ | ||
pkg.version = bump(pkg.version, pkg[nsp].determinedIncrementLevel); | ||
pkg[nsp].relations.forEach(rel => { | ||
const relatedPackage = packages[rel]; | ||
relatedPackage.dependencies[pkg.name] = pkg.version; | ||
}); | ||
}; |
@@ -6,2 +6,3 @@ const fs = require('fs'); | ||
delete pkg[nsp].file; | ||
delete pkg[nsp]; | ||
fs.writeFile(dest, JSON.stringify(pkg, null, 2), (err) => { | ||
@@ -8,0 +9,0 @@ if (err) { |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
207581
244
6185
2
8
3
38
53
+ Addedgit-latest-semver-tag@^1.0.2
+ Addedgit-latest-semver-tag@1.0.2(transitive)