* remove little-used `web-standalone-http-prod`
This let you run a local web app built in production mode against a remote Sourcegraph endpoint. You can still run a local web app built in *dev* mode.
* add `sg test bazel-backend-integration`
* fix DeveloperDialog positioning
It was taking up 100% width and was translated -50% so the left half of it was off-viewport.
* use vite for web builds
[Vite](https://vitejs.dev/) is a fast web bundler. With Vite, a local dev server is available as fast as with esbuild, and incremental builds are (1) hot (no page reload needed) and (2) much faster (<500ms).
* fix "manifestPlugin.d.ts" was not created
* sg lint
* remove little-used `web-standalone-http-prod`
This let you run a local web app built in production mode against a remote Sourcegraph endpoint. You can still run a local web app built in *dev* mode.
* add `sg test bazel-backend-integration`
* fix DeveloperDialog positioning
It was taking up 100% width and was translated -50% so the left half of it was off-viewport.
* use vite for web builds
[Vite](https://vitejs.dev/) is a fast web bundler. With Vite, a local dev server is available as fast as with esbuild, and incremental builds are (1) hot (no page reload needed) and (2) much faster (<500ms).
* fix "manifestPlugin.d.ts" was not created
* sg lint
* small lint fix
* added events shim to client/web/BUILD.bazel
* updated via bazel configure
* added in side-effectful import for EventEmitter
* added in side-effectful import for EventEmitter
* ran bazel configure
* re-run bazel configure
* pnpm dedupe
---------
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
Co-authored-by: jamesmcnamara <jamesscottmcnamara@gmail.com>
Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
* reapply "switch from jest to vitest for faster, simpler tests (https://github.com/sourcegraph/sourcegraph/pull/57886)"
This was reverted in https://github.com/sourcegraph/sourcegraph/pull/58116 due to an issue with the browser tests.
* include fetch-mock
* fix flakiness
* rm mock that did not work in experimentalVmThreads
* fix
* timeout
* fixup
---------
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
When running vitests concurrently the target //client/browser:test fails
Revert "switch from jest to vitest for faster, simpler tests (#57886)"
This reverts commit ae5325e432.
Replaces our usage of jest with vitest. Also removes the babel transpiler. This simplifies our test configuration by a lot, makes tests run 10% faster, and makes further modernizations to our build/test stuff possible (such as using vite for frontend builds).
This removes some of the junit exporting for Buildkite, and the vitest bazel defs don't really cleanly implement bazel testing guidelines (like sharding). But vitest is only used for unit tests (all integration/e2e/regression tests have always run in mocha), so none of them are very slow anyway.
## Codemods for vitest imports
fastmod -e js,ts,tsx @jest/globals vitest client/ dev/release/
fastmod -e js,ts,tsx 'jest\.(\w+)\(' 'vi.$1(' client/ dev/release/
fastmod -e js,ts,tsx 'jest,' 'vi,' client/ dev/release/
fastmod -e js,ts,tsx 'jest }' 'vi }' client/ dev/release/
git diff --diff-filter=M --name-only | xargs pnpm exec prettier --write
Cody code is being moved to https://github.com/sourcegraph/cody. This PR
removes the moved code and configures this repository to use the
`@sourcegraph/cody-{shared,ui}` packages published by the new separate
Cody repository.
## Test plan
Ensure that the new separate Cody repository tests pass. Ensure that
this repository's tests pass now that it uses 2 npm packages published
by the new separate Cody repository.
- The new `client/cody-ui` package (`@sourcegraph/cody-ui`) contains
reusable components for Cody's UI that are shared among all web UIs for
Cody.
- The Sourcegraph web app repo sidebar now adds a `Cody` tab (alongside
files and symbols) when the `cody-experimental` feature flag is enabled.
This lets you use Cody in the web app.
- A new demonstration `client/cody-web` package implements a standalone
web app for Cody.
No behavior change is intended to the Cody code.
## Test plan
Build and run the Cody extension locally. Ensure that it still functions
as is. All other changes are experimental and behind a feature flag (in
the main web app).
There were a few config changes and a change to the URL resolution algorithm, which was easiest to work around by moving the one only url in the entire webapp outside of the sass code. This should be another precursor for webpack 5 support.
Also I had to switch to a republished version of pin to-string-loader that fixes usage with css-loader v4+, but was never released to NPM.
This PR adjusts all configs/generators/linters that we use to support multiple `.graphql` files to be stitched together for the final schema.
This should help a bit with the MASSIVE `schema.graphql` file that has grown to around 10k loc by now, by encapsulating different fields of concern into separate files. Using the `extend` keyword, there is nothing that cannot be expressed with separate files that could have been with a single file, so there are no drawbacks to this method, that I'm aware of.
In a follow-up PR, I will restructure the backend code for this a bit and make it so the enterprise schema is not used in OSS (which gives better introspection, because there is less noise from fields that aren't accessible because OSS) and doesn't require us to implement a `defaultXXResolver`.