From 6d45dee7f52b9a53641e24909d51b4d275cd76ee Mon Sep 17 00:00:00 2001 From: Valery Bugakov Date: Mon, 26 Dec 2022 12:23:54 +0800 Subject: [PATCH] web: merge the `search` package into `shared` (#45949) --- .bazelignore | 1 - WORKSPACE | 1 - client/jetbrains/tsconfig.json | 1 - .../webview/src/bridge-mock/call-java-mock.ts | 3 +- client/jetbrains/webview/src/search/App.tsx | 3 +- .../search/input/JetBrainsSearchBox.story.tsx | 2 +- .../src/search/input/JetBrainsSearchBox.tsx | 2 +- .../src/search/input/JetBrainsToggles.tsx | 7 +++-- .../search/results/SearchResultList.story.tsx | 2 +- .../jetbrains/webview/src/search/types.d.ts | 2 +- .../components/CommitSearchResultMatch.tsx | 2 +- .../src/components/FileMatchChildren.tsx | 2 +- .../src/components/SymbolSearchResult.tsx | 2 +- .../SyntaxHighlightedSearchQuery.story.tsx | 2 +- .../SyntaxHighlightedSearchQuery.tsx | 2 +- .../src/input/CodeMirrorQueryInput.tsx | 2 +- .../src/input/MonacoQueryInput.story.tsx | 2 +- .../search-ui/src/input/MonacoQueryInput.tsx | 2 +- client/search-ui/src/input/QueryInput.ts | 7 ++++- .../search-ui/src/input/SearchBox.story.tsx | 3 +- client/search-ui/src/input/SearchBox.tsx | 2 +- .../src/input/SearchContextDropdown.tsx | 2 +- .../src/input/SearchContextMenu.story.tsx | 2 +- .../src/input/SearchContextMenu.test.tsx | 2 +- .../search-ui/src/input/SearchContextMenu.tsx | 3 +- .../src/input/codemirror/completion.ts | 2 +- .../src/input/codemirror/parsedQuery.ts | 2 +- .../CodeMirrorQueryInputWrapper.tsx | 3 +- .../src/input/toggles/Toggles.test.tsx | 3 +- .../search-ui/src/input/toggles/Toggles.tsx | 4 +-- .../src/input/useQueryIntelligence.ts | 2 +- .../search-ui/src/results/NoResultsPage.tsx | 2 +- .../results/StreamingSearchResultsList.tsx | 2 +- .../src/results/sidebar/SearchReference.tsx | 4 +-- .../src/results/sidebar/SearchTypeLink.tsx | 2 +- .../src/results/sidebar/revisions.ts | 2 +- client/search-ui/tsconfig.json | 1 - client/search/.bazelignore | 2 -- client/search/.eslintignore | 2 -- client/search/.eslintrc.js | 12 -------- client/search/BUILD.bazel | 27 ----------------- client/search/README.md | 3 -- client/search/babel.config.js | 5 ---- client/search/jest.config.js | 13 --------- client/search/package.json | 13 --------- client/search/src/CODENOTIFY | 3 -- client/search/tsconfig.json | 19 ------------ .../shared/dev/generateGraphQlOperations.js | 9 ------ .../src => shared/src/search}/backend.ts | 6 ++-- .../src => shared/src/search}/helpers.ts | 24 +++++++++++++-- .../src/search}/helpers/queryExample.test.ts | 2 +- .../src/search}/helpers/queryExample.ts | 8 ++--- .../src/search/helpers/searchContext.ts} | 29 +------------------ client/shared/src/search/index.ts | 5 ++++ client/shared/src/search/integration/index.ts | 1 + .../integration/streaming-search-mocks.ts | 21 +++++++------- .../src/search}/searchQueryState.tsx | 11 ++++--- client/shared/src/search/stream.ts | 3 +- client/shared/src/util/url.ts | 2 +- client/vscode/src/backend/searchContexts.ts | 2 +- client/vscode/src/backend/streamSearch.ts | 2 +- client/vscode/src/state.ts | 2 +- .../src/webview/search-panel/RepoView.tsx | 2 +- .../webview/search-panel/SearchHomeView.tsx | 3 +- .../search-panel/SearchResultsView.tsx | 3 +- .../search-panel/alias/SymbolSearchResult.tsx | 2 +- .../search-panel/components/HomeFooter.tsx | 2 +- .../history/components/RecentFilesSection.tsx | 2 +- .../components/RecentRepositoriesSection.tsx | 2 +- .../components/RecentSearchesSection.tsx | 2 +- .../sidebars/search/SearchSidebarView.tsx | 18 ++++++------ client/vscode/tests/context.ts | 3 +- client/vscode/tests/graphql.ts | 5 +--- client/vscode/tests/vsce.test.ts | 2 +- client/vscode/tsconfig.json | 1 - client/web/src/Layout.tsx | 2 +- client/web/src/SourcegraphWebApp.tsx | 20 ++++++------- .../CommunitySearchContextPage.story.tsx | 2 +- .../CommunitySearchContextPage.tsx | 2 +- .../components/FormTriggerArea.tsx | 2 +- .../ExecutorCompatibilityAlert.story.tsx | 3 +- .../instances/ExecutorsListPage.story.tsx | 4 +-- .../secrets/ExecutorSecretsListPage.story.tsx | 7 +++-- .../form/monaco-field/MonacoField.tsx | 2 +- .../CreateSearchContextPage.tsx | 3 +- .../DeleteSearchContextModal.story.tsx | 2 +- .../DeleteSearchContextModal.tsx | 3 +- .../searchContexts/EditSearchContextPage.tsx | 3 +- .../SearchContextForm.story.tsx | 2 +- .../searchContexts/SearchContextForm.tsx | 3 +- .../searchContexts/SearchContextNode.tsx | 2 +- .../SearchContextOwnerDropdown.tsx | 2 +- .../SearchContextPage.story.tsx | 2 +- .../searchContexts/SearchContextPage.tsx | 5 ++-- .../SearchContextRepositoriesFormArea.tsx | 2 +- .../searchContexts/SearchContextsList.tsx | 4 +-- .../searchContexts/SearchContextsListPage.tsx | 2 +- .../src/integration/code-monitoring.test.ts | 2 +- client/web/src/integration/context.ts | 3 +- client/web/src/integration/graphQlResults.ts | 5 +--- client/web/src/integration/nav.test.ts | 4 +-- client/web/src/integration/notebook.test.ts | 2 +- .../integration/search-aggregation.test.ts | 5 ++-- .../src/integration/search-contexts.test.ts | 4 +-- client/web/src/integration/search.test.ts | 11 +++---- client/web/src/integration/utils.ts | 9 +++--- client/web/src/nav/GlobalNavbar.tsx | 2 +- .../blocks/query/NotebookQueryBlock.tsx | 2 +- .../SearchTypeSuggestionsInput.tsx | 3 +- client/web/src/repo/RepoContainer.tsx | 2 +- client/web/src/repo/RepoRevisionContainer.tsx | 2 +- client/web/src/repo/blob/BlobPage.tsx | 2 +- client/web/src/repo/tree/TreePage.tsx | 2 +- .../web/src/savedSearches/SavedSearchForm.tsx | 4 +-- .../src/savedSearches/SavedSearchListPage.tsx | 2 +- .../src/savedSearches/SavedSearchModal.tsx | 2 +- client/web/src/search/helpers.tsx | 2 +- .../src/search/home/QueryExamplesHomepage.tsx | 3 +- client/web/src/search/home/SearchPage.tsx | 2 +- .../web/src/search/home/SearchPageInput.tsx | 14 ++++----- client/web/src/search/index.test.ts | 2 +- client/web/src/search/index.tsx | 2 +- .../web/src/search/input/SearchNavbarItem.tsx | 2 +- .../src/search/results/SearchActionsMenu.tsx | 2 +- .../search/results/SearchResultsInfoBar.tsx | 2 +- .../results/StreamingSearchResults.story.tsx | 2 +- .../results/StreamingSearchResults.test.tsx | 2 +- .../search/results/StreamingSearchResults.tsx | 2 +- .../aggregation/SearchAggregationResult.tsx | 3 +- .../web/src/search/results/createActions.ts | 2 +- .../results/sidebar/SearchAggregations.tsx | 2 +- .../sidebar/SearchFiltersSidebar.story.tsx | 2 +- .../results/sidebar/SearchFiltersSidebar.tsx | 3 +- .../web/src/search/suggestion/DidYouMean.tsx | 2 +- .../web/src/stores/navbarSearchQueryState.ts | 4 +-- client/web/src/util/settings.ts | 2 +- client/web/tsconfig.json | 1 - dev/foreach-ts-project.sh | 1 - pnpm-lock.yaml | 3 -- tsconfig.all.json | 1 - yarn.lock | 6 ---- 141 files changed, 232 insertions(+), 347 deletions(-) delete mode 100644 client/search/.bazelignore delete mode 100644 client/search/.eslintignore delete mode 100644 client/search/.eslintrc.js delete mode 100644 client/search/BUILD.bazel delete mode 100644 client/search/README.md delete mode 100644 client/search/babel.config.js delete mode 100644 client/search/jest.config.js delete mode 100644 client/search/package.json delete mode 100644 client/search/src/CODENOTIFY delete mode 100644 client/search/tsconfig.json rename client/{search/src => shared/src/search}/backend.ts (98%) rename client/{search/src => shared/src/search}/helpers.ts (85%) rename client/{search/src => shared/src/search}/helpers/queryExample.test.ts (99%) rename client/{search/src => shared/src/search}/helpers/queryExample.ts (95%) rename client/{search/src/index.ts => shared/src/search/helpers/searchContext.ts} (75%) create mode 100644 client/shared/src/search/index.ts create mode 100644 client/shared/src/search/integration/index.ts rename client/{search/src => shared/src/search}/integration/streaming-search-mocks.ts (99%) rename client/{search/src => shared/src/search}/searchQueryState.tsx (94%) diff --git a/.bazelignore b/.bazelignore index ba65fba9bd6..7369b37914a 100644 --- a/.bazelignore +++ b/.bazelignore @@ -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 diff --git a/WORKSPACE b/WORKSPACE index 03282859727..6dde98f62f6 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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", diff --git a/client/jetbrains/tsconfig.json b/client/jetbrains/tsconfig.json index 8bf7872118e..eb3c2cb6d10 100644 --- a/client/jetbrains/tsconfig.json +++ b/client/jetbrains/tsconfig.json @@ -19,7 +19,6 @@ { "path": "../shared" }, { "path": "../common" }, { "path": "../branded" }, - { "path": "../search" }, { "path": "../search-ui" }, ], "include": ["./package.json", "**/*", ".*", "**/*.d.ts"], diff --git a/client/jetbrains/webview/src/bridge-mock/call-java-mock.ts b/client/jetbrains/webview/src/bridge-mock/call-java-mock.ts index 41d7f3277d3..84721b151df 100644 --- a/client/jetbrains/webview/src/bridge-mock/call-java-mock.ts +++ b/client/jetbrains/webview/src/bridge-mock/call-java-mock.ts @@ -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' diff --git a/client/jetbrains/webview/src/search/App.tsx b/client/jetbrains/webview/src/search/App.tsx index 697028aee36..1b34a5fd832 100644 --- a/client/jetbrains/webview/src/search/App.tsx +++ b/client/jetbrains/webview/src/search/App.tsx @@ -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' diff --git a/client/jetbrains/webview/src/search/input/JetBrainsSearchBox.story.tsx b/client/jetbrains/webview/src/search/input/JetBrainsSearchBox.story.tsx index 06869d0fd96..e859aba96bc 100644 --- a/client/jetbrains/webview/src/search/input/JetBrainsSearchBox.story.tsx +++ b/client/jetbrains/webview/src/search/input/JetBrainsSearchBox.story.tsx @@ -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' diff --git a/client/jetbrains/webview/src/search/input/JetBrainsSearchBox.tsx b/client/jetbrains/webview/src/search/input/JetBrainsSearchBox.tsx index 4716b9af7a1..7c896d93561 100644 --- a/client/jetbrains/webview/src/search/input/JetBrainsSearchBox.tsx +++ b/client/jetbrains/webview/src/search/input/JetBrainsSearchBox.tsx @@ -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' diff --git a/client/jetbrains/webview/src/search/input/JetBrainsToggles.tsx b/client/jetbrains/webview/src/search/input/JetBrainsToggles.tsx index 1a2544147ee..c0ac89d7dbb 100644 --- a/client/jetbrains/webview/src/search/input/JetBrainsToggles.tsx +++ b/client/jetbrains/webview/src/search/input/JetBrainsToggles.tsx @@ -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 diff --git a/client/jetbrains/webview/src/search/results/SearchResultList.story.tsx b/client/jetbrains/webview/src/search/results/SearchResultList.story.tsx index e32734f6958..4a20a79887f 100644 --- a/client/jetbrains/webview/src/search/results/SearchResultList.story.tsx +++ b/client/jetbrains/webview/src/search/results/SearchResultList.story.tsx @@ -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' diff --git a/client/jetbrains/webview/src/search/types.d.ts b/client/jetbrains/webview/src/search/types.d.ts index 4da55482bf1..43b8ea60ee1 100644 --- a/client/jetbrains/webview/src/search/types.d.ts +++ b/client/jetbrains/webview/src/search/types.d.ts @@ -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' diff --git a/client/search-ui/src/components/CommitSearchResultMatch.tsx b/client/search-ui/src/components/CommitSearchResultMatch.tsx index fa5beb58a89..85a9be15b75 100644 --- a/client/search-ui/src/components/CommitSearchResultMatch.tsx +++ b/client/search-ui/src/components/CommitSearchResultMatch.tsx @@ -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' diff --git a/client/search-ui/src/components/FileMatchChildren.tsx b/client/search-ui/src/components/FileMatchChildren.tsx index d106597d2b4..81769787e78 100644 --- a/client/search-ui/src/components/FileMatchChildren.tsx +++ b/client/search-ui/src/components/FileMatchChildren.tsx @@ -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' diff --git a/client/search-ui/src/components/SymbolSearchResult.tsx b/client/search-ui/src/components/SymbolSearchResult.tsx index 624d5c36b0d..e8f9d158166 100644 --- a/client/search-ui/src/components/SymbolSearchResult.tsx +++ b/client/search-ui/src/components/SymbolSearchResult.tsx @@ -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' diff --git a/client/search-ui/src/components/SyntaxHighlightedSearchQuery.story.tsx b/client/search-ui/src/components/SyntaxHighlightedSearchQuery.story.tsx index 6744deaba4b..7a95052c9b2 100644 --- a/client/search-ui/src/components/SyntaxHighlightedSearchQuery.story.tsx +++ b/client/search-ui/src/components/SyntaxHighlightedSearchQuery.story.tsx @@ -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' diff --git a/client/search-ui/src/components/SyntaxHighlightedSearchQuery.tsx b/client/search-ui/src/components/SyntaxHighlightedSearchQuery.tsx index 3b872dc315c..f58ccc830f9 100644 --- a/client/search-ui/src/components/SyntaxHighlightedSearchQuery.tsx +++ b/client/search-ui/src/components/SyntaxHighlightedSearchQuery.tsx @@ -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' diff --git a/client/search-ui/src/input/CodeMirrorQueryInput.tsx b/client/search-ui/src/input/CodeMirrorQueryInput.tsx index 138c41dd349..de363ee86ef 100644 --- a/client/search-ui/src/input/CodeMirrorQueryInput.tsx +++ b/client/search-ui/src/input/CodeMirrorQueryInput.tsx @@ -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' diff --git a/client/search-ui/src/input/MonacoQueryInput.story.tsx b/client/search-ui/src/input/MonacoQueryInput.story.tsx index 7320bfb061c..9f8a92ecc9b 100644 --- a/client/search-ui/src/input/MonacoQueryInput.story.tsx +++ b/client/search-ui/src/input/MonacoQueryInput.story.tsx @@ -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' diff --git a/client/search-ui/src/input/MonacoQueryInput.tsx b/client/search-ui/src/input/MonacoQueryInput.tsx index 5db7c5443c6..977e8e1d130 100644 --- a/client/search-ui/src/input/MonacoQueryInput.tsx +++ b/client/search-ui/src/input/MonacoQueryInput.tsx @@ -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' diff --git a/client/search-ui/src/input/QueryInput.ts b/client/search-ui/src/input/QueryInput.ts index 92ad2ab87cf..c0e7d0e938a 100644 --- a/client/search-ui/src/input/QueryInput.ts +++ b/client/search-ui/src/input/QueryInput.ts @@ -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' diff --git a/client/search-ui/src/input/SearchBox.story.tsx b/client/search-ui/src/input/SearchBox.story.tsx index 10f2cc4b079..74573591448 100644 --- a/client/search-ui/src/input/SearchBox.story.tsx +++ b/client/search-ui/src/input/SearchBox.story.tsx @@ -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, diff --git a/client/search-ui/src/input/SearchBox.tsx b/client/search-ui/src/input/SearchBox.tsx index 7b3d1faf108..9ed22529a02 100644 --- a/client/search-ui/src/input/SearchBox.tsx +++ b/client/search-ui/src/input/SearchBox.tsx @@ -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' diff --git a/client/search-ui/src/input/SearchContextDropdown.tsx b/client/search-ui/src/input/SearchContextDropdown.tsx index 3c9589694cf..8062d454d49 100644 --- a/client/search-ui/src/input/SearchContextDropdown.tsx +++ b/client/search-ui/src/input/SearchContextDropdown.tsx @@ -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' diff --git a/client/search-ui/src/input/SearchContextMenu.story.tsx b/client/search-ui/src/input/SearchContextMenu.story.tsx index c5fb8463d9c..0a1f6b01b51 100644 --- a/client/search-ui/src/input/SearchContextMenu.story.tsx +++ b/client/search-ui/src/input/SearchContextMenu.story.tsx @@ -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, diff --git a/client/search-ui/src/input/SearchContextMenu.test.tsx b/client/search-ui/src/input/SearchContextMenu.test.tsx index 2b094e89fce..8a49db9dbba 100644 --- a/client/search-ui/src/input/SearchContextMenu.test.tsx +++ b/client/search-ui/src/input/SearchContextMenu.test.tsx @@ -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' diff --git a/client/search-ui/src/input/SearchContextMenu.tsx b/client/search-ui/src/input/SearchContextMenu.tsx index 721cee64036..72091258932 100644 --- a/client/search-ui/src/input/SearchContextMenu.tsx +++ b/client/search-ui/src/input/SearchContextMenu.tsx @@ -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, diff --git a/client/search-ui/src/input/codemirror/completion.ts b/client/search-ui/src/input/codemirror/completion.ts index 5418c32527c..9299bd03c70 100644 --- a/client/search-ui/src/input/codemirror/completion.ts +++ b/client/search-ui/src/input/codemirror/completion.ts @@ -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, diff --git a/client/search-ui/src/input/codemirror/parsedQuery.ts b/client/search-ui/src/input/codemirror/parsedQuery.ts index ab192ffec75..6c03ec21c12 100644 --- a/client/search-ui/src/input/codemirror/parsedQuery.ts +++ b/client/search-ui/src/input/codemirror/parsedQuery.ts @@ -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' diff --git a/client/search-ui/src/input/experimental/CodeMirrorQueryInputWrapper.tsx b/client/search-ui/src/input/experimental/CodeMirrorQueryInputWrapper.tsx index 12182d1de61..8858d698457 100644 --- a/client/search-ui/src/input/experimental/CodeMirrorQueryInputWrapper.tsx +++ b/client/search-ui/src/input/experimental/CodeMirrorQueryInputWrapper.tsx @@ -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' diff --git a/client/search-ui/src/input/toggles/Toggles.test.tsx b/client/search-ui/src/input/toggles/Toggles.test.tsx index 78cea6712fc..6e819dfcdfd 100644 --- a/client/search-ui/src/input/toggles/Toggles.test.tsx +++ b/client/search-ui/src/input/toggles/Toggles.test.tsx @@ -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' diff --git a/client/search-ui/src/input/toggles/Toggles.tsx b/client/search-ui/src/input/toggles/Toggles.tsx index feef299b259..93201afc735 100644 --- a/client/search-ui/src/input/toggles/Toggles.tsx +++ b/client/search-ui/src/input/toggles/Toggles.tsx @@ -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' diff --git a/client/search-ui/src/input/useQueryIntelligence.ts b/client/search-ui/src/input/useQueryIntelligence.ts index 5c03f03eec4..34cbb30fcda 100644 --- a/client/search-ui/src/input/useQueryIntelligence.ts +++ b/client/search-ui/src/input/useQueryIntelligence.ts @@ -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' diff --git a/client/search-ui/src/results/NoResultsPage.tsx b/client/search-ui/src/results/NoResultsPage.tsx index 2540a426e32..5e9fe8d7b70 100644 --- a/client/search-ui/src/results/NoResultsPage.tsx +++ b/client/search-ui/src/results/NoResultsPage.tsx @@ -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' diff --git a/client/search-ui/src/results/StreamingSearchResultsList.tsx b/client/search-ui/src/results/StreamingSearchResultsList.tsx index 91ac1ab5921..9c7a09e089d 100644 --- a/client/search-ui/src/results/StreamingSearchResultsList.tsx +++ b/client/search-ui/src/results/StreamingSearchResultsList.tsx @@ -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, diff --git a/client/search-ui/src/results/sidebar/SearchReference.tsx b/client/search-ui/src/results/sidebar/SearchReference.tsx index d182942ccaf..1f7d6e29d06 100644 --- a/client/search-ui/src/results/sidebar/SearchReference.tsx +++ b/client/search-ui/src/results/sidebar/SearchReference.tsx @@ -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' diff --git a/client/search-ui/src/results/sidebar/SearchTypeLink.tsx b/client/search-ui/src/results/sidebar/SearchTypeLink.tsx index a855ea4599c..32f97d491c3 100644 --- a/client/search-ui/src/results/sidebar/SearchTypeLink.tsx +++ b/client/search-ui/src/results/sidebar/SearchTypeLink.tsx @@ -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' diff --git a/client/search-ui/src/results/sidebar/revisions.ts b/client/search-ui/src/results/sidebar/revisions.ts index 125c284ab14..841a6aacb86 100644 --- a/client/search-ui/src/results/sidebar/revisions.ts +++ b/client/search-ui/src/results/sidebar/revisions.ts @@ -1,4 +1,4 @@ -import { QueryUpdate } from '@sourcegraph/search' +import { QueryUpdate } from '@sourcegraph/shared/src/search' export enum TabIndex { BRANCHES, diff --git a/client/search-ui/tsconfig.json b/client/search-ui/tsconfig.json index 31dad5e5e2b..a9f5092d2a7 100644 --- a/client/search-ui/tsconfig.json +++ b/client/search-ui/tsconfig.json @@ -11,7 +11,6 @@ "include": ["./src/**/*", "./*.ts"], "exclude": ["../../node_modules", "./node_modules", "./out"], "references": [ - { "path": "../search" }, { "path": "../shared" }, { "path": "../branded" }, { "path": "../http-client" }, diff --git a/client/search/.bazelignore b/client/search/.bazelignore deleted file mode 100644 index 52c902c991f..00000000000 --- a/client/search/.bazelignore +++ /dev/null @@ -1,2 +0,0 @@ -# TODO(bazel): remove when no longer generated into src -src/graphql-operations.ts diff --git a/client/search/.eslintignore b/client/search/.eslintignore deleted file mode 100644 index 97a7ee57081..00000000000 --- a/client/search/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -out/ -src/graphql-operations.ts diff --git a/client/search/.eslintrc.js b/client/search/.eslintrc.js deleted file mode 100644 index 23c93898412..00000000000 --- a/client/search/.eslintrc.js +++ /dev/null @@ -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, -} diff --git a/client/search/BUILD.bazel b/client/search/BUILD.bazel deleted file mode 100644 index c80261765e1..00000000000 --- a/client/search/BUILD.bazel +++ /dev/null @@ -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", -) diff --git a/client/search/README.md b/client/search/README.md deleted file mode 100644 index 968d57b820c..00000000000 --- a/client/search/README.md +++ /dev/null @@ -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). diff --git a/client/search/babel.config.js b/client/search/babel.config.js deleted file mode 100644 index 73a95d310cd..00000000000 --- a/client/search/babel.config.js +++ /dev/null @@ -1,5 +0,0 @@ -// @ts-check - -module.exports = { - extends: '../../babel.config.js', -} diff --git a/client/search/jest.config.js b/client/search/jest.config.js deleted file mode 100644 index d5149c625e6..00000000000 --- a/client/search/jest.config.js +++ /dev/null @@ -1,13 +0,0 @@ -// @ts-check - -const config = require('../../jest.config.base') - -const exportedConfig = { - ...config, - displayName: 'common', - rootDir: __dirname, - roots: [''], - verbose: true, -} - -module.exports = exportedConfig diff --git a/client/search/package.json b/client/search/package.json deleted file mode 100644 index 1242389f636..00000000000 --- a/client/search/package.json +++ /dev/null @@ -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" - } -} diff --git a/client/search/src/CODENOTIFY b/client/search/src/CODENOTIFY deleted file mode 100644 index a60d22539db..00000000000 --- a/client/search/src/CODENOTIFY +++ /dev/null @@ -1,3 +0,0 @@ -# See https://github.com/sourcegraph/codenotify for documentation. - -**/* @fkling diff --git a/client/search/tsconfig.json b/client/search/tsconfig.json deleted file mode 100644 index 7485d1825a1..00000000000 --- a/client/search/tsconfig.json +++ /dev/null @@ -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" }, - ], -} diff --git a/client/shared/dev/generateGraphQlOperations.js b/client/shared/dev/generateGraphQlOperations.js index cfb3e79c445..5495e386d8e 100644 --- a/client/shared/dev/generateGraphQlOperations.js +++ b/client/shared/dev/generateGraphQlOperations.js @@ -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'), diff --git a/client/search/src/backend.ts b/client/shared/src/search/backend.ts similarity index 98% rename from client/search/src/backend.ts rename to client/shared/src/search/backend.ts index f9593f0fa6a..2aeafedad93 100644 --- a/client/search/src/backend.ts +++ b/client/shared/src/search/backend.ts @@ -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 { diff --git a/client/search/src/helpers.ts b/client/shared/src/search/helpers.ts similarity index 85% rename from client/search/src/helpers.ts rename to client/shared/src/search/helpers.ts index ce3b0c8e938..515d652e1a8 100644 --- a/client/search/src/helpers.ts +++ b/client/shared/src/search/helpers.ts @@ -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 { /** diff --git a/client/search/src/helpers/queryExample.test.ts b/client/shared/src/search/helpers/queryExample.test.ts similarity index 99% rename from client/search/src/helpers/queryExample.test.ts rename to client/shared/src/search/helpers/queryExample.test.ts index 09eca84c3ba..8f688fb6f80 100644 --- a/client/search/src/helpers/queryExample.test.ts +++ b/client/shared/src/search/helpers/queryExample.test.ts @@ -1,4 +1,4 @@ -import { FilterType } from '@sourcegraph/shared/src/search/query/filters' +import { FilterType } from '../query/filters' import { createQueryExampleFromString, updateQueryWithFilterAndExample } from './queryExample' diff --git a/client/search/src/helpers/queryExample.ts b/client/shared/src/search/helpers/queryExample.ts similarity index 95% rename from client/search/src/helpers/queryExample.ts rename to client/shared/src/search/helpers/queryExample.ts index 8b9f5667bc4..c2037587d51 100644 --- a/client/search/src/helpers/queryExample.ts +++ b/client/shared/src/search/helpers/queryExample.ts @@ -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 diff --git a/client/search/src/index.ts b/client/shared/src/search/helpers/searchContext.ts similarity index 75% rename from client/search/src/index.ts rename to client/shared/src/search/helpers/searchContext.ts index bf91d0d4b99..a41d9dc5a60 100644 --- a/client/search/src/index.ts +++ b/client/shared/src/search/helpers/searchContext.ts @@ -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 diff --git a/client/shared/src/search/index.ts b/client/shared/src/search/index.ts new file mode 100644 index 00000000000..cbe5ca0fb31 --- /dev/null +++ b/client/shared/src/search/index.ts @@ -0,0 +1,5 @@ +export * from './backend' +export * from './searchQueryState' +export * from './helpers' +export * from './helpers/queryExample' +export * from './helpers/searchContext' diff --git a/client/shared/src/search/integration/index.ts b/client/shared/src/search/integration/index.ts new file mode 100644 index 00000000000..e2a265a5b8b --- /dev/null +++ b/client/shared/src/search/integration/index.ts @@ -0,0 +1 @@ +export * from './streaming-search-mocks' diff --git a/client/search/src/integration/streaming-search-mocks.ts b/client/shared/src/search/integration/streaming-search-mocks.ts similarity index 99% rename from client/search/src/integration/streaming-search-mocks.ts rename to client/shared/src/search/integration/streaming-search-mocks.ts index 587cfcd13b3..8dfaee4f93b 100644 --- a/client/search/src/integration/streaming-search-mocks.ts +++ b/client/shared/src/search/integration/streaming-search-mocks.ts @@ -1,10 +1,11 @@ /* eslint-disable no-template-curly-in-string */ -import { FetchFileParameters } from '@sourcegraph/shared/src/backend/file' -import { HighlightedFileResult, SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations' -import { SearchEvent } from '@sourcegraph/shared/src/search/stream' - -import { SearchGraphQlOperations } from '..' -import { SymbolKind } from '../graphql-operations' +import { + SymbolKind, + HighlightedFileResult, + SharedGraphQlOperations, + HighlightedFileVariables, +} from '../../graphql-operations' +import { SearchEvent } from '../stream' export const diffSearchStreamEvents: SearchEvent[] = [ { @@ -43,7 +44,7 @@ export const diffSearchStreamEvents: SearchEvent[] = [ Rule: "color-contrast" (Elements must have sufficient color contrast) for all changes in this file GitHub issue: https://github.com/sourcegraph/sourcegraph/issues/33343 */ -export const diffHighlightResult: Partial = { +export const diffHighlightResult: Partial = { highlightCode: () => ({ highlightCode: '
mocha.opts mocha.opts\n
@@ -0,0 +3,2 @@\n
+--timeout 200\n
+src/**/*.test.ts\n
\\ No newline at end of file\n
package.json package.json\n
@@ -50,0 +54,3 @@\n
+ "exclude": [\n
+ "**/*.test.ts"\n
+ ],\n
@@ -54,1 +64,2 @@\n
- "serve": "parcel serve --no-hmr --out-file dist/extension.js src/extension.ts",\n
+ "test": "TS_NODE_COMPILER_OPTIONS='{\\"module\\":\\"commonjs\\"}' mocha --require ts-node/register --require source-map-support/register --opts mocha.opts",\n
+ "cover": "TS_NODE_COMPILER_OPTIONS='{\\"module\\":\\"commonjs\\"}' nyc --require ts-node/register --require source-map-support/register --all mocha --opts mocha.opts --timeout 10000",\n
@@ -57,2 +70,2 @@\n
- "sourcegraph:prepublish": "parcel build src/extension.ts"\n
+ "sourcegraph:prepublish": "yarn typecheck && yarn test && yarn build"\n
},\n
yarn.lock yarn.lock\n
@@ -3736,0 +4204,3 @@ number-is-nan@^1.0.0:\n
+ spawn-wrap "^1.4.2"\n
+ test-exclude "^5.1.0"\n
+ uuid "^3.3.2"\n
@@ -5550,1 +6166,5 @@ terser@^3.7.3, terser@^3.8.1:\n
\n
+test-exclude@^5.1.0:\n
+ version "5.1.0"\n
+ resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.1.0.tgz#6ba6b25179d2d38724824661323b73e03c0c1de1"\n
+ integrity sha512-gwf0S2fFsANC55fSeSqpb8BYk6w3FDvwZxfNjeF6FRgvFa43r+7wRiA/Q0IxoRU37wB/LE8IQ4221BsNucTaCA==
', @@ -76,7 +77,7 @@ export const commitSearchStreamEvents: SearchEvent[] = [ { type: 'done', data: {} }, ] -export const commitHighlightResult: Partial = { +export const commitHighlightResult: Partial = { highlightCode: () => ({ highlightCode: '
add more tests, use the Sourcegraph stubs api and improve repo matching. (#13)\n
\n
* add more tests, refactor to use extension api stubs\n
* improve repo matching\n
Co-Authored-By: Felix Becker
', @@ -265,8 +266,8 @@ export const mixedSearchStreamEvents: SearchEvent[] = [ { type: 'done', data: {} }, ] -export const highlightFileResult: Partial = { - HighlightedFile: ((parameters: FetchFileParameters): HighlightedFileResult => { +export const highlightFileResult = { + HighlightedFile: ((parameters: HighlightedFileVariables): HighlightedFileResult => { const allLines = [ '
import { index } from './index'\n
', '
import { Edge, Vertex } from 'lsif-protocol'\n
', diff --git a/client/search/src/searchQueryState.tsx b/client/shared/src/search/searchQueryState.tsx similarity index 94% rename from client/search/src/searchQueryState.tsx rename to client/shared/src/search/searchQueryState.tsx index d41601f5cca..bb9c7e23b8c 100644 --- a/client/search/src/searchQueryState.tsx +++ b/client/shared/src/search/searchQueryState.tsx @@ -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 = UseBoundStore> diff --git a/client/shared/src/search/stream.ts b/client/shared/src/search/stream.ts index e26a293f3ee..70654923c78 100644 --- a/client/shared/src/search/stream.ts +++ b/client/shared/src/search/stream.ts @@ -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: diff --git a/client/shared/src/util/url.ts b/client/shared/src/util/url.ts index 4b56f01768c..9e08a4a843b 100644 --- a/client/shared/src/util/url.ts +++ b/client/shared/src/util/url.ts @@ -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 { /** diff --git a/client/vscode/src/backend/searchContexts.ts b/client/vscode/src/backend/searchContexts.ts index f0cbe5b256c..3233a3cf200 100644 --- a/client/vscode/src/backend/searchContexts.ts +++ b/client/vscode/src/backend/searchContexts.ts @@ -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' diff --git a/client/vscode/src/backend/streamSearch.ts b/client/vscode/src/backend/streamSearch.ts index 1240fb5e297..8bef3b7d7bd 100644 --- a/client/vscode/src/backend/streamSearch.ts +++ b/client/vscode/src/backend/streamSearch.ts @@ -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' diff --git a/client/vscode/src/state.ts b/client/vscode/src/state.ts index 4169aebe64a..1f381935e66 100644 --- a/client/vscode/src/state.ts +++ b/client/vscode/src/state.ts @@ -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' diff --git a/client/vscode/src/webview/search-panel/RepoView.tsx b/client/vscode/src/webview/search-panel/RepoView.tsx index d6e277b8331..dc0f1063f78 100644 --- a/client/vscode/src/webview/search-panel/RepoView.tsx +++ b/client/vscode/src/webview/search-panel/RepoView.tsx @@ -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' diff --git a/client/vscode/src/webview/search-panel/SearchHomeView.tsx b/client/vscode/src/webview/search-panel/SearchHomeView.tsx index 00f30830ebf..683757756bb 100644 --- a/client/vscode/src/webview/search-panel/SearchHomeView.tsx +++ b/client/vscode/src/webview/search-panel/SearchHomeView.tsx @@ -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' diff --git a/client/vscode/src/webview/search-panel/SearchResultsView.tsx b/client/vscode/src/webview/search-panel/SearchResultsView.tsx index ed22a07b31c..a3ed9459309 100644 --- a/client/vscode/src/webview/search-panel/SearchResultsView.tsx +++ b/client/vscode/src/webview/search-panel/SearchResultsView.tsx @@ -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' diff --git a/client/vscode/src/webview/search-panel/alias/SymbolSearchResult.tsx b/client/vscode/src/webview/search-panel/alias/SymbolSearchResult.tsx index 292048a66fe..3b0e63a7071 100644 --- a/client/vscode/src/webview/search-panel/alias/SymbolSearchResult.tsx +++ b/client/vscode/src/webview/search-panel/alias/SymbolSearchResult.tsx @@ -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' diff --git a/client/vscode/src/webview/search-panel/components/HomeFooter.tsx b/client/vscode/src/webview/search-panel/components/HomeFooter.tsx index b1ae9850de1..c5327def1ff 100644 --- a/client/vscode/src/webview/search-panel/components/HomeFooter.tsx +++ b/client/vscode/src/webview/search-panel/components/HomeFooter.tsx @@ -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' diff --git a/client/vscode/src/webview/sidebars/history/components/RecentFilesSection.tsx b/client/vscode/src/webview/sidebars/history/components/RecentFilesSection.tsx index b32e01fb36f..891f0757881 100644 --- a/client/vscode/src/webview/sidebars/history/components/RecentFilesSection.tsx +++ b/client/vscode/src/webview/sidebars/history/components/RecentFilesSection.tsx @@ -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' diff --git a/client/vscode/src/webview/sidebars/history/components/RecentRepositoriesSection.tsx b/client/vscode/src/webview/sidebars/history/components/RecentRepositoriesSection.tsx index ef34a02d161..83d12521f2c 100644 --- a/client/vscode/src/webview/sidebars/history/components/RecentRepositoriesSection.tsx +++ b/client/vscode/src/webview/sidebars/history/components/RecentRepositoriesSection.tsx @@ -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' diff --git a/client/vscode/src/webview/sidebars/history/components/RecentSearchesSection.tsx b/client/vscode/src/webview/sidebars/history/components/RecentSearchesSection.tsx index e73c9be914e..cd6cf71382d 100644 --- a/client/vscode/src/webview/sidebars/history/components/RecentSearchesSection.tsx +++ b/client/vscode/src/webview/sidebars/history/components/RecentSearchesSection.tsx @@ -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' diff --git a/client/vscode/src/webview/sidebars/search/SearchSidebarView.tsx b/client/vscode/src/webview/sidebars/search/SearchSidebarView.tsx index c017e69c224..a2cca583a18 100644 --- a/client/vscode/src/webview/sidebars/search/SearchSidebarView.tsx +++ b/client/vscode/src/webview/sidebars/search/SearchSidebarView.tsx @@ -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' diff --git a/client/vscode/tests/context.ts b/client/vscode/tests/context.ts index 5ea22012d03..346ea408968 100644 --- a/client/vscode/tests/context.ts +++ b/client/vscode/tests/context.ts @@ -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) > { /** diff --git a/client/vscode/tests/graphql.ts b/client/vscode/tests/graphql.ts index 2d6955d94f8..455e464e72a 100644 --- a/client/vscode/tests/graphql.ts +++ b/client/vscode/tests/graphql.ts @@ -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 = { ...sharedGraphQlResults, LogEvents: () => ({ __typename: 'Mutation', diff --git a/client/vscode/tests/vsce.test.ts b/client/vscode/tests/vsce.test.ts index a3ee24ab38f..888f39cd629 100644 --- a/client/vscode/tests/vsce.test.ts +++ b/client/vscode/tests/vsce.test.ts @@ -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' diff --git a/client/vscode/tsconfig.json b/client/vscode/tsconfig.json index 98ae522fff2..ea8bdc59b09 100644 --- a/client/vscode/tsconfig.json +++ b/client/vscode/tsconfig.json @@ -19,7 +19,6 @@ { "path": "../shared" }, { "path": "../common" }, { "path": "../branded" }, - { "path": "../search" }, { "path": "../search-ui" }, ], "include": ["./package.json", "**/*", ".*", "**/*.d.ts", "./code-intel-extensions.json"], diff --git a/client/web/src/Layout.tsx b/client/web/src/Layout.tsx index db67a745d63..fdf8b9531d3 100644 --- a/client/web/src/Layout.tsx +++ b/client/web/src/Layout.tsx @@ -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' diff --git a/client/web/src/SourcegraphWebApp.tsx b/client/web/src/SourcegraphWebApp.tsx index 83eda030b72..1c56792ad36 100644 --- a/client/web/src/SourcegraphWebApp.tsx +++ b/client/web/src/SourcegraphWebApp.tsx @@ -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' diff --git a/client/web/src/communitySearchContexts/CommunitySearchContextPage.story.tsx b/client/web/src/communitySearchContexts/CommunitySearchContextPage.story.tsx index e4cd5370e58..991d33cffed 100644 --- a/client/web/src/communitySearchContexts/CommunitySearchContextPage.story.tsx +++ b/client/web/src/communitySearchContexts/CommunitySearchContextPage.story.tsx @@ -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, diff --git a/client/web/src/communitySearchContexts/CommunitySearchContextPage.tsx b/client/web/src/communitySearchContexts/CommunitySearchContextPage.tsx index 8a6eb47f366..9aaed351e22 100644 --- a/client/web/src/communitySearchContexts/CommunitySearchContextPage.tsx +++ b/client/web/src/communitySearchContexts/CommunitySearchContextPage.tsx @@ -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' diff --git a/client/web/src/enterprise/code-monitoring/components/FormTriggerArea.tsx b/client/web/src/enterprise/code-monitoring/components/FormTriggerArea.tsx index 8657dd0b40c..ceef00a06f9 100644 --- a/client/web/src/enterprise/code-monitoring/components/FormTriggerArea.tsx +++ b/client/web/src/enterprise/code-monitoring/components/FormTriggerArea.tsx @@ -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' diff --git a/client/web/src/enterprise/executors/instances/ExecutorCompatibilityAlert.story.tsx b/client/web/src/enterprise/executors/instances/ExecutorCompatibilityAlert.story.tsx index 18f42635a5b..a43758dc881 100644 --- a/client/web/src/enterprise/executors/instances/ExecutorCompatibilityAlert.story.tsx +++ b/client/web/src/enterprise/executors/instances/ExecutorCompatibilityAlert.story.tsx @@ -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' diff --git a/client/web/src/enterprise/executors/instances/ExecutorsListPage.story.tsx b/client/web/src/enterprise/executors/instances/ExecutorsListPage.story.tsx index fb1e3994f6b..f9b283bb8a6 100644 --- a/client/web/src/enterprise/executors/instances/ExecutorsListPage.story.tsx +++ b/client/web/src/enterprise/executors/instances/ExecutorsListPage.story.tsx @@ -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' diff --git a/client/web/src/enterprise/executors/secrets/ExecutorSecretsListPage.story.tsx b/client/web/src/enterprise/executors/secrets/ExecutorSecretsListPage.story.tsx index 2af50b63d3d..764d579e005 100644 --- a/client/web/src/enterprise/executors/secrets/ExecutorSecretsListPage.story.tsx +++ b/client/web/src/enterprise/executors/secrets/ExecutorSecretsListPage.story.tsx @@ -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' diff --git a/client/web/src/enterprise/insights/components/form/monaco-field/MonacoField.tsx b/client/web/src/enterprise/insights/components/form/monaco-field/MonacoField.tsx index a540057384a..8c80d32af0a 100644 --- a/client/web/src/enterprise/insights/components/form/monaco-field/MonacoField.tsx +++ b/client/web/src/enterprise/insights/components/form/monaco-field/MonacoField.tsx @@ -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' diff --git a/client/web/src/enterprise/searchContexts/CreateSearchContextPage.tsx b/client/web/src/enterprise/searchContexts/CreateSearchContextPage.tsx index 19f13c65b89..d078b5a67f8 100644 --- a/client/web/src/enterprise/searchContexts/CreateSearchContextPage.tsx +++ b/client/web/src/enterprise/searchContexts/CreateSearchContextPage.tsx @@ -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' diff --git a/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.story.tsx b/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.story.tsx index 05f2ce2e7f3..1e007697e15 100644 --- a/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.story.tsx +++ b/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.story.tsx @@ -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' diff --git a/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.tsx b/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.tsx index 342d185c4bc..435147bad54 100644 --- a/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.tsx +++ b/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.tsx @@ -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' diff --git a/client/web/src/enterprise/searchContexts/EditSearchContextPage.tsx b/client/web/src/enterprise/searchContexts/EditSearchContextPage.tsx index 47995ddba12..eb0d4a9a07b 100644 --- a/client/web/src/enterprise/searchContexts/EditSearchContextPage.tsx +++ b/client/web/src/enterprise/searchContexts/EditSearchContextPage.tsx @@ -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' diff --git a/client/web/src/enterprise/searchContexts/SearchContextForm.story.tsx b/client/web/src/enterprise/searchContexts/SearchContextForm.story.tsx index 34c7f99a767..13f4263bec2 100644 --- a/client/web/src/enterprise/searchContexts/SearchContextForm.story.tsx +++ b/client/web/src/enterprise/searchContexts/SearchContextForm.story.tsx @@ -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' diff --git a/client/web/src/enterprise/searchContexts/SearchContextForm.tsx b/client/web/src/enterprise/searchContexts/SearchContextForm.tsx index 3666fbc8d36..617c9b8d6db 100644 --- a/client/web/src/enterprise/searchContexts/SearchContextForm.tsx +++ b/client/web/src/enterprise/searchContexts/SearchContextForm.tsx @@ -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 { diff --git a/client/web/src/enterprise/searchContexts/SearchContextNode.tsx b/client/web/src/enterprise/searchContexts/SearchContextNode.tsx index 5cf7c42d831..293be2c462e 100644 --- a/client/web/src/enterprise/searchContexts/SearchContextNode.tsx +++ b/client/web/src/enterprise/searchContexts/SearchContextNode.tsx @@ -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' diff --git a/client/web/src/enterprise/searchContexts/SearchContextOwnerDropdown.tsx b/client/web/src/enterprise/searchContexts/SearchContextOwnerDropdown.tsx index a1d562cdd2f..e7b9be58125 100644 --- a/client/web/src/enterprise/searchContexts/SearchContextOwnerDropdown.tsx +++ b/client/web/src/enterprise/searchContexts/SearchContextOwnerDropdown.tsx @@ -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' diff --git a/client/web/src/enterprise/searchContexts/SearchContextPage.story.tsx b/client/web/src/enterprise/searchContexts/SearchContextPage.story.tsx index b1bb53feeaf..ce25b041705 100644 --- a/client/web/src/enterprise/searchContexts/SearchContextPage.story.tsx +++ b/client/web/src/enterprise/searchContexts/SearchContextPage.story.tsx @@ -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' diff --git a/client/web/src/enterprise/searchContexts/SearchContextPage.tsx b/client/web/src/enterprise/searchContexts/SearchContextPage.tsx index a12ab849022..7778a8a98a3 100644 --- a/client/web/src/enterprise/searchContexts/SearchContextPage.tsx +++ b/client/web/src/enterprise/searchContexts/SearchContextPage.tsx @@ -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' diff --git a/client/web/src/enterprise/searchContexts/SearchContextRepositoriesFormArea.tsx b/client/web/src/enterprise/searchContexts/SearchContextRepositoriesFormArea.tsx index d72a232354d..40f94602a0e 100644 --- a/client/web/src/enterprise/searchContexts/SearchContextRepositoriesFormArea.tsx +++ b/client/web/src/enterprise/searchContexts/SearchContextRepositoriesFormArea.tsx @@ -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' diff --git a/client/web/src/enterprise/searchContexts/SearchContextsList.tsx b/client/web/src/enterprise/searchContexts/SearchContextsList.tsx index d2cc82a443d..835eb5c5620 100644 --- a/client/web/src/enterprise/searchContexts/SearchContextsList.tsx +++ b/client/web/src/enterprise/searchContexts/SearchContextsList.tsx @@ -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 { diff --git a/client/web/src/enterprise/searchContexts/SearchContextsListPage.tsx b/client/web/src/enterprise/searchContexts/SearchContextsListPage.tsx index 0c8ed467764..0d9f13f013d 100644 --- a/client/web/src/enterprise/searchContexts/SearchContextsListPage.tsx +++ b/client/web/src/enterprise/searchContexts/SearchContextsListPage.tsx @@ -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' diff --git a/client/web/src/integration/code-monitoring.test.ts b/client/web/src/integration/code-monitoring.test.ts index b6bbc547fa1..dee8be65f4e 100644 --- a/client/web/src/integration/code-monitoring.test.ts +++ b/client/web/src/integration/code-monitoring.test.ts @@ -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' diff --git a/client/web/src/integration/context.ts b/client/web/src/integration/context.ts index dbc619c9832..e32d2ede0f0 100644 --- a/client/web/src/integration/context.ts +++ b/client/web/src/integration/context.ts @@ -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) > { /** diff --git a/client/web/src/integration/graphQlResults.ts b/client/web/src/integration/graphQlResults.ts index a12783ffc11..a1e5979fe95 100644 --- a/client/web/src/integration/graphQlResults.ts +++ b/client/web/src/integration/graphQlResults.ts @@ -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 = { ...sharedGraphQlResults, CurrentAuthState: () => ({ currentUser: { diff --git a/client/web/src/integration/nav.test.ts b/client/web/src/integration/nav.test.ts index 04b3cde3de8..d81ffaace20 100644 --- a/client/web/src/integration/nav.test.ts +++ b/client/web/src/integration/nav.test.ts @@ -3,8 +3,8 @@ import expect from 'expect' import { test } from 'mocha' import { encodeURIPathComponent } from '@sourcegraph/common' -import { mixedSearchStreamEvents, SearchGraphQlOperations } from '@sourcegraph/search' import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations' +import { mixedSearchStreamEvents } from '@sourcegraph/shared/src/search/integration' import { Driver, createDriverForTest } from '@sourcegraph/shared/src/testing/driver' import { afterEachSaveScreenshotIfFailed } from '@sourcegraph/shared/src/testing/screenshotReporter' @@ -21,7 +21,7 @@ import { import { commonWebGraphQlResults } from './graphQlResults' import { createEditorAPI } from './utils' -const commonSearchGraphQLResults: Partial = { +const commonSearchGraphQLResults: Partial = { ...commonWebGraphQlResults, FileNames: () => createFileNamesResult(), ResolveRepoRev: () => createResolveRepoRevisionResult('/github.com/sourcegraph/sourcegraph'), diff --git a/client/web/src/integration/notebook.test.ts b/client/web/src/integration/notebook.test.ts index 837c267cfeb..e3bf993c34d 100644 --- a/client/web/src/integration/notebook.test.ts +++ b/client/web/src/integration/notebook.test.ts @@ -4,8 +4,8 @@ import path from 'path' import { subDays } from 'date-fns' import expect from 'expect' -import { highlightFileResult, mixedSearchStreamEvents } from '@sourcegraph/search' import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations' +import { highlightFileResult, mixedSearchStreamEvents } from '@sourcegraph/shared/src/search/integration' import { SearchEvent } from '@sourcegraph/shared/src/search/stream' import { accessibilityAudit } from '@sourcegraph/shared/src/testing/accessibility' import { Driver, createDriverForTest } from '@sourcegraph/shared/src/testing/driver' diff --git a/client/web/src/integration/search-aggregation.test.ts b/client/web/src/integration/search-aggregation.test.ts index 9a16573e787..a2378df9f87 100644 --- a/client/web/src/integration/search-aggregation.test.ts +++ b/client/web/src/integration/search-aggregation.test.ts @@ -2,13 +2,12 @@ import delay from 'delay' import expect from 'expect' import { test } from 'mocha' -import { SearchAggregationMode, SearchGraphQlOperations } from '@sourcegraph/search' import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations' import { SearchEvent } from '@sourcegraph/shared/src/search/stream' import { createDriverForTest, Driver } from '@sourcegraph/shared/src/testing/driver' import { afterEachSaveScreenshotIfFailed } from '@sourcegraph/shared/src/testing/screenshotReporter' -import { GetSearchAggregationResult, WebGraphQlOperations } from '../graphql-operations' +import { GetSearchAggregationResult, WebGraphQlOperations, SearchAggregationMode } from '../graphql-operations' import { createWebIntegrationTestContext, WebIntegrationTestContext } from './context' import { commonWebGraphQlResults } from './graphQlResults' @@ -108,7 +107,7 @@ const mockDefaultStreamEvents: SearchEvent[] = [ { type: 'done', data: {} }, ] -const commonSearchGraphQLResults: Partial = { +const commonSearchGraphQLResults: Partial = { ...commonWebGraphQlResults, IsSearchContextAvailable: () => ({ isSearchContextAvailable: true }), UserAreaUserProfile: () => ({ diff --git a/client/web/src/integration/search-contexts.test.ts b/client/web/src/integration/search-contexts.test.ts index d5da9814eb1..1f41cdf3424 100644 --- a/client/web/src/integration/search-contexts.test.ts +++ b/client/web/src/integration/search-contexts.test.ts @@ -3,8 +3,8 @@ import expect from 'expect' import { range } from 'lodash' import { test } from 'mocha' -import { highlightFileResult, mixedSearchStreamEvents, SearchContextMinimalFields } from '@sourcegraph/search' -import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations' +import { SharedGraphQlOperations, SearchContextMinimalFields } from '@sourcegraph/shared/src/graphql-operations' +import { highlightFileResult, 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' diff --git a/client/web/src/integration/search.test.ts b/client/web/src/integration/search.test.ts index 1f7c4fbf5f7..e70d7b35f5f 100644 --- a/client/web/src/integration/search.test.ts +++ b/client/web/src/integration/search.test.ts @@ -2,8 +2,8 @@ import expect from 'expect' import { test } from 'mocha' import { Key } from 'ts-key-enum' +import { SharedGraphQlOperations, SymbolKind } from '@sourcegraph/shared/src/graphql-operations' import { - SearchGraphQlOperations, commitHighlightResult, commitSearchStreamEvents, diffSearchStreamEvents, @@ -11,8 +11,7 @@ import { mixedSearchStreamEvents, highlightFileResult, symbolSearchStreamEvents, -} from '@sourcegraph/search' -import { SharedGraphQlOperations, SymbolKind } from '@sourcegraph/shared/src/graphql-operations' +} from '@sourcegraph/shared/src/search/integration' import { SearchEvent } from '@sourcegraph/shared/src/search/stream' import { accessibilityAudit } from '@sourcegraph/shared/src/testing/accessibility' import { Driver, createDriverForTest } from '@sourcegraph/shared/src/testing/driver' @@ -55,16 +54,14 @@ const mockDefaultStreamEvents: SearchEvent[] = [ { type: 'done', data: {} }, ] -const commonSearchGraphQLResults: Partial = { +const commonSearchGraphQLResults: Partial = { ...commonWebGraphQlResults, IsSearchContextAvailable: () => ({ isSearchContextAvailable: true, }), } -const commonSearchGraphQLResultsWithUser: Partial< - WebGraphQlOperations & SharedGraphQlOperations & SearchGraphQlOperations -> = { +const commonSearchGraphQLResultsWithUser: Partial = { ...commonSearchGraphQLResults, UserAreaUserProfile: () => ({ user: { diff --git a/client/web/src/integration/utils.ts b/client/web/src/integration/utils.ts index de39262ebcf..60aa5d89ea4 100644 --- a/client/web/src/integration/utils.ts +++ b/client/web/src/integration/utils.ts @@ -1,7 +1,6 @@ import { EditorView } from '@codemirror/view' import { Page } from 'puppeteer' -import { SearchGraphQlOperations } from '@sourcegraph/search' import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations' import { Settings, SettingsExperimentalFeatures } from '@sourcegraph/shared/src/schema/settings.schema' import { Driver, percySnapshot } from '@sourcegraph/shared/src/testing/driver' @@ -9,9 +8,11 @@ import { readEnvironmentBoolean } from '@sourcegraph/shared/src/testing/utils' import { WebGraphQlOperations } from '../graphql-operations' -const CODE_HIGHLIGHTING_QUERIES: Partial< - keyof (WebGraphQlOperations & SharedGraphQlOperations & SearchGraphQlOperations) ->[] = ['highlightCode', 'Blob', 'HighlightedFile'] +const CODE_HIGHLIGHTING_QUERIES: Partial[] = [ + 'highlightCode', + 'Blob', + 'HighlightedFile', +] /** * Matches a URL against an expected query that will handle code highlighting. diff --git a/client/web/src/nav/GlobalNavbar.tsx b/client/web/src/nav/GlobalNavbar.tsx index 3f19573bc76..bdc27a98299 100644 --- a/client/web/src/nav/GlobalNavbar.tsx +++ b/client/web/src/nav/GlobalNavbar.tsx @@ -8,11 +8,11 @@ import MagnifyIcon from 'mdi-react/MagnifyIcon' import { ContributableMenu } from '@sourcegraph/client-api' import { isErrorLike, isMacPlatform } from '@sourcegraph/common' -import { SearchContextInputProps } from '@sourcegraph/search' import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller' import { shortcutDisplayName } from '@sourcegraph/shared/src/keyboardShortcuts' import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context' import { Settings } from '@sourcegraph/shared/src/schema/settings.schema' +import { SearchContextInputProps } from '@sourcegraph/shared/src/search' import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' import { ThemeProps } from '@sourcegraph/shared/src/theme' diff --git a/client/web/src/notebooks/blocks/query/NotebookQueryBlock.tsx b/client/web/src/notebooks/blocks/query/NotebookQueryBlock.tsx index 76b9be23cd1..432c84db770 100644 --- a/client/web/src/notebooks/blocks/query/NotebookQueryBlock.tsx +++ b/client/web/src/notebooks/blocks/query/NotebookQueryBlock.tsx @@ -5,7 +5,6 @@ import { mdiPlayCircleOutline, mdiOpenInNew, mdiMagnify } from '@mdi/js' import classNames from 'classnames' import { Observable, of } from 'rxjs' -import { SearchContextProps } from '@sourcegraph/search' import { StreamingSearchResultsList, CodeMirrorQueryInput, @@ -15,6 +14,7 @@ import { import { FetchFileParameters } from '@sourcegraph/shared/src/backend/file' import { editorHeight } from '@sourcegraph/shared/src/components/CodeMirrorEditor' import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context' +import { SearchContextProps } from '@sourcegraph/shared/src/search' import { fetchStreamSuggestions } from '@sourcegraph/shared/src/search/suggestions' import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' diff --git a/client/web/src/notebooks/blocks/suggestions/SearchTypeSuggestionsInput.tsx b/client/web/src/notebooks/blocks/suggestions/SearchTypeSuggestionsInput.tsx index 7aa81c0838e..0e40c54eacf 100644 --- a/client/web/src/notebooks/blocks/suggestions/SearchTypeSuggestionsInput.tsx +++ b/client/web/src/notebooks/blocks/suggestions/SearchTypeSuggestionsInput.tsx @@ -6,14 +6,15 @@ import { Observable, of } from 'rxjs' import { delay, startWith } from 'rxjs/operators' import { pluralize } from '@sourcegraph/common' -import { createQueryExampleFromString, SearchPatternType, updateQueryWithFilterAndExample } from '@sourcegraph/search' import { CodeMirrorQueryInput, SyntaxHighlightedSearchQuery, singleLine, changeListener } from '@sourcegraph/search-ui' +import { createQueryExampleFromString, updateQueryWithFilterAndExample } from '@sourcegraph/shared/src/search' import { FilterType } from '@sourcegraph/shared/src/search/query/filters' import { PathMatch, SymbolMatch } from '@sourcegraph/shared/src/search/stream' import { ThemeProps } from '@sourcegraph/shared/src/theme' import { Button, Label, useObservable } from '@sourcegraph/wildcard' import { BlockProps } from '../..' +import { SearchPatternType } from '../../../graphql-operations' import { blockKeymap, focusEditor } from '../../codemirror-utils' import styles from './SearchTypeSuggestionsInput.module.scss' diff --git a/client/web/src/repo/RepoContainer.tsx b/client/web/src/repo/RepoContainer.tsx index 19f0910c3f0..3991e6b870e 100644 --- a/client/web/src/repo/RepoContainer.tsx +++ b/client/web/src/repo/RepoContainer.tsx @@ -10,13 +10,13 @@ import { NEVER, of } from 'rxjs' import { catchError, switchMap } from 'rxjs/operators' import { asError, encodeURIPathComponent, ErrorLike, isErrorLike, logger, repeatUntil } from '@sourcegraph/common' -import { SearchContextProps } from '@sourcegraph/search' import { StreamingSearchResultsListProps } from '@sourcegraph/search-ui' import { isCloneInProgressErrorLike, isRepoSeeOtherErrorLike } from '@sourcegraph/shared/src/backend/errors' 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 { Settings } from '@sourcegraph/shared/src/schema/settings.schema' +import { SearchContextProps } from '@sourcegraph/shared/src/search' import { escapeSpaces } from '@sourcegraph/shared/src/search/query/filters' import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' diff --git a/client/web/src/repo/RepoRevisionContainer.tsx b/client/web/src/repo/RepoRevisionContainer.tsx index aa51e813c19..bd60df361ed 100644 --- a/client/web/src/repo/RepoRevisionContainer.tsx +++ b/client/web/src/repo/RepoRevisionContainer.tsx @@ -4,10 +4,10 @@ import * as H from 'history' import { Route, RouteComponentProps, Switch } from 'react-router' import { isErrorLike } from '@sourcegraph/common' -import { SearchContextProps } from '@sourcegraph/search' import { StreamingSearchResultsListProps, CopyPathAction } from '@sourcegraph/search-ui' import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller' import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context' +import { SearchContextProps } from '@sourcegraph/shared/src/search' import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' import { ThemeProps } from '@sourcegraph/shared/src/theme' diff --git a/client/web/src/repo/blob/BlobPage.tsx b/client/web/src/repo/blob/BlobPage.tsx index a5d1e31ff28..9062c228e76 100644 --- a/client/web/src/repo/blob/BlobPage.tsx +++ b/client/web/src/repo/blob/BlobPage.tsx @@ -17,12 +17,12 @@ import { createActiveSpan, reactManualTracer, } from '@sourcegraph/observability-client' -import { SearchContextProps } from '@sourcegraph/search' import { StreamingSearchResultsListProps } from '@sourcegraph/search-ui' import { FetchFileParameters } from '@sourcegraph/shared/src/backend/file' import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller' import { HighlightResponseFormat } from '@sourcegraph/shared/src/graphql-operations' import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context' +import { SearchContextProps } from '@sourcegraph/shared/src/search' import { isSettingsValid, SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' import { ThemeProps } from '@sourcegraph/shared/src/theme' diff --git a/client/web/src/repo/tree/TreePage.tsx b/client/web/src/repo/tree/TreePage.tsx index 698fa83364c..b4d6738718b 100644 --- a/client/web/src/repo/tree/TreePage.tsx +++ b/client/web/src/repo/tree/TreePage.tsx @@ -8,13 +8,13 @@ import { catchError } from 'rxjs/operators' import { asError, encodeURIPathComponent, ErrorLike, isErrorLike, logger } from '@sourcegraph/common' import { gql } from '@sourcegraph/http-client' -import { SearchContextProps } from '@sourcegraph/search' import { fetchTreeEntries } from '@sourcegraph/shared/src/backend/repo' import { displayRepoName } from '@sourcegraph/shared/src/components/RepoLink' import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller' import { TreeFields } from '@sourcegraph/shared/src/graphql-operations' import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context' import { Settings } from '@sourcegraph/shared/src/schema/settings.schema' +import { SearchContextProps } from '@sourcegraph/shared/src/search' import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' import { ThemeProps } from '@sourcegraph/shared/src/theme' diff --git a/client/web/src/savedSearches/SavedSearchForm.tsx b/client/web/src/savedSearches/SavedSearchForm.tsx index 7a15bea7027..e4202c92acb 100644 --- a/client/web/src/savedSearches/SavedSearchForm.tsx +++ b/client/web/src/savedSearches/SavedSearchForm.tsx @@ -3,8 +3,8 @@ import React, { useEffect, useMemo, useState } from 'react' import classNames from 'classnames' import { Omit } from 'utility-types' -import { QueryState, SearchPatternType } from '@sourcegraph/search' import { LazyMonacoQueryInput } from '@sourcegraph/search-ui' +import { QueryState } from '@sourcegraph/shared/src/search' import { ThemeProps } from '@sourcegraph/shared/src/theme' import { Container, @@ -23,7 +23,7 @@ import { import { AuthenticatedUser } from '../auth' import { PageTitle } from '../components/PageTitle' -import { Scalars } from '../graphql-operations' +import { Scalars, SearchPatternType } from '../graphql-operations' import { NamespaceProps } from '../namespaces' import { useExperimentalFeatures } from '../stores' diff --git a/client/web/src/savedSearches/SavedSearchListPage.tsx b/client/web/src/savedSearches/SavedSearchListPage.tsx index 32d83091fd9..258737c0f4f 100644 --- a/client/web/src/savedSearches/SavedSearchListPage.tsx +++ b/client/web/src/savedSearches/SavedSearchListPage.tsx @@ -9,7 +9,7 @@ import { catchError, map, mapTo, startWith, switchMap } from 'rxjs/operators' import { useCallbackRef } from 'use-callback-ref' import { asError, ErrorLike, isErrorLike, logger } from '@sourcegraph/common' -import { SearchPatternTypeProps } from '@sourcegraph/search' +import { SearchPatternTypeProps } from '@sourcegraph/shared/src/search' import { buildSearchURLQuery } from '@sourcegraph/shared/src/util/url' import { Container, PageHeader, LoadingSpinner, Button, Link, Icon, Tooltip, ErrorAlert } from '@sourcegraph/wildcard' diff --git a/client/web/src/savedSearches/SavedSearchModal.tsx b/client/web/src/savedSearches/SavedSearchModal.tsx index 561b863ef42..3fc3f81b7e4 100644 --- a/client/web/src/savedSearches/SavedSearchModal.tsx +++ b/client/web/src/savedSearches/SavedSearchModal.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import classNames from 'classnames' import * as H from 'history' -import { SearchPatternTypeProps } from '@sourcegraph/search' +import { SearchPatternTypeProps } from '@sourcegraph/shared/src/search' import { Button, Modal, Select, H3, Form } from '@sourcegraph/wildcard' import { AuthenticatedUser } from '../auth' diff --git a/client/web/src/search/helpers.tsx b/client/web/src/search/helpers.tsx index 867ed042965..e1a5a678512 100644 --- a/client/web/src/search/helpers.tsx +++ b/client/web/src/search/helpers.tsx @@ -1,4 +1,4 @@ -import { SubmitSearchParameters } from '@sourcegraph/search' +import { SubmitSearchParameters } from '@sourcegraph/shared/src/search' import { appendContextFilter } from '@sourcegraph/shared/src/search/query/transformer' import { buildSearchURLQuery } from '@sourcegraph/shared/src/util/url' diff --git a/client/web/src/search/home/QueryExamplesHomepage.tsx b/client/web/src/search/home/QueryExamplesHomepage.tsx index f422c2835bd..5a1181f2ce4 100644 --- a/client/web/src/search/home/QueryExamplesHomepage.tsx +++ b/client/web/src/search/home/QueryExamplesHomepage.tsx @@ -4,12 +4,13 @@ import { mdiOpenInNew } from '@mdi/js' import classNames from 'classnames' import { useHistory } from 'react-router' -import { EditorHint, QueryState, SearchPatternType } from '@sourcegraph/search' import { SyntaxHighlightedSearchQuery } from '@sourcegraph/search-ui' +import { EditorHint, QueryState } from '@sourcegraph/shared/src/search' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' import { Button, H2, Link, Icon, Tabs, TabList, TabPanels, TabPanel, Tab } from '@sourcegraph/wildcard' import { CloudCtaBanner } from '../../components/CloudCtaBanner' +import { SearchPatternType } from '../../graphql-operations' import { exampleQueryColumns } from './QueryExamplesHomepage.constants' import { useQueryExamples, QueryExamplesSection } from './useQueryExamples' diff --git a/client/web/src/search/home/SearchPage.tsx b/client/web/src/search/home/SearchPage.tsx index c58efdecc25..d5064c1afb8 100644 --- a/client/web/src/search/home/SearchPage.tsx +++ b/client/web/src/search/home/SearchPage.tsx @@ -3,10 +3,10 @@ import React, { useEffect, useState } from 'react' import classNames from 'classnames' import * as H from 'history' -import { QueryState, SearchContextInputProps } from '@sourcegraph/search' import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller' import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context' import { Settings } from '@sourcegraph/shared/src/schema/settings.schema' +import { QueryState, SearchContextInputProps } from '@sourcegraph/shared/src/search' import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' import { ThemeProps } from '@sourcegraph/shared/src/theme' diff --git a/client/web/src/search/home/SearchPageInput.tsx b/client/web/src/search/home/SearchPageInput.tsx index ebd1161a24a..33a77a8281a 100644 --- a/client/web/src/search/home/SearchPageInput.tsx +++ b/client/web/src/search/home/SearchPageInput.tsx @@ -5,6 +5,12 @@ import { NavbarQueryState } from 'src/stores/navbarSearchQueryState' import shallow from 'zustand/shallow' import { TraceSpanProvider } from '@sourcegraph/observability-client' +import { SearchBox } from '@sourcegraph/search-ui' +// The experimental search input should be shown on the search home page +// eslint-disable-next-line no-restricted-imports +import { LazyCodeMirrorQueryInput } from '@sourcegraph/search-ui/src/experimental' +import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context' +import { Settings } from '@sourcegraph/shared/src/schema/settings.schema' import { SearchContextInputProps, CaseSensitivityProps, @@ -13,13 +19,7 @@ import { canSubmitSearch, QueryState, SearchModeProps, -} from '@sourcegraph/search' -import { SearchBox } from '@sourcegraph/search-ui' -// The experimental search input should be shown on the search home page -// eslint-disable-next-line no-restricted-imports -import { LazyCodeMirrorQueryInput } from '@sourcegraph/search-ui/src/experimental' -import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context' -import { Settings } from '@sourcegraph/shared/src/schema/settings.schema' +} from '@sourcegraph/shared/src/search' import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' import { ThemeProps } from '@sourcegraph/shared/src/theme' diff --git a/client/web/src/search/index.test.ts b/client/web/src/search/index.test.ts index e930a241abd..821aa3c2cd1 100644 --- a/client/web/src/search/index.test.ts +++ b/client/web/src/search/index.test.ts @@ -3,7 +3,7 @@ import { of, Subscription, Observable } from 'rxjs' import { first, startWith, tap, last } from 'rxjs/operators' import { resetAllMemoizationCaches } from '@sourcegraph/common' -import { SearchMode } from '@sourcegraph/search' +import { SearchMode } from '@sourcegraph/shared/src/search' import { SearchPatternType } from '../graphql-operations' import { observeLocation } from '../util/location' diff --git a/client/web/src/search/index.tsx b/client/web/src/search/index.tsx index 137f13763bd..d1aed957975 100644 --- a/client/web/src/search/index.tsx +++ b/client/web/src/search/index.tsx @@ -4,8 +4,8 @@ import { combineLatest, from, Observable, of } from 'rxjs' import { startWith, switchMap, map, distinctUntilChanged } from 'rxjs/operators' import { memoizeObservable } from '@sourcegraph/common' -import { SearchMode } from '@sourcegraph/search' import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations' +import { SearchMode } from '@sourcegraph/shared/src/search' import { discreteValueAliases, escapeSpaces } from '@sourcegraph/shared/src/search/query/filters' import { stringHuman } from '@sourcegraph/shared/src/search/query/printer' import { findFilter, FilterKind, getGlobalSearchContextFilter } from '@sourcegraph/shared/src/search/query/query' diff --git a/client/web/src/search/input/SearchNavbarItem.tsx b/client/web/src/search/input/SearchNavbarItem.tsx index 2f14eb4421a..71589a86320 100644 --- a/client/web/src/search/input/SearchNavbarItem.tsx +++ b/client/web/src/search/input/SearchNavbarItem.tsx @@ -3,9 +3,9 @@ import React, { useCallback } from 'react' import * as H from 'history' import shallow from 'zustand/shallow' -import { SearchContextInputProps, SubmitSearchParameters } from '@sourcegraph/search' import { SearchBox } from '@sourcegraph/search-ui' import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context' +import { SearchContextInputProps, SubmitSearchParameters } from '@sourcegraph/shared/src/search' import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' import { ThemeProps } from '@sourcegraph/shared/src/theme' diff --git a/client/web/src/search/results/SearchActionsMenu.tsx b/client/web/src/search/results/SearchActionsMenu.tsx index 88022ac9a6a..5f8857bd5ca 100644 --- a/client/web/src/search/results/SearchActionsMenu.tsx +++ b/client/web/src/search/results/SearchActionsMenu.tsx @@ -3,8 +3,8 @@ import React, { useCallback } from 'react' import { mdiArrowCollapseUp, mdiArrowExpandDown, mdiBookmarkOutline, mdiDotsHorizontal, mdiDownload } from '@mdi/js' import classNames from 'classnames' -import { SearchPatternTypeProps } from '@sourcegraph/search' import { PlatformContext } from '@sourcegraph/shared/src/platform/context' +import { SearchPatternTypeProps } from '@sourcegraph/shared/src/search' import { AggregateStreamingSearchResults } from '@sourcegraph/shared/src/search/stream' import { Position, diff --git a/client/web/src/search/results/SearchResultsInfoBar.tsx b/client/web/src/search/results/SearchResultsInfoBar.tsx index 270d954962d..d28655f09c7 100644 --- a/client/web/src/search/results/SearchResultsInfoBar.tsx +++ b/client/web/src/search/results/SearchResultsInfoBar.tsx @@ -5,11 +5,11 @@ import classNames from 'classnames' import * as H from 'history' import { ContributableMenu } from '@sourcegraph/client-api' -import { SearchPatternTypeProps, CaseSensitivityProps } from '@sourcegraph/search' import { ActionItem } from '@sourcegraph/shared/src/actions/ActionItem' import { ActionsContainer } from '@sourcegraph/shared/src/actions/ActionsContainer' import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller' import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context' +import { SearchPatternTypeProps, CaseSensitivityProps } from '@sourcegraph/shared/src/search' import { FilterKind, findFilter } from '@sourcegraph/shared/src/search/query/query' import { AggregateStreamingSearchResults } from '@sourcegraph/shared/src/search/stream' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' diff --git a/client/web/src/search/results/StreamingSearchResults.story.tsx b/client/web/src/search/results/StreamingSearchResults.story.tsx index 218fd18271d..37ffa74c40f 100644 --- a/client/web/src/search/results/StreamingSearchResults.story.tsx +++ b/client/web/src/search/results/StreamingSearchResults.story.tsx @@ -2,7 +2,7 @@ import { DecoratorFn, Meta, Story } from '@storybook/react' import { createBrowserHistory } from 'history' import { EMPTY, NEVER, of } from 'rxjs' -import { SearchQueryStateStoreProvider } from '@sourcegraph/search' +import { SearchQueryStateStoreProvider } from '@sourcegraph/shared/src/search' import { AggregateStreamingSearchResults } from '@sourcegraph/shared/src/search/stream' import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService' import { diff --git a/client/web/src/search/results/StreamingSearchResults.test.tsx b/client/web/src/search/results/StreamingSearchResults.test.tsx index 7c8630c8630..41fa4a0bf5b 100644 --- a/client/web/src/search/results/StreamingSearchResults.test.tsx +++ b/client/web/src/search/results/StreamingSearchResults.test.tsx @@ -8,8 +8,8 @@ import { CompatRouter } from 'react-router-dom-v5-compat' import { EMPTY, NEVER, of } from 'rxjs' import sinon from 'sinon' -import { SearchMode, SearchQueryStateStoreProvider } from '@sourcegraph/search' import { GitRefType, SearchPatternType } from '@sourcegraph/shared/src/graphql-operations' +import { SearchMode, SearchQueryStateStoreProvider } from '@sourcegraph/shared/src/search' import { AggregateStreamingSearchResults, Skipped } from '@sourcegraph/shared/src/search/stream' import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService' import { MockedTestProvider } from '@sourcegraph/shared/src/testing/apollo' diff --git a/client/web/src/search/results/StreamingSearchResults.tsx b/client/web/src/search/results/StreamingSearchResults.tsx index 59d94630a7b..09f12a2853f 100644 --- a/client/web/src/search/results/StreamingSearchResults.tsx +++ b/client/web/src/search/results/StreamingSearchResults.tsx @@ -6,13 +6,13 @@ import { useHistory } from 'react-router' import { Observable } from 'rxjs' import { asError } from '@sourcegraph/common' -import { QueryUpdate, SearchContextProps } from '@sourcegraph/search' import { limitHit, StreamingProgress, StreamingSearchResultsList } from '@sourcegraph/search-ui' import { FetchFileParameters } from '@sourcegraph/shared/src/backend/file' import { FilePrefetcher } from '@sourcegraph/shared/src/components/PrefetchableFile' import { ExtensionsControllerProps } from '@sourcegraph/shared/src/extensions/controller' import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations' import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context' +import { QueryUpdate, SearchContextProps } from '@sourcegraph/shared/src/search' import { collectMetrics } from '@sourcegraph/shared/src/search/query/metrics' import { sanitizeQueryForTelemetry, updateFilters } from '@sourcegraph/shared/src/search/query/transformer' import { LATEST_VERSION, StreamSearchOptions } from '@sourcegraph/shared/src/search/stream' diff --git a/client/web/src/search/results/components/aggregation/SearchAggregationResult.tsx b/client/web/src/search/results/components/aggregation/SearchAggregationResult.tsx index 5d79b8d52e3..100f03cd583 100644 --- a/client/web/src/search/results/components/aggregation/SearchAggregationResult.tsx +++ b/client/web/src/search/results/components/aggregation/SearchAggregationResult.tsx @@ -2,10 +2,11 @@ import { FC, HTMLAttributes, useEffect, useState } from 'react' import { mdiArrowCollapse } from '@mdi/js' -import { SearchAggregationMode, SearchPatternType } from '@sourcegraph/search' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' import { Button, H2, Icon, Code, Card, CardBody } from '@sourcegraph/wildcard' +import { SearchAggregationMode, SearchPatternType } from '../../../../graphql-operations' + import { AggregationLimitLabel, AggregationModeControls } from './components' import { AggregationChartCard, getAggregationData } from './components/aggregation-chart-card/AggregationChartCard' import { diff --git a/client/web/src/search/results/createActions.ts b/client/web/src/search/results/createActions.ts index 1a4ff142756..571caebf7b6 100644 --- a/client/web/src/search/results/createActions.ts +++ b/client/web/src/search/results/createActions.ts @@ -1,6 +1,5 @@ import { mdiMagnify } from '@mdi/js' -import { SearchPatternType } from '@sourcegraph/search' import { FilterType } from '@sourcegraph/shared/src/search/query/filters' import { FilterKind, findFilter } from '@sourcegraph/shared/src/search/query/query' import { omitFilter } from '@sourcegraph/shared/src/search/query/transformer' @@ -9,6 +8,7 @@ import { IconType } from '@sourcegraph/wildcard' import { AuthenticatedUser } from '../../auth' import { BatchChangesIcon } from '../../batches/icons' import { CodeMonitoringLogo } from '../../code-monitoring/CodeMonitoringLogo' +import { SearchPatternType } from '../../graphql-operations' import { CodeInsightsIcon } from '../../insights/Icons' export interface CreateAction { diff --git a/client/web/src/search/results/sidebar/SearchAggregations.tsx b/client/web/src/search/results/sidebar/SearchAggregations.tsx index c8048a97dd4..ae021a509f1 100644 --- a/client/web/src/search/results/sidebar/SearchAggregations.tsx +++ b/client/web/src/search/results/sidebar/SearchAggregations.tsx @@ -2,10 +2,10 @@ import { FC, useEffect, useState, memo } from 'react' import { mdiArrowExpand } from '@mdi/js' -import { SearchAggregationMode, SearchPatternType } from '@sourcegraph/search' import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' import { Button, Icon } from '@sourcegraph/wildcard' +import { SearchAggregationMode, SearchPatternType } from '../../../graphql-operations' import { AggregationChartCard, AggregationModeControls, diff --git a/client/web/src/search/results/sidebar/SearchFiltersSidebar.story.tsx b/client/web/src/search/results/sidebar/SearchFiltersSidebar.story.tsx index ed6ffc6f188..17104da795c 100644 --- a/client/web/src/search/results/sidebar/SearchFiltersSidebar.story.tsx +++ b/client/web/src/search/results/sidebar/SearchFiltersSidebar.story.tsx @@ -1,12 +1,12 @@ import { Meta, Story } from '@storybook/react' -import { SearchPatternType } from '@sourcegraph/search' import { QuickLink, SearchScope } from '@sourcegraph/shared/src/schema/settings.schema' import { Filter } from '@sourcegraph/shared/src/search/stream' import { EMPTY_SETTINGS_CASCADE } from '@sourcegraph/shared/src/settings/settings' import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService' import { WebStory } from '../../../components/WebStory' +import { SearchPatternType } from '../../../graphql-operations' import { SearchFiltersSidebar, SearchFiltersSidebarProps } from './SearchFiltersSidebar' diff --git a/client/web/src/search/results/sidebar/SearchFiltersSidebar.tsx b/client/web/src/search/results/sidebar/SearchFiltersSidebar.tsx index 3d8f027448a..f770727abb4 100644 --- a/client/web/src/search/results/sidebar/SearchFiltersSidebar.tsx +++ b/client/web/src/search/results/sidebar/SearchFiltersSidebar.tsx @@ -2,7 +2,6 @@ import { FC, ReactNode, ReactElement, useCallback, useMemo, HTMLAttributes, memo import { mdiInformationOutline } from '@mdi/js' -import { QueryStateUpdate, QueryUpdate, SearchPatternType } from '@sourcegraph/search' import { SearchSidebar, SearchSidebarSection, @@ -14,6 +13,7 @@ import { getFiltersOfKind, useLastRepoName, } from '@sourcegraph/search-ui' +import { QueryStateUpdate, QueryUpdate } from '@sourcegraph/shared/src/search' import { FilterType } from '@sourcegraph/shared/src/search/query/filters' import { Filter } from '@sourcegraph/shared/src/search/stream' import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings' @@ -21,6 +21,7 @@ import { SectionID } from '@sourcegraph/shared/src/settings/temporary/searchSide import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService' import { Code, Tooltip, Icon } from '@sourcegraph/wildcard' +import { SearchPatternType } from '../../../graphql-operations' import { buildSearchURLQueryFromQueryState, useExperimentalFeatures } from '../../../stores' import { AggregationUIMode, GroupResultsPing } from '../components/aggregation' diff --git a/client/web/src/search/suggestion/DidYouMean.tsx b/client/web/src/search/suggestion/DidYouMean.tsx index ad516ef7292..75e0de4b57f 100644 --- a/client/web/src/search/suggestion/DidYouMean.tsx +++ b/client/web/src/search/suggestion/DidYouMean.tsx @@ -2,9 +2,9 @@ import React, { useEffect, useMemo } from 'react' import { mdiArrowRight } from '@mdi/js' -import { CaseSensitivityProps, SearchPatternTypeProps, SearchContextProps } from '@sourcegraph/search' import { SyntaxHighlightedSearchQuery } from '@sourcegraph/search-ui' import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations' +import { CaseSensitivityProps, SearchPatternTypeProps, SearchContextProps } from '@sourcegraph/shared/src/search' import { ALL_LANGUAGES } from '@sourcegraph/shared/src/search/query/languageFilter' import { stringHuman } from '@sourcegraph/shared/src/search/query/printer' import { scanSearchQuery } from '@sourcegraph/shared/src/search/query/scanner' diff --git a/client/web/src/stores/navbarSearchQueryState.ts b/client/web/src/stores/navbarSearchQueryState.ts index 4ddb1a60aa8..86adbb27f8d 100644 --- a/client/web/src/stores/navbarSearchQueryState.ts +++ b/client/web/src/stores/navbarSearchQueryState.ts @@ -11,12 +11,12 @@ import { SearchQueryState, updateQuery, InitialParametersSource, - SearchPatternType, SearchMode, -} from '@sourcegraph/search' +} from '@sourcegraph/shared/src/search' import { Settings, SettingsCascadeOrError } from '@sourcegraph/shared/src/settings/settings' import { buildSearchURLQuery } from '@sourcegraph/shared/src/util/url' +import { SearchPatternType } from '../graphql-operations' import { ParsedSearchURL } from '../search' import { submitSearch } from '../search/helpers' import { diff --git a/client/web/src/util/settings.ts b/client/web/src/util/settings.ts index d11a7c225fb..9a33e317aee 100644 --- a/client/web/src/util/settings.ts +++ b/client/web/src/util/settings.ts @@ -1,6 +1,6 @@ import { isErrorLike } from '@sourcegraph/common' -import { SearchMode } from '@sourcegraph/search' import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations' +import { SearchMode } from '@sourcegraph/shared/src/search' import { SettingsCascadeOrError, SettingsSubjectCommonFields } from '@sourcegraph/shared/src/settings/settings' import { AuthenticatedUser } from '../auth' diff --git a/client/web/tsconfig.json b/client/web/tsconfig.json index 474f979b0c3..c8212b1e6e0 100644 --- a/client/web/tsconfig.json +++ b/client/web/tsconfig.json @@ -18,7 +18,6 @@ { "path": "../http-client" }, { "path": "../codeintellify" }, { "path": "../common" }, - { "path": "../search" }, { "path": "../search-ui" }, { "path": "../client-api" }, { "path": "../observability-client" }, diff --git a/dev/foreach-ts-project.sh b/dev/foreach-ts-project.sh index 04c23a91b4b..5d2f21bf7b5 100755 --- a/dev/foreach-ts-project.sh +++ b/dev/foreach-ts-project.sh @@ -24,7 +24,6 @@ DIRS=( client/jetbrains client/observability-client client/observability-server - client/search client/search-ui client/shared client/storybook diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ef5bf48d2fa..7637efce057 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -813,9 +813,6 @@ importers: client/observability-server: specifiers: {} - client/search: - specifiers: {} - client/search-ui: specifiers: {} diff --git a/tsconfig.all.json b/tsconfig.all.json index 2b689ac63cc..a70fe70b039 100644 --- a/tsconfig.all.json +++ b/tsconfig.all.json @@ -18,7 +18,6 @@ { "path": "client/extension-api" }, { "path": "client/extension-api-types" }, { "path": "client/storybook" }, - { "path": "client/search" }, { "path": "client/search-ui" }, { "path": "client/testing" }, { "path": "dev/release" }, diff --git a/yarn.lock b/yarn.lock index 29a317aedec..81b59611349 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5472,12 +5472,6 @@ __metadata: languageName: unknown linkType: soft -"@sourcegraph/search@workspace:client/search": - version: 0.0.0-use.local - resolution: "@sourcegraph/search@workspace:client/search" - languageName: unknown - linkType: soft - "@sourcegraph/shared@workspace:client/shared": version: 0.0.0-use.local resolution: "@sourcegraph/shared@workspace:client/shared"