Skip to content

Commit

Permalink
Refactor(conventional-changelog): Drop q from dependencies
Browse files Browse the repository at this point in the history
Closes #135
  • Loading branch information
literat committed Dec 13, 2023
1 parent 85835d0 commit 3e1b192
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 22 deletions.
3 changes: 1 addition & 2 deletions packages/conventional-changelog-lmc-bitbucket/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
"test": "is-ci || jest --maxWorkers=50%"
},
"dependencies": {
"@lmc-eu/conventional-changelog-lmc": "^2.0.0",
"q": "^1.5.1"
"@lmc-eu/conventional-changelog-lmc": "^2.0.0"
},
"devDependencies": {
"better-than-before": "1.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const Q = require('q');
const readFile = Q.denodeify(require('fs').readFile);
const { readFile } = require('fs').promises;
const { resolve } = require('path');
const { parserOpts, writerOpts } = require('@lmc-eu/conventional-changelog-lmc');

module.exports = Q.all([
module.exports = Promise.all([
readFile(resolve(__dirname, 'templates/template.hbs'), 'utf-8'),
readFile(resolve(__dirname, 'templates/header.hbs'), 'utf-8'),
readFile(resolve(__dirname, 'templates/commit.hbs'), 'utf-8'),
readFile(resolve(__dirname, 'templates/footer.hbs'), 'utf-8'),
]).spread((template, header, commit, footer) => {
]).then(([template, header, commit, footer]) => {
writerOpts.mainTemplate = template;
writerOpts.headerPartial = header;
writerOpts.commitPartial = commit;
Expand Down
5 changes: 2 additions & 3 deletions packages/conventional-changelog-lmc-bitbucket/src/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
const Q = require(`q`);
const conventionalChangelog = require(`./conventional-changelog`);
const { parserOpts, writerOpts, recommendedBumpOpts } = require('@lmc-eu/conventional-changelog-lmc');

module.exports = Q.all([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]).spread(
module.exports = Promise.all([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]).then(
// Using same configuration as other configurations
// Did not find any documentation whether the output must be in this format
// eslint-disable-next-line no-shadow
(conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => ({
([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]) => ({
conventionalChangelog,
parserOpts,
recommendedBumpOpts,
Expand Down
3 changes: 1 addition & 2 deletions packages/conventional-changelog-lmc-github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
"test": "is-ci || jest --maxWorkers=50%"
},
"dependencies": {
"@lmc-eu/conventional-changelog-lmc": "^2.0.0",
"q": "^1.5.1"
"@lmc-eu/conventional-changelog-lmc": "^2.0.0"
},
"devDependencies": {
"better-than-before": "1.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const Q = require('q');
const readFile = Q.denodeify(require('fs').readFile);
const { readFile } = require('fs').promises;
const { resolve } = require('path');
const { parserOpts, writerOpts } = require('@lmc-eu/conventional-changelog-lmc');

module.exports = Q.all([
module.exports = Promise.all([
readFile(resolve(__dirname, 'templates/template.hbs'), 'utf-8'),
readFile(resolve(__dirname, 'templates/header.hbs'), 'utf-8'),
readFile(resolve(__dirname, 'templates/commit.hbs'), 'utf-8'),
readFile(resolve(__dirname, 'templates/footer.hbs'), 'utf-8'),
]).spread((template, header, commit, footer) => {
]).then(([template, header, commit, footer]) => {
writerOpts.mainTemplate = template;
writerOpts.headerPartial = header;
writerOpts.commitPartial = commit;
Expand Down
5 changes: 2 additions & 3 deletions packages/conventional-changelog-lmc-github/src/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
const Q = require(`q`);
const conventionalChangelog = require(`./conventional-changelog`);
const { parserOpts, writerOpts, recommendedBumpOpts } = require('@lmc-eu/conventional-changelog-lmc');

module.exports = Q.all([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]).spread(
module.exports = Promise.all([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]).then(
// Using same configuration as other configurations
// Did not find any documentation whether the output must be in this format
// eslint-disable-next-line no-shadow
(conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => ({
([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]) => ({
conventionalChangelog,
parserOpts,
recommendedBumpOpts,
Expand Down
7 changes: 3 additions & 4 deletions packages/conventional-changelog-lmc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ yarn add --dev @lmc-eu/conventional-changelog-lmc
## Usage

```js
const Q = require('q');
const readFile = Q.denodeify(require('fs').readFile);
const { readFile } = require('fs').promises;
const { resolve } = require('path');
const { parserOpts, writerOpts } = require('@lmc-eu/conventional-changelog-lmc');

module.exports = Q.all([
module.exports = Promise.all([
readFile(resolve(__dirname, 'templates/template.hbs'), 'utf-8'),
readFile(resolve(__dirname, 'templates/header.hbs'), 'utf-8'),
readFile(resolve(__dirname, 'templates/commit.hbs'), 'utf-8'),
readFile(resolve(__dirname, 'templates/footer.hbs'), 'utf-8'),
]).spread((template, header, commit, footer) => {
]).then((template, header, commit, footer) => {
writerOpts.mainTemplate = template;
writerOpts.headerPartial = header;
writerOpts.commitPartial = commit;
Expand Down

0 comments on commit 3e1b192

Please sign in to comment.