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

@opentf/afw-cli

v1.37.0

Published

Static generation for AFW apps, run as an esdev build step.

Readme

@opentf/afw-cli

Static generation for AFW apps, run as an esdev build step

Static generation guide | Changelog | GitHub

An Open Tech Foundation project

Your project owns its build. This package supplies the pieces a prerender step needs: route and loader discovery, page rendering, API and loader bundles, plus a release hook that writes search indexes, feeds and llms.txt.

{
  "plugins": [
    { "module": "@opentf/esdev-plugin-afw", "options": { "mode": "ssg" } },
    { "module": "@opentf/afw-cli/ssg", "export": "siteOutputPlugin",
      "options": { "target": "web", "prerenderTarget": "site-ssg", "root": "." } }
  ],
  "build": {
    "targets": {
      "web": { "entry": "index.html", "outdir": "dist" },
      "site-ssg": { "entry": "ssg.js", "out": ".ssg/ssg.js", "then": "run" }
    }
  }
}

esdev build bundles the site, then runs ssg.js, which prerenders every route into the staged output. Only when every step succeeds does the new site replace the old one.

[!NOTE] Alpha. The package keeps its historical name; the old afw executable and its dev / build / serve commands are retired in favour of esdev.

Install

pnpm add -D @opentf/afw-cli @opentf/esdev-plugin-afw
pnpm add @opentf/afw

Requires esdev 0.16 or newer. esdev create my-site --template=docs generates a project with the prerender target, ssg.js and the release hook already in place.

The prerender step

ssg.js is a short script you own. It uses this package to:

| Step | Helpers | | --- | --- | | Find pages and loaders under app/ | discoverPages, discoverLoaders, assertNoRouteConflicts | | Read afw.config.js | loadConfig | | Render each route into the shell index.html | runPrerender, stampHydrateSentinel | | Bundle server code for a deploy adapter | emitLoaderBundle, emitApiBundle | | Hand results to the release hook | writePrerenderReport |

Pages with dynamic segments are skipped unless they export getStaticPaths(). The static generation guide walks through a complete ssg.js.

The release hook

siteOutputPlugin runs in the staging area after prerendering and before the site is published:

| Output | Source | | --- | --- | | Search index | afwc docs index over the prerendered HTML | | RSS / Atom feeds | The blog section, when afw.config.js has one | | llms.txt, llms-full.txt | Page titles and descriptions, for LLM context |

| Option | Purpose | | --- | --- | | target | The browser build target to post-process (e.g. "web") | | prerenderTarget | The prerender target that must run first | | root | The site's source folder, relative to the working directory |

The hook never runs under esdev start. If indexing fails, the build fails and the previous deployment stays live.

Environment

| Variable | Effect | | --- | --- | | AFWC_BIN | Use this afwc executable for compilation and indexing | | EXCLUDE_ROUTES | Comma-separated route folders the release hook skips (the starter ssg.js honours it too) |

License

MIT — see LICENSE.