Skip to content

Commit

Permalink
-Removed plugin folder, moved all code to src/
Browse files Browse the repository at this point in the history
-added more eslint rules for es6
-upped version to 1.1.0
-added PowerQuery version of sped alert, but won't be useful until we move to 9.x
  • Loading branch information
jonesnc committed Nov 2, 2015
1 parent 3122d94 commit a066dd6
Show file tree
Hide file tree
Showing 60 changed files with 232 additions and 764 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["transform-es2015-modules-amd"]
}
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"ecmaFeatures": {
"modules": true,
"templateStrings": true
"templateStrings": true,
"arrowFunctions": true,
"blockBindings": true,
"forOf": true
},
"globals": {
"window": true
Expand Down
89 changes: 87 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
var gulp = require("gulp");
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var config = require('./config.json');

require("../tasks")(gulp);
var minimist = require('minimist');
var del = require('del');
var lazypipe = require('lazypipe');
var runSequence = require('run-sequence');

var knownOptions = {
string: ['env'],
default: {
env: process.env.NODE_ENV || 'pstest2',
'use-babel': true,
}
};

var options = minimist(process.argv.slice(2), knownOptions);

gulp.task('deploy', function() {
return gulp.src([
'dist/web_root/scripts/**',
'dist/web_root/images/**'
], {
base: 'dist/web_root'
})
.pipe(plugins.debug())
.pipe(deploy());
});

gulp.task('build-then-deploy', function(callback) {
return runSequence('build', 'deploy', callback);
});

gulp.task('build', ['build-static', 'babel']);

gulp.task('build-static', function() {
return gulp.src([
'src/**',
'!src/**/*.js',
'!./src/web_root/scripts/**/*',
'!./src/web_root/scripts'
])
.pipe(plugins.debug())
.pipe(gulp.dest('dist'));
});

gulp.task('package', function() {
return gulp.src('dist/**')
.pipe(plugins.debug())
.pipe(plugins.zip('plugin.zip'))
.pipe(gulp.dest('./'));
});

gulp.task('babel', function() {
return gulp.src([
'./src/**/*.js'
], {
base: './src/web_root'
})
.pipe(preprocess())
.pipe(plugins.debug())
.pipe(plugins.if(options['use-babel'], plugins.babel()))
.pipe(gulp.dest('dist/web_root'));
});

var deploy = lazypipe()
.pipe(function() {
var env = options.env;
return plugins.if(config.hasOwnProperty(env), plugins.sftp(config[env].deploy_credentials))
});

var preprocess = lazypipe()
.pipe(function() {
var env = options.env;
return plugins.if(config.hasOwnProperty(env), plugins.preprocess({
context: {
SAMS_URL: config[env].sams_url,
API_URL: config[env].api_url
}
}));
});

gulp.task('lint', function() {
return gulp.src('src/**/*.js')
.pipe(plugins.eslint())
.pipe(plugins.eslint.format());
});
17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,20 @@
"bugs": {
"url": "https://github.com/IronCountySchoolDistrict/iep-alert/issues"
},
"homepage": "https://github.com/IronCountySchoolDistrict/iep-alert#readme"
"homepage": "https://github.com/IronCountySchoolDistrict/iep-alert#readme",
"devDependencies": {
"babel": "^6.*",
"babel-plugin-transform-es2015-modules-amd": "^6.0.15",
"eslint": "^1.7.3",
"gulp": "^3.9.0",
"gulp-babel": "^6.*",
"gulp-debug": "^2.1.2",
"gulp-if": "^2.0.0",
"gulp-preprocess": "^1.2.0",
"gulp-sftp": "^0.1.5",
"gulp-zip": "^3.0.2",
"preprocessor": "^1.4.0",
"requirejs-babel": "0.0.8",
"run-sequence": "^1.1.4"
}
}
11 changes: 0 additions & 11 deletions plugin/plugin.xml

This file was deleted.

24 changes: 0 additions & 24 deletions plugin/user_schema_root/u_sped.xml

This file was deleted.

13 changes: 0 additions & 13 deletions plugin/web_root/admin/alerts/iepalert.html

This file was deleted.

19 changes: 0 additions & 19 deletions plugin/web_root/admin/json/alert.json.html

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions plugin/web_root/admin/students/more2.iepalert.leftnav.footer.txt

This file was deleted.

This file was deleted.

Loading

0 comments on commit a066dd6

Please sign in to comment.