GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow `vp config` to install hooks without forcing `vp staged` · Issue #2252 · voidzero-dev/vite-plus

Allow vp config to install hooks without forcing vp staged #2252

New issue
Copy link
New issue
Copy link
Closed
Feature
#2280
Closed
Allow vp config to install hooks without forcing vp staged#2252
Feature
#2280
Copy link
Assignees
TheAlexLichter
Labels
enhancementNew feature or request
Milestone
RC

Description

@Perdolique
Perdolique
opened on Jul 25, 2026
Issue body actions

Describe the bug

I want Vite+ to install the Git hook dispatcher while keeping a custom pre-commit hook that runs whole-project checks. For example:

vp run lint
vp exec tsc --noEmit

Currently, vp config appends vp staged to the existing hook and adds a staged block to vite.config.ts.

--no-hooks does not cover this use case because it also skips dispatcher installation, so the setup is not reproducible on a fresh clone.

Reproduction

Not required

Steps to reproduce

No response

System Info

Tool Paths:
  node  /Users/user/.vite-plus/js_runtime/node/26.5.0/bin/node
  npm   /Users/user/.vite-plus/js_runtime/node/26.5.0/bin/npm
  npx   /Users/user/.vite-plus/js_runtime/node/26.5.0/bin/npx

Package Manager:
  Name          pnpm
  Version       11.17.0
  Source        packageManager
  Source Path   /Users/user/src/user/repo/package.json
  Project Root  /Users/user/src/user/repo
  Bin Path      /Users/user/.vite-plus/package_manager/pnpm/11.17.0/pnpm/bin/pnpm

vp v0.2.6

Local vite-plus:
  vite-plus  v0.2.6

Tools:
  vite             v8.1.5
  rolldown         v1.2.0
  vitest           v4.1.10
  oxfmt            v0.60.0
  oxlint           v1.75.0
  oxlint-tsgolint  v7.0.2001
  tsdown           v0.22.13

Environment:
  Package manager  pnpm v11.17.0
  Node.js          v26.5.0 (.node-version)

Used Package Manager

pnpm

Logs

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue for the same bug.
  • Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
  • The provided reproduction is a minimal reproducible example.

Activity

  1. Perdolique
    added
    pending triage
    on Jul 25, 2026
  2. Perdolique
    added the
    Bug
    issue type on Jul 25, 2026
  3. liangmiQwQ commented on Jul 27, 2026

    @liangmiQwQ
    liangmiQwQ
    on Jul 27, 2026
    Collaborator
    More actions

    Hello!

    At the present, vp config forces the hooks must include vp staged. That said, you can still modify your <project-root>/.vite-hooks/pre-commit to add other commands.

    Like

    vp staged
    vp run lint
    vp exec tsc --noEmit

    It is just a small .includes('vp staged') string match, so there is a small workaround if you don't really want to use vp staged

    # vp staged
    vp run lint
    vp exec tsc --noEmit

    Considering the current vp config's behavior is documented and expected. I will treat it as a feature request :), and I think it is worth supporting!

  4. liangmiQwQ
    changed the issue type from
    Bug
    to
    Feature
    on Jul 27, 2026
  5. Perdolique commented on Jul 27, 2026

    @Perdolique
    Perdolique
    on Jul 27, 2026
    Author
    More actions

    @liangmiQwQ, I still consider it a bug. I don't want to use "staged" at all, only commands in the hooks, similar to husky, but vp config is forcing it:

    The config (or lacking of a config file at all)

    export default defineConfig({});
    

    becomes

    export default defineConfig({
      staged: {
        "*": "vp check --fix"
      }
    });
    

    every time a new user clones the repo. This section should be optional. At the moment, it's a blocker for migration from husky.


    As a workaround, I did:

    export default defineConfig({
      staged: {
        '*': (): string[] => []
      }
    })
    

    But it looks like an unnecessary crutch, to be honest 🤔.

  6. liangmiQwQ commented on Jul 27, 2026

    @liangmiQwQ
    liangmiQwQ
    on Jul 27, 2026
    Collaborator
    More actions

    cc @TheAlexLichter

  7. liangmiQwQ commented on Jul 27, 2026

    @liangmiQwQ
    liangmiQwQ
    on Jul 27, 2026
    Collaborator
    More actions

    every time a new user clones the repo.

    Cloning repo itself shouldn't trigger git hooks. Maybe you mean vp install?


    As a workaround, I did:

    export default defineConfig({
      staged: {
        '*': (): string[] => []
      }
    })
    

    @Perdolique Maybe you can try leave an empty object for staged, like staged: {}.

  8. Perdolique commented on Jul 27, 2026

    @Perdolique
    Perdolique
    on Jul 27, 2026
    Author
    More actions

    Yes, vp install, which one is triggering prepare. It looks like the empty staged also works. For some reason, the absence of this option generates a new rule on vp install right after a fresh clone, even if the config file exists.

  9. TheAlexLichter commented on Jul 27, 2026

    @TheAlexLichter
    TheAlexLichter
    on Jul 27, 2026
    Member
    More actions

    How about this:

    • vp config should only install and refresh the generated hook dispatcher under .vite-hooks/_. It should not modify hooks such as .vite-hooks/pre-commit and does not write to vite.config.ts.
    • Top-level .vite-hooks/* scripts are project-owned and live in the repo (committed), while .vite-hooks/_/* stays ignored and is recreated after installation
    • vp create can continue scaffolding a default vp staged pre-commit hook and staged configuration when the user opts into that workflow
    • vp migrate should preserve or translate existing behavior (e.g. from husky) and only introduce defaults when there is no existing hook policy

    That would allow custom hooks without requiring an empty staged configuration or a new opt-out flag.

    Reacted by Liang
  10. Perdolique commented on Jul 27, 2026

    @Perdolique
    Perdolique
    on Jul 27, 2026
    Author
    More actions

    @TheAlexLichter, yes. It sounds exactly like how husky works right now. Currently, I have a config just for an empty staged: {} as a workaround for hooks.

    Reacted by Alexander Lichter
  11. liangmiQwQ
    added
    enhancementNew feature or request
    and removed
    pending triage
    on Jul 27, 2026
  12. TheAlexLichter
    self-assigned this
    on Jul 28, 2026
  13. fengmk2
    added this to the RC milestone on Aug 4, 2026
  14. fengmk2
    added a commit that references this issue on Aug 4, 2026

    fix(cli): preserve project-owned git hooks (#2280)

    This issue will close once commit cfb59b2 is merged into the 'main' branch.
    cfb59b2
  15. fengmk2
    closed this as completedin #2280on Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @TheAlexLichter
    TheAlexLichter

Labels

enhancementNew feature or request

Type

Feature

Fields

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

    Milestone

    • RC

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.