Skip to content

Commit

Permalink
Cleanups (#851)
Browse files Browse the repository at this point in the history
* clean up the readme a bit

* add some more comments to babelrc

* remove unused declaration "module" from index.js

* rearrange all route folders

and switch them to using absolute imports

* clean up the webpack output a bit

* inline the prebuild/prestart scripts for npm

* cease creating several tiny route bundles
  • Loading branch information
hawkrives authored Aug 29, 2016
1 parent cdd4b6e commit 295fcd0
Show file tree
Hide file tree
Showing 94 changed files with 191 additions and 200 deletions.
2 changes: 2 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"transform-class-properties",
// { ...todo, completed: true }
"transform-object-rest-spread",
// embeds the react tag name into the component
"transform-react-display-name",
// these two together prevent us from defining the helpers in every module
"external-helpers",
"transform-runtime",
// turns `import {sum} from 'lodash'`
Expand Down
14 changes: 11 additions & 3 deletions .webpackrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const config = {
replace: null,
port: 3000, // for webpack-dev-server

stats: {},
stats: {colors: false},

entry: {
main: ['./src/index.js'],
Expand All @@ -64,9 +64,17 @@ const config = {
},

devServer: {
// If these are enabled, then historyApiFallback doesn't work.
// If `info` is enabled, then historyApiFallback doesn't work.
// info: false,
// stats: 'errors-only',
stats: {
colors: false,
assets: false,
version: false,
hash: false,
timings: false,
chunks: false,
chunkModules: false,
},
contentBase: outputFolder,

// Makes webpack serve /index.html as the response to any request to
Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
[![Build Status](https://travis-ci.org/hawkrives/gobbldygook.svg?branch=master)](https://travis-ci.org/hawkrives/gobbldygook)
[![Code Coverage](https://coveralls.io/repos/hawkrives/gobbldygook/badge.svg?branch=master&service=github)](https://coveralls.io/github/hawkrives/gobbldygook?branch=master)

This is a course scheduler for students at St. Olaf College. You give it your areas of study (majors, concentrations, degrees), the courses you *have* taken and are *planning* on taking, and it tells you if you can graduate or not.
This is a course scheduler for students at St. Olaf College. You give it your areas of study (majors, concentrations, degrees), the courses you *have* taken and are *planning* to take, and it tells you if you can graduate or not.

We have a [trello board](https://trello.com/b/cviTwkre) where we track which areas of study we are working on; if you have one in particular that you want us to work on next, let us know by either voting on the Trello card or emailing us!


## Playing
1. Visit https://stolaf.edu/people/rives/g
1. Visit https://hawkrives.github.io/gobbldygook
– Gobbldygook currently supports every major browser, except for Safari (so Chrome, Firefox, Internet Explorer 11, and Microsoft Edge). (Addendum: IE support is currently broken. Unsure why. It's on the TODO list.)
– Let's just say that Safari's database support is … a bit lacking.
– On iOS devices, every browser is required to use Safari internally, which means that Chrome, Opera, and Safari on iOS all have the same terrible database support.
Expand All @@ -23,7 +23,7 @@ We have a [trello board](https://trello.com/b/cviTwkre) where we track which are


## Hacking
- Prerequisites: [node.js](https://nodejs.org) and [git](https://git-scm.com).
- Prerequisites: [node.js, at least v6](https://nodejs.org) and [git](https://git-scm.com).
- `git clone https://github.com/hawkrives/gobbldygook.git`
- `cd gobbldygook`
- `npm install`
Expand All @@ -33,26 +33,21 @@ You can see additional commands by executing `npm run` with no arguments.


## Support
You can file an issue via [github](https://github.com/hawkrives/gobbldygook/issues/), or you can send us an email, if you look us up on Stalkernet.
You can file an issue via [github](https://github.com/hawkrives/gobbldygook/issues/), or you can send an email to the email listed on my Github profile.


## Credits
- Initial concept from @xandrasings
- Final project for Software Design, @hawkrives and @xandrasings
- So much of the internet.
- Teammate for January 2015: @drewvolz
- Professor Hanson, for agreeing to be our advisor over Interim
- Professor Hanson, for agreeing to be our advisor over Interim 2014


## Screenshot
## Screenshots

### 2015 – September
![Screenshot, september 2015](./screenshots/september-2015.png)

### 2014 - September
![Screenshot, september 2014](./screenshots/september-2014.png)


## Misc.

- The svg sprite in /src/static was generated by `svg-sprite-generate -d src/icons/ionicons/ -o src/static/ionicons.svg`
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Hawken MacKay Rives",
"license": "MIT",
"scripts": {
"build": "cross-env NODE_ENV=production webpack --config .webpackrc.js --bail --production --progress",
"build": "npm run copy && cross-env NODE_ENV=production webpack --config .webpackrc.js --bail --production --progress",
"build-ci": "npm run build -- --no-progress",
"build-dev": "cross-env NODE_ENV=development webpack --config .webpackrc.js --bail --progress --devtool=source-map",
"build-peg": "pegjs < src/area-tools/parse-hanson-string.pegjs | ./scripts/babel-stdin.js | js-beautify -f - --end-with-newline --indent-with-tabs > src/area-tools/parse-hanson-string.js",
Expand All @@ -18,11 +18,9 @@
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"deploy": "bash scripts/deploy.sh",
"lint": "eslint *.js bin/ scripts/ src/ test/",
"prebuild": "npm run copy",
"prestart": "npm run copy",
"profile": "cat profile/README.md",
"serve-production": "cross-env NODE_ENV=production webpack-dev-server --config .webpackrc.js --progress",
"start": "cross-env NODE_ENV=development webpack-dev-server --config .webpackrc.js --progress",
"start": "npm run copy && cross-env NODE_ENV=development webpack-dev-server --config .webpackrc.js --progress",
"stats": "cross-env NODE_ENV=production npm run stats-base",
"stats-base": "webpack --config .webpackrc.js --bail --profile --json > stats.json && echo 'open http://webpack.github.io/analyse/'",
"stats-dev": "cross-env NODE_ENV=development npm run stats-base",
Expand Down
2 changes: 1 addition & 1 deletion src/containers/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ App.propTypes = {
overlay: PropTypes.node,
}

import StudentPicker from '../routes/app_content_student-picker/containers/student-picker'
import StudentPicker from '../routes/index/containers/student-picker'
App.defaultProps = {
content: <StudentPicker />,
}
Expand Down
2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* globals module */

// Set up the default promise implementation as Bluebird
import Bluebird from 'bluebird'
Bluebird.config({
Expand Down
3 changes: 0 additions & 3 deletions src/routes/app_content_student/containers/blank.js

This file was deleted.

25 changes: 0 additions & 25 deletions src/routes/app_content_student/index.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {PropTypes} from 'react'

import Button from '../../../components/button'
import Toolbar from '../../../components/toolbar'
import Button from 'src/components/button'
import Toolbar from 'src/components/toolbar'

export default function ScreenToolbar({onNext, onBack}) {
return (
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ export default {
}, 'new-student.index')
},
getChildRoutes(location, cb) {
require.ensure([], () => {
cb(null, [
require('./routes/sis').default, // create/sis
require('./routes/manual').default, // create/manual
require('./routes/drive').default, // create/drive
require('./routes/upload').default, // create/upload
])
}, 'new-student.routes')
cb(null, [
require('./routes/sis').default, // create/sis
require('./routes/manual').default, // create/manual
require('./routes/drive').default, // create/drive
require('./routes/upload').default, // create/upload
])
},
getComponents(location, cb) {
require.ensure([], () => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {Component, PropTypes} from 'react'
import Button from '../../../../components/button'
import Button from 'src/components/button'
import cx from 'classnames'
import Autosize from 'react-input-autosize'
import Select from 'react-select'
Expand All @@ -8,8 +8,8 @@ import withRouter from 'react-router/lib/withRouter'
import map from 'lodash/map'
import filter from 'lodash/filter'
import 'react-select/dist/react-select.css'
import { initStudent } from '../../../../redux/students/actions/init-student'
import filterAreaList from '../../../../helpers/filter-area-list'
import { initStudent } from 'src/redux/students/actions/init-student'
import filterAreaList from 'src/helpers/filter-area-list'

import './manual.scss'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../styles/variables.scss';
@import 'src/styles/variables.scss';

.manual .autosize-input > input {
border: 0;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, {Component, PropTypes} from 'react'
import serializeError from 'serialize-error'
import Button from '../../../../components/button'
import getStudentInfo, {checkIfLoggedIn} from '../../../../helpers/import-student'
import convertStudent from '../../../../helpers/convert-imported-student'
import StudentSummary from '../../../../routes/app_content_student/components/student-summary'
import Button from 'src/components/button'
import getStudentInfo, {checkIfLoggedIn} from 'src/helpers/import-student'
import convertStudent from 'src/helpers/convert-imported-student'
import StudentSummary from 'src/routes/student/components/student-summary'
import map from 'lodash/map'
import groupBy from 'lodash/groupBy'
import sortBy from 'lodash/sortBy'
import semesterName from '../../../../helpers/semester-name'
import semesterName from 'src/helpers/semester-name'
import { RadioGroup, Radio } from 'react-radio-group'
import { initStudent } from '../../../../redux/students/actions/init-student'
import { initStudent } from 'src/redux/students/actions/init-student'
import { connect } from 'react-redux'
import withRouter from 'react-router/lib/withRouter'

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React, {Component, PropTypes} from 'react'
import DropZone from 'react-dropzone'
import map from 'lodash/map'
import Button from '../../../../components/button'
import List from '../../../../components/list'
import StudentSummary from '../../../../routes/app_content_student/components/student-summary'
import { initStudent } from '../../../../redux/students/actions/init-student'
import Button from 'src/components/button'
import List from 'src/components/list'
// TODO: Move this component to src/components
import StudentSummary from 'src/routes/student/components/student-summary'
import { initStudent } from 'src/redux/students/actions/init-student'
import withRouter from 'react-router/lib/withRouter'
import { connect } from 'react-redux'

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import Button from '../../../../components/button'
import Button from 'src/components/button'

export default function WelcomeScreen() {
return <div>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import find from 'lodash/find'
import filter from 'lodash/filter'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import { loadAllAreas } from '../../../redux/areas/actions'
import { loadAllAreas } from 'src/redux/areas/actions'

import Loading from '../../../components/loading'
import Loading from 'src/components/loading'
import AreaList from '../components/area-list'
import AreaEditor from '../components/area-editor'

Expand Down
File renamed without changes.
24 changes: 10 additions & 14 deletions src/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
export default {
component: require('../containers/app').default,
component: require('src/containers/app').default,
childRoutes: [{
path: '/',

getIndexRoute(location, cb) {
require.ensure([], () => {
cb(null, {content: require('./app_content_student-picker').default})
}, 'app.index')
cb(null, {content: require('./index').default})
},

getChildRoutes(state, cb) {
require.ensure([], () => {
cb(null, [
require('./app_content_areas').default, // edit-area
require('./app_overlay_search').default, // search
require('./app_content_degub').default, // debug
require('./app_content_new-student').default, // create
require('./app_content_student').default, // s/:id
require('./not_found').default, // anything else
])
}, 'app.routes')
cb(null, [
require('./edit-area').default, // edit-area
require('./degub').default, // degub
require('./create').default, // create
require('./student').default, // student
require('./search').default, // search
require('./not-found').default, // anything else
])
},
}],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import cx from 'classnames'
import Link from 'react-router/lib/Link'
import groupBy from 'lodash/groupBy'
import map from 'lodash/map'
import interpose from '../../../helpers/interpose'
import sortStudiesByType from '../../../helpers/sort-studies-by-type'
import interpose from 'src/helpers/interpose'
import sortStudiesByType from 'src/helpers/sort-studies-by-type'

import Button from '../../../components/button'
import Icon from '../../../components/icon'
import {iosTrashOutline, iosArrowForward} from '../../../icons/ionicons'
import Button from 'src/components/button'
import Icon from 'src/components/icon'
import {iosTrashOutline, iosArrowForward} from 'src/icons/ionicons'

import './student-list-item.scss'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../../../styles/variables.scss';
@import '../../../styles/mixins.scss';
@import 'src/styles/variables.scss';
@import 'src/styles/mixins.scss';

.student-list-item {
@include link-undecorated();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import map from 'lodash/map'
import sortBy from 'lodash/sortBy'
import fuzzysearch from 'fuzzysearch'

import List from '../../../components/list'
import List from 'src/components/list'
import StudentListItem from './student-list-item'

import './student-list.scss'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/mixins.scss';
@import 'src/styles/mixins.scss';

.student-list {
@include card();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, {PropTypes} from 'react'
import size from 'lodash/size'

import {androidSearch, funnel, androidApps, androidMenu, androidAdd} from '../../../icons/ionicons'
import Toolbar from '../../../components/toolbar'
import Button from '../../../components/button'
import Icon from '../../../components/icon'
import {androidSearch, funnel, androidApps, androidMenu, androidAdd} from 'src/icons/ionicons'
import Toolbar from 'src/components/toolbar'
import Button from 'src/components/button'
import Icon from 'src/components/icon'
import StudentList from './student-list'

import './student-picker.scss'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../../../styles/variables.scss';
@import '../../../styles/mixins.scss';
@import 'src/styles/variables.scss';
@import 'src/styles/mixins.scss';

.app-title {
margin-top: 3em;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, {Component, PropTypes} from 'react'
import StudentPicker from '../components/student-picker'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { destroyStudent } from '../../../redux/students/actions/destroy-student'
import { loadStudents } from '../../../redux/students/actions/load-students'
import { destroyStudent } from 'src/redux/students/actions/destroy-student'
import { loadStudents } from 'src/redux/students/actions/load-students'

class StudentPickerContainer extends Component {
static propTypes = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 295fcd0

Please sign in to comment.