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 Sep 26, 2022
1 parent fe1ca87 commit f0042b0
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 33 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
14 changes: 0 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
},
"dependencies": {
"axios": "^0.24.0",
"dotenv": "^8.2.0",
"emoji-name-map": "^1.2.8",
"github-username-regex": "^1.0.0",
"upgrade": "^1.1.0",
Expand Down
3 changes: 0 additions & 3 deletions scripts/preview-theme.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import core from "@actions/core";
import github from "@actions/github";
import ColorContrastChecker from "color-contrast-checker";
import * as dotenv from "dotenv";
import Hjson from "hjson";
import snakeCase from "lodash.snakecase";
import parse from "parse-diff";

dotenv.config();

const OWNER = "anuraghazra";
const REPO = "github-readme-stats";
const COMMENT_TITLE = "Automated Theme Preview";
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 @@ -11,8 +10,6 @@ import {
request,
} from "../common/utils.js";

dotenv.config();

/**
* @param {import('axios').AxiosRequestHeaders} variables
* @param {string} token
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,10 +1,7 @@
// @ts-check
import * as dotenv from "dotenv";
import { retryer } from "../common/retryer.js";
import { logger, MissingParamError, request } from "../common/utils.js";

dotenv.config();

/**
* @param {import('Axios').AxiosRequestHeaders} variables
* @param {string} token
Expand Down

0 comments on commit f0042b0

Please sign in to comment.