A monorepo containing reusable core components and utilities for the DCL WKC ecosystem.
This repository is organized as a monorepo using pnpm workspaces with the following structure:
core-components/
├── components/ # Reusable components
│ ├── analytics/ # Analytics component for event tracking
│ ├── job/ # Job scheduling and execution component
│ ├── slack/ # Slack messaging component
│ ├── sns/ # AWS SNS publisher component
│ ├── sqs/ # AWS SQS queue component
│ ├── redis/ # Redis cache component
│ └── memory-cache/ # In-memory LRU cache component
└── shared/ # Shared utilities and types
└── commons/ # Common utilities, types, and constants
- Analytics Component (
@dcl/analytics-component
) - Event tracking and analytics integration - Slack Component (
@dcl/slack-component
) - Slack messaging and notifications - SNS Component (
@dcl/sns-component
) - AWS SNS message publishing
- SQS Component (
@dcl/sqs-component
) - AWS SQS queue management - Redis Component (
@dcl/redis-component
) - Redis distributed caching - Memory Cache Component (
@dcl/memory-cache-component
) - In-memory LRU caching
- Job Component (
@dcl/job-component
) - Job scheduling and execution - Core Commons (
@dcl/core-commons
) - Shared utilities, types, and constants
- Node.js >= 18.0.0
- pnpm >= 8.0.0
# Install dependencies
pnpm install
# 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
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
Each component includes comprehensive test suites using Jest. Run tests with:
# Run all tests
pnpm test
# Run tests for a specific component
cd components/analytics && pnpm test
All packages use TypeScript with strict configuration. TypeScript configuration is inherited from the root tsconfig.json
and can be extended in individual packages.
Testing is configured with Jest and ts-jest
for TypeScript support. The configuration is centralized in the root jest.config.js
.
This project uses Changesets for automated version management and publishing to npm. All packages are published under the @dcl
scope:
@dcl/analytics-component
@dcl/job-component
@dcl/slack-component
@dcl/sns-component
@dcl/sqs-component
@dcl/redis-component
@dcl/memory-cache-component
@dcl/core-commons
Every pull request that introduces changes to any package must include a changeset file that describes the changes and their semantic versioning impact.
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.
Include the generated changeset file in your PR:
git add .changeset/
git commit -m "chore: Add changeset for [your changes]"
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)
- Updated version numbers in
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
- Well-Known Components - Component interfaces used by this project
- Changesets - Version management tool