Skip to content

Commit

Permalink
refactor: remove unused dotenv calls
Browse files Browse the repository at this point in the history
As explained in the Vercel documentation vercel ignores dot files (see
vercel/vercel#3962 (comment)). It
instead loads the env variables defined in the vercel instance. As a
result we can therefore remove dotenv.
  • Loading branch information
rickstaa committed Nov 21, 2022
1 parent 5df25a6 commit 25066ab
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 15 deletions.
3 changes: 0 additions & 3 deletions api/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as dotenv from "dotenv";
import { renderStatsCard } from "../src/cards/stats-card.js";
import { blacklist } from "../src/common/blacklist.js";
import {
Expand All @@ -11,8 +10,6 @@ import {
import { fetchStats } from "../src/fetchers/stats-fetcher.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

export default async (req, res) => {
const {
username,
Expand Down
3 changes: 0 additions & 3 deletions api/top-langs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as dotenv from "dotenv";
import { renderTopLanguages } from "../src/cards/top-languages-card.js";
import { blacklist } from "../src/common/blacklist.js";
import {
Expand All @@ -11,8 +10,6 @@ import {
import { fetchTopLanguages } from "../src/fetchers/top-languages-fetcher.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

export default async (req, res) => {
const {
username,
Expand Down
3 changes: 0 additions & 3 deletions api/wakatime.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as dotenv from "dotenv";
import { renderWakatimeCard } from "../src/cards/wakatime-card.js";
import {
clampValue,
Expand All @@ -10,8 +9,6 @@ import {
import { fetchWakatimeStats } from "../src/fetchers/wakatime-fetcher.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

export default async (req, res) => {
const {
username,
Expand Down
3 changes: 0 additions & 3 deletions src/fetchers/stats-fetcher.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-check
import axios from "axios";
import * as dotenv from "dotenv";
import githubUsernameRegex from "github-username-regex";
import { calculateRank } from "../calculateRank.js";
import { retryer } from "../common/retryer.js";
Expand All @@ -12,8 +11,6 @@ import {
wrapTextMultiline,
} from "../common/utils.js";

dotenv.config();

/**
* Stats fetcher object.
*
Expand Down
3 changes: 0 additions & 3 deletions src/fetchers/top-languages-fetcher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-check
import * as dotenv from "dotenv";
import { retryer } from "../common/retryer.js";
import {
CustomError,
Expand All @@ -9,8 +8,6 @@ import {
wrapTextMultiline,
} from "../common/utils.js";

dotenv.config();

/**
* Top languages fetcher object.
*
Expand Down

0 comments on commit 25066ab

Please sign in to comment.