-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cool library, but my path alias (tsconfig) is printing rather strange. #22
Comments
Can you add a test in the test project to replicate the issue? https://github.com/PSeitz/ts-dependency-graph/blob/master/test_project/tsconfig.json |
Sure, but I'm not entriely sure how the codebase works so will do a bit of research before I make any PR. From what I can tell I should set up a path like this "paths": {
"@/*": ["src/*"],
}, and then import it in the test project somewhere, but not entirely sure what the 'expect' in jest should be expect(graph).toEqual({
edges: [
{
node1: { path: 'test_project/src/App.tsx', layer: 1000 },
node2: { path: 'test_project/src/components/Button.tsx', layer: 1000 },
},
{
node1: { path: 'test_project/src/App.tsx', layer: 1000 },
node2: { path: 'test_project/src/components/Input.tsx', layer: 1000 },
},
{
node1: { path: 'test_project/src/components/Input.tsx', layer: 1000 },
node2: { path: 'test_project/src/helpers/index.ts', layer: 1000 },
},
{
node1: { path: 'test_project/src/helpers/index.ts', layer: 1000 },
node2: { path: 'test_project/src/helpers/helper.ts', layer: 1000 },
},
],
nodes: [
{ path: 'test_project/src/App.tsx', layer: 1000 },
{ path: 'test_project/src/components/Button.tsx', layer: 1000 },
{ path: 'test_project/src/components/Input.tsx', layer: 1000 },
{ path: 'test_project/src/helpers/index.ts', layer: 1000 },
{ path: 'test_project/src/helpers/helper.ts', layer: 1000 },
],
start_nodes: new Set().add({ layer: 1000, path: 'test_project/src/App.tsx' }),
color_edges: false,
}) this is yours so I imagine it would be simiular? |
You can just edit the existing project, |
In my tsconfig.json
then in the graph it looks like this
this is my script
The text was updated successfully, but these errors were encountered: