Skip to content

Commit

Permalink
Merge pull request #28 from sir-dunxalot/ember-3
Browse files Browse the repository at this point in the history
Ember 3
  • Loading branch information
Duncan Walker authored Sep 13, 2018
2 parents 56e1eda + f53d307 commit 807358a
Show file tree
Hide file tree
Showing 30 changed files with 16,355 additions and 265 deletions.
19 changes: 19 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/coverage/

# ember-try
/.node_modules.ember-try/

# Node test suite
/node_tests/
42 changes: 39 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,47 @@ module.exports = {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
'no-console': 0,
}
},
overrides: [
// node files
{
files: [
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
}
]
};
25 changes: 11 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

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

# dependencies
/node_modules
/bower_components
/bower_components/
/node_modules/

# misc
/.sass-cache
/connect.lock
/coverage/*
/coverage/
/libpeerconnection.log
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

# test tmp output
/node_tests/tmp
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
8 changes: 6 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
.bowerrc
.editorconfig
.ember-cli
.gitignore
.eslintrc.js
.gitignore
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.js
yarn.lock

/node_tests/tmp
# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
28 changes: 18 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,20 @@ cache:
- $HOME/.npm

env:
# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-lts-2.8
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-lts-2.12
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-release
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-beta
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-canary
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-default
- TEST_SUITE=backend # node tests (node_tests dir)
global:
# See https://git.io/vdao3 for details.
- JOBS=1
matrix:
# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-lts-2.12
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-lts-2.16
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-lts-2.18
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-release
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-beta
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-canary
- TEST_SUITE=frontend EMBER_TRY_SCENARIO=ember-default
- TEST_SUITE=backend # node tests (node_tests dir)

matrix:
fast_finish: true
Expand All @@ -37,5 +42,8 @@ before_install:
- npm --version

script:
- if [ "$TEST_SUITE" = "backend" ]; then npm test; fi
- npm run lint:js
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- if [ "$TEST_SUITE" = "backend" ]; then npm run test:node; fi
- if [ "$TEST_SUITE" = "frontend" ]; then node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup; fi
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016
Copyright (c) 2018

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ This Ember addon adds [New Relic Browser](http://newrelic.com/browser-monitoring
- [Content Security Policy](#content-security-policy)
- [Development](#development)

## Installation
Installation
------------------------------------------------------------------------------

```sh
ember install ember-new-relic
Expand Down
31 changes: 21 additions & 10 deletions addon/instance-initializers/new-relic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import Ember from 'ember';
import { on } from 'rsvp';
import { isNone } from '@ember/utils';

export function initialize() {
const { NREUM } = window;
Expand All @@ -8,16 +10,23 @@ export function initialize() {
}

function mustIgnoreError(error) {
// Ember 2.X seems to not catch `TransitionAborted` errors caused by regular redirects. We don't want these errors to show up in NewRelic so we have to filter them ourselfs.
// Once the issue https://github.com/emberjs/ember.js/issues/12505 is resolved we can remove this ignored error.
if (Ember.isNone(error)) {

/* Ember 2.X seems to not catch `TransitionAborted` errors caused by
regular redirects. We don't want these errors to show up in NewRelic
so we have to filter them ourselfs.
See https://github.com/emberjs/ember.js/issues/12505
*/

if (isNone(error)) {
return false;
}
const errorName = Ember.get(error, 'name');
return errorName === 'TransitionAborted';

return error.name === 'TransitionAborted';
}

function handleError(error) {

if (mustIgnoreError(error)) {
return;
}
Expand All @@ -28,7 +37,7 @@ export function initialize() {
// Ignore
}

console.error(error);
console.error(error); // eslint-disable-line no-console
}

function generateError(cause, stack) {
Expand All @@ -41,11 +50,13 @@ export function initialize() {

Ember.onerror = handleError;

Ember.RSVP.on('error', handleError);
on('error', handleError);

Ember.Logger.error = function(...messages) {
handleError(generateError(messages.join(' ')));
};
if (Ember.Logger) {
Ember.Logger.error = function(...messages) {
handleError(generateError(messages.join(' ')));
};
}
}

export default {
Expand Down
141 changes: 64 additions & 77 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,83 +1,70 @@
/* eslint-env node */
module.exports = {
scenarios: [
{
name: 'ember-lts-2.8',
bower: {
dependencies: {
'ember': 'components/ember#lts-2-8'
'use strict';

const getChannelURL = require('ember-source-channel-url');

module.exports = function() {
return Promise.all([
getChannelURL('release'),
getChannelURL('beta'),
getChannelURL('canary')
]).then((urls) => {
return {
scenarios: [
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0'
}
}
},
resolutions: {
'ember': 'lts-2-8'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0'
}
}
},
{
name: 'ember-release',
bower: {
dependencies: {
'ember': 'components/ember#release'
{
name: 'ember-lts-2.16',
npm: {
devDependencies: {
'ember-source': '~2.16.0'
}
}
},
resolutions: {
'ember': 'release'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
name: 'ember-beta',
bower: {
dependencies: {
'ember': 'components/ember#beta'
{
name: 'ember-lts-2.18',
npm: {
devDependencies: {
'ember-source': '~2.18.0'
}
}
},
resolutions: {
'ember': 'beta'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
name: 'ember-canary',
bower: {
dependencies: {
'ember': 'components/ember#canary'
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': urls[0]
}
}
},
resolutions: {
'ember': 'canary'
}
},
npm: {
devDependencies: {
'ember-source': null
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': urls[1]
}
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': urls[2]
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
}
]
]
};
});
};
Loading

0 comments on commit 807358a

Please sign in to comment.