From 0ca640eee7ee9a64dd7be094648865f578cb824c Mon Sep 17 00:00:00 2001 From: Ilya Radchenko Date: Fri, 4 Jan 2019 16:56:55 -0500 Subject: [PATCH] fix: update using ember-cli-update --- .eslintignore | 21 ++++++- .eslintrc.js | 2 + .gitignore | 22 ++++---- .npmignore | 44 ++++++++++----- .template-lintrc.js | 5 ++ .travis.yml | 50 +++++++++++------ CONTRIBUTING.md | 26 +++++++++ LICENSE.md | 2 +- README.md | 27 +-------- config/ember-try.js | 37 +++++++++++-- index.js | 2 +- package.json | 67 ++++++++++++----------- testem.js | 11 ++-- tests/dummy/config/optional-features.json | 3 + 14 files changed, 205 insertions(+), 114 deletions(-) create mode 100644 .template-lintrc.js create mode 100644 CONTRIBUTING.md create mode 100644 tests/dummy/config/optional-features.json diff --git a/.eslintignore b/.eslintignore index 0516e6e..72df373 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,20 @@ -/blueprints/*/files/**/*.js +# unconventional js +/blueprints/*/files/ +/vendor/ + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/.eslintrc.js b/.eslintrc.js index c821ce4..e9e3de4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,6 +24,8 @@ module.exports = { // node files { files: [ + '.eslintrc.js', + '.template-lintrc.js', 'ember-cli-build.js', 'index.js', 'testem.js', diff --git a/.gitignore b/.gitignore index 818be65..29c9bc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,23 @@ # See https://help.github.com/ignore-files/ for more about ignoring files. # compiled output -/dist -/tmp +/dist/ +/tmp/ # dependencies -/node_modules -/bower_components +/bower_components/ +/node_modules/ # misc /.sass-cache /connect.lock -/coverage/* +/coverage/ /libpeerconnection.log -npm-debug.log* -yarn-error.log -testem.log +/npm-debug.log* +/testem.log +/yarn-error.log # ember-try -.node_modules.ember-try/ -bower.json.ember-try -package.json.ember-try \ No newline at end of file +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/.npmignore b/.npmignore index 552d952..82ca2cb 100644 --- a/.npmignore +++ b/.npmignore @@ -1,16 +1,30 @@ -/bower_components +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ + +# misc +/.bowerrc +/.editorconfig +/.ember-cli +/.eslintignore +/.eslintrc.js +/.gitignore +/.template-lintrc.js +/.travis.yml +/.watchmanconfig +/bower.json /config/ember-try.js -/dist -/tests -/tmp -**/.gitkeep -.bowerrc -.editorconfig -.ember-cli -.gitignore -.eslintrc.js -.watchmanconfig -.travis.yml -bower.json -ember-cli-build.js -testem.js \ No newline at end of file +/CONTRIBUTING.md +/ember-cli-build.js +/testem.js +/tests/ +/yarn.lock +.gitkeep + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/.template-lintrc.js b/.template-lintrc.js new file mode 100644 index 0000000..b45e96f --- /dev/null +++ b/.template-lintrc.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + extends: 'recommended' +}; diff --git a/.travis.yml b/.travis.yml index c0f32a3..dfd574f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ --- 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" -useYarn: true - sudo: false dist: trusty @@ -18,22 +18,38 @@ env: global: # See https://git.io/vdao3 for details. - JOBS=1 - 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.12 - - EMBER_TRY_SCENARIO=ember-lts-2.16 - - EMBER_TRY_SCENARIO=ember-lts-2.18 - - EMBER_TRY_SCENARIO=ember-release - - EMBER_TRY_SCENARIO=ember-beta - - EMBER_TRY_SCENARIO=ember-canary - - EMBER_TRY_SCENARIO=ember-default - -matrix: - fast_finish: true + +branches: + only: + - master + # npm version tags + - /^v\d+\.\d+\.\d+/ + +jobs: + fail_fast: true allow_failures: - env: EMBER_TRY_SCENARIO=ember-canary + + include: + # runs linting and tests with current locked deps + + - stage: "Tests" + name: "Tests" + script: + - npm run lint:hbs + - npm run lint:js + - npm test + + # 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.4 + - 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 before_install: - curl -o- -L https://yarnpkg.com/install.sh | bash @@ -43,6 +59,4 @@ install: - yarn install --no-lockfile --non-interactive 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 + - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4d14b95 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# How To Contribute + +## Installation + +* `git clone ` +* `cd my-addon` +* `npm install` + +## Linting + +* `npm run lint:hbs` +* `npm run lint:js` +* `npm run 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/). \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md index 00e9fbb..f8d1edb 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 +Copyright (c) 2019 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: diff --git a/README.md b/README.md index 2e4c53d..ed12766 100644 --- a/README.md +++ b/README.md @@ -99,30 +99,9 @@ var app = new EmberApp(defaults, { ## Contributing -### Installation +See the [Contributing](CONTRIBUTING.md) guide. -* `git clone ` -* `cd my-addon` -* `npm install` - -### Linting - -* `npm run lint:js` -* `npm run 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/). - -## License +License +------------------------------------------------------------------------------ This project is licensed under the [MIT License](LICENSE.md). diff --git a/config/ember-try.js b/config/ember-try.js index 644b02b..e2dfc27 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -11,26 +11,34 @@ module.exports = function() { return { scenarios: [ { - name: 'ember-lts-2.12', + name: 'ember-lts-2.16', + env: { + EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }) + }, npm: { devDependencies: { - 'ember-source': '~2.12.0' + '@ember/jquery': '^0.5.1', + 'ember-source': '~2.16.0' } } }, { - name: 'ember-lts-2.16', + name: 'ember-lts-2.18', + env: { + EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }) + }, npm: { devDependencies: { - 'ember-source': '~2.16.0' + '@ember/jquery': '^0.5.1', + 'ember-source': '~2.18.0' } } }, { - name: 'ember-lts-2.18', + name: 'ember-lts-3.4', npm: { devDependencies: { - 'ember-source': '~2.18.0' + 'ember-source': '~3.4.0' } } }, @@ -58,11 +66,28 @@ module.exports = function() { } } }, + // The default `.travis.yml` runs this scenario via `npm 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' + } + } } ] }; diff --git a/index.js b/index.js index 680da68..02adb29 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const writeFile = require('broccoli-file-creator'); module.exports = { - name: 'ember-cli-new-version', + name: require('./package').name, /** * Store `ember-cli-build.js` options diff --git a/package.json b/package.json index a55fbb6..22cbcba 100644 --- a/package.json +++ b/package.json @@ -2,51 +2,44 @@ "name": "ember-cli-new-version", "version": "1.4.1", "description": "A convention based update notification for Ember. With this addon, you can detect a new version and notify the user to refresh the page", - "directories": { - "doc": "doc", - "test": "tests" - }, "scripts": { "build": "ember build", + "lint:hbs": "ember-template-lint .", "start": "ember server", "test": "ember test", "test:all": "ember try:each", "release": "standard-version" }, - "repository": { - "type": "git", - "url": "https://github.com/sethwebster/ember-cli-new-version.git" - }, "engines": { - "node": "6.* || >= 7.*" + "node": "6.* || 8.* || >= 10.*" }, - "author": "", - "license": "MIT", "devDependencies": { - "broccoli-asset-rev": "^2.5.0", - "ember-cli": "~3.1.4", - "ember-cli-dependency-checker": "^2.0.1", - "ember-cli-eslint": "^4.1.0", - "ember-cli-htmlbars-inline-precompile": "^0.4.3", - "ember-cli-inject-live-reload": "^1.6.1", + "@ember/optional-features": "^0.6.3", + "broccoli-asset-rev": "^2.7.0", + "ember-cli": "~3.6.1", + "ember-cli-dependency-checker": "^3.0.0", + "ember-cli-eslint": "^4.2.3", + "ember-cli-htmlbars-inline-precompile": "^1.0.3", + "ember-cli-inject-live-reload": "^1.8.2", "ember-cli-mirage": "^0.4.1", - "ember-cli-qunit": "^4.0.0", - "ember-cli-shims": "^1.1.0", "ember-cli-sri": "^2.1.1", - "ember-cli-uglify": "^1.2.0", + "ember-cli-template-lint": "^1.0.0-beta.1", + "ember-cli-uglify": "^2.1.0", "ember-concurrency-test-waiter": "^0.3.1", - "ember-disable-prototype-extensions": "^1.1.2", + "ember-disable-prototype-extensions": "^1.1.3", "ember-export-application-global": "^2.0.0", - "ember-load-initializers": "^1.0.0", + "ember-load-initializers": "^1.1.0", "ember-maybe-import-regenerator": "^0.1.6", - "ember-resolver": "^4.2.1", - "ember-source": "~3.1.0", - "ember-source-channel-url": "^1.0.1", - "ember-try": "^0.2.23", - "eslint-plugin-ember": "^5.0.0", - "eslint-plugin-node": "^6.0.1", - "loader.js": "^4.5.1", + "ember-qunit": "^3.4.1", + "ember-resolver": "^5.0.1", + "ember-source": "~3.6.0", + "ember-source-channel-url": "^1.1.0", + "ember-try": "^1.0.0", + "eslint-plugin-ember": "^5.2.0", + "eslint-plugin-node": "^7.0.1", + "loader.js": "^4.7.0", "mirage": "0.0.7", + "qunit-dom": "^0.8.0", "standard-version": "^4.4.0" }, "keywords": [ @@ -56,12 +49,22 @@ "alert", "new version" ], + "repository": { + "type": "git", + "url": "https://github.com/sethwebster/ember-cli-new-version.git" + }, + "license": "MIT", + "author": "", + "directories": { + "doc": "doc", + "test": "tests" + }, "dependencies": { - "ember-fetch": "^6.4.0", "broccoli-file-creator": "^2.1.1", - "ember-cli-babel": "^6.6.0", + "ember-cli-babel": "^7.1.2", "ember-cli-htmlbars": "^3.0.1", - "ember-concurrency": "^0.8.12" + "ember-concurrency": "^0.8.12", + "ember-fetch": "^6.4.0" }, "ember-addon": { "configPath": "tests/dummy/config" diff --git a/testem.js b/testem.js index 4b95790..c944b32 100644 --- a/testem.js +++ b/testem.js @@ -10,13 +10,14 @@ module.exports = { ], browser_args: { Chrome: { - mode: 'ci', - args: [ + ci: [ // --no-sandbox is needed when running Chrome inside a container - process.env.TRAVIS ? '--no-sandbox' : null, - - '--disable-gpu', + process.env.CI ? '--no-sandbox' : null, '--headless', + '--disable-gpu', + '--disable-dev-shm-usage', + '--disable-software-rasterizer', + '--mute-audio', '--remote-debugging-port=0', '--window-size=1440,900' ].filter(Boolean) diff --git a/tests/dummy/config/optional-features.json b/tests/dummy/config/optional-features.json new file mode 100644 index 0000000..b190262 --- /dev/null +++ b/tests/dummy/config/optional-features.json @@ -0,0 +1,3 @@ +{ + "jquery-integration": false +}