Closed ethanjdiamond closed 1 week ago
@jafeltra Do you mind taking a look at this? Thanks!
Hi @ethanjdiamond. We just started a new sprint on Friday and I asked @mint-thompson to take the lead on reviewing this. I expect they will look at it soon! Thank you for the contribution!
Thank you!
Description: The FSH extension was causing pretty bad CPU issues for my team. We work in a monorepo using pnpm workspaces, which means that all our packages, internal and external, are linked using symlinks in node_modules. The "find the fsh files in workspace" step didn't have logic to prevent the same folders from being repeatedly checked for every time they're added as a dependency to another package.
This PR does two things - 1) use realpath in fs, which will resolve symlink paths, and 2) keeps track of all the realpaths that have been visited and do an immediate return if the folder has been visited before. This should fix our issue.
Testing Instructions: It passes the previously existing tests and returns the proper .fsh files.
Related Issue: N/A