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 🙏

© 2025 – Pkg Stats / Ryan Hefner

storecraft-framework

v1.0.2

Published

A powerful Next.js framework for building Shopify headless stores with WordPress-like theme management

Readme

StoreCraft Framework

A powerful Next.js framework for building Shopify headless stores with WordPress-like theme management.

Features

  • 🛍️ Complete Shopify Integration: Products, collections, cart, customer accounts
  • 🎨 Powerful Theme System: Easy theme switching and customization without touching core code
  • 📱 PWA Ready: Progressive Web App capabilities out of the box
  • Next.js 15: Built on the latest Next.js with App Router
  • 🔧 TypeScript: Full TypeScript support
  • 💳 Shopify Checkout: Seamless checkout integration
  • 🔒 Core Protection: Users can't modify framework core, only extend via themes

Quick Start

npx create-storecraft-app my-store
cd my-store
cp .env.example .env.local
# Add your Shopify credentials to .env.local
npm install
npm run dev

How It Works

This framework uses a theme-first routing system where:

  1. Theme files take priority: If a page exists in your active theme, it will be used
  2. Core fallback: If no theme file exists, the framework uses the core implementation
  3. No core modification: You cannot modify core files, only override them via themes
  4. Dynamic theme switching: Switch themes without restarting the application

Architecture

your-project/
├── themes/                    # 👤 User themes (customizable)
│   ├── default/
│   │   ├── pages/            # Custom page overrides
│   │   ├── components/       # Custom components
│   │   └── styles/           # Custom styles
│   └── my-custom-theme/
│       └── ...
├── node_modules/
│   └── storecraft-framework/
│       └── core/             # 🔒 Framework core (protected)
│           ├── app/          # Core Next.js pages
│           ├── components/   # Core components
│           ├── lib/          # Core utilities
│           └── hooks/        # Core hooks
└── theme.config.json         # Theme configuration

Theme System

Creating a Theme

# Create a new theme directory
mkdir themes/my-theme

# Create theme structure
mkdir themes/my-theme/{pages,components,styles,assets}

# Switch to your theme
npm run theme:switch my-theme

Overriding Core Pages

Create any file in your theme to override the core implementation:

// themes/my-theme/pages/index.tsx
export default function HomePage() {
  return (
    <div>
      <h1>My Custom Homepage</h1>
      {/* Your custom implementation */}
    </div>
  );
}

Available Core Routes to Override

  • pages/index.tsx - Homepage
  • pages/products/[handle].tsx - Product pages
  • pages/collections/[handle].tsx - Collection pages
  • pages/cart.tsx - Cart page
  • pages/search.tsx - Search page
  • pages/account/ - Account pages
  • pages/login.tsx - Login page
  • And more...

Using Core Components in Themes

// Import core components in your theme files
import { ProductGrid } from 'shopify-headless-framework/core/components/product/ProductGrid';
import { Header } from 'shopify-headless-framework/core/components/layout/Header';

export default function MyCustomPage() {
  return (
    <div>
      <Header />
      <ProductGrid products={products} />
    </div>
  );
}

Core Framework Features

The framework core provides:

Components

  • Product Components: ProductCard, ProductGrid, ProductForm, ProductGallery
  • Cart Components: CartDrawer, CartLineItem, CartSummary
  • Layout Components: Header, Footer, Breadcrumbs
  • UI Components: Button, Input
  • SEO Components: JsonLd

Hooks

  • useAuth: Customer authentication management
  • useCart: Shopping cart state management

Stores (Zustand)

  • authStore: Global authentication state
  • cartStore: Global cart state

Shopify Integration

  • Complete Storefront API: Products, collections, cart, customers
  • GraphQL Client: Optimized queries and mutations
  • Error Handling: Retry logic and rate limiting
  • TypeScript Types: Full type definitions

Environment Variables

# Required: Shopify Store Configuration
NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=your-store.myshopify.com
NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=your-storefront-access-token

# Optional: Custom domain
NEXT_PUBLIC_SITE_URL=https://your-domain.com

Theme Commands

# Switch active theme
npm run theme:switch theme-name

# List available themes
ls themes/

# Create new theme (manual)
mkdir themes/new-theme
mkdir themes/new-theme/{pages,components,styles,assets}

Development

Framework Development

# Clone the framework
git clone <framework-repo>
cd shopify-headless-framework

# Install dependencies
npm install

# Build the framework
npm run build

# Link for local development
npm link

Using Local Framework

# In your project
npm link shopify-headless-framework

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Make changes to core framework only
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support