Commit Graph

35 Commits

Author SHA1 Message Date
Bolaji Olajide
ae34b1df84
release: drop legacy release tooling (#61220)
purge legacy tooling
2024-04-09 14:29:35 -05:00
Vova Kulikov
ff6f396abb
Cody web: Bring back old packages from git history (#61376)
* Add cody-shared package

* Add cody-ui package

* Adjust web package and install new deps

* Minor fixes in build bazel

* Configure

* Run prettier

* Run prettier

* Fix linters

* Fix eslint problems

* Update tsconfig refs

* Remove unused code

* Update packages build files

* Update packages build files

* Update packages build files 2

* Remove wildcard from cody-ui

* Attempt to fix bazel file for cody-ui

* Run prettier

* fix cody bazel file

* Update tsconfig refs

* Remove unused/unsupported recipes  from cody-shared
2024-04-08 14:21:41 +02:00
Vova Kulikov
97d0fae787
Revert vs-code extension deleting (#61258)
* Revert vs-code extension deleting
2024-03-20 13:53:27 +01:00
Vova Kulikov
c3e2bf4fc8
Vscode extension: Delete vscode extension package (#58023)
* Remove vscode from CI

* Delete vscode package

* Remove vscode dependencies

* Update CHANGELOG.md
2023-10-31 18:39:30 -03:00
Quinn Slack
85818110a7
misc improvements to tests to prep for vitest switch (#57904)
* stub method to avoid unhandled exception in test from pretendRemote

* less flaky ActionItem test that checks condition before snapshotting

* rename *.{spec => test}.ts

This simplifies the test filename pattern.

* rename top-level tsconfig.all.json to tsconfig.json

* upgrade to pnpm 8.9.2

* avoid usage of jsdom.reconfigure

* more robust linkClickHandler.test.tsx

* make getBundleSizeStats.test.ts not need to use mocks

* extract createBarrier() to @sourcegraph/testing

* more robust fromObservableQuery.test.ts

* avoid jsdom.reconfigure

* do not attempt to request assets from assets.gitlab-static.net

fastmod -F assets.gitlab-static.net example.com client/browser/src/

* avoid "incorrect casing" for mocked React components

* use createBarrier

* fix SurveyToast mock GraphQL query

* fix classNames typo
2023-10-26 01:47:40 +00:00
Valery Bugakov
ce38bbc724
web: fix pnpm-lock issue (#47478)
Fixes the issue caused by the presence of the `sourcegraph: ''` entry in the `pnpm-lock.yaml`. If we install any new dependency, the `pnpm install` command fails on CI. [Failure example](https://github.com/sourcegraph/sourcegraph/actions/runs/4121774771/jobs/7117792725).
2023-02-09 22:04:31 -08:00
Valery Bugakov
5c25cdf1e7
web: remove root ts project references (#47426) 2023-02-07 09:11:16 +00:00
Valery Bugakov
3512fb9aa2
web: sync TS project refenreces (#46407) 2023-01-16 18:55:10 -08:00
Noah S-C
f3fdbabc46
fuzzy finder: join shortcut segments with + on Linux+Windows (#44150) 2022-12-09 15:07:46 +00:00
Valery Bugakov
260561a942
web: upgrade prettier to the latest version to support TS satisfies operator (#45400) 2022-12-08 02:37:23 -08:00
Valery Bugakov
179498b257
web: flatten frontend packages inside of the client folder (#19378)
* web: flattened frontend packages inside of the client folder

* web: please prettier 🙏

* web: reverted redundant changes

* web: reverted redundant whitespace changes

* Update client/README.md

Co-authored-by: Patrick Dubroy <patrick@sourcegraph.com>

* Update client/README.md

Co-authored-by: Patrick Dubroy <patrick@sourcegraph.com>

* Update client/README.md

Co-authored-by: Patrick Dubroy <patrick@sourcegraph.com>

* web: updated client/README

* Update client/README.md

Co-authored-by: Tom Ross <tom@umpox.com>

* web: changed licenses to Apache-2.0 for frontend packages

* web: reverted redudant change

* web: updated client/README

* web: added issue #

* web: added issue #

Co-authored-by: Patrick Dubroy <patrick@sourcegraph.com>
Co-authored-by: Tom Ross <tom@umpox.com>
2021-03-26 15:35:26 +08:00
Erik Seliger
b1ed170f2c
Some dev environment QoL improvements (#16445)
* Reduce logspam from gulp

* Reduce CPU strain of ts watchers

* Reduce syntect worker count to 1 for local dev
2020-12-07 15:33:47 +01:00
ᴜɴᴋɴᴡᴏɴ
12da28213a
tsconfig: bump to es2020 to use bigint (#16354) 2020-12-02 20:05:44 +08:00
Felix Becker
85f198b04c
Move shared branded code to branded/ (#14515) 2020-10-08 15:14:34 +02:00
Felix Becker
45f9839011
Move all client code into client/ folder (#14480) 2020-10-07 22:23:53 +02:00
Loïc Guychard
4118adcdbc
Add UI integration tests backed by Polly (#11898) 2020-07-06 14:57:02 +02:00
renovate[bot]
f425fda6e0
Update dependency @sourcegraph/eslint-config to ^0.19.1 (#11225)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Felix Becker <felix.b@outlook.com>
2020-06-03 12:33:59 +02:00
Eric Fritz
81845676da
codeintel: Remove old typescript services (#10566) 2020-05-14 15:29:03 -05:00
Eric Fritz
bf8119e8d1
Rename lsif-server to precise-code-intel (#9376) 2020-03-31 15:59:13 -05:00
Eric Fritz
64d740c6bd
lsif-server: Reorganize project layout (#9375) 2020-03-27 12:57:00 -05:00
Eric Fritz
60d7f713e4
Rename and move lsif directory (#9366) 2020-03-27 11:36:13 -05:00
Felix Becker
6ab2699825
Use Mocha for e2e and regression tests (#7872) 2020-01-20 11:55:15 +01:00
Stephen Gutekanst
c23f977b81
Remove the management console (#7197)
Remove the management console and merge all critical configuration automatically into the site configuration.

Instead of the management console, a file-based site configuration editing escape hatch is now available and is documented.

See [the added 3.11 migration notes](https://docs.sourcegraph.com/admin/migration/3_11) for details on the implications of this change, and ["editing your site configuration if you cannot access teh web UI"](https://docs.sourcegraph.com/admin/config/site_config#editing-your-site-configuration-if-you-cannot-access-the-web-ui) for how to use the new escape-hatch configuration file.

Fully-detailed proposal and motivations behind this change are documented in the PR description here: https://github.com/sourcegraph/sourcegraph/pull/7197

Associated PRs:

- https://github.com/sourcegraph/deploy-sourcegraph/pull/478
- https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/54
2019-12-16 21:30:51 -07:00
Felix Becker
765884306e
More optional chaining (#6891)
* More optional chaining

* Set target in tsconfig to transpile optional chaining
2019-11-27 16:20:11 +01:00
Felix Becker
d5bb53fb4d
Use TypeScript project references (#6053)
* Use TypeScript project references

* Use JS for config files

* Lint only ts to work around crash on JS files

* Fix codeowners

* Tune VS Code config

* skipDefaultLibCheck

* Add Buildkite grouping to foreach-ts-project.sh

* Add better logs for pre-build.sh

* Export interface to fix private name error
2019-11-12 12:26:21 +01:00
renovate[bot]
13c1abaad9 Update dependency @sourcegraph/prettierrc to v3 (#3974)
* Update dependency @sourcegraph/prettierrc to v3

* yarn run prettier
2019-05-13 13:17:09 -07:00
Felix Becker
028fe8d187
Remove tslint-language-service (#3781)
It's deprecated and the new TSLint extension works great without it.
It always printed a invalid peerDependency warning when running yarn.
2019-05-02 19:23:11 +02:00
Felix Becker
fac5944178
Config improvements (#2366)
Debug config for Jest
2019-02-19 21:54:28 +01:00
Quinn Slack
047e49b5f0
Move extsvc config JSON Schemas to separate files (#2178)
This helps with #2067 and clarifies the relationship between site config and external service config.

Test plan:

- Verify that equivalent Go `./schema` code is codegenned (vs. before this PR, by looking at the diff).
- For the web app, ensure that in the site admin external service Monaco editors for each kind of service, you get hovers and validation as before.
- For the backend, ensure that server-side validation occurs when you try to save external service JSON in site admin. (This is covered by Go unit tests.)
2019-02-15 13:27:13 -08:00
Quinn Slack
d292f16d28
use jest for testing (#1456)
Goal: help people write reliable UI code by making it easier to write and run tests.

Using Facebook's [jest](https://jestjs.io) for tests helps us achieve this goal because:

- jest has great first-class support for testing React components (see https://jestjs.io/docs/en/tutorial-react) and is by far the most popular way that people test React components, so the bugs are ironed out and the tooling is good
- jest can run all of our tests (`shared/`, `web/`, and `client/browser/` -- and unit tests **AND** e2e tests) from the same runner (`yarn test` in the root dir)
- jest has a great `--watch` UI and a good [vscode-jest extension](https://github.com/jest-community/vscode-jest)
- debugging tests in VS Code works with no additional effort
- jest requires a lot less configuration and code to set up testing and coverage than Mocha (no `--require ts-node --require source-map-support mocha.opts --require long-stack-traces --require esm ...`, no test-time bundling required using `unit-test-utils.ts`, etc.)

**Note:** Most of the diff is from https://github.com/skovhus/jest-codemods, which automatically updates our test code to use jest style (`describe`, `test`, `expect`, etc., not `it` and `assert`).

jest appears to be the most popular tool for solving the problem that we have (testing a large web/multi-platform application), and it was surprisingly painless to set up and a joy to use.

TODOs:

- [x] Make it pass on Buildkite
- [x] Ensure e2e, screenshots-after-failures, and coverage still work on Buildkite
- [x] Test on macOS
- [x] Add docs to repo

---

Usage:

> This is also documented in `doc/dev/testing.md` and `doc/dev/web_app.md`.

- To run all unit tests, run `yarn test` from the root directory.
- To run unit tests in development (only running the tests related to uncommitted code), run `yarn test --watch`.
  - And/or use [vscode-jest](https://github.com/jest-community/vscode-jest) with `jest.autoEnable: true` (and, if you want, `jest.showCoverageOnLoad: true`)
- To debug tests in VS Code, use [vscode-jest](https://github.com/jest-community/vscode-jest) and click the **Debug** code lens next to any `test('name ...', ...)` definition in your test file (be sure to set a breakpoint or break on uncaught exceptions by clicking in the left gutter).
- e2e tests:
  - To run e2e tests for the browser extension: `cd client/browser && yarn test-e2e`
  - To run e2e tests for the browser extension: `cd web && yarn test-e2e`
- You can also run `yarn test` from any of the individual project dirs (`shared/`, `web/`, `client/browser/`).

Usually while developing you will either have `yarn test --watch` running in a terminal or you will use vscode-jest.

---

Notes:

- There are no regressions. The following are all preserved as before: Puppeteer screenshots after test failures, jsdom tests, e2e tests, Codecov and lcov coverage, VS Code integration, etc.
- You will need to write tests using [jest matchers](https://jestjs.io/docs/en/using-matchers) (or [jest async matchers](https://jestjs.io/docs/en/asynchronous) for async code), not `assert`. They are very similar.
- You need to use `test()` instead of `it()` for defining test cases.
2018-12-16 18:13:40 -08:00
Quinn Slack
c4f70b577e
use single root package.json, do not build intermediate shared code (#936)
* remove enterprise workspace (build together with webapp)

* remove sourcegraph-extension-api workspace

* directly import graphqlschema instead of symlinking

* remove unneeded symlink (file now lives in this package)

* noEmit on extensions-client-common & refer to graphql schema in webapp only

* update paths @sourcegraph/extensions-client-common/{lib => src}

* remove unneeded workspace for and deps from extensions-client-common

* extensions-client-common compiles

* update paths in browser-extensions

* webapp compiles with ecc node_modules deleted

* compiling after adding back ecc node_modules

* root gulpfile working

* mv packages/webapp -> web

* replace "packages/webapp" with "web"

* mv packages/browser-extensions client/browser

* remove broken phabricator dev script

see https://github.com/sourcegraph/sourcegraph/issues/938

* replace "packages/browser-extensions" with "client/browser"

* mv packages/extensions-client-common shared

* update paths

* yarn.lock for browser ext

* update paths to graphqlschema

* tslint paths

* LinkOrSpan

* update gql

* client/browser typechecks

* client/browser tslint

* tsconfig.json combining

* rearrange gulpfiles

* clean up schema gulp tasks

* before linking a lot of deps

* webpack build working

* more consolidation

* add more common deps

* almost done w browser ext

* WIP just tried adding base.config.ts symlinks true

to try to fix the issues where multiple highlight.js caused hovers to fail due to no highlighting, and multiple rxjs type errors (codeintellify and sourcegraph/sourcegraph) showing up only in webpack. hypothesis is that this is due to webpack not resolving symlinks and so "seeing" multiple pkgs.

* hovers working, fixed resolve issue, just needed to add rxjs to root package.json

* regenerate lockfiles

* add browser ext to procfile

* add back builds

* manually sync contribution.schema.json

* import schema json files directly, no copying

* update import paths

* wip typescript build doc

* move enterprise/src/ into src/ for ease of typescript build

* wip build doc

* wip

* use a single root package.json

* update yarn.lock

* prettier

* set up .bin symlinks

* prettier

* all:typecheck

* fix

* fix all:typecheck

* fix schema output path

* add back .bin links

* fix link

* fix gulpfiles

* only include gulpfile in root tsconfig

* clean up gulpfiles

* generate

* fix node_modules paths in webpack

* sort

* simplify tsconfig

* ignore generated files

* fix bundlesize paths

* fix enterprise build

* fix tsconfigs

* fix back tsconfigs

* fix

* TMP

* fix path

* TIP

* WIP

* transpileonly in tests because we have already typechecked it

* fix browser ext test

* remove browser ext from procfile for now

* fix enterprise paths
2018-11-12 01:05:35 -08:00
Chris Wendt
a5b8cd4fbb build: fixups 2 (has already been reviewed by felix) 2018-11-04 14:49:27 -08:00
Chris Wendt
5c8ed1e532 build: fixups 1 (has already been reviewed by felix) 2018-11-04 14:49:27 -08:00
Quinn Slack
ce51f17d03 use a single Webpack/TypeScript build
Previously, there were 2 Webpack and TypeScript builds: in `.` and `./enterprise`. This was because these used to live in separate repositories. Now that they are in the same repository, we can combine them. The benefit of combining them is reduced complexity and duplication.

The work to combine the builds consisted of:

- Removing all Webpack/TypeScript build config files from `enterprise/`, such as `tsconfig.json`, `webpack.config.ts`, `package.json`, etc.
- Rewriting import paths in `enterprise/**/*.ts?(x)` to use relative file paths instead of importing from `@sourcegraph/webapp`.
- Removing all `dist`-related tasks from the root build config. (These were only used to export a package that `enterprise/` could use in its separate build.)

In combining the builds, some additional changes were required:

- Upgraded Webpack and various Webpack-related packages.
- Switched back to the now-recommended (no longer deprecated) webpack-dev-server from webpack-serve.
- Removed the node-sass-import-once helper because (1) it did not appear to be effective and (2) it resulted in a ModuleNotFoundError when importing a `.css` file in a dependency that itself imported a `.css` file with a relative path. (The usual solution for this is to use resolve-url-loader, but that is incompatible with node-sass-import-once. The reason this problem started occurring now is likely due to upgrading sass-loader or related packages, and that was necessitated by other errors that are not worth describing here.)
- Remove thread-loader. It did not actually speed up Webpack build times.
2018-10-28 02:00:06 -07:00
Sourcegraph
02a03f54c1 Publish Sourcegraph as open source 🚀
Internal revision: sourcegraph/sourcegraph-intermediate-2018@d0cebbadc7
Executor: @slimsag
2018-09-30 23:13:36 -07:00