2.8 KiB
Workspace Shared Packages
Status: 🚧 In Development Purpose: Shared packages and libraries for workspace projects Last Updated: 2025-01-27
Overview
This monorepo contains shared packages and libraries used across multiple projects in the workspace. It enables code reuse, consistent patterns, and simplified dependency management.
Packages
@workspace/shared-types
Status: 🚧 Planned Purpose: Common TypeScript types and interfaces Usage: Used across dbis_core, the_order, Sankofa, and others
@workspace/shared-utils
Status: 🚧 Planned Purpose: Common utility functions Usage: Used in 20+ projects
@workspace/shared-config
Status: 🚧 Planned Purpose: Shared configuration schemas and validation Usage: All projects with configuration
@workspace/shared-constants
Status: 🚧 Planned Purpose: Shared constants and enums Usage: DBIS projects, DeFi projects
@workspace/api-client
Status: 🚧 Planned Purpose: Common API client utilities Usage: Frontend projects, API consumers
@workspace/validation
Status: 🚧 Planned Purpose: Zod schemas and validators Usage: Multiple backend services
@workspace/blockchain
Status: 🚧 Planned Purpose: Blockchain utilities and helpers Usage: Blockchain projects
Getting Started
Prerequisites
- Node.js >= 18.0.0
- pnpm >= 8.0.0
Installation
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Lint all packages
pnpm lint
Using Packages
In your project's package.json:
{
"dependencies": {
"@workspace/shared-types": "workspace:*",
"@workspace/shared-utils": "workspace:*"
}
}
Development
Creating a New Package
- Create package directory:
packages/package-name/ - Add
package.jsonwith proper name (@workspace/package-name) - Implement package code
- Add to workspace configuration
- Build and test
Publishing
Packages are published to private npm registry (Verdaccio or GitHub Packages).
# Build package
cd packages/package-name
pnpm build
# Publish
pnpm publish --registry=<registry-url>
Structure
workspace-shared/
├── packages/ # Shared packages
│ ├── shared-types/
│ ├── shared-utils/
│ ├── shared-config/
│ └── ...
├── apps/ # Shared applications (if any)
├── tools/ # Development tools
├── package.json # Root package.json
├── pnpm-workspace.yaml
└── turbo.json # Turborepo configuration
Related Documents
Last Updated: 2025-01-27