unwind dependencies

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Anders Näsman
2021-02-26 15:17:37 +01:00
committed by Eric Peterson
parent 4abd922fb5
commit 5e70312d67
10 changed files with 59 additions and 70 deletions
+2 -9
View File
@@ -36,17 +36,10 @@
"url": "https://github.com/backstage/backstage/issues"
},
"dependencies": {
"@backstage/config": "^0.1.3",
"@backstage/plugin-search-indexer-backend": "^0.1.1"
"@backstage/config": "^0.1.3"
},
"devDependencies": {
"@backstage/cli": "^0.6.2",
"@types/fs-extra": "^9.0.5",
"@types/git-url-parse": "^9.0.0",
"@types/js-yaml": "^3.12.5",
"@types/mime-types": "^2.1.0",
"@types/mock-fs": "^4.13.0",
"@types/recursive-readdir": "^2.2.0"
"@backstage/cli": "^0.6.2"
},
"jest": {
"roots": [
+46 -1
View File
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import { JsonObject } from '@backstage/config';
import { IndexableDocument } from '@backstage/plugin-search-indexer-backend';
export interface SearchQuery {
term: string;
@@ -29,3 +28,49 @@ export interface SearchResult {
export interface SearchResultSet {
results: SearchResult[];
}
/**
* Base properties that all indexed documents must include, as well as some
* common properties that documents are encouraged to use where appropriate.
*/
export interface IndexableDocument {
/**
* The primary name of the document (e.g. name, title, identifier, etc).
*/
title: string;
/**
* Free-form text of the document (e.g. description, content, etc).
*/
text: string;
/**
* The relative or absolute URL of the document (target when a search result
* is clicked).
*/
location: string;
/**
* (Optional) The owner of the document (e.g. spec.owner on a catalog entity).
*/
owner?: string;
/**
* (Optional) The lifecycle of the document (e.g. spec.lifecycle on a catalog entity).
*/
lifecycle?: string;
}
/**
* Signature for the callback function that implementors must register to have
* their documents indexed.
*/
export type IndexableDocumentCollator = () => Promise<IndexableDocument[]>;
/**
* Signature for the callback function that implementors must register to
* decorate existing documents with additional metadata.
*/
export type IndexableDocumentDecorator = (
documents: IndexableDocument[],
) => Promise<IndexableDocument[]>;
+1
View File
@@ -36,6 +36,7 @@
"@backstage/errors": "^0.1.1",
"@backstage/integration": "^0.5.1",
"@backstage/plugin-search-indexer-backend": "^0.1.1",
"@backstage/search-common": "^0.1.1",
"@octokit/graphql": "^4.5.8",
"@types/express": "^4.17.6",
"@types/ldapjs": "^1.0.9",
@@ -17,7 +17,7 @@
import {
IndexableDocument,
IndexableDocumentCollator,
} from '@backstage/plugin-search-indexer-backend';
} from '@backstage/search-common';
import { EntitiesCatalog } from '../catalog';
export interface CatalogEntityDocument extends IndexableDocument {
+1 -5
View File
@@ -20,21 +20,17 @@
},
"dependencies": {
"@backstage/backend-common": "^0.5.3",
"@backstage/config": "^0.1.2",
"@backstage/plugin-search-indexer-backend": "^0.1.1",
"@backstage/search-common": "^0.1.1",
"@types/express": "^4.17.6",
"express": "^4.17.1",
"express-promise-router": "^3.0.3",
"winston": "^3.2.1",
"cross-fetch": "^3.0.6",
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.6.0",
"@types/supertest": "^2.0.8",
"supertest": "^4.0.2",
"msw": "^0.21.2"
"supertest": "^4.0.2"
},
"files": [
"dist"
+1 -1
View File
@@ -17,7 +17,7 @@
import express from 'express';
import Router from 'express-promise-router';
import { Logger } from 'winston';
import { SearchQuery, SearchResultSet } from '../types';
import { SearchQuery, SearchResultSet } from '@backstage/search-common';
type RouterOptions = {
logger: Logger;
+1 -2
View File
@@ -19,8 +19,7 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/backend-common": "^0.5.3",
"@backstage/config": "^0.1.2"
"@backstage/search-common": "^0.1.1"
},
"devDependencies": {
"@backstage/cli": "^0.6.0"
@@ -27,9 +27,3 @@ export const registerCollator = (params: RegisterCollatorParameters) => {
export const registerDecorator = (params: RegisterDecoratorParameters) => {
registry.addDecorator(params);
};
export type {
IndexableDocument,
IndexableDocumentCollator,
IndexableDocumentDecorator,
} from './types';
@@ -17,6 +17,8 @@
import {
IndexableDocumentCollator,
IndexableDocumentDecorator,
} from '@backstage/search-common';
import {
RegisterCollatorParameters,
RegisterDecoratorParameters,
} from './types';
+4 -45
View File
@@ -14,51 +14,10 @@
* limitations under the License.
*/
/**
* Base properties that all indexed documents must include, as well as some
* common properties that documents are encouraged to use where appropriate.
*/
export interface IndexableDocument {
/**
* The primary name of the document (e.g. name, title, identifier, etc).
*/
title: string;
/**
* Free-form text of the document (e.g. description, content, etc).
*/
text: string;
/**
* The relative or absolute URL of the document (target when a search result
* is clicked).
*/
location: string;
/**
* (Optional) The owner of the document (e.g. spec.owner on a catalog entity).
*/
owner?: string;
/**
* (Optional) The lifecycle of the document (e.g. spec.lifecycle on a catalog entity).
*/
lifecycle?: string;
}
/**
* Signature for the callback function that implementors must register to have
* their documents indexed.
*/
export type IndexableDocumentCollator = () => Promise<IndexableDocument[]>;
/**
* Signature for the callback function that implementors must register to
* decorate existing documents with additional metadata.
*/
export type IndexableDocumentDecorator = (
documents: IndexableDocument[],
) => Promise<IndexableDocument[]>;
import {
IndexableDocumentCollator,
IndexableDocumentDecorator,
} from '@backstage/search-common';
/**
* Parameters required to register a collator.