owner | approved | decision | choice |
---|---|---|---|
TBD |
TBD |
Approved |
Feature-based Directory Structure |
Item | Description |
---|---|
Status | Completed |
Owner | TBD |
Approved | TBD |
Due Date | Completed |
Decision | Yes |
Need a maintainable and scalable file structure that:
- Separates concerns
- Makes testing easy
- Supports future expansion
- Maintains clear dependencies
- Provides intuitive organization
-
Project Requirements:
- CLI tool with multiple commands
- Shared utilities
- Test files and mocks
- Configuration files
- Documentation
-
Common Patterns:
- Feature-based organization
- Test files next to source
- Centralized utilities
- Separate mock data
- Documentation in docs
A feature-based directory structure that:
- Groups related functionality
- Keeps tests close to implementation
- Centralizes shared code
- Separates configuration
- Isolates test data
Option 1: Flat Structure | Option 2: Feature-based | |
---|---|---|
Overview | All files in root | Organized by feature |
Benefits | - Simple imports - Easy to find files - No nesting |
- Clear boundaries - Scalable - Feature isolation |
Risks | - Gets messy with scale - No clear organization |
- Deeper imports - More directories |
.
├── scripts/ # CLI Commands
│ ├── all-spaces.js # Scrape all spaces
│ └── all-space-content.js # Scrape single space
├── utils/ # Shared Utilities
│ └── index.js # API client, helpers
└── docs/ # Documentation
├── api-integration.md
├── file-structure.md
├── error-handling.md
└── cli-interface.md
Decision | Status | Next Steps |
---|---|---|
Feature-based Structure | Completed |
- Add README to each dir - Document patterns |
Documentation | In Progress |
- Add architecture docs - Add contributing guide |
Key structural elements:
- package.json - Project structure and scripts
- scripts/ - CLI command implementations
- utils/ - Shared code
- docs/ - Documentation
File Organization Patterns:
- Command Pattern:
scripts/ ├── all-spaces.js # Main command └── all-space-content.js # Sub-command