refactor(stack-overflow-backend): remove alpha subpath

Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2023-10-19 09:28:38 +02:00
parent 8a7f1ba2a5
commit e13e43a125
8 changed files with 34 additions and 43 deletions
@@ -87,9 +87,7 @@ import { createBackend } from '@backstage/backend-defaults';
const backend = createBackend();
backend.add(import('@backstage/plugin-search-backend/alpha'));
backend.add(
import(
'@backstage/plugin-search-backend-module-stack-overflow-collator/alpha'
),
import('@backstage/plugin-search-backend-module-stack-overflow-collator'),
);
backend.start();
```
@@ -1,11 +0,0 @@
## API Report File for "@backstage/plugin-search-backend-module-stack-overflow-collator"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
// @alpha
const _default: () => BackendFeature;
export default _default;
```
@@ -5,12 +5,17 @@
```ts
/// <reference types="node" />
import { BackendFeature } from '@backstage/backend-plugin-api';
import { Config } from '@backstage/config';
import { DocumentCollatorFactory } from '@backstage/plugin-search-common';
import { IndexableDocument } from '@backstage/plugin-search-common';
import { Logger } from 'winston';
import { Readable } from 'stream';
// @public
const searchStackOverflowCollatorModule: () => BackendFeature;
export default searchStackOverflowCollatorModule;
// @public
export interface StackOverflowDocument extends IndexableDocument {
// (undocumented)
@@ -6,22 +6,9 @@
"types": "src/index.ts",
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
"exports": {
".": "./src/index.ts",
"./alpha": "./src/alpha.ts",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"alpha": [
"src/alpha.ts"
],
"package.json": [
"package.json"
]
}
"access": "public",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "backend-plugin-module"
@@ -20,3 +20,4 @@
*/
export * from './collators';
export { searchStackOverflowCollatorModule as default } from './module';
@@ -16,9 +16,9 @@
import { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha';
import searchModuleStackOverflowCollator from './alpha';
import { searchStackOverflowCollatorModule } from './SearchStackOverflowCollatorModule';
describe('searchModuleStackOverflowCollator', () => {
describe('searchStackOverflowCollatorModule', () => {
const schedule = {
frequency: { minutes: 10 },
timeout: { minutes: 15 },
@@ -35,7 +35,7 @@ describe('searchModuleStackOverflowCollator', () => {
[searchIndexRegistryExtensionPoint, extensionPointMock],
],
features: [
searchModuleStackOverflowCollator(),
searchStackOverflowCollatorModule(),
mockServices.rootConfig.factory({
data: {
stackoverflow: {
@@ -21,20 +21,14 @@ import {
createBackendModule,
} from '@backstage/backend-plugin-api';
import { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha';
import { StackOverflowQuestionsCollatorFactory } from './collators';
/**
* @packageDocumentation
* A module for the search backend that exports Stack Overflow modules.
*/
import { StackOverflowQuestionsCollatorFactory } from '../collators';
/**
* @public
* Search backend module for the Stack Overflow index.
*
* @alpha
*/
export default createBackendModule({
moduleId: 'stackoverflowCollator',
export const searchStackOverflowCollatorModule = createBackendModule({
moduleId: 'stackOverflowCollator',
pluginId: 'search',
register(env) {
env.registerInit({
@@ -0,0 +1,17 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { searchStackOverflowCollatorModule } from './SearchStackOverflowCollatorModule';