Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b47311d565 | ||
|
|
810b3533dd | ||
|
|
b397ffe91f | ||
|
|
471a67fc31 | ||
|
|
557c46b8dd |
@@ -101,7 +101,7 @@ _A few notes on `npm` config_:
|
||||
|
||||
## Plugins
|
||||
|
||||
There are four steps where you can customize the `semantic-release` behavior using plugins. A plugin is a regular [option](#options), but inside the `package.json` you can pass additional config.
|
||||
There are numerous steps where you can customize `semantic-release`'s behaviour using plugins. A plugin is a regular [option](#options), but passed inside the `release` block of `package.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -151,6 +151,10 @@ This plugins is responsible for verifying that a release should happen in the fi
|
||||
|
||||
This plugin is responsible for verifying a release that was determined before and is about to be published. There is no default implementation. It additionally receives `nextRelease`, `lastRelease` and `commits` inside `config`. While `commits` is the same as with analyzeCommits, `nextRelease` contains a `type` (e.g. `'major'`) and the new version (e.g. `'1.0.0'`) and `lastRelease` contains the old `version`, the `gitHead` at the time of the release and the npm dist-`tag` (e.g. `'latest'`). Using this information you could [detect breaking changes](https://github.com/semantic-release/cracks) or hold back certain types of releases. Again: Be creative.
|
||||
|
||||
### `getLastRelease`
|
||||
|
||||
This plugin is responsible for determining a package's last release version. The [default implementation](https://github.com/semantic-release/last-release-npm) uses the last published version on a npm registry.
|
||||
|
||||
## ITYM*FAQ*LT
|
||||
> I think you might frequently ask questions like these
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
"git-head": "^1.2.1",
|
||||
"github": "^0.2.4",
|
||||
"lodash": "^3.9.3",
|
||||
"nerf-dart": "^1.0.0",
|
||||
"nopt": "^3.0.3",
|
||||
"npmconf": "^2.1.2",
|
||||
"npmlog": "^1.2.1",
|
||||
|
||||
+5
-4
@@ -52,9 +52,10 @@ npmconf.load({}, (err, conf) => {
|
||||
|
||||
const config = {PREFIX, log, env, pkg, options, plugins, npm}
|
||||
|
||||
log.verbose(PREFIX, 'options:', _.assign({
|
||||
githubToken: options.githubToken ? '***' : undefined
|
||||
}), options)
|
||||
let hide = {}
|
||||
if (options.githubToken) hide.githubToken = '***'
|
||||
|
||||
log.verbose(PREFIX, 'options:', _.assign({}, options, hide))
|
||||
log.verbose(PREFIX, 'Verifying config.')
|
||||
|
||||
const errors = require('./lib/verify')(config)
|
||||
@@ -71,7 +72,7 @@ npmconf.load({}, (err, conf) => {
|
||||
if (!options.debug) process.exit(1)
|
||||
}
|
||||
|
||||
const nerfDart = require('./lib/nerf-dart')(npm.registry)
|
||||
const nerfDart = require('nerf-dart')(npm.registry)
|
||||
let wroteNpmRc = false
|
||||
|
||||
if (env.NPM_TOKEN) {
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// borrowed from https://github.com/npm/npm/blob/master/lib/config/nerf-dart.js
|
||||
const url = require('url')
|
||||
|
||||
/* istanbul ignore next */
|
||||
module.exports = function toNerfDart (uri) {
|
||||
let parsed = url.parse(uri)
|
||||
delete parsed.protocol
|
||||
delete parsed.auth
|
||||
delete parsed.query
|
||||
delete parsed.search
|
||||
delete parsed.hash
|
||||
|
||||
return url.resolve(url.format(parsed), '.')
|
||||
}
|
||||
Reference in New Issue
Block a user