Skip to content

Commit 14519cf

Browse files
committed
Re-organize a bit
1 parent cd69db4 commit 14519cf

5 files changed

Lines changed: 36 additions & 27 deletions

File tree

files/demo-app/app.gts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import EmberApp from 'ember-strict-application-resolver';
2+
import EmberRouter from '@ember/routing/router';
3+
import PageTitleService from 'ember-page-title/services/page-title';
4+
5+
class Router extends EmberRouter {
6+
location = 'history';
7+
rootURL = '/';
8+
}
9+
10+
export class App extends EmberApp {
11+
/**
12+
* Any services or anything from the addon that needs to be in the app-tree registry
13+
* will need to be manually specified here.
14+
*
15+
* Techniques to avoid needing this:
16+
* - private services
17+
* - require the consuming app import and configure themselves
18+
* (which is what we're emulating here)
19+
*/
20+
modules = {
21+
'./router': Router,
22+
'./services/page-title': PageTitleService,
23+
/**
24+
* NOTE: this glob will import everything matching the glob,
25+
* and includes non-services in the services directory.
26+
*/
27+
...import.meta.glob('./services/**/*', { eager: true }),
28+
...import.meta.glob('./templates/**/*', { eager: true }),
29+
};
30+
}
31+
32+
Router.map(function() { });

files/docs-app/app.gts

Lines changed: 0 additions & 21 deletions
This file was deleted.

files/tests/test-helper.__ext__

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1+
import EmberApp from 'ember-strict-application-resolver';
12
import EmberRouter from '@ember/routing/router';
23
import * as QUnit from 'qunit';
34
import { setApplication } from '@ember/test-helpers';
45
import { setup } from 'qunit-dom';
56
import { start as qunitStart, setupEmberOnerrorValidation } from 'ember-qunit';
67

7-
import { App, docsAppRegistry } from '#dosc-app/app';
8-
98
class Router extends EmberRouter {
109
location = 'none';
1110
rootURL = '/';
1211
}
1312

14-
class TestApp extends App {
13+
class TestApp extends EmberApp {
1514
modules = {
16-
...docsAppRegistry,
17-
'./router': Router,
18-
// add any overrides here
15+
'./router': { default: Router },
16+
// add any custom services here
1917
// import.meta.glob('./services/*', { eager: true }),
2018
};
2119
}

0 commit comments

Comments
 (0)