From 529f7db374e2edd7f3f6836c902cece4dedc7f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dandelion=20Man=C3=A9?= Date: Thu, 28 Jun 2018 14:20:31 -0700 Subject: [PATCH] Rename `demoData` folders to `example` (#435) The Git and GitHub plugins have folders that contain small example data, as used for tests and snapshots. These folders were called `demoData` which is misleading since the data isn't used for demos. The folders themselves contained files called "example", like "example-github.json" or "exampleRepo.js". Renaming the folders to `example` is cleaner. Test plan: `yarn travis --full` passes. --- src/v3/plugins/git/bin/createExampleRepo.js | 2 +- src/v3/plugins/git/createGraph.test.js | 2 +- .../__snapshots__/exampleRepo.test.js.snap | 0 src/v3/plugins/git/{demoData => example}/example-git.json | 0 src/v3/plugins/git/{demoData => example}/exampleRepo.js | 0 src/v3/plugins/git/{demoData => example}/exampleRepo.test.js | 0 .../plugins/git/{demoData => example}/synchronizeToGithub.sh | 0 src/v3/plugins/git/graphView.test.js | 4 ++-- src/v3/plugins/git/loadRepository.test.js | 4 ++-- src/v3/plugins/git/loadRepositoryTest.sh | 2 +- src/v3/plugins/github/createGraph.test.js | 2 +- src/v3/plugins/github/{demoData => example}/README.md | 0 .../plugins/github/{demoData => example}/example-github.json | 0 src/v3/plugins/github/fetchGithubRepoTest.sh | 2 +- src/v3/plugins/github/graphView.test.js | 2 +- src/v3/plugins/github/relationalView.test.js | 2 +- 16 files changed, 11 insertions(+), 11 deletions(-) rename src/v3/plugins/git/{demoData => example}/__snapshots__/exampleRepo.test.js.snap (100%) rename src/v3/plugins/git/{demoData => example}/example-git.json (100%) rename src/v3/plugins/git/{demoData => example}/exampleRepo.js (100%) rename src/v3/plugins/git/{demoData => example}/exampleRepo.test.js (100%) rename src/v3/plugins/git/{demoData => example}/synchronizeToGithub.sh (100%) rename src/v3/plugins/github/{demoData => example}/README.md (100%) rename src/v3/plugins/github/{demoData => example}/example-github.json (100%) diff --git a/src/v3/plugins/git/bin/createExampleRepo.js b/src/v3/plugins/git/bin/createExampleRepo.js index d5196be..cd02d30 100644 --- a/src/v3/plugins/git/bin/createExampleRepo.js +++ b/src/v3/plugins/git/bin/createExampleRepo.js @@ -5,7 +5,7 @@ import fs from "fs"; import { createExampleRepo, createExampleSubmoduleRepo, -} from "../demoData/exampleRepo"; +} from "../example/exampleRepo"; function parseArgs() { const argv = process.argv.slice(2); diff --git a/src/v3/plugins/git/createGraph.test.js b/src/v3/plugins/git/createGraph.test.js index ef23646..ac6198b 100644 --- a/src/v3/plugins/git/createGraph.test.js +++ b/src/v3/plugins/git/createGraph.test.js @@ -11,7 +11,7 @@ import { import {GraphView} from "./graphView"; import type {Hash, Tree} from "./types"; -const makeData = () => cloneDeep(require("./demoData/example-git")); +const makeData = () => cloneDeep(require("./example/example-git")); describe("plugins/git/createGraph", () => { describe("createGraph", () => { diff --git a/src/v3/plugins/git/demoData/__snapshots__/exampleRepo.test.js.snap b/src/v3/plugins/git/example/__snapshots__/exampleRepo.test.js.snap similarity index 100% rename from src/v3/plugins/git/demoData/__snapshots__/exampleRepo.test.js.snap rename to src/v3/plugins/git/example/__snapshots__/exampleRepo.test.js.snap diff --git a/src/v3/plugins/git/demoData/example-git.json b/src/v3/plugins/git/example/example-git.json similarity index 100% rename from src/v3/plugins/git/demoData/example-git.json rename to src/v3/plugins/git/example/example-git.json diff --git a/src/v3/plugins/git/demoData/exampleRepo.js b/src/v3/plugins/git/example/exampleRepo.js similarity index 100% rename from src/v3/plugins/git/demoData/exampleRepo.js rename to src/v3/plugins/git/example/exampleRepo.js diff --git a/src/v3/plugins/git/demoData/exampleRepo.test.js b/src/v3/plugins/git/example/exampleRepo.test.js similarity index 100% rename from src/v3/plugins/git/demoData/exampleRepo.test.js rename to src/v3/plugins/git/example/exampleRepo.test.js diff --git a/src/v3/plugins/git/demoData/synchronizeToGithub.sh b/src/v3/plugins/git/example/synchronizeToGithub.sh similarity index 100% rename from src/v3/plugins/git/demoData/synchronizeToGithub.sh rename to src/v3/plugins/git/example/synchronizeToGithub.sh diff --git a/src/v3/plugins/git/graphView.test.js b/src/v3/plugins/git/graphView.test.js index 145b92f..b430c6c 100644 --- a/src/v3/plugins/git/graphView.test.js +++ b/src/v3/plugins/git/graphView.test.js @@ -4,14 +4,14 @@ import cloneDeep from "lodash.clonedeep"; import {EdgeAddress, Graph, NodeAddress, edgeToString} from "../../core/graph"; import {createGraph} from "./createGraph"; -import * as exampleRepo from "./demoData/exampleRepo"; +import * as exampleRepo from "./example/exampleRepo"; import {GraphView} from "./graphView"; import type {Repository} from "./types"; import * as GE from "./edges"; import * as GN from "./nodes"; -const makeData = (): Repository => cloneDeep(require("./demoData/example-git")); +const makeData = (): Repository => cloneDeep(require("./example/example-git")); const makeGraph = () => createGraph(makeData()); const makeView = () => new GraphView(makeGraph()); diff --git a/src/v3/plugins/git/loadRepository.test.js b/src/v3/plugins/git/loadRepository.test.js index 8a8858d..5e03870 100644 --- a/src/v3/plugins/git/loadRepository.test.js +++ b/src/v3/plugins/git/loadRepository.test.js @@ -2,7 +2,7 @@ import tmp from "tmp"; -import {createExampleRepo} from "./demoData/exampleRepo"; +import {createExampleRepo} from "./example/exampleRepo"; import {loadRepository} from "./loadRepository"; const cleanups: (() => void)[] = []; @@ -25,7 +25,7 @@ describe("loadRepository", () => { // src/plugins/git/loadRepositoryTest.sh --updateSnapshot // to update the snapshot, then inspect the resulting changes. expect(loadRepository(repository.path, "HEAD")).toEqual( - require("./demoData/example-git.json") + require("./example/example-git.json") ); }); diff --git a/src/v3/plugins/git/loadRepositoryTest.sh b/src/v3/plugins/git/loadRepositoryTest.sh index 669a4f2..23f5e2c 100755 --- a/src/v3/plugins/git/loadRepositoryTest.sh +++ b/src/v3/plugins/git/loadRepositoryTest.sh @@ -2,7 +2,7 @@ set -eu -data_file=src/v3/plugins/git/demoData/example-git.json +data_file=src/v3/plugins/git/example/example-git.json usage() { printf 'usage: %s [-u|--updateSnapshot] [--help]\n' "$0" diff --git a/src/v3/plugins/github/createGraph.test.js b/src/v3/plugins/github/createGraph.test.js index bf22bcd..3c7cd3f 100644 --- a/src/v3/plugins/github/createGraph.test.js +++ b/src/v3/plugins/github/createGraph.test.js @@ -8,7 +8,7 @@ import cloneDeep from "lodash.clonedeep"; function exampleGraph() { const data: GithubResponseJSON = cloneDeep( - require("./demoData/example-github") + require("./example/example-github") ); const view = new RelationalView(data); return createGraph(view); diff --git a/src/v3/plugins/github/demoData/README.md b/src/v3/plugins/github/example/README.md similarity index 100% rename from src/v3/plugins/github/demoData/README.md rename to src/v3/plugins/github/example/README.md diff --git a/src/v3/plugins/github/demoData/example-github.json b/src/v3/plugins/github/example/example-github.json similarity index 100% rename from src/v3/plugins/github/demoData/example-github.json rename to src/v3/plugins/github/example/example-github.json diff --git a/src/v3/plugins/github/fetchGithubRepoTest.sh b/src/v3/plugins/github/fetchGithubRepoTest.sh index 7fb59b3..acc93a3 100755 --- a/src/v3/plugins/github/fetchGithubRepoTest.sh +++ b/src/v3/plugins/github/fetchGithubRepoTest.sh @@ -2,7 +2,7 @@ set -eu -data_file=src/v3/plugins/github/demoData/example-github.json +data_file=src/v3/plugins/github/example/example-github.json usage() { printf 'usage: %s [-u|--updateSnapshot] [--[no-]build] [--help]\n' "$0" diff --git a/src/v3/plugins/github/graphView.test.js b/src/v3/plugins/github/graphView.test.js index df8ce87..71c8a2b 100644 --- a/src/v3/plugins/github/graphView.test.js +++ b/src/v3/plugins/github/graphView.test.js @@ -12,7 +12,7 @@ import type {GithubResponseJSON} from "./graphql"; function exampleView() { const data: GithubResponseJSON = cloneDeep( - require("./demoData/example-github") + require("./example/example-github") ); const view = new RelationalView(data); const graph = createGraph(view); diff --git a/src/v3/plugins/github/relationalView.test.js b/src/v3/plugins/github/relationalView.test.js index a1b8ae6..13a9d8a 100644 --- a/src/v3/plugins/github/relationalView.test.js +++ b/src/v3/plugins/github/relationalView.test.js @@ -4,7 +4,7 @@ import * as R from "./relationalView"; import * as N from "./nodes"; describe("plugins/github/relationalView", () => { - const data = require("./demoData/example-github"); + const data = require("./example/example-github"); // Sharing this state is OK because it's just a view - no mutation allowed! const view = new R.RelationalView(data);