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

(feat): cli caches api dependencies #4201

Merged
merged 3 commits into from
Aug 6, 2024
Merged

Conversation

dsinghvi
Copy link
Member

@dsinghvi dsinghvi commented Aug 5, 2024

Rather than reoloading dependencies again and again, they are now cached in the ~/.fern folder as well as the LazyFernWorkspace.

@dsinghvi dsinghvi marked this pull request as ready for review August 5, 2024 11:06
@dsinghvi dsinghvi requested a review from armandobelardo August 5, 2024 11:07
Copy link
Contributor

@armandobelardo armandobelardo left a 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";
Copy link
Contributor

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());
Copy link
Contributor

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

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants