-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5eff877
commit ed989c2
Showing
5 changed files
with
70 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* @adonisjs/bouncer | ||
* | ||
* (c) AdonisJS | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import type Configure from '@adonisjs/core/commands/configure' | ||
|
||
/** | ||
* Configures the package | ||
*/ | ||
export async function configure(command: Configure) { | ||
const codemods = await command.createCodemods() | ||
|
||
/** | ||
* Register provider | ||
*/ | ||
await codemods.updateRcFile((rcFile) => { | ||
rcFile.addProvider('@adonisjs/bouncer/bouncer_provider') | ||
}) | ||
|
||
/** | ||
* Publish and register middleware | ||
*/ | ||
await command.publishStub('initialize_bouncer_middleware.stub', { | ||
entity: command.app.generators.createEntity('initialize_bouncer'), | ||
}) | ||
await codemods.registerMiddleware('router', [ | ||
{ | ||
path: '#middleware/initialize_bouncer_middleware', | ||
}, | ||
]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* @adonisjs/bouncer | ||
* | ||
* (c) AdonisJS | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import { getDirname } from '@poppinss/utils' | ||
|
||
export const stubsRoot = getDirname(import.meta.url) |