Move PluginAdapter to core (#615)

There's no reason for it to be in `app` - the concepts it contains are
core concepts, e.g. node types and graphs.

For now I'm leaving the `NodeType` and `EdgeType` interfaces with the
PluginAdapter. They may move later, but I'm relucant to clutter the
graph class more, and all I need for now is that they live in core.

Test plan: It's just a move/rename, so `yarn test` is amply sufficient.
This commit is contained in:
Dandelion Mané 2018-08-07 11:23:00 -07:00 committed by GitHub
parent f448960105
commit 25b0124b56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,7 @@ import type {
ScoredConnection, ScoredConnection,
} from "../../core/attribution/pagerankNodeDecomposition"; } from "../../core/attribution/pagerankNodeDecomposition";
import type {Connection} from "../../core/attribution/graphToMarkovChain"; import type {Connection} from "../../core/attribution/graphToMarkovChain";
import type {DynamicPluginAdapter} from "../pluginAdapter"; import type {DynamicPluginAdapter} from "../../core/pluginAdapter";
import * as NullUtil from "../../util/null"; import * as NullUtil from "../../util/null";
// TODO: Factor this out and test it (#465) // TODO: Factor this out and test it (#465)

View File

@ -2,7 +2,7 @@
import React from "react"; import React from "react";
import {shallow} from "enzyme"; import {shallow} from "enzyme";
import type {DynamicPluginAdapter} from "../pluginAdapter"; import type {DynamicPluginAdapter} from "../../core/pluginAdapter";
import { import {
PagerankTable, PagerankTable,

View File

@ -15,7 +15,7 @@ import {byEdgeType, byNodeType} from "./edgeWeights";
import * as MapUtil from "../../util/map"; import * as MapUtil from "../../util/map";
import * as NullUtil from "../../util/null"; import * as NullUtil from "../../util/null";
import type {StaticPluginAdapter} from "../pluginAdapter"; import type {StaticPluginAdapter} from "../../core/pluginAdapter";
import {StaticPluginAdapter as GithubAdapter} from "../../plugins/github/pluginAdapter"; import {StaticPluginAdapter as GithubAdapter} from "../../plugins/github/pluginAdapter";
import {StaticPluginAdapter as GitAdapter} from "../../plugins/git/pluginAdapter"; import {StaticPluginAdapter as GitAdapter} from "../../plugins/git/pluginAdapter";

View File

@ -12,7 +12,7 @@ import {
pagerank, pagerank,
} from "../../core/attribution/pagerank"; } from "../../core/attribution/pagerank";
import type {DynamicPluginAdapter} from "../pluginAdapter"; import type {DynamicPluginAdapter} from "../../core/pluginAdapter";
import {StaticPluginAdapter as GitAdapter} from "../../plugins/git/pluginAdapter"; import {StaticPluginAdapter as GitAdapter} from "../../plugins/git/pluginAdapter";
import {StaticPluginAdapter as GithubAdapter} from "../../plugins/github/pluginAdapter"; import {StaticPluginAdapter as GithubAdapter} from "../../plugins/github/pluginAdapter";

View File

@ -1,7 +1,7 @@
// @flow // @flow
import type {Graph, NodeAddressT, EdgeAddressT} from "../core/graph"; import type {Graph, NodeAddressT, EdgeAddressT} from "./graph";
import type {Repo} from "../core/repo"; import type {Repo} from "./repo";
export type EdgeType = {| export type EdgeType = {|
+forwardName: string, +forwardName: string,

View File

@ -2,7 +2,7 @@
import type { import type {
StaticPluginAdapter as IStaticPluginAdapter, StaticPluginAdapter as IStaticPluginAdapter,
DynamicPluginAdapter as IDynamicPluginAdapter, DynamicPluginAdapter as IDynamicPluginAdapter,
} from "../../app/pluginAdapter"; } from "../../core/pluginAdapter";
import {Graph} from "../../core/graph"; import {Graph} from "../../core/graph";
import * as N from "./nodes"; import * as N from "./nodes";
import * as E from "./edges"; import * as E from "./edges";
@ -64,7 +64,7 @@ export class StaticPluginAdapter implements IStaticPluginAdapter {
} }
const json = await response.json(); const json = await response.json();
const graph = Graph.fromJSON(json); const graph = Graph.fromJSON(json);
return new DynamicPluginAdapter(graph); return (new DynamicPluginAdapter(graph): IDynamicPluginAdapter);
} }
} }

View File

@ -2,7 +2,7 @@
import type { import type {
StaticPluginAdapter as IStaticPluginAdapter, StaticPluginAdapter as IStaticPluginAdapter,
DynamicPluginAdapter as IDynamicPluginAdapater, DynamicPluginAdapter as IDynamicPluginAdapater,
} from "../../app/pluginAdapter"; } from "../../core/pluginAdapter";
import {type Graph, NodeAddress} from "../../core/graph"; import {type Graph, NodeAddress} from "../../core/graph";
import {createGraph} from "./createGraph"; import {createGraph} from "./createGraph";
import * as N from "./nodes"; import * as N from "./nodes";