Skip to content

Commit

Permalink
Merge pull request #250 from internet4000/ember-auto-import
Browse files Browse the repository at this point in the history
Use ember-auto-import
  • Loading branch information
oskarrough committed Aug 6, 2018
2 parents f1aaebd + ba0ffec commit 3eaaf00
Show file tree
Hide file tree
Showing 13 changed files with 730 additions and 500 deletions.
4 changes: 2 additions & 2 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import config from './config/environment';
import RSVP from 'rsvp';
import LinkComponent from '@ember/routing/link-component';
import {debug} from '@ember/debug'
import 'npm:lazysizes/plugins/attrchange/ls.attrchange';
import 'npm:lazysizes';
import 'lazysizes/plugins/attrchange/ls.attrchange';
import 'lazysizes';

const App = Application.extend({
rootElement: '#Radio4000',
Expand Down
2 changes: 1 addition & 1 deletion app/components/account-provider-link/component.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ember from 'ember';
import firebase from 'npm:firebase';
import firebase from 'firebase';

const {Component, get} = Ember;

Expand Down
4 changes: 2 additions & 2 deletions app/components/channel-header/component.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint ember/use-brace-expansion:0 */
import Ember from 'ember';
import addMonths from 'npm:date-fns/add_months';
import isAfter from 'npm:date-fns/is_after';
import addMonths from 'date-fns/add_months';
import isAfter from 'date-fns/is_after';

const {
Component,
Expand Down
2 changes: 1 addition & 1 deletion app/components/x-playback/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Ember from 'ember';
// 1- comment out the following `import`
// 2- comment in the `script` tag in the `template.hbs`
// cheers
import 'npm:radio4000-player';
import 'radio4000-player';

const {Component, get, inject, computed} = Ember;

Expand Down
7 changes: 3 additions & 4 deletions app/helpers/time-ago.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Ember from 'ember';
import addHours from 'npm:date-fns/add_hours';
import differenceInHours from 'npm:date-fns/difference_in_hours';
import distanceInWordsToNow from 'npm:date-fns/distance_in_words_to_now';
import addHours from 'date-fns/add_hours';
import differenceInHours from 'date-fns/difference_in_hours';
import distanceInWordsToNow from 'date-fns/distance_in_words_to_now';

// Accepts a Date object or Number timestamp
// Returns a string like "x days ago" or "x months ago"
Expand All @@ -16,4 +16,3 @@ export function timeAgo([date]) {
}

export default Ember.Helper.helper(timeAgo);

18 changes: 8 additions & 10 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,14 @@
{{content-for "head"}}
<link rel="preload" as="font" href="https://res.cloudinary.com/radio4000/raw/upload/v1492541388/maisonneueweb-book_ee98sm.woff2" type="font/woff2" crossorigin />
<link rel="preload" as="font" href="https://res.cloudinary.com/radio4000/raw/upload/v1492541388/maisonneueweb-bold_rvmbzr.woff2" type="font/woff2" crossorigin />
<!-- <link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css"> -->
<!-- <link integrity="" rel="stylesheet" href="{{rootURL}}assets/radio4000.css"> -->
{{content-for "concat-css"}}
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/radio4000.css">
{{content-for "head-footer"}}
</head>
<body>
{{content-for "body"}}

<div id="Radio4000" class="Radio4000"></div>
<noscript>Sorry, to use Radio4000 you need to enable JavaScript in your browser.</noscript>

<!-- <script src="{{rootURL}}assets/vendor.js"></script> -->
<!-- <script src="{{rootURL}}assets/radio4000.js"></script> -->
{{content-for "concat-js"}}

{{content-for "body-footer"}}

<div class="DummyApp DummyApp--hidden">
<!-- a dummy app that appears independently from Ember and is removed by ember asap -->
Expand Down Expand Up @@ -102,5 +94,11 @@
</div>
</div>

<noscript>Sorry, to use Radio4000 you need to enable JavaScript in your browser.</noscript>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/radio4000.js" async></script>

{{content-for "body-footer"}}

</body>
</html>
2 changes: 1 addition & 1 deletion app/models/track.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {task} from 'ember-concurrency';
import {validator, buildValidations} from 'ember-cp-validations';
import youtubeUrlToId from 'radio4000/utils/youtube-url-to-id';
import {fetchTrackAvailability} from 'radio4000/utils/youtube-api';
import format from 'npm:date-fns/format';
import format from 'date-fns/format';

const {Model, attr, belongsTo} = DS;
const {get, set, computed} = Ember;
Expand Down
2 changes: 1 addition & 1 deletion app/services/ui-states.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global document */
import Ember from 'ember';
import Cookies from 'npm:js-cookie';
import Cookies from 'js-cookie';

const {Service, computed, get, set, on} = Ember;

Expand Down
2 changes: 1 addition & 1 deletion app/settings/account/controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ember from 'ember';
import firebase from 'npm:firebase';
import firebase from 'firebase';

const {Controller, inject, get, set, computed, debug} = Ember;

Expand Down
2 changes: 1 addition & 1 deletion app/utils/youtube-url-to-id.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import youtubeRegex from 'npm:youtube-regex';
import youtubeRegex from 'youtube-regex';

export default function youtubeUrlToId(url) {
const results = youtubeRegex().exec(url);
Expand Down
2 changes: 1 addition & 1 deletion app/validators/youtube-url.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseValidator from 'ember-cp-validations/validators/base';
import youtubeRegex from 'npm:youtube-regex';
import youtubeRegex from 'youtube-regex';

const YoutubeUrl = BaseValidator.extend({
validate(value) {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"devDependencies": {
"autoprefixer": "^7.1.6",
"broccoli-asset-rev": "^2.7.0",
"ember-auto-import": "^1.2.6",
"ember-awesome-macros": "^1.0.0",
"ember-browserify": "^1.1.11",
"ember-cli": "~2.18.2",
"ember-cli-app-version": "^3.1.0",
"ember-cli-babel": "^6.9.0",
Expand Down Expand Up @@ -53,7 +53,6 @@
},
"dependencies": {
"date-fns": "^1.29.0",
"ember-cli-concat": "^1.3.0",
"ember-cli-stripe": "^1.0.4",
"ember-fetch": "^3.4.5",
"ember-href-to": "^1.15.1",
Expand Down

0 comments on commit 3eaaf00

Please sign in to comment.