Skip to content

Commit

Permalink
feat(engine): initialize ember-engines configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed May 20, 2020
1 parent 0b14bb7 commit b22fcff
Show file tree
Hide file tree
Showing 8 changed files with 286 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"use strict";

module.exports = {
settings: {
"import/internal-regex": "^ember-emeis/",
},
extends: [
"@adfinis-sygroup/eslint-config/ember-addon",
"plugin:ember/octane",
Expand Down
14 changes: 14 additions & 0 deletions addon/engine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Engine from "@ember/engine";
import loadInitializers from "ember-load-initializers";
import Resolver from "ember-resolver";

import config from "ember-emeis/config/environment";

const { modulePrefix } = config;

export default class EmberEmeisEngine extends Engine {
modulePrefix = modulePrefix;
Resolver = Resolver;
}

loadInitializers(EmberEmeisEngine, modulePrefix);
3 changes: 3 additions & 0 deletions addon/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import buildRoutes from "ember-engines/routes";

export default buildRoutes(function () {});
9 changes: 7 additions & 2 deletions config/environment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
"use strict";

module.exports = function (/* environment, appConfig */) {
return {};
module.exports = function (environment) {
const ENV = {
modulePrefix: "ember-emeis",
environment,
};

return ENV;
};
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
"use strict";

module.exports = {
/* eslint-disable ember/avoid-leaking-state-in-ember-objects, node/no-unpublished-require */

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

module.exports = EngineAddon.extend({
name: require("./package").name,
};
lazyLoading: { enabled: false },
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"ember-cli-sri": "2.1.1",
"ember-cli-uglify": "3.0.0",
"ember-disable-prototype-extensions": "1.1.3",
"ember-engines": "^0.8.5",
"ember-export-application-global": "2.0.1",
"ember-load-initializers": "2.1.1",
"ember-maybe-import-regenerator": "0.1.6",
Expand Down
4 changes: 3 additions & 1 deletion tests/dummy/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ export default class Router extends EmberRouter {
}

/* eslint-disable-next-line array-callback-return */
Router.map(function () {});
Router.map(function () {
this.mount("ember-emeis", { path: "/" });
});
Loading

0 comments on commit b22fcff

Please sign in to comment.