npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@treenwang/gitkit-ui

v0.1.3

Published

React hooks and components for @treenwang/gitkit. Styled with shadcn semantic tokens; ships no CSS.

Readme

@treenwang/gitkit-ui

React hooks and components for @treenwang/gitkit. No editor, no diff viewer, and no bundled CSS.

@treenwang/gitkit-ui/hooks        the logic, on TanStack Query
@treenwang/gitkit-ui/components   the components, on the hooks

Import only the hooks and the component code stays out of your bundle.

Install and theming

// peerDependencies
"react": "^18 || ^19", "@tanstack/react-query": "^5",
// optional peers: used when installed, otherwise the components fall back to plain elements
"radix-ui": "^1", "lucide-react": "*"

The components use shadcn's semantic token classes only - bg-background, text-muted-foreground, border-border and the rest - so they follow your theme automatically, dark mode included. The price is that Tailwind v4 has to scan this package's build output:

@source "../node_modules/@treenwang/gitkit-ui/dist";

Forgetting that line leaves the components completely unstyled with no error at all, so in development the package warns when it cannot find --background.

Usage

import { QueryClientProvider } from '@tanstack/react-query'
import { createClient } from '@treenwang/gitkit-client'
import { GitkitProvider, FileTree, FileEditor, ChangeList, DiffView, CommitPanel, SyncStatus }
  from '@treenwang/gitkit-ui/components'

const client = createClient({ baseUrl: '/api/admin/skills/git' })

<QueryClientProvider client={qc}>
  <GitkitProvider client={client} sessionId={sessionId} components={{ Button, Badge }}>
    <SyncStatus ref="origin/main" />
    <FileTree selected={path} onSelect={setPath} />

    {/* The editor itself is yours - this package is only the shell */}
    <FileEditor path={path}>
      {({ content, onChange }) => <YourLexicalEditor value={content} onChange={onChange} />}
    </FileEditor>

    <ChangeList onSelect={setPath} />
    <DiffView path={path} />
    <CommitPanel base="main" />
  </GitkitProvider>
</QueryClientProvider>

Pass your own shadcn components through components to take the appearance over completely; leave it out and you get plain elements carrying the right token classes.

Autosave

Edits made through useFile and FileEditor land in the server's workspace on their own. The workspace is the single source of truth, so switching devices, reloading the page or restarting the process all pick up where you left off.

| Trigger | When | | --- | --- | | Debounced save | 800ms after typing stops | | Forced save | At least once every 5s while typing continues | | Immediate save | save(); called when switching files and on blur | | Page hidden | Rescued with keepalive on visibilitychange |

Saves carry an etag optimistic lock. When the file changes while you are editing it - another tab, or a pull - the write is refused rather than silently overwriting, and staleConflict offers three ways out:

const f = useFile(path)
if (f.staleConflict) {
  f.overwriteRemote()   // keep mine
  f.discardLocal()      // take the server's version and drop mine
  // or render staleConflict.localContent against serverContent yourself
}

The diff renderer is replaceable

The built-in unified diff rendering has no dependencies. Swap it for something better if you want to - this package does not make that decision for your bundle:

<DiffView path={path} renderDiff={(patch) => <YourMonacoDiff patch={patch} />} />

Hooks

useSessionStatus · useFileTree · useFile · useChanges · useDiff · useCommit · usePush · usePull · useCreateFile · useDeleteFile · useConflicts · useResolveConflicts · useAbortMerge

License

MIT