Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Oct 16, 2025

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.json file 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

  • Added .fern.metadata.json generation to both local and remote SDK generation pipelines
  • Implemented writeFernMetadata() function in local-workspace-runner/src/runGenerator.ts for local generation
  • Implemented writeFernMetadata() function in remote-workspace-runner/src/RemoteTaskHandler.ts for remote generation
  • Metadata includes: CLI version, generator name, generator version, and generators.yml config settings
  • ⚠️ Added js-yaml dependency to package.json but it's not used in final implementation - should be removed

Metadata Schema

{
  "cliVersion": "0.92.0",
  "generatorName": "fernapi/fern-typescript-sdk",
  "generatorVersion": "3.8.10",
  "generatorsYml": {
    "config": { /* generator-specific config */ }
  }
}

Testing

  • Manual testing with seed tool using imdb fixture for local generation
  • Verified .fern.metadata.json file is created in output directory
  • Remote generation not fully tested (requires Fiddle service)
  • CLI version correctness needs verification in production (currently reads from process.env.CLI_VERSION)

Review Checklist

  • CRITICAL: Remove unused js-yaml and @types/js-yaml dependencies from packages/cli/generation/local-generation/local-workspace-runner/package.json
  • Verify that process.env.CLI_VERSION is properly set in production CLI builds (not just "unknown")
  • Confirm .fern.metadata.json is an appropriate filename and location (root of output directory)
  • Review metadata schema - is the structure appropriate for the intended use case?
  • Note the inconsistent path handling between local (uses path.join) and remote (uses @fern-api/fs-utils join) - both work but differ in style

This commit implements a feature to include configuration metadata in
all generated SDK outputs. The metadata file (.fern.metadata.json) is
automatically created during the generation process and includes:

- CLI version (from versions.yml)
- Generator name and version
- generators.yml configuration settings

This addresses the internal ticket requesting better visibility into
the configuration context used for SDK generation, making it easier to
debug issues and understand which versions/configs were used.

The metadata file is written to the output directory after the generator
executes but before files are copied to their final destination, ensuring
it's included in all generated SDK artifacts.

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration bot changed the title Add .fern.metadata.json to generated SDK outputs feat: Add .fern.metadata.json to generated SDK outputs Oct 16, 2025
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.

1 participant