commit-and-tag-version 11.2.0 → 11.2.2
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.
- package/CHANGELOG.md +21 -0
- package/README.md +26 -0
- package/lib/stringify-package.js +36 -0
- package/lib/updaters/types/json.js +1 -1
- package/package.json +4 -5
- package/test/stringify-package.spec.js +39 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [11.2.2](https://github.com/absolute-version/commit-and-tag-version/compare/v11.2.1...v11.2.2) (2023-06-18)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **deps:** update dependency conventional-changelog-conventionalcommits to v6 ([285f5e7](https://github.com/absolute-version/commit-and-tag-version/commit/285f5e7c9d415c029fe6b6f4781f6ccfa71a0151))
|
|
11
|
+
* **deps:** update dependency conventional-changelog-conventionalcommits to v6 ([#81](https://github.com/absolute-version/commit-and-tag-version/issues/81)) ([ab67fa4](https://github.com/absolute-version/commit-and-tag-version/commit/ab67fa43b644f8078530ca7927054cd8cf5add77))
|
|
12
|
+
* **deps:** update dependency conventional-changelog-conventionalcommits to v6.1.0 ([39827d3](https://github.com/absolute-version/commit-and-tag-version/commit/39827d386ce8c3dbad7605ef872975ebe48db72a))
|
|
13
|
+
* **deps:** update dependency conventional-changelog-conventionalcommits to v6.1.0 ([#86](https://github.com/absolute-version/commit-and-tag-version/issues/86)) ([a8580d5](https://github.com/absolute-version/commit-and-tag-version/commit/a8580d5859c6c44ed82ac244eabad967eca0d4b8))
|
|
14
|
+
* **deps:** update dependency conventional-recommended-bump to v7 ([5978564](https://github.com/absolute-version/commit-and-tag-version/commit/59785644f2cd7980139c49086f3ba662f63a7179))
|
|
15
|
+
* **deps:** update dependency conventional-recommended-bump to v7 ([#83](https://github.com/absolute-version/commit-and-tag-version/issues/83)) ([1c9f82e](https://github.com/absolute-version/commit-and-tag-version/commit/1c9f82eca486dceda244d37f5264f992b9a5c57e))
|
|
16
|
+
* **deps:** update dependency git-semver-tags to v5 ([97e0237](https://github.com/absolute-version/commit-and-tag-version/commit/97e0237d645e1686f96418a1f2d8dbd6bfeca90b))
|
|
17
|
+
* **deps:** update dependency git-semver-tags to v5 ([#80](https://github.com/absolute-version/commit-and-tag-version/issues/80)) ([46ea506](https://github.com/absolute-version/commit-and-tag-version/commit/46ea506c5f2e5300f195462a6c2339cbe4b98fcb))
|
|
18
|
+
|
|
19
|
+
## [11.2.1](https://github.com/absolute-version/commit-and-tag-version/compare/v11.2.0...v11.2.1) (2023-04-05)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **dep:** add stringify-package to project source, removing the deprecation warning on npm install ([#65](https://github.com/absolute-version/commit-and-tag-version/issues/65)) ([3a959a7](https://github.com/absolute-version/commit-and-tag-version/commit/3a959a7eba86ad42b98592167df7c67f00b661a0))
|
|
25
|
+
|
|
5
26
|
## [11.2.0](https://github.com/absolute-version/commit-and-tag-version/compare/v11.1.0...v11.2.0) (2023-03-15)
|
|
6
27
|
|
|
7
28
|
|
package/README.md
CHANGED
|
@@ -552,6 +552,32 @@ module.exports.writeVersion = function (contents, version) {
|
|
|
552
552
|
};
|
|
553
553
|
```
|
|
554
554
|
|
|
555
|
+
### Why do breaking changes before 1.0.0 not trigger a 1.0.0 release?
|
|
556
|
+
|
|
557
|
+
Below 1.0.0, the semver specification doesn't give any guarantees about the
|
|
558
|
+
meaning of version numbers. However, with npm there is a community convention,
|
|
559
|
+
and implementation-defined behaviour: If your version is between 0.1.0 and
|
|
560
|
+
1.0.0, npm treats an update to the minor version as a breaking change - that is
|
|
561
|
+
^0.1.0 will match 0.1.2 but not 0.2.0. Rust's cargo package manager also behaves
|
|
562
|
+
the same way.
|
|
563
|
+
|
|
564
|
+
This tool (via conventional-commits) also follows that convention - breaking
|
|
565
|
+
changes below v1.0.0 are treated as a minor version bump. Here's an example
|
|
566
|
+
series of commits with tagged versions:
|
|
567
|
+
|
|
568
|
+
```
|
|
569
|
+
1017b00 chore: initial commit
|
|
570
|
+
9e2ba95 (tag: v0.0.2) chore(release): 0.0.2
|
|
571
|
+
3598012 fix!: Example breaking change
|
|
572
|
+
1a4994a (tag: v0.1.0) chore(release): 0.1.0
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
Semver's only guarantee is "all bets are off", but npm has made a choice about
|
|
576
|
+
what bets to make. `commit-and-tag-version` follows the same convention (along
|
|
577
|
+
with other package managers for other ecosystems).
|
|
578
|
+
|
|
579
|
+
When you are ready to release v1.0.0, add `--release-as 1.0.0` to the options.
|
|
580
|
+
|
|
555
581
|
## License
|
|
556
582
|
|
|
557
583
|
ISC
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright npm, Inc
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
6
|
+
copyright notice and this permission notice appear in all copies.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
9
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
10
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
11
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
12
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
13
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
14
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
|
|
16
|
+
https://github.com/npm/stringify-package/blob/main/LICENSE
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
'use strict'
|
|
20
|
+
|
|
21
|
+
module.exports = stringifyPackage
|
|
22
|
+
|
|
23
|
+
const DEFAULT_INDENT = 2
|
|
24
|
+
const CRLF = '\r\n'
|
|
25
|
+
const LF = '\n'
|
|
26
|
+
|
|
27
|
+
function stringifyPackage (data, indent, newline) {
|
|
28
|
+
indent = indent || (indent === 0 ? 0 : DEFAULT_INDENT)
|
|
29
|
+
const json = JSON.stringify(data, null, indent)
|
|
30
|
+
|
|
31
|
+
if (newline === CRLF) {
|
|
32
|
+
return json.replace(/\n/g, CRLF) + CRLF
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return json + LF
|
|
36
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commit-and-tag-version",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.2",
|
|
4
4
|
"description": "replacement for `npm version` with automatic CHANGELOG generation",
|
|
5
5
|
"bin": "bin/cli.js",
|
|
6
6
|
"scripts": {
|
|
@@ -43,16 +43,15 @@
|
|
|
43
43
|
"chalk": "^2.4.2",
|
|
44
44
|
"conventional-changelog": "3.1.25",
|
|
45
45
|
"conventional-changelog-config-spec": "2.1.0",
|
|
46
|
-
"conventional-changelog-conventionalcommits": "
|
|
47
|
-
"conventional-recommended-bump": "
|
|
46
|
+
"conventional-changelog-conventionalcommits": "6.1.0",
|
|
47
|
+
"conventional-recommended-bump": "7.0.1",
|
|
48
48
|
"detect-indent": "^6.0.0",
|
|
49
49
|
"detect-newline": "^3.1.0",
|
|
50
50
|
"dotgitignore": "^2.1.0",
|
|
51
51
|
"figures": "^3.1.0",
|
|
52
52
|
"find-up": "^5.0.0",
|
|
53
|
-
"git-semver-tags": "^
|
|
53
|
+
"git-semver-tags": "^5.0.0",
|
|
54
54
|
"semver": "^7.1.1",
|
|
55
|
-
"stringify-package": "^1.0.1",
|
|
56
55
|
"yargs": "^17.0.0"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* global describe it */
|
|
2
|
+
|
|
3
|
+
'use strict'
|
|
4
|
+
|
|
5
|
+
const stringifyPackage = require('../lib/stringify-package')
|
|
6
|
+
|
|
7
|
+
require('chai').should()
|
|
8
|
+
|
|
9
|
+
describe('stringifyPackage()', function () {
|
|
10
|
+
const dummy = { name: 'dummy' }
|
|
11
|
+
|
|
12
|
+
it('with no params uses \\n', function () {
|
|
13
|
+
stringifyPackage(dummy).should.match(/\n$/m)
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it('uses \\n', function () {
|
|
17
|
+
stringifyPackage(dummy, 2, '\n').should.match(/\n$/m)
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('uses \\r\\n', function () {
|
|
21
|
+
stringifyPackage(dummy, 2, '\r\n').should.match(/\r\n$/m)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it('with no params uses 2-space indent', function () {
|
|
25
|
+
stringifyPackage(dummy).should.match(/^ {2}"name": "dummy"/m)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('uses 2-space indent', function () {
|
|
29
|
+
stringifyPackage(dummy, 2, '\n').should.match(/^ {2}"name": "dummy"/m)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it('uses 4-space indent', function () {
|
|
33
|
+
stringifyPackage(dummy, 4, '\n').should.match(/^ {4}"name": "dummy"/m)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('0 works', function () {
|
|
37
|
+
stringifyPackage(dummy, 0).split(/\r\n|\r|\n/).length.should.equal(2)
|
|
38
|
+
})
|
|
39
|
+
})
|