git-semver-tags 1.3.2 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/LICENSE.md +21 -0
  3. package/cli.js +16 -18
  4. package/index.js +30 -30
  5. package/package.json +14 -12
package/CHANGELOG.md CHANGED
@@ -3,6 +3,38 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ <a name="1.3.6"></a>
7
+ ## [1.3.6](https://github.com/conventional-changelog/conventional-changelog/compare/git-semver-tags@1.3.5...git-semver-tags@1.3.6) (2018-03-27)
8
+
9
+
10
+
11
+
12
+ **Note:** Version bump only for package git-semver-tags
13
+
14
+ <a name="1.3.5"></a>
15
+ ## [1.3.5](https://github.com/conventional-changelog/conventional-changelog/compare/git-semver-tags@1.3.4...git-semver-tags@1.3.5) (2018-03-22)
16
+
17
+
18
+
19
+
20
+ **Note:** Version bump only for package git-semver-tags
21
+
22
+ <a name="1.3.4"></a>
23
+ ## [1.3.4](https://github.com/conventional-changelog/conventional-changelog/compare/git-semver-tags@1.3.3...git-semver-tags@1.3.4) (2018-02-24)
24
+
25
+
26
+
27
+
28
+ **Note:** Version bump only for package git-semver-tags
29
+
30
+ <a name="1.3.3"></a>
31
+ ## [1.3.3](https://github.com/conventional-changelog/conventional-changelog/compare/git-semver-tags@1.3.2...git-semver-tags@1.3.3) (2018-02-20)
32
+
33
+
34
+
35
+
36
+ **Note:** Version bump only for package git-semver-tags
37
+
6
38
  <a name="1.3.2"></a>
7
39
  ## [1.3.2](https://github.com/stevemao/git-semver-tags/compare/git-semver-tags@1.3.1...git-semver-tags@1.3.2) (2018-02-13)
8
40
 
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ ### MIT License
2
+
3
+ Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/cli.js CHANGED
@@ -1,28 +1,26 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- var meow = require('meow');
4
- var gitSemverTags = require('./');
2
+ 'use strict'
3
+ var meow = require('meow')
4
+ var gitSemverTags = require('./')
5
5
 
6
- var args = meow({
7
- help: [
8
- 'Usage',
9
- ' git-semver-tags',
10
- 'Options',
11
- ' --lerna parse lerna style git tags',
12
- ' --package when listing lerna style tags, filter by a package',
13
- ' --tagPrefix prefix to remove from the tags during their processing'
14
- ]
15
- });
6
+ var args = meow(`
7
+ Usage
8
+ git-semver-tags
9
+ Options
10
+ --lerna parse lerna style git tags
11
+ --package when listing lerna style tags, filter by a package
12
+ --tagPrefix prefix to remove from the tags during their processing`
13
+ )
16
14
 
17
- gitSemverTags(function(err, tags) {
15
+ gitSemverTags(function (err, tags) {
18
16
  if (err) {
19
- console.error(err.toString());
20
- process.exit(1);
17
+ console.error(err.toString())
18
+ process.exit(1)
21
19
  }
22
20
 
23
- console.log(tags.join('\n'));
21
+ console.log(tags.join('\n'))
24
22
  }, {
25
23
  lernaTags: args.flags.lerna,
26
24
  package: args.flags.package,
27
25
  tagPrefix: args.flags.tagPrefix
28
- });
26
+ })
package/index.js CHANGED
@@ -1,58 +1,58 @@
1
- 'use strict';
1
+ 'use strict'
2
2
 
3
- var exec = require('child_process').exec;
4
- var semverValid = require('semver').valid;
5
- var regex = /tag:\s*(.+?)[,\)]/gi;
6
- var cmd = 'git log --decorate --no-color';
3
+ var exec = require('child_process').exec
4
+ var semverValid = require('semver').valid
5
+ var regex = /tag:\s*(.+?)[,)]/gi
6
+ var cmd = 'git log --decorate --no-color'
7
7
 
8
- function lernaTag(tag, pkg) {
8
+ function lernaTag (tag, pkg) {
9
9
  if (pkg && !(new RegExp('^' + pkg + '@')).test(tag)) {
10
- return false;
10
+ return false
11
11
  } else {
12
- return /^.+@[0-9]+\.[0-9]+\.[0-9]+(-.+)?$/.test(tag);
12
+ return /^.+@[0-9]+\.[0-9]+\.[0-9]+(-.+)?$/.test(tag)
13
13
  }
14
14
  }
15
15
 
16
- module.exports = function(callback, opts) {
17
- opts = opts || {};
16
+ module.exports = function (callback, opts) {
17
+ opts = opts || {}
18
18
 
19
19
  if (opts.package && !opts.lernaTags) {
20
- callback(Error('opts.package should only be used when running in lerna mode'));
21
- return;
20
+ callback(Error('opts.package should only be used when running in lerna mode'))
21
+ return
22
22
  }
23
23
 
24
24
  exec(cmd, {
25
25
  maxBuffer: Infinity
26
- }, function(err, data) {
26
+ }, function (err, data) {
27
27
  if (err) {
28
- callback(err);
29
- return;
28
+ callback(err)
29
+ return
30
30
  }
31
31
 
32
- var tags = [];
33
- var tagPrefixRegexp;
32
+ var tags = []
33
+ var tagPrefixRegexp
34
34
  if (opts.tagPrefix) {
35
- tagPrefixRegexp = new RegExp('^' + opts.tagPrefix + '(.*)');
35
+ tagPrefixRegexp = new RegExp('^' + opts.tagPrefix + '(.*)')
36
36
  }
37
- data.split('\n').forEach(function(decorations) {
38
- var match;
39
- while (match = regex.exec(decorations)) {
40
- var tag = match[1];
37
+ data.split('\n').forEach(function (decorations) {
38
+ var match
39
+ while ((match = regex.exec(decorations))) {
40
+ var tag = match[1]
41
41
  if (opts.lernaTags) {
42
42
  if (lernaTag(tag, opts.package)) {
43
- tags.push(tag);
43
+ tags.push(tag)
44
44
  }
45
45
  } else if (opts.tagPrefix) {
46
- var matches = tag.match(tagPrefixRegexp);
46
+ var matches = tag.match(tagPrefixRegexp)
47
47
  if (matches && semverValid(matches[1])) {
48
- tags.push(tag);
48
+ tags.push(tag)
49
49
  }
50
50
  } else if (semverValid(tag)) {
51
- tags.push(tag);
51
+ tags.push(tag)
52
52
  }
53
53
  }
54
- });
54
+ })
55
55
 
56
- callback(null, tags);
57
- });
58
- };
56
+ callback(null, tags)
57
+ })
58
+ }
package/package.json CHANGED
@@ -1,14 +1,20 @@
1
1
  {
2
2
  "name": "git-semver-tags",
3
- "version": "1.3.2",
3
+ "version": "1.3.6",
4
4
  "description": "Get all git semver tags of your repository in reverse chronological order",
5
- "homepage": "https://github.com/stevemao/git-semver-tags",
5
+ "bugs": {
6
+ "url": "https://github.com/conventional-changelog/conventional-changelog/issues"
7
+ },
8
+ "homepage": "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/git-semver-tags#readme",
6
9
  "author": {
7
10
  "name": "Steve Mao",
8
11
  "email": "maochenyan@gmail.com",
9
12
  "url": "https://github.com/stevemao"
10
13
  },
11
- "repository": "stevemao/git-semver-tags",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/conventional-changelog/conventional-changelog.git"
17
+ },
12
18
  "license": "MIT",
13
19
  "files": [
14
20
  "index.js",
@@ -23,19 +29,15 @@
23
29
  "git"
24
30
  ],
25
31
  "dependencies": {
26
- "meow": "^3.3.0",
27
- "semver": "^5.0.1"
32
+ "meow": "^4.0.0",
33
+ "semver": "^5.5.0"
28
34
  },
29
35
  "devDependencies": {
30
- "git-dummy-commit": "^1.1.0",
31
- "istanbul": "^0.4.2",
32
- "jscs": "^2.9.0",
33
- "jshint": "^2.8.0",
34
- "mocha": "*",
35
- "shelljs": "^0.5.1"
36
+ "git-dummy-commit": "^1.2.0",
37
+ "shelljs": "^0.8.0"
36
38
  },
37
39
  "scripts": {
38
- "lint": "jshint *.js --exclude node_modules && jscs *.js",
40
+ "lint": "eslint --fix .",
39
41
  "test": "npm run-script lint && mocha --timeout 30000",
40
42
  "test-windows": "mocha --timeout 30000"
41
43
  },