mv client/browser browser (#3826)

* mv client/browser browser

* Fix paths

* tslint --fix

* Add back .bin symlink

* Relative path for symlink
This commit is contained in:
Felix Becker 2019-05-06 19:36:03 +02:00 committed by GitHub
parent 8bb3cc4124
commit cc5de96d4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
273 changed files with 187 additions and 181 deletions

2
.github/CODEOWNERS vendored
View File

@ -43,7 +43,7 @@ README.md @sqs
/web/src/enterprise/dotcom/welcome/ @sqs
# Browser extensions
/client/browser/ @felixfbecker @lguychard
/browser/ @felixfbecker @lguychard
# Sourcegraph extension API
/packages/sourcegraph-extension-api/ @lguychard

View File

@ -1,7 +1,7 @@
.bin/
*.bundle.*
client/phabricator/scripts/loader.js
client/browser/build
browser/build
**/package.json
**/coverage
cmd/frontend/db/schema.md

View File

@ -5,7 +5,7 @@
"**/bower_components": true,
"dist": true,
"ui/assets": true,
"client/browser/build": true,
"browser/build": true,
"**/coverage": true
},
"files.associations": {

2
.vscode/tasks.json vendored
View File

@ -38,7 +38,7 @@
"isBackground": true,
"option": "watch",
"problemMatcher": "$tsc-watch",
"tsconfig": "client/browser/tsconfig.json",
"tsconfig": "browser/tsconfig.json",
"presentation": {
"reveal": "never"
},

View File

@ -345,7 +345,7 @@ See the changelog entries for 3.0.0 beta releases and our [3.0](doc/admin/migrat
### Fixed
- Fixed an issue that would cause the frontend health check endpoint `/healthz` to not respond. This only impacts Kubernetes deployments.
- Fixed a CORS policy issue that caused requests to be rejected when they come from origins not in our [manifest.json](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/browser/src/extension/manifest.spec.json#L72) (i.e. requested via optional permissions by the user).
- Fixed a CORS policy issue that caused requests to be rejected when they come from origins not in our [manifest.json](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/browser/src/extension/manifest.spec.json#L72) (i.e. requested via optional permissions by the user).
- Fixed an issue that prevented `repositoryQuery` from working correctly on GitHub enterprise instances.
## 2.13.2

View File

@ -14,7 +14,7 @@ export const commonStylesheetLoaders: webpack.Loader[] = [
{
loader: 'sass-loader',
options: {
includePaths: [path.resolve(__dirname, '../../../..', 'node_modules')],
includePaths: [path.resolve(__dirname, '../../../node_modules')],
},
},
]

View File

@ -29,7 +29,7 @@ const config: webpack.Configuration = {
},
plugins: [
new MiniCssExtractPlugin({ filename: '../css/[name].bundle.css' }) as any, // @types package is incorrect
new MiniCssExtractPlugin({ filename: '../css/[name].bundle.css' }),
new OptimizeCssAssetsPlugin(),
// Code splitting doesn't make sense/work in the browser extension, but we still want to use dynamic import()
new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }),

View File

@ -23,7 +23,7 @@ const PHABRICATOR_ASSETS_DIRECTORY = path.join(__dirname, '../../ui/assets/exten
/**
* Copies the phabricator extension over to the ui/assets folder so they can be served by the webapp. The package
* is published from ./client/browser.
* is published from ./browser.
*/
export function phabricator(): NodeJS.ReadWriteStream {
return gulp.src(PHABRICATOR_EXTENSION_FILES).pipe(gulp.dest(PHABRICATOR_ASSETS_DIRECTORY))

7
browser/jest.config.js Normal file
View File

@ -0,0 +1,7 @@
// @ts-check
/** @type {jest.InitialOptions} */
const config = require('../jest.config.base')
/** @type {jest.InitialOptions} */
module.exports = { ...config, displayName: 'browser', rootDir: __dirname }

1
browser/node_modules/.bin generated vendored Symbolic link
View File

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

View File

Before

Width:  |  Height:  |  Size: 300 KiB

After

Width:  |  Height:  |  Size: 300 KiB

View File

@ -1,4 +1,4 @@
import { IGraphQLResponseRoot } from '../../../../shared/src/graphql/schema'
import { IGraphQLResponseRoot } from '../../../shared/src/graphql/schema'
import { GraphQLRequestArgs } from '../shared/backend/graphql'
import { DEFAULT_SOURCEGRAPH_URL } from '../shared/util/context'

View File

@ -1,5 +1,5 @@
// Same polyfills as the webapp
import '../../../../shared/src/polyfills'
import '../../../shared/src/polyfills'
// Polyfill global browser API for Chrome
// The API is much nicer to use because it supports Promises

View File

@ -1,6 +1,6 @@
import * as path from 'path'
import puppeteer from 'puppeteer'
import { saveScreenshotsUponFailuresAndClosePage } from '../../../../shared/src/util/screenshotReporter'
import { saveScreenshotsUponFailuresAndClosePage } from '../../../shared/src/util/screenshotReporter'
const chromeExtensionPath = path.resolve(__dirname, '..', '..', 'build/chrome')

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 712 B

After

Width:  |  Height:  |  Size: 712 B

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 739 B

View File

@ -6,8 +6,8 @@ import { without } from 'lodash'
import { noop, Observable } from 'rxjs'
import { bufferCount, filter, groupBy, map, mergeMap } from 'rxjs/operators'
import * as domainPermissionToggle from 'webext-domain-permission-toggle'
import { createExtensionHostWorker } from '../../../../../shared/src/api/extension/worker'
import { IGraphQLResponseRoot } from '../../../../../shared/src/graphql/schema'
import { createExtensionHostWorker } from '../../../../shared/src/api/extension/worker'
import { IGraphQLResponseRoot } from '../../../../shared/src/graphql/schema'
import { storage } from '../../browser/storage'
import { BackgroundMessageHandlers, defaultStorageItems } from '../../browser/types'
import { initializeOmniboxInterface } from '../../libs/cli'

View File

@ -4,7 +4,7 @@ import * as H from 'history'
import React from 'react'
import { Observable, Subscription } from 'rxjs'
import { startWith } from 'rxjs/operators'
import { setLinkComponent } from '../../../../../shared/src/components/Link'
import { setLinkComponent } from '../../../../shared/src/components/Link'
import { storage } from '../../browser/storage'
import { determineCodeHost as detectCodeHost, injectCodeIntelligenceToCodeHost } from '../../libs/code_intelligence'
import { initSentry } from '../../libs/sentry'

View File

@ -2,8 +2,8 @@ import { first } from 'lodash'
import { Observable } from 'rxjs'
import { ajax } from 'rxjs/ajax'
import { filter, map } from 'rxjs/operators'
import { memoizeObservable } from '../../../../../shared/src/util/memoizeObservable'
import { isDefined } from '../../../../../shared/src/util/types'
import { memoizeObservable } from '../../../../shared/src/util/memoizeObservable'
import { isDefined } from '../../../../shared/src/util/types'
import { DiffResolvedRevSpec } from '../../shared/repo'
import { BitbucketRepoInfo } from './scrape'

View File

@ -1,7 +1,7 @@
import { AdjustmentDirection, DOMFunctions, PositionAdjuster } from '@sourcegraph/codeintellify'
import { of } from 'rxjs'
import { Omit } from 'utility-types'
import { FileSpec, RepoSpec, ResolvedRevSpec, RevSpec } from '../../../../../shared/src/util/url'
import { FileSpec, RepoSpec, ResolvedRevSpec, RevSpec } from '../../../../shared/src/util/url'
import { querySelectorOrSelf } from '../../shared/util/dom'
import { CodeHost, MountGetter } from '../code_intelligence'
import { CodeView } from '../code_intelligence/code_views'

View File

@ -1,4 +1,4 @@
import { RepoSpec, RevSpec } from '../../../../../shared/src/util/url'
import { RepoSpec, RevSpec } from '../../../../shared/src/util/url'
import { CodeHostContext } from '../code_intelligence/code_intelligence'
// example pathname: /projects/TEST/repos/some-repo/browse/src/extension.ts

View File

@ -1,5 +1,5 @@
import * as path from 'path'
import { createAggregateError } from '../../../../../shared/src/util/errors'
import { createAggregateError } from '../../../../shared/src/util/errors'
import { DiffResolvedRevSpec } from '../../shared/repo'
import { FileInfo } from '../code_intelligence'

View File

@ -1,4 +1,4 @@
import { buildSearchURLQuery } from '../../../../../shared/src/util/url'
import { buildSearchURLQuery } from '../../../../shared/src/util/url'
import { storage } from '../../browser/storage'
import { createSuggestionFetcher } from '../../shared/backend/search'
import { sourcegraphUrl } from '../../shared/util/context'

View File

@ -1,5 +1,5 @@
@import '../../shared/global-styles/variables.scss';
@import '../../../../../shared/src/hover/HoverOverlay.scss';
@import '../../../../shared/src/hover/HoverOverlay.scss';
.hover-overlay {
z-index: $default-z-index;

View File

@ -10,11 +10,11 @@ import { uniqueId } from 'lodash'
import renderer from 'react-test-renderer'
import { BehaviorSubject, from, NEVER, of, Subject, Subscription } from 'rxjs'
import { filter, skip, switchMap, take } from 'rxjs/operators'
import { Services } from '../../../../../shared/src/api/client/services'
import { integrationTestContext } from '../../../../../shared/src/api/integration-test/testHelpers'
import { Controller } from '../../../../../shared/src/extensions/controller'
import { PlatformContextProps } from '../../../../../shared/src/platform/context'
import { isDefined } from '../../../../../shared/src/util/types'
import { Services } from '../../../../shared/src/api/client/services'
import { integrationTestContext } from '../../../../shared/src/api/integration-test/testHelpers'
import { Controller } from '../../../../shared/src/extensions/controller'
import { PlatformContextProps } from '../../../../shared/src/platform/context'
import { isDefined } from '../../../../shared/src/util/types'
import { MutationRecordLike } from '../../shared/util/dom'
import { createGlobalDebugMount, createOverlayMount, FileInfo, handleCodeHost } from './code_intelligence'
import { toCodeViewResolver } from './code_views'

View File

@ -22,21 +22,21 @@ import {
switchMap,
withLatestFrom,
} from 'rxjs/operators'
import { ActionItemAction } from '../../../../../shared/src/actions/ActionItem'
import { CodeEditorData } from '../../../../../shared/src/api/client/services/editorService'
import { WorkspaceRootWithMetadata } from '../../../../../shared/src/api/client/services/workspaceService'
import { HoverMerged } from '../../../../../shared/src/api/client/types/hover'
import { CommandListClassProps } from '../../../../../shared/src/commandPalette/CommandList'
import { CompletionWidgetClassProps } from '../../../../../shared/src/components/completion/CompletionWidget'
import { ApplyLinkPreviewOptions } from '../../../../../shared/src/components/linkPreviews/linkPreviews'
import { Controller } from '../../../../../shared/src/extensions/controller'
import { registerHighlightContributions } from '../../../../../shared/src/highlight/contributions'
import { getHoverActions, registerHoverContributions } from '../../../../../shared/src/hover/actions'
import { HoverContext, HoverOverlay, HoverOverlayClassProps } from '../../../../../shared/src/hover/HoverOverlay'
import { getModeFromPath } from '../../../../../shared/src/languages'
import { PlatformContextProps } from '../../../../../shared/src/platform/context'
import { NOOP_TELEMETRY_SERVICE } from '../../../../../shared/src/telemetry/telemetryService'
import { isDefined, isInstanceOf, propertyIsDefined } from '../../../../../shared/src/util/types'
import { ActionItemAction } from '../../../../shared/src/actions/ActionItem'
import { CodeEditorData } from '../../../../shared/src/api/client/services/editorService'
import { WorkspaceRootWithMetadata } from '../../../../shared/src/api/client/services/workspaceService'
import { HoverMerged } from '../../../../shared/src/api/client/types/hover'
import { CommandListClassProps } from '../../../../shared/src/commandPalette/CommandList'
import { CompletionWidgetClassProps } from '../../../../shared/src/components/completion/CompletionWidget'
import { ApplyLinkPreviewOptions } from '../../../../shared/src/components/linkPreviews/linkPreviews'
import { Controller } from '../../../../shared/src/extensions/controller'
import { registerHighlightContributions } from '../../../../shared/src/highlight/contributions'
import { getHoverActions, registerHoverContributions } from '../../../../shared/src/hover/actions'
import { HoverContext, HoverOverlay, HoverOverlayClassProps } from '../../../../shared/src/hover/HoverOverlay'
import { getModeFromPath } from '../../../../shared/src/languages'
import { PlatformContextProps } from '../../../../shared/src/platform/context'
import { NOOP_TELEMETRY_SERVICE } from '../../../../shared/src/telemetry/telemetryService'
import { isDefined, isInstanceOf, propertyIsDefined } from '../../../../shared/src/util/types'
import {
FileSpec,
PositionSpec,
@ -46,7 +46,7 @@ import {
toRootURI,
toURIWithPath,
ViewStateSpec,
} from '../../../../../shared/src/util/url'
} from '../../../../shared/src/util/url'
import { isInPage } from '../../context'
import { ERPRIVATEREPOPUBLICSOURCEGRAPHCOM } from '../../shared/backend/errors'
import { createLSPFromExtensions, toTextDocumentIdentifier } from '../../shared/backend/lsp'

View File

@ -3,7 +3,7 @@ import { Selection } from '@sourcegraph/extension-api-types'
import { Observable, of, zip } from 'rxjs'
import { catchError, map, switchMap } from 'rxjs/operators'
import { Omit } from 'utility-types'
import { FileSpec, RepoSpec, ResolvedRevSpec, RevSpec } from '../../../../../shared/src/util/url'
import { FileSpec, RepoSpec, ResolvedRevSpec, RevSpec } from '../../../../shared/src/util/url'
import { ERPRIVATEREPOPUBLICSOURCEGRAPHCOM, isErrorLike } from '../../shared/backend/errors'
import { ButtonProps } from '../../shared/components/CodeViewToolbar'
import { fetchBlobContentLines } from '../../shared/repo/backend'

View File

@ -2,8 +2,8 @@ import { MarkupKind } from '@sourcegraph/extension-api-classes'
import { uniqueId } from 'lodash'
import { concat, Observable, of, Subject, Subscription } from 'rxjs'
import { first } from 'rxjs/operators'
import { LinkPreviewMerged } from '../../../../../shared/src/api/client/services/linkPreview'
import { createBarrier } from '../../../../../shared/src/api/integration-test/testHelpers'
import { LinkPreviewMerged } from '../../../../shared/src/api/client/services/linkPreview'
import { createBarrier } from '../../../../shared/src/api/integration-test/testHelpers'
import { MutationRecordLike } from '../../shared/util/dom'
import { handleContentViews } from './content_views'

View File

@ -1,8 +1,8 @@
import { animationFrameScheduler, merge, Observable, of, Subject, Subscription, Unsubscribable } from 'rxjs'
import { distinctUntilChanged, map, mapTo, mergeMap, observeOn, tap, throttleTime } from 'rxjs/operators'
import { LinkPreviewProviderRegistry } from '../../../../../shared/src/api/client/services/linkPreview'
import { applyLinkPreview } from '../../../../../shared/src/components/linkPreviews/linkPreviews'
import { ExtensionsControllerProps } from '../../../../../shared/src/extensions/controller'
import { LinkPreviewProviderRegistry } from '../../../../shared/src/api/client/services/linkPreview'
import { applyLinkPreview } from '../../../../shared/src/components/linkPreviews/linkPreviews'
import { ExtensionsControllerProps } from '../../../../shared/src/extensions/controller'
import { MutationRecordLike, observeMutations } from '../../shared/util/dom'
import { CodeHost } from './code_intelligence'
import { trackViews } from './views'

View File

@ -1,25 +1,25 @@
import { TextDocumentDecoration } from '@sourcegraph/extension-api-types'
import * as React from 'react'
import { render } from 'react-dom'
import { ContributableMenu } from '../../../../../shared/src/api/protocol'
import { ContributableMenu } from '../../../../shared/src/api/protocol'
import {
CommandListPopoverButton,
CommandListPopoverButtonProps,
} from '../../../../../shared/src/commandPalette/CommandList'
import { Notifications } from '../../../../../shared/src/notifications/Notifications'
} from '../../../../shared/src/commandPalette/CommandList'
import { Notifications } from '../../../../shared/src/notifications/Notifications'
import { DOMFunctions } from '@sourcegraph/codeintellify'
import * as H from 'history'
import {
decorationAttachmentStyleForTheme,
decorationStyleForTheme,
} from '../../../../../shared/src/api/client/services/decoration'
} from '../../../../shared/src/api/client/services/decoration'
import {
createController as createExtensionsController,
ExtensionsControllerProps,
} from '../../../../../shared/src/extensions/controller'
import { PlatformContextProps } from '../../../../../shared/src/platform/context'
import { NOOP_TELEMETRY_SERVICE } from '../../../../../shared/src/telemetry/telemetryService'
} from '../../../../shared/src/extensions/controller'
import { PlatformContextProps } from '../../../../shared/src/platform/context'
import { NOOP_TELEMETRY_SERVICE } from '../../../../shared/src/telemetry/telemetryService'
import { createPlatformContext } from '../../platform/context'
import { GlobalDebug } from '../../shared/components/GlobalDebug'
import { ShortcutProvider } from '../../shared/components/ShortcutProvider'

Some files were not shown because too many files have changed in this diff Show More