sourcegraph/client/web
Sander Ginn 09c0e2941e
Revert "v5.1.0 bake constants and static content" (#53753)
Reverts sourcegraph/sourcegraph#53718

This broke main because `src-cli` 5.1.0 is not yet released on its GH
release page, but executor docker images are trying to download this
release already.

## Test plan
CI go green
2023-06-20 12:52:26 +00:00
..
bookmarklet
dev cody: add cody.enabled flag to site-config, simplify others (#52919) 2023-06-13 15:28:58 +02:00
scripts ci: report bundlesize handle missing file (#53153) 2023-06-08 11:30:49 +00:00
src Revert "v5.1.0 bake constants and static content" (#53753) 2023-06-20 12:52:26 +00:00
.bazelignore bazel: ignore files generated into src (#45922) 2022-12-21 20:43:29 -08:00
.eslintignore web: review environment variables before the Datadog integration (#33994) 2022-04-19 02:22:48 -07:00
.eslintrc.js bazel: implement custom ESLint Bazel rule (#52062) 2023-05-22 04:05:45 -07:00
.stylelintrc.json search: remove onboarding tour (#38142) 2022-07-06 13:22:27 +02:00
babel.config.js
BUILD.bazel Add enterprise UIs for cody enablement (#53360) 2023-06-16 03:35:58 +02:00
bundlesize.config.js UI: Use changelist ID in URL for browsing changelists (#53253) 2023-06-15 11:06:28 +02:00
gulpfile.js web: drop legacy GraphQL schema generator (#45945) 2022-12-25 18:10:20 -08:00
index.html.template app: experimental Tauri branch (#50620) 2023-04-21 19:48:47 +02:00
jest.config.js
package.json Add app specific (simplified) routing schema (#53257) 2023-06-09 14:58:34 -03:00
README.md web: review environment variables before the Datadog integration (#33994) 2022-04-19 02:22:48 -07:00
statoscope Report bundle size diff in PRs (#42277) 2022-10-12 10:19:51 +02:00
tsconfig.json extract Cody UI package, add Cody to web app (#50270) 2023-04-02 17:41:20 -07:00
webpack.bazel.config.js bazel: decouple web application bundle from integration tests modules (#51560) 2023-05-10 06:47:56 +00:00
webpack.bazel.devserver.config.js bazel: add webpack devserver config (#48978) 2023-03-20 03:08:13 +00:00
webpack.config.js bazel: decouple web application bundle from integration tests modules (#51560) 2023-05-10 06:47:56 +00:00

Web Application

Local development

Use sg CLI tool to configure and start local development server. For more information check out the sg documentation.

Our local development server runs by starting both a Caddy HTTPS server and a Node HTTP server. We then can reverse proxy requests to the Node server to serve client assets under HTTPS.

Configuration

Environment variables important for the web server:

  1. WEBPACK_SERVE_INDEX should be set to true to enable HTMLWebpackPlugin.
  2. SOURCEGRAPH_API_URL is used as a proxied API url. By default it points to the https://k8s.sgdev.org.

It's possible to overwrite these variables by creating sg.config.overwrite.yaml in the root folder and adjusting the env section of the relevant command.

Development server

sg start web-standalone

For open-source version:

sg start oss-web-standalone

Public API

To use a public API that doesn't require authentication for most of the functionality:

SOURCEGRAPH_API_URL=https://sourcegraph.com sg start web-standalone

For open-source version:

SOURCEGRAPH_API_URL=https://sourcegraph.com sg start oss-web-standalone

Production server

sg start web-standalone-prod

For open-source version:

sg start oss-web-standalone-prod

Web app should be available at https://${SOURCEGRAPH_HTTPS_DOMAIN}:${SOURCEGRAPH_HTTPS_PORT}. Build artifacts will be served from <rootRepoPath>/ui/assets.

Note: If you are unable to use the above commands (e.g. you can't install Caddy), you can use sg run web-standalone-http instead. This will start a development server using only Node, and will be available at http://localhost:${SOURCEGRAPH_HTTP_PORT}.

API proxy

In both environments, server proxies API requests to SOURCEGRAPH_API_URL provided as the .env variable.

esbuild (experimental)

See https://docs.sourcegraph.com/dev/background-information/web/build#esbuild.