Skip to content

Commit 3a92ab9

Browse files
authored
build(package): Remove extend, debounce, and resolve dependencies (#713)
extend and debounce are swapped for lodash versions, and resolve was no longer used Fixes #712
1 parent cf2ef2b commit 3a92ab9

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

lib/commands/build.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ var streamArray = require('stream-array'),
66
path = require('path'),
77
fs = require('fs'),
88
vfs = require('vinyl-fs'),
9-
extend = require('extend'),
109
chokidar = require('chokidar'),
1110
documentation = require('../../'),
12-
debounce = require('debounce');
11+
_ = require('lodash');
1312

1413
module.exports.command = 'build [input..]';
1514
module.exports.describe = 'build documentation';
@@ -20,7 +19,7 @@ module.exports.describe = 'build documentation';
2019
* @returns {Object} yargs with options
2120
* @private
2221
*/
23-
module.exports.builder = extend(
22+
module.exports.builder = _.assign(
2423
{},
2524
sharedOptions.sharedOutputOptions,
2625
sharedOptions.sharedInputOptions,
@@ -105,7 +104,7 @@ module.exports.handler = function build(argv /*: Object*/) {
105104
function updateWatcher() {
106105
if (!watcher) {
107106
watcher = chokidar.watch(argv.input);
108-
watcher.on('all', debounce(generator, 300));
107+
watcher.on('all', _.debounce(generator, 300));
109108
}
110109
documentation
111110
.expandInputs(argv.input, argv)

lib/commands/serve.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33

44
var errorPage = require('../../lib/serve/error_page'),
55
fs = require('fs'),
6-
extend = require('extend'),
76
path = require('path'),
87
chokidar = require('chokidar'),
98
sharedOptions = require('./shared_options'),
109
Server = require('../../lib/serve/server'),
11-
debounce = require('debounce'),
10+
_ = require('lodash'),
1211
documentation = require('../../');
1312

1413
module.exports.command = 'serve [input..]';
@@ -19,7 +18,7 @@ module.exports.description = 'generate, update, and display HTML documentation';
1918
* @returns {Object} yargs with options
2019
* @private
2120
*/
22-
module.exports.builder = extend(
21+
module.exports.builder = _.assign(
2322
{},
2423
sharedOptions.sharedOutputOptions,
2524
sharedOptions.sharedInputOptions,
@@ -66,7 +65,7 @@ module.exports.handler = function serve(argv /*: Object*/) {
6665
function updateWatcher() {
6766
if (!watcher) {
6867
watcher = chokidar.watch(argv.input);
69-
watcher.on('all', debounce(updateServer, 300));
68+
watcher.on('all', _.debounce(updateServer, 300));
7069
}
7170

7271
documentation

lib/parsers/polyglot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* @flow */
33

44
var getComments = require('get-comments'),
5-
extend = require('extend'),
5+
_ = require('lodash'),
66
isJSDocComment = require('../../lib/is_jsdoc_comment'),
77
parse = require('../../lib/parse');
88

@@ -18,7 +18,7 @@ function parsePolyglot(sourceFile /*: SourceFile*/) {
1818
.filter(isJSDocComment)
1919
.map(comment => {
2020
var context = {
21-
loc: extend({}, comment.loc),
21+
loc: _.clone(comment.loc),
2222
file: sourceFile.file,
2323
sortKey: sourceFile.file + ' ' + comment.loc.start.line
2424
};

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222
"chalk": "^1.1.1",
2323
"chokidar": "^1.2.0",
2424
"concat-stream": "^1.5.0",
25-
"debounce": "^1.0.0",
2625
"disparity": "^2.0.0",
2726
"doctrine": "^2.0.0",
28-
"extend": "^3.0.0",
2927
"get-comments": "^1.0.1",
3028
"git-url-parse": "^6.0.1",
3129
"github-slugger": "1.1.1",
@@ -45,7 +43,6 @@
4543
"remark-html": "6.0.0",
4644
"remark-toc": "^4.0.0",
4745
"remote-origin-url": "0.4.0",
48-
"resolve": "^1.1.6",
4946
"shelljs": "^0.7.5",
5047
"stream-array": "^1.1.0",
5148
"strip-json-comments": "^2.0.0",

0 commit comments

Comments
 (0)