diff --git a/src/components/Package/Package.tsx b/src/components/Package/Package.tsx index 27fbc7f..1d76f23 100644 --- a/src/components/Package/Package.tsx +++ b/src/components/Package/Package.tsx @@ -2,8 +2,8 @@ import React from 'react'; import BugReport from '@material-ui/icons/BugReport'; import Grid from '@material-ui/core/Grid'; import HomeIcon from '@material-ui/icons/Home'; -import { PackageMetaInterface, Author as PackageAuthor } from 'types/packageMeta'; +import { PackageMetaInterface, Author as PackageAuthor } from '../../../types/packageMeta'; import Tag from '../Tag'; import fileSizeSI from '../../utils/file-size'; import { formatDate, formatDateDistance } from '../../utils/package'; diff --git a/src/utils/calls.ts b/src/utils/calls.ts index 4406a21..2ae6488 100644 --- a/src/utils/calls.ts +++ b/src/utils/calls.ts @@ -1,4 +1,4 @@ -import { PackageMetaInterface } from 'types/packageMeta'; +import { PackageMetaInterface } from '../../types/packageMeta'; import API from './api'; diff --git a/src/utils/package.ts b/src/utils/package.ts index 1b95924..cb43022 100644 --- a/src/utils/package.ts +++ b/src/utils/package.ts @@ -5,6 +5,8 @@ import isString from 'lodash/isString'; import format from 'date-fns/format'; import distanceInWordsToNow from 'date-fns/distance_in_words_to_now'; +import { Time } from '../../types/packageMeta'; + export const TIMEFORMAT = 'DD.MM.YYYY, HH:mm:ss'; /** @@ -82,8 +84,8 @@ export function getLastUpdatedPackageTime(uplinks: UpLinks = {}): string { * @param {Object} time * @returns {Array} last 3 releases */ -export function getRecentReleases(time = {}): unknown { - const recent = Object.keys(time).map((version): unknown => ({ +export function getRecentReleases(time: Time = {}): Time[] { + const recent = Object.keys(time).map(version => ({ version, time: formatDate(time[version]), })); diff --git a/tsconfig.json b/tsconfig.json index f37588c..66cd22a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,6 @@ "resolveJsonModule": true, "checkJs": false, "esModuleInterop": true, - "baseUrl": "." }, "include": [ "src",