0.2.5 • Published 8 months ago

@dvmcp/commons v0.2.5

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

DVMCP Commons

Shared utilities for DVMCP packages, organized into tree-shakable modules for better performance and maintainability.

Structure

The package is organized into three main modules:

Core Module

import { constants, logger, utils } from '@dvmcp/commons/core';

Provides essential utilities and constants used across the DVMCP ecosystem:

  • Constants: DVMCP event kinds, tag names, and other shared constants
  • Logger: Debug logging utilities for different DVMCP components
  • Utils: General utility functions for working with DVMCP data
  • Mock Server: Testing utilities for DVMCP servers

Config Module

import { makeConfigLoader, ConfigSchema } from '@dvmcp/commons/config';

Provides a reusable configuration system that can be used across multiple DVMCP packages:

  • Config Types: TypeScript interfaces for configuration objects
  • Config Utils: Utilities for working with configuration
  • Config Loader: Functions for loading and validating configuration
  • Config Generator: Tools for generating configuration files

Nostr Module

import { createKeyManager, RelayHandler } from '@dvmcp/commons/nostr';

Provides Nostr-related functionality for the DVMCP ecosystem:

  • Key Manager: Utilities for managing Nostr keys and signing events
  • Relay Handler: Functions for connecting to and interacting with Nostr relays
  • Mock Relay: Testing utilities for Nostr relays

Usage

To take advantage of tree-shaking, import only what you need from the specific modules:

// Good - only imports what you need
import { logger } from '@dvmcp/commons/core';
import { createKeyManager } from '@dvmcp/commons/nostr';

// Avoid - imports everything
import { core, nostr } from '@dvmcp/commons';
const { logger } = core;
const { createKeyManager } = nostr;

This ensures that only the code you actually use is included in your bundle.

0.2.5

8 months ago

0.2.4

8 months ago

0.2.3

8 months ago

0.2.2

8 months ago

0.2.0

9 months ago

0.1.12

9 months ago

0.1.11

9 months ago

0.1.10

10 months ago

0.1.9

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago