-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No .d.ts created after update to 0.10.0 #268
Comments
I'm running into a similar issue and just assumed it was a quirk with the project. @dattebayorob Was this working for you on a previous version? |
This comment has been minimized.
This comment has been minimized.
@dattebayorob I've updated your comment above. I can also confirm that this seems to be introduced in the first |
potential related bug? |
Maybe the config is wrong here? |
It seems like this plugin is not yet stable. I think we should go back to Rollup-typescript2 |
@jaredpalmer - was this not part of a fix for - Support for async/await in rollup plugins? |
@tabuckner, The reason why you're seeing a different file structure now in terms of where declaration files are emitted to is that If you instead do: export {PrivateRoute, PublicRoute} from "./components"; Does that produce correct declarations inside I haven't verified it yet, but I think what's happening is that the tree-shaking step of the declaration bundling phase of
I really don't know why, but I think the combination of declaration bundling, ease of combining with Babel and support for plugins with async functions (to work around an |
No, the .d.ts creates a
|
@wessberg Here's an repro repo that shows the issues I ran into with It's not the exact scenario you outline and @dattebayorob confirmed, but it does seem to be related. https://github.com/tabuckner/tsdx-0.10.x-type-defs-repro |
I will try to setup with the @wessberg/rollup-plugin-ts now, I need a async plugin now, and the typescript2 hack to get it to work doesn't seem like a good idea |
On src/index.ts
The generated dist/index.d.ts |
@dattebayorob @tabuckner what version of node are you all using? |
I'll try with some other versions as well. |
I'm on 11.15.0 |
Is this the default or did you use it with an async Rollup plugin? |
With default plugins |
Thanks for the repro. I'll take a look at it and will report back here. |
Alright, I've fixed the issues and released v1.1.73. There were two of them:
Here's the declaration output based on your repro in the new version: interface ICoolThingInput {
message: string;
id?: number;
}
interface ICoolThingOutput {
name: string;
id: number;
message: {
text: string;
code: number;
};
}
declare const sum: (a: number, b: number) => number;
declare const log: (str: string) => void;
declare const doCoolThings: (input: ICoolThingInput) => ICoolThingOutput;
export { sum, log, doCoolThings, ICoolThingInput, ICoolThingOutput }; I'm unaware if this also fixes the issue that the original issue author had since I have no repro for it, but I hope so. |
I did some tests with the new rollup-plugin-ts:
Will generate declarations correctly:
But if a export * :
lends to
|
@dattebayorob, The issue you reported has been fixed in the latest version of |
Current Behavior
in
0.10.0
will generate
and directories of components with .d.ts aren't created
Expected behavior
In
0.9.3
the .d.ts are created:Suggested solution(s)
Additional context
Your environment
The text was updated successfully, but these errors were encountered: