Skip to content

Commit

Permalink
fix: Ember v3.22.0...v3.26.1
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Drop ember-concurrency < v1, update Ember deps.
  • Loading branch information
knownasilya committed May 22, 2021
1 parent 8650140 commit e27600c
Show file tree
Hide file tree
Showing 20 changed files with 109 additions and 64 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
Expand Down
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ module.exports = {
},
},
plugins: ['ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
Expand All @@ -26,6 +30,7 @@ module.exports = {
{
files: [
'.eslintrc.js',
'.prettierrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/.env*
/.pnp*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
Expand Down
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
Expand Down
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
2 changes: 2 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
singleQuote: true,
};
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: 'octane'
extends: 'octane',
};
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
- env: EMBER_TRY_SCENARIO=ember-classic
- env: EMBER_TRY_SCENARIO=embroider-tests
- env: EMBER_TRY_SCENARIO=embroider-safe
- env: EMBER_TRY_SCENARIO=embroider-optimized

script:
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

## Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`
* `npm run lint`
* `npm run lint:fix`

## Running tests

Expand Down
13 changes: 3 additions & 10 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const getChannelURL = require('ember-source-channel-url');
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

module.exports = async function () {
return {
Expand Down Expand Up @@ -73,16 +74,8 @@ module.exports = async function () {
},
},
},
{
name: 'embroider-tests',
npm: {
devDependencies: {
'@embroider/core': '*',
'@embroider/webpack': '*',
'@embroider/compat': '*',
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
};
};
6 changes: 3 additions & 3 deletions config/environment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env node */
'use strict';

module.exports = function(/* environment, appConfig */) {
return { };
};
module.exports = function (/* environment, appConfig */) {
return {};
};
19 changes: 7 additions & 12 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,11 @@ module.exports = function (defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

if ('@embroider/webpack' in app.dependencies()) {
const { Webpack } = require('@embroider/webpack'); // eslint-disable-line
return require('@embroider/compat') // eslint-disable-line
.compatBuild(app, Webpack, {
staticAddonTestSupportTrees: true,
staticAddonTrees: true,
staticHelpers: true,
staticComponents: true,
});
}

return app.toTree();
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app, {
staticAddonTestSupportTrees: true,
staticAddonTrees: true,
staticHelpers: true,
staticComponents: true,
});
};
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ const writeFile = require('broccoli-file-creator');

module.exports = {
name: require('./package').name,

/**
* Store `ember-cli-build.js` options
*/
included: function(app/*, parentAddon*/) {
included: function (app /*, parentAddon*/) {
this._super.included.apply(this, arguments);
this._options = app.options.newVersion || {};

if (this._options.enabled === true) {
this._options.fileName = this._options.fileName || 'VERSION.txt';
this._options.prepend = this._options.prepend || '';
this._options.prepend = this._options.prepend || '';
this._options.useAppVersion = this._options.useAppVersion || false;
}
},

/**
* Copy version from `ember-cli-app-version`
*/
config: function(env, baseConfig) {
config: function (env, baseConfig) {
this._appVersion = baseConfig.APP.version || null;
},

Expand All @@ -34,7 +34,7 @@ module.exports = {
* - ember-cli-app-version if installed
* - package.json of consuming application or
*/
treeForPublic: function() {
treeForPublic: function () {
let detectedVersion;

if (this._options.useAppVersion && this._appVersion) {
Expand All @@ -51,5 +51,5 @@ module.exports = {
this.ui.writeLine(`Created ${fileName} with ${detectedVersion}`);
return writeFile(fileName, detectedVersion);
}
}
},
};
44 changes: 27 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
"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",
"scripts": {
"build": "ember build --environment=production",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'",
"lint:js:fix": "eslint . --fix",
"start": "ember server",
"test": "npm-run-all lint:* test:*",
"test": "npm-run-all lint test:*",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each",
"release": "standard-version"
Expand All @@ -18,36 +21,43 @@
},
"devDependencies": {
"@ember/optional-features": "^2.0.0",
"@glimmer/component": "^1.0.2",
"@glimmer/tracking": "^1.0.2",
"@ember/test-helpers": "^2.2.5",
"@embroider/test-setup": "^0.37.0",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.6.0",
"ember-cli": "~3.22.0",
"ember-auto-import": "^1.11.2",
"ember-cli": "~3.26.1",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-mirage": "^1.1.2",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.0",
"ember-cli-terser": "^4.0.1",
"ember-concurrency-test-waiter": "^0.3.1",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.1",
"ember-fetch": "^8.0.4",
"ember-load-initializers": "^2.1.1",
"ember-load-initializers": "^2.1.2",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^4.6.0",
"ember-page-title": "^6.2.1",
"ember-qunit": "^5.1.4",
"ember-resolver": "^8.0.2",
"ember-source": "~3.22.0",
"ember-source": "~3.26.1",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^2.14.0",
"ember-template-lint": "^3.2.0",
"ember-try": "^1.4.0",
"eslint": "^7.11.0",
"eslint-plugin-ember": "^9.3.0",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-ember": "^10.3.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"loader.js": "^4.7.0",
"mirage": "0.0.7",
"npm-run-all": "^4.1.5",
"qunit-dom": "^1.5.0",
"prettier": "^2.2.1",
"qunit": "^2.14.1",
"qunit-dom": "^1.6.0",
"standard-version": "^8.0.1"
},
"keywords": [
Expand All @@ -69,8 +79,8 @@
},
"dependencies": {
"broccoli-file-creator": "^2.1.1",
"ember-cli-babel": "^7.22.1",
"ember-cli-htmlbars": "^5.3.1",
"ember-cli-babel": "^7.26.3",
"ember-cli-htmlbars": "^5.7.1",
"ember-concurrency": "^1.0.0 || ^2.0.2"
},
"ember": {
Expand Down
8 changes: 6 additions & 2 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<h2 id="title">Ember New Version</h2>
{{page-title 'Ember New Version'}}

<h2 id='title'>
Ember New Version
</h2>

{{outlet}}

<NewVersionNotifier />
<NewVersionNotifier />
2 changes: 1 addition & 1 deletion tests/dummy/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": [
{
"name": "ember-cli",
"version": "3.22.0",
"version": "3.26.1",
"blueprints": [
{
"name": "addon",
Expand Down
9 changes: 4 additions & 5 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env node */
'use strict';

module.exports = function(environment) {
module.exports = function (environment) {
let ENV = {
modulePrefix: 'dummy',
environment,
Expand All @@ -14,8 +14,8 @@ module.exports = function(environment) {
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false
}
Date: false,
},
},

APP: {
Expand All @@ -24,9 +24,8 @@ module.exports = function(environment) {
},

'ember-cli-mirage': {
enabled: false
enabled: false,
},

};

if (environment === 'development') {
Expand Down
4 changes: 2 additions & 2 deletions tests/dummy/config/targets.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
'last 1 Safari versions',
];

const isCI = Boolean(process.env.CI);
Expand All @@ -14,5 +14,5 @@ if (isCI || isProduction) {
}

module.exports = {
browsers
browsers,
};
7 changes: 7 additions & 0 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
{{content-for "body"}}
{{content-for "test-body"}}

<div id="qunit"></div>
<div id="qunit-fixture">
<div id="ember-testing-container">
<div id="ember-testing"></div>
</div>
</div>

<script src="/testem.js" integrity=""></script>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
Expand Down
4 changes: 4 additions & 0 deletions tests/test-helper.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import Application from 'dummy/app';
import config from 'dummy/config/environment';
import * as QUnit from 'qunit';
import { setApplication } from '@ember/test-helpers';
import { setup } from 'qunit-dom';
import { start } from 'ember-qunit';

setApplication(Application.create(config.APP));

setup(QUnit.assert);

start();

0 comments on commit e27600c

Please sign in to comment.