commit-and-tag-version
Advanced tools
Comparing version 12.1.0 to 12.2.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [12.2.0](https://github.com/absolute-version/commit-and-tag-version/compare/v12.1.0...v12.2.0) (2024-01-15) | ||
### Features | ||
* **updater:** add maven pom.xml file support ([#33](https://github.com/absolute-version/commit-and-tag-version/issues/33), [#109](https://github.com/absolute-version/commit-and-tag-version/issues/109)) ([#123](https://github.com/absolute-version/commit-and-tag-version/issues/123)) ([6466beb](https://github.com/absolute-version/commit-and-tag-version/commit/6466bebf849bbdcdaebf493a1ccce9670c469fde)) | ||
## [12.1.0](https://github.com/absolute-version/commit-and-tag-version/compare/v12.0.0...v12.1.0) (2024-01-06) | ||
@@ -7,0 +14,0 @@ |
@@ -6,2 +6,3 @@ const path = require('path'); | ||
'plain-text': require('./types/plain-text'), | ||
maven: require('./types/maven'), | ||
gradle: require('./types/gradle'), | ||
@@ -27,2 +28,5 @@ csproj: require('./types/csproj'), | ||
} | ||
if (/pom.xml/.test(filename)) { | ||
return getUpdaterByType('maven'); | ||
} | ||
if (/build.gradle/.test(filename)) { | ||
@@ -29,0 +33,0 @@ return getUpdaterByType('gradle'); |
{ | ||
"name": "commit-and-tag-version", | ||
"version": "12.1.0", | ||
"version": "12.2.0", | ||
"description": "replacement for `npm version` with automatic CHANGELOG generation", | ||
@@ -52,3 +52,5 @@ "bin": "bin/cli.js", | ||
"git-semver-tags": "^5.0.0", | ||
"jsdom": "^23.2.0", | ||
"semver": "^7.5.4", | ||
"w3c-xmlserializer": "^5.0.0", | ||
"yargs": "^17.7.2" | ||
@@ -55,0 +57,0 @@ }, |
@@ -9,3 +9,2 @@ # Commit and Tag Version | ||
A utility for versioning using [semver](https://semver.org/) and CHANGELOG generation powered by [Conventional Commits](https://conventionalcommits.org). | ||
@@ -24,2 +23,3 @@ | ||
- [`bumpFiles`, `packageFiles` and `updaters`](#bumpfiles-packagefiles-and-updaters) | ||
- [Maven Support (Java/Kotlin)](#maven-support-javakotlin) | ||
- [Gradle Support (Java/Kotlin)](#gradle-support-javakotlin) | ||
@@ -60,3 +60,3 @@ - [.NET Support](#net-support) | ||
### How It Works: | ||
### How It Works | ||
@@ -89,2 +89,10 @@ 1. Follow the [Conventional Commits Specification](https://conventionalcommits.org) in your repository. | ||
### Maven Support (Java/Kotlin) | ||
If you are using Maven, then just point to your `pom.xml` file. | ||
```sh | ||
commit-and-tag-version --packageFiles pom.xml --bumpFiles pom.xml | ||
``` | ||
### Gradle Support (Java/Kotlin) | ||
@@ -102,2 +110,3 @@ | ||
This is going to read and update only the `<Version>` tag in the file. | ||
```sh | ||
@@ -156,3 +165,3 @@ commit-and-tag-version --packageFiles <YOUR-PROJECT-NAME>.csproj --bumpFiles <YOUR-PROJECT-NAME>.csproj | ||
> Note for users who have migrated to | ||
> Note for users who have migrated to | ||
`commit-and-tag-version` from `standard-version`: the previous package.json configuration key of `standard-version` will still work. | ||
@@ -321,3 +330,3 @@ | ||
As an example to change from using GitHub to track your items to using your projects Jira use a | ||
`postchangelog` script to replace the url fragment containing 'https://github.com/`myproject`/issues/' | ||
`postchangelog` script to replace the url fragment containing '<https://github.com/`myproject`/issues/>' | ||
with a link to your Jira - assuming you have already installed [replace](https://www.npmjs.com/package/replace) | ||
@@ -324,0 +333,0 @@ |
@@ -1183,2 +1183,70 @@ 'use strict'; | ||
it('bumps version in Maven `pom.xml` file with CRLF Line Endings', async function () { | ||
const expected = fs.readFileSync( | ||
'./test/mocks/pom-6.4.0-crlf.xml', | ||
'utf-8', | ||
); | ||
const filename = 'pom.xml'; | ||
mock({ | ||
bump: 'minor', | ||
realTestFiles: [ | ||
{ | ||
filename, | ||
path: './test/mocks/pom-6.3.1-crlf.xml', | ||
}, | ||
], | ||
}); | ||
await exec({ | ||
packageFiles: [{ filename, type: 'maven' }], | ||
bumpFiles: [{ filename, type: 'maven' }], | ||
}); | ||
// filePath is the first arg passed to writeFileSync | ||
const packageJsonWriteFileSynchCall = findWriteFileCallForPath({ | ||
writeFileSyncSpy, | ||
filename, | ||
}); | ||
if (!packageJsonWriteFileSynchCall) { | ||
throw new Error(`writeFileSynch not invoked with path ${filename}`); | ||
} | ||
const calledWithContentStr = packageJsonWriteFileSynchCall[1]; | ||
expect(calledWithContentStr).toEqual(expected); | ||
}); | ||
it('bumps version in Maven `pom.xml` file with LF Line Endings', async function () { | ||
const expected = fs.readFileSync( | ||
'./test/mocks/pom-6.4.0-lf.xml', | ||
'utf-8', | ||
); | ||
const filename = 'pom.xml'; | ||
mock({ | ||
bump: 'minor', | ||
realTestFiles: [ | ||
{ | ||
filename, | ||
path: './test/mocks/pom-6.3.1-lf.xml', | ||
}, | ||
], | ||
}); | ||
await exec({ | ||
packageFiles: [{ filename, type: 'maven' }], | ||
bumpFiles: [{ filename, type: 'maven' }], | ||
}); | ||
// filePath is the first arg passed to writeFileSync | ||
const packageJsonWriteFileSynchCall = findWriteFileCallForPath({ | ||
writeFileSyncSpy, | ||
filename, | ||
}); | ||
if (!packageJsonWriteFileSynchCall) { | ||
throw new Error(`writeFileSynch not invoked with path ${filename}`); | ||
} | ||
const calledWithContentStr = packageJsonWriteFileSynchCall[1]; | ||
expect(calledWithContentStr).toEqual(expected); | ||
}); | ||
it('bumps version in Gradle `build.gradle.kts` file', async function () { | ||
@@ -1190,2 +1258,3 @@ const expected = fs.readFileSync( | ||
const filename = 'build.gradle.kts'; | ||
mock({ | ||
@@ -1195,3 +1264,3 @@ bump: 'minor', | ||
{ | ||
filename: 'build.gradle.kts', | ||
filename, | ||
path: './test/mocks/build-6.3.1.gradle.kts', | ||
@@ -1203,8 +1272,7 @@ }, | ||
await exec({ | ||
packageFiles: [{ filename: 'build.gradle.kts', type: 'gradle' }], | ||
bumpFiles: [{ filename: 'build.gradle.kts', type: 'gradle' }], | ||
packageFiles: [{ filename, type: 'gradle' }], | ||
bumpFiles: [{ filename, type: 'gradle' }], | ||
}); | ||
// filePath is the first arg passed to writeFileSync | ||
const filename = 'build.gradle.kts'; | ||
const packageJsonWriteFileSynchCall = findWriteFileCallForPath({ | ||
@@ -1211,0 +1279,0 @@ writeFileSyncSpy, |
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
212144
68
3696
607
2
15
+ Addedjsdom@^23.2.0
+ Addedw3c-xmlserializer@^5.0.0
+ Added@asamuzakjp/dom-selector@2.0.2(transitive)
+ Addedagent-base@7.1.1(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedbidi-js@1.0.3(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcss-tree@2.3.1(transitive)
+ Addedcssstyle@4.0.1(transitive)
+ Addeddata-urls@5.0.0(transitive)
+ Addeddebug@4.3.5(transitive)
+ Addeddecimal.js@10.4.3(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedform-data@4.0.0(transitive)
+ Addedhtml-encoding-sniffer@4.0.0(transitive)
+ Addedhttp-proxy-agent@7.0.2(transitive)
+ Addedhttps-proxy-agent@7.0.4(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedis-potential-custom-element-name@1.0.1(transitive)
+ Addedjsdom@23.2.0(transitive)
+ Addedmdn-data@2.0.30(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.1.2(transitive)
+ Addedparse5@7.1.2(transitive)
+ Addedpsl@1.9.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedquerystringify@2.2.0(transitive)
+ Addedrequire-from-string@2.0.2(transitive)
+ Addedrequires-port@1.0.0(transitive)
+ Addedrrweb-cssom@0.6.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsaxes@6.0.0(transitive)
+ Addedsource-map-js@1.2.0(transitive)
+ Addedsymbol-tree@3.2.4(transitive)
+ Addedtough-cookie@4.1.4(transitive)
+ Addedtr46@5.0.0(transitive)
+ Addeduniversalify@0.2.0(transitive)
+ Addedurl-parse@1.5.10(transitive)
+ Addedw3c-xmlserializer@5.0.0(transitive)
+ Addedwebidl-conversions@7.0.0(transitive)
+ Addedwhatwg-encoding@3.1.1(transitive)
+ Addedwhatwg-mimetype@4.0.0(transitive)
+ Addedwhatwg-url@14.0.0(transitive)
+ Addedws@8.17.0(transitive)
+ Addedxml-name-validator@5.0.0(transitive)
+ Addedxmlchars@2.2.0(transitive)