Skip to content

Latest commit

 

History

History
103 lines (67 loc) · 3.01 KB

File metadata and controls

103 lines (67 loc) · 3.01 KB

@dnd-mapp/shared-utils

CI Status NPM Version License: MIT

The core utility library for the D&D Mapp platform. This package provides a collection of shared TypeScript functions, constants, and business logic helpers used across the entire D&D Mapp ecosystem.

🏰 Overview

@dnd-mapp/shared-utils is a pure TypeScript library designed to ensure logic consistency between frontend and backend services. It contains the "brains" of the platform—handling dice mechanics, coordinate calculations, and shared data constants.

  • Runtime: Node.js v24+ / Browser compatible.
  • Language: TypeScript.
  • Package Management: pnpm with mise-en-place.

🚀 Getting Started

Prerequisites

This project uses mise-en-place to manage runtime versions. See the Mise Configuration Guide for global setup instructions.

  1. Install Mise to automatically manage:
  • Node.js: v24.14.0
  • pnpm: v10.32.1

Local Setup

  1. Clone and Install:

    git clone https://github.com/dnd-mapp/shared-utils.git
    cd shared-utils
    mise install
    pnpm install

📦 Usage

Installation

To use these utilities in a D&D Mapp application or service, install it via pnpm:

pnpm add @dnd-mapp/shared-utils

Integration

Import constants or utility functions directly into your TypeScript files:

import { rollDice, DICE_TYPES } from '@dnd-mapp/shared-utils';

// Example usage
const result = rollDice(DICE_TYPES.D20);
console.log(`You rolled a: ${result}`);

🛠 Project Structure

The repository follows a standard TypeScript library layout:

shared-utils/
├── src/
│   ├── lib/
│   │   ├── constants/      # Shared enums and static data
│   │   ├── utils/          # Pure helper functions
│   │   └── types/          # Shared TypeScript interfaces/types
│   └── index.ts            # Primary entry point (Public API)
├── .tool-versions          # Mise version config
├── package.json
└── tsconfig.json           # TypeScript configuration

📜 Scripts

  • pnpm build: Compiles the TypeScript source into the dist/ directory.
  • pnpm lint: Runs ESLint to ensure code quality.
  • pnpm format:write: Formats the codebase using Prettier.

🚀 Release Pipeline

For details on how releases are triggered, versioned, and published, see the Release Pipeline guide.


⚖️ License

Copyright © 2026 NoNamer777. All rights reserved.

This software is proprietary. Unauthorized copying, modification, or distribution is strictly prohibited. Use is subject to the terms in the LICENSE file.