Skip to content

Commit

Permalink
Updates codebase through ember init
Browse files Browse the repository at this point in the history
I noticed that the project still had a bunch of bower.json
dependencies. I moved some of them, but was super conservative as I’d
prefer to get these changes merged before continuing.
Also updated some of the files and dependencies, like jshint->eslint,
which included adding some TODOs to clean up afterwards.
The package.json churn is because `ember init` now generates
package.json with the same ordering as npm, to minimize churn.
  • Loading branch information
locks committed Jun 7, 2017
1 parent 4f69b44 commit fbc42db
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 47 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
rules: {
}
};
8 changes: 4 additions & 4 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for 'head'}}
{{content-for "head"}}

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand All @@ -20,13 +20,13 @@
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/cargo.css">

{{content-for 'head-footer'}}
{{content-for "head-footer"}}
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Cargo">
</head>
<body>
{{content-for 'body'}}
{{content-for "body"}}
<noscript>
<div id="main">
<div class='noscript'>
Expand All @@ -38,6 +38,6 @@
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/cargo.js"></script>

{{content-for 'body-footer'}}
{{content-for "body-footer"}}
</body>
</html>
4 changes: 3 additions & 1 deletion app/routes/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export default Ember.Route.extend({
beforeModel(transition) {
try {
localStorage.removeItem('github_response');
} catch (e) {}
} catch (e) {
// TODO: handle error
}

delete window.github_response;
var win = window.open('/github_login', 'Authorization',
Expand Down
8 changes: 6 additions & 2 deletions app/services/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export default Ember.Service.extend({
this.set('currentUser', user);
try {
localStorage.setItem('isLoggedIn', '1');
} catch (e) {}
} catch (e) {
// TODO: handle exception
}
},

logoutUser() {
Expand All @@ -32,6 +34,8 @@ export default Ember.Service.extend({

try {
localStorage.removeItem('isLoggedIn');
} catch (e) {}
} catch (e) {
// TODO: handle exception
}
}
});
2 changes: 0 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"name": "cargo",
"dependencies": {
"Faker": "4.1.0",
"jquery": "3.2.1",
"lodash": "4.17.4",
"ember": "2.13.2",
"moment": "2.18.1",
"moment-timezone": "0.5.13",
"normalize-css": "7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* jshint node: true */
/* eslint-env node */

module.exports = function(environment) {
var ENV = {
Expand Down
3 changes: 1 addition & 2 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*jshint node:true*/
/* global require, module */
/* eslint-env node */
const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
Expand Down
53 changes: 27 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "cargo",
"version": "0.0.0",
"private": true,
"license": "MIT",
"author": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"repository": "",
"scripts": {
"build": "yarn run ember build",
"start": "yarn run ember server",
Expand All @@ -15,46 +17,45 @@
"test": "yarn run ember test",
"ember": "ember"
},
"repository": "",
"engines": {
"node": "= 4.6.0"
},
"author": "",
"license": "MIT",
"devDependencies": {
"bower": "1.8.0",
"broccoli-asset-rev": "2.5.0",
"ember-ajax": "3.0.0",
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^3.0.0",
"ember-cli": "2.13.2",
"ember-cli-app-version": "3.0.0",
"ember-cli-babel": "6.1.0",
"ember-cli-dependency-checker": "2.0.0",
"ember-cli-htmlbars": "2.0.1",
"ember-cli-htmlbars-inline-precompile": "0.4.3",
"ember-cli-ic-ajax": "1.0.0",
"ember-cli-inject-live-reload": "1.6.1",
"ember-cli-jshint": "2.0.1",
"ember-cli-meta-tags": "3.1.0",
"ember-cli-mirage": "0.3.2",
"ember-cli-moment-shim": "3.3.0",
"ember-cli-qunit": "4.0.0",
"ember-cli-release": "0.2.9",
"ember-cli-sass": "6.1.3",
"ember-cli-shims": "1.1.0",
"ember-cli-sri": "2.1.1",
"ember-cli-test-loader": "2.1.0",
"ember-cli-uglify": "1.2.0",
"ember-data": "2.13.1",
"ember-export-application-global": "2.0.0",
"ember-load-initializers": "1.0.0",
"ember-lodash": "4.17.4",
"ember-moment": "7.3.1",
"ember-page-title": "3.1.6",
"ember-resolver": "4.1.0",
"ember-route-alias": "0.1.5",
"ember-router-scroll": "0.2.0",
"ember-suave": "4.0.1",
"emberx-select": "2.2.3",
"loader.js": "4.4.0"
}
"ember-cli-app-version": "^3.0.0",
"ember-cli-babel": "^6.0.0",
"ember-cli-dependency-checker": "^1.3.0",
"ember-cli-eslint": "^3.0.0",
"ember-cli-htmlbars": "^1.1.1",
"ember-cli-htmlbars-inline-precompile": "^0.4.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-qunit": "^4.0.0",
"ember-cli-shims": "^1.1.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "^2.13.0",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.0.0",
"ember-resolver": "^4.0.0",
"ember-source": "~2.13.0",
"loader.js": "^4.2.3"
},
"engines": {
"node": ">= 4"
},
"private": true
}
2 changes: 1 addition & 1 deletion testem.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*jshint node:true*/
/* eslint-env node */
module.exports = {
"test_page": "tests/index.html?hidepassed",
"disable_watching": true,
Expand Down
5 changes: 5 additions & 0 deletions tests/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
env: {
embertest: true
}
};
1 change: 1 addition & 0 deletions tests/acceptance/categories-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*global hasText*/
import { test } from 'qunit';
import moduleForAcceptance from 'cargo/tests/helpers/module-for-acceptance';

Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/crate-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*global hasText, matchesText*/
import { test } from 'qunit';
import moduleForAcceptance from 'cargo/tests/helpers/module-for-acceptance';

Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/front-page-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*global hasText*/
import { test } from 'qunit';
import moduleForAcceptance from 'cargo/tests/helpers/module-for-acceptance';

Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/search-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*global hasText, wait*/
import { test } from 'qunit';
import moduleForAcceptance from 'cargo/tests/helpers/module-for-acceptance';

Expand Down
1 change: 1 addition & 0 deletions tests/helpers/destroy-app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*global server*/
import Ember from 'ember';

export default function destroyApp(application) {
Expand Down
13 changes: 5 additions & 8 deletions tests/helpers/start-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ import './has-text';
import './matches-text';

export default function startApp(attrs) {
let application;
let attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;

// use defaults, but you can override
let attributes = Ember.assign({}, config.APP, attrs);

Ember.run(() => {
application = Application.create(attributes);
return Ember.run(() => {
let application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
return application;
});

return application;
}
1 change: 1 addition & 0 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Cargo Tests</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

Expand Down

0 comments on commit fbc42db

Please sign in to comment.