Skip to content

Commit

Permalink
Update all the things (#104)
Browse files Browse the repository at this point in the history
* Run codemod

* Upgrade dependencies

* Fix ember-wormhole to 0.5.3

yapplabs/ember-wormhole#104

* Add bower to install script
  • Loading branch information
offirgolan committed Feb 12, 2018
1 parent 0d73598 commit f5f9350
Show file tree
Hide file tree
Showing 32 changed files with 1,779 additions and 698 deletions.
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

5 changes: 0 additions & 5 deletions .codeclimate.yml

This file was deleted.

10 changes: 2 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@ module.exports = {
],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:ember-suave/recommended'
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
/* TODO: The code should be refactored so these exceptions are not required */
'camelcase': 'off',
'ember/closure-actions': 'off',
'ember/no-on-calls-in-components': 'off',
'ember/avoid-leaking-state-in-ember-objects': 'off',
'new-cap': 'off'
'ember/no-on-calls-in-components': 'off'
},
overrides: [
// node files
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
Expand Down
18 changes: 6 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
---
language: node_js
node_js:
- "6"
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "4"

sudo: false
dist: trusty

addons:
chrome: stable
code_climate:
repo_token: ddeebbb73024342b8c799ff053a2a610d981ca1d2f1718909400bb746b1493d0

cache:
directories:
- node_modules
- $HOME/.npm
- $HOME/.cache # includes bowers cache
yarn: true

env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1
- COVERAGE=true
matrix:
# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
Expand All @@ -36,11 +32,12 @@ matrix:
fast_finish: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-beta

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- yarn global add bower codeclimate-test-reporter
- npm install -g bower
- bower --version

install:
Expand All @@ -52,6 +49,3 @@ script:
# 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

after_script:
- codeclimate-test-reporter < coverage/lcov.info
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) 2016
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
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
[![Ember Version](https://embadge.io/v1/badge.svg?start=2.3.0)](https://embadge.io/v1/badge.svg?start=2.3.0)
[![Build Status](https://travis-ci.org/offirgolan/ember-burger-menu.svg?branch=master)](https://travis-ci.org/offirgolan/ember-burger-menu)
[![npm version](https://badge.fury.io/js/ember-burger-menu.svg)](http://badge.fury.io/js/ember-burger-menu)
[![Code Climate](https://codeclimate.com/github/offirgolan/ember-burger-menu/badges/gpa.svg)](https://codeclimate.com/github/offirgolan/ember-burger-menu)
[![Test Coverage](https://codeclimate.com/github/offirgolan/ember-burger-menu/badges/coverage.svg)](https://codeclimate.com/github/offirgolan/ember-burger-menu/coverage)
[![Dependency Status](https://david-dm.org/offirgolan/ember-burger-menu.svg)](https://david-dm.org/offirgolan/ember-burger-menu)

An off-canvas sidebar component with a collection of animations and styles using CSS transitions

Expand Down
4 changes: 2 additions & 2 deletions addon/-private/state.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import EObject, { computed } from '@ember/object';
import EmberObject, { computed } from '@ember/object';
import getAnimation from 'ember-burger-menu/animations';

export default EObject.extend({
export default EmberObject.extend({
open: false,
locked: false,
width: 300,
Expand Down
8 changes: 3 additions & 5 deletions addon/animations/base.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import EmberObject from '@ember/object';
import { assign } from '@ember/polyfills';
import { assert } from '@ember/debug';
import { assign as emberAssign, merge } from '@ember/polyfills';
import cssStringify from 'ember-burger-menu/utils/css-stringify';
import EObject from '@ember/object';

const assign = emberAssign || merge;

const Animation = EObject.extend({
const Animation = EmberObject.extend({
animation: null,
itemAnimation: null,

Expand Down
2 changes: 1 addition & 1 deletion addon/animations/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from '@ember/debug';
import { typeOf, isEmpty } from '@ember/utils';
import { isEmpty, typeOf } from '@ember/utils';
import requireModule from 'ember-require-module';

const ANIMATION_PATH = 'ember-burger-menu/animations';
Expand Down
2 changes: 1 addition & 1 deletion addon/components/bm-menu-item.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from '@ember/component';
import $ from 'jquery';
import { run } from '@ember/runloop';
import { computed } from '@ember/object';
import Component from '@ember/component';
import layout from '../templates/components/bm-menu-item';
import computedStyleFor from 'ember-burger-menu/computed/style-for';
import isFastboot from 'ember-burger-menu/utils/is-fastboot';
Expand Down
9 changes: 6 additions & 3 deletions addon/components/bm-menu.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { computed, observer } from '@ember/object';
import { A as emberArray } from '@ember/array';
import Component from '@ember/component';
import { observer, computed } from '@ember/object';
import { A as emberArray } from '@ember/array';
import layout from '../templates/components/bm-menu';
import computedStyleFor from 'ember-burger-menu/computed/style-for';

Expand All @@ -19,6 +19,9 @@ export default Component.extend({
itemTagName: 'div',
dismissOnItemClick: false,

onOpen() {},
onClose() {},

style: computedStyleFor('menu').readOnly(),

renderInPlace: computed('state.animation', function() {
Expand All @@ -30,6 +33,6 @@ export default Component.extend({
}).readOnly(),

onOpenChange: observer('state.open', function() {
this.sendAction(this.get('state.open') ? 'onOpen' : 'onClose');
this[this.get('state.open') ? 'onOpen' : 'onClose']();
})
});
14 changes: 7 additions & 7 deletions addon/components/burger-menu.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Component from '@ember/component';
import $ from 'jquery';
import { on } from '@ember/object/evented';
import { run } from '@ember/runloop';
import { computed, observer } from '@ember/object';
import { alias } from '@ember/object/computed';
import Component from '@ember/component';
import layout from '../templates/components/burger-menu';
import computedStyleFor from 'ember-burger-menu/computed/style-for';
import SwipeSupportMixin from 'ember-burger-menu/mixins/swipe-support';
Expand Down Expand Up @@ -61,20 +61,20 @@ export default Component.extend(DomMixin, SwipeSupportMixin, {
_setupEvents() {

if (this.get('dismissOnClick')) {
this.addEventListener(document.body, 'click', this.onClick);
this.addEventListener(document.body, 'touchstart', this.onClick);
this.addEventListener(document.body, `click`, this.onClick);
this.addEventListener(document.body, `touchstart`, this.onClick);
}

if (this.get('dismissOnEsc')) {
this.addEventListener(window, 'keyup', this.onKeyup);
this.addEventListener(window, `keyup`, this.onKeyup);
}
},

_teardownEvents() {

this.removeEventListener(document.body, 'click', this.onClick);
this.removeEventListener(document.body, 'touchstart', this.onClick);
this.removeEventListener(window, 'keyup', this.onKeyup);
this.removeEventListener(document.body, `click`, this.onClick);
this.removeEventListener(document.body, `touchstart`, this.onClick);
this.removeEventListener(window, `keyup`, this.onKeyup);
},

onClick(e) {
Expand Down
19 changes: 10 additions & 9 deletions addon/mixins/swipe-support.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Mixin from '@ember/object/mixin';
import { isNone } from '@ember/utils';
import { alias } from '@ember/object/computed';
import Mixin from '@ember/object/mixin';

let meta;

Expand All @@ -13,7 +13,9 @@ export default Mixin.create({
touchStart(e) {
this._super(...arguments);

let [touch] = e.originalEvent.touches;
// jscs:disable
let touch = e.originalEvent.touches[0];
// jscs:enable

meta = {
target: e.target,
Expand All @@ -28,7 +30,9 @@ export default Mixin.create({
touchMove(e) {
this._super(...arguments);

let [touch] = e.originalEvent.touches;
// jscs:disable
let touch = e.originalEvent.touches[0];
// jscs:enable

meta.differences = {
x: touch.pageX - meta.start.x,
Expand All @@ -53,12 +57,9 @@ export default Mixin.create({
let maxSwipeTime = this.get('maxSwipeTime');
let elapsedTime = new Date().getTime() - meta.start.time;

if (
meta.isHorizontal
&& !meta.isInvalid
&& Math.abs(meta.differences.x) >= minSwipeDistance
&& elapsedTime <= maxSwipeTime
) {
if (meta.isHorizontal && !meta.isInvalid &&
Math.abs(meta.differences.x) >= minSwipeDistance &&
elapsedTime <= maxSwipeTime) {
this.onSwipe((meta.differences.x > 0) ? 'right' : 'left', meta.target);
}
}
Expand Down
5 changes: 1 addition & 4 deletions addon/utils/css-stringify.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { isEmpty } from '@ember/utils';
import {
dasherize,
htmlSafe
} from '@ember/string';
import { dasherize, htmlSafe } from '@ember/string';

const PREFIXES = ['webkit'];
const PREFIXED_PROPS = [
Expand Down
4 changes: 1 addition & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"name": "ember-burger-menu",
"dependencies": {
"font-awesome": "~4.5.0",
"bootstrap": "~3.3.5",
"es5-shim": "^4.5.8"
"bootstrap": "~3.3.5"
}
}
2 changes: 2 additions & 0 deletions config/changelog.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/*jshint node:true*/

// For details on each option run `ember help release`
module.exports = {

Expand Down
12 changes: 6 additions & 6 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ module.exports = {
name: 'ember-release',
bower: {
dependencies: {
'ember': 'components/ember#release'
ember: 'components/ember#release'
},
resolutions: {
'ember': 'release'
ember: 'release'
}
},
npm: {
Expand All @@ -37,10 +37,10 @@ module.exports = {
name: 'ember-beta',
bower: {
dependencies: {
'ember': 'components/ember#beta'
ember: 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
ember: 'beta'
}
},
npm: {
Expand All @@ -53,10 +53,10 @@ module.exports = {
name: 'ember-canary',
bower: {
dependencies: {
'ember': 'components/ember#canary'
ember: 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
ember: 'canary'
}
},
npm: {
Expand Down
28 changes: 28 additions & 0 deletions config/release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* eslint-env node */

var execSync = require('child_process').execSync;
// eslint-disable-next-line node/no-unpublished-require
var generateChangelog = require('ember-cli-changelog/lib/tasks/release-with-changelog');

module.exports = {
publish: true,

beforeCommit: generateChangelog,

afterPublish: function(project, versions) {
runCommand(
'ember github-pages:commit --message "Released ' + versions.next + '"'
);
runCommand('git push origin gh-pages:gh-pages');
}
};

function runCommand(command) {
// eslint-disable-next-line no-console
console.log('running: ' + command);

var output = execSync(command, { encoding: 'utf8' });

// eslint-disable-next-line no-console
console.log(output);
}
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';

module.exports = {
name: 'ember-burger-menu'
name: 'ember-burger-menu',

included: function(/* app */) {
this._super.included.apply(this, arguments);
}
};

0 comments on commit f5f9350

Please sign in to comment.