Upgrade packages
The "upgrade packages" patch will update official AdonisJS packages, remove the deprecated one's and install the new one's.
npx @adonisjs/upgrade-kit@latest upgrade-packages
pnpm dlx @adonisjs/upgrade-kit@latest upgrade-packages
Following are the steps performed by this patch.
Packages upgraded
- Every
@adonisjsand@japapackages will be upgraded to the latest version. pino-pretty
Packages removed
@adonisjs/repl- The REPL source code has been merged with the AdonisJS core. Therefore the package is no longer required.source-map-support- No longer need external packages for source maps. Node.js supports source maps as first class citizen now.
Packages swapped
@adonisjs/viewswapped withedge.js. The@adonisjs/viewpackage was a wrapper on top ofedge.js. We decided to directly use theedge.jspackage.phc-argon2swapped withargon2. Thephc-argon2was a wrapper on top ofargon2. We decided to no longer use the wrapper and rely on the base implementation directly.phc-bcryptswapped withbcrypt. Thephc-bcryptwas a wrapper on top ofbcrypt. We decided to no longer use the wrapper and rely on the base implementation directly.@japa/preset-adonisis swapped with@japa/plugin-adonisjs.adonis-preset-ts- The base configuration for TypeScript has been moved to@adonisjs/tsconfigpackage. Also, we will installts-node,@swc/corepackages to run TypeScript code without compiling it during development.
Packages installed
@types/nodeto have types for Node.js.@adonisjs/validator- The validator module from v5 is in legacy mode and we recommend using VineJS for new apps. However, for smoother upgrade experience, we install the@adonisjs/validatorpackage, which brings the v5 validation module to v6 apps.@adonisjs/cors- The CORS source code has been moved to its own package. The patch will install and configure this package if there is anconfig/cors.tsfile.@adonisjs/static- The source code to serve static files has been moved to its own package. The patch will install and configure this package if there is aconfig/static.tsfile.
Providers updated
Since AdonisJS packages exports Service providers, this patch will also update the .adonisrc.json file to use the new providers imports.
- "@adonisjs/core"
+ "@adonisjs/core/providers/app_provider"
+ "@adonisjs/core/providers/hash_provider"
- "@adonisjs/session"
+ "@adonisjs/session/session_provider"
- "@adonisjs/view"
+ "@adonisjs/core/providers/edge_provider"
- "@adonisjs/shield"
+ "@adonisjs/shield/shield_provider"
- "@adonisjs/lucid"
+ "@adonisjs/lucid/database_provider"
- "@adonisjs/redis"
+ "@adonisjs/redis/redis_provider"
- "@adonisjs/mail"
+ "@adonisjs/mail/mail_provider"
- "@adonisjs/ally"
+ "@adonisjs/ally/ally_provider"
- "@adonisjs/auth"
+ "@adonisjs/auth/auth_provider"
- "@adonisjs/repl"
+ {
+ "file": "@adonisjs/core/providers/repl_provider",
+ "environments": ["repl", "test"]
+ }
- "@japa/preset-adonis/TestsProvider"
- The
aceProvidersandtestProvidershave been removed. You can now register providers within theprovidersarray and define the environment in which they should be imported.
Commands updated
Since AdonisJS packages exports Ace commands, this patch will also update the .adonisrc.json file to use the new commands imports.
- "@adonisjs/repl/build/commands"
- "@adonisjs/lucid/build/commands"
+ "@adonisjs/lucid/commands"
In v6, there is no need to explicitly register commands part of your application codebase. They will be scanned automatically from the ./commands directory. Also, we will delete the ./commands/index.ts file as it is no longer needed.
- "./commands"