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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@bemedev/app-cli

v0.1.7

Published

CLI for generating TypeScript typings for lib @bemedev/app-ts

Readme

@bemedev/app-cli


About

This library provides a command-line interface (CLI) for generating TypeScript typings from @bemedev/app-ts state machine configurations. It automatically extracts and generates type definitions from your machine files, offering a better development experience with improved autocompletion, type checking, and documentation.

This README contains essential information for installing, using, and contributing to the project.

Features

  • Automatic Type Generation: Extracts TypeScript typings from .machine.ts files that use createMachine from @bemedev/app-ts
  • Watch Mode: Monitors file changes and regenerates types automatically
  • Flexible File Selection: Generate types for specific files or use glob patterns
  • Strict Mode: Ensures all files follow the .machine.ts naming convention
  • Easy Integration: Simple CLI commands that work with any Node.js project

Installation

Install as a development dependency in your project using @bemedev/app-ts:

pnpm add -D @bemedev/app-cli

Requirements

  • Node.js >= 22
  • Files must use @bemedev/app-ts with createMachine function
  • Machine files should follow the .machine.ts naming convention

Usage (CLI)

The CLI provides two main commands:

app-typings generate

Generates typings from all .machine.ts files in your project:

app-typings generate

Options:

  • --watch, -w: Watch for file changes and regenerate automatically
  • --help, -h: Show help information

Aliases: gen

Examples:

# Generate types once
app-typings generate

# Generate types and watch for changes
app-typings generate --watch

# Using alias
app-typings gen -w

app-typings generateOne

Generates typings for specific files:

app-typings generateOne file1.machine.ts file2.machine.ts

Options:

  • --watch, -w: Watch specified files for changes
  • --strict, -s: Enable strict mode (all files must end with .machine.ts)
  • --help, -h: Show help information

Aliases: genOne, genO

Examples:

# Generate types for specific files
app-typings generateOne src/user.machine.ts src/auth.machine.ts

# Watch specific files
app-typings generateOne src/user.machine.ts --watch

# Strict mode - ensures all files follow naming convention (Regex : "**/*.machine.ts")
app-typings generateOne src/user.machine.ts --strict

File Structure

The CLI looks for files with the following pattern:

  • **/*.machine.ts - TypeScript machine files
  • **/*.machine.tsx - TypeScript React machine files

Generated files will have the .gen.ts extension:

  • user.machine.tsuser.machine.gen.ts
  • auth.machine.tsauth.machine.gen.ts

Integration with npm/pnpm Scripts

Add scripts to your package.json:

{
  "scripts": {
    "types:generate": "app-typings generate",
    "types:watch": "app-typings generate --watch",
    "types:build": "app-typings generateOne src/**/*.machine.ts"
  }
}

Then run:

pnpm run types:generate
pnpm run types:watch

Environment Variables

You can configure the CLI using environment variables:

  • APP_TYPINGS_WATCH: Enable watch mode for generate command
  • APP_TYPINGS_WATCH_ONE: Enable watch mode for generateOne command
  • APP_TYPINGS_STRICT_ONE: Enable strict mode for generateOne command

Contribution

Contributions are welcome: bugs, PRs, improvement suggestions. Please open an issue or a PR targeting the dev branch.

Quick guide:

  • Fork → new branch → PR to dev.
  • Respect tests and linting (see pnpm test).

CHANGE_LOG

See the full changelog:
CHANGE_LOG

Author

chlbri ([email protected])

My GitHub

Links

  • Documentation: https://github.com/chlbri/app-cli.git

License

MIT