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

next-safe-action-query

v1.1.1

Published

Type-safe server actions with built-in validation for Next.js

Readme

next-safe-action-query

Type-safe server actions with built-in validation for Next.js

Features

  • 🔄 Dual Package: Supports both ESM and CommonJS
  • 📦 Zero Config: Works out of the box with Next.js
  • 🛡️ Type Safe: Full TypeScript support with proper type exports
  • 🔧 pnpm: Optimized for pnpm package manager
  • 📝 Changesets: Automated versioning and changelog generation
  • 🔒 Fixed Versions: Enforced exact dependency versions with syncpack

Installation

npm install next-safe-action-query
# or
pnpm add next-safe-action-query
# or
yarn add next-safe-action-query

Usage

ESM (ES Modules)

import { createSafeAction, type ActionResult } from 'next-safe-action-query';

const result = await createSafeAction(async () => {
  return { message: 'Hello, World!' };
});

CommonJS

const { createSafeAction } = require('next-safe-action-query');

const result = await createSafeAction(async () => {
  return { message: 'Hello, World!' };
});

Development

Prerequisites

  • Node.js 18+
  • pnpm 8+

Setup

# Install dependencies
pnpm install

# Build the package
pnpm build

# Check dependency consistency
pnpm lint:deps

# Fix dependency issues
pnpm fix:deps

Build System

This package uses a modern dual-build system:

  • ESM: Built to dist/esm/ with native ES modules
  • CJS: Built to dist/cjs/ with CommonJS format
  • Types: TypeScript declarations in dist/types/

Scripts

  • pnpm build - Build all formats (ESM, CJS, and types)
  • pnpm clean - Remove build artifacts
  • pnpm changeset - Add a changeset for versioning
  • pnpm version - Update versions based on changesets
  • pnpm release - Build and publish to npm
  • pnpm lint:deps - Check dependency consistency
  • pnpm fix:deps - Fix dependency version mismatches

Version Management

This project uses Changesets for version management:

  1. Make changes to the codebase
  2. Add a changeset: pnpm changeset
  3. Commit the changeset with your changes
  4. Release when ready: pnpm version && pnpm release

Dependency Management

Syncpack ensures all dependencies use exact versions:

  • All package versions are pinned (no ^ or ~ ranges)
  • Consistent formatting across all package.json files
  • Automatic detection and fixing of version mismatches

Package Structure

next-safe-action-query/
├── src/                   # TypeScript source files
├── dist/                  # Build output (gitignored)
│   ├── esm/              # ES Modules build
│   ├── cjs/              # CommonJS build
│   └── types/            # TypeScript declarations
├── .changeset/           # Changeset configuration
├── build.js              # Build script
├── tsconfig.json         # TypeScript config
├── tsconfig.build.json   # Build-specific TS config
├── .syncpackrc.json      # Syncpack configuration
└── package.json          # Package configuration

Configuration Files

TypeScript Config (tsconfig.json)

  • Uses NodeNext module resolution for modern Node.js compatibility
  • Strict type checking enabled
  • Configured for optimal library development

Build Config (tsconfig.build.json)

  • Extends main config
  • Generates only type declarations
  • Excludes test files

Syncpack Config (.syncpackrc.json)

  • Enforces exact versions (no semver ranges)
  • Maintains consistent package.json formatting
  • Ensures reproducible builds

Changesets Config (.changeset/config.json)

  • Configured for public npm publishing
  • Automatic changelog generation
  • Semantic versioning support

Publishing

This package is configured for automated publishing:

  1. Manual: Use pnpm release
  2. CI/CD: Set up GitHub Actions with changesets action

License

MIT

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add a changeset: pnpm changeset
  5. Submit a pull request

Built with ❤️ using modern TypeScript tooling