Skip to content

Commit

Permalink
Ember 3.20, update ember-fetch, bump deps (#495)
Browse files Browse the repository at this point in the history
* Ember 3.20

* Update ember-fetch

* Tweaks

* Fix fetch, update router-scroll

* Remove debuggers

* Update yarn.lock

* Remove dependency lint

* Add fetch resolution
  • Loading branch information
RobbieTheWagner authored Aug 10, 2020
1 parent 70347aa commit da49b97
Show file tree
Hide file tree
Showing 21 changed files with 2,340 additions and 2,837 deletions.
17 changes: 1 addition & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,7 @@ module.exports = {
node: true
},
plugins: ['node'],
rules: Object.assign(
{},
require('eslint-plugin-node').configs.recommended.rules,
{
// add your custom rules and overrides for node files here
}
)
},

// test files
{
files: ['tests/**/*.js'],
excludedFiles: ['tests/dummy/**/*.js'],
env: {
embertest: true
}
extends: ['plugin:node/recommended']
},

// node test files
Expand Down
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ language: node_js
node_js:
- "10"

sudo: true
dist: trusty
dist: xenial

addons:
chrome: stable
Expand Down Expand Up @@ -52,9 +51,7 @@ jobs:
script: yarn test:test-apps

- stage: versioned tests
env: EMBER_TRY_SCENARIO=ember-lts-3.4
- env: EMBER_TRY_SCENARIO=ember-lts-3.8
- env: EMBER_TRY_SCENARIO=ember-lts-3.12
env: EMBER_TRY_SCENARIO=ember-lts-3.12
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
Expand Down
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) 2020

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
5 changes: 2 additions & 3 deletions addon/adapters/-addon-docs.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import Adapter from '@ember-data/adapter';
import config from 'ember-get-config';
import { inject as service } from '@ember/service';
import fetch from 'fetch';

export default Adapter.extend({
defaultSerializer: '-addon-docs',
namespace: `${config.rootURL.replace(/\/$/, '')}/docs`,
docsFetch: service(),

shouldBackgroundReloadAll() {
return false;
Expand All @@ -17,7 +16,7 @@ export default Adapter.extend({

findRecord(store, modelClass, id, snapshot) {
if (modelClass.modelName === 'project') {
return this.docsFetch.fetch({ url: `${this.namespace}/${id}.json` }).json();
return fetch(`${this.namespace}/${id}.json`).then((response) => response.json());
} else {
return store.peekRecord(modelClass.modelName, id);
}
Expand Down
5 changes: 2 additions & 3 deletions addon/router.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/** @documenter yuidoc */

import EmberRouter from '@ember/routing/router';
import RouterScroll from 'ember-router-scroll';
import EmberRouterScroll from 'ember-router-scroll';

/**
The AddonDocsRouter, which adds some extra functionality. This should be used
Expand All @@ -20,7 +19,7 @@ import RouterScroll from 'ember-router-scroll';
@class AddonDocsRouter
@extends EmberRouter
*/
export default EmberRouter.extend(RouterScroll);
export default class AddonDocsRouter extends EmberRouterScroll {}

/**
Creates the docs route and api docs routes. Can receive a callback with the
Expand Down
1 change: 0 additions & 1 deletion addon/services/docs-fetch.js

This file was deleted.

7 changes: 3 additions & 4 deletions addon/services/docs-search.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import Service, { inject as service } from '@ember/service';
import Service from '@ember/service';
import { getOwner } from '@ember/application';
import { computed } from '@ember/object';
import lunr from 'lunr';
import config from 'ember-get-config';
import fetch from 'fetch';

const { Index, Query } = lunr;

export default Service.extend({
docsFetch: service(),

search(phrase) {
return this.loadSearchIndex()
.then(({ index, documents }) => {
Expand Down Expand Up @@ -75,7 +74,7 @@ export default Service.extend({

loadSearchIndex() {
if (!this._searchIndex) {
this._searchIndex = this.docsFetch.fetch({ url: this._indexURL }).json()
this._searchIndex = fetch(this._indexURL).then((response) => response.json())
.then(json => {
return {
index: Index.load(json.index),
Expand Down
7 changes: 3 additions & 4 deletions addon/services/project-version.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import Service, { inject as service } from '@ember/service';
import Service from '@ember/service';
import { getOwner } from '@ember/application';
import { computed } from '@ember/object';
import { task } from 'ember-concurrency';
import config from 'ember-get-config';
import { assign } from '@ember/polyfills';
import fetch from 'fetch';

const { latestVersionName } = config['ember-cli-addon-docs'];

export default Service.extend({
docsFetch: service(),

_loadAvailableVersions: task(function*() {
let response = yield this.docsFetch.fetch({ url: `${this.root}versions.json` }).response();
let response = yield fetch(`${this.root}versions.json`);
let json;
if(response.ok){
json = yield response.json();
Expand Down
26 changes: 0 additions & 26 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,6 @@ module.exports = async function() {
return {
useYarn: true,
scenarios: [
{
name: 'ember-lts-3.4',
npm: {
devDependencies: {
'ember-source': '~3.4.0'
}
}
},
{
name: 'ember-lts-3.8',
npm: {
devDependencies: {
'ember-source': '~3.8.0'
}
}
},
{
name: 'ember-lts-3.12',
npm: {
Expand Down Expand Up @@ -62,16 +46,6 @@ module.exports = async function() {
}
}
},
// The default `.travis.yml` runs this scenario via `yarn test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: 'ember-default',
npm: {
devDependencies: {}
}
},
{
name: 'ember-default-with-jquery',
env: {
Expand Down
29 changes: 16 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
"chalk": "^2.4.2",
"ember-angle-bracket-invocation-polyfill": "^2.0.2",
"ember-assign-polyfill": "^2.6.0",
"ember-auto-import": "^1.5.3",
"ember-auto-import": "^1.6.0",
"ember-cli-autoprefixer": "^0.8.1",
"ember-cli-babel": "^7.19.0",
"ember-cli-babel": "^7.21.0",
"ember-cli-clipboard": "^0.13.0",
"ember-cli-htmlbars": "^5.2.0",
"ember-cli-postcss": "^5.0.0",
Expand All @@ -60,8 +60,7 @@
"ember-composable-helpers": "^2.4.0",
"ember-concurrency": "^0.9.0 || ^0.10.0 || ^1.0.0",
"ember-data": "2.x - 3.x",
"ember-fetch": "^6.7.1",
"ember-fetch-adapter": "^0.4.3",
"ember-fetch": "^8.0.1",
"ember-get-config": "^0.2.4",
"ember-href-to": "^1.15.1",
"ember-keyboard": "^4.0.0",
Expand All @@ -70,7 +69,7 @@
"ember-on-modifier": "^1.0.0",
"ember-responsive": "^3.0.5",
"ember-router-generator": "^2.0.0",
"ember-router-scroll": "^1.3.3",
"ember-router-scroll": "^3.3.3",
"ember-svg-jar": "^2.2.3",
"ember-tether": "^1.0.0",
"ember-truth-helpers": "^2.1.0",
Expand Down Expand Up @@ -101,20 +100,18 @@
},
"devDependencies": {
"@ember/optional-features": "^1.3.0",
"@glimmer/component": "^1.0.0",
"@glimmer/component": "^1.0.1",
"@glimmer/tracking": "^1.0.0",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"chai": "^4.2.0",
"common-tags": "^1.8.0",
"ember-auto-import": "^1.5.3",
"ember-classy-page-object": "^0.5.0",
"ember-cli": "~3.18.0",
"ember-cli": "~3.20.0",
"ember-cli-addon-docs-esdoc": "^0.2.3",
"ember-cli-addon-docs-yuidoc": "^0.2.4",
"ember-cli-blueprint-test-helpers": "^0.19.2",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-dependency-lint": "^1.1.3",
"ember-cli-deploy": "^1.0.2",
"ember-cli-deploy-build": "^2.0.0",
"ember-cli-deploy-git": "^1.3.4",
Expand All @@ -130,13 +127,13 @@
"ember-maybe-import-regenerator-for-testing": "^1.0.0",
"ember-qunit": "^4.6.0",
"ember-resolver": "^8.0.0",
"ember-source": "~3.18.0",
"ember-source": "~3.20.2",
"ember-source-channel-url": "^2.0.1",
"ember-template-lint": "^2.6.0",
"ember-template-lint": "^2.9.1",
"ember-test-selectors": "^2.1.0",
"ember-try": "^1.4.0",
"eslint": "^6.8.0",
"eslint-plugin-ember": "^8.4.0",
"eslint": "^7.5.0",
"eslint-plugin-ember": "^8.9.1",
"eslint-plugin-node": "^11.1.0",
"loader.js": "^4.7.0",
"mocha": "^6.2.3",
Expand All @@ -145,6 +142,12 @@
"release-it": "^13.5.7",
"release-it-lerna-changelog": "^2.3.0"
},
"peerDependencies": {
"ember-fetch": "^8.0.1"
},
"resolutions": {
"whatwg-fetch": "3.3.1"
},
"engines": {
"node": "10.* || >= 12"
},
Expand Down
2 changes: 1 addition & 1 deletion test-apps/new-addon/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018
Copyright (c) 2020

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
2 changes: 1 addition & 1 deletion test-apps/new-addon/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
name: 'new-addon'
name: require('./package').name,
};
1 change: 1 addition & 0 deletions test-apps/new-addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"ember-cli-dependency-checker": "*",
"ember-cli-htmlbars": "*",
"ember-cli-inject-live-reload": "*",
"ember-fetch": "*",
"ember-qunit": "*",
"ember-cli-sri": "*",
"ember-cli-uglify": "*",
Expand Down
13 changes: 8 additions & 5 deletions test-apps/new-addon/testem.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
Expand All @@ -7,15 +9,16 @@ module.exports = {
launch_in_dev: [
'Chrome'
],
browser_start_timeout: 120,
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-dev-shm-usage',
'--disable-software-rasterizer',
'--mute-audio',
'--remote-debugging-port=0',
'--window-size=1440,900'
].filter(Boolean)
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/app/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import config from 'dummy/config/environment';
import { registerWarnHandler } from '@ember/debug';

// BEGIN-SNIPPET sample-snippet.js
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/app/router.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import AddonDocsRouter, { docsRoute, apiRoute } from 'ember-cli-addon-docs/router';
import config from './config/environment';
import config from 'dummy/config/environment';

const Router = AddonDocsRouter.extend({
location: config.locationType,
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": [
{
"name": "ember-cli",
"version": "3.18.0",
"version": "3.20.0",
"blueprints": [
{
"name": "addon",
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function(environment) {
podModulePrefix: 'dummy/pods',
environment,
rootURL: '/',
locationType: 'router-scroll',
locationType: 'auto',
historySupportMiddleware: true,
EmberENV: {
FEATURES: {
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/config/targets.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const browsers = [
'last 1 Safari versions'
];

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

if (isCI || isProduction) {
Expand Down
4 changes: 2 additions & 2 deletions tests/test-helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Application from '../app';
import config from '../config/environment';
import Application from 'dummy/app';
import config from 'dummy/config/environment';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';

Expand Down
Loading

0 comments on commit da49b97

Please sign in to comment.