dts-bundle-generator
dts-bundle-generator copied to clipboard
Imported namespace "types" from babel missing in generated d.ts output
Bug report
Input code
import { types } from "@babel/core"
export type AnyJSXElement = types.CallExpression | types.JSXElement;
export function isAnyJSXElementPath(path: NodePath): path is NodePath<AnyJSXElement> {
return true;
}
Expected output
import { NodePath, types } from '@babel/core';
export declare type AnyJSXElement = types.CallExpression | types.JSXElement;
export declare function isAnyJSXElementPath(path: NodePath): path is NodePath<AnyJSXElement>;
Actual output
import { NodePath } from '@babel/core';
export declare type AnyJSXElement = types.CallExpression | types.JSXElement;
export declare function isAnyJSXElementPath(path: NodePath): path is NodePath<AnyJSXElement>;
Additional context
Version : 6.12.0
@IgnusG can you provide a full repro please? It seems that @babel/core doesn't include types and there is no package @types/@babel nor @types/babel nor @types/@babel/core nor @types/@babel/core so I stopped guessing at this point. Thanks!
Scoped packages in the @types repo are in the form of @types/scope__name (otherwise they would be invalid as package names) so @babel/core is available under @types/babel__core 😉
I can make a simple repro though if you'd like 👍
I can make a simple repro though if you'd like 👍
@IgnusG Yes please! I think creating a simple repro steps is a good approach to report bugs (you don't even need to ask whether I would like to see it or not) - it helps maintainers not to waste time of guessing what is going on and you to get the help faster.
@timocov I encountered this issue too.
Here is a simple minimum repo (with just two ts files) to demonstrate this issue. https://github.com/3cp/namespace-bug
Please read the readme for more information.
@3cp your issue related to https://github.com/timocov/dts-bundle-generator/issues/134
@IgnusG do you have any updates on this?
I'm going to close the issue. If you'll have any question or updates - feel free to ping me.