PR #4640 fixed the issue reported in #4639, but sadly this was only part of the solution as the IR JSON is also read and parsed by the generators, causing similar issues as those reported in #4639.
This PR introduces a new function streamObjectFromFile to the fs-utils package. The function reads a JSON file and returns a Promise that resolves to the parsed JSON object.
Changes
Added a new function streamObjectFromFile to the fs-utils package.
The function reads a JSON file and returns a Promise that resolves to the parsed JSON object.
The function uses the createReadStream function from the fs module to create a read stream for the file.
The StreamObject class from the stream-json module is used to parse the JSON data.
The stream-json package is added to the dependencies of the fs-utils package.
The @types/stream-json package is added to the devDependencies of the fs-utils package.
The stream-json package is added to the dependencies of the cli package.
The @types/stream-json package is added to the dependencies of the cli package.
PR #4640 fixed the issue reported in #4639, but sadly this was only part of the solution as the IR JSON is also read and parsed by the generators, causing similar issues as those reported in #4639.
For more context, see: https://github.com/fern-api/fern/pull/4640#issuecomment-2350992867.
This PR introduces a new function
streamObjectFromFile
to thefs-utils
package. The function reads a JSON file and returns a Promise that resolves to the parsed JSON object.Changes
streamObjectFromFile
to thefs-utils
package.createReadStream
function from thefs
module to create a read stream for the file.StreamObject
class from thestream-json
module is used to parse the JSON data.stream-json
package is added to the dependencies of thefs-utils
package.@types/stream-json
package is added to the devDependencies of thefs-utils
package.stream-json
package is added to the dependencies of thecli
package.@types/stream-json
package is added to the dependencies of thecli
package.