sourcegraph/client/web
Quinn Slack 07f29c98d6
use @typescript-eslint projectService for faster eslint (#57851)
See https://github.com/typescript-eslint/typescript-eslint/pull/6754.

Also removes needless `.eslintrc.js` files (now that we can use the root `tsconfig.all.json` for linting and it's still fast enough).

Some of our eslint rules were unintentionally made ineffective in `client/web`, and this commit also re-enables them and in some cases suppresses the eslint warning where a fix is not urgent.
2023-10-24 01:40:40 +00:00
..
bookmarklet
dev upgrade @sourcegraph/eslint-config and fix all auto-fixable issues (#57847) 2023-10-24 00:52:12 +00:00
dist disable frontend code coverage tracking (#57820) 2023-10-23 21:29:40 +00:00
scripts explicitly import @jest/globals and mocha (#57786) 2023-10-23 21:40:17 +00:00
src use @typescript-eslint projectService for faster eslint (#57851) 2023-10-24 01:40:40 +00:00
.bazelignore bazel: ignore files generated into src (#45922) 2022-12-21 20:43:29 -08:00
.eslintignore
.stylelintrc.json search: remove onboarding tour (#38142) 2022-07-06 13:22:27 +02:00
BUILD.bazel upgrade @sourcegraph/eslint-config and fix all auto-fixable issues (#57847) 2023-10-24 00:52:12 +00:00
bundlesize.config.js use esbuild for client/web builds (#57365) 2023-10-23 10:59:06 -07:00
gulpfile.js use esbuild for client/web builds (#57365) 2023-10-23 10:59:06 -07:00
index.html.template app: experimental Tauri branch (#50620) 2023-04-21 19:48:47 +02:00
jest.config.js
package.json use esbuild for client/web builds (#57365) 2023-10-23 10:59:06 -07:00
README.md use esbuild for client/web builds (#57365) 2023-10-23 10:59:06 -07:00
statoscope Report bundle size diff in PRs (#42277) 2022-10-12 10:19:51 +02:00
tsconfig.json remove cody code that was moved to separate cody repo (#54729) 2023-07-10 00:31:47 -10: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. WEB_BUILDER_SERVE_INDEX should be set to true to enable serving of an index page.
  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

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

Production server

sg start web-standalone-prod

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

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.