Skip to content

Commit

Permalink
Merge pull request #50 from samdemaeyer/ember-upgrade
Browse files Browse the repository at this point in the history
Upgrade ember
  • Loading branch information
amiel authored Oct 26, 2018
2 parents f85febc + b0c2e62 commit b7fe6c9
Show file tree
Hide file tree
Showing 48 changed files with 3,689 additions and 2,247 deletions.
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

23 changes: 23 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

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

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
42 changes: 40 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,48 @@ module.exports = {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
}
},
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,17 +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*
testem.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
8 changes: 7 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
.bowerrc
.editorconfig
.ember-cli
.gitignore
.eslintrc.js
.gitignore
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.js
yarn.lock

# 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'
};
39 changes: 22 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
---
language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "6"

sudo: required
sudo: false
dist: trusty

addons:
chrome: stable

cache:
yarn: true
directories:
- $HOME/.npm

env:
# 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.8
- EMBER_TRY_SCENARIO=ember-lts-2.12
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
- EMBER_TRY_SCENARIO=ember-default
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:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- "sudo chown root /opt/google/chrome/chrome-sandbox"
- "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"

install:
- yarn install --no-lockfile --non-interactive
- npm config set spin false
- npm install -g npm@4
- npm --version

script:
- 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
69 changes: 0 additions & 69 deletions CHANGELOG.md

This file was deleted.

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) 2015
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
7 changes: 3 additions & 4 deletions addon/mixins/url-templates-serializer.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Ember from 'ember';

const { get } = Ember;
import { get } from '@ember/object';
import Mixin from '@ember/object/mixin';

export const LINK_PREFIX = 'urlTemplate:';

export default Ember.Mixin.create({
export default Mixin.create({
normalize(modelClass) {
let result = this._super(...arguments);
return _injectLinksForRelationships(modelClass, result);
Expand Down
11 changes: 6 additions & 5 deletions addon/mixins/url-templates.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import Ember from 'ember';
import { isArray } from '@ember/array';
import { typeOf } from '@ember/utils';
import Mixin from '@ember/object/mixin';
import EmberObject from '@ember/object';
import UriTemplate from 'uri-templates';
import { assign } from '@ember/polyfills';
import { LINK_PREFIX } from "ember-data-url-templates/mixins/url-templates-serializer";
import flattenQueryParams from 'ember-data-url-templates/utils/flatten-query-params';

const { isArray, typeOf } = Ember;

const ID_KEY_RE = /(_id|Id)$/;
const LINK_PREFIX_RE = new RegExp(`^${LINK_PREFIX}`);

export default Ember.Mixin.create({
export default Mixin.create({
mergedProperties: ['urlSegments'],
buildURL(type, id, snapshot, requestType, query) {
const templateString = this.getTemplate(requestType);
Expand Down Expand Up @@ -54,7 +55,7 @@ export default Ember.Mixin.create({
// TODO: Add ability to customize templateResolver
// TODO: Add reference to the adapter
templateResolverFor(/* type */) {
return Ember.Object.create(this.get('urlSegments'));
return EmberObject.create(this.get('urlSegments'));
},

// HACK: Prevent query/queryRecord from appending query params to urls, we
Expand Down
Loading

0 comments on commit b7fe6c9

Please sign in to comment.