@dedel.alex/adonis6-swagger
Version:
Swagger provider for AdonisJS 6
29 lines (28 loc) • 1.01 kB
JavaScript
/*
|--------------------------------------------------------------------------
| Configure hook
|--------------------------------------------------------------------------
|
| The configure hook is called when someone runs "node ace configure <package>"
| command. You are free to perform any operations inside this function to
| configure the package.
|
| To make things easier, you have access to the underlying "ConfigureCommand"
| instance and you can use codemods to modify the source files.
|
*/
import { stubsRoot } from './stubs/main.js';
export async function configure(command) {
const codemods = await command.createCodemods();
/**
* Publish config file
*/
await codemods.makeUsingStub(stubsRoot, 'config/swagger.stub', {});
/**
* Register provider
*/
await codemods.updateRcFile((rcFile) => {
rcFile.addProvider('@dedel.alex/adonis6-swagger/providers/swagger_provider');
rcFile.addCommand('@dedel.alex/adonis6-swagger/commands');
});
}