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

Bump ember-css-modules & fix regression #201

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
48 changes: 46 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,54 @@ module.exports = {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
}
},
overrides: [
// node files
{
files: [
'index.js',
'testem.js',
'ember-cli-build.js',
'config/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: [
'app/**',
'addon/**',
'tests/dummy/app/**'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
},

// test files
{
files: ['tests/**/*.js'],
excludedFiles: ['tests/dummy/**/*.js'],
env: {
embertest: true
}
}
]
};
7 changes: 6 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
.bowerrc
.editorconfig
.ember-cli
.gitignore
.eslintrc.js
.gitignore
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.js

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ env:
matrix:
# 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.8
- EMBER_TRY_SCENARIO=ember-lts-2.12
- EMBER_TRY_SCENARIO=ember-lts-2.16
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
Expand All @@ -40,6 +40,7 @@ before_install:
- npm --version

script:
- npm run lint:js
# 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
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
23 changes: 16 additions & 7 deletions addon/services/notification-messages-service.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
import { getOwner } from '@ember/application';
import { A } from '@ember/array';
import EmberObject, { computed } from '@ember/object';
import { assign, merge } from '@ember/polyfills';
import ArrayProxy from '@ember/array/proxy';
import { A } from '@ember/array';
import { isEmpty } from '@ember/utils';
import EmberObject, { getWithDefault } from '@ember/object';
import { run } from '@ember/runloop';
import config from 'ember-get-config';

const notificationAssign = assign || merge;
const globals = config['ember-cli-notifications']; // Import app config object

const NotificationMessagesService = ArrayProxy.extend({
content: A(),

_defaultOptions: computed(function() {
const envOptions = getOwner(this).resolveRegistration('config:environment')['ember-cli-notifications'];
return notificationAssign({
autoClear: false,
clearDuration: 5000
}, envOptions);
}),

// Method for adding a notification
addNotification(options) {
// If no message is set, throw an error
if (!options.message) {
throw new Error("No notification message set");
}

// Override defaults with environment and override that with passed-in values
const { autoClear, clearDuration } = notificationAssign(this.get('_defaultOptions'), options);

const notification = EmberObject.create({
message: options.message,
type: options.type || 'info',
autoClear: (isEmpty(options.autoClear) ? getWithDefault(globals, 'autoClear', false) : options.autoClear),
clearDuration: options.clearDuration || getWithDefault(globals, 'clearDuration', 5000),
autoClear,
clearDuration,
onClick: options.onClick,
htmlContent: options.htmlContent || false,
cssClasses: options.cssClasses
Expand Down
10 changes: 6 additions & 4 deletions app/components/notification-message.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import NotificationMessage from 'ember-cli-notifications/components/notification-message';
import ENV from '../config/environment';

const config = ENV['ember-cli-notifications'] || {};
import { getOwner } from '@ember/application';
import { computed } from '@ember/object';

export default NotificationMessage.extend({
icons: config.icons || 'font-awesome'
icons: computed(function() {
const config = getOwner(this).resolveRegistration('config:environment')['ember-cli-notifications'] || {};
return config.icons || 'font-awesome';
})
});
18 changes: 5 additions & 13 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
/* eslint-env node */
module.exports = {
//useYarn: true,
scenarios: [
{
name: 'ember-lts-2.8',
bower: {
dependencies: {
'ember': 'components/ember#lts-2-8'
},
resolutions: {
'ember': 'lts-2-8'
}
},
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': null
'ember-source': '~2.12.0'
}
}
},
{
name: 'ember-lts-2.12',
name: 'ember-lts-2.16',
npm: {
devDependencies: {
'ember-source': '~2.12.0'
'ember-source': '~2.16.0'
}
}
},
Expand Down
1 change: 0 additions & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env node */
'use strict';

module.exports = function(/* environment, appConfig */) {
Expand Down
1 change: 0 additions & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env node */
'use strict';

const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env node */
'use strict';

const Funnel = require('broccoli-funnel');
Expand Down
Loading