@backstage/plugin-app-node 0.1.26-next.0 → 0.1.26-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,13 @@
1
1
  # @backstage/plugin-app-node
2
2
 
3
+ ## 0.1.26-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/backend-plugin-api@1.0.1-next.1
9
+ - @backstage/config-loader@1.9.1
10
+
3
11
  ## 0.1.26-next.0
4
12
 
5
13
  ### Patch Changes
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var backendPluginApi = require('@backstage/backend-plugin-api');
4
+
5
+ const staticFallbackHandlerExtensionPoint = backendPluginApi.createExtensionPoint({
6
+ id: "app.staticFallbackHandler"
7
+ });
8
+ const configSchemaExtensionPoint = backendPluginApi.createExtensionPoint({
9
+ id: "app.configSchema"
10
+ });
11
+
12
+ exports.configSchemaExtensionPoint = configSchemaExtensionPoint;
13
+ exports.staticFallbackHandlerExtensionPoint = staticFallbackHandlerExtensionPoint;
14
+ //# sourceMappingURL=extensions.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions.cjs.js","sources":["../src/extensions.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { ConfigSchema } from '@backstage/config-loader';\nimport { Handler } from 'express';\n\n/**\n * The interface for {@link staticFallbackHandlerExtensionPoint}.\n *\n * @public\n */\nexport interface StaticFallbackHandlerExtensionPoint {\n /**\n * Sets the static fallback handler. This can only be done once.\n */\n setStaticFallbackHandler(handler: Handler): void;\n}\n\n/**\n * An extension point the exposes the ability to configure a static fallback handler for the app backend.\n *\n * The static fallback handler is a request handler to handle requests for static content that is not\n * 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 * @public\n */\nexport const staticFallbackHandlerExtensionPoint =\n createExtensionPoint<StaticFallbackHandlerExtensionPoint>({\n id: 'app.staticFallbackHandler',\n });\n\n/**\n * The interface for {@link configSchemaExtensionPoint}.\n *\n * @public\n */\nexport interface ConfigSchemaExtensionPoint {\n /**\n * Sets the config schema. This can only be done once.\n */\n setConfigSchema(configSchema: ConfigSchema): void;\n}\n\n/**\n * An extension point the exposes the ability to override the config schema used by the frontend application.\n *\n * @public\n */\nexport const configSchemaExtensionPoint =\n createExtensionPoint<ConfigSchemaExtensionPoint>({\n id: 'app.configSchema',\n });\n"],"names":["createExtensionPoint"],"mappings":";;;;AAiDO,MAAM,sCACXA,qCAA0D,CAAA;AAAA,EACxD,EAAI,EAAA,2BAAA;AACN,CAAC,EAAA;AAmBI,MAAM,6BACXA,qCAAiD,CAAA;AAAA,EAC/C,EAAI,EAAA,kBAAA;AACN,CAAC;;;;;"}
package/dist/index.cjs.js CHANGED
@@ -1,33 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var backendPluginApi = require('@backstage/backend-plugin-api');
4
- var fs = require('fs-extra');
5
- var path = require('path');
6
- var configLoader = require('@backstage/config-loader');
3
+ var extensions = require('./extensions.cjs.js');
4
+ var schema = require('./schema.cjs.js');
7
5
 
8
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
9
6
 
10
- var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
11
7
 
12
- const staticFallbackHandlerExtensionPoint = backendPluginApi.createExtensionPoint({
13
- id: "app.staticFallbackHandler"
14
- });
15
- const configSchemaExtensionPoint = backendPluginApi.createExtensionPoint({
16
- id: "app.configSchema"
17
- });
18
-
19
- async function loadCompiledConfigSchema(appDistDir) {
20
- const schemaPath = path.resolve(appDistDir, ".config-schema.json");
21
- if (await fs__default.default.pathExists(schemaPath)) {
22
- const serializedSchema = await fs__default.default.readJson(schemaPath);
23
- return await configLoader.loadConfigSchema({
24
- serialized: serializedSchema
25
- });
26
- }
27
- return void 0;
28
- }
29
-
30
- exports.configSchemaExtensionPoint = configSchemaExtensionPoint;
31
- exports.loadCompiledConfigSchema = loadCompiledConfigSchema;
32
- exports.staticFallbackHandlerExtensionPoint = staticFallbackHandlerExtensionPoint;
8
+ exports.configSchemaExtensionPoint = extensions.configSchemaExtensionPoint;
9
+ exports.staticFallbackHandlerExtensionPoint = extensions.staticFallbackHandlerExtensionPoint;
10
+ exports.loadCompiledConfigSchema = schema.loadCompiledConfigSchema;
33
11
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/extensions.ts","../src/schema.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { ConfigSchema } from '@backstage/config-loader';\nimport { Handler } from 'express';\n\n/**\n * The interface for {@link staticFallbackHandlerExtensionPoint}.\n *\n * @public\n */\nexport interface StaticFallbackHandlerExtensionPoint {\n /**\n * Sets the static fallback handler. This can only be done once.\n */\n setStaticFallbackHandler(handler: Handler): void;\n}\n\n/**\n * An extension point the exposes the ability to configure a static fallback handler for the app backend.\n *\n * The static fallback handler is a request handler to handle requests for static content that is not\n * 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 * @public\n */\nexport const staticFallbackHandlerExtensionPoint =\n createExtensionPoint<StaticFallbackHandlerExtensionPoint>({\n id: 'app.staticFallbackHandler',\n });\n\n/**\n * The interface for {@link configSchemaExtensionPoint}.\n *\n * @public\n */\nexport interface ConfigSchemaExtensionPoint {\n /**\n * Sets the config schema. This can only be done once.\n */\n setConfigSchema(configSchema: ConfigSchema): void;\n}\n\n/**\n * An extension point the exposes the ability to override the config schema used by the frontend application.\n *\n * @public\n */\nexport const configSchemaExtensionPoint =\n createExtensionPoint<ConfigSchemaExtensionPoint>({\n id: 'app.configSchema',\n });\n","/*\n * Copyright 2024 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 fs from 'fs-extra';\nimport { resolve as resolvePath } from 'path';\nimport { ConfigSchema, loadConfigSchema } from '@backstage/config-loader';\n\n/**\n * Loads the config schema that is embedded in the frontend build.\n *\n * @public\n */\nexport async function loadCompiledConfigSchema(\n appDistDir: string,\n): Promise<ConfigSchema | undefined> {\n const schemaPath = resolvePath(appDistDir, '.config-schema.json');\n if (await fs.pathExists(schemaPath)) {\n const serializedSchema = await fs.readJson(schemaPath);\n\n return await loadConfigSchema({\n serialized: serializedSchema,\n });\n }\n\n return undefined;\n}\n"],"names":["createExtensionPoint","resolvePath","fs","loadConfigSchema"],"mappings":";;;;;;;;;;;AAiDO,MAAM,sCACXA,qCAA0D,CAAA;AAAA,EACxD,EAAI,EAAA,2BAAA;AACN,CAAC,EAAA;AAmBI,MAAM,6BACXA,qCAAiD,CAAA;AAAA,EAC/C,EAAI,EAAA,kBAAA;AACN,CAAC;;ACjDH,eAAsB,yBACpB,UACmC,EAAA;AACnC,EAAM,MAAA,UAAA,GAAaC,YAAY,CAAA,UAAA,EAAY,qBAAqB,CAAA,CAAA;AAChE,EAAA,IAAI,MAAMC,mBAAA,CAAG,UAAW,CAAA,UAAU,CAAG,EAAA;AACnC,IAAA,MAAM,gBAAmB,GAAA,MAAMA,mBAAG,CAAA,QAAA,CAAS,UAAU,CAAA,CAAA;AAErD,IAAA,OAAO,MAAMC,6BAAiB,CAAA;AAAA,MAC5B,UAAY,EAAA,gBAAA;AAAA,KACb,CAAA,CAAA;AAAA,GACH;AAEA,EAAO,OAAA,KAAA,CAAA,CAAA;AACT;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ var fs = require('fs-extra');
4
+ var path = require('path');
5
+ var configLoader = require('@backstage/config-loader');
6
+
7
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
8
+
9
+ var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
10
+
11
+ async function loadCompiledConfigSchema(appDistDir) {
12
+ const schemaPath = path.resolve(appDistDir, ".config-schema.json");
13
+ if (await fs__default.default.pathExists(schemaPath)) {
14
+ const serializedSchema = await fs__default.default.readJson(schemaPath);
15
+ return await configLoader.loadConfigSchema({
16
+ serialized: serializedSchema
17
+ });
18
+ }
19
+ return void 0;
20
+ }
21
+
22
+ exports.loadCompiledConfigSchema = loadCompiledConfigSchema;
23
+ //# sourceMappingURL=schema.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.cjs.js","sources":["../src/schema.ts"],"sourcesContent":["/*\n * Copyright 2024 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 fs from 'fs-extra';\nimport { resolve as resolvePath } from 'path';\nimport { ConfigSchema, loadConfigSchema } from '@backstage/config-loader';\n\n/**\n * Loads the config schema that is embedded in the frontend build.\n *\n * @public\n */\nexport async function loadCompiledConfigSchema(\n appDistDir: string,\n): Promise<ConfigSchema | undefined> {\n const schemaPath = resolvePath(appDistDir, '.config-schema.json');\n if (await fs.pathExists(schemaPath)) {\n const serializedSchema = await fs.readJson(schemaPath);\n\n return await loadConfigSchema({\n serialized: serializedSchema,\n });\n }\n\n return undefined;\n}\n"],"names":["resolvePath","fs","loadConfigSchema"],"mappings":";;;;;;;;;;AAyBA,eAAsB,yBACpB,UACmC,EAAA;AACnC,EAAM,MAAA,UAAA,GAAaA,YAAY,CAAA,UAAA,EAAY,qBAAqB,CAAA,CAAA;AAChE,EAAA,IAAI,MAAMC,mBAAA,CAAG,UAAW,CAAA,UAAU,CAAG,EAAA;AACnC,IAAA,MAAM,gBAAmB,GAAA,MAAMA,mBAAG,CAAA,QAAA,CAAS,UAAU,CAAA,CAAA;AAErD,IAAA,OAAO,MAAMC,6BAAiB,CAAA;AAAA,MAC5B,UAAY,EAAA,gBAAA;AAAA,KACb,CAAA,CAAA;AAAA,GACH;AAEA,EAAO,OAAA,KAAA,CAAA,CAAA;AACT;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-app-node",
3
- "version": "0.1.26-next.0",
3
+ "version": "0.1.26-next.1",
4
4
  "description": "Node.js library for the app plugin",
5
5
  "backstage": {
6
6
  "role": "node-library",
@@ -36,13 +36,13 @@
36
36
  "test": "backstage-cli package test"
37
37
  },
38
38
  "dependencies": {
39
- "@backstage/backend-plugin-api": "^1.0.1-next.0",
40
- "@backstage/config-loader": "^1.9.1",
39
+ "@backstage/backend-plugin-api": "1.0.1-next.1",
40
+ "@backstage/config-loader": "1.9.1",
41
41
  "@types/express": "^4.17.6",
42
42
  "express": "^4.17.1",
43
43
  "fs-extra": "^11.2.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@backstage/cli": "^0.28.0-next.0"
46
+ "@backstage/cli": "0.28.0-next.2"
47
47
  }
48
48
  }