Treehouse for developers. Branches are git branches, leaves are features, roots are dependencies, termites are bugs.
- JavaScript 100%
| node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 | ||
| src | ||
| tests | ||
| package.json | ||
| README.md | ||
code-treehouse
Treehouse for developers. Branches are git branches, leaves are features, roots are dependencies, termites are bugs.
Usage
const { Treehouse, SEASONS } = require('./src/treehouse');
const th = new Treehouse('Great Oak');
th.hireBuilder('Alice', 5);
// Create branches
th.createBranch('feature/auth');
th.createBranch('feature/payments');
// Plant features (leaves)
th.plantLeaf('feature/auth', 'login-form', 'feature');
th.plantLeaf('feature/auth', 'jwt-tokens', 'feature');
th.plantLeaf('main', 'unit-tests', 'test');
// Build platforms
th.buildPlatform('main', 'Lookout Tower');
// Merge branches
th.mergeBranch('feature/auth');
// Time passes
for (let i = 0; i < 10; i++) th.tick();
th.setSeason(SEASONS.AUTUMN);
th.prune('main');
console.log(th.treeView());
console.log(th.report());
Components
- Branch — Git branches with leaves, integrity, termites, platforms, bridges
- Leaf — Features with health/maturity/growth, seasonal colors, can fall
- Root — Dependencies (npm, postgres, redis, docker) that feed the tree, can rot
- Termite — Bugs eating branches, severity-based damage
- Treehouse — Seasons, builders, merge system, ASCII tree cross-section