Remove backend-common dependency
Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
@@ -20,7 +20,7 @@ import { SearchQuery } from '@backstage/plugin-search-common';
|
||||
import { TaskFunction } from '@backstage/backend-tasks';
|
||||
import { TaskRunner } from '@backstage/backend-tasks';
|
||||
import { Transform } from 'stream';
|
||||
import { UrlReader } from '@backstage/backend-common';
|
||||
import { UrlReaderService } from '@backstage/backend-plugin-api';
|
||||
import { Writable } from 'stream';
|
||||
|
||||
// @public
|
||||
@@ -138,7 +138,7 @@ export class NewlineDelimitedJsonCollatorFactory
|
||||
export type NewlineDelimitedJsonCollatorFactoryOptions = {
|
||||
type: string;
|
||||
searchPattern: string;
|
||||
reader: UrlReader;
|
||||
reader: UrlReaderService;
|
||||
logger: LoggerService;
|
||||
visibilityPermission?: Permission;
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
"test": "backstage-cli package test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "workspace:^",
|
||||
"@backstage/backend-defaults": "workspace:^",
|
||||
"@backstage/backend-plugin-api": "workspace:^",
|
||||
"@backstage/backend-tasks": "workspace:^",
|
||||
"@backstage/config": "workspace:^",
|
||||
|
||||
+8
-7
@@ -13,17 +13,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ReadUrlResponse,
|
||||
UrlReader,
|
||||
UrlReaders,
|
||||
} from '@backstage/backend-common';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { Readable } from 'stream';
|
||||
import { NewlineDelimitedJsonCollatorFactory } from './NewlineDelimitedJsonCollatorFactory';
|
||||
import { TestPipeline } from '../test-utils';
|
||||
import { mockServices } from '@backstage/backend-test-utils';
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { UrlReaders } from '@backstage/backend-defaults/urlReader';
|
||||
|
||||
describe('DefaultCatalogCollatorFactory', () => {
|
||||
const config = new ConfigReader({});
|
||||
@@ -42,7 +41,9 @@ describe('DefaultCatalogCollatorFactory', () => {
|
||||
describe('getCollator', () => {
|
||||
let readable: Readable;
|
||||
let reader: jest.Mocked<
|
||||
UrlReader & { readUrl: jest.Mock<Promise<ReadUrlResponse>> }
|
||||
UrlReaderService & {
|
||||
readUrl: jest.Mock<Promise<UrlReaderServiceReadUrlResponse>>;
|
||||
}
|
||||
>;
|
||||
let factory: NewlineDelimitedJsonCollatorFactory;
|
||||
|
||||
|
||||
@@ -18,9 +18,8 @@ import { Config } from '@backstage/config';
|
||||
import { DocumentCollatorFactory } from '@backstage/plugin-search-common';
|
||||
import { Permission } from '@backstage/plugin-permission-common';
|
||||
import { Readable } from 'stream';
|
||||
import { UrlReader } from '@backstage/backend-common';
|
||||
import { parse as parseNdjson } from 'ndjson';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { LoggerService, UrlReaderService } from '@backstage/backend-plugin-api';
|
||||
|
||||
/**
|
||||
* Options for instantiate NewlineDelimitedJsonCollatorFactory
|
||||
@@ -29,7 +28,7 @@ import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
export type NewlineDelimitedJsonCollatorFactoryOptions = {
|
||||
type: string;
|
||||
searchPattern: string;
|
||||
reader: UrlReader;
|
||||
reader: UrlReaderService;
|
||||
logger: LoggerService;
|
||||
visibilityPermission?: Permission;
|
||||
};
|
||||
@@ -73,7 +72,7 @@ export class NewlineDelimitedJsonCollatorFactory
|
||||
private constructor(
|
||||
type: string,
|
||||
private readonly searchPattern: string,
|
||||
private readonly reader: UrlReader,
|
||||
private readonly reader: UrlReaderService,
|
||||
private readonly logger: LoggerService,
|
||||
visibilityPermission: Permission | undefined,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user