# vite --version / vite -v => vp --version / vp -v (global flags, not dev-specific)
---
id: replace-vite-version
language: bash
rule:
  kind: command_name
  regex: '^vite$'
  inside:
    kind: command
    regex: 'vite\s+(-v|--version)'
fix: vp


# vite => vp dev (handles all cases: with/without env var prefix and flag args)
# Match command_name to preserve env var prefix and arguments
# Excludes subcommands like "vite build", "vite test", etc.
---
id: replace-vite
language: bash
rule:
  kind: command_name
  regex: '^vite$'
  inside:
    kind: command
    not:
      # ignore non-flag arguments (subcommands like build, test, etc.)
      regex: 'vite\s+[^-]'
fix: vp dev


# vite <subcommand> => vp <subcommand> (handles vite build, vite test, vite dev, etc.)
# Match command_name when followed by a subcommand, replace only the command name
---
id: replace-vite-subcommand
language: bash
rule:
  kind: command_name
  regex: '^vite$'
  inside:
    kind: command
    regex: 'vite\s+[^-]'
fix: vp


# oxlint => vp lint (handles all cases: with/without env var prefix and args)
# Match command_name to preserve env var prefix and arguments
---
id: replace-oxlint
language: bash
rule:
  kind: command_name
  regex: '^oxlint$'
fix: vp lint


# oxfmt => vp fmt
---
id: replace-oxfmt
language: bash
rule:
  kind: command_name
  regex: '^oxfmt$'
fix: vp fmt


# vitest => vp test
---
id: replace-vitest
language: bash
rule:
  kind: command_name
  regex: '^vitest$'
fix: vp test


# lint-staged => vp staged
---
id: replace-lint-staged
language: bash
rule:
  kind: command_name
  regex: '^lint-staged$'
fix: vp staged


# tsdown => vp pack
---
id: replace-tsdown
language: bash
rule:
  kind: command_name
  regex: '^tsdown$'
fix: vp pack
