sourcegraph/client/web
Taras Yemets 02e9afcbdd
fix(plg): banner styles (#63287)
Adresses [UI
feedback](https://www.figma.com/design/FMSdn1oKccJRHQPgf7053o/Cody-PLG-GA?node-id=5472-12492&t=ndgEZFI57dVTIBpo-4)
on https://github.com/sourcegraph/sourcegraph/pull/63231

|Description|Before|After|
|--|--|--|
| Change dismiss button variant from "secondary" to "link" |<img
width="1516" alt="Screenshot 2024-06-14 at 14 34 30"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/d6b53dc4-c7df-45eb-a743-9baddfdd8aa3">|<img
width="1170" alt="Screenshot 2024-06-17 at 12 35 53"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/6778a4bf-9a03-4c3b-a83c-57777859b7f1">|
| Fix banner content alignment |<img width="1516" alt="Screenshot
2024-06-14 at 14 35 41"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/eaa871ce-acd3-4a7e-a25c-74011a42af58"><img
width="1516" alt="Screenshot 2024-06-14 at 14 38 42"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/1382e5a0-4375-4002-93a4-ec25d354317f">|<img
width="1165" alt="Screenshot 2024-06-17 at 12 31 14"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/532930ff-8471-46d8-83c0-f2bbeb1a8bcd">|






<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- Tested manually (screenshots attached)
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-17 16:27:06 +03:00
..
__mocks__ reapply "switch from jest to vitest for faster, simpler tests (#57886)" (#58145) 2023-11-07 12:00:18 +02:00
bookmarklet
dev feat(ci): Adds playwright tests for sveltekit to bazel (#62560) 2024-06-06 12:45:05 -06:00
dist feat/bazel: //cmd/{frontend,server} targets that don't include client bundle for backend integration tests (#62877) 2024-05-28 14:32:48 +01:00
src fix(plg): banner styles (#63287) 2024-06-17 16:27:06 +03:00
tests-examples feat(ci): Adds playwright tests for sveltekit to bazel (#62560) 2024-06-06 12:45:05 -06:00
.bazelignore bazel: ignore files generated into src (#45922) 2022-12-21 20:43:29 -08:00
.eslintignore
.stylelintrc.json
BUILD.bazel fix(ci): remove broken glob (#63277) 2024-06-14 21:50:22 +00:00
bundlesize.config.js Revert "use vite for web builds (#58228)" (#59132) 2023-12-20 16:23:45 -03:00
package.json feat(ci): Adds playwright tests for sveltekit to bazel (#62560) 2024-06-06 12:45:05 -06:00
README.md fix: update links for dev docs (#62758) 2024-05-17 13:47:34 +02:00
statoscope Report bundle size diff in PRs (#42277) 2022-10-12 10:19:51 +02:00
tsconfig.json Create a shared Cody Ignore dataset (#61968) 2024-05-09 13:18:35 +00:00
vitest.config.ts bazel: fix vitest_test in Bazel in sandbox mode (#58274) 2023-11-15 10:14:41 +01: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.