react-audio-visualize icon indicating copy to clipboard operation
react-audio-visualize copied to clipboard

Export types from package.json

Open asquithea opened this issue 1 year ago • 2 comments

Fixes https://github.com/microsoft/TypeScript/issues/52363

asquithea avatar Dec 24 '23 19:12 asquithea

@samhirtarif

Hello, is it possible for this pull request to be merged? It's not possible to import any of the components when using TypeScript and .tsx files without errors as it complains about the types.

JohnnyRacer avatar Feb 14 '24 07:02 JohnnyRacer

here's a yarn patch you can use until the author gets back from spending all the internet credits.

diff --git a/package.json b/package.json
index 73d831ffb09522160101c69b8fab688823f1eaa7..10992633d9c992045756b455d249cf1bfd9015ea 100644
--- a/package.json
+++ b/package.json
@@ -33,7 +33,8 @@
   "exports": {
     ".": {
       "import": "./dist/react-audio-visualize.es.js",
-      "require": "./dist/react-audio-visualize.umd.js"
+      "require": "./dist/react-audio-visualize.umd.js",
+      "types": "./dist/index.d.ts"
     }
   },
   "scripts": {

chuck it in .yarn/patches/react-audio-visualize-npm-1.1.3-4843f9e559.patch

then update your package.json with


...

  "dependencies": {
...
      "react-audio-visualize": "patch:react-audio-visualize@npm%3A1.1.3#~/.yarn/patches/react-audio-visualize-npm-1.1.3-4843f9e559.patch",
...
  },

  "resolutions": {
    "react-audio-visualize@npm:^1.1.3": "patch:react-audio-visualize@npm%3A1.1.3#~/.yarn/patches/react-audio-visualize-npm-1.1.3-4843f9e559.patch"
  }

...

👍🏻 🤝

image

airtonix avatar Mar 11 '24 07:03 airtonix

@asquithea thanks for this!

And sorry for the wait guys! This will be published shortly!

samhirtarif avatar Sep 07 '24 07:09 samhirtarif