Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global: improvement of project structure #12

Merged
merged 1 commit into from
Aug 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/simple/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<script src='./node_modules/tv4/tv4.js'></script>
<script src='./node_modules/angular-schema-form/dist/schema-form.js'></script>
<script src='./node_modules/angular-schema-form/dist/bootstrap-decorator.js'></script>
<script src="/src/invenio-records-js/invenioRecords.module.js"></script>
<script src="/dist/invenio-records-js.js"></script>
<script src="./static/app.js"></script>
<style>
body {
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@

(function (angular) {
angular.module('invenioRecordsDemo', [
'invenioRecords', 'schemaForm'
'invenioRecords'
]);
})(angular);
28 changes: 18 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ var sourceDirectory = path.join(rootDirectory, './src');

var sourceFiles = [

// Make sure module files are handled first
path.join(sourceDirectory, '/**/*.module.js'),
// Then add all JavaScript files
path.join(sourceDirectory, '/*.js'),

// Then add all JavaScript files
path.join(sourceDirectory, '/**/*.js'),
Expand All @@ -69,7 +69,7 @@ var lintFiles = [
*/

// run all the build tasks
gulp.task('build', ['clean.build'], function (done) {
gulp.task('build', ['clean.build'], function(done) {
runSequence(
'build.src', 'build.templates', done
);
Expand All @@ -80,6 +80,8 @@ gulp.task('build.src', function() {
gulp.src(sourceFiles)
.pipe(plugins.plumber())
.pipe(plugins.concat('invenio-records-js.js'))
.pipe(plugins.stripComments())
.pipe(plugins.header(licences.javascript))
.pipe(gulp.dest('./dist/'))
.pipe(plugins.uglify())
.pipe(plugins.rename('invenio-records-js.min.js'))
Expand All @@ -99,12 +101,12 @@ gulp.task('build.templates', function() {
*/

// Run test once and exit
gulp.task('test', function (done) {
gulp.task('test', function(done) {
runSequence('test.jshint', 'test.src', done);
});

// check jshint
gulp.task('test.jshint', function () {
gulp.task('test.jshint', function() {
return gulp.src(lintFiles)
.pipe(plugins.plumber())
.pipe(plugins.jshint())
Expand All @@ -113,15 +115,15 @@ gulp.task('test.jshint', function () {
});

// test sources
gulp.task('test.src', function (done) {
gulp.task('test.src', function(done) {
karma.start({
configFile: __dirname + '/karma-src.conf.js',
singleRun: true
}, done);
});

// coveralls
gulp.task('coveralls', function () {
gulp.task('coveralls', function() {
return gulp.src('coverage/**/lcov.info')
.pipe(plugins.coveralls());
});
Expand All @@ -131,14 +133,20 @@ gulp.task('coveralls', function () {
* Demo
*/

gulp.task('demo', function() {
// run the demo
gulp.task('demo.run', function() {
gulp.src(rootDirectory)
.pipe(plugins.webserver({
livereload: true,
open: '/examples/index.html'
}));
});

// run build and then the demo
gulp.task('demo', function(done) {
runSequence('build', 'demo.run', done);
});

/**
* Clean tasks
*/
Expand All @@ -152,7 +160,7 @@ gulp.task('clean.build', function() {
* Watch
*/

gulp.task('watch', function () {
gulp.task('watch', function() {
// Watch JavaScript files
gulp.watch(sourceFiles, ['test']);
});
Expand All @@ -161,6 +169,6 @@ gulp.task('watch', function () {
* Default taks
*/

gulp.task('default', function () {
gulp.task('default', function() {
runSequence('test', 'watch');
});
9 changes: 7 additions & 2 deletions karma-src.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ module.exports = function(config) {
'node_modules/angular-schema-form/dist/schema-form.js',
'node_modules/angular-schema-form/dist/bootstrap-decorator.js',
'node_modules/angular-schema-form-dynamic-select/angular-schema-form-dynamic-select.js',
'src/*/*.js',
'src/**/*.js',
'src/**/*.html',
'test/unit/**/*.js',
Expand All @@ -89,8 +90,12 @@ module.exports = function(config) {

// Coverage reporter
coverageReporter: {
type: 'lcov',
dir: 'coverage/'
dir: 'coverage/',
reporters: [
{type: 'text'},
{type: 'html', subdir: 'report-html'},
{type: 'lcov', subdir: 'report-lcov'}
]
},


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"gulp-load-plugins": "^1.1.0",
"gulp-plumber": "^0.6.6",
"gulp-rename": "^1.2.0",
"gulp-strip-comments": "^2.4.3",
"gulp-uglify": "^0.3.1",
"gulp-webserver": "^0.9.1",
"istanbul": "^0.4.1",
"jquery": "^2.1.4",
"jsdoc": "^3.4.0",
"jshint-stylish": "^0.4.0",
Expand Down