Skip to content

Commit

Permalink
refactor: use aliases from the rcFile, since autoloads have been removed
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Dec 18, 2019
1 parent 9089cf1 commit 2d29d64
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
}
},
"dependencies": {
"@adonisjs/application": "^1.3.0",
"@adonisjs/application": "^1.3.1",
"@adonisjs/config": "^1.0.10",
"@adonisjs/encryption": "^1.0.2",
"@adonisjs/env": "^1.0.10",
Expand Down
2 changes: 1 addition & 1 deletion src/Ignitor/Ace/AppCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class AppCommands {
* Do not change sequence
*/
this._bootstrapper.registerProviders(true)
this._bootstrapper.registerAutoloads()
this._bootstrapper.registerAliases()
await this._bootstrapper.bootProviders()
this._bootstrapper.registerPreloads()
}
Expand Down
2 changes: 1 addition & 1 deletion src/Ignitor/Ace/GenerateManifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class GenerateManifest {
* the manifest file
*/
this._bootstrapper.registerProviders(true)
this._bootstrapper.registerAutoloads()
this._bootstrapper.registerAliases()

/**
* Generate file
Expand Down
4 changes: 2 additions & 2 deletions src/Ignitor/Bootstrapper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ export class Bootstrapper {
/**
* Registers autoloading directories
*/
public registerAutoloads () {
this.application.autoloadsMap.forEach((toPath, alias) => {
public registerAliases () {
this.application.aliasesMap.forEach((toPath, alias) => {
if (this._logger) {
this._logger.trace(`registering %s under %s alias`, toPath, alias)
}
Expand Down
2 changes: 1 addition & 1 deletion src/Ignitor/HttpServer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class HttpServer {
/**
* Registering directories to be autoloaded
*/
this._bootstrapper.registerAutoloads()
this._bootstrapper.registerAliases()

/**
* Booting providers
Expand Down
6 changes: 3 additions & 3 deletions test/ignitor-boostrapper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ test.group('Ignitor | Setup', (group) => {
assert.equal(env.get('APP_KEY'), SECRET)
})

test('register autoloads defined in adonisrc.json file', async (assert) => {
test('register aliases defined in adonisrc.json file', async (assert) => {
await fs.add('.adonisrc.json', JSON.stringify({
autoloads: {
aliases: {
'App': './app',
},
}))

const bootstrapper = new Bootstrapper(fs.basePath)
const application = bootstrapper.setup()
bootstrapper.registerAutoloads()
bootstrapper.registerAliases()

assert.deepEqual(application.container.autoloads, { App: join(fs.basePath, './app') })
})
Expand Down
2 changes: 1 addition & 1 deletion test/ignitor-http-server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test.group('Ignitor | Http', (group) => {
const httpServer = ignitor.httpServer()
const application = boostrapper.setup()

boostrapper.registerAutoloads()
boostrapper.registerAliases()
boostrapper.registerProviders(false)
await boostrapper.bootProviders()

Expand Down

0 comments on commit 2d29d64

Please sign in to comment.