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

Dependency cycle with TypeScript types #124

Open
jdeniau opened this issue Apr 25, 2020 · 1 comment
Open

Dependency cycle with TypeScript types #124

jdeniau opened this issue Apr 25, 2020 · 1 comment

Comments

@jdeniau
Copy link

jdeniau commented Apr 25, 2020

Hi,

thanks for developing destiny. It looks really interesting.

I noticed #123 and all linked issues, but I prefer opening a new issue, even if it can be related.

Imagine the two following files:

main.ts

import foo from './foo';

export type MAIN = string | number;

function main(key: MAIN): void {
  foo(key);
}

foo.ts

import type { MAIN } from './main';

export default function foo(key: MAIN): void {
  console.log(key);
}

Running destiny, I got the following warning:

 Dependency cycle detected: foo.ts -> main.ts -> foo.ts

And with bigger codebase, I think it it responsible for not having the shared folder, but a list of nested directory:
image

I think the types definition may be omitted for typescript.

In the first example, the resulting structure may be

main/
|- index.ts
|- index/
|-- foo.ts

(or something like that 😉 )

@AnatoleLucet
Copy link
Collaborator

Hi! I have some trouble understanding what's the issue here. Can you please describe what Destiny currently do with your example and what you expect it to do?

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

No branches or pull requests

2 participants