Gathering detailed insights and metrics for @adonisjs/presets
Gathering detailed insights and metrics for @adonisjs/presets
Gathering detailed insights and metrics for @adonisjs/presets
Gathering detailed insights and metrics for @adonisjs/presets
npm install @adonisjs/presets
Generate SilentAuth middleware
Published on 11 Sept 2024
Fix: export Authenticators from the config stub
Published on 09 Sept 2024
Install sqlite3 package when using libsql
Published on 19 Jun 2024
Export auth guards collection
Published on 19 Jun 2024
Install correct client for libsql dialect
Published on 19 Jun 2024
Add support for configuring libsql dialect
Published on 19 Jun 2024
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
7 Stars
71 Commits
6 Forks
5 Watching
2 Branches
6 Contributors
Updated on 11 Sept 2024
TypeScript (84.52%)
JavaScript (15.15%)
Shell (0.32%)
Cumulative downloads
Total Downloads
Last day
3%
2,535
Compared to previous day
Last week
7.3%
14,214
Compared to previous week
Last month
17.5%
58,468
Compared to previous month
Last year
0%
378,311
Compared to previous year
1
2
26
These presets are a collection of functions you can execute to configure an AdonisJS package. This repo contains presets only for those packages that can be configured from multiple user interactions.
For example: When you create a new AdonisJS application, you can configure Lucid and also you can create a new app without Lucid and configure it later.
So, instead of duplicating the code in multiple places, we create re-usable presets and use them with individual packages and the create-adonisjs initializer.
[!NOTE] Presets do not trigger any prompts and exposes a coding interface.
The auth
presets configures the @adonisjs/auth
package. The package must be installed to run this preset.
1import { Kernel } from '@adonisjs/core/ace' 2import { Application } from '@adonisjs/core/app' 3import { presetAuth } from '@adonisjs/presets/auth' 4import { Codemods } from '@adonisjs/core/ace/codemods' 5 6/** 7 * Create application instance. Inside an Ace command, you 8 * get access to it using `this.app` property. 9 */ 10const app = new Application(baseURL, { 11 importer: () => {}, 12}) 13 14/** 15 * Create Ace kernel instance to get CLI logger reference. 16 * Inside an Ace command you can access it using this.logger 17 * property. 18 */ 19const cliLogger = new Kernel(app).ui.logger 20 21/** 22 * Create codemods instance. Codemods are needed to modify 23 * source files. 24 */ 25const codemods = new Codemods(app, cliLogger) 26 27/** 28 * Apply preset 29 */ 30await presetAuth(codemods, app, { 31 guard: 'session', 32 userProvider: 'lucid', 33})
The auth
presets configures the @adonisjs/lucid
package. The package must be installed to run this preset.
1import { Kernel } from '@adonisjs/core/ace' 2import { Application } from '@adonisjs/core/app' 3import { presetLucid } from '@adonisjs/presets/lucid' 4import { Codemods } from '@adonisjs/core/ace/codemods' 5 6/** 7 * Create application instance. Inside an Ace command, you 8 * get access to it using `this.app` property. 9 */ 10const app = new Application(baseURL, { 11 importer: () => {}, 12}) 13 14/** 15 * Create Ace kernel instance to get CLI logger reference. 16 * Inside an Ace command you can access it using this.logger 17 * property. 18 */ 19const cliLogger = new Kernel(app).ui.logger 20 21/** 22 * Create codemods instance. Codemods are needed to modify 23 * source files. 24 */ 25const codemods = new Codemods(app, cliLogger) 26 27/** 28 * Apply preset 29 */ 30await presetLucid(codemods, app, { 31 dialect: 'sqlite', 32 installPackages: true, 33})
No vulnerabilities found.
No security vulnerabilities found.