From c997f4e1ec75c40cdb803856b48bf7f2f855008f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dandelion=20Man=C3=A9?= Date: Wed, 31 Oct 2018 21:24:25 -0700 Subject: [PATCH] Collect web-related utilities in `webutil/` (#970) I'm planning to pull `credExplorer` out of `app` and into its own top-level module. This is a bit awkward, as `credExplorer` depends on a lot of little modules that are currently collected in `app/`. To resolve this, I pull all of these little utility modules into `webutil/`. It's not a totally principled grouping, but it's quite convenient and keeps these rarely changing modules out of the way. Test plan: It's a file move, `yarn test` suffices. --- src/app/ExternalRedirect.js | 2 +- src/app/HomePage.js | 4 ++-- src/app/Page.js | 6 +++--- src/app/adapters/adapterSet.js | 2 +- src/app/adapters/adapterSet.test.js | 2 +- src/app/adapters/appAdapter.js | 2 +- src/app/adapters/fallbackAdapter.js | 2 +- src/app/createRoutes.js | 2 +- src/app/credExplorer/App.js | 10 +++++----- src/app/credExplorer/App.test.js | 6 +++--- src/app/credExplorer/RepositorySelect.js | 4 ++-- src/app/credExplorer/RepositorySelect.test.js | 8 ++++---- src/app/credExplorer/pagerankTable/Aggregation.test.js | 2 +- src/app/credExplorer/pagerankTable/Connection.test.js | 2 +- src/app/credExplorer/pagerankTable/Node.test.js | 2 +- src/app/credExplorer/pagerankTable/Table.test.js | 2 +- src/app/credExplorer/pagerankTable/TableRow.test.js | 2 +- src/app/credExplorer/state.js | 2 +- src/app/credExplorer/state.test.js | 2 +- src/app/credExplorer/weights/EdgeTypeConfig.test.js | 2 +- src/app/credExplorer/weights/NodeTypeConfig.test.js | 2 +- .../credExplorer/weights/PluginWeightConfig.test.js | 2 +- src/app/credExplorer/weights/WeightConfig.test.js | 2 +- src/app/credExplorer/weights/WeightSlider.test.js | 2 +- src/app/index.js | 2 +- src/app/routeData.js | 2 +- src/app/server.js | 4 ++-- src/plugins/demo/appAdapter.js | 2 +- src/plugins/git/appAdapter.js | 2 +- src/plugins/git/render.js | 2 +- src/plugins/git/render.test.js | 4 ++-- src/plugins/github/appAdapter.js | 2 +- src/plugins/github/render.js | 2 +- src/plugins/github/render.test.js | 4 ++-- src/{app => webutil}/Colors.js | 0 src/{app => webutil}/Link.js | 0 src/{app => webutil}/Link.test.js | 2 +- src/{app => webutil}/assets.js | 0 src/{app => webutil}/assets.test.js | 2 +- src/{app => webutil}/browserLocalStore.js | 0 src/{app => webutil}/checkedLocalStore.js | 0 src/{app => webutil}/checkedLocalStore.test.js | 2 +- src/{app => webutil}/createRelativeHistory.js | 0 src/{app => webutil}/createRelativeHistory.test.js | 2 +- src/{app => webutil}/localStore.js | 0 src/{app => webutil}/memoryLocalStore.js | 0 src/{app => webutil}/memoryLocalStore.test.js | 2 +- src/{app => webutil}/testLocalStore.js | 0 src/{app => webutil}/testUtil.js | 0 src/{app => webutil}/withAssets.js | 0 src/{app => webutil}/withAssets.test.js | 2 +- 51 files changed, 56 insertions(+), 56 deletions(-) rename src/{app => webutil}/Colors.js (100%) rename src/{app => webutil}/Link.js (100%) rename src/{app => webutil}/Link.test.js (98%) rename src/{app => webutil}/assets.js (100%) rename src/{app => webutil}/assets.test.js (99%) rename src/{app => webutil}/browserLocalStore.js (100%) rename src/{app => webutil}/checkedLocalStore.js (100%) rename src/{app => webutil}/checkedLocalStore.test.js (98%) rename src/{app => webutil}/createRelativeHistory.js (100%) rename src/{app => webutil}/createRelativeHistory.test.js (99%) rename src/{app => webutil}/localStore.js (100%) rename src/{app => webutil}/memoryLocalStore.js (100%) rename src/{app => webutil}/memoryLocalStore.test.js (95%) rename src/{app => webutil}/testLocalStore.js (100%) rename src/{app => webutil}/testUtil.js (100%) rename src/{app => webutil}/withAssets.js (100%) rename src/{app => webutil}/withAssets.test.js (98%) diff --git a/src/app/ExternalRedirect.js b/src/app/ExternalRedirect.js index a53d8fd..0981e17 100644 --- a/src/app/ExternalRedirect.js +++ b/src/app/ExternalRedirect.js @@ -2,7 +2,7 @@ import React from "react"; -import Link from "./Link"; +import Link from "../webutil/Link"; export default class ExternalRedirect extends React.Component<{| +redirectTo: string, diff --git a/src/app/HomePage.js b/src/app/HomePage.js index d821d7b..e1b3e47 100644 --- a/src/app/HomePage.js +++ b/src/app/HomePage.js @@ -2,8 +2,8 @@ import React from "react"; -import type {Assets} from "./assets"; -import Link from "./Link"; +import type {Assets} from "../webutil/assets"; +import Link from "../webutil/Link"; export default class HomePage extends React.Component<{|+assets: Assets|}> { render() { diff --git a/src/app/Page.js b/src/app/Page.js index d1e7c47..9f3ea8d 100644 --- a/src/app/Page.js +++ b/src/app/Page.js @@ -3,9 +3,9 @@ import React, {type Node} from "react"; import {StyleSheet, css} from "aphrodite/no-important"; -import type {Assets} from "./assets"; -import Colors from "./Colors"; -import Link from "./Link"; +import type {Assets} from "../webutil/assets"; +import Colors from "../webutil/Colors"; +import Link from "../webutil/Link"; import GithubLogo from "./GithubLogo"; import TwitterLogo from "./TwitterLogo"; import DiscordLogo from "./DiscordLogo"; diff --git a/src/app/adapters/adapterSet.js b/src/app/adapters/adapterSet.js index 04d6e72..bd7767c 100644 --- a/src/app/adapters/adapterSet.js +++ b/src/app/adapters/adapterSet.js @@ -2,7 +2,7 @@ import {Graph, type NodeAddressT, type EdgeAddressT} from "../../core/graph"; import {NodeTrie, EdgeTrie} from "../../core/trie"; -import type {Assets} from "../assets"; +import type {Assets} from "../../webutil/assets"; import type {RepoId} from "../../core/repoId"; import type {StaticAppAdapter, DynamicAppAdapter} from "./appAdapter"; diff --git a/src/app/adapters/adapterSet.test.js b/src/app/adapters/adapterSet.test.js index 2056689..5eeea71 100644 --- a/src/app/adapters/adapterSet.test.js +++ b/src/app/adapters/adapterSet.test.js @@ -9,7 +9,7 @@ import { fallbackNodeType, fallbackEdgeType, } from "../../analysis/fallbackDeclaration"; -import {Assets} from "../assets"; +import {Assets} from "../../webutil/assets"; import {makeRepoId} from "../../core/repoId"; describe("app/adapters/adapterSet", () => { diff --git a/src/app/adapters/appAdapter.js b/src/app/adapters/appAdapter.js index e2dbc87..7c291b7 100644 --- a/src/app/adapters/appAdapter.js +++ b/src/app/adapters/appAdapter.js @@ -2,7 +2,7 @@ import {type Node as ReactNode} from "react"; import {Graph, type NodeAddressT} from "../../core/graph"; -import type {Assets} from "../assets"; +import type {Assets} from "../../webutil/assets"; import type {RepoId} from "../../core/repoId"; import type {PluginDeclaration} from "../../analysis/pluginDeclaration"; diff --git a/src/app/adapters/fallbackAdapter.js b/src/app/adapters/fallbackAdapter.js index b729ecc..568e0e6 100644 --- a/src/app/adapters/fallbackAdapter.js +++ b/src/app/adapters/fallbackAdapter.js @@ -5,7 +5,7 @@ import type { StaticAppAdapter, DynamicAppAdapter, } from "../../app/adapters/appAdapter"; -import {Assets} from "../../app/assets"; +import {Assets} from "../../webutil/assets"; import {type RepoId} from "../../core/repoId"; import {Graph, NodeAddress, type NodeAddressT} from "../../core/graph"; diff --git a/src/app/createRoutes.js b/src/app/createRoutes.js index bf8786e..7659707 100644 --- a/src/app/createRoutes.js +++ b/src/app/createRoutes.js @@ -5,7 +5,7 @@ import {IndexRoute, Route} from "react-router"; import Page from "./Page"; import ExternalRedirect from "./ExternalRedirect"; -import withAssets from "./withAssets"; +import withAssets from "../webutil/withAssets"; import {routeData} from "./routeData"; export function createRoutes() { diff --git a/src/app/credExplorer/App.js b/src/app/credExplorer/App.js index 2ae687f..4845dba 100644 --- a/src/app/credExplorer/App.js +++ b/src/app/credExplorer/App.js @@ -2,11 +2,11 @@ import React from "react"; -import type {Assets} from "../assets"; -import type {LocalStore} from "../localStore"; -import CheckedLocalStore from "../checkedLocalStore"; -import BrowserLocalStore from "../browserLocalStore"; -import Link from "../Link"; +import type {Assets} from "../../webutil/assets"; +import type {LocalStore} from "../../webutil/localStore"; +import CheckedLocalStore from "../../webutil/checkedLocalStore"; +import BrowserLocalStore from "../../webutil/browserLocalStore"; +import Link from "../../webutil/Link"; import {defaultStaticAdapters} from "../adapters/defaultPlugins"; import {PagerankTable} from "./pagerankTable/Table"; diff --git a/src/app/credExplorer/App.test.js b/src/app/credExplorer/App.test.js index 9aa0bcf..5239c46 100644 --- a/src/app/credExplorer/App.test.js +++ b/src/app/credExplorer/App.test.js @@ -5,8 +5,8 @@ import {shallow} from "enzyme"; import {Graph} from "../../core/graph"; import {makeRepoId} from "../../core/repoId"; -import {Assets} from "../assets"; -import testLocalStore from "../testLocalStore"; +import {Assets} from "../../webutil/assets"; +import testLocalStore from "../../webutil/testLocalStore"; import {DynamicAdapterSet, StaticAdapterSet} from "../adapters/adapterSet"; import {FactorioStaticAdapter} from "../../plugins/demo/appAdapter"; import {defaultWeightsForAdapter} from "./weights/weights"; @@ -17,7 +17,7 @@ import {createApp, LoadingIndicator} from "./App"; import {uninitializedState} from "./state"; import {Prefix as GithubPrefix} from "../../plugins/github/nodes"; -require("../testUtil").configureEnzyme(); +require("../../webutil/testUtil").configureEnzyme(); describe("app/credExplorer/App", () => { function example() { diff --git a/src/app/credExplorer/RepositorySelect.js b/src/app/credExplorer/RepositorySelect.js index b62611b..f4070af 100644 --- a/src/app/credExplorer/RepositorySelect.js +++ b/src/app/credExplorer/RepositorySelect.js @@ -5,8 +5,8 @@ import sortBy from "lodash.sortby"; import deepEqual from "lodash.isequal"; import * as NullUtil from "../../util/null"; -import type {LocalStore} from "../localStore"; -import type {Assets} from "../assets"; +import type {LocalStore} from "../../webutil/localStore"; +import type {Assets} from "../../webutil/assets"; import {fromJSON, REPO_ID_REGISTRY_API} from "./repoIdRegistry"; import {type RepoId, stringToRepoId, repoIdToString} from "../../core/repoId"; diff --git a/src/app/credExplorer/RepositorySelect.test.js b/src/app/credExplorer/RepositorySelect.test.js index aca2e6f..93c58f4 100644 --- a/src/app/credExplorer/RepositorySelect.test.js +++ b/src/app/credExplorer/RepositorySelect.test.js @@ -3,7 +3,7 @@ import React from "react"; import {shallow, mount} from "enzyme"; import * as NullUtil from "../../util/null"; -import testLocalStore from "../testLocalStore"; +import testLocalStore from "../../webutil/testLocalStore"; import RepositorySelect, { PureRepositorySelect, LocalStoreRepositorySelect, @@ -11,7 +11,7 @@ import RepositorySelect, { type Status, REPO_ID_KEY, } from "./RepositorySelect"; -import {Assets} from "../assets"; +import {Assets} from "../../webutil/assets"; import { toJSON, @@ -20,8 +20,8 @@ import { } from "./repoIdRegistry"; import {makeRepoId} from "../../core/repoId"; -require("../testUtil").configureEnzyme(); -require("../testUtil").configureAphrodite(); +require("../../webutil/testUtil").configureEnzyme(); +require("../../webutil/testUtil").configureAphrodite(); describe("app/credExplorer/RepositorySelect", () => { beforeEach(() => { diff --git a/src/app/credExplorer/pagerankTable/Aggregation.test.js b/src/app/credExplorer/pagerankTable/Aggregation.test.js index 5fefca3..b8f3e95 100644 --- a/src/app/credExplorer/pagerankTable/Aggregation.test.js +++ b/src/app/credExplorer/pagerankTable/Aggregation.test.js @@ -18,7 +18,7 @@ import {aggregateFlat, type FlatAggregation} from "./aggregate"; import {TableRow} from "./TableRow"; import {nodes as factorioNodes} from "../../../plugins/demo/graph"; -require("../../testUtil").configureEnzyme(); +require("../../../webutil/testUtil").configureEnzyme(); describe("app/credExplorer/pagerankTable/Aggregation", () => { describe("AggregationRowList", () => { diff --git a/src/app/credExplorer/pagerankTable/Connection.test.js b/src/app/credExplorer/pagerankTable/Connection.test.js index bb9a7f0..1994845 100644 --- a/src/app/credExplorer/pagerankTable/Connection.test.js +++ b/src/app/credExplorer/pagerankTable/Connection.test.js @@ -11,7 +11,7 @@ import {TableRow} from "./TableRow"; import {NodeRow} from "./Node"; import {nodes as factorioNodes} from "../../../plugins/demo/graph"; -require("../../testUtil").configureEnzyme(); +require("../../../webutil/testUtil").configureEnzyme(); describe("app/credExplorer/pagerankTable/Connection", () => { describe("ConnectionRowList", () => { diff --git a/src/app/credExplorer/pagerankTable/Node.test.js b/src/app/credExplorer/pagerankTable/Node.test.js index e0769b2..a25071f 100644 --- a/src/app/credExplorer/pagerankTable/Node.test.js +++ b/src/app/credExplorer/pagerankTable/Node.test.js @@ -14,7 +14,7 @@ import {example} from "./sharedTestUtils"; import {NodeRowList, NodeRow, type NodeRowProps} from "./Node"; import {nodes as factorioNodes} from "../../../plugins/demo/graph"; -require("../../testUtil").configureEnzyme(); +require("../../../webutil/testUtil").configureEnzyme(); describe("app/credExplorer/pagerankTable/Node", () => { describe("NodeRowList", () => { diff --git a/src/app/credExplorer/pagerankTable/Table.test.js b/src/app/credExplorer/pagerankTable/Table.test.js index 61bdcdd..1833d71 100644 --- a/src/app/credExplorer/pagerankTable/Table.test.js +++ b/src/app/credExplorer/pagerankTable/Table.test.js @@ -12,7 +12,7 @@ import {WeightConfig} from "../weights/WeightConfig"; import {defaultWeightsForAdapter} from "../weights/weights"; import {FactorioStaticAdapter} from "../../../plugins/demo/appAdapter"; -require("../../testUtil").configureEnzyme(); +require("../../../webutil/testUtil").configureEnzyme(); describe("app/credExplorer/pagerankTable/Table", () => { describe("PagerankTable", () => { async function setup(defaultNodeFilter?: NodeAddressT) { diff --git a/src/app/credExplorer/pagerankTable/TableRow.test.js b/src/app/credExplorer/pagerankTable/TableRow.test.js index 23d32fd..0d7335b 100644 --- a/src/app/credExplorer/pagerankTable/TableRow.test.js +++ b/src/app/credExplorer/pagerankTable/TableRow.test.js @@ -5,7 +5,7 @@ import {shallow} from "enzyme"; import {TableRow, PaddingRow} from "./TableRow"; import {COLUMNS} from "./sharedTestUtils"; -require("../../testUtil").configureEnzyme(); +require("../../../webutil/testUtil").configureEnzyme(); describe("app/credExplorer/pagerankTable/TableRow", () => { function example() { diff --git a/src/app/credExplorer/state.js b/src/app/credExplorer/state.js index c0f0667..cefdc36 100644 --- a/src/app/credExplorer/state.js +++ b/src/app/credExplorer/state.js @@ -3,7 +3,7 @@ import deepEqual from "lodash.isequal"; import {Graph, type NodeAddressT} from "../../core/graph"; -import type {Assets} from "../../app/assets"; +import type {Assets} from "../../webutil/assets"; import type {RepoId} from "../../core/repoId"; import {type EdgeEvaluator} from "../../analysis/pagerank"; import { diff --git a/src/app/credExplorer/state.test.js b/src/app/credExplorer/state.test.js index 36ac818..1e71981 100644 --- a/src/app/credExplorer/state.test.js +++ b/src/app/credExplorer/state.test.js @@ -8,7 +8,7 @@ import { } from "./state"; import {Graph, NodeAddress} from "../../core/graph"; -import {Assets} from "../assets"; +import {Assets} from "../../webutil/assets"; import {makeRepoId, type RepoId} from "../../core/repoId"; import {type EdgeEvaluator} from "../../analysis/pagerank"; import type {WeightedTypes} from "../../analysis/weights"; diff --git a/src/app/credExplorer/weights/EdgeTypeConfig.test.js b/src/app/credExplorer/weights/EdgeTypeConfig.test.js index bb0034a..21ea86d 100644 --- a/src/app/credExplorer/weights/EdgeTypeConfig.test.js +++ b/src/app/credExplorer/weights/EdgeTypeConfig.test.js @@ -7,7 +7,7 @@ import {WeightSlider} from "./WeightSlider"; import {EdgeTypeConfig, EdgeWeightSlider} from "./EdgeTypeConfig"; import {assemblesEdgeType} from "../../../plugins/demo/declaration"; -require("../../testUtil").configureEnzyme(); +require("../../../webutil/testUtil").configureEnzyme(); describe("app/credExplorer/weights/EdgeTypeConfig", () => { describe("EdgeTypeConfig", () => { diff --git a/src/app/credExplorer/weights/NodeTypeConfig.test.js b/src/app/credExplorer/weights/NodeTypeConfig.test.js index 1ea00ee..71e5d3e 100644 --- a/src/app/credExplorer/weights/NodeTypeConfig.test.js +++ b/src/app/credExplorer/weights/NodeTypeConfig.test.js @@ -7,7 +7,7 @@ import {WeightSlider} from "./WeightSlider"; import {NodeTypeConfig} from "./NodeTypeConfig"; import {inserterNodeType} from "../../../plugins/demo/declaration"; -require("../../testUtil").configureEnzyme(); +require("../../../webutil/testUtil").configureEnzyme(); describe("app/credExplorer/weights/NodeTypeConfig", () => { describe("NodeTypeConfig", () => { diff --git a/src/app/credExplorer/weights/PluginWeightConfig.test.js b/src/app/credExplorer/weights/PluginWeightConfig.test.js index 150b122..94f5916 100644 --- a/src/app/credExplorer/weights/PluginWeightConfig.test.js +++ b/src/app/credExplorer/weights/PluginWeightConfig.test.js @@ -21,7 +21,7 @@ import { } from "../../../analysis/weights"; import {defaultWeightsForAdapter} from "./weights"; -require("../../testUtil").configureEnzyme(); +require("../../../webutil/testUtil").configureEnzyme(); describe("app/credExplorer/weights/PluginWeightConfig", () => { describe("PluginWeightConfig", () => { diff --git a/src/app/credExplorer/weights/WeightConfig.test.js b/src/app/credExplorer/weights/WeightConfig.test.js index 2cefc84..80d509f 100644 --- a/src/app/credExplorer/weights/WeightConfig.test.js +++ b/src/app/credExplorer/weights/WeightConfig.test.js @@ -12,7 +12,7 @@ import {FALLBACK_NAME} from "../../../analysis/fallbackDeclaration"; import {defaultWeightsForAdapterSet, defaultWeightsForAdapter} from "./weights"; import {WeightConfig} from "./WeightConfig"; -require("../../testUtil").configureEnzyme(); +require("../../../webutil/testUtil").configureEnzyme(); describe("app/credExplorer/weights/WeightConfig", () => { describe("WeightConfig", () => { diff --git a/src/app/credExplorer/weights/WeightSlider.test.js b/src/app/credExplorer/weights/WeightSlider.test.js index 648752f..01fd5b1 100644 --- a/src/app/credExplorer/weights/WeightSlider.test.js +++ b/src/app/credExplorer/weights/WeightSlider.test.js @@ -5,7 +5,7 @@ import {shallow} from "enzyme"; import {WeightSlider, formatWeight} from "./WeightSlider"; -require("../../testUtil").configureEnzyme(); +require("../../../webutil/testUtil").configureEnzyme(); describe("app/credExplorer/weights/WeightSlider", () => { describe("WeightSlider", () => { diff --git a/src/app/index.js b/src/app/index.js index 4e70af6..18f4e69 100644 --- a/src/app/index.js +++ b/src/app/index.js @@ -3,7 +3,7 @@ import React from "react"; import ReactDOM from "react-dom"; import createBrowserHistory from "history/lib/createBrowserHistory"; -import createRelativeHistory from "./createRelativeHistory"; +import createRelativeHistory from "../webutil/createRelativeHistory"; import normalize from "../util/pathNormalize"; import App from "./App"; diff --git a/src/app/routeData.js b/src/app/routeData.js index a87cdb7..b9b0e63 100644 --- a/src/app/routeData.js +++ b/src/app/routeData.js @@ -7,7 +7,7 @@ // inline syntax. /*:: -import type {Assets} from "./assets"; +import type {Assets} from "../webutil/assets"; type RouteDatum = {| +path: string, +contents: diff --git a/src/app/server.js b/src/app/server.js index 47ee4e1..4c93601 100644 --- a/src/app/server.js +++ b/src/app/server.js @@ -7,8 +7,8 @@ import ReactDOMServer from "react-dom/server"; import {match, RouterContext} from "react-router"; import Page from "./Page"; -import {Assets, rootFromPath} from "./assets"; -import createRelativeHistory from "./createRelativeHistory"; +import {Assets, rootFromPath} from "../webutil/assets"; +import createRelativeHistory from "../webutil/createRelativeHistory"; import ExternalRedirect from "./ExternalRedirect"; import {createRoutes} from "./createRoutes"; import {resolveRouteFromPath, resolveTitleFromPath} from "./routeData"; diff --git a/src/plugins/demo/appAdapter.js b/src/plugins/demo/appAdapter.js index 7678ec4..32ba6da 100644 --- a/src/plugins/demo/appAdapter.js +++ b/src/plugins/demo/appAdapter.js @@ -7,7 +7,7 @@ import type { DynamicAppAdapter, } from "../../app/adapters/appAdapter"; import {StaticAdapterSet} from "../../app/adapters/adapterSet"; -import {Assets} from "../../app/assets"; +import {Assets} from "../../webutil/assets"; import {type RepoId, makeRepoId} from "../../core/repoId"; import {NodeAddress, type NodeAddressT} from "../../core/graph"; import {graph} from "./graph"; diff --git a/src/plugins/git/appAdapter.js b/src/plugins/git/appAdapter.js index 4883633..81ce0ab 100644 --- a/src/plugins/git/appAdapter.js +++ b/src/plugins/git/appAdapter.js @@ -6,7 +6,7 @@ import type { import {Graph} from "../../core/graph"; import * as N from "./nodes"; import {description} from "./render"; -import type {Assets} from "../../app/assets"; +import type {Assets} from "../../webutil/assets"; import type {RepoId} from "../../core/repoId"; import type {Repository} from "./types"; import type {GitGateway} from "./gitGateway"; diff --git a/src/plugins/git/render.js b/src/plugins/git/render.js index 8c66b13..6603e96 100644 --- a/src/plugins/git/render.js +++ b/src/plugins/git/render.js @@ -1,7 +1,7 @@ // @flow import React from "react"; -import Link from "../../app/Link"; +import Link from "../../webutil/Link"; import * as N from "./nodes"; import type {Repository} from "./types"; import {type RepoIdString, stringToRepoId} from "../../core/repoId"; diff --git a/src/plugins/git/render.test.js b/src/plugins/git/render.test.js index 0997e10..a685a82 100644 --- a/src/plugins/git/render.test.js +++ b/src/plugins/git/render.test.js @@ -6,9 +6,9 @@ import {description} from "./render"; import {type RepoId, repoIdToString, makeRepoId} from "../../core/repoId"; import type {Repository, Hash, Commit} from "./types"; import type {GitGateway, URL} from "./gitGateway"; -import Link from "../../app/Link"; +import Link from "../../webutil/Link"; -require("../../app/testUtil").configureEnzyme(); +require("../../webutil/testUtil").configureEnzyme(); describe("plugins/git/render", () => { const repoId1 = makeRepoId("example-owner", "1"); diff --git a/src/plugins/github/appAdapter.js b/src/plugins/github/appAdapter.js index edf0157..74d470f 100644 --- a/src/plugins/github/appAdapter.js +++ b/src/plugins/github/appAdapter.js @@ -10,7 +10,7 @@ import {createGraph} from "./createGraph"; import * as N from "./nodes"; import {RelationalView} from "./relationalView"; import {description} from "./render"; -import type {Assets} from "../../app/assets"; +import type {Assets} from "../../webutil/assets"; import type {RepoId} from "../../core/repoId"; import type {PluginDeclaration} from "../../analysis/pluginDeclaration"; import {declaration} from "./declaration"; diff --git a/src/plugins/github/render.js b/src/plugins/github/render.js index 3b64148..ac8702d 100644 --- a/src/plugins/github/render.js +++ b/src/plugins/github/render.js @@ -3,7 +3,7 @@ import React, {type Node as ReactNode} from "react"; import * as R from "./relationalView"; -import Link from "../../app/Link"; +import Link from "../../webutil/Link"; function EntityUrl(props) { return ( diff --git a/src/plugins/github/render.test.js b/src/plugins/github/render.test.js index adfd87b..a4bbbd7 100644 --- a/src/plugins/github/render.test.js +++ b/src/plugins/github/render.test.js @@ -5,8 +5,8 @@ import {exampleEntities} from "./example/example"; import {description} from "./render"; import enzymeToJSON from "enzyme-to-json"; -require("../../app/testUtil").configureAphrodite(); -require("../../app/testUtil").configureEnzyme(); +require("../../webutil/testUtil").configureAphrodite(); +require("../../webutil/testUtil").configureEnzyme(); describe("plugins/github/render", () => { const examples = exampleEntities(); diff --git a/src/app/Colors.js b/src/webutil/Colors.js similarity index 100% rename from src/app/Colors.js rename to src/webutil/Colors.js diff --git a/src/app/Link.js b/src/webutil/Link.js similarity index 100% rename from src/app/Link.js rename to src/webutil/Link.js diff --git a/src/app/Link.test.js b/src/webutil/Link.test.js similarity index 98% rename from src/app/Link.test.js rename to src/webutil/Link.test.js index ca535b5..78573f3 100644 --- a/src/app/Link.test.js +++ b/src/webutil/Link.test.js @@ -9,7 +9,7 @@ import Link from "./Link"; require("./testUtil").configureAphrodite(); require("./testUtil").configureEnzyme(); -describe("src/app/Link", () => { +describe("webutil/Link", () => { const styles = StyleSheet.create({ x: {fontWeight: "bold"}, }); diff --git a/src/app/assets.js b/src/webutil/assets.js similarity index 100% rename from src/app/assets.js rename to src/webutil/assets.js diff --git a/src/app/assets.test.js b/src/webutil/assets.test.js similarity index 99% rename from src/app/assets.test.js rename to src/webutil/assets.test.js index fb57ea6..6848d76 100644 --- a/src/app/assets.test.js +++ b/src/webutil/assets.test.js @@ -2,7 +2,7 @@ import {Assets, rootFromPath} from "./assets"; -describe("app/assets", () => { +describe("webutil/assets", () => { describe("Assets", () => { describe("with an unknown root path (null)", () => { it("can be constructed", () => { diff --git a/src/app/browserLocalStore.js b/src/webutil/browserLocalStore.js similarity index 100% rename from src/app/browserLocalStore.js rename to src/webutil/browserLocalStore.js diff --git a/src/app/checkedLocalStore.js b/src/webutil/checkedLocalStore.js similarity index 100% rename from src/app/checkedLocalStore.js rename to src/webutil/checkedLocalStore.js diff --git a/src/app/checkedLocalStore.test.js b/src/webutil/checkedLocalStore.test.js similarity index 98% rename from src/app/checkedLocalStore.test.js rename to src/webutil/checkedLocalStore.test.js index 49e5f65..2b9744a 100644 --- a/src/app/checkedLocalStore.test.js +++ b/src/webutil/checkedLocalStore.test.js @@ -3,7 +3,7 @@ import {LocalStore} from "./localStore"; import CheckedLocalStore from "./checkedLocalStore"; -describe("src/app/checkedLocalStore", () => { +describe("webutil/checkedLocalStore", () => { function makeBase(): LocalStore { return { get: jest.fn(), diff --git a/src/app/createRelativeHistory.js b/src/webutil/createRelativeHistory.js similarity index 100% rename from src/app/createRelativeHistory.js rename to src/webutil/createRelativeHistory.js diff --git a/src/app/createRelativeHistory.test.js b/src/webutil/createRelativeHistory.test.js similarity index 99% rename from src/app/createRelativeHistory.test.js rename to src/webutil/createRelativeHistory.test.js index 4745b0f..d4439df 100644 --- a/src/app/createRelativeHistory.test.js +++ b/src/webutil/createRelativeHistory.test.js @@ -11,7 +11,7 @@ import createRelativeHistory from "./createRelativeHistory"; require("./testUtil").configureEnzyme(); -describe("app/createRelativeHistory", () => { +describe("webutil/createRelativeHistory", () => { function createHistory(basename, path) { const memoryHistory = createMemoryHistory(path); const relativeHistory = createRelativeHistory(memoryHistory, basename); diff --git a/src/app/localStore.js b/src/webutil/localStore.js similarity index 100% rename from src/app/localStore.js rename to src/webutil/localStore.js diff --git a/src/app/memoryLocalStore.js b/src/webutil/memoryLocalStore.js similarity index 100% rename from src/app/memoryLocalStore.js rename to src/webutil/memoryLocalStore.js diff --git a/src/app/memoryLocalStore.test.js b/src/webutil/memoryLocalStore.test.js similarity index 95% rename from src/app/memoryLocalStore.test.js rename to src/webutil/memoryLocalStore.test.js index c228d92..bf4fc1d 100644 --- a/src/app/memoryLocalStore.test.js +++ b/src/webutil/memoryLocalStore.test.js @@ -2,7 +2,7 @@ import MemoryLocalStore from "./memoryLocalStore"; -describe("src/app/memoryLocalStore", () => { +describe("webutil/memoryLocalStore", () => { it("stores simple values", () => { const ls = new MemoryLocalStore(); ls.set("one", 1); diff --git a/src/app/testLocalStore.js b/src/webutil/testLocalStore.js similarity index 100% rename from src/app/testLocalStore.js rename to src/webutil/testLocalStore.js diff --git a/src/app/testUtil.js b/src/webutil/testUtil.js similarity index 100% rename from src/app/testUtil.js rename to src/webutil/testUtil.js diff --git a/src/app/withAssets.js b/src/webutil/withAssets.js similarity index 100% rename from src/app/withAssets.js rename to src/webutil/withAssets.js diff --git a/src/app/withAssets.test.js b/src/webutil/withAssets.test.js similarity index 98% rename from src/app/withAssets.test.js rename to src/webutil/withAssets.test.js index c5463d6..076ed0e 100644 --- a/src/app/withAssets.test.js +++ b/src/webutil/withAssets.test.js @@ -12,7 +12,7 @@ import createRelativeHistory from "./createRelativeHistory"; require("./testUtil").configureEnzyme(); -describe("app/withAssets", () => { +describe("webutil/withAssets", () => { function createHistory(basename, path) { const memoryHistory = createMemoryHistory(path); const relativeHistory = createRelativeHistory(memoryHistory, basename);