Skip to content

Commit 27a1435

Browse files
author
Peter Kerpedjiev
committed
Added files from yeoman
1 parent 1bb9967 commit 27a1435

18 files changed

+209
-26
lines changed

.babelrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015"]
3+
}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
**/*.swp
55
**/.DS_Store
66
bower_components/**
7+
node_modules/**
8+
.tmp/**

app/apple-touch-icon.png

6.54 KB
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

app/favicon.ico

4.19 KB
Binary file not shown.

index.html app/index.html

File renamed without changes.

app/robots.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# robotstxt.org/
2+
3+
User-agent: *
4+
Disallow:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

closure-compiler

Submodule closure-compiler deleted from 377d901

gulpfile.babel.js

+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
// generated on 2016-01-26 using generator-gulp-webapp 1.1.1
2+
require('es6-promise').polyfill();
3+
4+
import gulp from 'gulp';
5+
import gulpLoadPlugins from 'gulp-load-plugins';
6+
import browserSync from 'browser-sync';
7+
import del from 'del';
8+
import {stream as wiredep} from 'wiredep';
9+
10+
const $ = gulpLoadPlugins();
11+
const reload = browserSync.reload;
12+
13+
gulp.task('styles', () => {
14+
return gulp.src('app/styles/*.css')
15+
.pipe($.sourcemaps.init())
16+
.pipe($.autoprefixer({browsers: ['> 1%', 'last 2 versions', 'Firefox ESR']}))
17+
.pipe($.sourcemaps.write())
18+
.pipe(gulp.dest('.tmp/styles'))
19+
.pipe(reload({stream: true}));
20+
});
21+
22+
gulp.task('scripts', () => {
23+
return gulp.src('app/scripts/**/*.js')
24+
.pipe($.plumber())
25+
.pipe($.sourcemaps.init())
26+
.pipe($.babel())
27+
.pipe($.sourcemaps.write('.'))
28+
.pipe(gulp.dest('.tmp/scripts'))
29+
.pipe(reload({stream: true}));
30+
});
31+
32+
function lint(files, options) {
33+
return () => {
34+
return gulp.src(files)
35+
.pipe(reload({stream: true, once: true}))
36+
.pipe($.eslint(options))
37+
.pipe($.eslint.format())
38+
.pipe($.if(!browserSync.active, $.eslint.failAfterError()));
39+
};
40+
}
41+
const testLintOptions = {
42+
env: {
43+
mocha: true
44+
}
45+
};
46+
47+
gulp.task('lint', lint('app/scripts/**/*.js'));
48+
gulp.task('lint:test', lint('test/spec/**/*.js', testLintOptions));
49+
50+
gulp.task('html', ['styles', 'scripts'], () => {
51+
return gulp.src('app/*.html')
52+
.pipe($.useref({searchPath: ['.tmp', 'app', '.']}))
53+
.pipe($.if('*.js', $.uglify()))
54+
.pipe($.if('*.css', $.cssnano()))
55+
.pipe($.if('*.html', $.htmlmin({collapseWhitespace: true})))
56+
.pipe(gulp.dest('dist'));
57+
});
58+
59+
gulp.task('images', () => {
60+
return gulp.src('app/images/**/*')
61+
.pipe($.if($.if.isFile, $.cache($.imagemin({
62+
progressive: true,
63+
interlaced: true,
64+
// don't remove IDs from SVGs, they are often used
65+
// as hooks for embedding and styling
66+
svgoPlugins: [{cleanupIDs: false}]
67+
}))
68+
.on('error', function (err) {
69+
console.log(err);
70+
this.end();
71+
})))
72+
.pipe(gulp.dest('dist/images'));
73+
});
74+
75+
gulp.task('fonts', () => {
76+
return gulp.src(require('main-bower-files')('**/*.{eot,svg,ttf,woff,woff2}', function (err) {})
77+
.concat('app/fonts/**/*'))
78+
.pipe(gulp.dest('.tmp/fonts'))
79+
.pipe(gulp.dest('dist/fonts'));
80+
});
81+
82+
gulp.task('extras', () => {
83+
return gulp.src([
84+
'app/*.*',
85+
'!app/*.html'
86+
], {
87+
dot: true
88+
}).pipe(gulp.dest('dist'));
89+
});
90+
91+
gulp.task('clean', del.bind(null, ['.tmp', 'dist']));
92+
93+
gulp.task('serve', ['styles', 'scripts', 'fonts'], () => {
94+
browserSync({
95+
notify: false,
96+
port: 9000,
97+
server: {
98+
baseDir: ['.tmp', 'app'],
99+
routes: {
100+
'/bower_components': 'bower_components'
101+
}
102+
}
103+
});
104+
105+
gulp.watch([
106+
'app/*.html',
107+
'.tmp/scripts/**/*.js',
108+
'app/images/**/*',
109+
'.tmp/fonts/**/*'
110+
]).on('change', reload);
111+
112+
gulp.watch('app/styles/**/*.css', ['styles']);
113+
gulp.watch('app/scripts/**/*.js', ['scripts']);
114+
gulp.watch('app/fonts/**/*', ['fonts']);
115+
gulp.watch('bower.json', ['wiredep', 'fonts']);
116+
});
117+
118+
gulp.task('serve:dist', () => {
119+
browserSync({
120+
notify: false,
121+
port: 9000,
122+
server: {
123+
baseDir: ['dist']
124+
}
125+
});
126+
});
127+
128+
gulp.task('serve:test', ['scripts'], () => {
129+
browserSync({
130+
notify: false,
131+
port: 9000,
132+
ui: false,
133+
server: {
134+
baseDir: 'test',
135+
routes: {
136+
'/scripts': '.tmp/scripts',
137+
'/bower_components': 'bower_components'
138+
}
139+
}
140+
});
141+
142+
gulp.watch('app/scripts/**/*.js', ['scripts']);
143+
gulp.watch('test/spec/**/*.js').on('change', reload);
144+
gulp.watch('test/spec/**/*.js', ['lint:test']);
145+
});
146+
147+
// inject bower components
148+
gulp.task('wiredep', () => {
149+
gulp.src('app/*.html')
150+
.pipe(wiredep({
151+
ignorePath: /^(\.\.\/)*\.\./
152+
}))
153+
.pipe(gulp.dest('app'));
154+
});
155+
156+
gulp.task('build', ['lint', 'html', 'images', 'fonts', 'extras'], () => {
157+
return gulp.src('dist/**/*').pipe($.size({title: 'build', gzip: true}));
158+
});
159+
160+
gulp.task('default', ['clean'], () => {
161+
gulp.start('build');
162+
});

package.json

+38-25
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
{
2-
"name": "fornac",
3-
"version": "1.0.0",
4-
"description": "An RNA secondary structure display library",
5-
"main": "js/fornac.js",
6-
"directories": {
7-
"doc": "doc",
8-
"example": "examples",
9-
"test": "test"
2+
"private": true,
3+
"engines": {
4+
"node": ">=0.12.0"
105
},
11-
"scripts": {
12-
"test": "echo \"Error: no test specified\" && exit 1"
6+
"devDependencies": {
7+
"babel-core": "^6.4.0",
8+
"babel-preset-es2015": "^6.3.13",
9+
"browser-sync": "^2.2.1",
10+
"del": "^1.1.1",
11+
"gulp": "^3.9.0",
12+
"gulp-autoprefixer": "^3.0.1",
13+
"gulp-babel": "^6.1.1",
14+
"gulp-cache": "^0.2.8",
15+
"gulp-cssnano": "^2.0.0",
16+
"gulp-eslint": "^0.13.2",
17+
"gulp-htmlmin": "^1.3.0",
18+
"gulp-if": "^1.2.5",
19+
"gulp-imagemin": "^2.2.1",
20+
"gulp-load-plugins": "^0.10.0",
21+
"gulp-plumber": "^1.0.1",
22+
"gulp-size": "^1.2.1",
23+
"gulp-sourcemaps": "^1.5.0",
24+
"gulp-uglify": "^1.1.0",
25+
"gulp-useref": "^3.0.0",
26+
"main-bower-files": "^2.5.0",
27+
"wiredep": "^2.2.2"
1328
},
14-
"repository": {
15-
"type": "git",
16-
"url": "git+https://github.com/pkerpedjiev/fornac.git"
17-
},
18-
"keywords": [
19-
"RNA",
20-
"secondary-structure",
21-
"bioinformatics"
22-
],
23-
"author": "Peter Kerpedjiev",
24-
"license": "MIT",
25-
"bugs": {
26-
"url": "https://github.com/pkerpedjiev/fornac/issues"
27-
},
28-
"homepage": "https://github.com/pkerpedjiev/fornac#readme"
29+
"eslintConfig": {
30+
"env": {
31+
"es6": true,
32+
"node": true,
33+
"browser": true
34+
},
35+
"rules": {
36+
"quotes": [
37+
2,
38+
"single"
39+
]
40+
}
41+
}
2942
}

0 commit comments

Comments
 (0)