wooorm / xdm

Just a *really* good MDX compiler. No runtime. With esbuild, Rollup, and webpack plugins
http://wooorm.com/xdm/
MIT License
595 stars 18 forks source link

Warning: source-map provides its own type definitions, so you don't need @types/source-map installed #60

Closed deadcoder0904 closed 3 years ago

deadcoder0904 commented 3 years ago

@types/source-map can be removed as it looks like source-map bundles its own types now:

https://github.com/wooorm/xdm/blob/3f121ec2c4280832f4a9010e76622be60d015ba0/package.json#L42

I got a warning while installing mdx-bundler so I found out xdm uses it:

npm WARN deprecated @types/source-map@0.5.7: This is a stub types definition for source-map (https://github.com/mozilla/source-map). source-map provides its own type definitions, so you don't need @types/source-map installed!

But I'm not sure as they have last released the version 2 years ago!

wooorm commented 3 years ago

I don’t think it’s correct, as you point out, because source-map was last published 3 years ago on npm.

/cc @silvenon who added it last month in https://github.com/wooorm/xdm/pull/43.

silvenon commented 3 years ago

Unfortunately #43 didn't fix my problem, I only thought it did. My problem is somewhere else, but I wasn't able to figure out where.

On npm page for source-map you can see the TypeScript icon, which means that it does pack its own type definitions, so @deadcoder0904 is right. Feel free to revert #43.

wooorm commented 3 years ago

Hmm okay! Weird. Maybe something is using resolutions to use an older source-map for you? Otherwise I’d expect that xdm is getting the version it wants (^0.7.0, which has the types)

wooorm commented 3 years ago

Thanks for reporting @deadcoder0904!

deadcoder0904 commented 3 years ago

Haha, nice. Can you guys make me understand how it uses types if it was published 3 years ago?

wooorm commented 3 years ago

I guess because TS@3 was around already back then!

wooorm commented 3 years ago

Released! https://github.com/wooorm/xdm/releases/tag/1.12.0