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

create-definite-app

v0.1.2

Published

Scaffold a Definite data app from an app.json manifest. Pairs with @definite-app/data-apps.

Readme

create-definite-app

Scaffold a Definite data app from an app.json manifest. Pairs with @definite-app/data-apps (the framework: build script, runtime, components).

Usage

# Blank scaffold (refined-shell template)
npx create-definite-app my-app

# Manifest-driven: write app.json first, scaffold + generate App.tsx + build
npx create-definite-app my-app --from ./app.json

# Pipe via stdin
cat app.json | npx create-definite-app my-app --from -

The CLI:

  1. Reads the manifest (or starts from a placeholder if --from is omitted).
  2. Infers per-column roles (date / measure / id / label / category) from your SQL aliases — no warehouse round-trip required.
  3. Generates src/App.tsx: refined sidebar shell, one nav item per resource, KPI strip from numeric measures, time-series chart when a date column is present.
  4. Writes package.json + src/main.tsx + app.json + .gitignore.
  5. (Optional) npm installs @definite-app/data-apps, then runs the build.
  6. (Optional) Probes the warehouse via DESCRIBE to emit typed .d.ts and fail loudly on HUGEINT/UHUGEINT (which silently round-trips to 0 in DuckDB WASM).
  7. (Optional) Headless-renders the build with a mock bridge and fails on any console.error / mounted ErrorState.

Flags

| Flag | Default | Effect | |------|---------|--------| | --from <path\|-> | (blank scaffold) | Source manifest. - reads stdin. | | --toolkit-dir <path> | (npm install) | Use an existing @definite-app/data-apps install via symlink — pass either the install root (a dir containing node_modules/@definite-app/data-apps) or the package directory itself. The CLI symlinks the entire node_modules/ so React + esbuild + the toolkit all resolve in one shot. Skip npm install. | | --no-install | off | Don't run npm install. | | --no-build | off | Don't run the build. | | --force | off | Overwrite the target directory if it exists. Default behavior is to auto-disambiguate by appending -2, -3, etc. so an existing app is never silently overwritten. | | --validate <levels> | static | Comma list: none\|static\|schema\|render. schema and render are explicit opt-ins. | | --api-key <key> | $DEFINITE_API_KEY | Definite API key for --validate=schema (also reads $DEFINITE_API_BASE_URL for the host and $_TABLE_INTEGRATION_ID for the integration). | | -o, --out <dir> | first positional | Target directory. | | -v, --version | | Print version. | | -h, --help | | Show help. |

Output (machine-readable)

The CLI prints these key=value lines on success so a parent agent can parse the resolved slug + drive paths without scraping prose:

RESULT_APP_DIR=/full/path/to/<slug>
RESULT_SLUG=<slug>                                  # may be auto-suffixed
RESULT_DRIVE_FILE=apps-v2/<slug>/dist/index.html
RESULT_DRIVE_FILE_EMBEDDED=apps-v2/<slug>/dist/index.embedded.html

<slug> reflects the actual directory used after auto-disambiguation. If you requested posthog-events and apps-v2/posthog-events/ was already populated, RESULT_SLUG will be posthog-events-2 (or -3, etc.) — pass that to your wrapper Doc YAML, not the slug you originally requested.

Manifest shape (v2)

{
  "version": 2,
  "name": "Revenue Explorer",
  "entry": "src/main.tsx",
  "resources": {
    "txns": {
      "kind": "dataset",
      "source": {
        "type": "sql",
        "sql": "SELECT id AS transactionId, STRFTIME(created_at, '%Y-%m-%d') AS transactionDate, amount::DOUBLE AS amount FROM LAKE.SCHEMA.transactions LIMIT 200000"
      }
    }
  }
}

The CLI reads SQL aliases (AS transactionDate, amount::DOUBLE AS amount) to infer column roles. STRFTIME / DATE_TRUNC / *Date|*At aliases → date. ::DOUBLE|::BIGINT|::INTEGER casts or SUM/AVG/COUNT(...) wraps → measure. Names like *Id|*Name|*Labelid|label. Everything else → category.

License

Apache 2.0 — see LICENSE in the parent repo.