Update Env validations code
The "update env validation code" patch will updates the env.ts file to be compatible with the new API.
npx @adonisjs/upgrade-kit@latest upgrade-env-config
pnpm dlx @adonisjs/upgrade-kit@latest upgrade-env-config
Following are the steps performed by this patch.
-
Move
env.tstostart/env.tsfile. -
Rename
Env.rulestoEnv.createand await the method call.- export default Env.rules({+ export default await Env.create(new URL('../', import.meta.url), { -
Delete the
contracts/env.tsfile
That's all!