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

Wrong shared file location #143

Open
AnatoleLucet opened this issue May 23, 2020 · 1 comment
Open

Wrong shared file location #143

AnatoleLucet opened this issue May 23, 2020 · 1 comment
Labels
bug Something isn't working important Important issue

Comments

@AnatoleLucet
Copy link
Collaborator

When running npx destiny src --debug on Destiny's repo:

src
├──index
│  ├──formatFileStructure
│  │  ├──fixImports
│  │  │  ├──customResolve.ts
│  │  │  ├──findImports.ts
│  │  │  ├──makeImportPath.ts
│  │  │  └──RootOption.ts
│  │  ├──fixImports.ts
│  │  ├──moveFiles.ts
│  │  └──removeEmptyFolders.ts
│  ├──generateTrees
│  │  ├──buildGraph
│  │  │  ├──findSharedParent.ts
│  │  │  └──Graph.ts
│  │  ├──findEntryPoints
│  │  │  └──isTestFile.ts
│  │  ├──toFractalTree
│  │  │  └──hasCycle.ts
│  │  ├──buildGraph.ts
│  │  ├──detect-lonely-files.ts
│  │  ├──findEntryPoints.ts
│  │  ├──printTree.ts
│  │  └──toFractalTree.ts
│  ├──getFilePaths
│  │  └──logger.ts <------ ????
│  ├──formatFileStructure.ts
│  ├──generateTrees.ts
│  ├──getFilePaths.ts
│  └──printHelpMessage.ts
└──index.ts
DEBUG: +81ms generated tree(s):
  [
    {
      parentFolder: '/mnt/c/Users/lucet/destiny/src',
      tree: {
        'index.ts': 'index.ts',
        'index/getFilePaths.ts': 'index/getFilePaths.ts',
        'shared/logger.ts': 'index/getFilePaths/logger.ts', <------ ????
        'index/formatFileStructure.ts': 'index/formatFileStructure.ts',
        'index/formatFileStructure/moveFiles.ts': 'index/formatFileStructure/moveFiles.ts',
        'index/formatFileStructure/removeEmptyFolders.ts': 'index/formatFileStructure/removeEmptyFolders.ts',
        'index/formatFileStructure/fixImports.ts': 'index/formatFileStructure/fixImports.ts',
        'index/shared/findImports.ts': 'index/formatFileStructure/fixImports/findImports.ts',
        'index/formatFileStructure/fixImports/makeImportPath.ts': 'index/formatFileStructure/fixImports/makeImportPath.ts',
        'index/shared/customResolve.ts': 'index/formatFileStructure/fixImports/customResolve.ts',
        'index/shared/RootOption.ts': 'index/formatFileStructure/fixImports/RootOption.ts',
        'index/generateTrees.ts': 'index/generateTrees.ts',
        'index/generateTrees/printTree.ts': 'index/generateTrees/printTree.ts',
        'index/generateTrees/buildGraph.ts': 'index/generateTrees/buildGraph.ts',
        'index/generateTrees/shared/Graph.ts': 'index/generateTrees/buildGraph/Graph.ts',
        'index/generateTrees/shared/findSharedParent.ts': 'index/generateTrees/buildGraph/findSharedParent.ts',
        'index/generateTrees/findEntryPoints.ts': 'index/generateTrees/findEntryPoints.ts',
        'index/generateTrees/shared/isTestFile.ts': 'index/generateTrees/findEntryPoints/isTestFile.ts',
        'index/generateTrees/toFractalTree.ts': 'index/generateTrees/toFractalTree.ts',
        'index/generateTrees/toFractalTree/hasCycle.ts': 'index/generateTrees/toFractalTree/hasCycle.ts',
        'index/shared/detect-lonely-files.ts': 'index/generateTrees/detect-lonely-files.ts',
        'index/printHelpMessage.ts': 'index/printHelpMessage.ts'
      },
      useForwardSlash: true
    }
  ]

logger.ts is misplaced. It's the only one I saw, but there may be more...

@AnatoleLucet AnatoleLucet added bug Something isn't working important Important issue labels May 23, 2020
@Ryan-Florida
Copy link
Contributor

@AnatoleLucet This seems to be a side effect of the circular dependency caused by the import { Config } from "../index"; line in generateTrees.ts. I do not know if the circular dependency is there intentionally so -- I see there is some logic/testing surrounding circular dependencies -- but I see two different paths forward depending on whether or not the circular dependency is intentional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working important Important issue
Projects
None yet
Development

No branches or pull requests

2 participants