plugins/*-backend: flip around alpha exports to stable

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-10-13 13:11:11 +02:00
parent b071eec7d7
commit 7cfc0c1902
53 changed files with 430 additions and 363 deletions
+1 -1
View File
@@ -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)
```
+3 -7
View File
@@ -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)
```
+5 -34
View File
@@ -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;
+1 -6
View File
@@ -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 }),
);
},
});
},
});