-
Notifications
You must be signed in to change notification settings - Fork 152
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
chore(cli): Add @fern-api/source-resolver #5295
Conversation
context, | ||
fdrApiDefinitionId, | ||
includeOptionalRequestPropertyExamples, | ||
sourceResolver = new NopSourceResolver() |
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.
@dsinghvi this will be fixed before merge - if everything else look good I'll make this a required property so that every caller needs to explicitly pass it in themselves. It's otherwise too easy for us to miss it.
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.
Changed to a required property in this commit.
@amckinney is it easy to nest |
@dsinghvi sounds great to me! I'll handle this in a follow up commit so that the other PRs branched off this one don't need to be rebased. |
Overview
This adds the new
@fern-api/source-resolver
and@fern-api/cli-source-resolver
packages which are primarily used in the@fern-api/ir-generator
.Rationale
The primary
SourceResolver
implementation requires access to the filesystem, so we abstract this interface away in a separate package, and require it as input togenerateIntermediateRepresentation
.The implementation defined in
@fern-api/cli-source-resolver
is explicitly provided in every node-compatible call-site (e.g. the CLI), whereas browser-compatible callers can provide theNopSourceResolver
, and can still receive valid IR output.With this, the
@fern-api/ir-generator
no longer depends onfs/promises
.