Skip to content

Commit e80d062

Browse files
committed
Update versioning strategy and fix @leanspec/ui packaging issue
- Added version management guidelines to CONTRIBUTING.md for synchronized package versions. - Bumped all package versions to 0.2.5 in respective package.json files. - Fixed packaging issue in @leanspec/ui by updating the files field to include actual pnpm store location.
1 parent 156a01b commit e80d062

File tree

7 files changed

+113
-6
lines changed

7 files changed

+113
-6
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,30 @@ pnpm test # Run tests (with caching)
3131
pnpm typecheck # Type check all packages (with caching)
3232
```
3333

34+
## Version Management
35+
36+
All packages in the monorepo should maintain synchronized versions for consistency:
37+
38+
- `lean-spec` (CLI package)
39+
- `@leanspec/core` (shared core library)
40+
- `@leanspec/ui` (web UI package)
41+
- `@leanspec/mcp` (MCP server wrapper)
42+
43+
**Before Publishing:**
44+
1. Update version in all `package.json` files (root and all packages)
45+
2. Update cross-package dependencies (e.g., `@leanspec/mcp` depends on `lean-spec`)
46+
3. Run `pnpm build` to verify all packages build successfully
47+
4. Run `node bin/lean-spec.js validate` to check specs
48+
5. Test package installation locally using `npm pack`
49+
50+
**Example version bump:**
51+
```bash
52+
# Bump all packages from 0.2.4 to 0.2.5
53+
# Update: package.json, packages/cli/package.json, packages/core/package.json,
54+
# packages/ui/package.json, packages/mcp/package.json
55+
# Also update: packages/mcp/package.json dependency on lean-spec
56+
```
57+
3458
### Docs Site Submodule
3559

3660
The docs are maintained in [codervisor/lean-spec-docs](https://github.com/codervisor/lean-spec-docs) and pulled in via the `docs-site/` git submodule. Typical workflow:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lean-spec-monorepo",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"private": true,
55
"type": "module",
66
"description": "Lightweight spec methodology for AI-powered development (monorepo root)",

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lean-spec",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "Specification-driven development made simple",
55
"type": "module",
66
"bin": {

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@leanspec/core",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "Core functionality for LeanSpec",
55
"type": "module",
66
"main": "./dist/index.js",

packages/mcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"LICENSE"
3030
],
3131
"dependencies": {
32-
"lean-spec": "^0.2.4"
32+
"lean-spec": "^0.2.5"
3333
},
3434
"engines": {
3535
"node": ">=20"

packages/ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@leanspec/ui",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "LeanSpec web UI launcher for visual spec management",
55
"type": "module",
66
"bin": {
@@ -23,7 +23,7 @@
2323
"files": [
2424
"bin/",
2525
".next/standalone/packages/",
26-
".next/standalone/node_modules/",
26+
".next/standalone/node_modules/.pnpm/",
2727
".next/static/",
2828
"public/",
2929
"README.md",
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
status: complete
3+
created: '2025-11-18'
4+
tags:
5+
- packaging
6+
- bug-fix
7+
priority: high
8+
created_at: '2025-11-18T09:26:38.346Z'
9+
updated_at: '2025-11-18T09:28:17.735Z'
10+
transitions:
11+
- status: in-progress
12+
at: '2025-11-18T09:27:10.441Z'
13+
- status: complete
14+
at: '2025-11-18T09:28:17.735Z'
15+
completed_at: '2025-11-18T09:28:17.735Z'
16+
completed: '2025-11-18'
17+
---
18+
19+
# Fix @leanspec/ui standalone packaging issue
20+
21+
> **Status**: ✅ Complete · **Priority**: High · **Created**: 2025-11-18 · **Tags**: packaging, bug-fix
22+
23+
**Project**: lean-spec
24+
**Team**: Core Development
25+
26+
## Overview
27+
28+
The published `@leanspec/[email protected]` package fails to run with error `Cannot find module 'next'`. This occurs because Next.js standalone build creates symlinks in `node_modules/`, but npm pack doesn't follow symlinks by default, resulting in missing dependencies in the published package.
29+
30+
**Root Cause**: The `files` field in `package.json` included `.next/standalone/node_modules/` which only contains symlinks pointing to `.next/standalone/node_modules/.pnpm/`. When npm packs the tarball, these symlinks aren't resolved.
31+
32+
**Impact**: Users running `lean-spec ui` via the published npm package cannot start the UI server.
33+
34+
## Design
35+
36+
**Solution**: Update the `files` field in `packages/ui/package.json` to include the actual pnpm store location:
37+
38+
```json
39+
"files": [
40+
"bin/",
41+
".next/standalone/packages/",
42+
".next/standalone/node_modules/.pnpm/", // Changed from .next/standalone/node_modules/
43+
".next/static/",
44+
"public/",
45+
"README.md",
46+
"LICENSE"
47+
]
48+
```
49+
50+
This ensures actual dependency files (not just symlinks) are included in the published package.
51+
52+
**Version Alignment**: All packages bumped to `0.2.5`:
53+
- `@leanspec/ui`: 0.2.4 → 0.2.5
54+
- `@leanspec/core`: 0.2.4 → 0.2.5
55+
- `lean-spec`: 0.2.4 → 0.2.5
56+
- `@leanspec/mcp`: Already at 0.2.5
57+
58+
## Plan
59+
60+
- [x] Update `packages/ui/package.json` files field
61+
- [x] Bump all package versions to 0.2.5
62+
- [x] Update cross-package dependencies
63+
- [ ] Build and test locally
64+
- [ ] Publish updated packages
65+
66+
## Test
67+
68+
**Verification Steps**:
69+
1. Build the UI package: `pnpm --filter @leanspec/ui build`
70+
2. Pack locally: `npm pack --dry-run` and verify `next` module is included
71+
3. Test installation in separate directory:
72+
```bash
73+
cd /tmp/test-leanspec-ui
74+
npm install @leanspec/[email protected]
75+
npx leanspec-ui --specs /path/to/specs
76+
```
77+
4. Verify UI starts without "Cannot find module 'next'" error
78+
79+
## Notes
80+
81+
**Package Size**: With this change, the published package is ~18.3 MB compressed (65 MB unpacked), which is reasonable for a Next.js standalone app.
82+
83+
**Future Improvement**: Consider documenting version alignment strategy in CONTRIBUTING.md or creating a release script to ensure versions stay in sync.

0 commit comments

Comments
 (0)