web: merge the search package into shared (#45949)

This commit is contained in:
Valery Bugakov 2022-12-26 12:23:54 +08:00 committed by GitHub
parent 47459ea10c
commit 6d45dee7f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
141 changed files with 232 additions and 347 deletions

View File

@ -12,7 +12,6 @@ client/http-client/node_modules
client/jetbrains/node_modules
client/observability-client/node_modules
client/observability-server/node_modules
client/search/node_modules
client/search-ui/node_modules
client/shared/node_modules
client/storybook/node_modules

View File

@ -75,7 +75,6 @@ npm_translate_lock(
"//:client/observability-client/package.json",
"//:client/observability-server/package.json",
"//:client/search-ui/package.json",
"//:client/search/package.json",
"//:client/shared/package.json",
"//:client/storybook/package.json",
"//:client/template-parser/package.json",

View File

@ -19,7 +19,6 @@
{ "path": "../shared" },
{ "path": "../common" },
{ "path": "../branded" },
{ "path": "../search" },
{ "path": "../search-ui" },
],
"include": ["./package.json", "**/*", ".*", "**/*.d.ts"],

View File

@ -1,7 +1,6 @@
import { decode } from 'js-base64'
import { SearchPatternType } from '@sourcegraph/search'
import { SearchPatternType } from '../graphql-operations'
import type { PreviewRequest, Request } from '../search/js-to-java-bridge'
import type { Search, Theme } from '../search/types'

View File

@ -3,9 +3,9 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { Observable, of, Subscription } from 'rxjs'
import { requestGraphQLCommon } from '@sourcegraph/http-client'
import { fetchSearchContexts, getUserSearchContextNamespaces, QueryState, SearchPatternType } from '@sourcegraph/search'
import type { AuthenticatedUser } from '@sourcegraph/shared/src/auth'
import type { PlatformContext } from '@sourcegraph/shared/src/platform/context'
import { fetchSearchContexts, getUserSearchContextNamespaces, QueryState } from '@sourcegraph/shared/src/search'
import {
aggregateStreamingSearch,
AggregateStreamingSearchResults,
@ -19,6 +19,7 @@ import { EMPTY_SETTINGS_CASCADE, SettingsCascadeOrError } from '@sourcegraph/sha
import type { TelemetryService } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { useObservable, WildcardThemeContext } from '@sourcegraph/wildcard'
import { SearchPatternType } from '../graphql-operations'
import { initializeSourcegraphSettings } from '../sourcegraphSettings'
import { GlobalKeyboardListeners } from './GlobalKeyboardListeners'

View File

@ -4,7 +4,6 @@ import { DecoratorFn, Meta, Story } from '@storybook/react'
import { EMPTY, NEVER } from 'rxjs'
import { useDarkMode } from 'storybook-dark-mode'
import { SearchPatternType } from '@sourcegraph/search'
import { EMPTY_SETTINGS_CASCADE } from '@sourcegraph/shared/src/settings/settings'
import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { usePrependStyles } from '@sourcegraph/storybook'
@ -13,6 +12,7 @@ import { WildcardThemeContext } from '@sourcegraph/wildcard'
import { applyTheme } from '..'
import { dark } from '../../bridge-mock/theme-snapshots/dark'
import { light } from '../../bridge-mock/theme-snapshots/light'
import { SearchPatternType } from '../../graphql-operations'
import { JetBrainsSearchBox } from './JetBrainsSearchBox'

View File

@ -5,7 +5,6 @@ import React, { useCallback, useState } from 'react'
import classNames from 'classnames'
import { QueryState, SearchContextInputProps, SubmitSearchProps } from '@sourcegraph/search'
import {
IEditor,
LazyMonacoQueryInput,
@ -14,6 +13,7 @@ import {
import { SearchContextDropdown } from '@sourcegraph/search-ui/src/input/SearchContextDropdown'
import { AuthenticatedUser } from '@sourcegraph/shared/src/auth'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { QueryState, SearchContextInputProps, SubmitSearchProps } from '@sourcegraph/shared/src/search'
import { fetchStreamSuggestions as defaultFetchStreamSuggestions } from '@sourcegraph/shared/src/search/suggestions'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { ThemeProps } from '@sourcegraph/shared/src/theme'

View File

@ -7,20 +7,21 @@ import { mdiCodeBrackets, mdiFormatLetterCase, mdiLightningBolt, mdiRegex } from
import classNames from 'classnames'
import { isErrorLike } from '@sourcegraph/common'
import { QueryInputToggle } from '@sourcegraph/search-ui/src/input/toggles/QueryInputToggle'
import {
CaseSensitivityProps,
SearchContextProps,
SearchPatternType,
SearchPatternTypeMutationProps,
SearchPatternTypeProps,
SubmitSearchProps,
} from '@sourcegraph/search'
import { QueryInputToggle } from '@sourcegraph/search-ui/src/input/toggles/QueryInputToggle'
} from '@sourcegraph/shared/src/search'
import { FilterKind, findFilter } from '@sourcegraph/shared/src/search/query/query'
import { appendContextFilter } from '@sourcegraph/shared/src/search/query/transformer'
import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings'
import { Button } from '@sourcegraph/wildcard'
import { SearchPatternType } from '../../graphql-operations'
import styles from './JetBrainsToggles.module.scss'
export interface JetBrainsTogglesProps

View File

@ -4,7 +4,6 @@ import { DecoratorFn, Meta, Story } from '@storybook/react'
import { subMonths } from 'date-fns'
import { useDarkMode } from 'storybook-dark-mode'
import { SymbolKind } from '@sourcegraph/search'
import { SearchMatch } from '@sourcegraph/shared/src/search/stream'
import { EMPTY_SETTINGS_CASCADE } from '@sourcegraph/shared/src/settings/settings'
import { usePrependStyles } from '@sourcegraph/storybook'
@ -12,6 +11,7 @@ import { usePrependStyles } from '@sourcegraph/storybook'
import { applyTheme } from '..'
import { dark } from '../../bridge-mock/theme-snapshots/dark'
import { light } from '../../bridge-mock/theme-snapshots/light'
import { SymbolKind } from '../../graphql-operations'
import { SearchResultList } from './SearchResultList'

View File

@ -1,4 +1,4 @@
import type { SearchPatternType } from '@sourcegraph/search'
import type { SearchPatternType } from '../graphql-operations'
import type { ActionName } from './java-to-js-bridge'
import type { Request } from './js-to-java-bridge'

View File

@ -7,8 +7,8 @@ import { catchError } from 'rxjs/operators'
import sanitizeHtml from 'sanitize-html'
import { highlightNode, logger } from '@sourcegraph/common'
import { highlightCode } from '@sourcegraph/search'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { highlightCode } from '@sourcegraph/shared/src/search'
import { CommitMatch } from '@sourcegraph/shared/src/search/stream'
import { LoadingSpinner, Link, Code, Markdown } from '@sourcegraph/wildcard'

View File

@ -11,9 +11,9 @@ import {
isErrorLike,
toPositionOrRangeQueryParameter,
} from '@sourcegraph/common'
import { HighlightLineRange, HighlightResponseFormat } from '@sourcegraph/search'
import { FetchFileParameters } from '@sourcegraph/shared/src/backend/file'
import { MatchGroup } from '@sourcegraph/shared/src/components/ranking/PerFileResultRanking'
import { HighlightLineRange, HighlightResponseFormat } from '@sourcegraph/shared/src/graphql-operations'
import { ContentMatch, getFileMatchUrl } from '@sourcegraph/shared/src/search/stream'
import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'

View File

@ -5,8 +5,8 @@ import { useHistory } from 'react-router'
import { Observable } from 'rxjs'
import { map } from 'rxjs/operators'
import { HighlightLineRange, HighlightResponseFormat } from '@sourcegraph/search'
import { FetchFileParameters } from '@sourcegraph/shared/src/backend/file'
import { HighlightLineRange, HighlightResponseFormat } from '@sourcegraph/shared/src/graphql-operations'
import { getFileMatchUrl, getRepositoryUrl, getRevision, SymbolMatch } from '@sourcegraph/shared/src/search/stream'
import { isSettingsValid, SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings'
import { SymbolKind } from '@sourcegraph/shared/src/symbols/SymbolKind'

View File

@ -1,7 +1,7 @@
import { Meta, Story } from '@storybook/react'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'
import { SearchPatternType } from '@sourcegraph/search'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import { Text } from '@sourcegraph/wildcard'
import { SyntaxHighlightedSearchQuery } from './SyntaxHighlightedSearchQuery'

View File

@ -2,7 +2,7 @@ import React, { Fragment, useMemo } from 'react'
import classNames from 'classnames'
import { SearchPatternType } from '@sourcegraph/search'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import { decorate, toDecoration } from '@sourcegraph/shared/src/search/query/decoratedToken'
import { scanSearchQuery } from '@sourcegraph/shared/src/search/query/scanner'

View File

@ -30,10 +30,10 @@ import { useHistory } from 'react-router'
import { renderMarkdown } from '@sourcegraph/common'
import { TraceSpanProvider } from '@sourcegraph/observability-client'
import { EditorHint, QueryChangeSource, SearchPatternTypeProps } from '@sourcegraph/search'
import { useCodeMirror, createUpdateableField } from '@sourcegraph/shared/src/components/CodeMirrorEditor'
import { useKeyboardShortcut } from '@sourcegraph/shared/src/keyboardShortcuts/useKeyboardShortcut'
import { Shortcut } from '@sourcegraph/shared/src/react-shortcuts'
import { EditorHint, QueryChangeSource, SearchPatternTypeProps } from '@sourcegraph/shared/src/search'
import { DecoratedToken } from '@sourcegraph/shared/src/search/query/decoratedToken'
import { Diagnostic, getDiagnostics } from '@sourcegraph/shared/src/search/query/diagnostics'
import { resolveFilter } from '@sourcegraph/shared/src/search/query/filters'

View File

@ -1,7 +1,7 @@
import { Meta, Story, DecoratorFn } from '@storybook/react'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'
import { SearchPatternType } from '@sourcegraph/search'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import { MonacoQueryInput, MonacoQueryInputProps } from './MonacoQueryInput'

View File

@ -5,9 +5,9 @@ import { isPlainObject, noop } from 'lodash'
import * as Monaco from 'monaco-editor'
import { observeResize, hasProperty } from '@sourcegraph/common'
import { QueryChangeSource, EditorHint } from '@sourcegraph/search'
import { MonacoEditor } from '@sourcegraph/shared/src/components/MonacoEditor'
import { useKeyboardShortcut } from '@sourcegraph/shared/src/keyboardShortcuts/useKeyboardShortcut'
import { QueryChangeSource, EditorHint } from '@sourcegraph/shared/src/search'
import { toMonacoRange } from '@sourcegraph/shared/src/search/query/monaco'
import { appendContextFilter } from '@sourcegraph/shared/src/search/query/transformer'
import { fetchStreamSuggestions as defaultFetchStreamSuggestions } from '@sourcegraph/shared/src/search/suggestions'

View File

@ -1,4 +1,9 @@
import { CaseSensitivityProps, QueryState, SearchContextProps, SearchPatternTypeProps } from '@sourcegraph/search'
import {
CaseSensitivityProps,
QueryState,
SearchContextProps,
SearchPatternTypeProps,
} from '@sourcegraph/shared/src/search'
import { fetchStreamSuggestions as defaultFetchStreamSuggestions } from '@sourcegraph/shared/src/search/suggestions'
import { ThemeProps } from '@sourcegraph/shared/src/theme'

View File

@ -1,7 +1,8 @@
import { Meta, Story } from '@storybook/react'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'
import { SearchMode, SearchPatternType } from '@sourcegraph/search'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import { SearchMode } from '@sourcegraph/shared/src/search'
import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService'
import {
mockFetchSearchContexts,

View File

@ -2,9 +2,9 @@ import React, { useCallback, useMemo, useRef } from 'react'
import classNames from 'classnames'
import { SearchContextInputProps, QueryState, SubmitSearchProps, EditorHint } from '@sourcegraph/search'
import { AuthenticatedUser } from '@sourcegraph/shared/src/auth'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { SearchContextInputProps, QueryState, SubmitSearchProps, EditorHint } from '@sourcegraph/shared/src/search'
import { getGlobalSearchContextFilter } from '@sourcegraph/shared/src/search/query/query'
import { omitFilter } from '@sourcegraph/shared/src/search/query/transformer'
import { fetchStreamSuggestions as defaultFetchStreamSuggestions } from '@sourcegraph/shared/src/search/suggestions'

View File

@ -2,9 +2,9 @@ import { FC, useCallback, useMemo, useRef, useState } from 'react'
import classNames from 'classnames'
import { SearchContextInputProps, SubmitSearchProps } from '@sourcegraph/search'
import { AuthenticatedUser } from '@sourcegraph/shared/src/auth'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { SearchContextInputProps, SubmitSearchProps } from '@sourcegraph/shared/src/search'
import { FilterType } from '@sourcegraph/shared/src/search/query/filters'
import { filterExists } from '@sourcegraph/shared/src/search/query/validate'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'

View File

@ -2,7 +2,7 @@ import { Meta, Story, DecoratorFn } from '@storybook/react'
import { Observable, of } from 'rxjs'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'
import { ListSearchContextsResult } from '@sourcegraph/search'
import { ListSearchContextsResult } from '@sourcegraph/shared/src/graphql-operations'
import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService'
import {
mockFetchSearchContexts,

View File

@ -4,7 +4,7 @@ import { act } from 'react-dom/test-utils'
import { of } from 'rxjs'
import sinon from 'sinon'
import { ListSearchContextsResult, SearchContextMinimalFields } from '@sourcegraph/search'
import { ListSearchContextsResult, SearchContextMinimalFields } from '@sourcegraph/shared/src/graphql-operations'
import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { MockIntersectionObserver } from '@sourcegraph/shared/src/testing/MockIntersectionObserver'
import { mockGetUserSearchContextNamespaces } from '@sourcegraph/shared/src/testing/searchContexts/testHelpers'

View File

@ -7,9 +7,10 @@ import { BehaviorSubject, combineLatest, of, timer } from 'rxjs'
import { catchError, debounce, map, switchMap, tap } from 'rxjs/operators'
import { asError, isErrorLike } from '@sourcegraph/common'
import { getDefaultSearchContextSpec, SearchContextInputProps, SearchContextMinimalFields } from '@sourcegraph/search'
import { AuthenticatedUser } from '@sourcegraph/shared/src/auth'
import { SearchContextMinimalFields } from '@sourcegraph/shared/src/graphql-operations'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { getDefaultSearchContextSpec, SearchContextInputProps } from '@sourcegraph/shared/src/search'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import {
Badge,

View File

@ -49,7 +49,7 @@ import * as H from 'history'
import { isEqual, startCase } from 'lodash'
import { isDefined } from '@sourcegraph/common'
import { SymbolKind } from '@sourcegraph/search'
import { SymbolKind } from '@sourcegraph/shared/src/graphql-operations'
import {
createFilterSuggestions,
PREDICATE_REGEX,

View File

@ -1,6 +1,6 @@
import { EditorState, Extension, Facet, StateEffect, StateField } from '@codemirror/state'
import { SearchPatternType } from '@sourcegraph/search'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import { decorate, DecoratedToken } from '@sourcegraph/shared/src/search/query/decoratedToken'
import { ParseResult, parseSearchQuery, Node } from '@sourcegraph/shared/src/search/query/parser'
import { scanSearchQuery } from '@sourcegraph/shared/src/search/query/scanner'

View File

@ -10,8 +10,9 @@ import { useHistory } from 'react-router'
import useResizeObserver from 'use-resize-observer'
import * as uuid from 'uuid'
import { QueryChangeSource, QueryState, SearchPatternType } from '@sourcegraph/search'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import { Shortcut } from '@sourcegraph/shared/src/react-shortcuts'
import { QueryChangeSource, QueryState } from '@sourcegraph/shared/src/search'
import { Icon } from '@sourcegraph/wildcard'
import { singleLine } from '../codemirror'

View File

@ -1,6 +1,7 @@
import { screen } from '@testing-library/react'
import { SearchMode, SearchPatternType } from '@sourcegraph/search'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import { SearchMode } from '@sourcegraph/shared/src/search'
import { renderWithBrandedContext } from '@sourcegraph/wildcard/src/testing'
import { getFullQuery, Toggles } from './Toggles'

View File

@ -4,16 +4,16 @@ import { mdiCodeBrackets, mdiFormatLetterCase, mdiRegex } from '@mdi/js'
import classNames from 'classnames'
import { isMacPlatform } from '@sourcegraph/common'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import {
SearchPatternTypeProps,
CaseSensitivityProps,
SearchContextProps,
SearchPatternTypeMutationProps,
SubmitSearchProps,
SearchPatternType,
SearchMode,
SearchModeProps,
} from '@sourcegraph/search'
} from '@sourcegraph/shared/src/search'
import { findFilter, FilterKind } from '@sourcegraph/shared/src/search/query/query'
import { appendContextFilter } from '@sourcegraph/shared/src/search/query/transformer'
import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings'

View File

@ -4,7 +4,7 @@ import * as Monaco from 'monaco-editor'
import { Observable } from 'rxjs'
import * as uuid from 'uuid'
import { SearchPatternType } from '@sourcegraph/search'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import { Diagnostic, getDiagnostics } from '@sourcegraph/shared/src/search/query/diagnostics'
import { getProviders } from '@sourcegraph/shared/src/search/query/providers'
import { scanSearchQuery } from '@sourcegraph/shared/src/search/query/scanner'

View File

@ -3,7 +3,7 @@ import React, { useCallback, useEffect } from 'react'
import { mdiClose, mdiOpenInNew } from '@mdi/js'
import classNames from 'classnames'
import { SearchContextProps } from '@sourcegraph/search'
import { SearchContextProps } from '@sourcegraph/shared/src/search'
import { NoResultsSectionID as SectionID } from '@sourcegraph/shared/src/settings/temporary/searchSidebar'
import { useTemporarySetting } from '@sourcegraph/shared/src/settings/temporary/useTemporarySetting'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'

View File

@ -5,12 +5,12 @@ import { useLocation } from 'react-router'
import { Observable } from 'rxjs'
import { TraceSpanProvider } from '@sourcegraph/observability-client'
import { SearchContextProps } from '@sourcegraph/search'
import { FetchFileParameters } from '@sourcegraph/shared/src/backend/file'
import { FilePrefetcher, PrefetchableFile } from '@sourcegraph/shared/src/components/PrefetchableFile'
import { displayRepoName } from '@sourcegraph/shared/src/components/RepoLink'
import { VirtualList } from '@sourcegraph/shared/src/components/VirtualList'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { SearchContextProps } from '@sourcegraph/shared/src/search'
import {
AggregateStreamingSearchResults,
SearchMatch,

View File

@ -5,14 +5,14 @@ import classNames from 'classnames'
import { escapeRegExp } from 'lodash'
import { renderMarkdown } from '@sourcegraph/common'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import {
SearchQueryState,
createQueryExampleFromString,
updateQueryWithFilterAndExample,
QueryExample,
EditorHint,
} from '@sourcegraph/search'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
} from '@sourcegraph/shared/src/search'
import { FILTERS, FilterType, isNegatableFilter } from '@sourcegraph/shared/src/search/query/filters'
import { scanSearchQuery } from '@sourcegraph/shared/src/search/query/scanner'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'

View File

@ -9,7 +9,7 @@ import {
createQueryExampleFromString,
updateQueryWithFilterAndExample,
EditorHint,
} from '@sourcegraph/search'
} from '@sourcegraph/shared/src/search'
import { FilterType } from '@sourcegraph/shared/src/search/query/filters'
import { updateFilter } from '@sourcegraph/shared/src/search/query/transformer'
import { containsLiteralOrPattern } from '@sourcegraph/shared/src/search/query/validate'

View File

@ -1,4 +1,4 @@
import { QueryUpdate } from '@sourcegraph/search'
import { QueryUpdate } from '@sourcegraph/shared/src/search'
export enum TabIndex {
BRANCHES,

View File

@ -11,7 +11,6 @@
"include": ["./src/**/*", "./*.ts"],
"exclude": ["../../node_modules", "./node_modules", "./out"],
"references": [
{ "path": "../search" },
{ "path": "../shared" },
{ "path": "../branded" },
{ "path": "../http-client" },

View File

@ -1,2 +0,0 @@
# TODO(bazel): remove when no longer generated into src
src/graphql-operations.ts

View File

@ -1,2 +0,0 @@
out/
src/graphql-operations.ts

View File

@ -1,12 +0,0 @@
// @ts-check
const baseConfig = require('../../.eslintrc.js')
module.exports = {
extends: '../../.eslintrc.js',
parserOptions: {
...baseConfig.parserOptions,
project: [__dirname + '/tsconfig.json'],
},
overrides: baseConfig.overrides,
}

View File

@ -1,27 +0,0 @@
load("//client/shared/dev:generate_graphql_operations.bzl", "generate_graphql_operations")
load("@aspect_rules_js//js:defs.bzl", "js_library")
js_library(
name = "graphql_operations_files",
# Keep in sync with glob in client/shared/dev/generateGraphQlOperations.js
srcs = glob(
[
"src/**/*.ts",
"src/**/*.tsx",
],
# TODO: Ignore legacy build generated file as it conflicts with the Bazel
# build. This can be removed after the migration.
[
"src/graphql-operations.ts",
],
),
)
generate_graphql_operations(
name = "graphql_operations",
srcs = [
":graphql_operations_files",
],
out = "src/graphql-operations.ts",
interface_name = "SearchGraphQlOperations",
)

View File

@ -1,3 +0,0 @@
# Search package
This package contains search-related code that may be shared between all clients, both branded (e.g. web, VS Code extension) and unbranded (e.g. browser extension).

View File

@ -1,5 +0,0 @@
// @ts-check
module.exports = {
extends: '../../babel.config.js',
}

View File

@ -1,13 +0,0 @@
// @ts-check
const config = require('../../jest.config.base')
const exportedConfig = {
...config,
displayName: 'common',
rootDir: __dirname,
roots: ['<rootDir>'],
verbose: true,
}
module.exports = exportedConfig

View File

@ -1,13 +0,0 @@
{
"private": true,
"name": "@sourcegraph/search",
"version": "0.0.1",
"description": "Shared Sourcegraph search code",
"main": "./src/index.ts",
"sideEffects": false,
"license": "Apache-2.0",
"scripts": {
"lint:js": "yarn run -T eslint --cache 'src/**/*.[jt]s?(x)'",
"test": "yarn run -T jest"
}
}

View File

@ -1,3 +0,0 @@
# See https://github.com/sourcegraph/codenotify for documentation.
**/* @fkling

View File

@ -1,19 +0,0 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"sourceRoot": "src",
"rootDir": ".",
"outDir": "./out",
"baseUrl": "./src",
"jsx": "react-jsx",
},
"include": ["./src/**/*", "./*.ts"],
"exclude": ["../../node_modules", "./node_modules", "./out"],
"references": [
{ "path": "../shared" },
{ "path": "../branded" },
{ "path": "../http-client" },
{ "path": "../common" },
],
}

View File

@ -9,7 +9,6 @@ const ROOT_FOLDER = path.resolve(__dirname, '../../../')
const WEB_FOLDER = path.resolve(ROOT_FOLDER, './client/web')
const BROWSER_FOLDER = path.resolve(ROOT_FOLDER, './client/browser')
const SHARED_FOLDER = path.resolve(ROOT_FOLDER, './client/shared')
const SEARCH_FOLDER = path.resolve(ROOT_FOLDER, './client/search')
const VSCODE_FOLDER = path.resolve(ROOT_FOLDER, './client/vscode')
const JETBRAINS_FOLDER = path.resolve(ROOT_FOLDER, './client/jetbrains')
const SCHEMA_PATH = path.join(ROOT_FOLDER, './cmd/frontend/graphqlbackend/*.graphql')
@ -28,8 +27,6 @@ const BROWSER_DOCUMENTS_GLOB = [
'!**/*.d.ts',
]
const SEARCH_DOCUMENTS_GLOB = [`${SEARCH_FOLDER}/src/**/*.{ts,tsx}`]
const VSCODE_DOCUMENTS_GLOB = [`${VSCODE_FOLDER}/src/**/*.{ts,tsx}`]
const JETBRAINS_DOCUMENTS_GLOB = [`${JETBRAINS_FOLDER}/webview/src/**/*.{ts,tsx}`]
@ -37,7 +34,6 @@ const JETBRAINS_DOCUMENTS_GLOB = [`${JETBRAINS_FOLDER}/webview/src/**/*.{ts,tsx}
const GLOBS = {
BrowserGraphQlOperations: BROWSER_DOCUMENTS_GLOB,
JetBrainsGraphQlOperations: JETBRAINS_DOCUMENTS_GLOB,
SearchGraphQlOperations: SEARCH_DOCUMENTS_GLOB,
SharedGraphQlOperations: SHARED_DOCUMENTS_GLOB,
VSCodeGraphQlOperations: VSCODE_DOCUMENTS_GLOB,
WebGraphQlOperations: WEB_DOCUMENTS_GLOB,
@ -53,7 +49,6 @@ const ALL_DOCUMENTS_GLOB = [
...SHARED_DOCUMENTS_GLOB,
...WEB_DOCUMENTS_GLOB,
...BROWSER_DOCUMENTS_GLOB,
...SEARCH_DOCUMENTS_GLOB,
...VSCODE_DOCUMENTS_GLOB,
...JETBRAINS_DOCUMENTS_GLOB,
]),
@ -85,10 +80,6 @@ async function generateGraphQlOperations() {
interfaceNameForOperations: 'SharedGraphQlOperations',
outputPath: path.join(SHARED_FOLDER, './src/graphql-operations.ts'),
},
{
interfaceNameForOperations: 'SearchGraphQlOperations',
outputPath: path.join(SEARCH_FOLDER, './src/graphql-operations.ts'),
},
{
interfaceNameForOperations: 'VSCodeGraphQlOperations',
outputPath: path.join(VSCODE_FOLDER, './src/graphql-operations.ts'),

View File

@ -3,9 +3,8 @@ import { map } from 'rxjs/operators'
import { createAggregateError, memoizeObservable } from '@sourcegraph/common'
import { gql, dataOrThrowErrors, isErrorGraphQLResult } from '@sourcegraph/http-client'
import { AuthenticatedUser } from '@sourcegraph/shared/src/auth'
import { PlatformContext } from '@sourcegraph/shared/src/platform/context'
import { AuthenticatedUser } from '../auth'
import {
EventLogsDataResult,
EventLogsDataVariables,
@ -31,7 +30,8 @@ import {
SearchContextFields,
DefaultSearchContextSpecResult,
DefaultSearchContextSpecVariables,
} from './graphql-operations'
} from '../graphql-operations'
import { PlatformContext } from '../platform/context'
const searchContextFragment = gql`
fragment SearchContextFields on SearchContext {

View File

@ -1,8 +1,28 @@
import * as H from 'history'
import { CharacterRange } from '@sourcegraph/shared/src/search/query/token'
import { SearchPatternType } from '../graphql-operations'
import { CaseSensitivityProps, SearchContextProps, SearchMode, SearchPatternTypeProps } from '.'
import { SearchContextProps } from './helpers/searchContext'
import { CharacterRange } from './query/token'
import { SearchMode } from './searchQueryState'
export interface SearchPatternTypeProps {
patternType: SearchPatternType
}
export interface SearchPatternTypeMutationProps {
setPatternType: (patternType: SearchPatternType) => void
}
export interface CaseSensitivityProps {
caseSensitive: boolean
setCaseSensitivity: (caseSensitive: boolean) => void
}
export interface SearchModeProps {
searchMode: SearchMode
setSearchMode: (searchMode: SearchMode) => void
}
export enum QueryChangeSource {
/**

View File

@ -1,4 +1,4 @@
import { FilterType } from '@sourcegraph/shared/src/search/query/filters'
import { FilterType } from '../query/filters'
import { createQueryExampleFromString, updateQueryWithFilterAndExample } from './queryExample'

View File

@ -1,7 +1,7 @@
import { FilterType } from '@sourcegraph/shared/src/search/query/filters'
import { FilterKind, findFilter } from '@sourcegraph/shared/src/search/query/query'
import { CharacterRange } from '@sourcegraph/shared/src/search/query/token'
import { updateFilter } from '@sourcegraph/shared/src/search/query/transformer'
import { FilterType } from '../query/filters'
import { FilterKind, findFilter } from '../query/query'
import { CharacterRange } from '../query/token'
import { updateFilter } from '../query/transformer'
/**
* A QueryExample is a structured representation of a query fragment possibly

View File

@ -14,34 +14,7 @@ import {
deleteSearchContext,
isSearchContextAvailable,
fetchDefaultSearchContextSpec,
} from './backend'
import { SearchPatternType } from './graphql-operations'
import { SearchMode } from './searchQueryState'
export * from './backend'
export * from './searchQueryState'
export * from './helpers'
export * from './graphql-operations'
export * from './helpers/queryExample'
export * from './integration/streaming-search-mocks'
export interface SearchPatternTypeProps {
patternType: SearchPatternType
}
export interface SearchPatternTypeMutationProps {
setPatternType: (patternType: SearchPatternType) => void
}
export interface CaseSensitivityProps {
caseSensitive: boolean
setCaseSensitivity: (caseSensitive: boolean) => void
}
export interface SearchModeProps {
searchMode: SearchMode
setSearchMode: (searchMode: SearchMode) => void
}
} from '../backend'
export interface SearchContextProps {
searchContextsEnabled: boolean

View File

@ -0,0 +1,5 @@
export * from './backend'
export * from './searchQueryState'
export * from './helpers'
export * from './helpers/queryExample'
export * from './helpers/searchContext'

View File

@ -0,0 +1 @@
export * from './streaming-search-mocks'

View File

@ -2,13 +2,12 @@ import React, { createContext, useContext } from 'react'
import { StoreApi, UseBoundStore } from 'zustand'
import { FilterType } from '@sourcegraph/shared/src/search/query/filters'
import { appendFilter, updateFilter } from '@sourcegraph/shared/src/search/query/transformer'
import { filterExists } from '@sourcegraph/shared/src/search/query/validate'
import { SearchPatternType } from '../graphql-operations'
import { SearchPatternType } from './graphql-operations'
import { QueryState, SubmitSearchParameters, toggleSubquery } from '.'
import { QueryState, SubmitSearchParameters, toggleSubquery } from './helpers'
import { FilterType } from './query/filters'
import { appendFilter, updateFilter } from './query/transformer'
import { filterExists } from './query/validate'
export type SearchQueryStateStore<T extends SearchQueryState = SearchQueryState> = UseBoundStore<T, StoreApi<T>>

View File

@ -4,10 +4,11 @@ import { defaultIfEmpty, map, materialize, scan, switchMap } from 'rxjs/operator
import { AggregableBadge } from 'sourcegraph'
import { asError, ErrorLike, isErrorLike } from '@sourcegraph/common'
import { SearchMode } from '@sourcegraph/search'
import { SearchPatternType, SymbolKind } from '../graphql-operations'
import { SearchMode } from './searchQueryState'
// The latest supported version of our search syntax. Users should never be able to determine the search version.
// The version is set based on the release tag of the instance.
// History:

View File

@ -9,13 +9,13 @@ import {
toViewStateHash,
} from '@sourcegraph/common'
import { Position } from '@sourcegraph/extension-api-types'
import { SearchMode } from '@sourcegraph/search'
import { WorkspaceRootWithMetadata } from '../api/extension/extensionHostApi'
import { SearchPatternType } from '../graphql-operations'
import { discreteValueAliases } from '../search/query/filters'
import { findFilter, FilterKind } from '../search/query/query'
import { appendContextFilter, omitFilter } from '../search/query/transformer'
import { SearchMode } from '../search/searchQueryState'
export interface RepoSpec {
/**

View File

@ -3,7 +3,7 @@ import { catchError } from 'rxjs/operators'
import * as vscode from 'vscode'
import { GraphQLResult } from '@sourcegraph/http-client'
import { getAvailableSearchContextSpecOrFallback } from '@sourcegraph/search'
import { getAvailableSearchContextSpecOrFallback } from '@sourcegraph/shared/src/search'
import { LocalStorageService, SELECTED_SEARCH_CONTEXT_SPEC_KEY } from '../settings/LocalStorageService'
import { VSCEStateMachine } from '../state'

View File

@ -2,7 +2,7 @@ import { of, Subscription } from 'rxjs'
import { map, switchMap, throttleTime } from 'rxjs/operators'
import * as vscode from 'vscode'
import { SearchMode } from '@sourcegraph/search'
import { SearchMode } from '@sourcegraph/shared/src/search'
import { appendContextFilter } from '@sourcegraph/shared/src/search/query/transformer'
import { aggregateStreamingSearch } from '@sourcegraph/shared/src/search/stream'

View File

@ -1,8 +1,8 @@
import { cloneDeep } from 'lodash'
import { BehaviorSubject, Observable } from 'rxjs'
import { SearchQueryState } from '@sourcegraph/search'
import { AuthenticatedUser } from '@sourcegraph/shared/src/auth'
import { SearchQueryState } from '@sourcegraph/shared/src/search'
import { AggregateStreamingSearchResults } from '@sourcegraph/shared/src/search/stream'
import { LocalStorageService, SELECTED_SEARCH_CONTEXT_SPEC_KEY } from './settings/LocalStorageService'

View File

@ -5,9 +5,9 @@ import { VSCodeProgressRing } from '@vscode/webview-ui-toolkit/react'
import classNames from 'classnames'
import { catchError } from 'rxjs/operators'
import { QueryState } from '@sourcegraph/search'
import { fetchTreeEntries } from '@sourcegraph/shared/src/backend/repo'
import { displayRepoName } from '@sourcegraph/shared/src/components/RepoLink'
import { QueryState } from '@sourcegraph/shared/src/search'
import { RepositoryMatch } from '@sourcegraph/shared/src/search/stream'
import { Icon, PageHeader, useObservable, H4, Text, Button } from '@sourcegraph/wildcard'

View File

@ -4,14 +4,15 @@ import classNames from 'classnames'
import { Observable } from 'rxjs'
import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect'
import { SearchPatternType, getUserSearchContextNamespaces, QueryState, SearchMode } from '@sourcegraph/search'
import { SearchBox } from '@sourcegraph/search-ui'
import { wrapRemoteObservable } from '@sourcegraph/shared/src/api/client/api/common'
import { getUserSearchContextNamespaces, QueryState, SearchMode } from '@sourcegraph/shared/src/search'
import { collectMetrics } from '@sourcegraph/shared/src/search/query/metrics'
import { appendContextFilter, sanitizeQueryForTelemetry } from '@sourcegraph/shared/src/search/query/transformer'
import { LATEST_VERSION, SearchMatch } from '@sourcegraph/shared/src/search/stream'
import { globbingEnabledFromSettings } from '@sourcegraph/shared/src/util/globbing'
import { SearchPatternType } from '../../graphql-operations'
import { SearchHomeState } from '../../state'
import { WebviewPageProps } from '../platform/context'

View File

@ -4,10 +4,10 @@ import classNames from 'classnames'
import { Observable } from 'rxjs'
import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect'
import { SearchPatternType, getUserSearchContextNamespaces, QueryState, SearchMode } from '@sourcegraph/search'
import { IEditor, SearchBox, StreamingProgress, StreamingSearchResultsList } from '@sourcegraph/search-ui'
import { wrapRemoteObservable } from '@sourcegraph/shared/src/api/client/api/common'
import { FetchFileParameters, fetchHighlightedFileLineRanges } from '@sourcegraph/shared/src/backend/file'
import { getUserSearchContextNamespaces, QueryState, SearchMode } from '@sourcegraph/shared/src/search'
import { collectMetrics } from '@sourcegraph/shared/src/search/query/metrics'
import {
appendContextFilter,
@ -18,6 +18,7 @@ import { LATEST_VERSION, RepositoryMatch, SearchMatch } from '@sourcegraph/share
import { globbingEnabledFromSettings } from '@sourcegraph/shared/src/util/globbing'
import { buildSearchURLQuery } from '@sourcegraph/shared/src/util/url'
import { SearchPatternType } from '../../graphql-operations'
import { SearchResultsState } from '../../state'
import { WebviewPageProps } from '../platform/context'

View File

@ -4,7 +4,6 @@ import classNames from 'classnames'
import { Observable } from 'rxjs'
import { map } from 'rxjs/operators'
import { HighlightLineRange, HighlightResponseFormat } from '@sourcegraph/search'
import {
LastSyncedIcon,
SymbolSearchResultStyles as styles,
@ -21,6 +20,7 @@ import { SymbolKind } from '@sourcegraph/shared/src/symbols/SymbolKind'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { codeCopiedEvent } from '@sourcegraph/shared/src/tracking/event-log-creators'
import { HighlightLineRange, HighlightResponseFormat } from '../../../graphql-operations'
import { useOpenSearchResultsContext } from '../MatchHandlersContext'
import { RepoFileLink } from './RepoFileLink'

View File

@ -2,8 +2,8 @@ import React, { useCallback } from 'react'
import classNames from 'classnames'
import { QueryState } from '@sourcegraph/search'
import { SyntaxHighlightedSearchQuery } from '@sourcegraph/search-ui'
import { QueryState } from '@sourcegraph/shared/src/search'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { ThemeProps } from '@sourcegraph/shared/src/theme'
import { Card, Text } from '@sourcegraph/wildcard'

View File

@ -3,7 +3,7 @@ import React, { useMemo, useState } from 'react'
import { mdiChevronDown, mdiChevronLeft } from '@mdi/js'
import classNames from 'classnames'
import { EventLogResult, fetchRecentFileViews } from '@sourcegraph/search'
import { EventLogResult, fetchRecentFileViews } from '@sourcegraph/shared/src/search'
import { Icon, Link, H5, useObservable, Button } from '@sourcegraph/wildcard'
import { HistorySidebarProps } from '../HistorySidebarView'

View File

@ -3,8 +3,8 @@ import React, { useMemo, useState } from 'react'
import { mdiChevronDown, mdiChevronLeft } from '@mdi/js'
import classNames from 'classnames'
import { EventLogResult, fetchRecentSearches } from '@sourcegraph/search'
import { SyntaxHighlightedSearchQuery } from '@sourcegraph/search-ui'
import { EventLogResult, fetchRecentSearches } from '@sourcegraph/shared/src/search'
import { scanSearchQuery } from '@sourcegraph/shared/src/search/query/scanner'
import { isRepoFilter } from '@sourcegraph/shared/src/search/query/validate'
import { LATEST_VERSION } from '@sourcegraph/shared/src/search/stream'

View File

@ -3,8 +3,8 @@ import React, { useMemo, useState } from 'react'
import { mdiChevronDown, mdiChevronLeft } from '@mdi/js'
import classNames from 'classnames'
import { EventLogResult, fetchRecentSearches } from '@sourcegraph/search'
import { SyntaxHighlightedSearchQuery } from '@sourcegraph/search-ui'
import { EventLogResult, fetchRecentSearches } from '@sourcegraph/shared/src/search'
import { LATEST_VERSION } from '@sourcegraph/shared/src/search/stream'
import { Icon, H5, useObservable, Button } from '@sourcegraph/wildcard'

View File

@ -6,15 +6,6 @@ import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect'
// eslint-disable-next-line no-restricted-imports
import create from 'zustand'
import {
InitialParametersSource,
QueryUpdate,
SearchMode,
SearchPatternType,
SearchQueryState,
SearchQueryStateStore,
updateQuery,
} from '@sourcegraph/search'
import {
getDynamicFilterLinks,
getFiltersOfKind,
@ -26,12 +17,21 @@ import {
SearchSidebarSection,
} from '@sourcegraph/search-ui'
import { wrapRemoteObservable } from '@sourcegraph/shared/src/api/client/api/common'
import {
InitialParametersSource,
QueryUpdate,
SearchMode,
SearchQueryState,
SearchQueryStateStore,
updateQuery,
} from '@sourcegraph/shared/src/search'
import { FilterType } from '@sourcegraph/shared/src/search/query/filters'
import { Filter, LATEST_VERSION } from '@sourcegraph/shared/src/search/stream'
import { SectionID } from '@sourcegraph/shared/src/settings/temporary/searchSidebar'
import { useTemporarySetting } from '@sourcegraph/shared/src/settings/temporary/useTemporarySetting'
import { Code, useObservable } from '@sourcegraph/wildcard'
import { SearchPatternType } from '../../../graphql-operations'
import { WebviewPageProps } from '../../platform/context'
import styles from './SearchSidebarView.module.scss'

View File

@ -1,6 +1,5 @@
import puppeteer from 'puppeteer'
import { SearchGraphQlOperations } from '@sourcegraph/search'
import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations'
import { SearchEvent } from '@sourcegraph/shared/src/search/stream'
import {
@ -15,7 +14,7 @@ import { commonVSCodeGraphQlResults } from './graphql'
export interface VSCodeIntegrationTestContext
extends IntegrationTestContext<
VSCodeGraphQlOperations & SharedGraphQlOperations & SearchGraphQlOperations,
VSCodeGraphQlOperations & SharedGraphQlOperations,
string & keyof (VSCodeGraphQlOperations & SharedGraphQlOperations)
> {
/**

View File

@ -1,4 +1,3 @@
import { SearchGraphQlOperations } from '@sourcegraph/search'
import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations'
import { sharedGraphQlResults } from '@sourcegraph/shared/src/testing/integration/graphQlResults'
@ -7,9 +6,7 @@ import { VSCodeGraphQlOperations } from '../src/graphql-operations'
/**
* Predefined results for GraphQL requests that are made on almost every user flow.
*/
export const commonVSCodeGraphQlResults: Partial<
VSCodeGraphQlOperations & SharedGraphQlOperations & SearchGraphQlOperations
> = {
export const commonVSCodeGraphQlResults: Partial<VSCodeGraphQlOperations & SharedGraphQlOperations> = {
...sharedGraphQlResults,
LogEvents: () => ({
__typename: 'Mutation',

View File

@ -1,6 +1,6 @@
import { downloadAndUnzipVSCode } from '@vscode/test-electron'
import { mixedSearchStreamEvents, highlightFileResult } from '@sourcegraph/search'
import { mixedSearchStreamEvents, highlightFileResult } from '@sourcegraph/shared/src/search/integration'
import { Settings } from '@sourcegraph/shared/src/settings/settings'
import { setupExtensionMocking } from '@sourcegraph/shared/src/testing/integration/mockExtension'

View File

@ -19,7 +19,6 @@
{ "path": "../shared" },
{ "path": "../common" },
{ "path": "../branded" },
{ "path": "../search" },
{ "path": "../search-ui" },
],
"include": ["./package.json", "**/*", ".*", "**/*.d.ts", "./code-intel-extensions.json"],

View File

@ -6,13 +6,13 @@ import { Observable } from 'rxjs'
import { TabbedPanelContent } from '@sourcegraph/branded/src/components/panel/TabbedPanelContent'
import { isMacPlatform } from '@sourcegraph/common'
import { SearchContextProps } from '@sourcegraph/search'
import { FetchFileParameters } from '@sourcegraph/shared/src/backend/file'
import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller'
import { useKeyboardShortcut } from '@sourcegraph/shared/src/keyboardShortcuts/useKeyboardShortcut'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { Shortcut } from '@sourcegraph/shared/src/react-shortcuts'
import { Settings } from '@sourcegraph/shared/src/schema/settings.schema'
import { SearchContextProps } from '@sourcegraph/shared/src/search'
import { SettingsCascadeProps, SettingsSubjectCommonFields } from '@sourcegraph/shared/src/settings/settings'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { parseQueryAndHash } from '@sourcegraph/shared/src/util/url'

View File

@ -14,6 +14,15 @@ import * as uuid from 'uuid'
import { logger } from '@sourcegraph/common'
import { GraphQLClient, HTTPStatusError } from '@sourcegraph/http-client'
import { SharedSpanName, TraceSpanProvider } from '@sourcegraph/observability-client'
import { NotificationType } from '@sourcegraph/shared/src/api/extension/extensionHostApi'
import { FetchFileParameters, fetchHighlightedFileLineRanges } from '@sourcegraph/shared/src/backend/file'
import { setCodeIntelSearchContext } from '@sourcegraph/shared/src/codeintel/searchContext'
import { Controller as ExtensionsController } from '@sourcegraph/shared/src/extensions/controller'
import { createController as createExtensionsController } from '@sourcegraph/shared/src/extensions/createLazyLoadedController'
import { BrandedNotificationItemStyleProps } from '@sourcegraph/shared/src/notifications/NotificationItem'
import { Notifications } from '@sourcegraph/shared/src/notifications/Notifications'
import { PlatformContext } from '@sourcegraph/shared/src/platform/context'
import { ShortcutProvider } from '@sourcegraph/shared/src/react-shortcuts'
import {
getUserSearchContextNamespaces,
SearchContextProps,
@ -26,16 +35,7 @@ import {
isSearchContextSpecAvailable,
SearchQueryStateStoreProvider,
getDefaultSearchContextSpec,
} from '@sourcegraph/search'
import { NotificationType } from '@sourcegraph/shared/src/api/extension/extensionHostApi'
import { FetchFileParameters, fetchHighlightedFileLineRanges } from '@sourcegraph/shared/src/backend/file'
import { setCodeIntelSearchContext } from '@sourcegraph/shared/src/codeintel/searchContext'
import { Controller as ExtensionsController } from '@sourcegraph/shared/src/extensions/controller'
import { createController as createExtensionsController } from '@sourcegraph/shared/src/extensions/createLazyLoadedController'
import { BrandedNotificationItemStyleProps } from '@sourcegraph/shared/src/notifications/NotificationItem'
import { Notifications } from '@sourcegraph/shared/src/notifications/Notifications'
import { PlatformContext } from '@sourcegraph/shared/src/platform/context'
import { ShortcutProvider } from '@sourcegraph/shared/src/react-shortcuts'
} from '@sourcegraph/shared/src/search'
import { FilterType } from '@sourcegraph/shared/src/search/query/filters'
import { filterExists } from '@sourcegraph/shared/src/search/query/validate'
import { aggregateStreamingSearch } from '@sourcegraph/shared/src/search/stream'

View File

@ -4,8 +4,8 @@ import { subDays } from 'date-fns'
import { EMPTY, NEVER, Observable, of } from 'rxjs'
import { subtypeOf } from '@sourcegraph/common'
import { SearchContextFields } from '@sourcegraph/search'
import { ActionItemComponentProps } from '@sourcegraph/shared/src/actions/ActionItem'
import { SearchContextFields } from '@sourcegraph/shared/src/graphql-operations'
import {
mockFetchSearchContexts,
mockGetUserSearchContextNamespaces,

View File

@ -6,11 +6,11 @@ import * as H from 'history'
import { catchError, startWith } from 'rxjs/operators'
import { asError, isErrorLike } from '@sourcegraph/common'
import { QueryState, SearchContextInputProps, SearchContextProps } from '@sourcegraph/search'
import { SyntaxHighlightedSearchQuery } from '@sourcegraph/search-ui'
import { displayRepoName } from '@sourcegraph/shared/src/components/RepoLink'
import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { QueryState, SearchContextInputProps, SearchContextProps } from '@sourcegraph/shared/src/search'
import { SettingsCascadeProps, Settings } from '@sourcegraph/shared/src/settings/settings'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { ThemeProps } from '@sourcegraph/shared/src/theme'

View File

@ -4,8 +4,8 @@ import { mdiCheck, mdiRadioboxBlank, mdiHelpCircle, mdiOpenInNew } from '@mdi/js
import { VisuallyHidden } from '@reach/visually-hidden'
import classNames from 'classnames'
import { QueryState } from '@sourcegraph/search'
import { LazyMonacoQueryInput } from '@sourcegraph/search-ui'
import { QueryState } from '@sourcegraph/shared/src/search'
import { FilterType, resolveFilter, validateFilter } from '@sourcegraph/shared/src/search/query/filters'
import { scanSearchQuery } from '@sourcegraph/shared/src/search/query/scanner'
import { ThemeProps } from '@sourcegraph/shared/src/theme'

View File

@ -1,8 +1,7 @@
import { DecoratorFn, Story, Meta } from '@storybook/react'
import { ExecutorCompatibility } from '@sourcegraph/search'
import { WebStory } from '../../../components/WebStory'
import { ExecutorCompatibility } from '../../../graphql-operations'
import { ExecutorCompatibilityAlert } from './ExecutorCompatibilityAlert'

View File

@ -2,10 +2,8 @@ import { DecoratorFn, Story, Meta } from '@storybook/react'
import { subDays, subHours } from 'date-fns'
import { Observable, of } from 'rxjs'
import { ExecutorCompatibility } from '@sourcegraph/search'
import { WebStory } from '../../../components/WebStory'
import { ExecutorConnectionFields } from '../../../graphql-operations'
import { ExecutorCompatibility, ExecutorConnectionFields } from '../../../graphql-operations'
import { ExecutorsListPage } from './ExecutorsListPage'

View File

@ -3,11 +3,14 @@ import { DecoratorFn, Story, Meta } from '@storybook/react'
import { subDays } from 'date-fns'
import { getDocumentNode } from '@sourcegraph/http-client'
import { ExecutorSecretScope } from '@sourcegraph/search'
import { MockedTestProvider } from '@sourcegraph/shared/src/testing/apollo'
import { WebStory } from '../../../components/WebStory'
import { GlobalExecutorSecretsResult, UserExecutorSecretsResult } from '../../../graphql-operations'
import {
GlobalExecutorSecretsResult,
ExecutorSecretScope,
UserExecutorSecretsResult,
} from '../../../graphql-operations'
import { GLOBAL_EXECUTOR_SECRETS, USER_EXECUTOR_SECRETS } from './backend'
import { GlobalExecutorSecretsListPage, UserExecutorSecretsListPage } from './ExecutorSecretsListPage'

View File

@ -4,9 +4,9 @@ import classNames from 'classnames'
import { noop } from 'lodash'
import * as Monaco from 'monaco-editor'
import { QueryChangeSource } from '@sourcegraph/search'
import { LazyMonacoQueryInput, DEFAULT_MONACO_OPTIONS } from '@sourcegraph/search-ui'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import { QueryChangeSource } from '@sourcegraph/shared/src/search'
import { ForwardReferenceComponent } from '@sourcegraph/wildcard'
import { useExperimentalFeatures } from '../../../../../stores'

View File

@ -4,13 +4,14 @@ import { mdiMagnify } from '@mdi/js'
import { Redirect, RouteComponentProps } from 'react-router'
import { Observable } from 'rxjs'
import { SearchContextFields, SearchContextProps } from '@sourcegraph/search'
import {
Scalars,
SearchContextInput,
SearchContextRepositoryRevisionsInput,
SearchContextFields,
} from '@sourcegraph/shared/src/graphql-operations'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { SearchContextProps } from '@sourcegraph/shared/src/search'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { ThemeProps } from '@sourcegraph/shared/src/theme'
import { PageHeader, Link } from '@sourcegraph/wildcard'

View File

@ -2,7 +2,7 @@ import { DecoratorFn, Meta, Story } from '@storybook/react'
import { NEVER } from 'rxjs'
import sinon from 'sinon'
import { SearchContextFields } from '@sourcegraph/search'
import { SearchContextFields } from '@sourcegraph/shared/src/graphql-operations'
import { NOOP_PLATFORM_CONTEXT } from '@sourcegraph/shared/src/testing/searchTestHelpers'
import { WebStory } from '../../components/WebStory'

View File

@ -5,8 +5,9 @@ import { Observable } from 'rxjs'
import { mergeMap, startWith, tap, catchError } from 'rxjs/operators'
import { asError, isErrorLike } from '@sourcegraph/common'
import { SearchContextFields, SearchContextProps } from '@sourcegraph/search'
import { SearchContextFields } from '@sourcegraph/shared/src/graphql-operations'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { SearchContextProps } from '@sourcegraph/shared/src/search'
import { Button, LoadingSpinner, useEventObservable, Modal, Alert, H3, Text } from '@sourcegraph/wildcard'
import { ALLOW_NAVIGATION } from '../../components/AwayPrompt'

View File

@ -6,13 +6,14 @@ import { Observable, of, throwError } from 'rxjs'
import { catchError, startWith, switchMap } from 'rxjs/operators'
import { asError, isErrorLike } from '@sourcegraph/common'
import { SearchContextFields, SearchContextProps } from '@sourcegraph/search'
import {
Scalars,
SearchContextEditInput,
SearchContextRepositoryRevisionsInput,
SearchContextFields,
} from '@sourcegraph/shared/src/graphql-operations'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { SearchContextProps } from '@sourcegraph/shared/src/search'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { ThemeProps } from '@sourcegraph/shared/src/theme'
import { PageHeader, LoadingSpinner, useObservable, Alert } from '@sourcegraph/wildcard'

View File

@ -3,7 +3,7 @@ import { subDays } from 'date-fns'
import { NEVER, Observable, of } from 'rxjs'
import sinon from 'sinon'
import { SearchContextFields } from '@sourcegraph/search'
import { SearchContextFields } from '@sourcegraph/shared/src/graphql-operations'
import { NOOP_PLATFORM_CONTEXT } from '@sourcegraph/shared/src/testing/searchTestHelpers'
import { AuthenticatedUser } from '../../auth'

View File

@ -6,15 +6,16 @@ import { Observable, of, throwError } from 'rxjs'
import { catchError, map, startWith, switchMap, tap } from 'rxjs/operators'
import { asError, createAggregateError, isErrorLike } from '@sourcegraph/common'
import { QueryState, SearchContextFields, SearchContextProps } from '@sourcegraph/search'
import { SyntaxHighlightedSearchQuery, LazyMonacoQueryInput } from '@sourcegraph/search-ui'
import {
Scalars,
SearchContextInput,
SearchContextRepositoryRevisionsInput,
SearchPatternType,
SearchContextFields,
} from '@sourcegraph/shared/src/graphql-operations'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { QueryState, SearchContextProps } from '@sourcegraph/shared/src/search'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { ThemeProps } from '@sourcegraph/shared/src/theme'
import {

View File

@ -5,7 +5,7 @@ import classNames from 'classnames'
import { Timestamp } from '@sourcegraph/branded/src/components/Timestamp'
import { isErrorLike, pluralize } from '@sourcegraph/common'
import { SearchContextMinimalFields } from '@sourcegraph/search'
import { SearchContextMinimalFields } from '@sourcegraph/shared/src/graphql-operations'
import { Badge, Icon, Link, Menu, MenuButton, MenuItem, MenuLink, MenuList, Tooltip } from '@sourcegraph/wildcard'
import { AuthenticatedUser } from '../../auth'

View File

@ -2,7 +2,7 @@ import React, { useMemo } from 'react'
import { mdiMenuDown } from '@mdi/js'
import { SearchContextFields } from '@sourcegraph/search'
import { SearchContextFields } from '@sourcegraph/shared/src/graphql-operations'
import { Menu, MenuButton, MenuDivider, MenuItem, MenuList, Icon, Tooltip } from '@sourcegraph/wildcard'
import { AuthenticatedUser } from '../../auth'

View File

@ -2,7 +2,7 @@ import { DecoratorFn, Meta, Story } from '@storybook/react'
import { subDays } from 'date-fns'
import { NEVER, Observable, of, throwError } from 'rxjs'
import { SearchContextFields, SearchContextRepositoryRevisionsFields } from '@sourcegraph/search'
import { SearchContextFields, SearchContextRepositoryRevisionsFields } from '@sourcegraph/shared/src/graphql-operations'
import { mockAuthenticatedUser } from '@sourcegraph/shared/src/testing/searchContexts/testHelpers'
import { NOOP_PLATFORM_CONTEXT } from '@sourcegraph/shared/src/testing/searchTestHelpers'

View File

@ -8,12 +8,12 @@ import { catchError, startWith } from 'rxjs/operators'
import { Timestamp } from '@sourcegraph/branded/src/components/Timestamp'
import { asError, isErrorLike, renderMarkdown, pluralize } from '@sourcegraph/common'
import { SearchContextProps, SearchContextRepositoryRevisionsFields } from '@sourcegraph/search'
import { SyntaxHighlightedSearchQuery } from '@sourcegraph/search-ui'
import { AuthenticatedUser } from '@sourcegraph/shared/src/auth'
import { VirtualList } from '@sourcegraph/shared/src/components/VirtualList'
import { Scalars, SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import { SearchContextRepositoryRevisionsFields } from '@sourcegraph/shared/src/graphql-operations'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { SearchContextProps } from '@sourcegraph/shared/src/search'
import { buildSearchURLQuery } from '@sourcegraph/shared/src/util/url'
import {
Badge,
@ -31,6 +31,7 @@ import {
import { Page } from '../../components/Page'
import { PageTitle } from '../../components/PageTitle'
import { Scalars, SearchPatternType } from '../../graphql-operations'
import { useDefaultContext } from './hooks/useDefaultContext'
import { useToggleSearchContextStar } from './hooks/useToggleSearchContextStar'

View File

@ -6,7 +6,7 @@ import { useHistory } from 'react-router'
import { Observable } from 'rxjs'
import { delay, mergeMap, startWith, tap } from 'rxjs/operators'
import { SearchContextRepositoryRevisionsFields } from '@sourcegraph/search'
import { SearchContextRepositoryRevisionsFields } from '@sourcegraph/shared/src/graphql-operations'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { ThemeProps } from '@sourcegraph/shared/src/theme'
import { Button, useEventObservable, Alert, Icon } from '@sourcegraph/wildcard'

View File

@ -6,13 +6,13 @@ import { useHistory, useLocation } from 'react-router'
import { ErrorLike, isErrorLike } from '@sourcegraph/common'
import {
SearchContextProps,
ListSearchContextsResult,
ListSearchContextsVariables,
SearchContextsOrderBy,
SearchContextMinimalFields,
} from '@sourcegraph/search'
} from '@sourcegraph/shared/src/graphql-operations'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { SearchContextProps } from '@sourcegraph/shared/src/search'
import { AuthenticatedUser } from '../../auth'
import {

View File

@ -2,8 +2,8 @@ import React, { useState } from 'react'
import { mdiMagnify, mdiPlus } from '@mdi/js'
import { SearchContextProps } from '@sourcegraph/search'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { SearchContextProps } from '@sourcegraph/shared/src/search'
import { PageHeader, Link, Button, Icon, Alert } from '@sourcegraph/wildcard'
import { AuthenticatedUser } from '../../auth'

View File

@ -2,7 +2,7 @@ import assert from 'assert'
import expect from 'expect'
import { mixedSearchStreamEvents } from '@sourcegraph/search'
import { mixedSearchStreamEvents } from '@sourcegraph/shared/src/search/integration'
import { accessibilityAudit } from '@sourcegraph/shared/src/testing/accessibility'
import { Driver, createDriverForTest } from '@sourcegraph/shared/src/testing/driver'
import { afterEachSaveScreenshotIfFailed } from '@sourcegraph/shared/src/testing/screenshotReporter'

View File

@ -3,7 +3,6 @@ import path from 'path'
import html from 'tagged-template-noop'
import { SearchGraphQlOperations } from '@sourcegraph/search'
import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations'
import { SearchEvent } from '@sourcegraph/shared/src/search/stream'
import { TemporarySettings } from '@sourcegraph/shared/src/settings/temporary/TemporarySettings'
@ -24,7 +23,7 @@ import { TemporarySettingsContext } from './temporarySettingsContext'
export interface WebIntegrationTestContext
extends IntegrationTestContext<
WebGraphQlOperations & SharedGraphQlOperations & SearchGraphQlOperations,
WebGraphQlOperations & SharedGraphQlOperations,
string & keyof (WebGraphQlOperations & SharedGraphQlOperations)
> {
/**

View File

@ -1,4 +1,3 @@
import { SearchGraphQlOperations } from '@sourcegraph/search'
import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations'
import { Settings } from '@sourcegraph/shared/src/schema/settings.schema'
import { mergeSettings } from '@sourcegraph/shared/src/settings/settings'
@ -58,9 +57,7 @@ export const createViewerSettingsGraphQLOverride = (
/**
* Predefined results for GraphQL requests that are made on almost every page.
*/
export const commonWebGraphQlResults: Partial<
WebGraphQlOperations & SharedGraphQlOperations & SearchGraphQlOperations
> = {
export const commonWebGraphQlResults: Partial<WebGraphQlOperations & SharedGraphQlOperations> = {
...sharedGraphQlResults,
CurrentAuthState: () => ({
currentUser: {

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