Skip to content

Update index.tsHere’s a clean PR message you can use:#41

Open
ThomasHumper wants to merge 1 commit into
TheDeveloperDen:masterfrom
ThomasHumper:patch-1
Open

Update index.tsHere’s a clean PR message you can use:#41
ThomasHumper wants to merge 1 commit into
TheDeveloperDen:masterfrom
ThomasHumper:patch-1

Conversation

@ThomasHumper
Copy link
Copy Markdown

Here’s a clean PR message you can use:


Fix schema generation script and improve Zod + runtime compatibility

Summary

This PR fixes several runtime and type issues in the schema generation script and improves compatibility between Node.js, Zod, and JSON schema output generation.

Changes

  • Fix __dirname usage in ESM by replacing it with fileURLToPath(import.meta.url)
  • Replace invalid z.url() with z.string().url()
  • Replace unsupported z.toJSONSchema with zod-to-json-schema
  • Fix incorrect use of Bun.argv → replaced with process.argv
  • Remove invalid .describe() usage on discriminated union branch object
  • Improve typing of dynamic schema variable (z.ZodTypeAny)
  • Fix unsafe enum construction for EntityTagEnum
  • Clean up schema definitions for consistency and correctness
  • Improve CLI error handling and messages
  • Standardize JSON schema output generation

Impact

  • Script now runs correctly in Node ESM environments
  • Schema generation is stable and deterministic
  • Fixes runtime crashes caused by missing or invalid Zod APIs
  • Improves maintainability of metadata/resource schema system

Notes

This change aligns the project with standard Zod + Node.js ESM usage patterns and removes reliance on non-standard APIs.


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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant