From b29aac814f4143c29f02729302d3fb3dc0ab6740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Wed, 18 Oct 2023 10:38:13 +0200 Subject: [PATCH] Revert "feat(env): upgrade `dotenv` (#38481)" This reverts commit 308a327923b087d7f060934456a0fbe77a76056b. --- .../03-environment-variables.mdx | 25 +------------------ packages/next-env/package.json | 4 +-- pnpm-lock.yaml | 16 ++++-------- 3 files changed, 8 insertions(+), 37 deletions(-) diff --git a/docs/02-app/01-building-your-application/07-configuring/03-environment-variables.mdx b/docs/02-app/01-building-your-application/07-configuring/03-environment-variables.mdx index 7015c00dc6c98..813aa2946ed0c 100644 --- a/docs/02-app/01-building-your-application/07-configuring/03-environment-variables.mdx +++ b/docs/02-app/01-building-your-application/07-configuring/03-environment-variables.mdx @@ -48,24 +48,7 @@ export async function getStaticProps() { -> **Note**: Next.js also supports multiline variables inside of your `.env*` files: -> -> ```bash -> # .env.local -> -> # you can write with line breaks -> PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY----- -> ... -> Kh9NV... -> ... -> -----END DSA PRIVATE KEY-----" -> -> # or with `\n` inside double quotes -> PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nKh9NV...\n-----END DSA PRIVATE KEY-----\n" -> ``` - -> **Note**: If you are using a `/src` folder, please note that Next.js will load the .env files **only** from the parent folder and **not** from the `/src` folder. -> This loads `process.env.DB_HOST`, `process.env.DB_USER`, and `process.env.DB_PASS` into the Node.js environment automatically allowing you to use them in [Route Handlers](/docs/app/building-your-application/routing/route-handlers). +This loads `process.env.DB_HOST`, `process.env.DB_USER`, and `process.env.DB_PASS` into the Node.js environment automatically allowing you to use them in [Route Handlers](/docs/app/building-your-application/routing/route-handlers). For example: @@ -197,9 +180,3 @@ For example, if `NODE_ENV` is `development` and you define a variable in both `. - If you are using a [`/src` directory](/docs/app/building-your-application/configuring/src-directory), `.env.*` files should remain in the root of your project. - If the environment variable `NODE_ENV` is unassigned, Next.js automatically assigns `development` when running the `next dev` command, or `production` for all other commands. - -## Version History - -| Version | Changes | -| -------- | --------------------------------------------- | -| `v9.4.0` | Support `.env` and `NEXT_PUBLIC_` introduced. | diff --git a/packages/next-env/package.json b/packages/next-env/package.json index b8624381fd2c6..599ef6cf5c3fc 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -30,7 +30,7 @@ }, "devDependencies": { "@vercel/ncc": "0.34.0", - "dotenv": "16.3.1", - "dotenv-expand": "10.0.0" + "dotenv": "10.0.0", + "dotenv-expand": "8.0.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 640ba798f019b..16ae9fa4d61e6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1470,11 +1470,11 @@ importers: specifier: 0.34.0 version: 0.34.0 dotenv: - specifier: 16.3.1 - version: 16.3.1 - dotenv-expand: specifier: 10.0.0 version: 10.0.0 + dotenv-expand: + specifier: 8.0.1 + version: 8.0.1 packages/next-mdx: dependencies: @@ -10792,20 +10792,14 @@ packages: is-obj: 2.0.0 dev: true - /dotenv-expand@10.0.0: - resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==} + /dotenv-expand@8.0.1: + resolution: {integrity: sha512-j/Ih7bIERDR5PzI89Zu8ayd3tXZ6E3dbY0ljQ9Db0K87qBO8zdLsi2dIvDHMWtjC3Yxb8XixOTHAtia0fDHRpg==} engines: {node: '>=12'} dev: true /dotenv@10.0.0: resolution: {integrity: sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==} engines: {node: '>=10'} - dev: false - - /dotenv@16.3.1: - resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} - engines: {node: '>=12'} - dev: true /downsample-lttb@0.0.1: resolution: {integrity: sha512-Olebo5gyh44OAXTd2BKdcbN5VaZOIKFzoeo9JUFwxDlGt6Sd8fUo6SKaLcafy8aP2UrsKmWDpsscsFEghMjeZA==}