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

@sometic/app-shell

v4.0.2

Published

Sometic System composition: createAppShell with session epoch binds across auth, http, query, head, theme, stores, and forms.

Downloads

1,817

Readme

@sometic/app-shell

System composition for Sometic. Start with createSometicApp for easy keys (app.http, app.query.define, app.whenReauth). Under the hood it uses createAppShell, which wires auth session epoch across HTTP, query, head, theme, stores, and forms.

When the session epoch bumps (logout, user switch, hard re-auth), query caches clear/refetch, mutation queues reset, and optional session stores revert. Hand-wiring bindAuthToHttp, bindQueryToAuth, bindThemeToHead, and draft clears is easy to get wrong. This package encodes the recommended composition once.

Standout exports: createSometicApp, createAppShell, bindAuthToHttp, bindQueryToAuth, bindHeadToQuery, bindMutationForm, bindThemeToHead, bindAuthToStores, createSessionMutationQueue, and bindMutationQueueToAuth.

Peers: @sometic/auth, @sometic/http, @sometic/query. Optional: @sometic/head, @sometic/theme, @sometic/store, @sometic/forms. Foundation: @sometic/core.

Docs: https://sometic.dev/guide/app-shell

Install

pnpm add @sometic/app-shell @sometic/auth @sometic/http @sometic/query
npm install @sometic/app-shell @sometic/auth @sometic/http @sometic/query
yarn add @sometic/app-shell @sometic/auth @sometic/http @sometic/query

Add optional peers (@sometic/head, @sometic/theme, @sometic/store, @sometic/forms) as needed.

Usage

Easy spine (createSometicApp):

import { createAuth, createMemoryAuthStorage, createTestAuthProvider } from "@sometic/auth";
import { createSometicApp } from "@sometic/app-shell";

const auth = createAuth({
    provider: createTestAuthProvider(),
    storage: createMemoryAuthStorage(),
});

const app = createSometicApp({
    auth,
    baseUrl: "https://api.example.com",
    theme: true,
});

app.whenReauth((epoch) => {
    console.log("epoch", epoch);
});

const todos = app.query.define(["todos"], async () => app.http.get("/todos"));
await todos.refetch();
await app.query.invalidate(["todos"]);

app.dispose();
auth.dispose();

Engine-level createAppShell (same epoch graph, no façade keys):

import { createAuth, createMemoryAuthStorage, createTestAuthProvider } from "@sometic/auth";
import { createAppShell } from "@sometic/app-shell";
import { createQueryClient } from "@sometic/query";

const auth = createAuth({
    provider: createTestAuthProvider(),
    storage: createMemoryAuthStorage(),
});

const shell = createAppShell({
    auth,
    query: createQueryClient(),
    refetchOnReauth: "all",
});

shell.onEpochChange((epoch) => {
    console.log("session epoch", epoch);
});

await auth.signIn({ email: "[email protected]", password: "password" });

Bind a mutation form and dispose cleanly:

import { bindMutationForm, createSometicApp } from "@sometic/app-shell";
import { createForm } from "@sometic/forms";
import { createMutationObserver } from "@sometic/query";

const app = createSometicApp({ auth, baseUrl: "https://api.example.com" });
const form = createForm({ defaultValues: { title: "" } });
const mutation = createMutationObserver(app.query, {
    mutationFn: async (variables: { title: string }) => {
        await app.http.post("/items", JSON.stringify(variables), {
            headers: { "Content-Type": "application/json" },
        });
    },
});

const bound = bindMutationForm({
    form,
    mutation,
    getEpoch: () => app.getEpoch(),
    queryClient: app.query,
    getVariables: () => ({ title: String(form.getValues().title ?? "") }),
});

await bound.submit();
app.dispose();

CDN

Docs: https://sometic.dev/guide/app-shell.

Simple script

<script src="https://cdn.jsdelivr.net/npm/@sometic/[email protected]/dist/cdn/sometic-app-shell.iife.js"></script>
<script>
    const app = SometicAppShell.createSometicApp({
        auth,
        baseUrl: "/api",
        query: true,
    });
</script>

Module script

<script type="module">
    import { createSometicApp } from "https://cdn.jsdelivr.net/npm/@sometic/[email protected]/dist/cdn/sometic-app-shell.esm.js";

    const app = createSometicApp({
        auth,
        baseUrl: "/api",
        query: true,
    });
</script>

Peers / when not to use

Required peers in practice: @sometic/auth, @sometic/http, @sometic/query. Optional: @sometic/forms, @sometic/head, @sometic/store, @sometic/theme. Depends on @sometic/core.

Skip app-shell when you only need a single package in isolation (for example HTTP without auth). Prefer calling individual bind* helpers if you need a custom topology the shell does not express. Always call dispose() when tearing down.

Docs

License

MIT