@backstage/backend-defaults 0.0.0-nightly-20220811024336
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +19 -0
- package/dist/index.cjs.js +26 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/package.json +45 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @backstage/backend-defaults
|
|
2
|
+
|
|
3
|
+
## 0.0.0-nightly-20220811024336
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5df230d48c: Introduced a new `backend-defaults` package carrying `createBackend` which was previously exported from `backend-app-api`.
|
|
8
|
+
The `backend-app-api` package now exports the `createSpecializedBacked` that does not add any service factories by default.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/backend-app-api@0.0.0-nightly-20220811024336
|
|
14
|
+
- @backstage/backend-plugin-api@0.0.0-nightly-20220811024336
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @backstage/backend-defaults
|
|
2
|
+
|
|
3
|
+
**This package is HIGHLY EXPERIMENTAL, do not use this for production**
|
|
4
|
+
|
|
5
|
+
This package provides the core API used by Backstage backend apps.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add the library to your backend app package:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# From your Backstage root directory
|
|
13
|
+
yarn add --cwd packages/backend @backstage/backend-defaults
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Documentation
|
|
17
|
+
|
|
18
|
+
- [Backstage Readme](https://github.com/backstage/backstage/blob/master/README.md)
|
|
19
|
+
- [Backstage Documentation](https://github.com/backstage/backstage/blob/master/docs/README.md)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var backendAppApi = require('@backstage/backend-app-api');
|
|
6
|
+
|
|
7
|
+
const defaultServiceFactories = [
|
|
8
|
+
backendAppApi.cacheFactory,
|
|
9
|
+
backendAppApi.configFactory,
|
|
10
|
+
backendAppApi.databaseFactory,
|
|
11
|
+
backendAppApi.discoveryFactory,
|
|
12
|
+
backendAppApi.loggerFactory,
|
|
13
|
+
backendAppApi.permissionsFactory,
|
|
14
|
+
backendAppApi.schedulerFactory,
|
|
15
|
+
backendAppApi.tokenManagerFactory,
|
|
16
|
+
backendAppApi.urlReaderFactory,
|
|
17
|
+
backendAppApi.httpRouterFactory
|
|
18
|
+
];
|
|
19
|
+
function createBackend(options) {
|
|
20
|
+
return backendAppApi.createSpecializedBackend({
|
|
21
|
+
services: [...defaultServiceFactories, ...(options == null ? void 0 : options.services) || []]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.createBackend = createBackend;
|
|
26
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/CreateBackend.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Backend,\n cacheFactory,\n configFactory,\n createSpecializedBackend,\n databaseFactory,\n discoveryFactory,\n httpRouterFactory,\n loggerFactory,\n permissionsFactory,\n schedulerFactory,\n tokenManagerFactory,\n urlReaderFactory,\n} from '@backstage/backend-app-api';\n\nexport const defaultServiceFactories = [\n cacheFactory,\n configFactory,\n databaseFactory,\n discoveryFactory,\n loggerFactory,\n permissionsFactory,\n schedulerFactory,\n tokenManagerFactory,\n urlReaderFactory,\n httpRouterFactory,\n];\n\nimport { AnyServiceFactory } from '@backstage/backend-plugin-api';\n\n/**\n * @public\n */\nexport interface CreateBackendOptions {\n services?: AnyServiceFactory[];\n}\n\n/**\n * @public\n */\nexport function createBackend(options?: CreateBackendOptions): Backend {\n // TODO: merge with provided APIs\n return createSpecializedBackend({\n services: [...defaultServiceFactories, ...(options?.services || [])],\n });\n}\n"],"names":["cacheFactory","configFactory","databaseFactory","discoveryFactory","loggerFactory","permissionsFactory","schedulerFactory","tokenManagerFactory","urlReaderFactory","httpRouterFactory","createSpecializedBackend"],"mappings":";;;;;;AAaO,MAAM,uBAAuB,GAAG;AACvC,EAAEA,0BAAY;AACd,EAAEC,2BAAa;AACf,EAAEC,6BAAe;AACjB,EAAEC,8BAAgB;AAClB,EAAEC,2BAAa;AACf,EAAEC,gCAAkB;AACpB,EAAEC,8BAAgB;AAClB,EAAEC,iCAAmB;AACrB,EAAEC,8BAAgB;AAClB,EAAEC,+BAAiB;AACnB,CAAC,CAAC;AACK,SAAS,aAAa,CAAC,OAAO,EAAE;AACvC,EAAE,OAAOC,sCAAwB,CAAC;AAClC,IAAI,QAAQ,EAAE,CAAC,GAAG,uBAAuB,EAAE,GAAG,CAAC,OAAO,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,QAAQ,KAAK,EAAE,CAAC;AAClG,GAAG,CAAC,CAAC;AACL;;;;"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AnyServiceFactory } from '@backstage/backend-plugin-api';
|
|
2
|
+
import { Backend } from '@backstage/backend-app-api';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
interface CreateBackendOptions {
|
|
8
|
+
services?: AnyServiceFactory[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
declare function createBackend(options?: CreateBackendOptions): Backend;
|
|
14
|
+
|
|
15
|
+
export { CreateBackendOptions, createBackend };
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@backstage/backend-defaults",
|
|
3
|
+
"description": "Backend defaults used by Backstage backend apps",
|
|
4
|
+
"version": "0.0.0-nightly-20220811024336",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"private": false,
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"main": "dist/index.cjs.js",
|
|
11
|
+
"types": "dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"backstage": {
|
|
14
|
+
"role": "node-library"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://backstage.io",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/backstage/backstage",
|
|
20
|
+
"directory": "packages/backend-defaults"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"backstage"
|
|
24
|
+
],
|
|
25
|
+
"license": "Apache-2.0",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "backstage-cli package build",
|
|
28
|
+
"lint": "backstage-cli package lint",
|
|
29
|
+
"test": "backstage-cli package test",
|
|
30
|
+
"prepack": "backstage-cli package prepack",
|
|
31
|
+
"postpack": "backstage-cli package postpack",
|
|
32
|
+
"clean": "backstage-cli package clean",
|
|
33
|
+
"start": "backstage-cli package start"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@backstage/backend-app-api": "0.0.0-nightly-20220811024336",
|
|
37
|
+
"@backstage/backend-plugin-api": "0.0.0-nightly-20220811024336"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@backstage/cli": "0.0.0-nightly-20220811024336"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist"
|
|
44
|
+
]
|
|
45
|
+
}
|