Skip to content

Commit 4c95fea

Browse files
committed
Upgrade dependencies
1 parent e345898 commit 4c95fea

File tree

8 files changed

+135
-220
lines changed

8 files changed

+135
-220
lines changed

.babelrc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"presets": [
3-
"env"
3+
[
4+
"@babel/preset-env"
5+
]
46
],
5-
"plugins": ["transform-runtime"]
7+
"plugins": [
8+
"@babel/plugin-transform-runtime"
9+
]
610
}

gulpfile.babel.js

Lines changed: 81 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ var watch = require('gulp-watch')
3131
var batch = require('gulp-batch')
3232
var replace = require('gulp-replace')
3333
var fs = require('fs-extra')
34-
var runSequence = require('run-sequence')
3534
var path = require('path')
3635
var minimist = require('minimist')
3736
var install = require('gulp-install')
@@ -46,19 +45,13 @@ var transformTools = require('browserify-transform-tools')
4645
/**
4746
* Useful to investigate resource leaks in tests. Enable to see active sockets and file handles after the 'test' task.
4847
*/
49-
var enableActiveNodeHandlesLogging = false
50-
51-
gulp.task('default', ['test'])
52-
53-
gulp.task('browser', function (cb) {
54-
runSequence('build-browser-test', 'build-browser', cb)
55-
})
48+
const enableActiveNodeHandlesLogging = false
5649

5750
/** Build all-in-one files for use in the browser */
58-
gulp.task('build-browser', function () {
59-
var browserOutput = 'lib/browser'
51+
gulp.task('build-browser', async function () {
52+
const browserOutput = 'lib/browser'
6053
// Our app bundler
61-
var appBundler = browserify({
54+
const appBundler = browserify({
6255
entries: ['src/index.js'],
6356
cache: {},
6457
standalone: 'neo4j',
@@ -69,30 +62,29 @@ gulp.task('build-browser', function () {
6962
.bundle()
7063

7164
// Un-minified browser package
72-
appBundler
65+
await appBundler
7366
.on('error', gutil.log)
7467
.pipe(source('neo4j-web.js'))
7568
.pipe(gulp.dest(browserOutput))
7669

77-
return appBundler
70+
await appBundler
7871
.on('error', gutil.log)
7972
.pipe(source('neo4j-web.min.js'))
8073
.pipe(buffer())
8174
.pipe(uglify())
8275
.pipe(gulp.dest(browserOutput))
8376
})
8477

85-
gulp.task('build-browser-test', function () {
86-
var browserOutput = 'build/browser/'
87-
var testFiles = []
78+
gulp.task('build-browser-test', async function () {
79+
const browserOutput = 'build/browser/'
80+
const testFiles = []
81+
8882
return gulp
89-
.src(['./test/**/*.test.js', '!./test/**/node/*.js'])
83+
.src(['./test/**/!(examples).test.js', '!./test/**/node/*.js'])
9084
.pipe(
9185
through.obj(
9286
function (file, enc, cb) {
93-
if (file.path.indexOf('examples.test.js') < 0) {
94-
testFiles.push(file.path)
95-
}
87+
testFiles.push(file.path)
9688
cb()
9789
},
9890
function (cb) {
@@ -103,26 +95,20 @@ gulp.task('build-browser-test', function () {
10395
)
10496
)
10597
.pipe(
106-
through.obj(
107-
function (testFiles, enc, cb) {
108-
browserify({
109-
entries: testFiles,
110-
cache: {},
111-
debug: true
112-
})
113-
.transform(babelifyTransform())
114-
.transform(browserifyTransformNodeToBrowserRequire())
115-
.bundle(function () {
116-
cb()
117-
})
118-
.on('error', gutil.log)
119-
.pipe(source('neo4j-web.test.js'))
120-
.pipe(gulp.dest(browserOutput))
121-
},
122-
function (cb) {
123-
cb()
124-
}
125-
)
98+
through.obj(function (testFiles, enc, cb) {
99+
browserify({
100+
entries: testFiles,
101+
cache: {},
102+
debug: true
103+
})
104+
.transform(babelifyTransform())
105+
.transform(browserifyTransformNodeToBrowserRequire())
106+
.bundle()
107+
.on('error', gutil.log)
108+
.pipe(source('neo4j-web.test.js'))
109+
.pipe(gulp.dest(browserOutput))
110+
.on('end', cb)
111+
})
126112
)
127113
})
128114

@@ -140,62 +126,40 @@ gulp.task('nodejs', function () {
140126
})
141127
})
142128

143-
gulp.task('all', function (cb) {
144-
runSequence('nodejs', 'browser', cb)
145-
})
146-
147129
// prepares directory for package.test.js
148-
gulp.task('install-driver-into-sandbox', ['nodejs'], function () {
149-
var testDir = path.join('build', 'sandbox')
150-
fs.emptyDirSync(testDir)
151-
152-
var packageJsonContent = JSON.stringify({
153-
private: true,
154-
dependencies: {
155-
'neo4j-driver': __dirname
156-
}
157-
})
158-
159-
return file('package.json', packageJsonContent, { src: true })
160-
.pipe(gulp.dest(testDir))
161-
.pipe(install())
162-
})
163-
164-
gulp.task('test', function (cb) {
165-
runSequence(
166-
'run-ts-declaration-tests',
167-
'test-nodejs',
168-
'test-browser',
169-
function (err) {
170-
if (err) {
171-
var exitCode = 2
172-
console.log('[FAIL] test task failed - exiting with code ' + exitCode)
173-
return process.exit(exitCode)
130+
gulp.task(
131+
'install-driver-into-sandbox',
132+
gulp.series('nodejs', function () {
133+
var testDir = path.join('build', 'sandbox')
134+
fs.emptyDirSync(testDir)
135+
136+
var packageJsonContent = JSON.stringify({
137+
private: true,
138+
dependencies: {
139+
'neo4j-driver': __dirname
174140
}
175-
return cb()
176-
}
177-
)
178-
})
179-
180-
gulp.task('test-nodejs', ['install-driver-into-sandbox'], function () {
181-
return gulp
182-
.src(['./test/**/*.test.js', '!./test/**/browser/*.js'])
183-
.pipe(
184-
jasmine({
185-
includeStackTrace: true,
186-
reporter: newJasmineConsoleReporter()
187-
})
188-
)
189-
.on('end', logActiveNodeHandles)
190-
})
191-
192-
gulp.task('test-browser', function (cb) {
193-
runSequence('all', 'run-browser-test', cb)
194-
})
141+
})
195142

196-
gulp.task('run-browser-test', function (cb) {
197-
runSequence('run-browser-test-firefox', cb)
198-
})
143+
return file('package.json', packageJsonContent, { src: true })
144+
.pipe(gulp.dest(testDir))
145+
.pipe(install())
146+
})
147+
)
148+
149+
gulp.task(
150+
'test-nodejs',
151+
gulp.series('install-driver-into-sandbox', function () {
152+
return gulp
153+
.src(['./test/**/*.test.js', '!./test/**/browser/*.js'])
154+
.pipe(
155+
jasmine({
156+
includeStackTrace: true,
157+
reporter: newJasmineConsoleReporter()
158+
})
159+
)
160+
.on('end', logActiveNodeHandles)
161+
})
162+
)
199163

200164
gulp.task('run-browser-test-chrome', function (cb) {
201165
runKarma('chrome', cb)
@@ -213,6 +177,8 @@ gulp.task('run-browser-test-ie', function (cb) {
213177
runKarma('ie', cb)
214178
})
215179

180+
gulp.task('run-browser-test', gulp.series('run-browser-test-firefox'))
181+
216182
gulp.task('watch', function () {
217183
return watch(
218184
'src/**/*.js',
@@ -222,9 +188,12 @@ gulp.task('watch', function () {
222188
)
223189
})
224190

225-
gulp.task('watch-n-test', ['test-nodejs'], function () {
226-
return gulp.watch(['src/**/*.js', 'test/**/*.js'], ['test-nodejs'])
227-
})
191+
gulp.task(
192+
'watch-n-test',
193+
gulp.series('test-nodejs', function () {
194+
return gulp.watch(['src/**/*.js', 'test/**/*.js'], ['test-nodejs'])
195+
})
196+
)
228197

229198
/** Set the project version, controls package.json and version.js */
230199
gulp.task('set', function () {
@@ -295,6 +264,19 @@ gulp.task('run-ts-declaration-tests', function () {
295264
.pipe(gulp.dest('build/test/types'))
296265
})
297266

267+
gulp.task('browser', gulp.series('build-browser-test', 'build-browser'))
268+
269+
gulp.task('all', gulp.series('nodejs', 'browser'))
270+
271+
gulp.task('test-browser', gulp.series('all', 'run-browser-test'))
272+
273+
gulp.task(
274+
'test',
275+
gulp.series('run-ts-declaration-tests', 'test-nodejs', 'test-browser')
276+
)
277+
278+
gulp.task('default', gulp.series('test'))
279+
298280
function logActiveNodeHandles () {
299281
if (enableActiveNodeHandlesLogging) {
300282
console.log(
@@ -321,8 +303,8 @@ function babelifyTransform () {
321303

322304
function babelConfig () {
323305
return {
324-
presets: ['env'],
325-
plugins: ['transform-runtime']
306+
presets: [['@babel/preset-env']],
307+
plugins: ['@babel/plugin-transform-runtime']
326308
}
327309
}
328310

@@ -350,11 +332,7 @@ function browserifyTransformNodeToBrowserRequire () {
350332
function runKarma (browser, cb) {
351333
new karma.Server(
352334
{
353-
configFile: path.join(
354-
__dirname,
355-
`/test/browser/karma-${browser}.conf.js`
356-
),
357-
singleRun: true
335+
configFile: path.join(__dirname, `/test/browser/karma-${browser}.conf.js`)
358336
},
359337
function (exitCode) {
360338
exitCode ? process.exit(exitCode) : cb()

package.json

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -40,67 +40,68 @@
4040
"jsdelivr": "lib/browser/neo4j-web.js",
4141
"types": "types/index.d.ts",
4242
"devDependencies": {
43-
"async": "^2.4.0",
44-
"babel-core": "^6.26.3",
43+
"async": "^2.6.2",
44+
"@babel/core": "^7.4.4",
45+
"@babel/runtime": "^7.4.4",
46+
"@babel/plugin-transform-runtime": "^7.4.4",
47+
"@babel/preset-env": "^7.4.4",
48+
"@babel/register": "^7.4.4",
4549
"babel-eslint": "^10.0.1",
46-
"babel-plugin-transform-runtime": "^6.23.0",
47-
"babel-preset-env": "^1.6.1",
48-
"babel-register": "^6.26.0",
49-
"babelify": "^7.3.0",
50-
"browserify": "^13.3.0",
50+
"babelify": "^10.0.0",
51+
"browserify": "^16.2.3",
5152
"browserify-transform-tools": "^1.7.0",
52-
"esdoc": "^1.0.4",
53-
"esdoc-importpath-plugin": "^1.0.1",
53+
"esdoc": "^1.1.0",
54+
"esdoc-importpath-plugin": "^1.0.2",
5455
"esdoc-standard-plugin": "^1.0.0",
5556
"eslint": "^5.16.0",
5657
"eslint-config-standard": "^12.0.0",
57-
"eslint-plugin-import": "^2.16.0",
58+
"eslint-plugin-import": "^2.17.2",
5859
"eslint-plugin-jasmine": "^2.10.1",
59-
"eslint-plugin-node": "^8.0.1",
60+
"eslint-plugin-node": "^9.0.1",
6061
"eslint-plugin-promise": "^4.1.1",
6162
"eslint-plugin-standard": "^4.0.0",
62-
"fs-extra": "^1.0.0",
63-
"gulp": "^3.9.1",
64-
"gulp-babel": "^6.1.3",
63+
"fs-extra": "^8.0.1",
64+
"gulp": "^4.0.2",
65+
"gulp-babel": "^8.0.0",
6566
"gulp-batch": "^1.0.5",
66-
"gulp-decompress": "^1.2.0",
67+
"gulp-decompress": "^2.0.2",
6768
"gulp-download": "^0.0.1",
68-
"gulp-file": "^0.3.0",
69-
"gulp-install": "^0.6.0",
70-
"gulp-jasmine": "^2.1.0",
71-
"gulp-replace": "^0.5.4",
72-
"gulp-typescript": "^3.1.7",
73-
"gulp-uglify": "^1.4.2",
74-
"gulp-util": "^3.0.6",
75-
"gulp-watch": "^4.3.5",
76-
"husky": "^1.3.1",
77-
"jasmine-console-reporter": "^2.0.1",
78-
"karma": "^2.0.3",
69+
"gulp-file": "^0.4.0",
70+
"gulp-install": "^1.1.0",
71+
"gulp-jasmine": "^4.0.0",
72+
"gulp-replace": "^1.0.0",
73+
"gulp-typescript": "^5.0.1",
74+
"gulp-uglify": "^3.0.2",
75+
"gulp-util": "^3.0.8",
76+
"gulp-watch": "^5.0.1",
77+
"husky": "^2.3.0",
78+
"jasmine-console-reporter": "^3.1.0",
79+
"karma": "^4.1.0",
7980
"karma-chrome-launcher": "^2.2.0",
8081
"karma-edge-launcher": "^0.4.2",
8182
"karma-firefox-launcher": "^1.1.0",
8283
"karma-ie-launcher": "^1.0.0",
83-
"karma-jasmine": "^1.1.2",
84+
"karma-jasmine": "^2.0.1",
8485
"karma-spec-reporter": "^0.0.32",
85-
"lint-staged": "^8.1.5",
86-
"lodash": "^4.17.4",
87-
"lolex": "^1.5.2",
86+
"lint-staged": "^8.1.6",
87+
"lodash": "^4.17.11",
88+
"lolex": "^4.0.1",
8889
"minimist": "^1.2.0",
89-
"mustache": "^2.3.0",
90+
"mustache": "^3.0.1",
9091
"prettier-eslint": "^8.8.2",
9192
"prettier-eslint-cli": "^4.7.1",
92-
"run-sequence": "^1.1.4",
93-
"semver": "^5.3.0",
94-
"through2": "~2.0.0",
95-
"tmp": "0.0.31",
96-
"typescript": "^2.3.4",
97-
"vinyl-buffer": "^1.0.0",
98-
"vinyl-source-stream": "^1.1.0",
99-
"webpack": "^4.19.1"
93+
"run-sequence": "^2.2.1",
94+
"semver": "^6.0.0",
95+
"through2": "~3.0.1",
96+
"tmp": "0.1.0",
97+
"typescript": "^3.4.5",
98+
"vinyl-buffer": "^1.0.1",
99+
"vinyl-source-stream": "^2.0.0",
100+
"webpack": "^4.31.0"
100101
},
101102
"dependencies": {
102-
"babel-runtime": "^6.26.0",
103-
"text-encoding": "^0.6.4",
104-
"uri-js": "^4.2.1"
103+
"@babel/runtime": "^7.4.4",
104+
"text-encoding": "^0.7.0",
105+
"uri-js": "^4.2.2"
105106
}
106107
}

0 commit comments

Comments
 (0)