feat: Add .fern.metadata.json to generated SDK outputs #9887
+103
−76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Linear ticket: [internal] Add config artifacts to generated SDK outputs
Implements a feature to include configuration metadata in all generated SDK outputs. A
.fern.metadata.jsonfile is now automatically added to the root of generated SDK directories, containing CLI version, generator information, and configuration settings. This metadata will help with debugging and support by providing context about the generation environment.Session URL: https://app.devin.ai/sessions/91a220a4ee9f40e7a9b3a73c0685a542
Requested by: [email protected] (@jsklan)
Changes Made
.fern.metadata.jsongeneration to both local and remote SDK generation pipelineswriteFernMetadata()function inlocal-workspace-runner/src/runGenerator.tsfor local generationwriteFernMetadata()function inremote-workspace-runner/src/RemoteTaskHandler.tsfor remote generationjs-yamldependency to package.json but it's not used in final implementation - should be removedMetadata Schema
{ "cliVersion": "0.92.0", "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "3.8.10", "generatorsYml": { "config": { /* generator-specific config */ } } }Testing
.fern.metadata.jsonfile is created in output directoryprocess.env.CLI_VERSION)Review Checklist
js-yamland@types/js-yamldependencies frompackages/cli/generation/local-generation/local-workspace-runner/package.jsonprocess.env.CLI_VERSIONis properly set in production CLI builds (not just "unknown").fern.metadata.jsonis an appropriate filename and location (root of output directory)path.join) and remote (uses@fern-api/fs-utilsjoin) - both work but differ in style