0.2.5 • Published 5 months ago

@dvmcp/commons v0.2.5

Weekly downloads
-
License
-
Repository
-
Last release
5 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

5 months ago

0.2.4

5 months ago

0.2.3

5 months ago

0.2.2

5 months ago

0.2.0

6 months ago

0.1.12

6 months ago

0.1.11

6 months ago

0.1.10

6 months ago

0.1.9

6 months ago

0.1.8

6 months ago

0.1.7

6 months ago

0.1.6

6 months ago

0.1.5

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.2

7 months ago

0.1.1

8 months ago

0.1.0

8 months ago