Skip to content

Commit

Permalink
chore: update to ember v4
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
- Ember.js v3.28 or above
- Ember CLI v3.28 or above
- Node.js v16 or above
  • Loading branch information
velrest committed Jul 4, 2023
1 parent 7ac04b3 commit 04865f1
Show file tree
Hide file tree
Showing 23 changed files with 872 additions and 268 deletions.
8 changes: 7 additions & 1 deletion .ember-cli
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
"disableAnalytics": false,

/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
}
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
push:
branches:
- main
- master
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
name: "Tests"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Run Tests
run: yarn test:ember

floating:
name: "Floating Dependencies"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: Install Dependencies
run: yarn install --no-lockfile
- name: Run Tests
run: yarn test:ember

try-scenarios:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
needs: "test"
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.28
- ember-lts-4.4
- ember-release
- ember-beta
- ember-canary
- ember-classic
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,10 @@
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
/.eslintignore
/.eslintrc.js
/.git/
/.github/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/CONTRIBUTING.md
/ember-cli-build.js
/testem.js
Expand All @@ -33,4 +33,7 @@
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
/coverage/
!.*
.eslintcache
.lint-todo/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

## Linting

* `yarn lint`
* `yarn lint:fix`
- `yarn lint`
- `yarn lint:fix`

## Running tests

Expand All @@ -27,4 +27,4 @@
- set up `emeis` (see [docs](https://github.com/projectcaluma/emeis))
- `yarn start-proxy`

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/).
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ The frontend for the [emeis](https://github.com/projectcaluma/emeis) user manage

## Compatibility

- Ember.js v3.20 or above
- Ember CLI v3.20 or above
- Node.js v10 or above
- Ember.js v3.28 or above
- Ember CLI v3.28 or above
- Node.js v14 or above

## Installation

```bash
$ ember install ember-emeis
ember install ember-emeis
```

Then add the following lines to your `app/styles/app.scss`:
Expand Down Expand Up @@ -230,5 +230,3 @@ See the [Contributing](CONTRIBUTING.md) guide for details.
# License

This project is licensed under the [LGPL-3.0-or-later license](LICENSE).

<3
2 changes: 1 addition & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = function (environment) {
const ENV = {
modulePrefix: "ember-emeis",
modulePrefix: require("./../package").name,
environment,
};

Expand Down
8 changes: 7 additions & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ module.exports = function (defaults) {
*/

const { maybeEmbroider } = require("@embroider/test-setup");
return maybeEmbroider(app);
return maybeEmbroider(app, {
skipBabel: [
{
package: "qunit",
},
],
});
};
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

/* eslint-disable ember/avoid-leaking-state-in-ember-objects, n/no-unpublished-require */

const EngineAddon = require("ember-engines/lib/engine-addon");
const { buildEngine } = require("ember-engines/lib/engine-addon");

module.exports = EngineAddon.extend({
module.exports = buildEngine({
name: require("./package").name,
lazyLoading: { enabled: false },
});
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
},
"scripts": {
"build": "ember build --environment=production",
"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": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:pkg": "npmPkgJsonLint .",
"start": "ember serve",
"start-proxy": "ember server --proxy http://localhost:8000",
"test": "npm-run-all lint test:*",
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each",
"prepare": "husky install"
Expand Down Expand Up @@ -76,23 +76,22 @@
"@embroider/test-setup": "3.0.1",
"@faker-js/faker": "6.2.0",
"broccoli-asset-rev": "3.0.0",
"ember-cli": "3.28.6",
"concurrently": "7.6.0",
"ember-cli": "4.9.2",
"ember-cli-dependency-checker": "3.3.1",
"ember-cli-inject-live-reload": "2.1.0",
"ember-cli-mirage": "3.0.0-alpha.3",
"ember-cli-sass": "11.0.1",
"ember-cli-sri": "2.1.1",
"ember-cli-uglify": "3.0.0",
"ember-disable-prototype-extensions": "1.1.3",
"ember-engines": "0.9.0",
"ember-export-application-global": "2.0.1",
"ember-load-initializers": "2.1.2",
"ember-maybe-import-regenerator": "1.0.0",
"ember-qunit": "6.2.0",
"ember-resolver": "8.0.3",
"ember-source": "3.28.9",
"ember-source": "4.9.1",
"ember-source-channel-url": "3.0.0",
"ember-template-lint": "4.10.1",
"ember-template-lint": "5.2.0",
"ember-template-lint-plugin-prettier": "4.1.0",
"ember-try": "3.0.0-beta.1",
"eslint": "8.39.0",
Expand All @@ -115,6 +114,9 @@
"sass": "1.56.1",
"webpack": "5.81.0"
},
"peerDependencies": {
"ember-source": "^3.28.0 || ^4.0.0"
},
"engines": {
"node": ">= 18.*"
},
Expand Down
1 change: 0 additions & 1 deletion tests/dummy/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Dummy</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down
7 changes: 2 additions & 5 deletions tests/dummy/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
"packages": [
{
"name": "ember-cli",
"version": "3.27.0",
"version": "4.9.2",
"blueprints": [
{
"name": "addon",
"outputRepo": "https://github.com/ember-cli/ember-addon-output",
"codemodsSource": "ember-addon-codemods-manifest@1",
"isBaseBlueprint": true,
"options": [
"--yarn",
"--no-welcome"
]
"options": ["--yarn", "--no-welcome"]
}
]
}
Expand Down
27 changes: 20 additions & 7 deletions config/ember-try.js → tests/dummy/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,35 @@ module.exports = async function () {
},
},
},
{
name: "ember-lts-4.4",
npm: {
devDependencies: {
"ember-source": "~4.4.0",
},
},
},
{
name: "ember-release",
allowedToFail: true,
npm: {
devDependencies: {
"ember-source": await getChannelURL("release"),
},
},
},
{
name: "ember-default-with-jquery",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"jquery-integration": true,
}),
name: "ember-beta",
npm: {
devDependencies: {
"ember-source": await getChannelURL("beta"),
},
},
},
{
name: "ember-canary",
npm: {
devDependencies: {
"@ember/jquery": "^1.1.0",
"ember-source": await getChannelURL("canary"),
},
},
},
Expand All @@ -47,6 +57,9 @@ module.exports = async function () {
}),
},
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
ember: {
edition: "classic",
},
Expand Down
7 changes: 2 additions & 5 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ module.exports = function (environment) {
modulePrefix: "dummy",
environment,
rootURL: "/",
locationType: "auto",
locationType: "history",
EmberENV: {
EXTEND_PROTOTYPES: false,
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false,
},
},

APP: {
Expand Down
7 changes: 0 additions & 7 deletions tests/dummy/config/targets.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ const browsers = [
"last 1 Safari versions",
];

const isCI = !!process.env.CI;
const isProduction = process.env.EMBER_ENV === "production";

if (isCI || isProduction) {
browsers.push("ie 11");
}

module.exports = {
browsers,
};
Empty file removed tests/helpers/.gitkeep
Empty file.
Loading

0 comments on commit 04865f1

Please sign in to comment.