Commands

Timvir comes with a command line tool that eases creation of new React components, pages, and other general maintenance of the files used by the timvir integration.

  • component – Generate a new React component
  • toc – Update the table of contents file
  • link – Link the component documentation files into src/pages/docs
  • capid – Generate component API documentation

Run the commands with npx @timvir/cli <command>.

component

This command will ask you a few questions about what component you want to create, and will then generate a few files inside the src/components/ folder. It will also update the table of contents such that the new component appears in the navigation tree.
















toc

Use this command after you manually edit the toc.timvir files to regenerate the table of contents JavaScript module (src/timvir/toc.ts).






This command creates symlinks in src/pages/docs/components which point to the component documentation and sample files.









capid

This commands generates an MDX file which describes the component API for each of your components. The file is written into src/components/*/docs/api.mdx.