solid-slider icon indicating copy to clipboard operation
solid-slider copied to clipboard

Add missing types to package.json for "." case

Open awhitford opened this issue 10 months ago β€’ 7 comments

Related to issue #20 and #22, it appears that there is a missing types entry in the package.json for the "." case:

  "types": "./dist/index/index.d.ts",
  "exports": {
    ".": {
      "solid": "./dist/index/index.jsx",
      "import": "./dist/index/index.module.js",
      "browser": "./dist/index/index.module.js",
      "require": "./dist/index/index.common.js",
      "node": "./dist/index/index.common.js",
      "types": "./dist/index/index.d.ts"
    },

The last types is presently missing. If I manually add that, then my ts(7016) issue goes away.

awhitford avatar Jan 21 '25 09:01 awhitford

Gee, that's weird... It looks like it was part of PR #21:

Image

So what happened to it?

It looks like the last revision removed it:

Image

I know it looks redundant, but it seems necessary.

If I rollback to 1.3.17, then my ts(7016) issue goes away too.

awhitford avatar Jan 21 '25 09:01 awhitford

I truly despise JavaScript packaging. lol.

I've made an adjustment to the exports and added the types in the wildcard export. I published as @beta tag. Can you test it before I officially publish it? Thanks :)

davedbase avatar Jan 25 '25 13:01 davedbase

@awhitford can you confirm? I can publish the beta if it seems better.

davedbase avatar Feb 09 '25 21:02 davedbase

According to are the types wrong , the types in v1.3.18 are almost totally broken.

"solid-slider" "solid-slider/plugins/autoplay" "solid-slider/plugins/adaptiveHeight" "solid-slider/plugins/adaptiveWidth" "solid-slider/slider.css" "solid-slider/plugins/adaptiveHeight.css" "solid-slider/plugins/adaptiveWidth.css"
node10 βœ… πŸ’€ Resolution failed πŸ’€ Resolution failed πŸ’€ Resolution failed πŸ’€ Resolution failed πŸ’€ Resolution failed πŸ’€ Resolution failed
node16Β (from CJS) ❌ No types⚠️ ESM (dynamic import only)🚭 Unexpected module syntax ❌ No types⚠️ ESM (dynamic import only)πŸ› Used fallback condition ❌ No types⚠️ ESM (dynamic import only)πŸ› Used fallback condition ❌ No types⚠️ ESM (dynamic import only)πŸ› Used fallback condition πŸ’€ Resolution failed πŸ’€ Resolution failed πŸ’€ Resolution failed
node16Β (from ESM) ❌ No types ❌ No typesπŸ› Used fallback condition ❌ No typesπŸ› Used fallback condition ❌ No typesπŸ› Used fallback condition πŸ’€ Resolution failed πŸ’€ Resolution failed πŸ’€ Resolution failed
bundler ❌ No types ❌ No typesπŸ› Used fallback condition ❌ No typesπŸ› Used fallback condition ❌ No typesπŸ› Used fallback condition πŸ’€ Resolution failed πŸ’€ Resolution failed πŸ’€ Resolution failed

subframe7536 avatar Mar 03 '25 13:03 subframe7536

same shit

Azq2 avatar Apr 16 '25 11:04 Azq2

pnpm patch is great

$ cat ../patches/solid-slider.patch 
diff --git a/package.json b/package.json
index 1db7d1c72f42ae04c5752341691d4f000d9fd8cb..68bd8ca664423dd00638286d92f78befac298fbc 100644
--- a/package.json
+++ b/package.json
@@ -18,6 +18,7 @@
   "types": "./dist/index/index.d.ts",
   "exports": {
     ".": {
+      "types": "./dist/index/index.d.ts",
       "solid": "./dist/index/index.jsx",
       "import": "./dist/index/index.module.js",
       "browser": "./dist/index/index.module.js",

Azq2 avatar Apr 16 '25 13:04 Azq2

any updates?

timevoltex avatar Aug 11 '25 05:08 timevoltex