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

@wuguishifu/nx-convex

v0.0.1

Published

Nx plugin that scaffolds a Convex backend app with a companion contract library inside an Nx workspace.

Downloads

92

Readme

@wuguishifu/nx-convex

An Nx plugin that scaffolds a Convex backend app together with a companion contract library inside an Nx workspace.

Convex generates its client API types from your server source. In a monorepo that's awkward: any app that wants the nice api types ends up pulling the whole Convex server source graph into its TypeScript project. This plugin scaffolds two projects instead — the Convex app itself, and a small "contract" library that packages only the generated, client-safe artifacts (api, dataModel, and the declaration files they reference) into a dist/ that other apps and libs can depend on.

Installation

pnpm add -D @wuguishifu/nx-convex

Usage

nx g @wuguishifu/nx-convex:convex-app apps/my-backend libs/my-backend-kore

The two positional arguments are the directory for the Convex app and the directory for the companion contract library. Project names default to the last segment of each path, and the contract library's import path defaults to its name. To set things explicitly:

nx g @wuguishifu/nx-convex:convex-app apps/my-backend libs/my-backend-kore \
  --appName=my-backend \
  --contractLibName=my-backend-kore \
  --importPath=@myorg/my-backend-kore

Add --dry-run to preview the changes without writing them.

Options

| Option | Type | Default | Description | | ---------------------- | ------- | ---------------------------------- | ---------------------------------------------------------------------------------------- | | appDirectory | string | (required, first positional) | Directory the Convex app is created in, e.g. apps/my-backend. | | contractLibDirectory | string | (required, second positional) | Directory the contract library is created in, e.g. libs/my-backend-kore. | | appName | string | basename of appDirectory | Nx project name for the Convex app. | | contractLibName | string | basename of contractLibDirectory | Nx project name for the contract library. | | importPath | string | contractLibName | Package name used to import the Convex api, e.g. @myorg/my-backend-kore. | | enableAiFiles | boolean | false | Enable Convex generated AI files, and add an update:ai-files target. | | deferConvexSetup | boolean | false | Skip connecting to a Convex deployment; scaffold placeholder _generated files instead. |

What gets generated

apps/my-backend/
├── .gitignore                  # ignores .env.local
├── convex.json
├── eslint.config.mjs
├── index.ts                    # re-exports only convex/_generated
├── package.json
├── project.json
├── tsconfig.json
├── tsconfig.lib.json
└── convex/
    ├── convex.config.ts
    ├── schema.ts               # example `notes` table
    └── _generated/             # only with --deferConvexSetup

libs/my-backend-kore/
├── README.md
├── package.json                # exports ./convex/_generated/{api,dataModel}
├── project.json
├── tsconfig.json
├── tsconfig.lib.json
└── scripts/
    └── build.mjs               # packages generated artifacts into dist/

The Convex app gets these Nx targets:

  • serve — runs convex dev and rebuilds the contract library whenever the generated files change, in parallel.
  • build — typechecks the app and rebuilds the contract library.
  • convex — forwards arbitrary commands to the Convex CLI, e.g. nx convex my-backend -- dev --once.
  • deploy — runs convex deploy from the app directory.
  • clean — removes dist, node_modules, and out-tsc.

After generation

The generator adds convex to the workspace package.json, runs nx sync, builds the app, and builds the contract library. Unless --deferConvexSetup is passed, it also runs convex dev --once first, which prompts you to log in and create or link a Convex deployment.

Other projects then consume the backend's API through the contract library:

import { api } from '@myorg/my-backend-kore';

Requirements

  • Node.js >= 20
  • Nx >= 23 with the @nx/js/typescript plugin
  • pnpm (the generator's post-install steps invoke pnpm nx ...)
  • App and library directories two levels below the workspace root (e.g. apps/*, libs/*)

License

MIT