# @adonisjs/presets

> A collection of presets to configure AdonisJS packages

Latest version **3.0.0** (published 2026-02-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @adonisjs/presets
pnpm add @adonisjs/presets
yarn add @adonisjs/presets
bun add @adonisjs/presets
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-02-25 |
| First published | 2023-12-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=24.0.0 |
| Dependencies | 0 |
| Unpacked size | 36 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 9 |
| Author | Harminder Virk |
| Maintainers | romainlanz, virk, julien-r44 |
| Keywords | adonisjs, presets |

## Links

- npm: https://www.npmjs.com/package/@adonisjs/presets
- Repository: https://github.com/adonisjs/presets
- Homepage: https://github.com/adonisjs/presets#readme
- Issues: https://github.com/adonisjs/presets/issues
- npm.io page: https://npm.io/package/@adonisjs/presets

## Recent versions

- 3.0.0 (latest) — 2026-02-25
- 3.0.0-next.1 (next) — 2026-01-14
- 3.0.0-next.0 — 2025-09-22
- 2.6.4 — 2024-12-18
- 2.6.3 — 2024-09-11
- 2.6.2 — 2024-09-09
- 2.6.1 — 2024-06-19
- 2.6.0 — 2024-06-19
- 2.5.1 — 2024-06-19
- 2.5.0 — 2024-06-19
- 2.4.1 — 2024-05-17
- 2.4.0 — 2024-04-02
- 2.3.0 — 2024-04-02
- 2.2.5 — 2024-02-12
- 2.2.4 — 2024-01-25
- … 10 more at https://npm.io/package/@adonisjs/presets/versions

## README

# AdonisJS presets

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](https://npm.im/create-adonisjs) initializer.

> [!NOTE]
> Presets do not trigger any prompts and exposes a coding interface.

## Auth preset

The `auth` presets configures the `@adonisjs/auth` package. The package must be installed to run this preset.

```ts
import { Kernel } from '@adonisjs/core/ace'
import { Application } from '@adonisjs/core/app'
import { presetAuth } from '@adonisjs/presets/auth'
import { Codemods } from '@adonisjs/core/ace/codemods'

/**
 * Create application instance. Inside an Ace command, you
 * get access to it using `this.app` property.
 */
const app = new Application(baseURL, {
  importer: () => {},
})

/**
 * Create Ace kernel instance to get CLI logger reference.
 * Inside an Ace command you can access it using this.logger
 * property.
 */
const cliLogger = new Kernel(app).ui.logger

/**
 * Create codemods instance. Codemods are needed to modify
 * source files.
 */
const codemods = new Codemods(app, cliLogger)

/**
 * Apply preset
 */
await presetAuth(codemods, app, {
  guard: 'session',
  userProvider: 'lucid',
})
```

## Lucid preset

The `auth` presets configures the `@adonisjs/lucid` package. The package must be installed to run this preset.

```ts
import { Kernel } from '@adonisjs/core/ace'
import { Application } from '@adonisjs/core/app'
import { presetLucid } from '@adonisjs/presets/lucid'
import { Codemods } from '@adonisjs/core/ace/codemods'

/**
 * Create application instance. Inside an Ace command, you
 * get access to it using `this.app` property.
 */
const app = new Application(baseURL, {
  importer: () => {},
})

/**
 * Create Ace kernel instance to get CLI logger reference.
 * Inside an Ace command you can access it using this.logger
 * property.
 */
const cliLogger = new Kernel(app).ui.logger

/**
 * Create codemods instance. Codemods are needed to modify
 * source files.
 */
const codemods = new Codemods(app, cliLogger)

/**
 * Apply preset
 */
await presetLucid(codemods, app, {
  dialect: 'sqlite',
  installPackages: true,
})
```

---
_Source: https://npm.io/package/@adonisjs/presets · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
