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>
This commit is contained in:
Valery Bugakov 2021-03-26 15:35:26 +08:00 committed by GitHub
parent 71042b4a3f
commit 179498b257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
83 changed files with 169 additions and 420 deletions

View File

@ -98,4 +98,4 @@ node_modules/
/client/web
# Extensions
/packages/sourcegraph-extension-api/dist
/extension-api/dist

4
.eslintignore Normal file
View File

@ -0,0 +1,4 @@
out/
src/schema/*
src/graphql-operations.ts
GH2SG.bookmarklet.js

28
.gitignore vendored
View File

@ -107,34 +107,8 @@ sourcegraph-webapp-*.tgz
*.tsbuildinfo
graphql-operations.ts
# We use symlinks in the deeper node_modules to share the same .bin as the root (for CLI tools)
# unignore node_modules itself
!/client/web/node_modules
!/client/shared/node_modules
!/client/branded/node_modules
!/client/browser/node_modules
!/client/wildcard/node_modules
!/client/packages/sourcegraph-extension-api/node_modules
!/client/packages/@sourcegraph/extension-api-types/node_modules
# ignore everything inside node_modules
/client/web/node_modules/*
/client/shared/node_modules/*
/client/branded/node_modules/*
/client/browser/node_modules/*
/client/wildcard/node_modules/*
/client/packages/sourcegraph-extension-api/node_modules/*
/client/packages/@sourcegraph/extension-api-types/node_modules/*
# except .bin
!/client/web/node_modules/.bin
!/client/shared/node_modules/.bin
!/client/branded/node_modules/.bin
!/client/browser/node_modules/.bin
!/client/wildcard/node_modules/.bin
!/client/packages/sourcegraph-extension-api/node_modules/.bin
!/client/packages/@sourcegraph/extension-api-types/node_modules/.bin
# Extensions
/client/packages/sourcegraph-extension-api/dist
/client/extension-api/dist
# Symbols service: PCRE extension to sqlite3
libsqlite3-pcre.dylib

View File

@ -2,7 +2,6 @@
# Eventually, the goal is to unify this with .golangci.yml.
# https://github.com/sourcegraph/sourcegraph/issues/18720
# See explanation of linters at https://golangci-lint.run/usage/linters/
linters:
disable-all: true

View File

@ -23,7 +23,7 @@ doc/
**/.cache
**/__snapshots__
**/__fixtures__
client/contrib/GH2SG.bookmarklet.js
GH2SG.bookmarklet.js
docker-images/grafana/config/provisioning/dashboards/sourcegraph/
storybook-static/
browser/code-intel-extensions/

2
.vscode/tasks.json vendored
View File

@ -108,7 +108,7 @@
"label": "eslint:extension-api",
"type": "npm",
"script": "eslint",
"path": "client/packages/sourcegraph-extension-api/",
"path": "client/extension-api/",
"problemMatcher": ["$eslint-stylish"],
},
],

28
client/README.md Normal file
View File

@ -0,0 +1,28 @@
# Frontend packages
## List
- **web**: The web application deployed to http://sourcegraph.com/
- **browser**: The Sourcegraph browser extension adds tooltips to code on different code hosts.
- **eslint-plugin-sourcegraph**: Not published package with custom ESLint rules for Sourcegraph. Isn't intended for reuse by other repositories in the Sourcegraph org.
- **extension-api**: The Sourcegraph extension API types for the _Sourcegraph extensions_. Published as `sourcegraph`.
- **extension-api-types**: The Sourcegraph extension API types for _client applications_ that embed Sourcegraph extensions and need to communicate with them. Published as `@sourcegraph/extension-api-types`.
- **shared**: Contains common TypeScript/React/SCSS client code shared between the browser extension and the web app. Everything in this package is code-host agnostic.
- **branded**: Contains React components and implements the visual design language we use across our web app and e.g. in the options menu of the browser extension. Over time, components from `shared` and `branded` packages should be moved into the `wildcard` package.
- **wildcard**: Package that encapsulates storybook configuration and contains our Wildcard design system components. If we're using a component in two or more different areas (e.g. `web-app` and `browser-extension`) then it should live in the `wildcard` package. Otherwise the components should be better colocated with the code where they're actually used.
## Further migration plan
1. Fix circular dependency in TS project-references graph **wildcard** package should not rely on **web** and probably **shared**, **branded** too. Ideally it should be an independent self-contained package.
2. Decide on package naming and update existing package names. Especially it should be done for a **shared** package because we have multiple `shared` folders inside of other packages. It's hard to understand from where dependency is coming from and it's not possible to refactor import paths using find-and-replace.
3. Investigate if we can painlessly switch to `npm` workspaces.
4. Content of packages **shared** and **branded** should be moved to **wildcard** and refactored using the latest FE rules and conventions. Having different packages clearly communicates the migration plan. Developers first should look for components in the **wildcard** package and then fall-back to **legacy** packages if **wildcard** doesn't have the solution to their problem yet.
5. **shared** contains utility functions, types, polyfills, etc which is not a part of the Wildcard component library. These modules should be moved into **utils** package and other new packages: e.g. **api** for GraphQL client and type generators, etc.
6. Packages should use package name (e.g. `@sourcegraph/wildcard`) for imports instead of the relative paths (e.g. `../../../../wildcard/src/components/Markdown`) to avoid long relative-paths and make dependency graph between packages clear. (Typescript will warn if packages have circular dependencies). It's easy to refactor such isolated packages, extract functionality into new ones, or even into new repositories.
7. **build** or **config** package should be added later to encapsulate all the configurations reused between packages which will allow removing `jest.config`, `babel.config` from the root of the repo.

1
client/branded/node_modules/.bin generated vendored
View File

@ -1 +0,0 @@
../../../node_modules/.bin

View File

@ -1,5 +1,8 @@
{
"private": true,
"name": "@sourcegraph/branded",
"version": "1.0.0",
"license": "Apache-2.0",
"scripts": {
"eslint": "eslint --cache '**/*.[jt]s?(x)'",
"stylelint": "stylelint 'src/**/*.scss' --quiet",

View File

@ -2,7 +2,7 @@ import * as H from 'history'
import React from 'react'
import { Observable } from 'rxjs'
import { FetchFileParameters } from '../../../../../shared/src/components/CodeExcerpt'
import { Markdown } from '../../../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import { ExtensionsControllerProps } from '../../../../../shared/src/extensions/controller'
import { SettingsCascadeProps } from '../../../../../shared/src/settings/settings'
import { renderMarkdown } from '../../../../../shared/src/util/markdown'

View File

@ -1,6 +1,5 @@
{
"extends": "../../tsconfig.json",
"references": [{ "path": "../shared" }],
"compilerOptions": {
"jsx": "react",
"module": "esnext",
@ -21,4 +20,5 @@
},
"include": ["**/*", ".*", "./src/**/*.json"],
"exclude": ["../../node_modules", "./node_modules", "./out"],
"references": [{ "path": "../shared" }],
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2018 Sourcegraph
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

1
client/browser/node_modules/.bin generated vendored
View File

@ -1 +0,0 @@
../../../node_modules/.bin

View File

@ -1,6 +1,8 @@
{
"private": true,
"name": "@sourcegraph/browser",
"version": "1.0.0",
"license": "Apache-2.0",
"engines": {
"yarn": ">1.10.0"
},

View File

@ -1,4 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

View File

@ -1,20 +1,21 @@
{
"name": "eslint-plugin-sourcegraph",
"version": "0.0.0",
"private": true,
"name": "@sourcegraph/eslint-plugin-sourcegraph",
"version": "1.0.0",
"description": "Custom ESLint rules for Sourcegraph",
"keywords": ["eslint", "eslintplugin", "eslint-plugin"],
"keywords": [
"eslint",
"eslintplugin",
"eslint-plugin"
],
"main": "lib/index.js",
"scripts": {
"eslint": "../../../../node_modules/.bin/eslint",
"eslint": "echo 'TODO: add proper ESLint config, issue #19448'",
"test": "mocha tests --recursive"
},
"dependencies": {
"requireindex": "~1.1.0"
},
"devDependencies": {
"eslint": "^7.1.0",
"mocha": "^7.2.0"
},
"engines": {
"node": ">=0.10.0"
},

View File

@ -1,6 +1,7 @@
const baseConfig = require('../../../.eslintrc')
const baseConfig = require('../../.eslintrc')
module.exports = {
extends: '../../../.eslintrc.js',
extends: '../../.eslintrc.js',
parserOptions: {
...baseConfig.parserOptions,
project: __dirname + '/tsconfig.json',

View File

@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@ -9,7 +9,7 @@
"repository": {
"type": "git",
"url": "https://github.com/sourcegraph/sourcegraph",
"directory": "packages/@sourcegraph/extension-api-types"
"directory": "client/extension-api-types"
},
"license": "Apache-2.0",
"main": "",
@ -19,7 +19,7 @@
],
"sideEffects": false,
"scripts": {
"eslint": "../../../../node_modules/.bin/eslint 'src/*.[jt]s?(x)'",
"eslint": "eslint 'src/**/*.[jt]s?(x)'",
"prepublishOnly": "yarn run eslint"
},
"peerDependencies": {

View File

@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "out",
"rootDir": "src",

View File

@ -1,6 +1,7 @@
const baseConfig = require('../../../../.eslintrc')
const baseConfig = require('../../.eslintrc')
module.exports = {
extends: '../../../../.eslintrc.js',
extends: '../../.eslintrc.js',
parserOptions: {
...baseConfig.parserOptions,
project: __dirname + '/tsconfig.json',

View File

@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@ -1,9 +1,9 @@
# Sourcegraph extension API
[![codecov](https://codecov.io/gh/sourcegraph/sourcegraph-extension-api/branch/master/graph/badge.svg?token=SLtdKY3zQx)](https://codecov.io/gh/sourcegraph/sourcegraph/tree/master/packages/sourcegraph-extension-api/src)
[![codecov](https://codecov.io/gh/sourcegraph/extension-api/branch/master/graph/badge.svg?token=SLtdKY3zQx)](https://codecov.io/gh/sourcegraph/sourcegraph/tree/master/packages/extension-api/src)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![sourcegraph: search](https://img.shields.io/badge/sourcegraph-search-brightgreen.svg)](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/tree/packages/sourcegraph-extension-api)
[![sourcegraph: search](https://img.shields.io/badge/sourcegraph-search-brightgreen.svg)](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/tree/packages/extension-api)
This package contains only the types for the [Sourcegraph extension API](https://unpkg.com/sourcegraph/dist/docs/index.html) ([`sourcegraph.d.ts`](https://github.com/sourcegraph/sourcegraph/blob/main/packages/sourcegraph-extension-api/src/sourcegraph.d.ts)).
This package contains only the types for the [Sourcegraph extension API](https://unpkg.com/sourcegraph/dist/docs/index.html) ([`sourcegraph.d.ts`](https://github.com/sourcegraph/sourcegraph/blob/main/packages/extension-api/src/sourcegraph.d.ts)).
See [Sourcegraph extensions documentation](https://docs.sourcegraph.com/extensions) for more information.

View File

@ -1,6 +1,7 @@
{
"name": "sourcegraph",
"version": "25.1.0",
"license": "Apache-2.0",
"description": "Sourcegraph extension API: build extensions that enhance reading and reviewing code in your existing tools",
"author": "Sourcegraph",
"bugs": {
@ -9,9 +10,8 @@
"repository": {
"type": "git",
"url": "https://github.com/sourcegraph/sourcegraph",
"directory": "packages/sourcegraph-extension-api"
"directory": "client/extension-api"
},
"license": "Apache-2.0",
"main": "src/index.js",
"module": "src/index.js",
"types": "src/sourcegraph.d.ts",
@ -21,7 +21,7 @@
],
"sideEffects": false,
"scripts": {
"eslint": "../../../node_modules/.bin/eslint 'src/*.[jt]s?(x)'",
"eslint": "eslint 'src/*.[jt]s?(x)'",
"docs": "typedoc",
"prepublishOnly": "yarn run eslint && yarn run docs"
},

View File

@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"allowJs": true,
"outDir": "out",

View File

@ -1 +0,0 @@
yarn.lock

View File

@ -1 +0,0 @@
../../../../../node_modules/.bin

View File

@ -1 +0,0 @@
../../../../node_modules/.bin

View File

@ -1,227 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
commander@~2.20.0:
version "2.20.0"
resolved "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^4.0.0"
universalify "^0.1.0"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
glob@^7.0.0:
version "7.1.4"
resolved "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255"
integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.1"
resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.1.tgz#1c1f0c364882c868f5bff6512146328336a11b1d"
integrity sha512-b9usnbDGnD928gJB3LrCmxoibr3VE4U2SMo5PBuBnokWyDADTqDPXg4YpwKF1trpH+UbGp7QLicO3+aWEy0+mw==
handlebars@^4.7.6:
version "4.7.6"
resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e"
integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==
dependencies:
minimist "^1.2.5"
neo-async "^2.6.0"
source-map "^0.6.1"
wordwrap "^1.0.0"
optionalDependencies:
uglify-js "^3.1.4"
highlight.js@^10.0.0:
version "10.4.1"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.4.1.tgz#d48fbcf4a9971c4361b3f95f302747afe19dbad0"
integrity sha512-yR5lWvNz7c85OhVAEAeFhVCc/GV4C30Fjzc/rCP0aCWzc1UUOPUk55dK/qdwTZHBvMZo+eZ2jpk62ndX/xMFlg==
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2:
version "2.0.4"
resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
interpret@^1.0.0:
version "1.2.0"
resolved "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"
integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==
jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
optionalDependencies:
graceful-fs "^4.1.6"
lodash@^4.17.15:
version "4.17.19"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
lunr@^2.3.8:
version "2.3.8"
resolved "https://registry.npmjs.org/lunr/-/lunr-2.3.8.tgz#a8b89c31f30b5a044b97d2d28e2da191b6ba2072"
integrity sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==
marked@1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz#d35784245a04871e5988a491e28867362e941693"
integrity sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==
minimatch@^3.0.0, minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
dependencies:
brace-expansion "^1.1.7"
minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
neo-async@^2.6.0:
version "2.6.1"
resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==
once@^1.3.0:
version "1.4.0"
resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
dependencies:
wrappy "1"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
path-parse@^1.0.6:
version "1.0.6"
resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
progress@^2.0.3:
version "2.0.3"
resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=
dependencies:
resolve "^1.1.6"
resolve@^1.1.6:
version "1.12.0"
resolved "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"
integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==
dependencies:
path-parse "^1.0.6"
shelljs@^0.8.4:
version "0.8.4"
resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"
source-map@^0.6.1, source-map@~0.6.1:
version "0.6.1"
resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
typedoc-default-themes@^0.10.2:
version "0.10.2"
resolved "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.10.2.tgz#743380a80afe62c5ef92ca1bd4abe2ac596be4d2"
integrity sha512-zo09yRj+xwLFE3hyhJeVHWRSPuKEIAsFK5r2u47KL/HBKqpwdUSanoaz5L34IKiSATFrjG5ywmIu98hPVMfxZg==
dependencies:
lunr "^2.3.8"
typedoc@^0.17.8:
version "0.17.8"
resolved "https://registry.npmjs.org/typedoc/-/typedoc-0.17.8.tgz#96b67e9454aa7853bfc4dc9a55c8a07adfd5478e"
integrity sha512-/OyrHCJ8jtzu+QZ+771YaxQ9s4g5Z3XsQE3Ma7q+BL392xxBn4UMvvCdVnqKC2T/dz03/VXSLVKOP3lHmDdc/w==
dependencies:
fs-extra "^8.1.0"
handlebars "^4.7.6"
highlight.js "^10.0.0"
lodash "^4.17.15"
lunr "^2.3.8"
marked "1.0.0"
minimatch "^3.0.0"
progress "^2.0.3"
shelljs "^0.8.4"
typedoc-default-themes "^0.10.2"
uglify-js@^3.1.4:
version "3.6.0"
resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5"
integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==
dependencies:
commander "~2.20.0"
source-map "~0.6.1"
universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
wordwrap@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=
wrappy@1:
version "1.0.2"
resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=

1
client/shared/node_modules/.bin generated vendored
View File

@ -1 +0,0 @@
../../../node_modules/.bin

View File

@ -1,11 +1,15 @@
{
"private": true,
"name": "@sourcegraph/shared",
"version": "1.0.0",
"license": "Apache-2.0",
"scripts": {
"eslint": "eslint --cache '**/*.[jt]s?(x)'",
"stylelint": "stylelint 'src/**/*.scss' --quiet",
"test": "jest",
"graphql": "gulp graphQlSchema",
"schema": "gulp schema",
"graphql-operations": "gulp graphQlOperations",
"watch-schema": "gulp watchSchema",
"download-puppeteer-browser":"TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\":\\\"commonjs\\\"}\" ts-node ./scripts/download-puppeteer-browser.ts"
},

View File

@ -1,6 +1,5 @@
{
"extends": "../../tsconfig.json",
"references": [],
"compilerOptions": {
"jsx": "react",
"module": "esnext",

View File

@ -1,3 +1,5 @@
src/schema/*
src/graphql-operations.ts
out/
.eslintrc.js
GH2SG.bookmarklet.js

1
client/web/node_modules/.bin generated vendored
View File

@ -1 +0,0 @@
../../../node_modules/.bin

View File

@ -1,9 +1,9 @@
{
"private": true,
"name": "webapp",
"name": "@sourcegraph/web",
"version": "1.10.1",
"description": "The Sourcegraph web app",
"license": "MIT",
"license": "Apache-2.0",
"scripts": {
"test": "jest --testPathIgnorePatterns end-to-end --testPathIgnorePatterns regression integration",
"test:regression": "mocha './src/regression/**/*.test.ts' --exit",
@ -26,7 +26,8 @@
"browserslist": "browserslist",
"analyze-bundle": "NODE_ENV=production ENTERPRISE=1 WEBPACK_ANALYZER=1 yarn build"
},
"bundlesize": [{
"bundlesize": [
{
"path": "../../ui/assets/styles/app.bundle.css"
},
{

View File

@ -1,6 +1,6 @@
import { Observable, ReplaySubject } from 'rxjs'
import { catchError, map, mergeMap, tap } from 'rxjs/operators'
import { dataOrThrowErrors, gql } from '../../shared/src/graphql/graphql'
import { dataOrThrowErrors, gql } from '@sourcegraph/shared/src/graphql/graphql'
import { requestGraphQL } from './backend/graphql'
import { CurrentAuthStateResult } from './graphql-operations'

View File

@ -7,7 +7,7 @@ import { renderMarkdown } from '../../../shared/src/util/markdown'
import { SearchResultMatch } from './SearchResultMatch'
import { ThemeProps } from '../../../shared/src/theme'
import * as H from 'history'
import { Markdown } from '../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
interface Props extends ThemeProps {
result: Omit<GQL.IGenericSearchResultInterface, '__typename'>

View File

@ -7,7 +7,7 @@ import VisibilitySensor from 'react-visibility-sensor'
import { combineLatest, of, Subject, Subscription } from 'rxjs'
import { catchError, distinctUntilChanged, filter, switchMap } from 'rxjs/operators'
import sanitizeHtml from 'sanitize-html'
import { Markdown } from '../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import * as GQL from '../../../shared/src/graphql/schema'
import { highlightNode } from '../../../shared/src/util/dom'
import { highlightCode } from '../search/backend'

View File

@ -2,7 +2,7 @@ import AlertCircleIcon from 'mdi-react/AlertCircleIcon'
import React from 'react'
import { asError } from '../../../shared/src/util/errors'
import { upperFirst } from 'lodash'
import { Markdown } from '../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import { renderMarkdown } from '../../../shared/src/util/markdown'
import classNames from 'classnames'
import { useHistory } from 'react-router'

View File

@ -1,6 +1,6 @@
import * as H from 'history'
import React, { useEffect, useCallback, useState } from 'react'
import { Markdown } from '../../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import { asError, isErrorLike } from '../../../../shared/src/util/errors'
import { renderMarkdown } from '../../../../shared/src/util/markdown'
import { PageTitle } from '../PageTitle'

View File

@ -1,6 +1,5 @@
{
"extends": "../../tsconfig.json",
"references": [{ "path": "../../../shared/src/testing" }, { "path": "../../../../schema" }],
"compilerOptions": {
"types": ["mocha", "node"],
"module": "commonjs",
@ -12,6 +11,7 @@
},
],
},
"references": [{ "path": "../../../shared/src/testing" }, { "path": "../../../../schema" }],
"include": ["**/*"],
"exclude": [],
}

View File

@ -1,6 +1,6 @@
import * as H from 'history'
import React from 'react'
import { Markdown } from '../../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import { renderMarkdown } from '../../../../shared/src/util/markdown'
import { BatchChangeFields } from '../../graphql-operations'
import classNames from 'classnames'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { Markdown } from '../../../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import { renderMarkdown } from '../../../../../shared/src/util/markdown'
import { Link } from '../../../../../shared/src/components/Link'
import classNames from 'classnames'

View File

@ -1,6 +1,6 @@
import * as React from 'react'
import { Link } from 'react-router-dom'
import { Markdown } from '../../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import { ConfiguredRegistryExtension } from '../../../../shared/src/extensions/extension'
import { isErrorLike } from '../../../../shared/src/util/errors'
import { renderMarkdown } from '../../../../shared/src/util/markdown'

View File

@ -2,7 +2,7 @@ import ErrorIcon from 'mdi-react/ErrorIcon'
import InformationIcon from 'mdi-react/InformationIcon'
import WarningIcon from 'mdi-react/WarningIcon'
import React from 'react'
import { Markdown } from '../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import * as GQL from '../../../shared/src/graphql/schema'
import { renderMarkdown } from '../../../shared/src/util/markdown'
import { DismissibleAlert } from '../components/DismissibleAlert'

View File

@ -2,7 +2,7 @@ import { parseISO } from 'date-fns'
import differenceInDays from 'date-fns/differenceInDays'
import * as React from 'react'
import { Subscription } from 'rxjs'
import { Markdown } from '../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import { isSettingsValid, SettingsCascadeProps } from '../../../shared/src/settings/settings'
import { renderMarkdown } from '../../../shared/src/util/markdown'
import { DismissibleAlert } from '../components/DismissibleAlert'

View File

@ -1,5 +1,5 @@
import * as React from 'react'
import { Markdown } from '../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import { isSettingsValid, SettingsCascadeProps } from '../../../shared/src/settings/settings'
import { renderMarkdown } from '../../../shared/src/util/markdown'
import { DismissibleAlert } from '../components/DismissibleAlert'

View File

@ -1,6 +1,6 @@
import * as React from 'react'
import * as H from 'history'
import { Markdown } from '../../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import { useScrollToLocationHash } from '../../components/useScrollToLocationHash'
interface Props {

View File

@ -7,7 +7,7 @@ import InformationOutlineIcon from 'mdi-react/InformationOutlineIcon'
import SearchIcon from 'mdi-react/SearchIcon'
import React, { useCallback, useState } from 'react'
import { Button, Collapse, Form, FormGroup, Input, Label } from 'reactstrap'
import { Markdown } from '../../../../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import { renderMarkdown } from '../../../../../../shared/src/util/markdown'
import { SyntaxHighlightedSearchQuery } from '../../../../components/SyntaxHighlightedSearchQuery'
import { Skipped } from '../../../stream'

View File

@ -1,5 +1,5 @@
import React, { useEffect, useRef } from 'react'
import { Markdown } from '../../../shared/src/components/Markdown'
import { Markdown } from '@sourcegraph/shared/src/components/Markdown'
import { renderMarkdown } from '../../../shared/src/util/markdown'
import { MarkupKind } from '@sourcegraph/extension-api-classes'
import * as H from 'history'

View File

@ -1,6 +1,5 @@
{
"extends": "../../tsconfig.json",
"references": [{ "path": "../shared" }, { "path": "../branded" }, { "path": "../../schema" }],
"compilerOptions": {
"module": "commonjs",
"baseUrl": ".",
@ -18,6 +17,7 @@
},
],
},
"references": [{ "path": "../shared" }, { "path": "../branded" }, { "path": "../../schema" }],
"include": ["**/*", ".*", "./src/**/*.json"],
"exclude": ["../../node_modules", "./node_modules", "./out", "src/end-to-end", "src/regression", "src/integration"],
}

View File

@ -1,4 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

1
client/wildcard/node_modules/.bin generated vendored
View File

@ -1 +0,0 @@
../../../node_modules/.bin

View File

@ -5,7 +5,7 @@
"description": "Sourcegraph Wildcard component library",
"main": "./src/index.ts",
"sideEffects": false,
"license": "MIT",
"license": "Apache-2.0",
"scripts": {
"eslint": "eslint --cache '**/*.[jt]s?(x)'",
"stylelint": "stylelint 'src/**/*.scss' --quiet",

View File

@ -2,8 +2,8 @@ import { storiesOf } from '@storybook/react'
import React, { useState } from 'react'
import { number } from '@storybook/addon-knobs'
import webStyles from '../../../../web/src/SourcegraphWebApp.scss'
import { PageSelector } from './PageSelector'
import { BrandedStory } from '../../../../branded/src/components/BrandedStory'
import { PageSelector } from './PageSelector'
const { add } = storiesOf('wildcard/PageSelector', module).addDecorator(story => (
<BrandedStory styles={webStyles}>{() => <div className="container web-content mt-3">{story()}</div>}</BrandedStory>

View File

@ -1,2 +1,4 @@
// TODO: research possible issue around one file export pattern and tree-shaking
// https://github.com/sourcegraph/sourcegraph/issues/19451
export * from './components'
export * from './hooks'

View File

@ -1,6 +1,5 @@
{
"extends": "../../tsconfig.json",
"references": [{ "path": "../shared" }, { "path": "../branded" }, { "path": "../../schema" }],
"compilerOptions": {
"module": "esnext",
"sourceRoot": "src",
@ -9,6 +8,7 @@
"baseUrl": "./src",
"jsx": "react",
},
"references": [{ "path": "../shared" }, { "path": "../branded" }, { "path": "../../schema" }],
"include": ["**/*", ".*"],
"exclude": ["../../node_modules", "./node_modules", "./out"],
}

View File

@ -16,9 +16,9 @@ DIRS=(
client/branded
client/browser
client/wildcard
client/packages/sourcegraph-extension-api
client/packages/@sourcegraph/eslint-plugin-sourcegraph
client/packages/@sourcegraph/extension-api-types
client/extension-api
client/eslint-plugin-sourcegraph
client/extension-api-types
dev/release
dev/ts-morph
)

View File

@ -1,6 +1,5 @@
{
"extends": "../../tsconfig.json",
"references": [],
"compilerOptions": {
"lib": ["esnext"],
"module": "commonjs",

View File

@ -47,7 +47,7 @@ It might *seem* like staying in a single tool (your editor) means staying in flo
- 😊 A separate code search tool would let you quickly triage a bug on any branch without changing your local branch or affecting your dev setup.
- 😊 The code search tool can show much more helpful code context, such as [Git blame information after each line](https://sourcegraph.com/extensions/sourcegraph/git-extras), [code coverage overlays](https://sourcegraph.com/extensions/sourcegraph/codecov), runtime info from [Datadog](https://sourcegraph.com/extensions/sourcegraph/datadog-metrics)/[LightStep](https://sourcegraph.com/extensions/sourcegraph/lightstep)/[Sentry](https://sourcegraph.com/extensions/sourcegraph/sentry)/etc., static analysis and lint results from [SonarQube](https://sourcegraph.com/extensions/sourcegraph/sonarqube), and more. You could configure some of these things to display in your editor, but that's cumbersome and they're noisy for the majority of the time when you're writing code.
- 😊 A code search tool does all the hard work (indexing and analysis) on the server beforehand, so your local machine remains fast and responsive.
> "The JetBrains IDEs have great search capabilities. However, indexing a large repo is slow and draining on even a powerful MacBook Pro, and that happens every time you switch to another branch."
- 😊 If you identify a likely culprit (such as a problematic line of code) via code search, it's easy to get a permalink to that line to add to the bug report.

View File

@ -69,7 +69,7 @@ Sample use cases for this are for tracking migrations, usage of libraries across
Code insights are currently feature-flagged - set `"experimentalFeatures": { "codeInsights": true }` in your user settings to enable them.
Code insights currently work through [**extensions**](#sourcegraph-extension-api).
Code insights currently work through [**extensions**](#extension-api).
A code insight extension can register a _view provider_ that contributes a graph to either the repository/directory page, the [search homepage](https://sourcegraph.com/search), or the [global "Insights" dashboard](https://sourcegraph.com/insights) reachable from the navbar.
It is called on-demand on the client (the browser) to return the data needed for the chart.
_How_ that extension produces the data is up to the extension - it can run search queries, query code intelligence data or analyze Git data using the Sourcegraph GraphQL API, or it can query an external service using its public API, e.g. Codecov.
@ -80,7 +80,7 @@ Just like other extensions, it's also possible to install and configure them org
Because of code insights currently being run on-demand in the client, the performance of code insights is bound to the performance of the underlying data source.
For example, search queries are relatively fast as long as the scope doesn't include many repositories, but performance degrades when trying to include a lot of repositories.
We're actively working on removing this limitation.
We're actively working on removing this limitation.
If you want to learn more about code insights:
@ -157,9 +157,9 @@ If you want to learn more about src-cli:
## Editor extensions
Sourcegraph editor extensions will bring Sourcegraph features like search, code intelligence, and Sourcegraph extensions into your IDE. (Switching between Sourcegraph and an IDE when viewing a file is separately powered by Sourcegraph extensions.)
Sourcegraph editor extensions will bring Sourcegraph features like search, code intelligence, and Sourcegraph extensions into your IDE. (Switching between Sourcegraph and an IDE when viewing a file is separately powered by Sourcegraph extensions.)
The editor extension is still in the exploratory phase of determining priority and scope. For more information:
The editor extension is still in the exploratory phase of determining priority and scope. For more information:
- [PD19: IDE Extension (Research & Exploration)](https://docs.google.com/document/d/1LpShKInGJo0BBDnRQW4yz4_CjhjK_FYcwse4LYXGImE/edit#)

View File

@ -2,7 +2,7 @@
A [Sourcegraph extension](../index.md) is a single JavaScript file that runs in users' web browsers in a Web Worker and has an exported `activate` function. The JavaScript file is usually produced by compiling and bundling one or more TypeScript source files.
The [Sourcegraph extension API](https://unpkg.com/sourcegraph/dist/docs/index.html) (generated from [`sourcegraph.d.ts`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/packages/sourcegraph-extension-api/src/sourcegraph.d.ts)) is available to extensions by [importing the `sourcegraph` module](importing_sourcegraph.md). Writing a Sourcegraph extension is very similar to writing an editor extension for [VS Code](https://code.visualstudio.com/docs/extensions/overview).
The [Sourcegraph extension API](https://unpkg.com/sourcegraph/dist/docs/index.html) (generated from [`sourcegraph.d.ts`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/extension-api/src/sourcegraph.d.ts)) is available to extensions by [importing the `sourcegraph` module](importing_sourcegraph.md). Writing a Sourcegraph extension is very similar to writing an editor extension for [VS Code](https://code.visualstudio.com/docs/extensions/overview).
## Explanations
- [Activation and deactivation](activation.md)
@ -26,7 +26,7 @@ The [Sourcegraph extension API](https://unpkg.com/sourcegraph/dist/docs/index.ht
- [File decorations](tutorials/file_decorations.md)
## References
- [Extension API documentation](https://unpkg.com/sourcegraph/dist/docs/index.html) (full API is in [`sourcegraph.d.ts`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/packages/sourcegraph-extension-api/src/sourcegraph.d.ts))
- [Extension API documentation](https://unpkg.com/sourcegraph/dist/docs/index.html) (full API is in [`sourcegraph.d.ts`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/extension-api/src/sourcegraph.d.ts))
- [Extension manifest (`package.json`)](manifest.md)
- [Testing extensions](testing_extensions.md)
- [Example extension: Token Highlights](https://github.com/sourcegraph/sourcegraph-extension-samples/tree/master/token-highlights)

View File

@ -1,8 +1,8 @@
# Sourcegraph Firefox Add-on security
## Why can't I get Sourcegraph extensions in the FireFox Add-on?
## Why can't I get Sourcegraph extensions in the FireFox Add-on?
We removed extensions except code intelligence language extensions in order to comply with Mozilla's policy regarding [add-on development practices](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/AMO/Policy/Reviews#Development_Practices).
We removed extensions except code intelligence language extensions in order to comply with Mozilla's policy regarding [add-on development practices](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/AMO/Policy/Reviews#Development_Practices).
This issue is specifically related to how we have chosen to implement Sourcegraph extensions.
@ -20,15 +20,15 @@ Sourcegraph extensions are executed from remote code, but their execution enviro
* The JavaScript bundles are fetched at runtime, and executed in a WebWorker in the add-ons background page, using `WebWorkerGlobalScope.importScripts()`
* Executing in the background page ensures extensions never have access to your browsing context. They cannot manipulate the DOM, or make same-origin requests on websites you visit.
* The sandboxed scope of the WebWorker means Sourcegraph extensions cant interact with the WebExtension APIs.
* The extensions interactions are strictly restricted to what is defined in the [Sourcegraph extension API](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/packages/sourcegraph-extension-api/src/sourcegraph.d.ts).
* The extensions interactions are strictly restricted to what is defined in the [Sourcegraph extension API](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/packages/extension-api/src/sourcegraph.d.ts).
The above, third-party extensions being opt-in, and users always being able to inspect the bundle of Sourcegraph extensions when they enable them, makes us confident that Sourcegraph extensions do not negatively impact our users browsing safety.
Mozillas main objection to our execution model is the fact that extensions upgrade automatically without user interaction, so the add-on will always fetch the latest version of the extension from your Sourcegraph instance. In order to be compliant, we had to remove non-language extensions.
Mozillas main objection to our execution model is the fact that extensions upgrade automatically without user interaction, so the add-on will always fetch the latest version of the extension from your Sourcegraph instance. In order to be compliant, we had to remove non-language extensions.
## What can I do?
If you use Bitbucket Server, you can enable the [Bitbucket Server plugin](bitbucket_server.md#sourcegraph-bitbucket-server-plugin) to bring Sourcegraph functionality including extensions to your code host directly. Otherwise, to get Sourcegraph extensions on your code host via the browser extension, you must use either our Safari or Chrome [browser extension](browser_extension.md).
If you use Bitbucket Server, you can enable the [Bitbucket Server plugin](bitbucket_server.md#sourcegraph-bitbucket-server-plugin) to bring Sourcegraph functionality including extensions to your code host directly. Otherwise, to get Sourcegraph extensions on your code host via the browser extension, you must use either our Safari or Chrome [browser extension](browser_extension.md).
## What are Sourcegraph extensions, and who can author them?

View File

@ -44,6 +44,7 @@ const config = {
// https://github.com/Microsoft/monaco-editor/issues/996
'^monaco-editor': 'monaco-editor/esm/vs/editor/editor.main.js',
},
modulePaths: ['node_modules', '<rootDir>/src'],
// By default, don't clutter `yarn test --watch` output with the full coverage table. To see it, use the
// `--coverageReporters text` jest option.

View File

@ -1,7 +1,7 @@
{
"private": true,
"description": "The Sourcegraph web app",
"license": "MIT",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/sourcegraph/sourcegraph"
@ -14,12 +14,12 @@
"prettier": "prettier '**/{*.{js?(on),ts?(x),graphql,md,scss},.*.js?(on)}' --write --list-different --config prettier.config.js",
"prettier-check": "yarn -s run prettier --write=false",
"all:eslint": "DOCSITE_LIST=\"$(./dev/docsite.sh -config doc/docsite.json ls)\" dev/foreach-ts-project.sh yarn -s run eslint --quiet",
"all:stylelint": "yarn --cwd client/web run stylelint && yarn --cwd client/shared run stylelint && yarn --cwd client/branded run stylelint && yarn --cwd client/browser run stylelint && yarn --cwd client/wildcard run stylelint",
"all:stylelint": "yarn --cwd client/web run stylelint && yarn --cwd client/shared run stylelint && yarn --cwd client/branded run stylelint && yarn --cwd client/browser run stylelint && yarn --cwd client/wildcard run stylelint",
"all:tsgql": "yarn --cwd client/web run tsgql validate -p . --exitOnWarn && yarn --cwd client/shared run tsgql validate -p . --exitOnWarn && yarn --cwd client/browser run tsgql validate -p . --exitOnWarn",
"build-ts": "tsc -b tsconfig.all.json",
"graphql-lint": "graphql-schema-linter cmd/frontend/graphqlbackend/schema.graphql",
"build-web": "yarn --cwd client/web run build",
"watch-web": "yarn --cwd client/web run watch",
"build-web": "yarn workspace @sourcegraph/web run build",
"watch-web": "yarn workspace @sourcegraph/web run watch",
"generate": "gulp generate",
"watch-generate": "gulp watchGenerate",
"test": "jest --testPathIgnorePatterns end-to-end regression integration storybook",
@ -72,6 +72,11 @@
"**/assets"
]
},
"workspaces": {
"packages": [
"client/*"
]
},
"devDependencies": {
"@atlassian/aui": "^7.10.1",
"@babel/core": "^7.12.3",
@ -96,7 +101,7 @@
"@slack/web-api": "^5.10.0",
"@sourcegraph/babel-plugin-transform-react-hot-loader-wrapper": "^1.0.0",
"@sourcegraph/eslint-config": "^0.23.0",
"@sourcegraph/eslint-plugin-sourcegraph": "link:client/packages/@sourcegraph/eslint-plugin-sourcegraph",
"@sourcegraph/eslint-plugin-sourcegraph": "1.0.0",
"@sourcegraph/prettierrc": "^3.0.3",
"@sourcegraph/stylelint-config": "^1.2.0",
"@sourcegraph/tsconfig": "^4.0.1",
@ -274,7 +279,7 @@
"@slimsag/react-shortcuts": "^1.2.1",
"@sourcegraph/codeintellify": "^7.2.0",
"@sourcegraph/extension-api-classes": "^1.1.0",
"@sourcegraph/extension-api-types": "link:client/packages/@sourcegraph/extension-api-types",
"@sourcegraph/extension-api-types": "link:client/extension-api-types",
"@sourcegraph/react-loading-spinner": "0.0.7",
"@sqs/jsonc-parser": "^1.0.3",
"bootstrap": "^4.5.2",
@ -324,7 +329,7 @@
"sanitize-html": "^1.26.0",
"semver": "^7.3.2",
"shepherd.js": "^8.0.2",
"sourcegraph": "link:client/packages/sourcegraph-extension-api",
"sourcegraph": "link:client/extension-api",
"string-score": "^1.0.1",
"tabbable": "^5.1.5",
"tagged-template-noop": "^2.1.1",

View File

@ -1,6 +1,5 @@
{
"extends": "../tsconfig.json",
"references": [],
"compilerOptions": {
"rootDir": ".",
"outDir": "out",

View File

@ -11,8 +11,8 @@
{ "path": "client/web/src/integration" },
{ "path": "client/browser" },
{ "path": "client/browser/src/end-to-end" },
{ "path": "client/packages/sourcegraph-extension-api" },
{ "path": "client/packages/@sourcegraph/extension-api-types" },
{ "path": "client/extension-api" },
{ "path": "client/extension-api-types" },
{ "path": "dev/release" },
{ "path": "schema" },
],

View File

@ -1,6 +1,5 @@
{
"extends": "@sourcegraph/tsconfig",
"references": [],
"compilerOptions": {
"target": "es2020",
"module": "commonjs",

View File

@ -62,6 +62,13 @@
underscore "1.6.0"
webcomponents.js "0.7.20"
"@babel/code-frame@7.12.11", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.5.5":
version "7.12.11"
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f"
integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==
dependencies:
"@babel/highlight" "^7.10.4"
"@babel/code-frame@7.8.3":
version "7.8.3"
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e"
@ -69,13 +76,6 @@
dependencies:
"@babel/highlight" "^7.8.3"
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.5.5":
version "7.10.4"
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a"
integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==
dependencies:
"@babel/highlight" "^7.10.4"
"@babel/compat-data@^7.12.1", "@babel/compat-data@^7.12.5":
version "7.12.5"
resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.5.tgz#f56db0c4bb1bbbf221b4e81345aab4141e7cb0e9"
@ -1353,10 +1353,10 @@
ts-node "^9"
tslib "^2"
"@eslint/eslintrc@^0.2.2":
version "0.2.2"
resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz#d01fc791e2fc33e88a29d6f3dc7e93d0cd784b76"
integrity sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==
"@eslint/eslintrc@^0.4.0":
version "0.4.0"
resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz#99cc0a0584d72f1df38b900fb062ba995f395547"
integrity sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==
dependencies:
ajv "^6.12.4"
debug "^4.1.1"
@ -1365,7 +1365,6 @@
ignore "^4.0.6"
import-fresh "^3.2.1"
js-yaml "^3.13.1"
lodash "^4.17.19"
minimatch "^3.0.4"
strip-json-comments "^3.1.1"
@ -2718,10 +2717,6 @@
eslint-plugin-rxjs "^2.1.5"
eslint-plugin-unicorn "^21.0.0"
"@sourcegraph/eslint-plugin-sourcegraph@link:client/packages/@sourcegraph/eslint-plugin-sourcegraph":
version "0.0.0"
uid ""
"@sourcegraph/event-positions@^1.0.4":
version "1.0.4"
resolved "https://registry.npmjs.org/@sourcegraph/event-positions/-/event-positions-1.0.4.tgz#031541374b725cfb0cbefaa07add020b1a119a60"
@ -2738,14 +2733,8 @@
dependencies:
"@sourcegraph/extension-api-types" "^2.1.0"
"@sourcegraph/extension-api-types@^2.0.0", "@sourcegraph/extension-api-types@^2.1.0":
"@sourcegraph/extension-api-types@link:client/extension-api-types":
version "2.1.0"
resolved "https://registry.npmjs.org/@sourcegraph/extension-api-types/-/extension-api-types-2.1.0.tgz#dcc81eba70371c9aabc7333361f5e1ed63e7c91e"
integrity sha512-KWxkyphmlwam8kfYPSmoitKQRMGQCsr1ZRmNZgijT7ABKaVyk/+I5ezt2J213tM04Hi0vyg4L7iH1VCkNvm2Jw==
"@sourcegraph/extension-api-types@link:client/packages/@sourcegraph/extension-api-types":
version "0.0.0"
uid ""
"@sourcegraph/prettierrc@^3.0.3":
version "3.0.3"
@ -8427,9 +8416,9 @@ debug@=3.1.0, debug@~3.1.0:
ms "2.0.0"
debug@^3.0.0, debug@^3.0.1, debug@^3.1.0, debug@^3.1.1, debug@^3.2.6:
version "3.2.7"
resolved "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==
version "3.2.6"
resolved "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
dependencies:
ms "^2.1.1"
@ -9915,12 +9904,12 @@ eslint@^3.7.1:
user-home "^2.0.0"
eslint@^7.17.0:
version "7.17.0"
resolved "https://registry.npmjs.org/eslint/-/eslint-7.17.0.tgz#4ccda5bf12572ad3bf760e6f195886f50569adb0"
integrity sha512-zJk08MiBgwuGoxes5sSQhOtibZ75pz0J35XTRlZOk9xMffhpA9BTbQZxoXZzOl5zMbleShbGwtw+1kGferfFwQ==
version "7.21.0"
resolved "https://registry.npmjs.org/eslint/-/eslint-7.21.0.tgz#4ecd5b8c5b44f5dedc9b8a110b01bbfeb15d1c83"
integrity sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg==
dependencies:
"@babel/code-frame" "^7.0.0"
"@eslint/eslintrc" "^0.2.2"
"@babel/code-frame" "7.12.11"
"@eslint/eslintrc" "^0.4.0"
ajv "^6.10.0"
chalk "^4.0.0"
cross-spawn "^7.0.2"
@ -9931,9 +9920,9 @@ eslint@^7.17.0:
eslint-utils "^2.1.0"
eslint-visitor-keys "^2.0.0"
espree "^7.3.1"
esquery "^1.2.0"
esquery "^1.4.0"
esutils "^2.0.2"
file-entry-cache "^6.0.0"
file-entry-cache "^6.0.1"
functional-red-black-tree "^1.0.1"
glob-parent "^5.0.0"
globals "^12.1.0"
@ -9944,7 +9933,7 @@ eslint@^7.17.0:
js-yaml "^3.13.1"
json-stable-stringify-without-jsonify "^1.0.1"
levn "^0.4.1"
lodash "^4.17.19"
lodash "^4.17.20"
minimatch "^3.0.4"
natural-compare "^1.4.0"
optionator "^0.9.1"
@ -10002,10 +9991,10 @@ esprima@4.0.1, esprima@^4.0.0, esprima@^4.0.1, esprima@~4.0.0:
resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
esquery@^1.0.0, esquery@^1.0.1, esquery@^1.2.0:
version "1.3.1"
resolved "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57"
integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==
esquery@^1.0.0, esquery@^1.0.1, esquery@^1.4.0:
version "1.4.0"
resolved "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5"
integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==
dependencies:
estraverse "^5.1.0"
@ -10530,10 +10519,10 @@ file-entry-cache@^5.0.1:
dependencies:
flat-cache "^2.0.1"
file-entry-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz#7921a89c391c6d93efec2169ac6bf300c527ea0a"
integrity sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==
file-entry-cache@^6.0.0, file-entry-cache@^6.0.1:
version "6.0.1"
resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027"
integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==
dependencies:
flat-cache "^3.0.4"
@ -12023,9 +12012,9 @@ hex-color-regex@^1.1.0:
integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==
highlight.js@^10.1.1, highlight.js@^10.5.0:
version "10.5.0"
resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-10.5.0.tgz#3f09fede6a865757378f2d9ebdcbc15ba268f98f"
integrity sha512-xTmvd9HiIHR6L53TMC7TKolEj65zG1XU+Onr8oi86mYa+nLcIbxTTWkpW7CsEwv/vK7u1zb8alZIMLDqqN6KTw==
version "10.6.0"
resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-10.6.0.tgz#0073aa71d566906965ba6e1b7be7b2682f5e18b6"
integrity sha512-8mlRcn5vk/r4+QcqerapwBYTe+iPL5ih6xrNylxrnBdHQiijDETfXX7VIxC3UiCRiINBJfANBAsPzAvRQj8RpQ==
highlight.js@~10.4.0:
version "10.4.1"
@ -12806,9 +12795,9 @@ is-buffer@^1.1.5:
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
is-buffer@^2.0.0, is-buffer@^2.0.2:
version "2.0.4"
resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz#3e572f23c8411a5cfd9557c849e3665e0b290623"
integrity sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==
version "2.0.5"
resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191"
integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==
is-callable@^1.1.4, is-callable@^1.1.5, is-callable@^1.2.3:
version "1.2.3"
@ -20142,7 +20131,7 @@ sourcegraph@^24.0.0:
resolved "https://registry.npmjs.org/sourcegraph/-/sourcegraph-24.8.0.tgz#27dc196d8a050ac69f03c3680229d1866f57c754"
integrity sha512-uB2SbjEzcA/HWP3Rj+INUXqQweO8HmRdVWW7zesFWZQFBcu7JTcq0pg0jeAN71glKPIyyOgZVrIm1d7KoVzfZw==
"sourcegraph@link:client/packages/sourcegraph-extension-api":
"sourcegraph@link:client/extension-api":
version "0.0.0"
uid ""