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

Initial Commit: updates to ember 3.4.0 #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

18 changes: 18 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/coverage/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
43 changes: 40 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,48 @@ module.exports = {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
"no-console": "off"
}
},
overrides: [
// node files
{
files: [
'.template-lintrc.js',
'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
})
}
]
};
20 changes: 13 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# 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*
testem.log
/npm-debug.log*
/testem.log
/yarn-error.log
*.DS_Store

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
42 changes: 27 additions & 15 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
/bower_components
# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/.bowerrc
/.editorconfig
/.ember-cli
/.eslintignore
/.eslintrc.js
/.gitignore
/.watchmanconfig
/.travis.yml
/bower.json
/config/ember-try.js
/dist
/tests
/tmp
**/.gitkeep
.bowerrc
.editorconfig
.ember-cli
.gitignore
.jshintrc
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.js
/ember-cli-build.js
/testem.js
/tests/
/yarn.lock
.gitkeep

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
5 changes: 5 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
};
58 changes: 36 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
---
language: node_js
node_js:
- "4"
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "6"

sudo: false
dist: trusty

addons:
chrome: stable

cache:
directories:
- $HOME/.npm
- $HOME/.cache # includes bowers cache

env:
# we recommend testing LTS's and latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=ember-lts-2.4
- EMBER_TRY_SCENARIO=ember-lts-2.8
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary

matrix:
fast_finish: true
global:
# See https://git.io/vdao3 for details.
- JOBS=1

jobs:
fail_fast: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

include:
# runs linting and tests with current locked deps

- stage: "Tests"
name: "Tests"
script:
- npm run lint:hbs
- npm run lint:js
- npm test

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- stage: "Additional Tests"
env: EMBER_TRY_SCENARIO=ember-lts-2.16
- env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery

before_install:
- npm config set spin false
- npm install -g bower
- bower --version
- npm install phantomjs-prebuilt
- node_modules/phantomjs-prebuilt/bin/phantomjs --version

install:
- npm install
- bower install
- npm install -g npm@4
- npm --version

script:
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
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) 2017
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
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# ember-appmetrics 🐹
==============================================================================

[![Build Status](https://travis-ci.org/gokatz/ember-appmetrics.svg?branch=master)](https://travis-ci.org/gokatz/ember-appmetrics)

Ember library used to measure various metrics in your Ember app with ultra simple APIs. Especially useful for [RUM](https://en.wikipedia.org/wiki/Real_user_monitoring) in Ember SPAs.
------------------------------------------------------------------------------

## Installation 💻
For Ember CLI >= `0.2.3`:
Expand Down Expand Up @@ -52,24 +54,29 @@ PS: In Safari, the User Timing API (performance.mark()) is not available, so the

* `git clone` this repository
* `npm install`
* `bower install`

## Running 👟👟

* `ember server`
* Visit your app at http://localhost:4301.
* `npm run lint:js -- --fix`

## Running Tests 💉

* `ember test`
* `ember test --server`
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions

## Building
### Running the dummy application

* `ember build`
* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).

## Contribution 👨‍👧‍👦

Missing something? Let's work together to get that done 😉

## License

This project is licensed under the [MIT License](LICENSE.md).
19 changes: 12 additions & 7 deletions addon/services/metrics.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import Ember from 'ember';

const { typeOf, Service } = Ember;
import { typeOf } from '@ember/utils';
import Service from '@ember/service';

export default Service.extend({
isMarkSupportedBrowser: true,
isNowSupportedBrowser: true,

secondaryPerformanceObj: {},
metricsObj: {},

init() {

this._super(...arguments);
this.setProperties({
secondaryPerformanceObj: {},
metricsObj: {}
});
// detecting the browser's Compatibility over window.performance.mark and window.performance.now

if (!(window.performance && window.performance.mark)) {
// eslint-disable-next-line no-console
console.warn('Performance.mark is not supported in this browser. Hence falling back to performance.now()');
this.set('isMarkSupportedBrowser', false);

if (!(window.performance && window.performance.now)) {
// eslint-disable-next-line no-console
console.warn('Performance.now is also not supported. Hence falling back to javascript Date API');
this.set('isNowSupportedBrowser', false);
}
Expand All @@ -27,6 +29,7 @@ export default Service.extend({
start(eventName) {

if (typeOf(eventName) !== 'string') {
// eslint-disable-next-line no-console
console.error('Expected type String for invoking `start`');
return -1;
}
Expand All @@ -52,6 +55,7 @@ export default Service.extend({
end(eventName) {

if (typeOf(eventName) !== 'string') {
// eslint-disable-next-line no-console
console.error('Expected type String for invoking `end`');
return -1;
}
Expand Down Expand Up @@ -89,6 +93,7 @@ export default Service.extend({

measure(eventName) {
if (typeOf(eventName) !== 'string') {
// eslint-disable-next-line no-console
console.error('Expected type String for invoking `measure`');
return -1;
}
Expand Down
7 changes: 0 additions & 7 deletions bower.json

This file was deleted.

Loading