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

Update for Fastboot 1.0 #35

Merged
merged 4 commits into from
Jul 7, 2017
Merged
Show file tree
Hide file tree
Changes from 3 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
18 changes: 15 additions & 3 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 @@ -7,5 +7,17 @@
# dependencies
/node_modules
/bower_components
npm-debug.log
testem.log

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

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
11 changes: 4 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ sudo: false
cache:
directories:
- $HOME/.npm
- $HOME/.cache # includes bowers cache

env:
# we recommend testing LTS's and latest stable release (bonus points to beta/canary)
Expand All @@ -17,6 +16,7 @@ env:
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
- EMBER_TRY_SCENARIO=ember-default

matrix:
fast_finish: true
Expand All @@ -25,16 +25,13 @@ matrix:

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

install:
- npm install
- bower install

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 test --skip-cleanup
9 changes: 6 additions & 3 deletions addon/components/new-version-notifier/component.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*jshint esnext:true */

import Ember from 'ember';
import getOwner from 'ember-getowner-polyfill';
import layout from './template';

export default Ember.Component.extend({
Expand All @@ -15,7 +14,7 @@ export default Ember.Component.extend({
showReloadButton: Ember.computed.alias("showReload"),
reloadButtonText: "Reload",
url: Ember.computed('versionFileName', function() {
var config = getOwner(this).resolveRegistration('config:environment');
var config = Ember.getOwner(this).resolveRegistration('config:environment');
var versionFileName = this.get('versionFileName');
var baseUrl = config.rootURL || config.baseURL;

Expand All @@ -37,6 +36,8 @@ export default Ember.Component.extend({
clearTimeout(currentTimeout);
}

if(!Ember.$) { return; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, could you make this a multiline if, just so it goes with the rest of the syntax?


Ember.$.ajax(self.get('url'), { cache:false }).then(function(res){
var currentVersion = self.get('version');
var newVersion = res && res.trim();
Expand Down Expand Up @@ -67,7 +68,9 @@ export default Ember.Component.extend({
},
actions: {
reload() {
location.reload();
if(typeof window !== 'undefined' && window.location) {
window.location.reload();
}
},

close() {
Expand Down
16 changes: 0 additions & 16 deletions bower.json

This file was deleted.

33 changes: 32 additions & 1 deletion config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*jshint node:true*/
/* eslint-env node */
module.exports = {
scenarios: [
{
Expand All @@ -10,6 +10,11 @@ module.exports = {
resolutions: {
'ember': 'lts-2-4'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
Expand All @@ -21,6 +26,11 @@ module.exports = {
resolutions: {
'ember': 'lts-2-8'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
Expand All @@ -32,6 +42,11 @@ module.exports = {
resolutions: {
'ember': 'release'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
Expand All @@ -43,6 +58,11 @@ module.exports = {
resolutions: {
'ember': 'beta'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
Expand All @@ -54,6 +74,17 @@ module.exports = {
resolutions: {
'ember': 'canary'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*jshint node:true*/
/* eslint-env node */
'use strict';

module.exports = function(/* environment, appConfig */) {
Expand Down
11 changes: 6 additions & 5 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/*jshint node:true*/
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
/* eslint-env node */
'use strict';

const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
let app = new EmberAddon(defaults, {
// Add options here
newVersion: {
fileName: 'MY-VERSION.txt'
}
});

/*
This build file specifes the options for the dummy test app of this
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* jshint node: true */
/* eslint-env node */
'use strict';

var writeFile = require('broccoli-file-creator');
const writeFile = require('broccoli-file-creator');

module.exports = {
name: 'ember-cli-new-version',
Expand Down Expand Up @@ -32,8 +32,8 @@ module.exports = {
based on package.json of consuming application.
*/
treeForPublic: function() {
var content = this.parent.pkg.version || '';
var fileName = this._options.fileName;
let content = this.parent.pkg.version || '';
let fileName = this._options.fileName;

if (this._options.fileName) {
this.ui.writeLine('Created ' + fileName);
Expand Down
47 changes: 23 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "ember-cli-new-version",
"version": "1.1.0",
"version": "1.2.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't bump the version 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha yes forgot to change this back. When testing the package lock kept causing a cached version to be installed so took drastic measures

"description": "A convention based update notification for Ember. With this addon, you can detect a new version and notify the user to refresh the page",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"build": "ember build",
"start": "ember server --live-reload=false",
"test": "ember try:testall"
"start": "ember server",
"test": "ember try:each"
},
"repository": {
"type": "git",
Expand All @@ -21,25 +21,24 @@
"author": "",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.2.0",
"broccoli-file-creator": "^1.1.0",
"ember-cli": "1.13.13",
"ember-cli-app-version": "^1.0.0",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "^1.1.0",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-ic-ajax": "0.2.4",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-qunit": "^1.0.4",
"ember-cli-release": "0.2.8",
"ember-cli-sri": "^1.2.0",
"broccoli-asset-rev": "^2.5.0",
"ember-ajax": "^3.0.0",
"ember-cli": "~2.14.0",
"ember-cli-dependency-checker": "^2.0.1",
"ember-cli-eslint": "^4.1.0",
"ember-cli-htmlbars-inline-precompile": "^0.4.3",
"ember-cli-inject-live-reload": "^1.6.1",
"ember-cli-qunit": "^4.0.0",
"ember-cli-shims": "^1.1.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-uglify": "^1.2.0",
"ember-data": "1.13.15",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-getowner-polyfill": "1.0.1",
"ember-try": "^0.2.6"
"ember-disable-prototype-extensions": "^1.1.2",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.0.0",
"ember-resolver": "^4.2.1",
"ember-source": "~2.14.0",
"ember-welcome-page": "^3.1.1",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also remove this dependency? Thanks!

"loader.js": "^4.5.1"
},
"keywords": [
"ember-addon",
Expand All @@ -49,9 +48,9 @@
"new version"
],
"dependencies": {
"ember-cli-babel": "^5.1.5",
"ember-cli-htmlbars": "^1.0.1",
"broccoli-file-creator": "^1.1.0"
"broccoli-file-creator": "^1.1.1",
"ember-cli-babel": "^6.5.1",
"ember-cli-htmlbars": "^1.0.1"
},
"ember-addon": {
"configPath": "tests/dummy/config"
Expand Down
12 changes: 0 additions & 12 deletions testem.json

This file was deleted.

6 changes: 2 additions & 4 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

let App;

Ember.MODEL_FACTORY_INJECTIONS = true;

App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Expand Down
16 changes: 8 additions & 8 deletions tests/dummy/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for 'head'}}
{{content-for "head"}}

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/dummy.css">
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/dummy.css">

{{content-for 'head-footer'}}
{{content-for "head-footer"}}
</head>
<body>
{{content-for 'body'}}
{{content-for "body"}}

<script src="assets/vendor.js"></script>
<script src="assets/dummy.js"></script>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/dummy.js"></script>

{{content-for 'body-footer'}}
{{content-for "body-footer"}}
</body>
</html>
3 changes: 2 additions & 1 deletion tests/dummy/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
location: config.locationType
location: config.locationType,
rootURL: config.rootURL
});

Router.map(function() {
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h2 id="title">Welcome to Ember</h2>
<h2 id="title">Ember New Version</h2>

{{outlet}}

Expand Down
Loading