Skip to content

Commit

Permalink
feat(all): switch normalizeSync to normalize api
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jan 8, 2016
1 parent 0f83b9b commit 4d5b1f6
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/framework-configuration.js
Expand Up @@ -81,7 +81,7 @@ export class FrameworkConfiguration {
this.preTasks = [];
this.postTasks = [];
this.resourcesToLoad = {};
this.preTask(() => this.bootstrapperName = aurelia.loader.normalizeSync('aurelia-bootstrapper'));
this.preTask(() => aurelia.loader.normalize('aurelia-bootstrapper').then(name => this.bootstrapperName = name));
this.postTask(() => loadResources(aurelia.container, this.resourcesToLoad, aurelia.resources));
}

Expand Down Expand Up @@ -212,13 +212,14 @@ export class FrameworkConfiguration {

this.plugin(plugin);
this.preTask(() => {
let normalizedName = this.aurelia.loader.normalizeSync(name, this.bootstrapperName);
normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts')
? normalizedName.substring(0, normalizedName.length - 3) : normalizedName;
return this.aurelia.loader.normalize(name, this.bootstrapperName).then(normalizedName => {
normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts')
? normalizedName.substring(0, normalizedName.length - 3) : normalizedName;

plugin.moduleId = normalizedName;
plugin.resourcesRelativeTo = normalizedName;
this.aurelia.loader.map(name, normalizedName);
plugin.moduleId = normalizedName;
plugin.resourcesRelativeTo = normalizedName;
this.aurelia.loader.map(name, normalizedName);
});
});

return this;
Expand Down Expand Up @@ -278,10 +279,11 @@ export class FrameworkConfiguration {
*/
developmentLogging(): FrameworkConfiguration {
this.preTask(() => {
let name = this.aurelia.loader.normalizeSync('aurelia-logging-console', this.bootstrapperName);
return this.aurelia.loader.loadModule(name).then(m => {
TheLogManager.addAppender(new m.ConsoleAppender());
TheLogManager.setLevel(TheLogManager.logLevel.debug);
return this.aurelia.loader.normalize('aurelia-logging-console', this.bootstrapperName).then(name => {
return this.aurelia.loader.loadModule(name).then(m => {
TheLogManager.addAppender(new m.ConsoleAppender());
TheLogManager.setLevel(TheLogManager.logLevel.debug);
});
});
});

Expand Down

0 comments on commit 4d5b1f6

Please sign in to comment.