Skip to content

Commit

Permalink
Merge pull request #6 from pabloascarza/master
Browse files Browse the repository at this point in the history
Update to Ember 3.8
  • Loading branch information
pabloascarza authored Jul 31, 2019
2 parents 9e7ccb1 + 1a6aae7 commit f77625f
Show file tree
Hide file tree
Showing 20 changed files with 8,360 additions and 4,756 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ module.exports = {
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/node_modules/

# misc
/.env*
/.pnp*
/.sass-cache
/connect.lock
/coverage/
Expand All @@ -21,5 +23,3 @@
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

\.vscode/
20 changes: 19 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
/bower_components
# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/.bowerrc
/.editorconfig
/.ember-cli
/.env*
/.eslintignore
/.eslintrc.js
/.gitignore
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/dist
/tests
Expand Down
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'
};
40 changes: 28 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,37 @@ env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1
matrix:

branches:
only:
- master
# npm version tags
- /^v\d+\.\d+\.\d+/

jobs:
fail_fast: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

include:
# runs linting and tests with current locked deps

- stage: "Tests"
name: "Tests"
script:
- npm run lint:hbs
- npm run lint:js
- npm test

# 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:
- stage: "Additional Tests"
env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-lts-3.4
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery

before_install:
- npm config set spin false
Expand Down
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# How To Contribute

## Installation

* `git clone <repository-url>`
* `cd my-addon`
* `npm install`

## Linting

* `npm run lint:hbs`
* `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/).
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) 2018
Copyright (c) 2019

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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ you are saving on `localStorage` which you then use to update your UI through ev
a new tab is opened.
* This service is most useful on objects that provide global functionality to your application, such as other services.

## Installation

`ember install ember-master-tab`

Expand Down Expand Up @@ -192,4 +191,4 @@ export default Ember.Service.extend({

## License

Ember Master Tab is released under the [MIT Licencse](https://github.com/rhyek/ember-master-tab/blob/master/LICENSE.md).
Ember Master Tab is released under the [MIT Licencse](https://github.com/rhyek/ember-master-tab/blob/master/LICENSE.md).
19 changes: 9 additions & 10 deletions addon/initializers/master-tab.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import Ember from 'ember';
import MasterTabService from '../services/master-tab-factory';

export function initialize(application) {
if (!Ember.testing) {
const masterTab = MasterTabService.create();
application.unregister('service:master-tab-factory');
application.register('service:master-tab', masterTab, { instantiate: false });
application.deferReadiness();
masterTab.setup().then(() => {
application.advanceReadiness();
});
}
if (!application.testing) {
const masterTab = MasterTabService.create();
application.unregister('service:master-tab-factory');
application.register('service:master-tab', masterTab, { instantiate: false });
application.deferReadiness();
masterTab.setup().then(() => {
application.advanceReadiness();
});
}
}

export default {
Expand Down
6 changes: 4 additions & 2 deletions addon/services/master-tab-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default Service.extend(Evented, {
setup() {
const storageHandler = e => {
switch (e.key) {
case tabIdKey:
case tabIdKey: {
const newTabId = e.newValue;
if (newTabId === null) {

Expand All @@ -51,7 +51,8 @@ export default Service.extend(Evented, {
}
}
break;
case shouldInvalidateMasterTabKey:
}
case shouldInvalidateMasterTabKey: {
const shouldInvalidateMasterTab = eval(e.newValue);
const _isMasterTab = isMasterTab();
if (shouldInvalidateMasterTab && _isMasterTab) {
Expand All @@ -69,6 +70,7 @@ export default Service.extend(Evented, {
}
}
break;
}
}
};
window.addEventListener('storage', storageHandler);
Expand Down
37 changes: 25 additions & 12 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,22 @@ module.exports = function() {
return {
scenarios: [
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0'
}
}
},
{
name: 'ember-lts-2.16',
name: 'ember-lts-2.18',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true })
},
npm: {
devDependencies: {
'ember-source': '~2.16.0'
'@ember/jquery': '^0.5.1',
'ember-source': '~2.18.0'
}
}
},
{
name: 'ember-lts-2.18',
name: 'ember-lts-3.4',
npm: {
devDependencies: {
'ember-source': '~2.18.0'
'ember-source': '~3.4.0'
}
}
},
Expand Down Expand Up @@ -58,11 +54,28 @@ module.exports = function() {
}
}
},
// The default `.travis.yml` runs this scenario via `npm 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: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'jquery-integration': true
})
},
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1'
}
}
}
]
};
Expand Down
3 changes: 3 additions & 0 deletions config/optional-features.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"jquery-integration": true
}
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
name: 'ember-master-tab'
name: require('./package').name
};
1 change: 1 addition & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compilerOptions":{"target":"es6","experimentalDecorators":true},"exclude":["node_modules","bower_components","tmp","vendor",".git","dist"]}
Loading

0 comments on commit f77625f

Please sign in to comment.