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

@secundus-studio/stift-generator

v0.4.32

Published

Bundler-agnostic build core: config loading/validation, namespace discovery, Register typegen, pack compiler.

Downloads

849

Readme

@secundus-studio/stift-generator

Bundler-agnostic build core: config loading/validation, namespace discovery, pack compiler, and typegen.

What it is

The shared build engine behind @secundus-studio/stift-cli and @secundus-studio/stift-vite-plugin: config loading and validation (stift.config.ts), locale/namespace discovery, message-shape extraction, the pack compiler (.dat packs plus catalog.json and per-locale shards), and Register typegen (stift.gen.d.ts). Most users meet it through the CLI or the Vite plugin and never install it directly — reach for it when you need the pipeline programmatically (custom scripts, tests, or your own tooling).

pnpm add @secundus-studio/stift-generator

Quick start

import { Generator } from '@secundus-studio/stift-generator'

const generator = new Generator({ root: process.cwd() })

// Load stift.config.ts, discover locales/<locale>/<namespace>.json,
// extract param shapes, diff locales, emit src/stift.gen.d.ts.
await generator.generateAsync()

// Compile every (locale, namespace) into packs + catalog.json + shards.
await generator.compileAsync({ outDir: 'dist/packs' })

stift.config.ts is authored with the defineConfig helper and resolved with loadConfig / findConfigFile.

API

  • Generator — one-shot pipeline: generateAsync() (config → discovery → extraction → diff → stift.gen.d.ts) and compileAsync() (packs + catalog + shards, written to outDir or returned in memory).
  • DEFAULT_OUTPUT_REL — default relative output path for the generated declaration file.
  • compileAll — compile every (locale, namespace) source into pack bytes, the catalog index, and one shard per locale.
  • compileNamespace — compile a single namespace message map into pack bytes.
  • resolveCompileSecurity — resolve the effective compiler security config from a loaded config (with static-key fallback).
  • loadConfig / findConfigFile — resolve and schema-validate stift.config.ts.
  • defineConfig — typed helper for authoring stift.config.ts.
  • discoverConvention — walk locales/<locale>/<namespace>.json (nested namespaces supported) into a stable discovery result.
  • generateTypegen — emit the stift.gen.d.ts Register declaration from config plus extraction.
  • extractShapes / deriveLocaleShape — infer union-across-locale param shapes from message sources.
  • diffLocales — diff key coverage across supported locales against the default locale.
  • parseMessage / collectFunctions — ICU message parsing and function collection (re-exported from core).
  • configSchema — schema the loaded config is validated against.
  • Type-only: GenerateOptions, GenerateResult, CompileOptions, CompileResult, CompileAllOptions, CompileAllResult, CompileNamespaceOptions, CompiledNamespaceOutput, CompiledNamespaceCacheEntry, CompiledCache, LocaleShardOutput, CompileSecurityConfig, StiftConfig, ParamsConfig, ContextParamConfig, NamespacesConfig, DetectionConfig, LoadConfigOptions, LoadedConfig, DiscoveredNamespace, DiscoveryResult, ExtractResult, KeyShape, KeyLocaleShape, MessageSourceInput, ParamType, DiffResult, MissingDiffIssue, GenerateTypegenOptions, IcuNode, IcuOption, ParseResult.

Docs

  • Config file: https://stift.secundus.studio/docs/latest/vanilla/configuration/config-file
  • Build pipeline: https://stift.secundus.studio/docs/latest/vanilla/tooling/build
  • Authoring messages: https://stift.secundus.studio/docs/latest/vanilla/authoring/messages