feat: extract CLI help from comments#8
Conversation
There was a problem hiding this comment.
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".
| 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') |
There was a problem hiding this comment.
[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 👍 / 👎.
Summary
@cliParamannotations to generate examples and paramsTesting
npm run buildnode --testhttps://chatgpt.com/codex/tasks/task_b_68b44a6aa1988325ac6f4cf1852340cf