sourcecred/config/paths.js
William Chargin 08219f98bf
fetchGithubRepo: use Mirror pipeline (#937)
Summary:
As of this commit, `node ./bin/sourcecred.js load` uses the Mirror code,
and the legacy continuation-fetching code is not included in the
`sourcecred.js` bundle.

We do not yet perform the commit prefetching described in #923. The code
should be plenty fast for repositories that merge pull requests at least
occasionally.

Test Plan:
Running `yarn test --full` passes. Loading `sourcecred/sourcecred` works
and generates a reasonable credit attribution. Loading it again
completes immediately.

wchargin-branch: fetchGithubRepo-mirror
2018-10-28 12:03:06 -07:00

42 lines
1.5 KiB
JavaScript

// @flow
const path = require("path");
const fs = require("fs");
// Make sure any symlinks in the project folder are resolved:
// https://github.com/facebookincubator/create-react-app/issues/637
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);
// config after eject: we're in ./config/
module.exports = {
root: appDirectory,
dotenv: resolveApp(".env"),
favicon: resolveApp("src/assets/logo/sourcecred_32.png"),
appBuild: resolveApp("build"),
appIndexJs: resolveApp("src/app/index.js"),
appServerSideRenderingIndexJs: resolveApp("src/app/server.js"),
appRouteData: resolveApp("src/app/routeData.js"),
appPackageJson: resolveApp("package.json"),
appSrc: resolveApp("src"),
yarnLockFile: resolveApp("yarn.lock"),
appNodeModules: resolveApp("node_modules"),
backendBuild: resolveApp("bin"),
// This object should have one key-value pair per entry point. For
// each key, the value should be the path to the entry point for the
// source file, and the key will be the filename of the bundled entry
// point within the build directory.
backendEntryPoints: {
sourcecred: resolveApp("src/cli/main.js"),
//
generateGithubGraphqlFlowTypes: resolveApp(
"src/plugins/github/bin/generateGraphqlFlowTypes.js"
),
fetchAndPrintGithubRepo: resolveApp(
"src/plugins/github/bin/fetchAndPrintGithubRepo.js"
),
createExampleRepo: resolveApp("src/plugins/git/bin/createExampleRepo.js"),
mirror: resolveApp("src/graphql/demo.js"),
},
};