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

Question: Is it intended that the dependencies of the root index.ts are not rendered? #258

Closed
danieldietrich opened this issue Sep 10, 2020 · 2 comments

Comments

@danieldietrich
Copy link

Screenshot 2020-09-10 at 11 19 21

There are other files that use wildcard exports, like comp/index.ts:

export { comp } from './comp'
export { assign, render } from './render'
export * from './types'

The dependency between comp/index.ts and comp/types.ts is rendered correctly.

So why it does not happen for the root index.ts? 🤔

johnnaegle added a commit to johnnaegle/madge that referenced this issue Aug 9, 2022
Adds a test for pahen#258.  Demonstrates that
aggregated ES6 modules in typescript are not correctly processed.

If we have an aggregated module that is in typescript:
export { named } from './a-named.ts'

Then made does not process the file
johnnaegle added a commit to johnnaegle/madge that referenced this issue Aug 9, 2022
Adds a test for pahen#258.  Demonstrates that
aggregated ES6 modules in typescript are not correctly processed.

If we have an aggregated module that is in typescript:
export { named } from './a-named.ts'

Then madge does not process the file
@johnnaegle
Copy link

I think this may be fixed by a typescript upgrade in the project.

I added a failing test in my fork for a similar case:

When the aggregation is this:

import { nombre } from "./c-named";
export * as default from "./a-default";
export { named } from "./b-named";

That fails with this error:

 typescript-eslint:typescript-estree:createSourceFile Getting AST without type information in TS mode for: /Users/jnaegle/code/my-madge/test/typescript/aggregate/estree.ts +0ms
  tree error getting dependencies: Identifier expected. 'default' is a reserved word that cannot be used here. +9ms
  tree TSError: Identifier expected. 'default' is a reserved word that cannot be used here.

I believe this was fixed in Typescript 4.1, see here: microsoft/TypeScript#39803

@PabloLION
Copy link
Collaborator

Thanks for the suggestion. Now typescript is added as an optional peer dependency in #350 so this problem should be solved.

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

3 participants