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.ts
tostart/env.ts
file. -
Rename
Env.rules
toEnv.create
and await the method call.- export default Env.rules({+ export default await Env.create(new URL('../', import.meta.url), { -
Delete the
contracts/env.ts
file
That's all!