Skip to content

decentraland/core-libs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Core Libraries

A monorepo containing reusable core libraries for the DCL ecosystem.

πŸ“¦ Project Structure

This repository is organized as a monorepo using pnpm workspaces with the following structure:

core-libs/
β”œβ”€β”€ libs/
β”‚   β”œβ”€β”€ http-commons/        # Common middlewares and utils for HTTP Servers
β”‚   β”œβ”€β”€ crypto/              # Crypto auth primitives for Decentraland
β”‚   β”œβ”€β”€ crypto-middleware/   # Multi-framework authentication middleware for Decentraland signed requests
β”‚   β”œβ”€β”€ crypto-fetch/        # fetch wrapper that signs requests with a Decentraland Identity

πŸš€ Libraries

HTTP Server Commons

  • HTTP Commons (@dcl/http-server-commons) - Middlewares and utilities for HTTP Servers

Crypto

  • Crypto (@dcl/crypto) - Crypto auth primitives for Decentraland: Authenticator, signature validation, and auth-chain helpers

Crypto Middleware

  • Crypto Middleware (@dcl/crypto-middleware) - Authentication middleware for Decentraland signed requests with Express, Koa, Passport and Well-Known Components adapters

Crypto Fetch

  • Crypto Fetch (decentraland-crypto-fetch) - fetch wrapper that signs requests with a Decentraland Identity

πŸ› οΈ Development

Prerequisites

  • Node.js >= 22.0.0
  • pnpm >= 10.0.0

Installation

# Install dependencies
pnpm install

Available Scripts

# Build all packages
pnpm build

# Run tests for all packages
pnpm test

# Start development mode (watch mode)
pnpm dev

# Clean build artifacts
pnpm clean

# Lint all packages
pnpm lint

Package Management

This project uses Changesets for version management:

# Create a new changeset
pnpm changeset

# Version packages based on changesets
pnpm version-packages

# Build and publish packages
pnpm release

πŸ“š Testing

Each library includes comprehensive test suites using Jest. Run tests with:

# Run all tests
pnpm test

# Run tests for a specific library
cd libraries/http-server-commons && pnpm test

πŸ”§ Configuration

TypeScript

All packages use TypeScript with strict configuration. TypeScript configuration is inherited from the root tsconfig.json and can be extended in individual packages.

Jest

Testing is configured with Jest and ts-jest for TypeScript support. The configuration is centralized in the root jest.config.js.

πŸ“¦ Publishing

This project uses Changesets for automated version management and publishing to npm:

  • @dcl/http-server-commons
  • @dcl/crypto
  • @dcl/crypto-middleware
  • decentraland-crypto-fetch

Publishing Workflow

Every pull request that introduces changes to any package must include a changeset file that describes the changes and their semantic versioning impact.

Step 1: Create a Changeset

When making changes to any package, run the changeset command to create a changeset file:

pnpm changeset

This interactive command will:

  • Ask you to select which packages have changed
  • Prompt you to choose the version bump type (major, minor, or patch)
  • Request a summary of the changes for the changelog

The command creates a new file in the .changeset/ directory with your change description.

Step 2: Commit and Submit PR

Include the generated changeset file in your PR:

git add .changeset/
git commit -m "chore: Add changeset for [your changes]"

Step 3: Merge PR

After peer review and approval, merge your PR. The changeset CI will automatically:

  • Detect the merged changeset
  • Create a new "Version Packages" PR with:
    • Updated version numbers in package.json files
    • Generated changelogs for each affected package
    • Consumed changeset files (they'll be deleted)

Step 4: Release

Merge the "Version Packages" PR to trigger the automated publishing process:

  • Packages are built and published to npm
  • Git tags are created for the new versions
  • GitHub releases are generated

πŸ”— Related

About

Mono-repo with all of the libraries for the core team

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors