@appweaver/common
v2.4.1
Published
Appweaver - the backend framework for AI-first development (@common)
Readme
Description
@appweaver/common holds what every other Appweaver package builds on:
- Configuration –
defineConfig, declaring the config sections every package and application reads by their short key names (appConfig.ENV), each validated by its TypeBox schema, fromappweaver.jsonwith itsenvironmentssections, the optionalappweaver.<env>.jsonoverlay,.envfiles, and environment variables, and theconfigaccessors (config.str(),config.int(), ...) reading any flattened key as it is. - Logger – the
loggerinstance, a configured Pino logger. - Types – the resource model, query filter, sort, aggregate, policy, and route types, and the
ResourceRegistrythatweaver generatefills so the factories infer the model types from a model name. - Infrastructure contracts – the abstract
Database,Cache,Memory,Queue,Scheduler,Storage,Mailer,Events,TemplateEngine,ImageProcessor, andSecurityStoreclasses the drivers implement. - Modules –
defineModule, the manifest of a module declaring its contracts, providers, services, setup, resources and startup code, the same format for the framework's own modules, npm packages, and thesrc/modules/of an app. - Lifecycle – the
OnInit,OnReady,OnShutdown, andOnDestroyhooks of the application services. - Utilities – string, object, date, and version helpers such as
randomStringandcompareVersions.
Installation
It is installed with @appweaver/core, and is rarely added on its own:
npm install @appweaver/commonUsage
import { appConfig, logger, randomString } from '@appweaver/common';
logger.info({ env: appConfig.ENV }, 'Starting the application');
const token = randomString(32);Documentation
- Appweaver README – getting started, configuration, and the overview of every package
- Agent skill – the complete framework reference shipped to every scaffolded project
License
Appweaver is MIT licensed.
