
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@adonisjs/presets
Advanced tools
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.
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',
})
The auth presets configures the @adonisjs/lucid package. The package must be installed to run this preset.
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,
})
FAQs
A collection of presets to configure AdonisJS packages
We found that @adonisjs/presets demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.