From ca85fdf2349a0c83871d7343553d758a0aba2b05 Mon Sep 17 00:00:00 2001 From: William Chargin Date: Mon, 19 Mar 2018 14:31:50 -0700 Subject: [PATCH] Reorganize `src/` directory (#87) Test Plan: Note that tests still pass, and all changes to snapshot files are verbatim moves. wchargin-branch: reorg --- config/paths.js | 2 +- src/{backend => core}/__snapshots__/address.test.js.snap | 0 src/{backend => core}/__snapshots__/graph.test.js.snap | 0 src/{backend => core}/address.js | 0 src/{backend => core}/address.test.js | 0 src/{backend => core}/graph.js | 0 src/{backend => core}/graph.test.js | 0 src/{backend => core}/graphDemoData.js | 0 .../graphql/__snapshots__/queries.test.js.snap | 0 src/{backend => }/graphql/queries.js | 0 src/{backend => }/graphql/queries.test.js | 0 .../github}/__snapshots__/githubPlugin.test.js.snap | 0 .../github}/bin/fetchAndPrintGitHubRepo.js | 0 .../github/demoData}/example-repo.json | 0 src/{backend => plugins/github}/fetchGitHubRepo.js | 0 src/{backend => plugins/github}/fetchGitHubRepoTest.sh | 2 +- src/{backend => plugins/github}/githubPlugin.js | 6 +++--- src/{backend => plugins/github}/githubPlugin.test.js | 2 +- 18 files changed, 6 insertions(+), 6 deletions(-) rename src/{backend => core}/__snapshots__/address.test.js.snap (100%) rename src/{backend => core}/__snapshots__/graph.test.js.snap (100%) rename src/{backend => core}/address.js (100%) rename src/{backend => core}/address.test.js (100%) rename src/{backend => core}/graph.js (100%) rename src/{backend => core}/graph.test.js (100%) rename src/{backend => core}/graphDemoData.js (100%) rename src/{backend => }/graphql/__snapshots__/queries.test.js.snap (100%) rename src/{backend => }/graphql/queries.js (100%) rename src/{backend => }/graphql/queries.test.js (100%) rename src/{backend => plugins/github}/__snapshots__/githubPlugin.test.js.snap (100%) rename src/{backend => plugins/github}/bin/fetchAndPrintGitHubRepo.js (100%) rename src/{backend/githubDemoData => plugins/github/demoData}/example-repo.json (100%) rename src/{backend => plugins/github}/fetchGitHubRepo.js (100%) rename src/{backend => plugins/github}/fetchGitHubRepoTest.sh (91%) rename src/{backend => plugins/github}/githubPlugin.js (97%) rename src/{backend => plugins/github}/githubPlugin.test.js (97%) diff --git a/config/paths.js b/config/paths.js index 7a1714a..f79b81c 100644 --- a/config/paths.js +++ b/config/paths.js @@ -60,7 +60,7 @@ module.exports = { // point within the build directory. backendEntryPoints: { fetchAndPrintGitHubRepo: resolveApp( - "src/backend/bin/fetchAndPrintGitHubRepo.js" + "src/plugins/github/bin/fetchAndPrintGitHubRepo.js" ), }, }; diff --git a/src/backend/__snapshots__/address.test.js.snap b/src/core/__snapshots__/address.test.js.snap similarity index 100% rename from src/backend/__snapshots__/address.test.js.snap rename to src/core/__snapshots__/address.test.js.snap diff --git a/src/backend/__snapshots__/graph.test.js.snap b/src/core/__snapshots__/graph.test.js.snap similarity index 100% rename from src/backend/__snapshots__/graph.test.js.snap rename to src/core/__snapshots__/graph.test.js.snap diff --git a/src/backend/address.js b/src/core/address.js similarity index 100% rename from src/backend/address.js rename to src/core/address.js diff --git a/src/backend/address.test.js b/src/core/address.test.js similarity index 100% rename from src/backend/address.test.js rename to src/core/address.test.js diff --git a/src/backend/graph.js b/src/core/graph.js similarity index 100% rename from src/backend/graph.js rename to src/core/graph.js diff --git a/src/backend/graph.test.js b/src/core/graph.test.js similarity index 100% rename from src/backend/graph.test.js rename to src/core/graph.test.js diff --git a/src/backend/graphDemoData.js b/src/core/graphDemoData.js similarity index 100% rename from src/backend/graphDemoData.js rename to src/core/graphDemoData.js diff --git a/src/backend/graphql/__snapshots__/queries.test.js.snap b/src/graphql/__snapshots__/queries.test.js.snap similarity index 100% rename from src/backend/graphql/__snapshots__/queries.test.js.snap rename to src/graphql/__snapshots__/queries.test.js.snap diff --git a/src/backend/graphql/queries.js b/src/graphql/queries.js similarity index 100% rename from src/backend/graphql/queries.js rename to src/graphql/queries.js diff --git a/src/backend/graphql/queries.test.js b/src/graphql/queries.test.js similarity index 100% rename from src/backend/graphql/queries.test.js rename to src/graphql/queries.test.js diff --git a/src/backend/__snapshots__/githubPlugin.test.js.snap b/src/plugins/github/__snapshots__/githubPlugin.test.js.snap similarity index 100% rename from src/backend/__snapshots__/githubPlugin.test.js.snap rename to src/plugins/github/__snapshots__/githubPlugin.test.js.snap diff --git a/src/backend/bin/fetchAndPrintGitHubRepo.js b/src/plugins/github/bin/fetchAndPrintGitHubRepo.js similarity index 100% rename from src/backend/bin/fetchAndPrintGitHubRepo.js rename to src/plugins/github/bin/fetchAndPrintGitHubRepo.js diff --git a/src/backend/githubDemoData/example-repo.json b/src/plugins/github/demoData/example-repo.json similarity index 100% rename from src/backend/githubDemoData/example-repo.json rename to src/plugins/github/demoData/example-repo.json diff --git a/src/backend/fetchGitHubRepo.js b/src/plugins/github/fetchGitHubRepo.js similarity index 100% rename from src/backend/fetchGitHubRepo.js rename to src/plugins/github/fetchGitHubRepo.js diff --git a/src/backend/fetchGitHubRepoTest.sh b/src/plugins/github/fetchGitHubRepoTest.sh similarity index 91% rename from src/backend/fetchGitHubRepoTest.sh rename to src/plugins/github/fetchGitHubRepoTest.sh index 44d8e16..402cc61 100755 --- a/src/backend/fetchGitHubRepoTest.sh +++ b/src/plugins/github/fetchGitHubRepoTest.sh @@ -19,7 +19,7 @@ main() { >"${output}" \ ; diff -uw \ - src/backend/githubDemoData/example-repo.json \ + src/plugins/github/demoData/example-repo.json \ "${output}" \ ; rm "${output}" diff --git a/src/backend/githubPlugin.js b/src/plugins/github/githubPlugin.js similarity index 97% rename from src/backend/githubPlugin.js rename to src/plugins/github/githubPlugin.js index ad78aba..41d2715 100644 --- a/src/backend/githubPlugin.js +++ b/src/plugins/github/githubPlugin.js @@ -1,8 +1,8 @@ // @flow -import type {Node, Edge} from "./graph"; -import type {Address} from "./address"; -import {Graph} from "./graph"; +import type {Node, Edge} from "../../core/graph"; +import type {Address} from "../../core/address"; +import {Graph} from "../../core/graph"; const stringify = require("json-stable-stringify"); export const GITHUB_PLUGIN_NAME = "sourcecred/github-beta"; diff --git a/src/backend/githubPlugin.test.js b/src/plugins/github/githubPlugin.test.js similarity index 97% rename from src/backend/githubPlugin.test.js rename to src/plugins/github/githubPlugin.test.js index 90f33f1..b48769e 100644 --- a/src/backend/githubPlugin.test.js +++ b/src/plugins/github/githubPlugin.test.js @@ -1,7 +1,7 @@ // @flow import {GithubParser, getNodeType, getEdgeType} from "./githubPlugin"; -import exampleRepoData from "./githubDemoData/example-repo.json"; +import exampleRepoData from "./demoData/example-repo.json"; describe("GithubParser", () => { describe("whole repo parsing", () => {