plugins/*-backend: flip around alpha exports to stable
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -17,5 +17,5 @@
|
||||
import { createBackend } from '@backstage/backend-defaults';
|
||||
|
||||
const backend = createBackend();
|
||||
backend.add(import('../src/alpha'));
|
||||
backend.add(import('../src/plugin'));
|
||||
backend.start();
|
||||
|
||||
@@ -5,9 +5,13 @@
|
||||
```ts
|
||||
import { BackendFeature } from '@backstage/backend-plugin-api';
|
||||
|
||||
// @alpha
|
||||
const _default: BackendFeature;
|
||||
export default _default;
|
||||
// @alpha (undocumented)
|
||||
const _feature: BackendFeature;
|
||||
export default _feature;
|
||||
|
||||
// Warnings were encountered during analysis:
|
||||
//
|
||||
// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature".
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
|
||||
@@ -12,9 +12,9 @@ import { SignalsService } from '@backstage/plugin-signals-node';
|
||||
// @public @deprecated
|
||||
export function createRouter(options: RouterOptions): Promise<express.Router>;
|
||||
|
||||
// @public (undocumented)
|
||||
const _feature: BackendFeature;
|
||||
export default _feature;
|
||||
// @public
|
||||
const _default: BackendFeature;
|
||||
export default _default;
|
||||
|
||||
// @public @deprecated
|
||||
export type RouterOptions = {
|
||||
@@ -23,9 +23,5 @@ export type RouterOptions = {
|
||||
signals?: SignalsService;
|
||||
};
|
||||
|
||||
// Warnings were encountered during analysis:
|
||||
//
|
||||
// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature".
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2023 The Backstage Authors
|
||||
* Copyright 2024 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.
|
||||
@@ -14,37 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
coreServices,
|
||||
createBackendPlugin,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { createRouterInternal } from './service/router';
|
||||
import { signalsServiceRef } from '@backstage/plugin-signals-node';
|
||||
import { DatabaseUserSettingsStore } from './database/DatabaseUserSettingsStore';
|
||||
import { default as feature } from './plugin';
|
||||
|
||||
/**
|
||||
* The user settings backend plugin.
|
||||
*
|
||||
* @alpha
|
||||
*/
|
||||
export default createBackendPlugin({
|
||||
pluginId: 'user-settings',
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
database: coreServices.database,
|
||||
httpAuth: coreServices.httpAuth,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
signals: signalsServiceRef,
|
||||
},
|
||||
async init({ database, httpAuth, httpRouter, signals }) {
|
||||
const userSettingsStore = await DatabaseUserSettingsStore.create({
|
||||
database,
|
||||
});
|
||||
httpRouter.use(
|
||||
await createRouterInternal({ userSettingsStore, httpAuth, signals }),
|
||||
);
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
/** @alpha */
|
||||
const _feature = feature;
|
||||
export default _feature;
|
||||
|
||||
@@ -14,11 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { default as feature } from './alpha';
|
||||
|
||||
/** @public */
|
||||
const _feature = feature;
|
||||
export default _feature;
|
||||
|
||||
export { default } from './plugin';
|
||||
export * from './deprecated';
|
||||
export * from './database';
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import {
|
||||
coreServices,
|
||||
createBackendPlugin,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { createRouterInternal } from './service/router';
|
||||
import { signalsServiceRef } from '@backstage/plugin-signals-node';
|
||||
import { DatabaseUserSettingsStore } from './database/DatabaseUserSettingsStore';
|
||||
|
||||
/**
|
||||
* The user settings backend plugin.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export default createBackendPlugin({
|
||||
pluginId: 'user-settings',
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
database: coreServices.database,
|
||||
httpAuth: coreServices.httpAuth,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
signals: signalsServiceRef,
|
||||
},
|
||||
async init({ database, httpAuth, httpRouter, signals }) {
|
||||
const userSettingsStore = await DatabaseUserSettingsStore.create({
|
||||
database,
|
||||
});
|
||||
httpRouter.use(
|
||||
await createRouterInternal({ userSettingsStore, httpAuth, signals }),
|
||||
);
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user