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

create-devtype-toolkit

v1.0.2

Published

Create a new React project with Vite, TypeScript, TDD, shadcn/ui, and TanStack Query

Readme

@toolkit/template

A fully configured React + Vite template with TDD, clean code, and mobile-first design.

Getting Started

Setup

npm install
npm run dev

Visit http://localhost:5173

Scripts

npm run dev              # Start dev server
npm run build            # Build for production
npm run preview          # Preview production build
npm run test             # Run tests once
npm run test:watch       # Run tests in watch mode
npm run lint             # Run ESLint
npm run type-check       # Check TypeScript

What's Pre-Configured

Vite - Lightning-fast dev server with HMR ✅ React 19.2 - Latest React with hooks ✅ TypeScript - Full type safety with strict mode ✅ Tailwind CSS 4.2 - Utility-first CSS with @/ path alias ✅ Shadcn/ui - Accessible component library (5 base components) ✅ TanStack Query - Server state management with React Query ✅ Axios - HTTP client with interceptors ✅ Zustand - Global state management (auth, ui) ✅ React Hook Form - Performant form handling ✅ Zod - Schema validation ✅ ESLint - Code quality ✅ Jest - Testing framework ✅ i18n - Internationalization (pt, en)

Project Structure

src/
├── features/
│   └── shared/
│       ├── components/ui/       # Shadcn base components
│       ├── hooks/               # Reusable hooks (useSearch, useDebounce, etc)
│       ├── services/api/        # apiClient, endpoints, queryClient
│       └── store/               # Zustand stores (authStore, uiStore)
├── pages/                       # Generic pages
├── routes/index.tsx             # Route configuration
├── i18n/locales/                # Translations
├── styles/globals.css           # Global styles
├── App.tsx
└── main.tsx

Creating Features

Use the CLI to scaffold new features:

npx @toolkit/cli create-feature domain/subdomain/featureName

Example:

npx @toolkit/cli create-feature admin/financial/contracts

This creates a complete feature with:

  • TypeScript types + Zod schemas
  • React Query services
  • Custom form hook with React Hook Form
  • Components (form, card, list)
  • Integration tests

Conventions

See root CLAUDE.md for detailed conventions:

  • TDD: Write tests before code
  • Logic-Presentation Separation: Logic in hooks, UI in components
  • Clean Code: No comments, self-explanatory naming
  • Mobile-First: Design for small screens first
  • Reusability: Extract duplicated logic to hooks

API Integration

1. Define Endpoints

// src/features/shared/services/api/endpoints.ts
export const CONTRACT_ENDPOINTS = {
  LIST: '/contracts',
  GET: (id) => `/contracts/${id}`,
  CREATE: '/contracts',
  UPDATE: (id) => `/contracts/${id}`,
  DELETE: (id) => `/contracts/${id}`,
};

2. Create Service Hooks

// src/features/admin/financial/contracts/contract.services.ts
import { useQuery, useMutation } from '@tanstack/react-query';
import { apiClient } from '@/shared/services/api/apiClient';

export const useGetContracts = () =>
  useQuery({
    queryKey: ['contracts'],
    queryFn: () => apiClient.get(CONTRACT_ENDPOINTS.LIST),
  });

3. Use in Hooks

// src/features/admin/financial/contracts/hooks/useContractForm.tsx
export function useContractForm(onSuccess) {
  const { mutate: create } = useCreateContract();
  // Form logic...
}

4. Use in Components

// src/features/admin/financial/contracts/pages/ContractListPage.tsx
export function ContractListPage() {
  const form = useContractForm();
  return <ContractForm {...form} />;
}

Testing

Tests follow TDD: write tests before code.

Run Tests

npm run test              # Single run
npm run test:watch       # Watch mode
npm run test -- --coverage

Test Examples

Hook Test:

describe('useContractForm', () => {
  it('initializes with empty form', () => {
    const { result } = renderHook(() => useContractForm());
    expect(result.current.isValid).toBe(false);
  });
});

Component Test:

describe('ContractForm', () => {
  it('renders form fields', () => {
    render(<ContractForm {...mockProps} />);
    expect(screen.getByLabelText(/title/i)).toBeInTheDocument();
  });
});

Environment Variables

Create .env.local:

VITE_API_URL=http://localhost:3000/api
VITE_APP_NAME=My App

Deployment

Build

npm run build

Output: dist/

Deploy to Vercel

vercel deploy

Deploy to Netlify

Connect repository and Netlify will auto-deploy on push.

Troubleshooting

Port 5173 already in use

npm run dev -- --port 3000

ESLint errors

npx eslint src --fix

TypeScript errors

npm run type-check

Learn More

License

MIT