Browse Source

chore(js): Re-export Fuse type in utils/fuzzySearch (#32094)

Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Evan Purkhiser 3 years ago
parent
commit
c75c184426

+ 1 - 1
static/app/components/events/interfaces/spans/types.tsx

@@ -1,4 +1,4 @@
-import type Fuse from 'fuse.js';
+import {Fuse} from 'sentry/utils/fuzzySearch';
 
 
 export type GapSpanType = {
 export type GapSpanType = {
   isOrphan: boolean;
   isOrphan: boolean;

+ 1 - 2
static/app/components/events/interfaces/spans/waterfallModel.tsx

@@ -1,11 +1,10 @@
-import type Fuse from 'fuse.js';
 import isEqual from 'lodash/isEqual';
 import isEqual from 'lodash/isEqual';
 import pick from 'lodash/pick';
 import pick from 'lodash/pick';
 import {action, computed, makeObservable, observable} from 'mobx';
 import {action, computed, makeObservable, observable} from 'mobx';
 
 
 import {Client} from 'sentry/api';
 import {Client} from 'sentry/api';
 import {EventTransaction} from 'sentry/types/event';
 import {EventTransaction} from 'sentry/types/event';
-import {createFuzzySearch} from 'sentry/utils/createFuzzySearch';
+import {createFuzzySearch, Fuse} from 'sentry/utils/fuzzySearch';
 
 
 import {ActiveOperationFilter, noFilter, toggleAllFilters, toggleFilter} from './filter';
 import {ActiveOperationFilter, noFilter, toggleAllFilters, toggleFilter} from './filter';
 import SpanTreeModel from './spanTreeModel';
 import SpanTreeModel from './spanTreeModel';

+ 1 - 1
static/app/components/search/index.tsx

@@ -1,7 +1,6 @@
 import * as React from 'react';
 import * as React from 'react';
 import {withRouter, WithRouterProps} from 'react-router';
 import {withRouter, WithRouterProps} from 'react-router';
 import styled from '@emotion/styled';
 import styled from '@emotion/styled';
-import type Fuse from 'fuse.js';
 import debounce from 'lodash/debounce';
 import debounce from 'lodash/debounce';
 
 
 import {addErrorMessage} from 'sentry/actionCreators/indicator';
 import {addErrorMessage} from 'sentry/actionCreators/indicator';
@@ -18,6 +17,7 @@ import RouteSource from 'sentry/components/search/sources/routeSource';
 import {t} from 'sentry/locale';
 import {t} from 'sentry/locale';
 import space from 'sentry/styles/space';
 import space from 'sentry/styles/space';
 import trackAdvancedAnalyticsEvent from 'sentry/utils/analytics/trackAdvancedAnalyticsEvent';
 import trackAdvancedAnalyticsEvent from 'sentry/utils/analytics/trackAdvancedAnalyticsEvent';
+import {Fuse} from 'sentry/utils/fuzzySearch';
 import replaceRouterParams from 'sentry/utils/replaceRouterParams';
 import replaceRouterParams from 'sentry/utils/replaceRouterParams';
 
 
 import {Result} from './sources/types';
 import {Result} from './sources/types';

+ 1 - 2
static/app/components/search/sources/apiSource.tsx

@@ -1,7 +1,6 @@
 import * as React from 'react';
 import * as React from 'react';
 import {withRouter, WithRouterProps} from 'react-router';
 import {withRouter, WithRouterProps} from 'react-router';
 import * as Sentry from '@sentry/react';
 import * as Sentry from '@sentry/react';
-import type Fuse from 'fuse.js';
 import debounce from 'lodash/debounce';
 import debounce from 'lodash/debounce';
 import flatten from 'lodash/flatten';
 import flatten from 'lodash/flatten';
 
 
@@ -20,7 +19,7 @@ import {
   Team,
   Team,
 } from 'sentry/types';
 } from 'sentry/types';
 import {defined} from 'sentry/utils';
 import {defined} from 'sentry/utils';
-import {createFuzzySearch} from 'sentry/utils/createFuzzySearch';
+import {createFuzzySearch, Fuse} from 'sentry/utils/fuzzySearch';
 import {singleLineRenderer as markedSingleLine} from 'sentry/utils/marked';
 import {singleLineRenderer as markedSingleLine} from 'sentry/utils/marked';
 import withLatestContext from 'sentry/utils/withLatestContext';
 import withLatestContext from 'sentry/utils/withLatestContext';
 
 

+ 1 - 2
static/app/components/search/sources/commandSource.tsx

@@ -1,12 +1,11 @@
 import * as React from 'react';
 import * as React from 'react';
 import {PlainRoute} from 'react-router';
 import {PlainRoute} from 'react-router';
-import type Fuse from 'fuse.js';
 
 
 import {openHelpSearchModal, openSudo} from 'sentry/actionCreators/modal';
 import {openHelpSearchModal, openSudo} from 'sentry/actionCreators/modal';
 import Access from 'sentry/components/acl/access';
 import Access from 'sentry/components/acl/access';
 import {toggleLocaleDebug} from 'sentry/locale';
 import {toggleLocaleDebug} from 'sentry/locale';
 import ConfigStore from 'sentry/stores/configStore';
 import ConfigStore from 'sentry/stores/configStore';
-import {createFuzzySearch} from 'sentry/utils/createFuzzySearch';
+import {createFuzzySearch, Fuse} from 'sentry/utils/fuzzySearch';
 
 
 import {ChildProps, ResultItem} from './types';
 import {ChildProps, ResultItem} from './types';
 
 

+ 1 - 2
static/app/components/search/sources/formSource.tsx

@@ -1,10 +1,9 @@
 import * as React from 'react';
 import * as React from 'react';
 import {withRouter, WithRouterProps} from 'react-router';
 import {withRouter, WithRouterProps} from 'react-router';
-import type Fuse from 'fuse.js';
 
 
 import {loadSearchMap} from 'sentry/actionCreators/formSearch';
 import {loadSearchMap} from 'sentry/actionCreators/formSearch';
 import FormSearchStore, {FormSearchField} from 'sentry/stores/formSearchStore';
 import FormSearchStore, {FormSearchField} from 'sentry/stores/formSearchStore';
-import {createFuzzySearch} from 'sentry/utils/createFuzzySearch';
+import {createFuzzySearch, Fuse} from 'sentry/utils/fuzzySearch';
 import replaceRouterParams from 'sentry/utils/replaceRouterParams';
 import replaceRouterParams from 'sentry/utils/replaceRouterParams';
 
 
 import {ChildProps, Result, ResultItem} from './types';
 import {ChildProps, Result, ResultItem} from './types';

+ 2 - 1
static/app/components/search/sources/index.tsx

@@ -1,7 +1,8 @@
 import * as React from 'react';
 import * as React from 'react';
-import type Fuse from 'fuse.js';
 import flatten from 'lodash/flatten';
 import flatten from 'lodash/flatten';
 
 
+import {Fuse} from 'sentry/utils/fuzzySearch';
+
 import {Result} from './types';
 import {Result} from './types';
 
 
 type ChildProps = {
 type ChildProps = {

+ 1 - 2
static/app/components/search/sources/routeSource.tsx

@@ -1,10 +1,9 @@
 import * as React from 'react';
 import * as React from 'react';
 import {RouteComponentProps} from 'react-router';
 import {RouteComponentProps} from 'react-router';
-import type Fuse from 'fuse.js';
 import flattenDepth from 'lodash/flattenDepth';
 import flattenDepth from 'lodash/flattenDepth';
 
 
 import {Organization, Project} from 'sentry/types';
 import {Organization, Project} from 'sentry/types';
-import {createFuzzySearch} from 'sentry/utils/createFuzzySearch';
+import {createFuzzySearch, Fuse} from 'sentry/utils/fuzzySearch';
 import replaceRouterParams from 'sentry/utils/replaceRouterParams';
 import replaceRouterParams from 'sentry/utils/replaceRouterParams';
 import withLatestContext from 'sentry/utils/withLatestContext';
 import withLatestContext from 'sentry/utils/withLatestContext';
 import accountSettingsNavigation from 'sentry/views/settings/account/navigationConfiguration';
 import accountSettingsNavigation from 'sentry/views/settings/account/navigationConfiguration';

+ 1 - 1
static/app/components/search/sources/types.tsx

@@ -1,4 +1,4 @@
-import type Fuse from 'fuse.js';
+import {Fuse} from 'sentry/utils/fuzzySearch';
 
 
 /**
 /**
  * A result item that sources create.
  * A result item that sources create.

+ 2 - 1
static/app/components/search/sources/utils.tsx

@@ -1,9 +1,10 @@
-import type Fuse from 'fuse.js';
 // Override the lint rule for this, we actually need the path lookup feature,
 // Override the lint rule for this, we actually need the path lookup feature,
 // which `?.` does not magically give us.
 // which `?.` does not magically give us.
 // eslint-disable-next-line no-restricted-imports
 // eslint-disable-next-line no-restricted-imports
 import get from 'lodash/get';
 import get from 'lodash/get';
 
 
+import {Fuse} from 'sentry/utils/fuzzySearch';
+
 /**
 /**
  * A value getter for fuse that will ensure the result is a string.
  * A value getter for fuse that will ensure the result is a string.
  *
  *

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