From f8516cf23cb76ec6ab450579f55e7cac9eac9b8e Mon Sep 17 00:00:00 2001 From: hazycora Date: Sat, 16 Sep 2023 23:16:11 -0500 Subject: [PATCH] hotfix import resolution --- package.json | 6 +++++- src/streamers/soundcloud/parse.ts | 2 +- src/streamers/spotify/main.ts | 2 +- src/streamers/spotify/parse.ts | 9 ++------- tsconfig.json | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index fecd1c8..fcdecb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lucida", - "version": "1.1.0", + "version": "1.1.1", "description": "A modular downloader tool", "main": "build/index.js", "type": "module", @@ -12,6 +12,10 @@ }, "exports": { ".": "./build/index.js", + "./types": { + "import": "./build/types.js", + "types": "./build/types.d.ts" + }, "./streamers/*.js": "./build/streamers/*.js" }, "files": [ diff --git a/src/streamers/soundcloud/parse.ts b/src/streamers/soundcloud/parse.ts index eb6e9f9..b56b4f6 100644 --- a/src/streamers/soundcloud/parse.ts +++ b/src/streamers/soundcloud/parse.ts @@ -1,6 +1,6 @@ import { Artist, Album, Track } from '../../types.js' import fetch from 'node-fetch' -import sizeOf from 'image-size' +import { imageSize as sizeOf } from 'image-size' async function parseCoverArtwork(url: string) { const resp = await fetch(url) diff --git a/src/streamers/spotify/main.ts b/src/streamers/spotify/main.ts index 844b6d9..1ce405c 100644 --- a/src/streamers/spotify/main.ts +++ b/src/streamers/spotify/main.ts @@ -1,7 +1,7 @@ import Librespot from 'librespot' import { parseArtist, parseAlbum, parseTrack } from './parse.js' import { GetByUrlResponse, SearchResults, StreamerWithLogin } from '../../types.js' -import { SpotifyAlbum, SpotifyArtist } from 'librespot/build/utils/types' +import { SpotifyAlbum, SpotifyArtist } from 'librespot/types' class Spotify implements StreamerWithLogin { client: Librespot diff --git a/src/streamers/spotify/parse.ts b/src/streamers/spotify/parse.ts index f996b43..8f54424 100644 --- a/src/streamers/spotify/parse.ts +++ b/src/streamers/spotify/parse.ts @@ -1,10 +1,5 @@ -import type { - SpotifyAlbum, - SpotifyArtist, - SpotifyThumbnail, - SpotifyTrack -} from 'librespot/build/utils/types' -import { Album, Artist, Track } from '../../types' +import type { SpotifyAlbum, SpotifyArtist, SpotifyThumbnail, SpotifyTrack } from 'librespot/types' +import { Album, Artist, Track } from '../../types.js' function parseThumbnails(raw: SpotifyThumbnail[]) { return raw diff --git a/tsconfig.json b/tsconfig.json index 1875f1c..21fd0b4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,7 +27,7 @@ /* Modules */ "module": "es6" /* Specify what module code is generated. */, // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, + "moduleResolution": "node16" /* Specify how TypeScript looks up a file from a given module specifier. */, // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */