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

@fullsnacklab/astro-theme

v0.1.0

Published

Validated YAML site identity, metadata, SEO, and provider-neutral runtime theme loading for Astro.

Readme

@fullsnacklab/astro-theme

Validated YAML site identity, internationalization, metadata, SEO, Open Graph, structured data, and provider-neutral runtime theme loading for Astro.

Install

bun add @fullsnacklab/astro-theme

Create theme.config.yaml at the Astro project root. The package publishes schema.json for editor validation:

# yaml-language-server: $schema=./node_modules/@fullsnacklab/astro-theme/schema.json
schemaVersion: 1
site:
  name: Example
  shortName: Example
  url: https://example.com
  description: An example Astro site.
contact:
  primary: mailto:[email protected]
owner:
  type: organization
  name: Example
  url: https://example.com/about
i18n:
  defaultLocale: en
  locales:
    en:
      label: English
      lang: en-US
seo:
  title:
    default: Example
    pattern: "{title} — {site}"

Add the integration:

import theme from "@fullsnacklab/astro-theme";
import { defineConfig } from "astro/config";

export default defineConfig({
  integrations: [theme()],
});

The integration validates the YAML, watches it during development, and projects build-shaping values into Astro:

  • site.url becomes Astro's site;
  • i18n becomes Astro's locale routing configuration;
  • all validated settings become typed virtual modules.

Virtual modules

Use the client-safe build snapshot from normal Astro components and modules:

import theme from "virtual:fullsnack-theme";

For request-time settings, use the server-only module:

---
import { getTheme } from "virtual:fullsnack-theme/server";
const theme = await getTheme({ request: Astro.request, locals: Astro.locals });
---

The server module caches one loader result per Request. A loader returning null explicitly selects the YAML fallback; loader errors are preserved.

Runtime adapters without provider dependencies

The package defines the seam, while the application owns D1, Emdash, HTTP, authentication, and caching dependencies:

// src/theme-loader.ts
import { defineThemeLoader } from "@fullsnacklab/astro-theme/runtime";

export default defineThemeLoader(async ({ baseline, request }) => {
  const remote = await loadFromYourProvider(request);
  return remote ?? null;
});
// astro.config.mjs
theme({
  runtime: { loader: "./src/theme-loader.ts" },
});

Runtime documents can replace presentation identity, contact, ownership, SEO, Open Graph, metadata, assets, and structured-data policy. They cannot change site.url, schemaVersion, or i18n route topology because Astro consumes those values while building routes and configuration.

Explicit sync and seed

Use a consumer-owned sink for offline YAML → remote synchronization:

import { readThemeConfig } from "@fullsnacklab/astro-theme/schema";
import { defineThemeSink, syncTheme } from "@fullsnacklab/astro-theme/runtime";

const sink = defineThemeSink(async (runtimeTheme) => {
  await saveToYourProvider(runtimeTheme);
});

await syncTheme(await readThemeConfig(new URL("./theme.config.yaml", import.meta.url)), sink);

Synchronization is explicit rather than an integration side effect, so deployments never silently overwrite remote settings.

Helpers and schemas

@fullsnacklab/astro-theme/runtime exports:

  • createPageMetadata() for canonical, robots, Open Graph, and Twitter values;
  • createSiteJsonLd() for a Schema.org WebSite and owner graph;
  • resolveLocalizedText() and formatThemeTitle();
  • defineThemeLoader(), defineThemeSink(), syncTheme(), and mergeRuntimeTheme().

@fullsnacklab/astro-theme/schema exports the Zod schemas, YAML parser, Astro i18n projection, and TypeScript document types. The checked-in JSON Schema is available at @fullsnacklab/astro-theme/schema.json.

Ownership boundary

The package owns normalized site settings and reusable derivation. Layout markup, <head> rendering, page-specific descriptions, remote credentials, D1 queries, Emdash models, conflict policy, and deployment adapters remain application-owned.

License

MIT