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

@kodentuzo/spotcraft

v0.19.0

Published

The spotcraft command: a local stack that matches a Spotcraft server, per repository

Readme

@kodentuzo/spotcraft

The spotcraft command. spotcraft new starts a private, offline-first app from Kodentuzo's starter (the server is the authority; the device keeps a working copy and a queue of changes), and spotcraft dev runs a local stack that matches a Spotcraft server, one per repository (ADR 0037): Postgres set up as on the server, the user pool, and Mailpit to catch email. It needs Docker.

npm install --save-dev @kodentuzo/spotcraft   # same version as the Spotcraft you deploy to
npx spotcraft dev                             # start, set up this app, fill .env, migrate

A new app

pnpm dlx @kodentuzo/spotcraft new my-app            # the starter's latest release, in ./my-app
pnpm dlx @kodentuzo/spotcraft new my-app --ref v0.1.0

It downloads a release of kodentuzo/starter from GitHub (with the system's tar), then names it: starter becomes the app's name, Starter its title, and app_starter its schema (app_my_app) in every text file, outside node_modules. The template's own links stay. It writes a README and changelog of the app's own, and refuses a folder that isn't empty. The name follows Spotcraft's rules: lowercase letters, digits and dashes.

It replaces the old spotcraft package.

| Command | What | | ---------------------- | ------------------------------------------------------------------------------------------------------ | | dev | starts the stack if needed, sets up this app's schema, adds missing settings to .env, runs migrate | | dev env [--write] | prints this app's settings; --write adds missing ones to .env | | dev db reset [--yes] | deletes everything in this app's schema (asks first), then runs migrate | | dev migrate | runs migrate from spotcraft.json with this app's settings | | dev status | whether the stack runs, its addresses, and this app's schema | | dev stop | stops the stack; the data stays | | dev ls | every repository's stack on this machine |

The app

The app's name comes from --name, else name in spotcraft.json, else the name in package.json made into an app name (@acme/Blog_API → blog-api). spotcraft.json sits in the deployable's folder:

{ "name": "lifts-api", "migrate": "pnpm db:migrate" }

migrate runs through the shell in that folder, with the app's settings; values in .env win. On the server, the image's dev.spotcraft.migrate label does that job instead (the contract).

.env gets the names the server uses, pointing at the local stack: DATABASE_URL, DATABASE_SCHEMA, APP_NAME, APP_SECRET (random, kept), PUBLIC_URL (http://localhost:3000; change it to your dev server's), AUTH_URL, AUTH_ISSUER, AUTH_JWKS_URL, SMTP_URL, MAIL_FROM and LEGAL_FACTS (example facts, in single quotes, with .invalid addresses). Existing lines are never changed.

The stack

  • One per repository, found from the folder you run it in: the nearest folder up with .git or pnpm-workspace.yaml. Every deployable in a monorepo shares it, so their tables can point at the same local users. It is the Compose project spotcraft-dev-<repo folder>-<hash>, with its data in its own volume. The hash is 6 hex characters of the root's absolute path, so two checkouts or worktrees with the same folder name get their own stacks. dev status prints the name; dev ls lists every stack without the spotcraft-dev- prefix.
  • Ports and the name are picked on the first run and kept in .spotcraft/dev.json at the repository's root, so .env stays valid. A stack made by 0.6.0 keeps its name, spotcraft-dev-<repo folder>. .spotcraft/ ignores itself in git.
  • Postgres: the server's pinned image and login rules, the same roles and grants (the deploy script's SQL), and the same provisioning code as the agent (@kodentuzo/spotcraft/provision). Every app has its own schema and role in the apps database. Tests fail if the copies of the image, the rules or that SQL drift from infra/.
  • The user pool: Spotpass, the same pinned image as the server (SPOTPASS_DEV_IMAGE overrides it, e.g. with a local build), over plain HTTP. It trusts any http://localhost:<port> and http://127.0.0.1:<port> origin, where dev servers run. Its cookies are host-only, and browsers send localhost cookies to every port, so an app at localhost:3000 and the pool at its own port share the session.
  • Mailpit catches every email sent to SMTP_URL; its inbox is at the address dev status shows.

Everything listens on 127.0.0.1 only. The passwords are fixed (local-<name>-password for an app), which is fine for throwaway data on your own machine and nowhere else. To remove a stack and its data: docker compose -p <name from dev status> down -v.

Developing

In the workspace, run it from source with node --conditions=spotcraft-source packages/cli/src/cli.ts dev … from an app's folder. pnpm selects this package by folder (--filter ./packages/cli), as spotcraft is also the workspace root's name. pnpm --filter ./packages/cli build writes dist/: the spotcraft bin, and @kodentuzo/spotcraft/provision, which the agent imports. That export is for Spotcraft itself, not for apps.