mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
What: This PR does the bare minimum to migrate the current community search pages to Svelte. A better strategy for managing them is needed in the medium/long term. How: The community pages live at the root (e.g. `/kubernetes`) which complicates things, but I'll get to that later. The page is implemented as a single parameterized route. A parameter matcher is used to validate the community name. Because these pages should only be accessible on dotcom the matcher also validates whether or not we are on dotcom (if not, the path will be matched against a different route). The page config is stored in a separate module so that it's no included in every page and so that it can be used in the integration test. The loader and page implementation themselves are straightforward. I made a couple of changes in other modules to make implementation easier: - Extracted the parameter type of the `marked` function so that it can be used as prop type. - Added an `inline` option to `marked` that allows formatting markdown as 'inline', i.e. without `p` wrapper. - Added a `wrap` prop to `SyntaxHighlightedQuery.svelte` to configure line wrapping of syntax highlighted search queries (instead of having to overwrite styles with `:global`). - Extended the route code generator to be able to handle single parameter segments and the `communitySearchContext` matcher. Because the community routes should only be available on dotcom I added a new tag to the code generator that allows it include routes only for dotcom. Once we change how all this works and have community search pages live under a different path we can simplify this again. Result: | React | Svelte | |--------|--------| |  |  | ## Test plan - New integration tests. - Verified that `/kubernetes` shows a 'repo not found error' when running against S2. - Verified that `/kubernetes` shows the community page when running against dotcom. - Verified that `window.context.svelteKit.enabledRoutes` contains the community page route in enterprise mode but not in dotcom mode. |
||
|---|---|---|
| .. | ||
| appliance | ||
| batcheshelper | ||
| blobstore | ||
| bundled-executor | ||
| cody-gateway | ||
| cody-gateway-config | ||
| customer-2315 | ||
| customer-4512 | ||
| embeddings | ||
| enterprise-portal | ||
| executor | ||
| executor-kubernetes | ||
| frontend | ||
| gitserver | ||
| loadtest | ||
| migrator | ||
| msp-example | ||
| pings | ||
| precise-code-intel-worker | ||
| repo-updater | ||
| searcher | ||
| server | ||
| sourcegraph | ||
| symbols | ||
| syntactic-code-intel-worker | ||
| telemetry-gateway | ||
| worker | ||
| README.md | ||
This directory contains Sourcegraph services and binaries.
When a services is added, removed, or when a service's dependencies change, update our architecture diagram.