sourcegraph/client/web
2023-01-16 14:20:35 +02:00
..
bookmarklet
dev set process.env.NODE_DEBUG in esbuild (#46457) 2023-01-14 16:20:49 -08:00
scripts web: upgrade prettier to the latest version to support TS satisfies operator (#45400) 2022-12-08 02:37:23 -08:00
src Add Bitbucket Cloud as an auth provider with Perms syncing (#46309) 2023-01-16 14:20:35 +02: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 [SG-39797] Enable no-console ESLint rule (#40458) 2022-10-03 07:19:17 -07:00
.stylelintrc.json search: remove onboarding tour (#38142) 2022-07-06 13:22:27 +02:00
babel.config.js
BUILD.bazel bazel: rename generate_graphql_operations(output) to out (#45946) 2022-12-23 03:35:32 +00:00
bundlesize.config.js Lazy load the new inlined code intel APIs (#41504) 2022-09-08 12:42:23 +00:00
gulpfile.js web: drop legacy GraphQL schema generator (#45945) 2022-12-25 18:10:20 -08: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: migrate from yarn to pnpm (#46143) 2023-01-11 19:50:09 -08: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 [SG-46115] - Merge the search-ui package into the branded package (#46197) 2023-01-11 18:27:19 +01:00
webpack.config.js web: migrate from yarn to pnpm (#46143) 2023-01-11 19:50:09 -08: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.