Skip to content

Commit cd02d83

Browse files
committed
chore: add pnpm workspace configuration to manage packages
1 parent c204777 commit cd02d83

21 files changed

+1615
-1524
lines changed

.npmrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Use exact versions for better reproducibility
2+
save-exact=true
3+
4+
# Automatically install peer dependencies
5+
auto-install-peers=true
6+
7+
# Use strict peer dependencies
8+
strict-peer-dependencies=false
9+
10+
# Enable hoisting for better performance
11+
hoist-pattern[]=*
12+
13+
# Dedupe dependencies
14+
dedupe-peer-dependents=false
15+
16+
# Use lockfile for reproducible installs
17+
lockfile=true

.vscode/tasks.json

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,69 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "Build Devlog MCP",
5+
"label": "Build All Packages",
66
"type": "shell",
7-
"command": "npm",
7+
"command": "pnpm",
88
"args": [
9-
"run",
109
"build"
1110
],
1211
"group": "build",
1312
"problemMatcher": [
1413
"$tsc"
1514
]
15+
},
16+
{
17+
"label": "Build MCP Server",
18+
"type": "shell",
19+
"command": "pnpm",
20+
"args": [
21+
"build:mcp"
22+
],
23+
"group": "build",
24+
"problemMatcher": [
25+
"$tsc"
26+
]
27+
},
28+
{
29+
"label": "Build Types",
30+
"type": "shell",
31+
"command": "pnpm",
32+
"args": [
33+
"build:types"
34+
],
35+
"group": "build",
36+
"problemMatcher": [
37+
"$tsc"
38+
]
39+
},
40+
{
41+
"label": "Start MCP Server",
42+
"type": "shell",
43+
"command": "pnpm",
44+
"args": [
45+
"start"
46+
],
47+
"group": "test",
48+
"isBackground": true
49+
},
50+
{
51+
"label": "Dev MCP Server",
52+
"type": "shell",
53+
"command": "pnpm",
54+
"args": [
55+
"dev"
56+
],
57+
"group": "test",
58+
"isBackground": true
59+
},
60+
{
61+
"label": "Clean All",
62+
"type": "shell",
63+
"command": "pnpm",
64+
"args": [
65+
"clean"
66+
],
67+
"group": "build"
1668
}
1769
]
1870
}

CONTRIBUTING.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Contributing to Devlog Tools
2+
3+
This is a monorepo containing development logging tools and utilities. This document explains the project structure and development workflow.
4+
5+
## Project Structure
6+
7+
```
8+
/
9+
├── package.json # Root workspace configuration
10+
├── packages/
11+
│ ├── mcp-server/ # MCP server for development logging
12+
│ │ ├── package.json # Package-specific dependencies and scripts
13+
│ │ ├── src/ # Source code
14+
│ │ └── build/ # Compiled output
15+
│ └── [future packages]/ # Space for additional packages
16+
├── .vscode/ # VS Code workspace configuration
17+
└── README.md # Main documentation
18+
```
19+
20+
## Development Workflow
21+
22+
### Initial Setup
23+
24+
```bash
25+
# Install all dependencies for all packages
26+
pnpm install
27+
28+
# Build all packages
29+
pnpm build
30+
```
31+
32+
### Working with Packages
33+
34+
```bash
35+
# Build all packages
36+
pnpm build
37+
38+
# Build only the MCP server
39+
pnpm build:mcp
40+
41+
# Build only the types package
42+
pnpm build:types
43+
44+
# Start the MCP server
45+
pnpm start
46+
47+
# Run the MCP server in development mode
48+
pnpm dev
49+
50+
# Run tests for all packages
51+
pnpm test
52+
53+
# Clean build artifacts from all packages
54+
pnpm clean
55+
```
56+
57+
### Working with Individual Packages
58+
59+
You can also work directly with individual packages using pnpm filters:
60+
61+
```bash
62+
# Work on the MCP server package
63+
pnpm --filter @devlog/mcp-server build
64+
pnpm --filter @devlog/mcp-server dev
65+
66+
# Work on the types package
67+
pnpm --filter @devlog/types build
68+
pnpm --filter @devlog/types dev
69+
70+
# Install dependencies for a specific package
71+
pnpm --filter @devlog/mcp-server add some-dependency
72+
```
73+
74+
## Adding New Packages
75+
76+
When adding a new package to the monorepo:
77+
78+
1. Create a new directory in `packages/`
79+
2. Add a `package.json` with a scoped name (e.g., `@devlog/package-name`)
80+
3. Add TypeScript configuration with `"composite": true`
81+
4. Update the root `tsconfig.json` to include the new package reference
82+
5. Update this document
83+
84+
## Architecture Decisions
85+
86+
### Monorepo Benefits
87+
88+
- **Shared tooling**: Common TypeScript, linting, and build configurations
89+
- **Code sharing**: Easy to share types and utilities between packages
90+
- **Atomic changes**: Changes across multiple packages can be made in single commits
91+
- **Simplified dependency management**: Unified dependency resolution
92+
93+
### Package Structure
94+
95+
- `@devlog/mcp-server`: The main MCP server implementation
96+
- Future packages might include:
97+
- `@devlog/cli`: Command-line interface for devlog management
98+
- `@devlog/types`: Shared TypeScript types
99+
- `@devlog/web`: Web interface for browsing devlogs
100+
- `@devlog/utils`: Shared utilities
101+
102+
## Build System
103+
104+
The project uses pnpm workspaces with TypeScript project references for efficient builds:
105+
106+
- `pnpm-workspace.yaml` defines the workspace structure
107+
- Root `tsconfig.json` references all packages
108+
- Each package has `"composite": true` for incremental builds
109+
- `pnpm` manages dependencies and scripts efficiently
110+
111+
### pnpm Workspace Commands
112+
113+
- `pnpm -r <command>` - Run command in all packages
114+
- `pnpm --filter <package> <command>` - Run command in specific package
115+
- `pnpm --filter <pattern> <command>` - Run command in packages matching pattern
116+
117+
## Testing
118+
119+
Each package should include its own tests. The root workspace provides commands to run tests across all packages.

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# Devlog MCP Server
1+
# Devlog Development Tools - Monorepo
22

3-
A Model Context Protocol (MCP) server for managing development logs and working notes. This tool helps AI assistants maintain context about ongoing tasks, features, and bugfixes by storing structured notes in a local `.devlog` directory.
3+
A monorepo containing development logging tools and utilities, including a Model Context Protocol (MCP) server for managing development logs and working notes. These tools help AI assistants maintain context about ongoing tasks, features, and bugfixes by storing structured notes in a local `.devlog` directory.
4+
5+
## Packages
6+
7+
### `@devlog/mcp-server`
8+
The main MCP server for development logging functionality.
49

510
## Features
611

@@ -17,14 +22,30 @@ A Model Context Protocol (MCP) server for managing development logs and working
1722

1823
```bash
1924
# Clone or download this repository
20-
npm install
21-
npm run build
25+
pnpm install
26+
pnpm build
2227
```
2328

2429
## Usage
2530

31+
### MCP Server
2632
The devlog MCP server is designed to be used with MCP-compatible AI clients. It stores all data locally in a `.devlog` directory within your project.
2733

34+
```bash
35+
# Start the MCP server
36+
pnpm start
37+
38+
# Start in development mode
39+
pnpm dev
40+
41+
# Build all packages
42+
pnpm build
43+
44+
# Build specific packages
45+
pnpm build:mcp
46+
pnpm build:types
47+
```
48+
2849
### Available Tools
2950

3051
#### `create_devlog`

claude-desktop-config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"mcpServers": {
33
"devlog": {
44
"command": "node",
5-
"args": ["/path/to/devlog-mcp/build/index.js"],
5+
"args": ["/path/to/devlog-monorepo/packages/mcp-server/build/index.js"],
66
"env": {
7-
"NODE_PATH": "/path/to/devlog-mcp/node_modules"
7+
"NODE_PATH": "/path/to/devlog-monorepo/node_modules"
88
}
99
}
1010
}

mcp-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"mcpServers": {
33
"devlog": {
44
"command": "node",
5-
"args": ["./build/index.js"],
5+
"args": ["./packages/mcp-server/build/index.js"],
66
"cwd": "."
77
}
88
}

0 commit comments

Comments
 (0)