Skip to content

Commit

Permalink
Merge pull request #6 from IronCountySchoolDistrict/update19
Browse files Browse the repository at this point in the history
Update19
  • Loading branch information
Basiczombie authored Jul 2, 2019
2 parents e371829 + 6e4da0b commit 7221fcb
Show file tree
Hide file tree
Showing 12 changed files with 5,393 additions and 1,355 deletions.
6 changes: 4 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"presets": ["@babel/es2015"]
}
"presets": [
"@babel/preset-env"
]
}
23 changes: 23 additions & 0 deletions gulp.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"image_server_name": {
"ps_url": "",
"deploy_credentials": {
"host": "",
"user": "",
"pass": "",
"remotePath": ""
}
},

"image_server_name2": {
"ps_url": "https://ps.example.com",
"deploy_credentials": {
"host": "sftp_host",
"user": "user",
"pass": "password",
"remotePath": "/path/to/assets/folder"
}
},

"default_deploy_target": "image_server_name"
}
8 changes: 5 additions & 3 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import gulp from 'gulp';
import psTasks from 'gulp-ps-tasks';
import * as psTasks from 'gulp4-ps-tasks'

psTasks(gulp, __dirname);
// Parse the exports gulp tasks from index.js
Object.keys(psTasks).forEach(key => {
module.exports[key] = psTasks[key]
})
29 changes: 24 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,29 @@
},
"homepage": "https://github.com/IronCountySchoolDistrict/iep-alert#readme",
"devDependencies": {
"@babel/cli": "^7.0.0-beta.51",
"@babel/preset-es2015": "^7.0.0-beta.51",
"@babel/register": "^7.0.0-beta.51",
"gulp": "^3.9.1",
"gulp-ps-tasks": "^0.7.0"
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.4",
"@babel/plugin-transform-modules-amd": "^7.2.0",
"@babel/plugin-transform-modules-commonjs": "^7.4.4",
"@babel/plugin-transform-regenerator": "^7.4.5",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.3.4",
"@babel/register": "^7.0.0",
"babel-loader": "^8.0.6",
"css-loader": "^3.0.0",
"file-loader": "^4.0.0",
"gulp": "^4.0.2",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.7.0",
"pkginfo": "^0.4.1",
"sass-loader": "^7.1.0",
"underscore": "^1.9.1",
"webpack": "^4.35.0",
"webpack-merge": "^4.2.1"
},
"dependencies": {
"@babel/runtime": "^7.4.5",
"gulp4-ps-tasks": "^0.1.9"
}
}
2 changes: 1 addition & 1 deletion plugin/web_root/admin/students/studentpages/power-iep.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
JOIN students ON u_def_ext_students.studentsdcid = students.dcid
WHERE students.id = ~(curstudid)]~(checked)[/tlist_sql]
data-toggle="toggle"
data-on="<div>PowerIEP</div><div>Referral</div>" data-off="<div>Not referred</div><div>to PowerIEP</div>"
data-on="<div>embraceIEP</div><div>Referral</div>" data-off="<div>Not referred</div><div>to embraceIEP</div>"
data-onstyle="success"
data-offstyle="danger" />

Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion plugin/web_root/wildcards/alert.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
require.config({
paths: {
alert: '/scripts/iep-alert/js/alert',
fetch: '//cdnjs.cloudflare.com/ajax/libs/fetch/0.9.0/fetch'
fetch: '//cdnjs.cloudflare.com/ajax/libs/fetch/1.0.0/fetch'
}
});

Expand Down
1 change: 0 additions & 1 deletion src/scripts/iep-alert/js/attendance-alert.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*global require, $, _, psData*/
import $ from 'jquery';
import _ from 'underscore';
import Promise from 'bluebird';

export default function() {
var studentRows = $('.studentrow');
Expand Down
83 changes: 83 additions & 0 deletions webpack.common.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import path from 'path'
import webpack from 'webpack'
import pkgInfo from 'pkginfo'

pkgInfo(module)

const config = {
entry: {
'alert-content': `./src/scripts/${module.exports.name}/js/alert-content.js`,
alert: `./src/scripts/${module.exports.name}/js/alert.js`,
'attendance-alert': `./src/scripts/${module.exports.name}/js/attendance-alert.js`,
},
performance: {
hints: false
},
externals: {
jquery: 'jquery',
underscore: 'underscore'
},
optimization: {
splitChunks: {
name: true,
cacheGroups: {
index: {
test: /static\/js/
},
vendors: {
test: /([\\/]node_modules[\\/])/,
name: 'vendor',
chunks: 'all'
}
}
}
},
module: {
rules: [
{
test: /\.(png|svg|gif|jpg)$/,
loader: 'file-loader',
options: {
name: path.resolve(__dirname,`./src/images/${module.exports.name}/[name].[ext]`),
},
},
{
test: /\.(html)$/,
use: {
loader: 'html-loader',
options: { minimize: true }
}
},
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: [
"@babel/plugin-transform-modules-amd",
"@babel/plugin-transform-regenerator",
"@babel/plugin-transform-runtime",
]
}
}
]
},
plugins: [
new webpack.NamedModulesPlugin(),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
createDayLabel: "jquery",
createWeekdayLabel: "jquery"
}),
],
resolve: {
modules: ['src', 'node_modules'],
extensions: ['.js', '.css'],
}

}

export default config
73 changes: 73 additions & 0 deletions webpack.dev.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import path from 'path'
import webpack from 'webpack'
import merge from 'webpack-merge'
import HtmlWebpackPlugin from 'html-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import DashboardPlugin from 'webpack-dashboard/plugin'
import BrowserSyncPlugin from 'browser-sync-webpack-plugin'

import common from './webpack.common.babel'

export default merge(common, {
devtool: 'inline-source-map',
mode: 'development',
output: {
path: path.resolve(__dirname, './src/public/dist/'),
filename: `[name].bundle.js`,
publicPath: '/'
},
module: {
rules: [
{
test: /\.(sc|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
includePaths: [
path.resolve(__dirname, 'node_modules/')
]
}
},
'css-loader',
'sass-loader'
]
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin({ multiStep: true }),
new MiniCssExtractPlugin({
filename: '[name].bundle.css'
}),
new HtmlWebpackPlugin({
template: './src/html/template.html',
inject: 'body'
}),
new BrowserSyncPlugin({
host: '0.0.0.0',
port: 3001,
proxy: 'http://localhost:3000/',
reload: false,
open: false
})
],
devServer: {
headers: {
'Access-Control-Allow-Origin': '*'
},
contentBase: './src/public',
compress: true,
host: '0.0.0.0',
port: '3000',
bonjour: true,
hot: true,
historyApiFallback: true,
inline: true,
clientLogLevel: 'error',
watchOptions: {
aggregateTimeout: 500,
poll: 1000
}
}
})
45 changes: 45 additions & 0 deletions webpack.prod.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import path from 'path'
import webpack from 'webpack'
import merge from 'webpack-merge'
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import pkgInfo from 'pkginfo'

import common from './webpack.common.babel'

pkgInfo(module)

export default merge(common, {
mode: 'production',
// devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'dist/web_root'),
filename: `scripts/${module.exports.name}/js/[name].js`,
publicPath: 'https://ps.irondistrict.org',
library: '[name]',
libraryTarget: 'amd'
},
module: {
rules: [
{
test: /\.(sc|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
includePaths: [
path.resolve(__dirname, 'node_modules/')
]
}
},
'css-loader',
'sass-loader'
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: `scripts/${module.exports.name}/css/[name].css`
})
]
})
Loading

0 comments on commit 7221fcb

Please sign in to comment.