mirror of
https://github.com/valitydev/swag-payments.git
synced 2024-11-06 01:25:22 +00:00
Migrate to new gulp & gulpfile version by sheer incompetence
This commit is contained in:
parent
58cce8f713
commit
75cacf5fa4
56
gulpfile.js
56
gulpfile.js
@ -10,8 +10,34 @@ const swaggerRepo = require('swagger-repo');
|
||||
const DIST_DIR = 'web_deploy';
|
||||
const SPEC_DIR = 'spec';
|
||||
|
||||
gulp.task('serve', ['build', 'watch', 'edit'], function () {
|
||||
portfinder.getPort({port: 3000}, function (err, port) {
|
||||
|
||||
gulp.task('build', function (cb) {
|
||||
exec('npm run build', function (err, stdout, stderr) {
|
||||
console.log(stderr);
|
||||
cb(err);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
gulp.task('edit', function () {
|
||||
portfinder.getPort({ port: 5000 }, function (err, port) {
|
||||
let app = connect();
|
||||
app.use(swaggerRepo.swaggerEditorMiddleware());
|
||||
app.listen(port);
|
||||
util.log(util.colors.green('swagger-editor started http://localhost:' + port));
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('reload', gulp.series('build', function () {
|
||||
gulp.src(DIST_DIR).pipe(gulpConnect.reload())
|
||||
}));
|
||||
|
||||
gulp.task('watch', function () {
|
||||
gulp.watch([`${SPEC_DIR}/**/*`, 'web/**/*'], gulp.series('reload'));
|
||||
});
|
||||
|
||||
gulp.task('serve', gulp.parallel('build', 'edit', 'watch', function () {
|
||||
portfinder.getPort({ port: 3000 }, function (err, port) {
|
||||
gulpConnect.server({
|
||||
root: [DIST_DIR],
|
||||
livereload: true,
|
||||
@ -23,28 +49,4 @@ gulp.task('serve', ['build', 'watch', 'edit'], function () {
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('edit', function () {
|
||||
portfinder.getPort({port: 5000}, function (err, port) {
|
||||
let app = connect();
|
||||
app.use(swaggerRepo.swaggerEditorMiddleware());
|
||||
app.listen(port);
|
||||
util.log(util.colors.green('swagger-editor started http://localhost:' + port));
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('build', function (cb) {
|
||||
exec('npm run build', function (err, stdout, stderr) {
|
||||
console.log(stderr);
|
||||
cb(err);
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('reload', ['build'], function () {
|
||||
gulp.src(DIST_DIR).pipe(gulpConnect.reload())
|
||||
});
|
||||
|
||||
gulp.task('watch', function () {
|
||||
gulp.watch([`${SPEC_DIR}/**/*`, 'web/**/*'], ['reload']);
|
||||
});
|
||||
}));
|
||||
|
@ -6,15 +6,14 @@
|
||||
"connect": "^3.4.1",
|
||||
"cors": "^2.7.1",
|
||||
"deploy-to-gh-pages": "^1.1.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-connect": "^4.2.0",
|
||||
"gulp-util": "^3.0.7",
|
||||
"json-merge-patch": "^0.2.3",
|
||||
"npm": "^5.7.1",
|
||||
"portfinder": "^1.0.3",
|
||||
"shelljs": "^0.7.0",
|
||||
"swagger-repo": "^1.0.0",
|
||||
"swagger-ui": "^2.1.4",
|
||||
"json-merge-patch": "^0.2.3"
|
||||
"swagger-ui": "^2.1.4"
|
||||
},
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@ -22,5 +21,8 @@
|
||||
"swagger": "swagger-repo",
|
||||
"test": "swagger-repo validate",
|
||||
"start": "gulp serve"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp": "github:gulpjs/gulp"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user