@backstage/plugin-app-backend 0.3.48-next.0 → 0.3.48-next.1

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @backstage/plugin-app-backend
2
2
 
3
+ ## 0.3.48-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 629cbd194a87: Use `coreServices.rootConfig` instead of `coreService.config`
8
+ - Updated dependencies
9
+ - @backstage/backend-common@0.19.2-next.1
10
+ - @backstage/config-loader@1.4.0-next.1
11
+ - @backstage/backend-plugin-api@0.6.0-next.1
12
+ - @backstage/config@1.0.8
13
+ - @backstage/types@1.1.0
14
+
3
15
  ## 0.3.48-next.0
4
16
 
5
17
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-app-backend",
3
- "version": "0.3.48-next.0",
3
+ "version": "0.3.48-next.1",
4
4
  "main": "../dist/alpha.cjs.js",
5
5
  "types": "../dist/alpha.d.ts"
6
6
  }
package/dist/alpha.cjs.js CHANGED
@@ -21,7 +21,7 @@ const appPlugin = backendPluginApi.createBackendPlugin((options) => ({
21
21
  env.registerInit({
22
22
  deps: {
23
23
  logger: backendPluginApi.coreServices.logger,
24
- config: backendPluginApi.coreServices.config,
24
+ config: backendPluginApi.coreServices.rootConfig,
25
25
  database: backendPluginApi.coreServices.database,
26
26
  httpRouter: backendPluginApi.coreServices.httpRouter
27
27
  },
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.cjs.js","sources":["../src/service/appPlugin.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 express from 'express';\nimport {\n coreServices,\n createBackendPlugin,\n} from '@backstage/backend-plugin-api';\nimport { createRouter } from './router';\nimport { loggerToWinstonLogger } from '@backstage/backend-common';\n\n/** @alpha */\nexport type AppPluginOptions = {\n /**\n * The name of the app package (in most Backstage repositories, this is the\n * \"name\" field in `packages/app/package.json`) that content should be served\n * from. The same app package should be added as a dependency to the backend\n * package in order for it to be accessible at runtime.\n *\n * In a typical setup with a single app package, this will default to 'app'.\n */\n appPackageName?: string;\n\n /**\n * A request handler to handle requests for static content that are not present in the app bundle.\n *\n * This can be used to avoid issues with clients on older deployment versions trying to access lazy\n * loaded content that is no longer present. Typically the requests would fall back to a long-term\n * object store where all recently deployed versions of the app are present.\n *\n * Another option is to provide a `database` that will take care of storing the static assets instead.\n *\n * If both `database` and `staticFallbackHandler` are provided, the `database` will attempt to serve\n * static assets first, and if they are not found, the `staticFallbackHandler` will be called.\n */\n staticFallbackHandler?: express.Handler;\n\n /**\n * Disables the configuration injection. This can be useful if you're running in an environment\n * with a read-only filesystem, or for some other reason don't want configuration to be injected.\n *\n * Note that this will cause the configuration used when building the app bundle to be used, unless\n * a separate configuration loading strategy is set up.\n *\n * This also disables configuration injection though `APP_CONFIG_` environment variables.\n */\n disableConfigInjection?: boolean;\n\n /**\n * By default the app backend plugin will cache previously deployed static assets in the database.\n * If you disable this, it is recommended to set a `staticFallbackHandler` instead.\n */\n disableStaticFallbackCache?: boolean;\n};\n\n/**\n * The App plugin is responsible for serving the frontend app bundle and static assets.\n * @alpha\n */\nexport const appPlugin = createBackendPlugin((options: AppPluginOptions) => ({\n pluginId: 'app',\n register(env) {\n env.registerInit({\n deps: {\n logger: coreServices.logger,\n config: coreServices.config,\n database: coreServices.database,\n httpRouter: coreServices.httpRouter,\n },\n async init({ logger, config, database, httpRouter }) {\n const {\n appPackageName,\n staticFallbackHandler,\n disableConfigInjection,\n disableStaticFallbackCache,\n } = options;\n const winstonLogger = loggerToWinstonLogger(logger);\n\n const router = await createRouter({\n logger: winstonLogger,\n config,\n database: disableStaticFallbackCache ? undefined : database,\n appPackageName: appPackageName ?? 'app',\n staticFallbackHandler,\n disableConfigInjection,\n });\n httpRouter.use(router);\n },\n });\n },\n}));\n"],"names":["createBackendPlugin","coreServices","loggerToWinstonLogger","router","createRouter"],"mappings":";;;;;;;;;;;;;;;;;AAwEa,MAAA,SAAA,GAAYA,oCAAoB,CAAA,CAAC,OAA+B,MAAA;AAAA,EAC3E,QAAU,EAAA,KAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,QAAQC,6BAAa,CAAA,MAAA;AAAA,QACrB,QAAQA,6BAAa,CAAA,MAAA;AAAA,QACrB,UAAUA,6BAAa,CAAA,QAAA;AAAA,QACvB,YAAYA,6BAAa,CAAA,UAAA;AAAA,OAC3B;AAAA,MACA,MAAM,IAAK,CAAA,EAAE,QAAQ,MAAQ,EAAA,QAAA,EAAU,YAAc,EAAA;AACnD,QAAM,MAAA;AAAA,UACJ,cAAA;AAAA,UACA,qBAAA;AAAA,UACA,sBAAA;AAAA,UACA,0BAAA;AAAA,SACE,GAAA,OAAA,CAAA;AACJ,QAAM,MAAA,aAAA,GAAgBC,oCAAsB,MAAM,CAAA,CAAA;AAElD,QAAM,MAAAC,QAAA,GAAS,MAAMC,mBAAa,CAAA;AAAA,UAChC,MAAQ,EAAA,aAAA;AAAA,UACR,MAAA;AAAA,UACA,QAAA,EAAU,6BAA6B,KAAY,CAAA,GAAA,QAAA;AAAA,UACnD,gBAAgB,cAAkB,IAAA,IAAA,GAAA,cAAA,GAAA,KAAA;AAAA,UAClC,qBAAA;AAAA,UACA,sBAAA;AAAA,SACD,CAAA,CAAA;AACD,QAAA,UAAA,CAAW,IAAID,QAAM,CAAA,CAAA;AAAA,OACvB;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAE,CAAA;;;;"}
1
+ {"version":3,"file":"alpha.cjs.js","sources":["../src/service/appPlugin.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 express from 'express';\nimport {\n coreServices,\n createBackendPlugin,\n} from '@backstage/backend-plugin-api';\nimport { createRouter } from './router';\nimport { loggerToWinstonLogger } from '@backstage/backend-common';\n\n/** @alpha */\nexport type AppPluginOptions = {\n /**\n * The name of the app package (in most Backstage repositories, this is the\n * \"name\" field in `packages/app/package.json`) that content should be served\n * from. The same app package should be added as a dependency to the backend\n * package in order for it to be accessible at runtime.\n *\n * In a typical setup with a single app package, this will default to 'app'.\n */\n appPackageName?: string;\n\n /**\n * A request handler to handle requests for static content that are not present in the app bundle.\n *\n * This can be used to avoid issues with clients on older deployment versions trying to access lazy\n * loaded content that is no longer present. Typically the requests would fall back to a long-term\n * object store where all recently deployed versions of the app are present.\n *\n * Another option is to provide a `database` that will take care of storing the static assets instead.\n *\n * If both `database` and `staticFallbackHandler` are provided, the `database` will attempt to serve\n * static assets first, and if they are not found, the `staticFallbackHandler` will be called.\n */\n staticFallbackHandler?: express.Handler;\n\n /**\n * Disables the configuration injection. This can be useful if you're running in an environment\n * with a read-only filesystem, or for some other reason don't want configuration to be injected.\n *\n * Note that this will cause the configuration used when building the app bundle to be used, unless\n * a separate configuration loading strategy is set up.\n *\n * This also disables configuration injection though `APP_CONFIG_` environment variables.\n */\n disableConfigInjection?: boolean;\n\n /**\n * By default the app backend plugin will cache previously deployed static assets in the database.\n * If you disable this, it is recommended to set a `staticFallbackHandler` instead.\n */\n disableStaticFallbackCache?: boolean;\n};\n\n/**\n * The App plugin is responsible for serving the frontend app bundle and static assets.\n * @alpha\n */\nexport const appPlugin = createBackendPlugin((options: AppPluginOptions) => ({\n pluginId: 'app',\n register(env) {\n env.registerInit({\n deps: {\n logger: coreServices.logger,\n config: coreServices.rootConfig,\n database: coreServices.database,\n httpRouter: coreServices.httpRouter,\n },\n async init({ logger, config, database, httpRouter }) {\n const {\n appPackageName,\n staticFallbackHandler,\n disableConfigInjection,\n disableStaticFallbackCache,\n } = options;\n const winstonLogger = loggerToWinstonLogger(logger);\n\n const router = await createRouter({\n logger: winstonLogger,\n config,\n database: disableStaticFallbackCache ? undefined : database,\n appPackageName: appPackageName ?? 'app',\n staticFallbackHandler,\n disableConfigInjection,\n });\n httpRouter.use(router);\n },\n });\n },\n}));\n"],"names":["createBackendPlugin","coreServices","loggerToWinstonLogger","router","createRouter"],"mappings":";;;;;;;;;;;;;;;;;AAwEa,MAAA,SAAA,GAAYA,oCAAoB,CAAA,CAAC,OAA+B,MAAA;AAAA,EAC3E,QAAU,EAAA,KAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,QAAQC,6BAAa,CAAA,MAAA;AAAA,QACrB,QAAQA,6BAAa,CAAA,UAAA;AAAA,QACrB,UAAUA,6BAAa,CAAA,QAAA;AAAA,QACvB,YAAYA,6BAAa,CAAA,UAAA;AAAA,OAC3B;AAAA,MACA,MAAM,IAAK,CAAA,EAAE,QAAQ,MAAQ,EAAA,QAAA,EAAU,YAAc,EAAA;AACnD,QAAM,MAAA;AAAA,UACJ,cAAA;AAAA,UACA,qBAAA;AAAA,UACA,sBAAA;AAAA,UACA,0BAAA;AAAA,SACE,GAAA,OAAA,CAAA;AACJ,QAAM,MAAA,aAAA,GAAgBC,oCAAsB,MAAM,CAAA,CAAA;AAElD,QAAM,MAAAC,QAAA,GAAS,MAAMC,mBAAa,CAAA;AAAA,UAChC,MAAQ,EAAA,aAAA;AAAA,UACR,MAAA;AAAA,UACA,QAAA,EAAU,6BAA6B,KAAY,CAAA,GAAA,QAAA;AAAA,UACnD,gBAAgB,cAAkB,IAAA,IAAA,GAAA,cAAA,GAAA,KAAA;AAAA,UAClC,qBAAA;AAAA,UACA,sBAAA;AAAA,SACD,CAAA,CAAA;AACD,QAAA,UAAA,CAAW,IAAID,QAAM,CAAA,CAAA;AAAA,OACvB;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAE,CAAA;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-app-backend",
3
3
  "description": "A Backstage backend plugin that serves the Backstage frontend app",
4
- "version": "0.3.48-next.0",
4
+ "version": "0.3.48-next.1",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -43,10 +43,10 @@
43
43
  "clean": "backstage-cli package clean"
44
44
  },
45
45
  "dependencies": {
46
- "@backstage/backend-common": "^0.19.2-next.0",
47
- "@backstage/backend-plugin-api": "^0.5.5-next.0",
46
+ "@backstage/backend-common": "^0.19.2-next.1",
47
+ "@backstage/backend-plugin-api": "^0.6.0-next.1",
48
48
  "@backstage/config": "^1.0.8",
49
- "@backstage/config-loader": "^1.4.0-next.0",
49
+ "@backstage/config-loader": "^1.4.0-next.1",
50
50
  "@backstage/types": "^1.1.0",
51
51
  "@types/express": "^4.17.6",
52
52
  "express": "^4.17.1",
@@ -61,9 +61,9 @@
61
61
  "yn": "^4.0.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@backstage/backend-app-api": "^0.4.6-next.0",
65
- "@backstage/backend-test-utils": "^0.1.40-next.0",
66
- "@backstage/cli": "^0.22.10-next.0",
64
+ "@backstage/backend-app-api": "^0.5.0-next.1",
65
+ "@backstage/backend-test-utils": "^0.2.0-next.1",
66
+ "@backstage/cli": "^0.22.10-next.1",
67
67
  "@backstage/types": "^1.1.0",
68
68
  "@types/supertest": "^2.0.8",
69
69
  "mock-fs": "^5.1.0",