Skip to content

Commit bcc73f2

Browse files
sanitize tasks
1 parent d1b933e commit bcc73f2

File tree

9 files changed

+21
-12
lines changed

9 files changed

+21
-12
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"build": "npm run lint && tsc && node tasks/build.js",
1414
"git-stage-and-push": "node tasks/git-stage-and-push.js",
1515
"npm-publish": "node tasks/npm-publish.js",
16-
"publish-major": "npm run version-major && npm run test-silent && npm run git-stage-and-push && npm run npm-publish",
17-
"publish-minor": "npm run version-minor && npm run test-silent && npm run git-stage-and-push && npm run npm-publish",
18-
"publish-patch": "npm run version-patch && npm run test-silent && npm run git-stage-and-push && npm run npm-publish",
16+
"publish-major": "npm run test-silent && npm run version-major && npm run git-stage-and-push && npm run npm-publish",
17+
"publish-minor": "npm run test-silent && npm run version-minor && npm run git-stage-and-push && npm run npm-publish",
18+
"publish-patch": "npm run test-silent && npm run version-patch && npm run git-stage-and-push && npm run npm-publish",
1919
"test": "npm run build && node tasks/mochaTest.js",
2020
"test-silent": "npm run build && node tasks/mochaTest.js --silent",
2121
"version-major": "node tasks/version.js --type=\"major\"",

tasks/build.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
'use strict';
23

34
const fs = require('fs-extra');

tasks/changelog.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
'use strict';
23

34
const async = require('async');
45
const fs = require('fs');
56
const path = require('path');
6-
const get = require('./git');
7+
const git = require('./git');
78

89
module.exports = () =>
9-
new Promise(resolve => {
10+
new Promise((resolve, reject) => {
1011
const writeChangelog = (changelog, cb) => {
1112
let result = '## Change Log';
1213
changelog.forEach(pr => {
@@ -17,12 +18,12 @@ module.exports = () =>
1718
fs.writeFile(path.join(__dirname, '../CHANGELOG.md'), result, cb);
1819
};
1920

20-
get.tags((err, tags) => {
21+
git.tags((err, tags) => {
2122
const result = [];
2223
async.eachSeries(
2324
tags,
2425
(tag, next) => {
25-
get.prs(tag, (err, changes) => {
26+
git.prs(tag, (err, changes) => {
2627
result.push({
2728
tag,
2829
changes

tasks/git-stage-and-push.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
'use strict';
23

34
const changelog = require('./changelog');

tasks/git.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
'use strict';
23

34
const path = require('path');
@@ -76,13 +77,14 @@ const utils = {
7677

7778
module.exports = {
7879
// Fetches PRs
79-
prs: (options, cb) => {
80-
const opts = Object.assign({}, options, {
80+
prs(options, cb) {
81+
const opts = {
82+
...options,
8183
format: {
8284
message: '%s',
8385
body: '%b'
8486
}
85-
});
87+
};
8688
git.log(opts, (err, changes) => {
8789
if (err) {
8890
cb(err, null);
@@ -91,7 +93,7 @@ module.exports = {
9193
});
9294
},
9395
// Fetches all tags
94-
tags: cb => {
96+
tags(cb) {
9597
utils.getFirstCommitHash((err, hash) => {
9698
git.tags((err, tags) => {
9799
if (err) {

tasks/logger.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
'use strict';
23

34
const chalk = require('chalk');

tasks/mochaTest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
'use strict';
23

34
const async = require('async');

tasks/npm-publish.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
const fs = require('fs-extra');
23
const log = require('./logger');
34
const spawn = require('cross-spawn');

tasks/version.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
'use strict';
23

34
const fs = require('fs-extra');
@@ -24,6 +25,6 @@ if (
2425
log.complete(`Package version upgraded to: ${packageJson.version}`);
2526
} else {
2627
log.error(
27-
`Incorrect --type input: ${argv.type}. Use \'patch\', \'minor\' or \'major\'`
28+
`Incorrect --type input: ${argv.type}. Use 'patch', 'minor' or 'major'`
2829
);
2930
}

0 commit comments

Comments
 (0)