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 to LTS 3.20 #291

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
22 changes: 2 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
defaults: &defaults
docker:
- image: circleci/node:6.12-browsers
- image: circleci/node:12.22-browsers
environment:
JOBS: 2
working_directory: ~/emberx-select
version: 2.0
references:
container_config: &container_config
docker:
- image: circleci/node:6-browsers
- image: circleci/node:12-browsers
environment:
JOBS: 2
working_directory: ~/emberx-select
Expand All @@ -26,12 +26,6 @@ references:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies

restore_bower_components: &restore_bower_components
restore_cache:
keys:
- v1-bower-dependencies-{{ checksum "bower.json" }}
- v1-bower-dependencies

jobs:
checkout_code:
<<: *container_config
Expand All @@ -48,64 +42,52 @@ jobs:
steps:
- *restore_repo
- *restore_node_modules
- *restore_bower_components
- run: yarn install
- run: yarn bower-install
- save_cache:
key: v1-dependencies-{{ checksum "package.json" }}
paths:
- node_modules
- save_cache:
key: v1-bower-dependencies-{{ checksum "bower.json" }}
paths:
- bower_components

test-lts-2.12:
<<: *container_config
steps:
- *restore_repo
- *restore_node_modules
- *restore_bower_components
- run: node_modules/.bin/ember try:one ember-lts-2.12 --skip-cleanup

test-lts-2.16:
<<: *container_config
steps:
- *restore_repo
- *restore_node_modules
- *restore_bower_components
- run: node_modules/.bin/ember try:one ember-lts-2.16 --skip-cleanup

test-release:
<<: *container_config
steps:
- *restore_repo
- *restore_node_modules
- *restore_bower_components
- run: node_modules/.bin/ember try:one ember-release --skip-cleanup

test-beta:
<<: *container_config
steps:
- *restore_repo
- *restore_node_modules
- *restore_bower_components
- run: node_modules/.bin/ember try:one ember-beta --skip-cleanup

test-canary:
<<: *container_config
steps:
- *restore_repo
- *restore_node_modules
- *restore_bower_components
- run: node_modules/.bin/ember try:one ember-canary --skip-cleanup

test-default:
<<: *container_config
steps:
- *restore_repo
- *restore_node_modules
- *restore_bower_components
- run: node_modules/.bin/ember try:one ember-default --skip-cleanup

workflows:
Expand Down
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
Expand Down
20 changes: 12 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: ['prefer-let', 'ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended'],
env: {
browser: true
},
rules: {
'prefer-let/prefer-let': 2
'ember/no-observers': 0,
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
Expand All @@ -26,17 +33,14 @@ module.exports = {
],
excludedFiles: ['addon/**', 'addon-test-support/**', 'app/**', 'tests/dummy/app/**'],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
sourceType: 'script'
},
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
})
extends: ['plugin:node/recommended']
}
]
};
2 changes: 2 additions & 0 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 Down
6 changes: 5 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
/.bowerrc
/.editorconfig
/.ember-cli
/.env*
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.watchmanconfig
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/CONTRIBUTING.md
/ember-cli-build.js
/testem.js
/tests/
Expand Down
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
extends: 'octane'
};
37 changes: 21 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "6"
- "10"

sudo: false
dist: trusty
dist: xenial

addons:
chrome: stable
Expand All @@ -19,43 +18,49 @@ env:
# See https://git.io/vdao3 for details.
- JOBS=1

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

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

include:
# runs linting and tests with current locked deps

- stage: "Tests"
name: "Tests"
install:
- yarn install --non-interactive
script:
- yarn lint:hbs
- yarn lint:js
- yarn test
- yarn lint
- yarn test:ember

- name: "Floating Dependencies"
- stage: "Additional Tests"
name: "Floating Dependencies"
install:
- yarn install --no-lockfile --non-interactive
script:
- yarn test
- yarn test:ember

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- stage: "Additional Tests"
env: EMBER_TRY_SCENARIO=ember-lts-2.16
- env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-lts-3.12
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
- env: EMBER_TRY_SCENARIO=ember-lts-3.20
- 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
- env: EMBER_TRY_SCENARIO=ember-classic

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH

install:
- yarn install --no-lockfile --non-interactive
- yarn install --non-interactive

script:
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
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 emberx-select`
* `yarn install`

## Linting

* `yarn lint:hbs`
* `yarn lint:js`
* `yarn 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/).
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ The goal of `<XSelect>` is to let you see how it works and style it
right in your template, rather than passing in a ball of configuration
or wrapping a hard-coded, inaccessible jQuery plugin.

## Compatibility

* Ember.js v3.12 or above
* Ember CLI v2.13 or above
* Node.js v10 or above

## Installation

Expand Down Expand Up @@ -341,9 +346,18 @@ application at http://emberx-select.netlify.com

Npm releases use semver and happen at the project owner's discretion.


## Code of Conduct

Please note that this project is released with a Contributor Code of
Conduct. By participating in this project you agree to abide by its
terms, which can be found in the `CODE_OF_CONDUCT.md` file in this
repository.

## Contributing

See the [Contributing](CONTRIBUTING.md) guide for details.

## License

This project is licensed under the [MIT License](LICENSE.md).
26 changes: 14 additions & 12 deletions addon/components/x-option.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,33 @@ export default Component.extend({
* @type Boolean
*/
selected: computed('value', 'select.{value,multiple}', function() {
if (this.get('select.multiple') && isArray(this.get('select.value'))) {
let selectValue = A(this.get('select.value'));
if (this.select?.multiple && isArray(this.select?.value)) {
let selectValue = A(this.select?.value);

return selectValue.includes(this.get('value'));
return selectValue.includes(this.value);
} else {
return this.get('value') === this.get('select.value');
return this.value === this.select?.value;
}
}),

didReceiveAttrs() {
this._super.apply(this, arguments);

let oldDisabled = this.get('_oldDisabled');
let oldDisabled = this._oldDisabled;

if (oldDisabled !== undefined && !oldDisabled) {
// Undefined means the first time

if (this.get('disabled') !== oldDisabled) {
this.get('onDisable')(this.get('value'), this.get('disabled'));
if (this.disabled !== oldDisabled) {
this.onDisable(this.value, this.disabled);
}
}

this.set('_oldDisabled', this.get('disabled'));
this.set('_oldDisabled', this.disabled);
},

callRegister() {
this.register(this)
},

/**
Expand All @@ -70,9 +74,7 @@ export default Component.extend({
didInsertElement() {
this._super.apply(this, arguments);

scheduleOnce('afterRender', () => {
this.get('register')(this);
});
scheduleOnce('afterRender', this, this.callRegister);
},

/**
Expand All @@ -81,7 +83,7 @@ export default Component.extend({
* @override
*/
willDestroyElement: function() {
this.get('unregister')(this);
this.unregister(this);
this._super.apply(this, arguments);
}
});
Loading