sourcecred/config
Dandelion Mané e6a3d776ab
Configure fe2 to load from instances (#1856)
This modifies the frontend2 so that we can load real data from cli2
instances, including:
- the root `sourcecred.json` config
- files inside the `config/` directory
- files inside the `output/` directory

This works both for the dev server and the compiled output.

In the case of the dev server, it's now necessary to provide the path to
the cli2 instance you're developing against. You can pass this via the
`--instance` argument, as in `yarn start2 --instance=/path/`, or via
the `$SOURCECRED_DEV_INSTANCE` environment variable (recommended). If
neither is provided, or if that path doesn't look like a valid instance,
an error is thrown.

In the case of the built output, given a valid sc2 instance, you can set
it up via the following:

```
cp -r build2/favicon.png build2/index.html build2/static $INSTANCE
```

Then spin up a simple http server in the $INSTANCE.

You can look at console messages in the frontend to verify that the
instance is working (note it expects to see a discourse config file, not
a GitHub config file as was used in some previous examples).

Test plan:
Setup an example Discourse instance, and then turn on the server via
`yarn start2 --instance=PATH`,
`SOURCECRED_DEV_INSTANCE=path yarn start2`,
and by manually copying in the built outputs using the instructions
above.

In each case, you can load the homepage and check the console to see
that assets loaded successfully.
2020-06-17 18:47:12 -07:00
..
jest flow: add typing to Jest transform modules (#790) 2018-09-06 13:30:33 -07:00
RemoveBuildDirectoryPlugin.js upgrade to webpack 4 2019-07-11 05:52:54 +01:00
env.js Frontend2: Remove references to projectIds (#1855) 2020-06-17 18:45:50 -07:00
paths.js Fork the frontend to build towards cli2 compat (#1853) 2020-06-17 18:44:34 -07:00
polyfills.js Ensure that flow is used in all js files (#232) 2018-05-07 20:02:19 -07:00
test.js prettier: reformat code for 2.0.1 2020-03-24 07:57:14 -07:00
webpack.config.api.js api: extract browser-friendly build target (#1536) 2020-01-09 21:27:37 -08:00
webpack.config.backend.js upgrade to webpack 4 2019-07-11 05:52:54 +01:00
webpack.config.web.js Remove the repoIdRegistry (#1534) 2020-01-08 12:58:04 -08:00
webpack.config.web2.js Configure fe2 to load from instances (#1856) 2020-06-17 18:47:12 -07:00