Skip to content

Commit 7f91b2d

Browse files
committed
feat: ⬆️ upgrade dependencies
1 parent dd7a280 commit 7f91b2d

File tree

9 files changed

+1664
-1164
lines changed

9 files changed

+1664
-1164
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 11.15.0
1+
nodejs 12.22.12

dist/webduino-all.min.js

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/webduino-base.min.js

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/files/src_transport_NodeMqttTransport.js.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ <h1>src/transport/NodeMqttTransport.js <small>File</small></h1>
157157
self._client = mqtt.connect(self._options.server, {
158158
clientId: &#x27;_&#x27; + self._options.device + (self._options.multi ? &#x27;.&#x27; + util.randomId() : &#x27;&#x27;),
159159
username: self._options.login || &#x27;&#x27;,
160-
password: new Buffer(self._options.password || &#x27;&#x27;),
160+
password: Buffer.from(self._options.password || &#x27;&#x27;),
161161
keepalive: NodeMqttTransport.KEEPALIVE_INTERVAL,
162162
reconnectPeriod: self._options.autoReconnect ? NodeMqttTransport.RECONNECT_PERIOD * 1000 : 0,
163163
connectTimeout: NodeMqttTransport.CONNECT_TIMEOUT * 1000
@@ -224,7 +224,7 @@ <h1>src/transport/NodeMqttTransport.js <small>File</small></h1>
224224
}
225225

226226
function sendOut() {
227-
var payload = new Buffer(this._buf);
227+
var payload = Buffer.from(this._buf);
228228
this.isOpen &amp;&amp; this._client.publish(this._options.device + TOPIC.PING, payload, {
229229
qos: 0
230230
});

gulpfile.js

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
const gulp = require('gulp');
1+
const { src, dest, watch, series, parallel } = require('gulp');
22
const expect = require('gulp-expect-file');
33
const concat = require('gulp-concat');
44
const uglify = require('gulp-uglify');
55
const shell = require('gulp-shell');
66

7-
const expectFiles = (ary) => {
8-
return gulp.src(ary).pipe(expect(ary));
9-
}
10-
117
const SOURCE_DIR = 'src';
128
const DIST_DIR = 'dist';
139
const base = [
@@ -70,42 +66,56 @@ const modules = [
7066
'src/module/Stepper.js'
7167
];
7268

73-
gulp.task('clean', shell.task([
74-
`rm -rf ${DIST_DIR} docs`
75-
]));
69+
function expectFiles(ary) {
70+
return src(ary).pipe(expect(ary));
71+
}
7672

77-
/**
78-
* NPM alert potential security vulnerabilities.
79-
* yuidocjs seems to be no longer maintained.
80-
* If need the document, run the gulp task.
81-
*/
82-
gulp.task('docs', ['clean'], shell.task([
83-
'npm install --no-save yuidocjs yuidoc-lucid-theme',
84-
'./node_modules/.bin/yuidoc -c yuidoc.json ./src'
85-
]));
73+
function clean() {
74+
return shell.task([
75+
`rm -rf ${DIST_DIR} docs`
76+
])();
77+
}
8678

87-
gulp.task('dev', ['clean'], () => {
88-
expectFiles(base)
79+
function docs() {
80+
return shell.task([
81+
'npm install --no-save yuidocjs yuidoc-lucid-theme',
82+
'./node_modules/.bin/yuidoc -c yuidoc.json ./src'
83+
])();
84+
}
85+
86+
function webduinoBaseJS() {
87+
return expectFiles(base)
8988
.pipe(concat('webduino-base.js'))
90-
.pipe(gulp.dest(DIST_DIR));
91-
expectFiles(base.concat(boards).concat(modules))
92-
.pipe(concat('webduino-all.js'))
93-
.pipe(gulp.dest(DIST_DIR));
94-
});
89+
.pipe(dest(DIST_DIR));
90+
}
9591

96-
gulp.task('prod', ['clean'], () => {
97-
expectFiles(base)
92+
function webduinoBaseMinJS() {
93+
return expectFiles(base)
9894
.pipe(concat('webduino-base.min.js'))
9995
.pipe(uglify())
100-
.pipe(gulp.dest(DIST_DIR));
101-
expectFiles(base.concat(boards).concat(modules))
96+
.pipe(dest(DIST_DIR));
97+
}
98+
99+
function webduinoAllJS() {
100+
return expectFiles(base.concat(boards).concat(modules))
101+
.pipe(concat('webduino-all.js'))
102+
.pipe(dest(DIST_DIR));
103+
}
104+
105+
function webduinoAllMinJS() {
106+
return expectFiles(base.concat(boards).concat(modules))
102107
.pipe(concat('webduino-all.min.js'))
103108
.pipe(uglify())
104-
.pipe(gulp.dest(DIST_DIR));
105-
});
109+
.pipe(dest(DIST_DIR));
110+
}
111+
112+
function watchFiles() {
113+
watch(SOURCE_DIR + '/**/*.js', series(clean, dev));
114+
}
115+
116+
const dev = series(webduinoBaseJS, webduinoAllJS);
106117

107-
gulp.task('watch', () => {
108-
gulp.watch(SOURCE_DIR + '/**/*.js', ['dev']);
109-
});
118+
const prod = series(webduinoBaseMinJS, webduinoAllMinJS);
110119

111-
gulp.task('default', ['docs', 'dev', 'prod']);
120+
exports.watch = watchFiles;
121+
exports.default = series(clean, parallel(docs, dev, prod));

0 commit comments

Comments
 (0)