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

@safqi/storefront-core

v1.4.0

Published

Shared, versioned core for Safqi multi-tenant storefront themes: the data/API client, auth, cart, i18n, theme-token engine, the window.appConfig + API type contract, design-free leaf components, and the boot/build glue. Themes depend on this and own only

Readme

@safqi/storefront-core

The shared, versioned core every Safqi storefront theme is built on. It owns the parts that are the same across every theme, so a fix or a new API field ships to all themes with a single version bump instead of an N-repo copy-merge.

What's in the core (behaviour + contract)

  • appConfig reader — the only reader of window.appConfig (getApiUrl, getTheme, isAppInstalled, …).
  • Data / APIfetchProducts, fetchProduct, fetchCategories, fetchBrands, fetchFilters, queryKeys (catalog) and the whole commerce layer (OTP auth, cart, addresses, geo, shipping, payments, orders, downloads, memberships).
  • Auth + cartAuthProvider / useAuth, useCart.
  • i18n + formatting + statust, formatMoney, orderStatusLabel, statusTone.
  • Theme-token engineapplyThemeSettings() (derives the OKLCh accent ramp + font from tenant settings).
  • Icon registryIcon, SolarIcon, ICONS, resolveIcon.
  • Design-free leaf componentsSwiper (Embla-backed slide carousel), SwipeRow, RequireAuth, ErrorState, EmptyState.
  • Boot + build gluebootStorefront() and the defineThemeConfig() Vite preset.
  • CapabilitiesENDPOINTS, PATTERNS, SECTION_TYPES, CORE_VERSION (the single source create-safqi-theme reads to emit each theme's THEME-REFERENCE.md).

A theme owns only its presentation: index.css tokens, chrome (Header/BottomBar/Footer), ProductCard, the pattern engine (src/patterns/*), SectionRenderer + sections/* markup, and pages.

Using it in a theme

// vite.config.ts
import { defineThemeConfig } from "@safqi/storefront-core/vite";
export default defineThemeConfig({ slug: "basic", rootUrl: import.meta.url });
// src/main.tsx
import "./index.css";
import { bootStorefront } from "@safqi/storefront-core";
import { Routes, Route } from "react-router-dom";
// … your pages/layout
bootStorefront({ children: <Routes>{/* your route tree */}</Routes> });
// src/env.d.ts — pull in the ambient window.appConfig contract
/// <reference types="@safqi/storefront-core/global" />

Distribution & versioning

  • Consumed only by Vite/React theme builds. Ships dist/ (ESM + .d.ts) built with tsup.
  • Themes pin a caret range ("@safqi/storefront-core": "^1") and install it from git or a private registry.
  • Upgrade a theme: npm update @safqi/storefront-core && npm run build. Variant themes (zero-build) inherit automatically via their runtime's bundle.
  • CORE_VERSION (in capabilities.ts) is stamped into a theme so drift against the shipped basic core is detectable later.

Develop

bun install
bun run build      # tsup → dist/ (+ copies the ambient global.d.ts)
bun run dev        # watch