Skip to content
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

"package-name" after generating is incorrect #102

Open
lovedota opened this issue Mar 9, 2017 · 5 comments
Open

"package-name" after generating is incorrect #102

lovedota opened this issue Mar 9, 2017 · 5 comments
Milestone

Comments

@lovedota
Copy link

lovedota commented Mar 9, 2017

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.
@lovedota lovedota changed the title "package-name" is incorrect "package-name" after generating is incorrect Mar 9, 2017
@aight8
Copy link

aight8 commented Mar 12, 2017

same issue here

@dylans dylans added this to the 2.2.0 milestone Mar 17, 2017
@thib3113
Copy link

any news on this ?

@dylans
Copy link
Contributor

dylans commented Sep 24, 2018

@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.

@thib3113
Copy link

@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 .

@dylans dylans modified the milestones: 2.2.0, 3.1 Dec 28, 2018
@vytenisu
Copy link

Tool is capable of creating alias (map raven to raven/index). In addition to --name you need to use --main and --prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants