Move `{Node,Edge}Type` to src/analysis/types.js (#946)
Test plan: `yarn test` Part of ongoing work on #704
This commit is contained in:
parent
917b793aca
commit
5f2cc56172
|
@ -0,0 +1,18 @@
|
||||||
|
// @flow
|
||||||
|
|
||||||
|
import {type NodeAddressT, type EdgeAddressT} from "../core/graph";
|
||||||
|
|
||||||
|
export type EdgeType = {|
|
||||||
|
+forwardName: string,
|
||||||
|
+backwardName: string,
|
||||||
|
+defaultForwardWeight: number,
|
||||||
|
+defaultBackwardWeight: number,
|
||||||
|
+prefix: EdgeAddressT,
|
||||||
|
|};
|
||||||
|
|
||||||
|
export type NodeType = {|
|
||||||
|
+name: string,
|
||||||
|
+pluralName: string,
|
||||||
|
+prefix: NodeAddressT,
|
||||||
|
+defaultWeight: number,
|
||||||
|
|};
|
|
@ -5,12 +5,8 @@ import {NodeTrie, EdgeTrie} from "../../core/trie";
|
||||||
import type {Assets} from "../assets";
|
import type {Assets} from "../assets";
|
||||||
import type {RepoId} from "../../core/repoId";
|
import type {RepoId} from "../../core/repoId";
|
||||||
|
|
||||||
import type {
|
import type {StaticPluginAdapter, DynamicPluginAdapter} from "./pluginAdapter";
|
||||||
StaticPluginAdapter,
|
import type {EdgeType, NodeType} from "../../analysis/types";
|
||||||
DynamicPluginAdapter,
|
|
||||||
NodeType,
|
|
||||||
EdgeType,
|
|
||||||
} from "./pluginAdapter";
|
|
||||||
|
|
||||||
import {FallbackStaticAdapter} from "./fallbackAdapter";
|
import {FallbackStaticAdapter} from "./fallbackAdapter";
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,8 @@ import {
|
||||||
type NodeAddressT,
|
type NodeAddressT,
|
||||||
EdgeAddress,
|
EdgeAddress,
|
||||||
} from "../../core/graph";
|
} from "../../core/graph";
|
||||||
import type {
|
import type {StaticPluginAdapter, DynamicPluginAdapter} from "./pluginAdapter";
|
||||||
StaticPluginAdapter,
|
import type {EdgeType, NodeType} from "../../analysis/types";
|
||||||
DynamicPluginAdapter,
|
|
||||||
EdgeType,
|
|
||||||
NodeType,
|
|
||||||
} from "./pluginAdapter";
|
|
||||||
|
|
||||||
import {StaticAdapterSet} from "./adapterSet";
|
import {StaticAdapterSet} from "./adapterSet";
|
||||||
import {makeRepoId, type RepoId} from "../../core/repoId";
|
import {makeRepoId, type RepoId} from "../../core/repoId";
|
||||||
|
|
|
@ -4,21 +4,7 @@ import {type Node as ReactNode} from "react";
|
||||||
import {Graph, type NodeAddressT, type EdgeAddressT} from "../../core/graph";
|
import {Graph, type NodeAddressT, type EdgeAddressT} from "../../core/graph";
|
||||||
import type {Assets} from "../assets";
|
import type {Assets} from "../assets";
|
||||||
import type {RepoId} from "../../core/repoId";
|
import type {RepoId} from "../../core/repoId";
|
||||||
|
import type {EdgeType, NodeType} from "../../analysis/types";
|
||||||
export type EdgeType = {|
|
|
||||||
+forwardName: string,
|
|
||||||
+backwardName: string,
|
|
||||||
+defaultForwardWeight: number,
|
|
||||||
+defaultBackwardWeight: number,
|
|
||||||
+prefix: EdgeAddressT,
|
|
||||||
|};
|
|
||||||
|
|
||||||
export type NodeType = {|
|
|
||||||
+name: string,
|
|
||||||
+pluralName: string,
|
|
||||||
+prefix: NodeAddressT,
|
|
||||||
+defaultWeight: number,
|
|
||||||
|};
|
|
||||||
|
|
||||||
export interface StaticPluginAdapter {
|
export interface StaticPluginAdapter {
|
||||||
name(): string;
|
name(): string;
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {shallow} from "enzyme";
|
||||||
|
|
||||||
import * as NullUtil from "../../../util/null";
|
import * as NullUtil from "../../../util/null";
|
||||||
import {NodeAddress, EdgeAddress} from "../../../core/graph";
|
import {NodeAddress, EdgeAddress} from "../../../core/graph";
|
||||||
import type {NodeType, EdgeType} from "../../adapters/pluginAdapter";
|
import type {EdgeType, NodeType} from "../../../analysis/types";
|
||||||
import {
|
import {
|
||||||
AggregationRowList,
|
AggregationRowList,
|
||||||
AggregationRow,
|
AggregationRow,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import sortBy from "lodash.sortby";
|
||||||
import stringify from "json-stable-stringify";
|
import stringify from "json-stable-stringify";
|
||||||
import * as MapUtil from "../../../util/map";
|
import * as MapUtil from "../../../util/map";
|
||||||
import {NodeTrie, EdgeTrie} from "../../../core/trie";
|
import {NodeTrie, EdgeTrie} from "../../../core/trie";
|
||||||
import type {NodeType, EdgeType} from "../../adapters/pluginAdapter";
|
import type {EdgeType, NodeType} from "../../../analysis/types";
|
||||||
import type {ScoredConnection} from "../../../analysis/pagerankNodeDecomposition";
|
import type {ScoredConnection} from "../../../analysis/pagerankNodeDecomposition";
|
||||||
|
|
||||||
// Sorted by descending `summary.score`
|
// Sorted by descending `summary.score`
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import * as MapUtil from "../../../util/map";
|
import * as MapUtil from "../../../util/map";
|
||||||
import {type NodeAddressT, type EdgeAddressT} from "../../../core/graph";
|
import {type NodeAddressT, type EdgeAddressT} from "../../../core/graph";
|
||||||
import type {NodeType, EdgeType} from "../../adapters/pluginAdapter";
|
import type {EdgeType, NodeType} from "../../../analysis/types";
|
||||||
import type {StaticPluginAdapter} from "../../adapters/pluginAdapter";
|
import type {StaticPluginAdapter} from "../../adapters/pluginAdapter";
|
||||||
import type {StaticAdapterSet} from "../../adapters/adapterSet";
|
import type {StaticAdapterSet} from "../../adapters/adapterSet";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue