Skip to content

Commit

Permalink
✨ Add maven preset (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmembre-zenika authored and frinyvonnick committed Jan 17, 2020
1 parent 56d13f9 commit 1622775
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
1 change: 1 addition & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ _This workflow is related to the `node` preset but can be adapted to your own te

- node (default preset)
- generic
- maven

You didn't the preset you need in the list? Consider adding it. Presets are stored in a [presets](packages/gitmoji-changelog-cli/src/presets) folder in the `cli` package.

Expand Down
1 change: 1 addition & 0 deletions packages/gitmoji-changelog-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"issue-reporter": "^0.2.0",
"libnpm": "^1.0.0",
"lodash": "^4.17.11",
"pom-parser": "^1.2.0",
"rc": "^1.2.8",
"semver": "^5.6.0",
"semver-compare": "^1.0.0",
Expand Down
32 changes: 32 additions & 0 deletions packages/gitmoji-changelog-cli/src/presets/maven.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const pomParser = require('pom-parser')

module.exports = async () => {
try {
const opts = {
filePath: 'pom.xml',
}
const pomPromise = new Promise((resolve, reject) => {
pomParser.parse(opts, (err, pomResponse) => {
if (err) {
reject(err)
return
}

resolve(pomResponse.pomObject)
})
})

const {
project: {
groupid, artifactid, version, description,
},
} = await pomPromise
return {
name: `${groupid}.${artifactid}`,
version: version,
description: description,
}
} catch (e) {
return null
}
}
28 changes: 27 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4864,6 +4864,14 @@ pn@^1.1.0:
resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb"
integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==

pom-parser@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/pom-parser/-/pom-parser-1.2.0.tgz#d705b379432c6ed33bbbadc096c0263d37eb44fe"
integrity sha512-v5QRdaXWS/Qg2KX3rYNSI8dxuEH1DVh8HcayKQwqfaGFVzI5EJxHqK2ThBBsRvmscEHkbyPrBzno1sq9l54uiA==
dependencies:
traverse "^0.6.6"
xml2js "^0.4.9"

posix-character-classes@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
Expand Down Expand Up @@ -5397,7 +5405,7 @@ sane@^2.0.0:
optionalDependencies:
fsevents "^1.2.3"

sax@^1.2.4:
sax@>=0.6.0, sax@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
Expand Down Expand Up @@ -6060,6 +6068,11 @@ tr46@^1.0.1:
dependencies:
punycode "^2.1.0"

traverse@^0.6.6:
version "0.6.6"
resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137"
integrity sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=

trim-newlines@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613"
Expand Down Expand Up @@ -6440,6 +6453,19 @@ xml-name-validator@^3.0.0:
resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==

xml2js@^0.4.9:
version "0.4.23"
resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66"
integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==
dependencies:
sax ">=0.6.0"
xmlbuilder "~11.0.0"

xmlbuilder@~11.0.0:
version "11.0.1"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3"
integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==

[email protected]:
version "4.0.0"
resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020"
Expand Down

0 comments on commit 1622775

Please sign in to comment.