Skip to content

Commit

Permalink
Merge pull request #158 from lolmaus/upgrade-3-28
Browse files Browse the repository at this point in the history
Upgrade Ember to 3.28
  • Loading branch information
mixonic committed Nov 1, 2023
2 parents 06c7e87 + 85057ba commit a8f256b
Show file tree
Hide file tree
Showing 15 changed files with 3,312 additions and 3,013 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
Expand Down
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,10 @@ module.exports = {
'ember/new-module-imports': 0,
},
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
/.eslintrc.js
/.git/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
Expand All @@ -24,6 +26,7 @@
/ember-cli-build.js
/testem.js
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

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: 'octane',
extends: 'recommended',
};
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

* `yarn lint:hbs`
* `yarn lint:js`
* `yarn lint:js --fix`
* `yarn lint`
* `yarn lint:fix`

## Running tests

Expand Down
5 changes: 4 additions & 1 deletion 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 () {
let emberReleaseVersion = await getChannelURL('release');
Expand Down Expand Up @@ -49,7 +50,7 @@ module.exports = async function () {
name: 'ember-lts-3.24',
npm: {
devDependencies: {
'ember-source': '~3.24.0',
'ember-source': '~3.24.3',
},
},
},
Expand Down Expand Up @@ -133,6 +134,8 @@ module.exports = async function () {
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
};
};
9 changes: 8 additions & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,12 @@ module.exports = function (defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

return app.toTree();
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app, {
skipBabel: [
{
package: 'qunit',
},
],
});
};
38 changes: 20 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"scripts": {
"build": "ember build --environment=production",
"changelog": "lerna-changelog",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
Expand All @@ -34,45 +34,47 @@
"devDependencies": {
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "2.2.9",
"@glimmer/component": "^1.0.3",
"@glimmer/tracking": "^1.0.3",
"@embroider/test-setup": "^0.48.1",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^2.2.3",
"ember-cli": "~3.25.0",
"ember-cli-babel": "^7.26.6",
"ember-cli": "~3.28.6",
"ember-cli-babel": "^7.26.10",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-htmlbars": "^5.3.2",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-htmlbars": "^5.7.2",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.1",
"ember-cli-terser": "^4.0.2",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.1",
"ember-load-initializers": "^2.1.2",
"ember-page-title": "^6.2.1",
"ember-page-title": "^6.2.2",
"ember-qunit": "~5.0.0",
"ember-resolver": "^8.0.2",
"ember-source": "~3.25.1",
"ember-resolver": "^8.0.3",
"ember-source": "~3.28.8",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^2.18.1",
"ember-template-lint": "^3.15.0",
"ember-try": "^1.4.0",
"eslint": "^7.20.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-ember": "^10.2.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.8",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-qunit": "^6.2.0",
"lerna-changelog": "^0.8.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
"prettier": "^2.5.1",
"qunit": "^2.17.2",
"qunit-dom": "^1.6.0",
"release-it": "^14.2.1",
"release-it-lerna-changelog": "^3.1.0",
"webpack": "^5.52.1"
},
"engines": {
"node": "12.* || >= 14"
"node": "12.* || 14.* || >= 16"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down
30 changes: 17 additions & 13 deletions tests/acceptance/workflow-config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module('workflow config', function (hooks) {
window.Testem.handleConsoleMessage = originalWarn;
});

test('deprecation silenced with string matcher', (assert) => {
test('deprecation silenced with string matcher', function (assert) {
deprecate('silence-strict', false, {
since: '2.0.0',
until: 'forever',
Expand All @@ -24,13 +24,14 @@ module('workflow config', function (hooks) {
assert.ok(true, 'Deprecation did not raise');
});

test('deprecation logs with message matcher', (assert) => {
test('deprecation logs with message matcher', function (assert) {
assert.expect(1);

let message = 'log-strict';
window.Testem.handleConsoleMessage = function (passedMessage) {
assert.ok(
passedMessage.indexOf('DEPRECATION: ' + message) === 0,
assert.strictEqual(
passedMessage.indexOf('DEPRECATION: ' + message),
0,
'deprecation logs'
);
};
Expand All @@ -42,13 +43,14 @@ module('workflow config', function (hooks) {
});
});

test('deprecation logs with message matcher by regex', (assert) => {
test('deprecation logs with message matcher by regex', function (assert) {
assert.expect(1);

let message = ' foo log-match foo';
window.Testem.handleConsoleMessage = function (passedMessage) {
assert.ok(
passedMessage.indexOf('DEPRECATION: ' + message) === 0,
assert.strictEqual(
passedMessage.indexOf('DEPRECATION: ' + message),
0,
'deprecation logs'
);
};
Expand All @@ -60,13 +62,14 @@ module('workflow config', function (hooks) {
});
});

test('deprecation logs with id matcher', (assert) => {
test('deprecation logs with id matcher', function (assert) {
assert.expect(1);

let message = ' foo foo';
window.Testem.handleConsoleMessage = function (passedMessage) {
assert.ok(
passedMessage.indexOf('DEPRECATION: ' + message) === 0,
assert.strictEqual(
passedMessage.indexOf('DEPRECATION: ' + message),
0,
'deprecation logs'
);
};
Expand All @@ -78,7 +81,7 @@ module('workflow config', function (hooks) {
});
});

test('deprecation thrown with string matcher', (assert) => {
test('deprecation thrown with string matcher', function (assert) {
assert.throws(function () {
deprecate('throw-strict', false, {
since: '2.0.0',
Expand All @@ -89,7 +92,7 @@ module('workflow config', function (hooks) {
}, 'deprecation throws');
});

test('deprecation logs with id matcher', (assert) => {
test('deprecation logs with id matcher and options', function (assert) {
assert.expect(1);

let message = 'arbitrary-unmatched-message';
Expand All @@ -111,7 +114,7 @@ module('workflow config', function (hooks) {
deprecate(message, false, options);
});

test('deprecation limits each id to 100 console.logs', (assert) => {
test('deprecation limits each id to 100 console.logs', function (assert) {
assert.expect(104);
let limit = 100;

Expand All @@ -129,6 +132,7 @@ module('workflow config', function (hooks) {
window.Testem.handleConsoleMessage = function (passedMessage) {
count++;
if (count <= limit) {
// eslint-disable-next-line qunit/no-conditional-assertions
assert.equal(
passedMessage.substr(0, expected.length),
expected,
Expand Down
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.25.0",
"version": "3.28.6",
"blueprints": [
{
"name": "addon",
Expand Down
20 changes: 14 additions & 6 deletions tests/dummy/config/targets.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ const browsers = [
'last 1 Safari versions',
];

const isCI = Boolean(process.env.CI);
const isProduction = process.env.EMBER_ENV === 'production';

if (isCI || isProduction) {
browsers.push('ie 11');
}
// Ember's browser support policy is changing, and IE11 support will end in
// v4.0 onwards.
//
// See https://deprecations.emberjs.com/v3.x#toc_3-0-browser-support-policy
//
// If you need IE11 support on a version of Ember that still offers support
// for it, uncomment the code block below.
//
// const isCI = Boolean(process.env.CI);
// const isProduction = process.env.EMBER_ENV === 'production';
//
// if (isCI || isProduction) {
// browsers.push('ie 11');
// }

module.exports = {
browsers,
Expand Down
6 changes: 5 additions & 1 deletion tests/helpers/debug-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import { DEBUG } from '@glimmer/env';
import { test } from 'qunit';

export default function debugTest(description, callback) {
// eslint-disable-next-line qunit/require-expect
return test(description, function (assert) {
if (!DEBUG) {
assert.ok(true, 'debug functions are disabled');
assert.pushResult({
result: true,
message: 'debug functions are disabled',
});
return;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{{content-for "body"}}
{{content-for "test-body"}}

<script src="/testem.js" integrity=""></script>
<script src="/testem.js" integrity="" data-embroider-ignore></script>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
<script src="{{rootURL}}assets/dummy.js"></script>
Expand Down

0 comments on commit a8f256b

Please sign in to comment.