[SG-46115] - Merge the search-ui package into the branded package (#46197)

* chore: merge search-ui package into branded package
This commit is contained in:
GitStart-SourceGraph 2023-01-12 01:27:19 +08:00 committed by GitHub
parent 03acd94e95
commit 2729f21766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
225 changed files with 94 additions and 200 deletions

View File

@ -17,7 +17,6 @@ client/http-client/package.json=1413453754
client/jetbrains/package.json=1441482894
client/observability-client/package.json=-463261822
client/observability-server/package.json=1984976913
client/search-ui/package.json=-602996280
client/search/package.json=-467983686
client/shared/package.json=1160771529
client/storybook/package.json=-1924844575

View File

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

View File

@ -69,7 +69,7 @@ const config = {
See https://handbook.sourcegraph.com/community/faq#is-all-of-sourcegraph-open-source for more information.`,
},
{
group: ['@sourcegraph/search-ui/src/experimental'],
group: ['@sourcegraph/branded/src/search-ui/experimental'],
message:
'The experimental search input is not available for general use. If you have questions about it reach out to the search product team.',
},
@ -83,7 +83,7 @@ See https://handbook.sourcegraph.com/community/faq#is-all-of-sourcegraph-open-so
'!@sourcegraph/shared/src/*',
'!@sourcegraph/shared/src/testing/*',
'!@sourcegraph/web/src/SourcegraphWebApp.scss',
'!@sourcegraph/search-ui/src/experimental',
'!@sourcegraph/branded/src/search-ui/experimental',
'!@sourcegraph/*/src/testing',
'!@sourcegraph/*/src/stories',
],

View File

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

View File

@ -12,7 +12,6 @@
- **branded**: Contains React components and implements the visual design language we use across our web app and e.g. in the options menu of the browser extension. Over time, components from `shared` and `branded` packages should be moved into the `wildcard` package.
- **wildcard**: Package that encapsulates storybook configuration and contains our Wildcard design system components. If we're using a component in two or more different areas (e.g. `web-app` and `browser-extension`) then it should live in the `wildcard` package. Otherwise the components should be better colocated with the code where they're actually used.
- **search**: Search-related code that may be shared between all clients, both branded (e.g. web, VS Code extension) and unbranded (e.g. browser extension)
- **search-ui**: Search UI components with branded styling that are shared between clients. For example, the `<SearchBox>` component that is used in both the web application and VS Code extension.
- **storybook**: Storybook configuration.
## Further migration plan

View File

@ -8,5 +8,7 @@
"lint:js": "yarn run -T eslint --cache '**/*.[jt]s?(x)'",
"lint:css": "yarn run -T stylelint 'src/**/*.scss' --quiet",
"test": "yarn run -T jest"
}
},
"sideEffects": false,
"main": "./src/index.ts"
}

View File

@ -9,7 +9,6 @@ import { catchError, distinctUntilChanged, map, startWith, switchMap } from 'rxj
import { asError, ErrorLike, isErrorLike, isDefined, property, logger } from '@sourcegraph/common'
import { Location } from '@sourcegraph/extension-api-types'
import { FileContentSearchResult } from '@sourcegraph/search-ui'
import { FetchFileParameters } from '@sourcegraph/shared/src/backend/file'
import { Badged } from '@sourcegraph/shared/src/codeintel/legacy-extensions/api'
import { VirtualList } from '@sourcegraph/shared/src/components/VirtualList'
@ -19,6 +18,8 @@ import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryServi
import { parseRepoURI } from '@sourcegraph/shared/src/util/url'
import { LoadingSpinner, Alert, Icon } from '@sourcegraph/wildcard'
import { FileContentSearchResult } from '../../../search-ui'
import styles from './FileLocations.module.scss'
export const FileLocationsError: React.FunctionComponent<React.PropsWithChildren<{ error: ErrorLike }>> = ({

View File

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

View File

@ -0,0 +1,3 @@
# Search UI
This contains search UI components with branded styling that are shared between clients. For example, the `<SearchBox>` component that is used in both the web application and VS Code extension.

View File

@ -3,12 +3,13 @@ import React from 'react'
import VisuallyHidden from '@reach/visually-hidden'
import classNames from 'classnames'
import { Timestamp } from '@sourcegraph/branded/src/components/Timestamp'
import { displayRepoName } from '@sourcegraph/shared/src/components/RepoLink'
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
import { CommitMatch, getCommitMatchUrl, getRepositoryUrl } from '@sourcegraph/shared/src/search/stream'
import { Link, Code } from '@sourcegraph/wildcard'
import { Timestamp } from '../../components/Timestamp'
import { CommitSearchResultMatch } from './CommitSearchResultMatch'
import { ResultContainer } from './ResultContainer'

View File

@ -7,7 +7,7 @@ import { BrandedStory } from '@sourcegraph/wildcard/src/stories'
import { SyntaxHighlightedSearchQuery } from './SyntaxHighlightedSearchQuery'
const config: Meta = {
title: 'search-ui/SyntaxHighlightedSearchQuery',
title: 'branded/search-ui/SyntaxHighlightedSearchQuery',
parameters: {
chromatic: { viewports: [480] },
},

View File

@ -14,7 +14,7 @@ import { BrandedStory } from '@sourcegraph/wildcard/src/stories'
import { SearchBox, SearchBoxProps } from './SearchBox'
const config: Meta = {
title: 'search-ui/input/SearchBox',
title: 'branded/search-ui/input/SearchBox',
parameters: {
chromatic: { viewports: [575, 700], disableSnapshot: false },
},

View File

@ -19,7 +19,7 @@ const decorator: DecoratorFn = story => (
)
const config: Meta = {
title: 'search-ui/input/SearchContextMenu',
title: 'branded/search-ui/input/SearchContextMenu',
parameters: {
chromatic: { viewports: [500], disableSnapshot: false },
design: {

View File

@ -12,7 +12,7 @@ const decorator: DecoratorFn = story => (
)
const config: Meta = {
title: 'search-ui/input/SearchContextMenuItem',
title: 'branded/search-ui/input/SearchContextMenuItem',
parameters: {
chromatic: { viewports: [1200], disableSnapshot: false },
},

View File

@ -11,7 +11,6 @@ import React, {
import { mdiClockOutline } from '@mdi/js'
import classNames from 'classnames'
import { Timestamp } from '@sourcegraph/branded/src/components/Timestamp'
import { pluralize } from '@sourcegraph/common'
import { RecentSearch } from '@sourcegraph/shared/src/settings/temporary/recentSearches'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
@ -27,6 +26,7 @@ import {
usePopoverContext,
} from '@sourcegraph/wildcard'
import { Timestamp } from '../../components/Timestamp'
import { SyntaxHighlightedSearchQuery } from '../components'
import styles from './SearchHistoryDropdown.module.scss'

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