Skip to content

Commit 0d5397a

Browse files
authored
Remove dotenv (#90)
1 parent e34689e commit 0d5397a

4 files changed

Lines changed: 9 additions & 22 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
"@graphql-codegen/cli": "^7.0.0",
6969
"@tsconfig/node22": "^22.0.5",
7070
"@types/node": "^20.11.24",
71-
"dotenv": "^16.4.5",
7271
"oxfmt": "^0.51.0",
7372
"oxlint": "^1.63.0",
7473
"oxlint-tsgolint": "^0.22.1",

pnpm-lock.yaml

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/env.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import { configDotenv } from "dotenv";
21
import { pino } from "pino";
32

43
export const ROOT_TEST_BRANCH_PREFIX = process.env.ROOT_TEST_BRANCH_PREFIX!;
54
export const ROOT_TEMP_DIRECTORY = process.env.ROOT_TEMP_DIRECTORY!;
65

7-
configDotenv();
8-
96
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
107
if (!GITHUB_TOKEN) {
118
throw new Error("GITHUB_TOKEN must be set");

vitest.integration.config.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { randomBytes } from "node:crypto";
22
import os from "node:os";
33
import path from "node:path";
4+
import { loadEnvFile } from "node:process";
45
import { defineConfig } from "vitest/config";
56

6-
const ROOT_TEST_BRANCH_PREFIX =
7-
process.env.ROOT_TEST_BRANCH_PREFIX ??
8-
`test-${randomBytes(4).toString("hex")}`;
7+
try {
8+
loadEnvFile();
9+
} catch {}
910

10-
const ROOT_TEMP_DIRECTORY =
11-
process.env.ROOT_TEMP_DIRECTORY ??
12-
path.join(os.tmpdir(), ROOT_TEST_BRANCH_PREFIX);
13-
14-
process.env.ROOT_TEST_BRANCH_PREFIX = ROOT_TEST_BRANCH_PREFIX;
15-
process.env.ROOT_TEMP_DIRECTORY = ROOT_TEMP_DIRECTORY;
11+
process.env.ROOT_TEST_BRANCH_PREFIX ??= `test-${randomBytes(4).toString("hex")}`;
12+
process.env.ROOT_TEMP_DIRECTORY ??= path.join(
13+
os.tmpdir(),
14+
process.env.ROOT_TEST_BRANCH_PREFIX,
15+
);
1616

1717
export default defineConfig({
1818
test: {

0 commit comments

Comments
 (0)