Skip to content
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.

14 changes: 0 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,8 @@ insert_final_newline = true
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false
indent_style = space
indent_size = 2

[*.css]
indent_style = space
indent_size = 2

[*.html]
indent_style = space
indent_size = 2

[*.{diff,md}]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/blueprints/*/files/**/*.js
50 changes: 50 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
},
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
})
}
]
};
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
Expand All @@ -13,5 +13,11 @@
/connect.lock
/coverage/*
/libpeerconnection.log
npm-debug.log
npm-debug.log*
yarn-error.log
testem.log

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
32 changes: 0 additions & 32 deletions .jshintrc

This file was deleted.

9 changes: 7 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
.bowerrc
.editorconfig
.ember-cli
.eslintrc.js
.gitignore
.jshintrc
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.json
testem.js

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
43 changes: 28 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,47 @@
---
language: node_js
node_js:
- "0.12"
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "4"

sudo: false
dist: trusty

addons:
chrome: stable

cache:
directories:
- node_modules
- $HOME/.npm

env:
- EMBER_TRY_SCENARIO=default
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
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)
- EMBER_TRY_SCENARIO=ember-lts-2.12
- EMBER_TRY_SCENARIO=ember-lts-2.16
- EMBER_TRY_SCENARIO=ember-lts-2.18
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
- EMBER_TRY_SCENARIO=ember-default

matrix:
fast_finish: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

before_install:
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
- "npm config set spin false"
- "npm install -g npm@^2"

install:
- npm install -g bower
- npm install
- bower install
- npm config set spin false
- npm install -g npm@4
- npm --version

script:
- ember try $EMBER_TRY_SCENARIO test
- npm run lint:js
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
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
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,26 @@ export default JSONAPIAdapter.extend(DataAdapterMixin, {
namespace: 'api',
});
```

### Linting

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

### Running tests

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

### Running the dummy application

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

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

License
------------------------------------------------------------------------------

This project is licensed under the [MIT License](LICENSE.md).
21 changes: 11 additions & 10 deletions addon/authenticators/loopback.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* jscs:disable requireDotNotation */
import Ember from 'ember';
import $ from 'jquery'
import BaseAuthenticator from 'ember-simple-auth/authenticators/base';

const { RSVP, isEmpty, run, computed } = Ember;
const assign = Ember.assign || Ember.merge;
import RSVP from 'rsvp';
import { A } from '@ember/array';
import { isEmpty } from '@ember/utils'
import { run } from '@ember/runloop';

/**
Authenticator that works with Loopback's default authentication
Expand Down Expand Up @@ -48,7 +49,7 @@ export default BaseAuthenticator.extend({

@method restore
@param {Object} data The data to restore the session from
@return {Ember.RSVP.Promise} A promise that when it resolves results in the session becoming or remaining authenticated
@return {RSVP.Promise} A promise that when it resolves results in the session becoming or remaining authenticated
@public
*/
restore(data) {
Expand All @@ -73,10 +74,10 @@ export default BaseAuthenticator.extend({
@method authenticate
@param {String} username The resource owner username
@param {String} password The resource owner password
@return {Ember.RSVP.Promise} A promise that when it resolves results in the session becoming authenticated
@return {RSVP.Promise} A promise that when it resolves results in the session becoming authenticated
@public
*/
authenticate(email, password, scope = []) {
authenticate(email, password, scope = []) { // eslint-disable-line no-unused-vars
return new RSVP.Promise((resolve, reject) => {
const data = { email, password };
const loginEndpoint = this.get('loginEndpoint');
Expand All @@ -102,7 +103,7 @@ export default BaseAuthenticator.extend({

@method invalidate
@param {Object} data The current authenticated session data
@return {Ember.RSVP.Promise} A promise that when it resolves results in the session being invalidated
@return {RSVP.Promise} A promise that when it resolves results in the session being invalidated
@public
*/
invalidate(data) {
Expand All @@ -117,7 +118,7 @@ export default BaseAuthenticator.extend({
success.apply(this, [resolve]);
} else {
const requests = [];
Ember.A(['id']).forEach((tokenType) => {
A(['id']).forEach((tokenType) => {
const token = data[tokenType];
if (!isEmpty(token)) {
requests.push(this.makeRequest(logoutEndpoint, {
Expand Down Expand Up @@ -151,6 +152,6 @@ export default BaseAuthenticator.extend({
contentType: 'application/json'
};

return Ember.$.ajax(options);
return $.ajax(options);
},
});
4 changes: 1 addition & 3 deletions addon/authorizers/loopback.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* jscs:disable requireDotNotation */
import Ember from 'ember';
import Base from 'ember-simple-auth/authorizers/base';

const { isEmpty } = Ember;
import { isEmpty } from '@ember/utils'

/**
Authorizer that sets headers to communicated with Loopback servers
Expand Down
9 changes: 0 additions & 9 deletions bower.json

This file was deleted.

Loading