question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lib mode should export types

See original GitHub issue

Clear and concise description of the problem

Previous issues: #2049, #2989

To provide a better experience for our users, lib mode should automatically generate TypeScript definitions, and not require additional setup.

Suggested solution

Alternative

Workarounds:

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:13
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

10reactions
qmhccommented, Jun 5, 2021

I made a plugin vite-plugin-dts to generate d.ts for lib.

5reactions
aleclarsoncommented, May 28, 2021

due to we would need to rely/depend on typescript, and we don’t want that dependency.

A direct dependency isn’t required, since we can use resolve to find typescript from the project root. Regardless, we still think this use case should be handled in a userland plugin, if anything. We’d like to avoid the maintenance burden and subtle complexities introduced by declaration bundling. Someone in the community will hopefully create a plugin if the mentioned workarounds are insufficient.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript library tips: Rollup your types! | by Martin Hochel
When authoring a TypeScript library make sure to follow best industry practices like shipping smallest possible files by rollup-ing your ...
Read more >
Export and publish all types and interfaces in Typescript
I get autocomplete for mylib because it is exported. My question is how can I see all the types and interfaces of mylib...
Read more >
Documentation - Modules - TypeScript
Each module can optionally export a default export. Default exports are marked with the keyword default ; and there can only be one...
Read more >
How to re-export types for users in a library? : r/typescript
The "Documents" variable only contains one property "default", which is just the default export. Why is that? How can I import all the ......
Read more >
Tlbexp.exe (Type Library Exporter) - .NET Framework
You can export a type library from an assembly that references assemblies that were imported using Tlbimp.exe. See the examples section below.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found