Skip to content

Add TypeScript Renderer #10

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

Merged
merged 23 commits into from
Jun 5, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add prompt
  • Loading branch information
osolmaz committed May 21, 2025
commit 628dbbad6e5c3e84b4c4bf63e71e2db21f1b4883
21 changes: 21 additions & 0 deletions docs/2025-05-21-json-doc-ts-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Implementing JSON-DOC TypeScript parser"
author: "Onur <onur@textcortex.com>"
date: "2025-05-21"
---

A lot of coding agent products went into production recently, such as OpenAI Codex, Google Jules, Claude Code, etc. The TypeScript implementation is an ideal task, thanks to existing tests.

Below is the prompt:

```
Convert JSON Schemas into TS interfaces similar to what is in Python with datamodel-codegen. See https://github.com/bcherny/json-schema-to-typescript and https://github.com/ThomasAribart/json-schema-to-ts. Compare the two and choose the best option.

The interfaces MUST BE generated programmatically, just as how we do in Python. Understand the directory structure first, list, navigate and read files. Look at the json schema files under /schema, and compare them with the generated files in the python directory

We basically need to implement parsing of a JSON-DOC file into typed objects in typescript, similar to Python load_jsondoc() and similar functions

Note that we use uv for running python. There are example json-doc files and tests under /tests and github actions that make sure that the parsing and validation logic in python is correct

For a correct ts implementation, similar tests and checks need to be implemented. Make sure to use up-to-date typescript tooling and conventions. This library is supposed to be installed universally, keep that in mind. Do not use obscure or non-general tooling for packaging and distribution. Follow today's best practices
```
Loading