Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

Replace dotenv-cli with dotenv require hook (#2010)

Bogdan Chadkin3d851e427ff8
diff --git a/apps/builder/env-check.js b/apps/builder/env-check.js
index 805622f8e1..dd9cf9b825 100644
--- a/apps/builder/env-check.js
+++ b/apps/builder/env-check.js
@@ -10,8 +10,7 @@
* `dot-env` makes it so that when you run this file the `process.env` is always populated with your `.env` file if it finds one,
* if not it will read the environment variables set by your hosting provider like remix does.
*/
-// eslint-disable-next-line @typescript-eslint/no-var-requires
-require("dotenv").config();
+require("dotenv/config");
const REQUIRED_ENVS = ["DATABASE_URL", "AUTH_SECRET"];
const S3_KEYS = [
diff --git a/apps/builder/package.json b/apps/builder/package.json
index 1e7fe94676..c6c0f900c5 100644
--- a/apps/builder/package.json
+++ b/apps/builder/package.json
@@ -7,7 +7,7 @@
"prebuild": "pnpm remix --version",
"build": "remix build",
"start": "remix-serve build",
- "start-local": "dotenv -e .env npm start",
+ "start-local": "NODE_OPTIONS='-r dotenv/config' remix-serve build",
"dev": "remix dev",
"typecheck": "tsc --noEmit --emitDeclarationOnly false",
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
@@ -116,8 +116,7 @@
"@webstudio-is/jest-config": "workspace:^",
"@webstudio-is/storybook-config": "workspace:^",
"@webstudio-is/tsconfig": "workspace:^",
- "dotenv": "^16.0.0",
- "dotenv-cli": "^7.1.0",
+ "dotenv": "^16.3.1",
"html-tags": "^3.3.1",
"jest": "^29.6.2",
"react-test-renderer": "^18.2.0",
diff --git a/packages/prisma-client/package.json b/packages/prisma-client/package.json
index e310441582..e1589a4b3a 100644
--- a/packages/prisma-client/package.json
+++ b/packages/prisma-client/package.json
@@ -36,7 +36,7 @@
"private": false,
"dependencies": {
"@inquirer/confirm": "^0.0.25-alpha.0",
- "dotenv": "^16.0.0",
+ "dotenv": "^16.3.1",
"execa": "^6.1.0",
"nanoid": "^4.0.2",
"umzug": "^3.2.1"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index bcfd975f81..f6d48ee9e8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -341,11 +341,8 @@ importers:
specifier: workspace:^
version: link:../../packages/tsconfig
dotenv:
- specifier: ^16.0.0
- version: 16.0.1
- dotenv-cli:
- specifier: ^7.1.0
- version: 7.1.0
+ specifier: ^16.3.1
+ version: 16.3.1
html-tags:
specifier: ^3.3.1
version: 3.3.1
@@ -1035,8 +1032,8 @@ importers:
specifier: ^0.0.25-alpha.0
version: 0.0.25-alpha.0
dotenv:
- specifier: ^16.0.0
- version: 16.0.1
+ specifier: ^16.3.1
+ version: 16.3.1
execa:
specifier: ^6.1.0
version: 6.1.0
@@ -5789,7 +5786,7 @@ packages:
cacache: 15.3.0
chalk: 4.1.2
chokidar: 3.5.3
- dotenv: 16.0.1
+ dotenv: 16.3.1
esbuild: 0.17.6
esbuild-plugins-node-modules-polyfill: 1.1.0([email protected])
execa: 5.1.1
@@ -9029,16 +9026,6 @@ packages:
domhandler: 5.0.3
dev: true
- resolution: {integrity: sha512-motytjZFQB3ZtGTIN4c0vnFgv4kuNZ2WxVnGY6PVFiygCzkm3IFBBguDUzezd9HgNA0OYYd6vNCWlozs0Q1Zxg==}
- hasBin: true
- dependencies:
- cross-spawn: 7.0.3
- dotenv: 16.0.1
- dotenv-expand: 10.0.0
- minimist: 1.2.7
- dev: true
-
resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==}
engines: {node: '>=12'}
@@ -9048,8 +9035,8 @@ packages:
engines: {node: '>=10'}
dev: true
- resolution: {integrity: sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==}
+ resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==}
engines: {node: '>=12'}
@@ -11650,7 +11637,7 @@ packages:
engines: {node: '>=14.0.0'}
dependencies:
app-root-dir: 1.0.2
- dotenv: 16.0.1
+ dotenv: 16.3.1
dotenv-expand: 10.0.0