Package Exports
- @farm-framework/types
- @farm-framework/types/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@farm-framework/types) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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
- Configuration Types (
config.ts)- Describes the full
FarmConfigstructure including AI, database, build and plugin sections.
- Describes the full
- CLI Types (
cli.ts)- Option objects and runtime context used by the CLI commands.
- AI Types (
ai.ts)- Provider definitions, chat message formats and model metadata.
- Database Types (
database.ts)- Connection settings and schema helper interfaces.
- Template Types (
templates.ts)- Project template descriptors used by generators and validators.
- Build Types (
build.ts)- Build result objects and bundle analysis structures.
- Error Types (
errors.ts)- Common error shapes shared across tooling.
- Auth Types (
auth.ts)- Roles, permissions, user models and session payloads.
- Plugin Types (
plugins.ts)- Plugin definition, configuration schema and lifecycle hooks.
- Core Helpers (
core.ts)- Minimal interfaces for the framework core.
- 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.tswith 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 cleanInstallation
This package is consumed internally by other FARM packages. It can also be installed standalone:
npm install @farm/typesNext 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.tsIntegration
@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
FarmConfigdefinition. - 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.