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:
Dandelion Mané 2018-10-29 23:49:53 +00:00 committed by GitHub
parent 917b793aca
commit 5f2cc56172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 30 deletions

18
src/analysis/types.js Normal file
View File

@ -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,
|};

View File

@ -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";

View File

@ -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";

View File

@ -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;

View File

@ -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,

View File

@ -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`

View File

@ -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";