Skip to content

Commit

Permalink
ONL-4148: Upgrade vulnerable versions found on dependencies (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
matallo authored Jan 3, 2020
1 parent 56f424a commit 76ce99a
Show file tree
Hide file tree
Showing 8 changed files with 4,846 additions and 3,709 deletions.
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"@babel/preset-env"
]
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
dist/*/*
dist/
.idea
.awspublish-*
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2020-01-03
### Fixes
- Upgrade vulnerable versions found on dependencies.

## [1.6.4] - 2019-09-12
### Fixes
- Remove `--delete` option from deploy command.
Expand Down
2 changes: 0 additions & 2 deletions dist/huha.js

This file was deleted.

70 changes: 70 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import del from 'del';
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import packageJson from './package.json';
import browserify from 'browserify';
import babelify from 'babelify';
import source from 'vinyl-source-stream';
import buffer from 'vinyl-buffer';

const { src, dest, series } = require('gulp');

const $ = gulpLoadPlugins();

const VERSION = packageJson.version;
const buildFolder = 'dist';
const versionedBuildFolder = `${buildFolder}/${VERSION}`;
const devBuildFolder = `${buildFolder}/dev`;

const clean = () => del(['dist']);

const lint = () => src('src/**/*.js')
.pipe($.eslint({
fix: true,
}))
.pipe($.eslint.format())
.pipe($.eslint.failAfterError())
.pipe(dest('src'));

const build = () => {
const b = browserify({
entries: 'src/huha.js',
debug: true,
transform: babelify,
standalone: 'Huha',
});

return b.bundle()
.pipe(source('huha.js'))
.pipe(buffer())
.pipe($.sourcemaps.init({ loadMaps: true }))
.pipe($.uglify())
.pipe($.sourcemaps.write('./'))
.pipe($.size({ title: 'build', gzip: true }))
.pipe(dest(buildFolder))
.pipe(dest(versionedBuildFolder))
.pipe(dest(devBuildFolder));
};

const deploy = () => {
const publisher = $.awspublish.create({
'params': {
'Bucket': process.env.HUHA_S3_BUCKET
},
'accessKeyId': process.env.HUHA_S3_ACCESS_KEY_ID,
'secretAccessKey': process.env.HUHA_S3_SECRET_ACCESS_KEY,
});

const headers = {
'Cache-Control': 'max-age=315360000, no-transform, public'
};

return src('dist/**/*.*')
.pipe(publisher.publish(headers))
.pipe($.awspublish.reporter());
};

gulp.task('lint', lint);
gulp.task('deploy', series(clean, build, deploy));
gulp.task('build', series(clean, build));
gulp.task('default', series(clean, build));
75 changes: 0 additions & 75 deletions gulpfile.js

This file was deleted.

Loading

0 comments on commit 76ce99a

Please sign in to comment.