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

@farm-framework/types

v0.2.0

Published

Shared TypeScript types for FARM framework

Readme

@farm/types

Overview

Shared TypeScript definitions used across the FARM framework. These interfaces describe everything from the farm.config.ts configuration file to CLI options, database schemas and plugin hooks. All packages in the monorepo depend on this library for a single source of truth.

✅ Completed Implementation

Core Modules

  1. Configuration Types (config.ts)
    • Describes the full FarmConfig structure including AI, database, build and plugin sections.
  2. CLI Types (cli.ts)
    • Option objects and runtime context used by the CLI commands.
  3. AI Types (ai.ts)
    • Provider definitions, chat message formats and model metadata.
  4. Database Types (database.ts)
    • Connection settings and schema helper interfaces.
  5. Template Types (templates.ts)
    • Project template descriptors used by generators and validators.
  6. Build Types (build.ts)
    • Build result objects and bundle analysis structures.
  7. Error Types (errors.ts)
    • Common error shapes shared across tooling.
  8. Auth Types (auth.ts)
    • Roles, permissions, user models and session payloads.
  9. Plugin Types (plugins.ts)
    • Plugin definition, configuration schema and lifecycle hooks.
  10. Core Helpers (core.ts)
    • Minimal interfaces for the framework core.
  11. Barrel Export (index.ts)
    • Re-exports all modules for easy consumption.

Architecture

┌────────────────────────────────────────────┐
│                @farm/types                 │
├────────────────────────────────────────────┤
│  config   ai     database   cli            │
│  auth     templates  build   plugins       │
│  errors   core                                │
└────────────────────────────────────────────┘

All modules are compiled to CommonJS and ES modules in dist/. Type Declarations live under dist/ts and are generated via tsc.

Features Implemented

  • Unified type definitions for all FARM packages
  • Strongly typed farm.config.ts with database and AI configuration
  • Typed interfaces for CLI commands and plugin systems
  • Database schema modelling utilities
  • AI provider and chat structures
  • Template descriptors for project generators
  • Build artefact and analysis reporting
  • Shared error and authentication models

Usage

Build Commands

# Compile TypeScript and bundle
pnpm run --filter @farm/types build:bundle

# Watch mode for development
pnpm run --filter @farm/types build:watch

# Type checking only
pnpm run --filter @farm/types type-check

# Clean build output
pnpm run --filter @farm/types clean

Installation

This package is consumed internally by other FARM packages. It can also be installed standalone:

npm install @farm/types

Next Steps

  • Continue refining configuration and plugin schemas
  • Add more granular database field types and validations
  • Expand build metrics for future tooling

Files Structure

types
├── README.md
├── package.json
├── package.json.bak
├── src
│   ├── ai.ts
│   ├── auth.ts
│   ├── build.ts
│   ├── cli.ts
│   ├── config.ts
│   ├── core.ts
│   ├── database.ts
│   ├── errors.ts
│   ├── index.ts
│   ├── plugins.ts
│   └── templates.ts
├── tsconfig.json
└── tsup.config.ts

Integration

@farm/types is imported by the CLI, core runtime, template validator and development server packages. Keeping the types here ensures a single source of truth across the entire framework.

File Overview

  • src/config.ts – main FarmConfig definition.
  • src/ai.ts – AI provider and chat message types.
  • src/database.ts – database schema helpers.
  • src/cli.ts – CLI option interfaces.
  • src/templates.ts – template and scaffold structures.
  • src/build.ts – build artefact reporting.
  • src/errors.ts – common error shapes.
  • src/auth.ts – authentication and user models.
  • src/plugins.ts – plugin system contracts.
  • src/core.ts – core framework interfaces.
  • src/index.ts – barrel exports.