generated from AthennaIO/Template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
36 changed files
with
2,427 additions
and
185 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
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* @athenna/template | ||
* @athenna/validator | ||
* | ||
* (c) João Lenon <lenon@athenna.io> | ||
* | ||
|
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,54 @@ | ||
/** | ||
* @athenna/validator | ||
* | ||
* (c) João Lenon <lenon@athenna.io> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import { BaseConfigurer } from '@athenna/artisan' | ||
|
||
export default class ValidatorConfigurer extends BaseConfigurer { | ||
public async configure() { | ||
const task = this.logger.task() | ||
|
||
task.addPromise('Update commands of .athennarc.json', () => { | ||
return this.rc | ||
.setTo( | ||
'commands', | ||
'make:validator', | ||
'@athenna/validator/commands/MakeValidatorCommand' | ||
) | ||
.save() | ||
}) | ||
|
||
task.addPromise('Update templates of .athennarc.json', () => { | ||
return this.rc | ||
.setTo( | ||
'templates', | ||
'validator-http', | ||
'node_modules/@athenna/validator/templates/validator-http.edge' | ||
) | ||
.setTo( | ||
'templates', | ||
'validator-console', | ||
'node_modules/@athenna/validator/templates/validator-console.edge' | ||
) | ||
.save() | ||
}) | ||
|
||
task.addPromise('Update providers of .athennarc.json', () => { | ||
return this.rc | ||
.pushTo('providers', '@athenna/validator/providers/ValidatorProvider') | ||
.save() | ||
}) | ||
|
||
await task.run() | ||
|
||
console.log() | ||
this.logger.success( | ||
'Successfully configured ({dim,yellow} @athenna/validator) library' | ||
) | ||
} | ||
} |
Oops, something went wrong.