-
Notifications
You must be signed in to change notification settings - Fork 159
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
(feat): cli caches api dependencies #4201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Only question really is: do we need some sort of clean up mechanism? I might've missed this, but maybe in loadDependency if you're on a different version than what's on disk the cli can clear the dir?
@@ -1,14 +1,17 @@ | |||
import { dependenciesYml } from "@fern-api/configuration"; | |||
import { VersionedDependency } from "@fern-api/configuration/src/dependencies-yml"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mega nit - looks like this might not be exported from the top level index.ts
metadata = response.body; | ||
await writeFile(pathToMetadata, JSON.stringify(metadata)); | ||
} else { | ||
metadata = JSON.parse((await readFile(pathToMetadata)).toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any validation, similar to the above that needs to be done after reading in the dir? I'd imagine no since it's version specific, so should be used immediately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup no validation needs to be done
Rather than reoloading dependencies again and again, they are now cached in the
~/.fern
folder as well as theLazyFernWorkspace
.