dts-generator
dts-generator copied to clipboard
"package-name" after generating is incorrect
Hi guys I have a case. After generated the module name is raven/index which I suppose to be raven
- index.ts
export {default as Button} from './app/Button';
export {default as Icon} from './app/Icon';
- After running this command dts-generator --name raven --project ./ --out ./dist/raven.d.ts
It is become
declare module 'raven/app/Button' {
/// <reference types="react" />
import * as React from 'react';
export interface ButtonPropsType {
size: 'medium' | 'small' | 'large';
className: string;
children: React.ReactElement<any>;
} class Button extends React.Component<ButtonPropsType, any> {
render(): JSX.Element;
}
export default Button;
}
declare module 'raven/app/Icon' {
/// <reference types="react" />
import * as React from 'react';
export type GlyphType = 'action-collapseall' | 'action-expandall' | 'action-archive';
export interface IconPropsType {
type: GlyphType;
className: string;
children: React.ReactElement<any>;
} class Icon extends React.Component<IconPropsType, any> {
render(): JSX.Element;
}
export default Icon;
}
declare module 'raven/index' {
export { default as Button } from 'raven/app/Button';
export { default as Icon } from 'raven/app/Icon';
}
- How can I change the package-name to not contain index.
same issue here
any news on this ?
@thib3113 unfortunately no... it's probably not a particularly difficult issue to resolve. I'm happy to review/land PRs for things like this, but we've not spent a lot of time on this package over the past year in part because most of the things we create no longer need it. The package is still useful to many so we do what we can to maintain it, but we're mostly relying on the community for enhancements and PRs currently.
@dylans thanks for answer . In my case, the documentation options of typescript is enough for my need, but I discover this tool, before the documentation options .
Tool is capable of creating alias (map raven to raven/index). In addition to --name you need to use --main and --prefix.