- Update the "getting started" link in the quickstart guide to point to
the correct URL
- Remove the outdated developer help links as they are no longer
relevant
## Test plan
Test the links manually
Historically, sourcegraph.com has been the only instance. It was
connected to GitHub.com and GitLab.com only.
Configuration should be as simple as possible, and we wanted everyone to
try it on any repo. So public repos were added on-demand when browsed
from these code hosts.
Since, dotcom is no longer the only instance, and this is a special case
that only exists for sourcegraph.com.
This causes a bunch of additional complexity and various extra code
paths that we don't test well enough today.
We want to make dotcom simpler to understand, so we've made the decision
to disable that feature, and instead we will maintain a list of
repositories that we have on the instance.
We already disallowed several repos half a year ago, by restricting size
of repos with few stars heavily.
This is basically just a continuation of that.
In the diff, you'll mostly find deletions. This PR does not do much
other than removing the code paths that were only enabled in dotcom mode
in the repo syncer, and then removes code that became unused as a result
of that.
## Test plan
Ran a dotcom mode instance locally, it did not behave differently than a
regular instance wrt. repo cloning.
We will need to verify during the rollout that we're not suddenly
hitting code paths that don't scale to the dotcom size.
## Changelog
Dotcom no longer clones repos on demand.
The docs for `sg` can be found in `sg help`, which is more up-to-date and customized to the user's environment than auto-generated Markdown docs. Removing this also simplifies our build and makes it simpler to change `sg` and `sg.config.yaml`.
Removed usage of gulp for running commands. Instead, we just use `package.json` scripts (that mostly invoke `ts-node -T ...`). The purpose of removing gulp is to remove a layer of duplication/indirection between the tasks we need to run and where they are defined.
The code generation tasks (GraphQL operations, CSS modules types, and schema/ JSON Schema types) no longer run in watch mode in local dev. If you make changes that require regeneration of this code, run `pnpm run generate` from the root. This is for simplicity and speed (they would run on many unrelated changes and slow down local dev).
Use [esbuild](https://esbuild.github.io/) instead of Webpack for builds of `client/web`, for faster builds (dev and prod) and greater dev-prod parity. This PR completely removes all use of Webpack in this repository.
`client/web` is the last build target that still uses Webpack; all others have been recently migrated to esbuild. Most devs here have been using esbuild for local dev of `client/web` for the last 6-12 months anyway. The change here is that now our production builds will be built by esbuild.
All sg commands, integration/e2e tests, etc., continue to work as-is. The bundlesize report will take a while to stabilize because the new build products use different filenames.
## Benchmarks
Running `pnpm run generate && time pnpm -C client/web run task:gulp webBuild` and taking the `time` output from the last command:
- Webpack: 62.5s
- esbuild: 6.7s
Note: This understates esbuild's victory for 2 reasons: (1) because esbuild is building both the main and embed entrypoints, whereas Webpack only builds the main entrypoint in this benchmark) and (2) because a lot of it is in the fixed startup time of `gulp`; esbuild incremental rebuilds during local dev only take ~1s.
## Notes
We no longer use Babel to produce web builds (we use esbuild), so we don't need any Babel plugins that optimize the output or improve browser compatibility. Right now, Babel is only used by Jest (for tests) and by Bazel as an intermediate step.
This file is produced by both Webpack and esbuild. It is not Webpack-specific.
```
fastmod -e yaml,ts,js,md,tsx WEBPACK_MANIFEST WEB_BUILD_MANIFEST
fastmod -e yaml,ts,js,md,tsx,go webpack.manifest.json web.manifest.json
fastmod -e yaml,ts,js,md,tsx,go webpackManifestPath webBuildManifestPath
fastmod -e yaml,ts,js,md,tsx,go 'webpack manifest' 'web build manifest'
fastmod -e go,ts,tsx webpackManifest webBuildManifest
fastmod -e go,ts,tsx WebpackManifest WebBuildManifest # not all accepted
```
This removes another source of "names" and also makes it so that client/web can be built by esbuild via Bazel in the future (which does not support renaming entrypoints).
While looking up developer docs about a couple things, I felt compelled
to do a bit of cleanup.
We had two docs, `dev/index.md` and
`dev/background-information/index.md`, which featured the same lengthy
table of contents to other subpages. The two lists were meant to be
identical, as was noted by a comment at the top of the latter doc:
```
<!-- Link back any new sections to doc/dev/index.md as well -->
```
But the lists had actually diverged quite a bit, and frankly it just
felt redundant to have the latter doc when it was literally only this
table of contents and nothing else. So I removed the redundant doc,
merged the lists, dropped outdated and duplicative subpage links, and
regrouped a couple sections that only had one or two items listed under
then. The header hierarchy had also gotten messed up in a couple ways
(for example SQL was listed as a subsection of `git` 🤪), so I fixed that
up. This hopefully means both maintaining and browsing the developer
docs will be easier!
I have left a couple comments inline to clarify items that were moved or
removed.
## Test plan
Tested locally, tried to verify most links still worked!
Also verified the ToC hierarchy is corrected:
<img width="366" alt="image"
src="https://github.com/sourcegraph/sourcegraph/assets/8942601/df064955-6c8f-4a40-bfd2-bf493fc0ec40">
<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
Scrubbing references to the deprecated OSS version from the
documentation. There were a few places it seemed like leaving the
reference made sense, so I annotated with a note it is deprecated.
## Test plan
I started Sourcegraph using sg, that seemed useful to test.
<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
---------
Co-authored-by: Joe Chen <joe@sourcegraph.com>
Bazel's rules_js rely on the pnpm package manager. To simplify the integration, we're migrating to pnpm from our current package manager — yarn. Another reason to migrate is that pnpm is cool and fast. 😉
The 'alternative instrucitons' section never seemed to exist, so this reference
can be removed. Also fixes some typos.
Co-authored-by: davejrt <davetry@gmail.com>
Migrates the existing sg usage examples into UsageText, which is used to generate similar docs as before, except now automatically annotated with more details about the command. This centralizes all documentation within sg code, so that consistent help is available both on docs.sourcegraph.com and locally.
* sg: document troubleshooting steps for WSL2
* sg: Move WSL troubleshooting
Move the WSL2 troubleshooting document into `setup/troubleshooting`
along with other useful information
* sg: Update wsl doc with permalink