sourcegraph/client/web
2022-06-06 20:30:11 -07:00
..
bookmarklet web: flatten frontend packages inside of the client folder (#19378) 2021-03-26 15:35:26 +08:00
dev web: upgrade Storybook (#36437) 2022-06-06 20:30:11 -07:00
src web: upgrade Storybook (#36437) 2022-06-06 20:30:11 -07:00
.eslintignore web: review environment variables before the Datadog integration (#33994) 2022-04-19 02:22:48 -07:00
.eslintrc.js Enable eslint-plugin-wildcard globally (#30830) 2022-03-02 21:19:54 +07:00
.stylelintrc.json web: integrate @sourcegraph/stylelint-plugin-sourcegraph and ban bootstrap imports (#34956) 2022-05-05 04:27:26 +00:00
babel.config.js Move all client code into client/ folder (#14480) 2020-10-07 22:23:53 +02:00
bundlesize.config.js web: update bundlesize config (#26846) 2021-11-01 17:13:22 +08:00
gulpfile.js web: review environment variables before the Datadog integration (#33994) 2022-04-19 02:22:48 -07:00
jest.config.js fix types for jest.config.base.js (using @jest/types package) (#24339) 2021-08-26 02:33:21 -07:00
package.json web: review environment variables before the Datadog integration (#33994) 2022-04-19 02:22:48 -07:00
README.md web: review environment variables before the Datadog integration (#33994) 2022-04-19 02:22:48 -07:00
tsconfig.json [SG-33302] Upgrade all client packages to use the latest version of the JSX transform (#34287) 2022-04-22 12:25:38 +01:00
webpack.config.js Move compute Elm component to more generic location (#35908) 2022-05-25 10:08:46 -07: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.