Skip to content

Commit

Permalink
feat: Rename Addon
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Addon is now named `ember-toggle`, make sure to update your `config/environment.js` accordingly.

_This is due to the fact that the `ember-cli-*` naming convention for Ember Addons is
meant mainly for extending the CLI in some way, which this addon doesn't do. Also it's shorter and easier to remember._
  • Loading branch information
knownasilya authored and Ilya Radchenko committed Mar 16, 2017
1 parent ab641fc commit 0bdcc89
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 27 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ember-cli-toggle
# ember-toggle

Checkbox based Toggle Switch component for Ember.
Based on [this](http://codepen.io/mallendeo/pen/eLIiG/) codepen.
Expand All @@ -12,7 +12,7 @@ See the ***0.x*** branch for 0.x code and fixes.

## Install

`ember install ember-cli-toggle`
`ember install ember-toggle`

## Basic Usage

Expand Down Expand Up @@ -49,7 +49,7 @@ There are many `themes` which change the visual appearance of the switch. Check
- flip
- skewed

![ ](vendor/ember-cli-toggle/example-images/show-labels.png)
![ ](vendor/ember-toggle/example-images/show-labels.png)
> example of "default" theme

Expand Down Expand Up @@ -105,11 +105,11 @@ When we use the `action` helper instead of `mut`, the data we get back is more r

### Configuring

Add a configuration for `ember-cli-toggle` to include only the themes that
Add a configuration for `ember-toggle` to include only the themes that
you will use.

```js
ENV['ember-cli-toggle'] = {
ENV['ember-toggle'] = {
includedThemes: ['light', 'default', 'flip'],
excludedThemes: ['flip'],
excludeBaseStyles: false, // defaults to false
Expand All @@ -126,7 +126,7 @@ To exclude or not include a theme, means that it's css styles will not be bundle
your application, thus not polluting your app.

> **Note:** including a blank array e.g. `includeThemes: []` will not include any themes, leaving
you to define your own theme styles. See the `vendor/ember-cli-toggle/themes` directory
you to define your own theme styles. See the `vendor/ember-toggle/themes` directory
for reference.
> **Note:** you may also want to set `excludeBaseStyles: true` so that this addon doesn't include the styles
used by all the themes.
Expand All @@ -135,11 +135,11 @@ used by all the themes.

See [CONTRIBUTING.md] for details.

[npm-badge]: https://nodei.co/npm/ember-cli-toggle.png?downloads=true&stars=true
[npm-badge-url]: https://nodei.co/npm/ember-cli-toggle/
[travis-badge]: https://travis-ci.org/knownasilya/ember-cli-toggle.svg
[travis-badge-url]: https://travis-ci.org/knownasilya/ember-cli-toggle
[ember-observer-badge]: http://emberobserver.com/badges/ember-cli-toggle.svg
[ember-observer-url]: http://emberobserver.com/addons/ember-cli-toggle
[demo]: http://knownasilya.github.io/ember-cli-toggle/
[npm-badge]: https://nodei.co/npm/ember-toggle.png?downloads=true&stars=true
[npm-badge-url]: https://nodei.co/npm/ember-toggle/
[travis-badge]: https://travis-ci.org/knownasilya/ember-toggle.svg
[travis-badge-url]: https://travis-ci.org/knownasilya/ember-toggle
[ember-observer-badge]: http://emberobserver.com/badges/ember-toggle.svg
[ember-observer-url]: http://emberobserver.com/addons/ember-toggle
[demo]: http://knownasilya.github.io/ember-toggle/
[CONTRIBUTING.md]: CONTRIBUTING.md
5 changes: 3 additions & 2 deletions app/components/x-toggle.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import XToggle from 'ember-cli-toggle/components/x-toggle/component';

import XToggle from 'ember-toggle/components/x-toggle/component';
import ENV from '../config/environment';

const config = ENV['ember-cli-toggle'] || {};
const config = ENV['ember-toggle'] || {};

export default XToggle.extend({
theme: config.defaultTheme || 'default',
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "ember-cli-toggle",
"name": "ember-toggle",
"dependencies": {}
}
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

module.exports = {
name: 'ember-cli-toggle',
name: 'ember-toggle',

included: function(app, parentAddon) {
var target = (parentAddon || app);
Expand All @@ -23,7 +23,7 @@ module.exports = {

importThemes: function(app) {
var projectConfig = this.project.config(app.env);
var config = projectConfig['ember-cli-toggle'];
var config = projectConfig['ember-toggle'];
var themes = [];
var excludeBaseStyles = false;

Expand Down Expand Up @@ -53,13 +53,13 @@ module.exports = {
}

if (!excludeBaseStyles) {
app.import('vendor/ember-cli-toggle/base.css');
app.import('vendor/ember-toggle/base.css');
}

themes = themes.length ? themes : ['default'];

themes.forEach(function (theme) {
app.import('vendor/ember-cli-toggle/themes/' + theme + '.css');
app.import('vendor/ember-toggle/themes/' + theme + '.css');
});
}
};
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ember-cli-toggle",
"name": "ember-toggle",
"version": "3.0.0",
"description": "Checkbox based toggle switch component for Ember.js",
"directories": {
Expand All @@ -11,7 +11,7 @@
"build": "ember build",
"test": "ember try:each"
},
"repository": "https://github.com/knownasilya/ember-cli-toggle",
"repository": "https://github.com/knownasilya/ember-toggle",
"engines": {
"node": ">= 0.12.0"
},
Expand Down Expand Up @@ -55,6 +55,6 @@
},
"ember-addon": {
"configPath": "tests/dummy/config",
"demoURL": "http://knownasilya.github.io/ember-cli-toggle/"
"demoURL": "http://knownasilya.github.io/ember-toggle/"
}
}
2 changes: 1 addition & 1 deletion tests/dummy/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ember-cli-toggle</title>
<title>ember-toggle</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

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 @@
<h1 id='title'>ember-cli-toggle</h1>
<h1 id='title'>ember-toggle</h1>

<h2>Themes</h2>

Expand Down
4 changes: 2 additions & 2 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = function(environment) {
var ENV = {
modulePrefix: 'dummy',
environment: environment,
rootURL: '/ember-cli-toggle/',
rootURL: '/ember-toggle/',
locationType: 'auto',
EmberENV: {
FEATURES: {
Expand All @@ -22,7 +22,7 @@ module.exports = function(environment) {
// when it is created
},

'ember-cli-toggle': {
'ember-toggle': {
//includedThemes: ['light', 'ios', 'flip'],
//excludedThemes: ['flip'],
//defaultTheme: 'light',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0bdcc89

Please sign in to comment.