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

Upgrade to Ember 3.x #247

Merged
merged 9 commits into from
Aug 6, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/coverage/

# ember-try
/.node_modules.ember-try/
28 changes: 7 additions & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,18 @@ module.exports = {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'xo',
'plugin:ember/recommended',
],
plugins: ['ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'xo'],
env: {
browser: true
},
// Change errors to warnings to avoid the CI builds failing.
rules: {
'capitalized-comments': 'off',
'indent': 'warn',
indent: 'warn',
'no-alert': 'off',
'object-curly-spacing': 'off',
'semi': 'off',
semi: 'off',
'space-before-function-paren': 'off',
// Disable a few "best practices" for now
'ember/closure-actions': 'warn',
Expand All @@ -33,8 +27,9 @@ module.exports = {
// node files
{
files: [
'testem.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js'
],
Expand All @@ -46,15 +41,6 @@ module.exports = {
browser: false,
node: true
}
},

// test files
{
files: ['tests/**/*.js'],
excludedFiles: ['tests/dummy/**/*.js'],
env: {
embertest: true
}
}
]
};
}
26 changes: 9 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/dist/
/tmp/

# dependencies
/node_modules

# misc
/.sass-cache
/connect.lock
/coverage/*
/coverage/
/libpeerconnection.log
package-lock.json
npm-debug.log*
yarn-error.log
testem.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try

# editors
*.sublime-project
*.sublime-workspace
/.vscode
jsconfig.json
typings/
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js: 9
node_js: 10

sudo: false
dist: trusty
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ it in your browser at this URL: `http://localhost:4000`.

Run `yarn test` for a single test or `yarn ember test --server` to start a test server.

Lint scripts with:

* `npm run lint:js`
* `npm run lint:js -- --fix`

## Backend

We use Google's Firebase as our database and API, as for
Expand Down
24 changes: 17 additions & 7 deletions config/targets.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
'use strict'

const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
]

const isCI = Boolean(process.env.CI)
const isProduction = process.env.EMBER_ENV === 'production'

if (isCI || isProduction) {
browsers.push('ie 11')
}

module.exports = {
browsers: [
'ie 10',
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
]
};
browsers
}
36 changes: 19 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,58 @@
"repository": "internet4000/radio4000",
"scripts": {
"build": "ember build -prod",
"lint:js": "eslint ./*.js app config lib server tests",
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test"
},
"devDependencies": {
"autoprefixer": "^7.1.6",
"broccoli-asset-rev": "^2.7.0",
"ember-auto-import": "^1.2.6",
"ember-awesome-macros": "^1.0.0",
"ember-cli": "~2.18.2",
"ember-awesome-macros": "^2.0.0",
"ember-cli": "~3.3.0",
"ember-cli-app-version": "^3.1.0",
"ember-cli-babel": "^6.9.0",
"ember-cli-css-preprocess": "^1.1.0",
"ember-cli-dependency-checker": "^2.0.0",
"ember-cli-eslint": "^4.2.1",
"ember-cli-flash": "^1.5.0",
"ember-cli-google-analytics": "^1.5.0",
"ember-cli-htmlbars": "^2.0.1",
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-qunit": "^4.1.1",
"ember-cli-qunit": "^4.3.2",
"ember-cli-shims": "^1.2.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^2.1.0",
"ember-concurrency": "^0.8.12",
"ember-cp-validations": "^4.0.0-beta.0",
"ember-data": "~2.18.0",
"ember-cp-validations": "^4.0.0-beta.2",
"ember-data": "~3.3.1",
"ember-export-application-global": "^2.0.0",
"ember-keyboard": "^2.3.0",
"ember-leaflet": "^3.0.14",
"ember-load-initializers": "^1.0.0",
"ember-keyboard": "^3.0.2",
"ember-leaflet": "^3.0.17",
"ember-load-initializers": "^1.1.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-modal-dialog": "^3.0.0-beta.0",
"ember-page-title": "^4.0.3",
"ember-page-title": "^4.0.5",
"ember-resolver": "^4.0.0",
"ember-source": "~2.18.0",
"ember-source": "~3.3.0",
"eslint-config-xo": "^0.20.1",
"eslint-plugin-ember": "^5.0.0",
"leaflet": "^1.0.0",
"leaflet": "^1.3.3",
"loader.js": "^4.2.3",
"node-sass": "^4.9.0",
"node-sass": "^4.9.2",
"postcss": "^6.0.14",
"postcss-import": "^11.0.0"
"postcss-import": "^11.0.0",
"qunit-dom": "^0.6.2"
},
"engines": {
"node": "^4.5 || 6.* || >= 7.*"
"node": "6.* || 8.* || >= 10.*"
},
"dependencies": {
"date-fns": "^1.29.0",
"ember-cli-flash": "^1.6.5",
"ember-cli-stripe": "^1.0.4",
"ember-fetch": "^3.4.5",
"ember-fetch": "^5.1.1",
"ember-href-to": "^1.15.1",
"ember-jets": "^1.3.0",
"emberfire": "^2.0.10",
Expand Down
21 changes: 9 additions & 12 deletions testem.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
launch_in_ci: ['Chrome'],
launch_in_dev: ['Chrome'],
browser_args: {
Chrome: {
mode: 'ci',
args: [
ci: [
// --no-sandbox is needed when running Chrome inside a container
process.env.TRAVIS ? '--no-sandbox' : null,

'--disable-gpu',
process.env.CI ? '--no-sandbox' : null,
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-software-rasterizer',
'--mute-audio',
'--remote-debugging-port=0',
'--window-size=1440,900'
].filter(Boolean)
}
}
};
}
19 changes: 11 additions & 8 deletions tests/acceptance/map-test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import {test} from 'qunit'
import moduleForAcceptance from 'radio4000/tests/helpers/module-for-acceptance'
import {module, test} from 'qunit'
import {visit, currentURL} from '@ember/test-helpers'
import {setupApplicationTest} from 'ember-qunit'

moduleForAcceptance('Acceptance | map')
module('Acceptance | map', function(hooks) {
setupApplicationTest(hooks)

test('visiting /map', async function(assert) {
await visit('/map')
test('visiting /map', async function(assert) {
await visit('/map')

assert.ok(currentURL().includes('/map'))
assert.ok(currentURL().includes('/map'))

const markers = document.querySelectorAll('.leaflet-marker-icon')
assert.ok(markers.length, 'map markers are being rendered')
const markers = document.querySelectorAll('.leaflet-marker-icon')
assert.ok(markers.length, 'map markers are being rendered')
})
})
13 changes: 7 additions & 6 deletions tests/acceptance/settings-test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {test} from 'qunit'
import moduleForAcceptance from 'radio4000/tests/helpers/module-for-acceptance'
import {module, test} from 'qunit'
import {visit, currentURL} from '@ember/test-helpers'
import {setupApplicationTest} from 'ember-qunit'

moduleForAcceptance('Acceptance | settings')
module('Acceptance | settings', function(hooks) {
setupApplicationTest(hooks)

test('visiting /settings without auth redirects to login', function(assert) {
visit('/settings')
test('visiting /settings without auth redirects to login', async function(assert) {
await visit('/settings')

andThen(function() {
assert.equal(currentURL(), '/auth/login')
})
})
Empty file added tests/helpers/.gitkeep
Empty file.
5 changes: 0 additions & 5 deletions tests/helpers/destroy-app.js

This file was deleted.

8 changes: 4 additions & 4 deletions tests/helpers/flash-message.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';
import FlashObject from 'ember-cli-flash/flash/object';
import Ember from 'ember'
import FlashObject from 'ember-cli-flash/flash/object'

const {K} = Ember;
const {K} = Ember

FlashObject.reopen({init: K});
FlashObject.reopen({init: K})
19 changes: 10 additions & 9 deletions tests/helpers/module-for-acceptance.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { module } from 'qunit';
import { resolve } from 'rsvp';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import {module} from 'qunit'
import {resolve} from 'rsvp'
import startApp from '../helpers/start-app'
import destroyApp from '../helpers/destroy-app'

export default function(name, options = {}) {
module(name, {
beforeEach() {
this.application = startApp();
this.application = startApp()

if (options.beforeEach) {
return options.beforeEach.apply(this, arguments);
return options.beforeEach.apply(this, arguments)
}
},

afterEach() {
let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
return resolve(afterEach).then(() => destroyApp(this.application));
let afterEach =
options.afterEach && options.afterEach.apply(this, arguments)
return resolve(afterEach).then(() => destroyApp(this.application))
}
});
})
}
10 changes: 5 additions & 5 deletions tests/helpers/resolver.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Resolver from '../../resolver';
import config from '../../config/environment';
import Resolver from '../../resolver'
import config from '../../config/environment'

const resolver = Resolver.create();
const resolver = Resolver.create()

resolver.namespace = {
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix
};
}

export default resolver;
export default resolver
17 changes: 0 additions & 17 deletions tests/helpers/start-app.js

This file was deleted.

Loading