diff --git a/.dockerignore b/.dockerignore index 00b2448d466..e5cfd89a37c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -98,4 +98,4 @@ node_modules/ /client/web # Extensions -/packages/sourcegraph-extension-api/dist +/extension-api/dist diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000000..aa26087a92c --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +out/ +src/schema/* +src/graphql-operations.ts +GH2SG.bookmarklet.js diff --git a/.gitignore b/.gitignore index ba0a548e516..17d74caf88a 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.golangci.enforced.yml b/.golangci.enforced.yml index 9e2dd01b7d4..8dd64569a7f 100644 --- a/.golangci.enforced.yml +++ b/.golangci.enforced.yml @@ -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 diff --git a/.prettierignore b/.prettierignore index 4ca87659287..fe38de2e01a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -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/ diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 942493f9d7c..1e7605ccf54 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -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"], }, ], diff --git a/client/README.md b/client/README.md new file mode 100644 index 00000000000..297e0cbcfd4 --- /dev/null +++ b/client/README.md @@ -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. diff --git a/client/branded/node_modules/.bin b/client/branded/node_modules/.bin deleted file mode 120000 index 1dedf1a6f80..00000000000 --- a/client/branded/node_modules/.bin +++ /dev/null @@ -1 +0,0 @@ -../../../node_modules/.bin \ No newline at end of file diff --git a/client/branded/package.json b/client/branded/package.json index ccd9be6dcf2..0321ee1cd1f 100644 --- a/client/branded/package.json +++ b/client/branded/package.json @@ -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", diff --git a/client/branded/src/components/panel/views/PanelView.tsx b/client/branded/src/components/panel/views/PanelView.tsx index ac1a65e4125..9fa047bdb5d 100644 --- a/client/branded/src/components/panel/views/PanelView.tsx +++ b/client/branded/src/components/panel/views/PanelView.tsx @@ -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' diff --git a/client/branded/tsconfig.json b/client/branded/tsconfig.json index 50900ea053a..75d6b3848bf 100644 --- a/client/branded/tsconfig.json +++ b/client/branded/tsconfig.json @@ -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" }], } diff --git a/client/browser/LICENSE b/client/browser/LICENSE deleted file mode 100644 index 2e8d210b616..00000000000 --- a/client/browser/LICENSE +++ /dev/null @@ -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. \ No newline at end of file diff --git a/client/browser/node_modules/.bin b/client/browser/node_modules/.bin deleted file mode 120000 index 1dedf1a6f80..00000000000 --- a/client/browser/node_modules/.bin +++ /dev/null @@ -1 +0,0 @@ -../../../node_modules/.bin \ No newline at end of file diff --git a/client/browser/package.json b/client/browser/package.json index 45ac5e4953d..5d6ca11986f 100644 --- a/client/browser/package.json +++ b/client/browser/package.json @@ -1,6 +1,8 @@ { "private": true, + "name": "@sourcegraph/browser", "version": "1.0.0", + "license": "Apache-2.0", "engines": { "yarn": ">1.10.0" }, diff --git a/client/browser/yarn.lock b/client/browser/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/client/browser/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/client/packages/@sourcegraph/eslint-plugin-sourcegraph/README.md b/client/eslint-plugin-sourcegraph/README.md similarity index 100% rename from client/packages/@sourcegraph/eslint-plugin-sourcegraph/README.md rename to client/eslint-plugin-sourcegraph/README.md diff --git a/client/packages/@sourcegraph/eslint-plugin-sourcegraph/lib/index.js b/client/eslint-plugin-sourcegraph/lib/index.js similarity index 100% rename from client/packages/@sourcegraph/eslint-plugin-sourcegraph/lib/index.js rename to client/eslint-plugin-sourcegraph/lib/index.js diff --git a/client/packages/@sourcegraph/eslint-plugin-sourcegraph/lib/rules/check-help-links.js b/client/eslint-plugin-sourcegraph/lib/rules/check-help-links.js similarity index 100% rename from client/packages/@sourcegraph/eslint-plugin-sourcegraph/lib/rules/check-help-links.js rename to client/eslint-plugin-sourcegraph/lib/rules/check-help-links.js diff --git a/client/packages/@sourcegraph/eslint-plugin-sourcegraph/package.json b/client/eslint-plugin-sourcegraph/package.json similarity index 51% rename from client/packages/@sourcegraph/eslint-plugin-sourcegraph/package.json rename to client/eslint-plugin-sourcegraph/package.json index 4915ffcbe16..21b08105e86 100644 --- a/client/packages/@sourcegraph/eslint-plugin-sourcegraph/package.json +++ b/client/eslint-plugin-sourcegraph/package.json @@ -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" }, diff --git a/client/packages/@sourcegraph/eslint-plugin-sourcegraph/tests/lib/rules/check-help-links.test.js b/client/eslint-plugin-sourcegraph/tests/lib/rules/check-help-links.test.js similarity index 100% rename from client/packages/@sourcegraph/eslint-plugin-sourcegraph/tests/lib/rules/check-help-links.test.js rename to client/eslint-plugin-sourcegraph/tests/lib/rules/check-help-links.test.js diff --git a/client/packages/sourcegraph-extension-api/.eslintrc.js b/client/extension-api-types/.eslintrc.js similarity index 64% rename from client/packages/sourcegraph-extension-api/.eslintrc.js rename to client/extension-api-types/.eslintrc.js index 7fbed58955d..12e5f8f90e2 100644 --- a/client/packages/sourcegraph-extension-api/.eslintrc.js +++ b/client/extension-api-types/.eslintrc.js @@ -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', diff --git a/client/packages/@sourcegraph/extension-api-types/LICENSE b/client/extension-api-types/LICENSE similarity index 99% rename from client/packages/@sourcegraph/extension-api-types/LICENSE rename to client/extension-api-types/LICENSE index f49a4e16e68..261eeb9e9f8 100644 --- a/client/packages/@sourcegraph/extension-api-types/LICENSE +++ b/client/extension-api-types/LICENSE @@ -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. \ No newline at end of file + limitations under the License. diff --git a/client/packages/@sourcegraph/extension-api-types/README.md b/client/extension-api-types/README.md similarity index 100% rename from client/packages/@sourcegraph/extension-api-types/README.md rename to client/extension-api-types/README.md diff --git a/client/packages/@sourcegraph/extension-api-types/package.json b/client/extension-api-types/package.json similarity index 85% rename from client/packages/@sourcegraph/extension-api-types/package.json rename to client/extension-api-types/package.json index 6afab61bac5..7d03e1960fc 100644 --- a/client/packages/@sourcegraph/extension-api-types/package.json +++ b/client/extension-api-types/package.json @@ -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": { diff --git a/client/packages/@sourcegraph/extension-api-types/src/hover.d.ts b/client/extension-api-types/src/hover.d.ts similarity index 100% rename from client/packages/@sourcegraph/extension-api-types/src/hover.d.ts rename to client/extension-api-types/src/hover.d.ts diff --git a/client/packages/@sourcegraph/extension-api-types/src/index.d.ts b/client/extension-api-types/src/index.d.ts similarity index 100% rename from client/packages/@sourcegraph/extension-api-types/src/index.d.ts rename to client/extension-api-types/src/index.d.ts diff --git a/client/packages/@sourcegraph/extension-api-types/src/location.d.ts b/client/extension-api-types/src/location.d.ts similarity index 100% rename from client/packages/@sourcegraph/extension-api-types/src/location.d.ts rename to client/extension-api-types/src/location.d.ts diff --git a/client/packages/@sourcegraph/extension-api-types/src/textDocument.d.ts b/client/extension-api-types/src/textDocument.d.ts similarity index 100% rename from client/packages/@sourcegraph/extension-api-types/src/textDocument.d.ts rename to client/extension-api-types/src/textDocument.d.ts diff --git a/client/packages/@sourcegraph/extension-api-types/src/workspace.d.ts b/client/extension-api-types/src/workspace.d.ts similarity index 100% rename from client/packages/@sourcegraph/extension-api-types/src/workspace.d.ts rename to client/extension-api-types/src/workspace.d.ts diff --git a/client/packages/@sourcegraph/extension-api-types/tsconfig.json b/client/extension-api-types/tsconfig.json similarity index 70% rename from client/packages/@sourcegraph/extension-api-types/tsconfig.json rename to client/extension-api-types/tsconfig.json index 314803d6258..508c34b7835 100644 --- a/client/packages/@sourcegraph/extension-api-types/tsconfig.json +++ b/client/extension-api-types/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "out", "rootDir": "src", diff --git a/client/packages/@sourcegraph/extension-api-types/.eslintrc.js b/client/extension-api/.eslintrc.js similarity index 63% rename from client/packages/@sourcegraph/extension-api-types/.eslintrc.js rename to client/extension-api/.eslintrc.js index e821c3e0d98..12e5f8f90e2 100644 --- a/client/packages/@sourcegraph/extension-api-types/.eslintrc.js +++ b/client/extension-api/.eslintrc.js @@ -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', diff --git a/client/packages/sourcegraph-extension-api/LICENSE b/client/extension-api/LICENSE similarity index 99% rename from client/packages/sourcegraph-extension-api/LICENSE rename to client/extension-api/LICENSE index f49a4e16e68..261eeb9e9f8 100644 --- a/client/packages/sourcegraph-extension-api/LICENSE +++ b/client/extension-api/LICENSE @@ -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. \ No newline at end of file + limitations under the License. diff --git a/client/packages/sourcegraph-extension-api/README.md b/client/extension-api/README.md similarity index 62% rename from client/packages/sourcegraph-extension-api/README.md rename to client/extension-api/README.md index 27e2898e2f6..b7f57925107 100644 --- a/client/packages/sourcegraph-extension-api/README.md +++ b/client/extension-api/README.md @@ -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. diff --git a/client/packages/sourcegraph-extension-api/package.json b/client/extension-api/package.json similarity index 85% rename from client/packages/sourcegraph-extension-api/package.json rename to client/extension-api/package.json index 0b7f2aa2f17..c4c938b8a08 100644 --- a/client/packages/sourcegraph-extension-api/package.json +++ b/client/extension-api/package.json @@ -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" }, diff --git a/client/packages/sourcegraph-extension-api/src/index.js b/client/extension-api/src/index.js similarity index 100% rename from client/packages/sourcegraph-extension-api/src/index.js rename to client/extension-api/src/index.js diff --git a/client/packages/sourcegraph-extension-api/src/sourcegraph.d.ts b/client/extension-api/src/sourcegraph.d.ts similarity index 100% rename from client/packages/sourcegraph-extension-api/src/sourcegraph.d.ts rename to client/extension-api/src/sourcegraph.d.ts diff --git a/client/packages/sourcegraph-extension-api/tsconfig.json b/client/extension-api/tsconfig.json similarity index 79% rename from client/packages/sourcegraph-extension-api/tsconfig.json rename to client/extension-api/tsconfig.json index 0feb4d58189..b1127619ed1 100644 --- a/client/packages/sourcegraph-extension-api/tsconfig.json +++ b/client/extension-api/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../tsconfig.json", "compilerOptions": { "allowJs": true, "outDir": "out", diff --git a/client/packages/sourcegraph-extension-api/typedoc.js b/client/extension-api/typedoc.js similarity index 100% rename from client/packages/sourcegraph-extension-api/typedoc.js rename to client/extension-api/typedoc.js diff --git a/client/packages/@sourcegraph/eslint-plugin-sourcegraph/.gitignore b/client/packages/@sourcegraph/eslint-plugin-sourcegraph/.gitignore deleted file mode 100644 index 8ee01d321b7..00000000000 --- a/client/packages/@sourcegraph/eslint-plugin-sourcegraph/.gitignore +++ /dev/null @@ -1 +0,0 @@ -yarn.lock diff --git a/client/packages/@sourcegraph/extension-api-types/node_modules/.bin b/client/packages/@sourcegraph/extension-api-types/node_modules/.bin deleted file mode 120000 index 06cdb5c0771..00000000000 --- a/client/packages/@sourcegraph/extension-api-types/node_modules/.bin +++ /dev/null @@ -1 +0,0 @@ -../../../../../node_modules/.bin \ No newline at end of file diff --git a/client/packages/sourcegraph-extension-api/node_modules/.bin b/client/packages/sourcegraph-extension-api/node_modules/.bin deleted file mode 120000 index 2f09a28df1b..00000000000 --- a/client/packages/sourcegraph-extension-api/node_modules/.bin +++ /dev/null @@ -1 +0,0 @@ -../../../../node_modules/.bin \ No newline at end of file diff --git a/client/packages/sourcegraph-extension-api/yarn.lock b/client/packages/sourcegraph-extension-api/yarn.lock deleted file mode 100644 index 6b9120f198f..00000000000 --- a/client/packages/sourcegraph-extension-api/yarn.lock +++ /dev/null @@ -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= diff --git a/client/shared/node_modules/.bin b/client/shared/node_modules/.bin deleted file mode 120000 index 1dedf1a6f80..00000000000 --- a/client/shared/node_modules/.bin +++ /dev/null @@ -1 +0,0 @@ -../../../node_modules/.bin \ No newline at end of file diff --git a/client/shared/package.json b/client/shared/package.json index 256ba349a70..c0a4dfb345f 100644 --- a/client/shared/package.json +++ b/client/shared/package.json @@ -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" }, diff --git a/client/shared/tsconfig.json b/client/shared/tsconfig.json index 792674f821d..3c6ed69e6ca 100644 --- a/client/shared/tsconfig.json +++ b/client/shared/tsconfig.json @@ -1,6 +1,5 @@ { "extends": "../../tsconfig.json", - "references": [], "compilerOptions": { "jsx": "react", "module": "esnext", diff --git a/client/web/.eslintignore b/client/web/.eslintignore index f01fd928f18..41d689449fc 100644 --- a/client/web/.eslintignore +++ b/client/web/.eslintignore @@ -1,3 +1,5 @@ src/schema/* src/graphql-operations.ts out/ +.eslintrc.js +GH2SG.bookmarklet.js diff --git a/client/contrib/GH2SG.bookmarklet.js b/client/web/bookmarklet/GH2SG.bookmarklet.js similarity index 100% rename from client/contrib/GH2SG.bookmarklet.js rename to client/web/bookmarklet/GH2SG.bookmarklet.js diff --git a/client/web/node_modules/.bin b/client/web/node_modules/.bin deleted file mode 120000 index 1dedf1a6f80..00000000000 --- a/client/web/node_modules/.bin +++ /dev/null @@ -1 +0,0 @@ -../../../node_modules/.bin \ No newline at end of file diff --git a/client/web/package.json b/client/web/package.json index b8f9a64f663..9ee852e091e 100644 --- a/client/web/package.json +++ b/client/web/package.json @@ -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" }, { diff --git a/client/web/src/auth.ts b/client/web/src/auth.ts index 9fc4be5e2ec..9db3c6b901e 100644 --- a/client/web/src/auth.ts +++ b/client/web/src/auth.ts @@ -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' diff --git a/client/web/src/components/SearchResult.tsx b/client/web/src/components/SearchResult.tsx index 55b19cc6fb8..5eac9a87c9d 100644 --- a/client/web/src/components/SearchResult.tsx +++ b/client/web/src/components/SearchResult.tsx @@ -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 diff --git a/client/web/src/components/SearchResultMatch.tsx b/client/web/src/components/SearchResultMatch.tsx index 38a87625b20..17bea7333a7 100644 --- a/client/web/src/components/SearchResultMatch.tsx +++ b/client/web/src/components/SearchResultMatch.tsx @@ -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' diff --git a/client/web/src/components/alerts.tsx b/client/web/src/components/alerts.tsx index 56666647476..fa8c9d4fabf 100644 --- a/client/web/src/components/alerts.tsx +++ b/client/web/src/components/alerts.tsx @@ -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' diff --git a/client/web/src/components/externalServices/AddExternalServicePage.tsx b/client/web/src/components/externalServices/AddExternalServicePage.tsx index 5e09173b5f5..50e3295bb8e 100644 --- a/client/web/src/components/externalServices/AddExternalServicePage.tsx +++ b/client/web/src/components/externalServices/AddExternalServicePage.tsx @@ -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' diff --git a/client/web/src/end-to-end/tsconfig.json b/client/web/src/end-to-end/tsconfig.json index 0c363de6ed2..47a4e2e051d 100644 --- a/client/web/src/end-to-end/tsconfig.json +++ b/client/web/src/end-to-end/tsconfig.json @@ -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": [], } diff --git a/client/web/src/enterprise/batches/Description.tsx b/client/web/src/enterprise/batches/Description.tsx index 4a9cd75d90e..219363423d8 100644 --- a/client/web/src/enterprise/batches/Description.tsx +++ b/client/web/src/enterprise/batches/Description.tsx @@ -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' diff --git a/client/web/src/enterprise/batches/list/BatchChangeNode.tsx b/client/web/src/enterprise/batches/list/BatchChangeNode.tsx index b5b863a7c45..0628eb33b5c 100644 --- a/client/web/src/enterprise/batches/list/BatchChangeNode.tsx +++ b/client/web/src/enterprise/batches/list/BatchChangeNode.tsx @@ -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' diff --git a/client/web/src/extensions/extension/RegistryExtensionReadme.tsx b/client/web/src/extensions/extension/RegistryExtensionReadme.tsx index f10f129c123..2dda0d5364e 100644 --- a/client/web/src/extensions/extension/RegistryExtensionReadme.tsx +++ b/client/web/src/extensions/extension/RegistryExtensionReadme.tsx @@ -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' diff --git a/client/web/src/global/GlobalAlert.tsx b/client/web/src/global/GlobalAlert.tsx index 48afc624e3d..b03650ec0cd 100644 --- a/client/web/src/global/GlobalAlert.tsx +++ b/client/web/src/global/GlobalAlert.tsx @@ -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' diff --git a/client/web/src/global/GlobalAlerts.tsx b/client/web/src/global/GlobalAlerts.tsx index 4901921ef46..422b00b8977 100644 --- a/client/web/src/global/GlobalAlerts.tsx +++ b/client/web/src/global/GlobalAlerts.tsx @@ -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' diff --git a/client/web/src/global/Notices.tsx b/client/web/src/global/Notices.tsx index f30794e0530..596765069fb 100644 --- a/client/web/src/global/Notices.tsx +++ b/client/web/src/global/Notices.tsx @@ -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' diff --git a/client/web/src/repo/blob/RenderedFile.tsx b/client/web/src/repo/blob/RenderedFile.tsx index 1041f0bbefe..178a338b9c2 100644 --- a/client/web/src/repo/blob/RenderedFile.tsx +++ b/client/web/src/repo/blob/RenderedFile.tsx @@ -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 { diff --git a/client/web/src/search/results/streaming/progress/StreamingProgressSkippedPopover.tsx b/client/web/src/search/results/streaming/progress/StreamingProgressSkippedPopover.tsx index e0a2ca06544..695346f2b34 100644 --- a/client/web/src/search/results/streaming/progress/StreamingProgressSkippedPopover.tsx +++ b/client/web/src/search/results/streaming/progress/StreamingProgressSkippedPopover.tsx @@ -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' diff --git a/client/web/src/views/ViewContent.tsx b/client/web/src/views/ViewContent.tsx index d9908bcfed8..acd6851e376 100644 --- a/client/web/src/views/ViewContent.tsx +++ b/client/web/src/views/ViewContent.tsx @@ -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' diff --git a/client/web/tsconfig.json b/client/web/tsconfig.json index 89787d0048b..e3994e21dc5 100644 --- a/client/web/tsconfig.json +++ b/client/web/tsconfig.json @@ -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"], } diff --git a/client/web/yarn.lock b/client/web/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/client/web/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/client/wildcard/node_modules/.bin b/client/wildcard/node_modules/.bin deleted file mode 120000 index 1dedf1a6f80..00000000000 --- a/client/wildcard/node_modules/.bin +++ /dev/null @@ -1 +0,0 @@ -../../../node_modules/.bin \ No newline at end of file diff --git a/client/wildcard/package.json b/client/wildcard/package.json index 61fd299556d..b7e9b8d6eb6 100644 --- a/client/wildcard/package.json +++ b/client/wildcard/package.json @@ -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", diff --git a/client/wildcard/src/components/PageSelector/PageSelector.story.tsx b/client/wildcard/src/components/PageSelector/PageSelector.story.tsx index aaf3b4afd00..bb707ef1f9e 100644 --- a/client/wildcard/src/components/PageSelector/PageSelector.story.tsx +++ b/client/wildcard/src/components/PageSelector/PageSelector.story.tsx @@ -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 => ( {() =>
{story()}
}
diff --git a/client/wildcard/src/index.ts b/client/wildcard/src/index.ts index 7aea380be8c..0c93c9ac1c0 100644 --- a/client/wildcard/src/index.ts +++ b/client/wildcard/src/index.ts @@ -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' diff --git a/client/wildcard/tsconfig.json b/client/wildcard/tsconfig.json index 2088134c387..f2dfd34e20c 100644 --- a/client/wildcard/tsconfig.json +++ b/client/wildcard/tsconfig.json @@ -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"], } diff --git a/dev/foreach-ts-project.sh b/dev/foreach-ts-project.sh index 004fbbe1044..9b92438bec2 100755 --- a/dev/foreach-ts-project.sh +++ b/dev/foreach-ts-project.sh @@ -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 ) diff --git a/dev/release/tsconfig.json b/dev/release/tsconfig.json index bd795455895..12ca714bf09 100644 --- a/dev/release/tsconfig.json +++ b/dev/release/tsconfig.json @@ -1,6 +1,5 @@ { "extends": "../../tsconfig.json", - "references": [], "compilerOptions": { "lib": ["esnext"], "module": "commonjs", diff --git a/doc/adopt/code_search_in_monorepos.md b/doc/adopt/code_search_in_monorepos.md index 3f46ca62d11..86cfa55bfff 100644 --- a/doc/adopt/code_search_in_monorepos.md +++ b/doc/adopt/code_search_in_monorepos.md @@ -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. diff --git a/doc/dev/background-information/architecture/index.md b/doc/dev/background-information/architecture/index.md index 7e107e2451c..3069de84274 100644 --- a/doc/dev/background-information/architecture/index.md +++ b/doc/dev/background-information/architecture/index.md @@ -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#) diff --git a/doc/extensions/authoring/index.md b/doc/extensions/authoring/index.md index 2cb5a3d7c81..690503b2bd3 100644 --- a/doc/extensions/authoring/index.md +++ b/doc/extensions/authoring/index.md @@ -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) diff --git a/doc/integration/firefox_security.md b/doc/integration/firefox_security.md index 2f0d7b39722..31158acb730 100644 --- a/doc/integration/firefox_security.md +++ b/doc/integration/firefox_security.md @@ -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-on’s 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 can’t interact with the WebExtension APIs. - * The extension’s 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 extension’s 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. -Mozilla’s 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. +Mozilla’s 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? diff --git a/jest.config.base.js b/jest.config.base.js index 817b904698f..86c4a8b2c38 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -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', '/src'], // By default, don't clutter `yarn test --watch` output with the full coverage table. To see it, use the // `--coverageReporters text` jest option. diff --git a/package.json b/package.json index 1c7f5332c19..f02846dc99c 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/schema/tsconfig.json b/schema/tsconfig.json index 12bf6236bd0..ee7ff2e6af6 100644 --- a/schema/tsconfig.json +++ b/schema/tsconfig.json @@ -1,6 +1,5 @@ { "extends": "../tsconfig.json", - "references": [], "compilerOptions": { "rootDir": ".", "outDir": "out", diff --git a/tsconfig.all.json b/tsconfig.all.json index 82efa002fb5..a7d583987e6 100644 --- a/tsconfig.all.json +++ b/tsconfig.all.json @@ -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" }, ], diff --git a/tsconfig.json b/tsconfig.json index 4fec5134129..6b5b3f7701d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,5 @@ { "extends": "@sourcegraph/tsconfig", - "references": [], "compilerOptions": { "target": "es2020", "module": "commonjs", diff --git a/yarn.lock b/yarn.lock index d194dc6676c..8f54569f35a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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 ""