Skip to content

feat: extract CLI help from comments#8

Open
kiyo-e wants to merge 1 commit into
mainfrom
codex/add-helper-to-parse-route-comments
Open

feat: extract CLI help from comments#8
kiyo-e wants to merge 1 commit into
mainfrom
codex/add-helper-to-parse-route-comments

Conversation

@kiyo-e
Copy link
Copy Markdown
Owner

@kiyo-e kiyo-e commented Aug 31, 2025

Summary

  • parse @cliParam annotations to generate examples and params
  • merge comment metadata when OpenAPI specs are missing
  • document comment syntax and provide tests

Testing

  • npm run build
  • node --test

https://chatgpt.com/codex/tasks/task_b_68b44a6aa1988325ac6f4cf1852340cf

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment thread src/index.ts
Comment on lines +238 to +244
export function listRoutesWithExamplesFromComments(
files: string[],
cmdBase?: string
): { routes: string[]; examples: string[]; params: OpenApiParam[][] } {
const base = cmdBase ?? detectCommandBase()
const require = createRequire(import.meta.url)
const ts: typeof import('typescript') = require('typescript')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Declare runtime dependency on TypeScript for comment parsing

The new comment parser calls require('typescript') at runtime to inspect source files, but typescript is only listed under devDependencies in package.json. When the package is installed as a dependency (without dev deps), calling listRoutesWithExamplesFromComments or listRoutesWithExamplesFromOpenApi with commentFiles will throw Cannot find module 'typescript', making the new feature unusable for consumers. typescript should be a normal dependency or loading should be made optional.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant