solid-slider
solid-slider copied to clipboard
Add missing types to package.json for "." case
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.
Gee, that's weird... It looks like it was part of PR #21:
So what happened to it?
It looks like the last revision removed it:
I know it looks redundant, but it seems necessary.
If I rollback to 1.3.17, then my ts(7016) issue goes away too.
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 :)
@awhitford can you confirm? I can publish the beta if it seems better.
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 |
same shit
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",
any updates?