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 ember-cli 3.16 #341

Merged
merged 1 commit into from
Aug 6, 2021
Merged
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
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
12 changes: 9 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module'
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
'ember'
Expand All @@ -23,6 +29,7 @@ module.exports = {
'ember/no-observers': 'warn',
'ember/require-computed-macros': 'warn',
'ember/require-tagless-components': 'warn',
'ember/no-jquery': 'error'
},
overrides: [
// node files
Expand All @@ -44,8 +51,7 @@ module.exports = {
'tests/dummy/app/**'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
sourceType: 'script'
},
env: {
browser: false,
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/.env*
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.template-lintrc.js
/.travis.yml
Expand Down
43 changes: 35 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ 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
- "12"
- "10"

sudo: required
dist: trusty

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

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

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

include:
# runs linting and tests with current locked deps
- stage: "Tests"
name: "Tests"
script:
- yarn lint:hbs
- yarn lint:js
- yarn test

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

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
- 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:
- yarn 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:each --skip-cleanup
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ Here is a more useful example of how to conditionally display a modal based on a
**Controller**

```javascript
import Ember from 'ember';
import Controller from '@ember/controller';

export default Ember.Controller.extend({
export default Controller.extend({
isShowingModal: false,
actions: {
toggleModal: function() {
toggleModal() {
this.toggleProperty('isShowingModal');
}
}
Expand Down Expand Up @@ -316,7 +316,7 @@ This can work, but some apps require a more sophisticated approach. One approach

```javascript
// app/components/modal-dialog.js
import Ember from 'ember';
import { on } from '@ember/object/evented';
import ModalDialog from 'ember-modal-dialog/components/modal-dialog';
import { EKMixin as EmberKeyboardMixin, keyDown } from 'ember-keyboard';

Expand All @@ -327,7 +327,7 @@ export default ModalDialog.extend(EmberKeyboardMixin, {
this.set('keyboardActivated', true);
},

closeOnEsc: Ember.on(keyDown('Escape'), function() {
closeOnEsc: on(keyDown('Escape'), function() {
this.get('onClose')();
})
});
Expand Down Expand Up @@ -371,7 +371,7 @@ If you create an addon that you want to depend on ember-modal-dialog, you need t

module.exports = {
name: 'my-addon',
config: function(environment, appConfig) {
config(environment, appConfig) {
let initialConfig = _.merge({}, appConfig);
let updatedConfig = this.addons.reduce((config, addon) => {
if (addon.config) {
Expand Down
2 changes: 1 addition & 1 deletion addon/components/basic-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default Component.extend({
return /iPad|iPhone|iPod/.test(navigator.userAgent);
}),

makeOverlayClickableOnIOS: function() {
makeOverlayClickableOnIOS() {
if (this.isIOS) {
let overlayEl = document.querySelector('div[data-emd-overlay]');
if (overlayEl) {
Expand Down
8 changes: 3 additions & 5 deletions addon/helpers/ignore-children.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import Ember from 'ember';
import { helper } from '@ember/component/helper';

export function ignoreChildren([nextHandler]) {
export default helper(function ignoreChildren([nextHandler]) {
return function(...args) {
let event = args[args.length - 1];
if (event && event.target === event.currentTarget) {
nextHandler.apply(this, args);
}
};
}

export default Ember.Helper.helper(ignoreChildren);
});
1 change: 1 addition & 0 deletions app/helpers/ignore-children.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-modal-dialog/helpers/ignore-children';
84 changes: 80 additions & 4 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,81 @@
/* eslint-env node */
module.exports = {
useYarn: true,
useVersionCompatibility: true
'use strict';

const getChannelURL = require('ember-source-channel-url');

module.exports = async function() {
return {
useYarn: true,
scenarios: [
{
name: 'ember-lts-3.16',
npm: {
devDependencies: {
'ember-source': '~3.16.0'
}
}
},
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': await getChannelURL('release')
}
}
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': await getChannelURL('beta')
}
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': await getChannelURL('canary')
}
}
},
// The default `.travis.yml` runs this scenario via `yarn 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'
}
}
},
{
name: 'ember-classic',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'application-template-wrapper': true,
'default-async-observers': false,
'template-only-glimmer-components': false
})
},
npm: {
ember: {
edition: 'classic'
}
}
}
]
};
};
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';

var VersionChecker = require('ember-cli-version-checker');
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
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* eslint-env node */
'use strict';

var fs = require('fs');
var path = require('path');

module.exports = {
name: require('./package').name,
config: function (env, baseConfig) {
config(env, baseConfig) {
var configPath = path.join(this.root, 'config', 'environment.js');

if (fs.existsSync(configPath)) {
Expand All @@ -15,5 +14,4 @@ module.exports = {
return configGenerator(env, baseConfig, this);
}
}

};
48 changes: 27 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "tests"
},
"scripts": {
"build": "ember build",
"build": "ember build --environment=production",
"deploy": "ember github-pages:commit --message \"Deploy gh-pages from commit $(git rev-parse HEAD)\"; git push; git checkout -",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
Expand All @@ -24,44 +24,47 @@
},
"dependencies": {
"ember-cli-babel": "^7.23.0",
"ember-cli-htmlbars": "^3.0.0",
"ember-cli-htmlbars": "^4.2.2",
"ember-cli-version-checker": "^2.1.0",
"ember-wormhole": "^0.6.0"
},
"devDependencies": {
"@ember/jquery": "^0.5.2",
"@ember/optional-features": "^0.7.0",
"broccoli-asset-rev": "^2.7.0",
"ember-cli": "~3.9.0",
"@ember/jquery": "^2.0.0",
"@ember/optional-features": "^1.3.0",
"@glimmer/component": "^1.0.0",
"@glimmer/tracking": "^1.0.0",
"babel-eslint": "^10.0.3",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.5.3",
"ember-cli": "~3.16.0",
"ember-cli-build-notifications": "^0.4.0",
"ember-cli-dependency-checker": "^3.1.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-deprecation-workflow": "^1.0.1",
"ember-cli-github-pages": "^0.2.1",
"ember-cli-htmlbars-inline-precompile": "^1.0.3",
"ember-cli-inject-live-reload": "^1.8.2",
"ember-cli-github-pages": "^0.2.2",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-shims": "^1.2.0",
"ember-cli-template-lint": "^1.0.0-beta.1",
"ember-cli-uglify": "^2.1.0",
"ember-cli-template-lint": "^1.0.0-beta.3",
"ember-cli-uglify": "^3.0.0",
"ember-code-snippet": "^2.4.0",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.1.0",
"ember-export-application-global": "^2.0.1",
"ember-load-initializers": "^2.1.1",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^3.4.1",
"ember-resolver": "^5.0.1",
"ember-qunit": "^4.6.0",
"ember-resolver": "^7.0.0",
"ember-source": "~3.27.0",
"ember-source-channel-url": "^1.1.0",
"ember-source-channel-url": "^2.0.1",
"ember-tether": "^1.0.0",
"ember-truth-helpers": "^2.0.0",
"ember-try": "^1.0.0",
"ember-truth-helpers": "^3.0.0",
"ember-try": "^1.4.0",
"eslint": "^7.16.0",
"eslint-plugin-ember": "^10.0.2",
"eslint-plugin-node": "^11.1.0",
"liquid-fire": "^0.29.5",
"liquid-fire": "^0.31.0",
"liquid-tether": "^2.0.7",
"liquid-wormhole": "^2.1.5",
"loader.js": "^4.7.0",
"qunit-dom": "^0.8.0",
"qunit-dom": "^1.0.0",
"release-it": "^13.6.5",
"release-it-lerna-changelog": "^2.3.0"
},
Expand All @@ -71,6 +74,9 @@
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"ember": {
"edition": "octane"
},
"ember-addon": {
"configPath": "tests/dummy/config",
"demoURL": "http://yapplabs.github.io/ember-modal-dialog/",
Expand Down
Loading