Commands#

@sigx/vite ships a sigx-types CLI that generates TypeScript definitions for components declared with a tag name, so JSX gets intellisense for those tags. It's exposed through the package's bin field, so npx sigx-types runs it from any project that has @sigx/vite installed — no global install needed.

sigx-types#

Scans the project (the current working directory) for components declared with a tag name — component('my-button', ...), including the typed form component<...>('my-button', ...) and export default component('my-button', ...) — and writes two files into the output directory:

  • components.d.ts — augments @sigx/runtime-core's CustomElementRegistry so JSX gets intellisense for tag names like <my-button>.
  • components.ts — nested global runtime objects (for example, ui.button.primary from the tag ui-button-primary).

Add the output directory to your tsconfig include so the editor picks it up.

Usage#

Terminal
pnpm dlx sigx-types [options]

Flags#

FlagAliasDescription
--help-hShow the help message and exit.
--watch-wRe-generate on file changes instead of running once.
--out <dir>-oOutput directory. Default: node_modules/.sigx.
--include <globs>Comma-separated globs to scan. Default: **/*.tsx,**/*.ts,**/*.jsx.
--exclude <globs>Comma-separated globs to skip. Default: node_modules/**,dist/**,**/*.d.ts.

Examples#

Generate once into the default output directory:

Terminal
pnpm dlx sigx-types

Watch for changes:

Terminal
pnpm dlx sigx-types --watch

Use a custom output directory:

Terminal
pnpm dlx sigx-types --out .sigx-types

Restrict the scan to specific globs:

Terminal
pnpm dlx sigx-types --include "src/**/*.tsx,components/**/*.tsx"

Wiring the Output into TypeScript#

After generating, add the output to your tsconfig include so the editor uses the generated definitions:

JSON
// tsconfig.json
{
    "include": ["src", "node_modules/.sigx/**/*.d.ts"]
}

Go-to-definition into source#

Every @sigx/* package ships its TypeScript src/ alongside the compiled dist/, and the .d.ts files carry declaration maps (.d.ts.map) — so "Go to Definition" in your editor lands in the real source, not a .d.ts stub. No configuration is needed; it works as soon as the package is installed.

Next Steps#