Skip to content

Commit

Permalink
Update envalid imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kachkaev committed Feb 7, 2022
1 parent 6637156 commit 910bf3d
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/scripts/2-sources/osm/tiles/fetch-images.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AxiosInstance } from "axios";
import chalk from "chalk";
import * as envalid from "envalid";
import envalid from "envalid";
import fs from "fs-extra";
import path from "node:path";
import stream from "node:stream";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AxiosResponse } from "axios";
import chalk from "chalk";
import * as envalid from "envalid";
import envalid from "envalid";
import sortKeys from "sort-keys";

import { cleanEnv } from "../../../shared/cleanEnv";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as turf from "@turf/turf";
import axios, { AxiosError, AxiosInstance } from "axios";
import axiosRetry from "axios-retry";
import chalk from "chalk";
import * as envalid from "envalid";
import envalid from "envalid";
import fs from "fs-extra";
import http from "node:http";
import https from "node:https";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import chalk from "chalk";
import clipboardy from "clipboardy";
import { color as d3Color } from "d3-color";
import * as envalid from "envalid";
import envalid from "envalid";
import fs from "fs-extra";
import _ from "lodash";
import path from "node:path";
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/4-results/generate-poster.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from "chalk";
import * as envalid from "envalid";
import envalid from "envalid";
import path from "node:path";
import puppeteer from "puppeteer";

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/format-data-files.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from "chalk";
import * as envalid from "envalid";
import envalid from "envalid";
import fs from "fs-extra";
import path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion src/shared/cleanEnv.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { config } from "dotenv-flow";
import * as envalid from "envalid";
import envalid from "envalid";

import { defaultReporter } from "./envalidDefaultReporter";

Expand Down
8 changes: 5 additions & 3 deletions src/shared/envalidDefaultReporter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Origin: https://github.com/af/envalid/blob/a694876d3fe5f8a8316d15ce4e26e895f41966f6/src/reporter.ts

import { EnvMissingError, ReporterOptions } from "envalid";
import envalid from "envalid";

import { ScriptError } from "./helpersForScripts";

Expand All @@ -17,15 +17,17 @@ const colors = {

const rule = colors.white("================================");

export const defaultReporter = ({ errors = {} }: ReporterOptions<any>) => {
export const defaultReporter = ({
errors = {},
}: envalid.ReporterOptions<any>) => {
if (Object.keys(errors).length === 0) {
return;
}

const missingVarsOutput: string[] = [];
const invalidVarsOutput: string[] = [];
for (const [key, error] of Object.entries(errors)) {
if (error instanceof EnvMissingError) {
if (error instanceof envalid.EnvMissingError) {
missingVarsOutput.push(
` ${colors.blue(key)}: ${error.message || "(required)"}`,
);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/geocoding/debugAddressNormalizationIfEnabled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from "chalk";
import * as envalid from "envalid";
import envalid from "envalid";
import { WriteStream } from "node:tty";

import { AddressNormalizationConfig, normalizeAddress } from "../addresses";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/results/getLocaleFromEnv.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as envalid from "envalid";
import envalid from "envalid";

import { cleanEnv } from "../cleanEnv";

Expand Down
2 changes: 1 addition & 1 deletion src/shared/sources/mkrf/helpersForPaths.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as envalid from "envalid";
import envalid from "envalid";
import path from "node:path";

import { cleanEnv } from "../../cleanEnv";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as envalid from "envalid";
import envalid from "envalid";
import _ from "lodash";
import sleep from "sleep-promise";

Expand Down
2 changes: 1 addition & 1 deletion src/shared/territory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as turf from "@turf/turf";
import chalk from "chalk";
import * as envalid from "envalid";
import envalid from "envalid";
import fs from "fs-extra";
import { load } from "js-yaml";
import _ from "lodash";
Expand Down

0 comments on commit 910bf3d

Please sign in to comment.