From 8c376463798ff5b05006653c285c8419d114ebfd Mon Sep 17 00:00:00 2001 From: Alem Tuzlak Date: Tue, 24 Sep 2024 15:17:37 +0200 Subject: [PATCH] update to dotenvx --- package-lock.json | 147 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 8 +-- scripts/setup.ts | 4 +- 3 files changed, 151 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index ce546f0..fcd4d3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ }, "devDependencies": { "@biomejs/biome": "^1.9.2", + "@dotenvx/dotenvx": "^1.14.1", "@remix-run/dev": "^2.12.1", "@types/node": "^22.6.1", "@types/prompt": "^1.1.9", @@ -37,7 +38,6 @@ "@vitest/ui": "^2.1.1", "autoprefixer": "^10.4.20", "chalk": "^5.3.0", - "dotenv": "^16.4.5", "glob": "^11.0.0", "happy-dom": "^15.7.4", "knip": "^5.30.5", @@ -988,6 +988,89 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@dotenvx/dotenvx": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@dotenvx/dotenvx/-/dotenvx-1.14.1.tgz", + "integrity": "sha512-uuv4JJxyy2dA1VaoyJpv404tzg+xpShYOy7eMYD7MZTAdO5JMnYlm7x5UZV6jgaHk5w99OTTe17i/R2fOS5jbw==", + "dev": true, + "dependencies": { + "commander": "^11.1.0", + "dotenv": "^16.4.5", + "eciesjs": "^0.4.6", + "execa": "^5.1.1", + "fdir": "^6.2.0", + "ignore": "^5.3.0", + "object-treeify": "1.1.33", + "picomatch": "^4.0.2", + "which": "^4.0.0" + }, + "bin": { + "dotenvx": "src/cli/dotenvx.js", + "git-dotenvx": "src/cli/dotenvx.js" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/@dotenvx/dotenvx/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/@dotenvx/dotenvx/node_modules/fdir": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.3.0.tgz", + "integrity": "sha512-QOnuT+BOtivR77wYvCWHfGt9s4Pz1VIMbD463vegT5MLqNXy8rYFT/lPVEqf/bhYeT6qmqrNHhsX+rWwe3rOCQ==", + "dev": true, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/@dotenvx/dotenvx/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/@dotenvx/dotenvx/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@dotenvx/dotenvx/node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dev": true, + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, "node_modules/@emotion/babel-plugin": { "version": "11.11.0", "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", @@ -1655,6 +1738,45 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/@noble/ciphers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.0.0.tgz", + "integrity": "sha512-wH5EHOmLi0rEazphPbecAzmjd12I6/Yv/SiHdkA9LSycsQk7RuuTp7am5/o62qYr0RScE7Pc9icXGBbsr6cesA==", + "dev": true, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/curves": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.6.0.tgz", + "integrity": "sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==", + "dev": true, + "dependencies": { + "@noble/hashes": "1.5.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.5.0.tgz", + "integrity": "sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==", + "dev": true, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -4929,6 +5051,20 @@ "wcwidth": "^1.0.1" } }, + "node_modules/eciesjs": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/eciesjs/-/eciesjs-0.4.8.tgz", + "integrity": "sha512-U2wAn6yEOVBP9lOVh3nryufg3hQTKVicG+qjEfqB/70m/mU9DzwWNdK0mC5zuxlJH42EGAezFlHVWI0snwg1nw==", + "dev": true, + "dependencies": { + "@noble/ciphers": "^1.0.0", + "@noble/curves": "^1.6.0", + "@noble/hashes": "^1.5.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/editorconfig": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-1.0.4.tgz", @@ -8519,6 +8655,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object-treeify": { + "version": "1.1.33", + "resolved": "https://registry.npmjs.org/object-treeify/-/object-treeify-1.1.33.tgz", + "integrity": "sha512-EFVjAYfzWqWsBMRHPMAXLCDIJnpMhdWAqR7xG6M6a2cs6PMFpl/+Z20w9zDW4vkxOFfddegBKq9Rehd0bxWE7A==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", diff --git a/package.json b/package.json index 3e89b38..8d7713b 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "test:ui": "vitest --ui --api 9527", "test:cov": "vitest run --coverage", "typecheck": "tsc", - "validate": "npm run typecheck && npm run check && npm run test && npm run check:unused", + "validate": "npm run check && npm run typecheck && npm run test && npm run check:unused", "check": "biome check .", "check:fix": "biome check --fix .", "check:unused": "knip" @@ -39,13 +39,13 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-i18next": "^15.0.2", - "remix-custom-routes": "^1.0.1", "remix-i18next": "^6.4.1", "tailwind-merge": "^2.5.2", "zod": "^3.23.8" }, "devDependencies": { "@biomejs/biome": "^1.9.2", + "@dotenvx/dotenvx": "^1.14.1", "@remix-run/dev": "^2.12.1", "@types/node": "^22.6.1", "@types/prompt": "^1.1.9", @@ -55,8 +55,6 @@ "@vitest/ui": "^2.1.1", "autoprefixer": "^10.4.20", "chalk": "^5.3.0", - "dotenv": "^16.4.5", - "glob": "^11.0.0", "happy-dom": "^15.7.4", "knip": "^5.30.5", "lefthook": "^1.7.16", @@ -77,4 +75,4 @@ "engines": { "node": ">=20.0.0" } -} \ No newline at end of file +} diff --git a/scripts/setup.ts b/scripts/setup.ts index 5e2fbc1..bbb6143 100644 --- a/scripts/setup.ts +++ b/scripts/setup.ts @@ -1,6 +1,6 @@ import { spawn } from "node:child_process" +import dotenvx from "@dotenvx/dotenvx" import chalk from "chalk" -import dotenv from "dotenv" import prompt from "prompt" // add all the env you wish here const ENVIRONMENTS = ["stage", "prod", "test"] @@ -18,7 +18,7 @@ const getEnvInfo = () => { const setupEnv = () => { const { envName, path } = getEnvInfo() console.log(chalk.green(`Loading environment: ${envName}`)) - dotenv.config({ path }) + dotenvx.config({ path }) console.log(`Environment loaded: ${chalk.green(envName)} from ${chalk.green(path)}`) }