Skip to content

Commit 8cf9d45

Browse files
committed
[memory-bank] Tell cline how to build components
Tool: gitpod/catfood.gitpod.cloud
1 parent fabaae8 commit 8cf9d45

File tree

4 files changed

+113
-14
lines changed

4 files changed

+113
-14
lines changed

memory-bank/.clinerules

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,35 @@ This file captures important patterns, preferences, and project intelligence tha
2626

2727
## Development Workflow
2828

29-
- **Build System**: Use Leeway for building components
30-
- `leeway build` to build specific components
31-
- `leeway exec` to run commands across components
29+
- **Build Approaches**:
30+
- **In-tree builds** (primary for local development):
31+
- TypeScript components: Use `yarn` commands defined in package.json
32+
- `yarn build`: Compile the component
33+
- `yarn test`: Run tests
34+
- `yarn lint`: Check code style
35+
- `yarn watch`: Watch for changes and rebuild
36+
- Go components: Use standard Go tools
37+
- `go build ./...`: Build all packages
38+
- `go test ./...`: Test all packages
39+
- `go run main.go`: Build and run
40+
41+
- **Out-of-tree builds** (Leeway, primary for CI):
42+
- `leeway build components/component-name:app`: Build a specific component
43+
- `leeway build -D components/component-name:app`: Build with dependencies
44+
- `leeway exec --package components/component-name:app -- command`: Run a command for a package
3245

3346
- **Testing**:
3447
- Unit tests alongside code
3548
- Integration tests in separate directories
3649
- End-to-end tests in the `test/` directory
50+
- Component-specific test commands in package.json (for TypeScript)
51+
- Go tests use standard `go test` command
3752

3853
- **Local Development**:
3954
- Use Gitpod workspaces for development (dogfooding)
4055
- Components can be run individually for testing
4156
- Preview environments for testing changes
57+
- Use in-tree builds for rapid iteration during development
4258

4359
## Critical Implementation Paths
4460

@@ -102,6 +118,23 @@ This section will be updated as I learn about how and why certain architectural
102118

103119
This section will be updated as I learn about specific user preferences for working with the codebase.
104120

121+
## Build and Test Information
122+
123+
When working with components, I should always document:
124+
125+
- **Build Commands**: Document any new or component-specific build commands I encounter
126+
- **Test Commands**: Document how to run tests for each component
127+
- **Dependencies**: Note any special dependencies required for building or testing
128+
- **Common Issues**: Document common build or test issues and their solutions
129+
- **Performance Considerations**: Note any performance considerations for builds
130+
131+
Whenever I encounter new build patterns or commands, I should update:
132+
1. The relevant component documentation in `memory-bank/components/`
133+
2. The `.clinerules` file with general patterns
134+
3. The `techContext.md` file if it represents a significant pattern
135+
136+
This information is critical for effective development work, as being able to build and test components is fundamental to making changes and verifying their correctness.
137+
105138
---
106139

107140
Note: This file will be continuously updated as I work with the Gitpod codebase and discover new patterns, preferences, and insights.

memory-bank/activeContext.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ The immediate next steps are:
6363

6464
1. **Explore Component Interactions**: Understand how components interact with each other
6565
2. **Set Up Development Environment**: Configure a local development environment for effective testing
66-
3. **Identify Initial Tasks**: Determine specific tasks or improvements to focus on
67-
4. **Establish Testing Approach**: Define how changes will be tested and validated
68-
5. **Update Memory Bank**: Continue to refine and expand the memory bank as new information is discovered
66+
3. **Explore Build System**: Gain hands-on experience with both in-tree and Leeway builds
67+
4. **Test Component Builds**: Practice building and testing different component types
68+
5. **Identify Initial Tasks**: Determine specific tasks or improvements to focus on
69+
6. **Establish Testing Approach**: Define how changes will be tested and validated
70+
7. **Update Memory Bank**: Continue to refine and expand the memory bank as new information is discovered
6971

7072
## Active Decisions and Considerations
7173

@@ -115,5 +117,15 @@ Initial exploration of the Gitpod codebase has revealed:
115117
- Go services typically have a cmd/ directory with command implementations
116118
- TypeScript services use React and modern frontend practices
117119
- Most components have a clear separation between API definitions and implementations
120+
- **Build System Approaches**: Gitpod uses two primary approaches for building components:
121+
- **In-tree builds**: Using language-specific tools (yarn, go) directly in the workspace
122+
- Primary method for local development
123+
- TypeScript components use commands defined in package.json (yarn build, yarn test, etc.)
124+
- Go components use standard Go tools (go build, go test, etc.)
125+
- **Out-of-tree builds**: Using Leeway, a custom build tool
126+
- Primary method for CI to generate build artifacts
127+
- Works by copying relevant sources into a separate file tree
128+
- Can also be run from inside the workspace
129+
- Manages complex dependencies between components
118130

119131
This section will be continuously updated as new insights are gained through working with the system.

memory-bank/progress.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ The existing functionality of the Gitpod platform:
6868
## What's Left to Build
6969

7070
### Immediate Tasks
71-
- Explore component interactios
71+
- Explore component interactions
7272
- Set up local development environment
73+
- Explore build system approaches (in-tree and Leeway)
74+
- Test component builds for different component types
7375
- Identify specific components for deeper exploration
7476
- Establish testing methodology
7577
- Create initial contribution plan
@@ -166,6 +168,14 @@ No specific blockers or dependencies have been identified yet. This section will
166168
- Documented scheduler-extender component
167169
- Documented ipfs component
168170

171+
- **2/27/2025**:
172+
- Documented build system approaches:
173+
- In-tree builds using language-specific tools (yarn, go)
174+
- Out-of-tree builds using Leeway
175+
- Updated techContext.md with detailed build process information
176+
- Updated .clinerules with build patterns and commands
177+
- Added build information tracking to memory bank maintenance procedures
178+
169179
## Next Evaluation Point
170180

171181
The next evaluation of progress will occur after:

memory-bank/techContext.md

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,57 @@ The project uses a Gitpod-based development workflow (dogfooding), with the foll
4242
4. **Dev Containers**: Development occurs in containers that mirror production
4343

4444
### Build Process
45-
1. **Leeway**: Custom build system that manages the complex dependencies between components
46-
2. **Component Compilation**: Each component is compiled independently
47-
- TypeScript components use `yarn build`
48-
- Go components use `go build`
49-
- Java components use Gradle
50-
3. **Docker Images**: Components are packaged as Docker images
51-
4. **Helm Charts**: Deployment configurations are managed as Helm charts
45+
46+
Gitpod uses two primary approaches for building components:
47+
48+
#### 1. In-tree Builds (Primary for Local Development)
49+
Components are built directly in the workspace using language-specific tools:
50+
51+
- **TypeScript/JavaScript Components**:
52+
- Commands are defined in each component's `package.json`
53+
- Common commands:
54+
- `yarn build`: Compiles the component
55+
- `yarn test`: Runs unit tests
56+
- `yarn lint`: Checks code style
57+
- `yarn watch`: Watches for changes and rebuilds automatically
58+
- Example (from server component):
59+
```bash
60+
cd components/server
61+
yarn build # Build the component
62+
yarn test:unit # Run unit tests
63+
yarn test:db # Run database tests
64+
```
65+
66+
- **Go Components**:
67+
- Use standard Go tools
68+
- Common commands:
69+
- `go build`: Compiles the component
70+
- `go test`: Runs tests
71+
- `go run`: Builds and runs the component
72+
- Example:
73+
```bash
74+
cd components/ws-daemon
75+
go build ./... # Build all packages
76+
go test ./... # Test all packages
77+
```
78+
79+
#### 2. Leeway Builds (Out-of-tree, Primary for CI)
80+
Leeway is a custom build tool that:
81+
- Copies relevant sources into a separate file tree
82+
- Manages complex dependencies between components
83+
- Generates build artifacts for CI/CD pipelines
84+
- Can also be run from inside the workspace
85+
86+
Common Leeway commands:
87+
```bash
88+
leeway build components/server:app # Build a specific component
89+
leeway build -D components/server:app # Build with dependencies
90+
leeway exec --package components/server:app -- yarn test # Run a command for a package
91+
```
92+
93+
#### 3. Component Packaging
94+
- **Docker Images**: Components are packaged as Docker images using `leeway.Dockerfile` files
95+
- **Helm Charts**: Deployment configurations are managed as Helm charts for Kubernetes deployment
5296

5397
### Testing Strategy
5498
1. **Unit Tests**: Component-level tests for individual functions and classes

0 commit comments

Comments
 (0)