sourcegraph/client/jetbrains
Quinn Slack de613e92b6
use esbuild for client/web builds (#57365)
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.
2023-10-23 10:59:06 -07:00
..
docs JetBrains: Add custom keymap docs (#40243) 2022-08-11 14:44:02 +02:00
scripts use esbuild for client/web builds (#57365) 2023-10-23 10:59:06 -07:00
standalone/src JetBrains: Fix standalone build (#50525) 2023-04-11 20:47:00 +02:00
webview Replace deprecated storybook types (Story & DecoratorFn) (#57604) 2023-10-16 15:35:14 +00:00
.eslintignore JetBrains: Add telemetry to the TypeScript side (#37498) 2022-06-22 16:37:16 +02:00
.eslintrc.js [SG-39797] Enable no-console ESLint rule (#40458) 2022-10-03 07:19:17 -07:00
.gitignore JetBrains: Ignore bin files that are generated by VS Code extension (#37744) 2022-06-27 14:39:03 +02:00
.stylelintrc.json web: integrate @sourcegraph/stylelint-plugin-sourcegraph and ban bootstrap imports (#34956) 2022-05-05 04:27:26 +00:00
BUILD.bazel Revert "revert "bazel: improve ESLint rule" (#52853)" (#52878) 2023-06-04 19:06:39 -07:00
CHANGELOG.md JetBrains: release 3.3.0 (#57021) 2023-09-25 23:16:35 +00:00
globals.d.ts JetBrains: Add basic TS pipeline (#34443) 2022-04-25 18:04:30 +02:00
gulpfile.js JetBrains: Use esbuild to build artifacts (#38206) 2022-07-08 12:15:13 +02:00
LICENSE relicense all paths other than MIT licensed code, client/cody*, jetbrains, VS code, and browser extension to enterprise (#53345) (#53345) 2023-06-13 10:28:11 -07:00
package.json web: migrate from yarn to pnpm (#46143) 2023-01-11 19:50:09 -08:00
README.md JetBrains: remove plugin (#57505) 2023-10-17 09:03:43 +00:00
settings.gradle.kts JetBrains: fix ktfmt Gradle/Spotless config (#56613) 2023-09-14 10:42:53 +02:00
tsconfig.json web: fix pnpm-lock issue (#47478) 2023-02-09 22:04:31 -08:00

Sourcegraph Code Search for IntelliJ

This directory contains web assets for the Sourcegraph JetBrains plugin. The JetBrains plugin lives in the sourcegraph/jetbrains repository.

Building the assets

Run the following commands to build the assets.

pnpm i
pnpm build
# (optional) pnpm watch

The assets get generated to src/main/resources/dist, which are ignored by git. The JetBrains plugin embeds the contents of that directory into the plugin.

Previewing the assets locally

Run the following commands to preview the components in a standalone HTML file.

pnpm standalone && open http://localhost:3000/