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>
42 lines
1.5 KiB
JavaScript
42 lines
1.5 KiB
JavaScript
import isReactComponentClass from './isReactComponentClass.js';
|
|
import isReactCreateClassCall from './isReactCreateClassCall.js';
|
|
import isReactForwardRefCall from './isReactForwardRefCall.js';
|
|
import isStatelessComponent from './isStatelessComponent.js';
|
|
import normalizeClassDefinition from './normalizeClassDefinition.js';
|
|
import resolveHOC from './resolveHOC.js';
|
|
import resolveToValue from './resolveToValue.js';
|
|
function isComponentDefinition(path) {
|
|
return (isReactCreateClassCall(path) ||
|
|
isReactComponentClass(path) ||
|
|
isStatelessComponent(path) ||
|
|
isReactForwardRefCall(path));
|
|
}
|
|
function resolveComponentDefinition(definition) {
|
|
if (isReactCreateClassCall(definition)) {
|
|
// return argument
|
|
const resolvedPath = resolveToValue(definition.get('arguments')[0]);
|
|
if (resolvedPath.isObjectExpression()) {
|
|
return resolvedPath;
|
|
}
|
|
}
|
|
else if (isReactComponentClass(definition)) {
|
|
normalizeClassDefinition(definition);
|
|
return definition;
|
|
}
|
|
else if (isStatelessComponent(definition) ||
|
|
isReactForwardRefCall(definition)) {
|
|
return definition;
|
|
}
|
|
return null;
|
|
}
|
|
export default function findComponentDefinition(path) {
|
|
let resolvedPath = path;
|
|
if (!isComponentDefinition(resolvedPath)) {
|
|
resolvedPath = resolveToValue(resolveHOC(resolvedPath));
|
|
if (!isComponentDefinition(resolvedPath)) {
|
|
return null;
|
|
}
|
|
}
|
|
return resolveComponentDefinition(resolvedPath);
|
|
}
|