Created 10 detailed GitHub issues covering: - Project activation and management UI (#1-2) - Worker node coordination and visualization (#3-4) - Automated GitHub repository scanning (#5) - Intelligent model-to-issue matching (#6) - Multi-model task execution system (#7) - N8N workflow integration (#8) - Hive-Bzzz P2P bridge (#9) - Peer assistance protocol (#10) Each issue includes detailed specifications, acceptance criteria, technical implementation notes, and dependency mapping. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
47 lines
1.9 KiB
JavaScript
47 lines
1.9 KiB
JavaScript
import { getDocblock } from '../utils/docblock.js';
|
|
import isReactForwardRefCall from '../utils/isReactForwardRefCall.js';
|
|
import resolveToValue from '../utils/resolveToValue.js';
|
|
function getDocblockFromComponent(path) {
|
|
let description = null;
|
|
if (path.isClassDeclaration() || path.isClassExpression()) {
|
|
const decorators = path.get('decorators');
|
|
// If we have a class declaration or expression, then the comment might be
|
|
// attached to the last decorator instead as trailing comment.
|
|
if (decorators && decorators.length > 0) {
|
|
description = getDocblock(decorators[decorators.length - 1], true);
|
|
}
|
|
}
|
|
if (description == null) {
|
|
// Find parent statement (e.g. var Component = React.createClass(<path>);)
|
|
let searchPath = path;
|
|
while (searchPath && !searchPath.isStatement()) {
|
|
searchPath = searchPath.parentPath;
|
|
}
|
|
if (searchPath) {
|
|
// If the parent is an export statement, we have to traverse one more up
|
|
if (searchPath.parentPath.isExportNamedDeclaration() ||
|
|
searchPath.parentPath.isExportDefaultDeclaration()) {
|
|
searchPath = searchPath.parentPath;
|
|
}
|
|
description = getDocblock(searchPath);
|
|
}
|
|
}
|
|
if (!description) {
|
|
const searchPath = isReactForwardRefCall(path)
|
|
? path.get('arguments')[0]
|
|
: path;
|
|
const inner = resolveToValue(searchPath);
|
|
if (inner.node !== path.node) {
|
|
return getDocblockFromComponent(inner);
|
|
}
|
|
}
|
|
return description;
|
|
}
|
|
/**
|
|
* Finds the nearest block comment before the component definition.
|
|
*/
|
|
const componentDocblockHandler = function (documentation, componentDefinition) {
|
|
documentation.set('description', getDocblockFromComponent(componentDefinition) || '');
|
|
};
|
|
export default componentDocblockHandler;
|