@backstage/plugin-techdocs-backend 2.1.8-next.0 → 2.1.8
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 +3 -10
- package/config.d.ts +12 -0
- package/dist/service/CachedEntityLoader.cjs.js.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
# @backstage/plugin-techdocs-backend
|
|
2
2
|
|
|
3
|
-
## 2.1.8
|
|
3
|
+
## 2.1.8
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- 9f76ea4: Added `techdocs.generator.mkdocs.dangerouslyAllowAdditionalPlugins` configuration option, allowing operators to extend the set of permitted MkDocs plugins during TechDocs generation.
|
|
7
8
|
- Updated dependencies
|
|
8
|
-
- @backstage/
|
|
9
|
-
- @backstage/integration@2.0.2-next.0
|
|
10
|
-
- @backstage/backend-plugin-api@1.9.1-next.0
|
|
11
|
-
- @backstage/catalog-client@1.15.1-next.0
|
|
12
|
-
- @backstage/catalog-model@1.8.1-next.0
|
|
13
|
-
- @backstage/config@1.3.8-next.0
|
|
14
|
-
- @backstage/plugin-catalog-node@2.2.1-next.0
|
|
15
|
-
- @backstage/plugin-techdocs-node@1.14.6-next.0
|
|
16
|
-
- @backstage/types@1.2.2
|
|
9
|
+
- @backstage/plugin-techdocs-node@1.14.7
|
|
17
10
|
|
|
18
11
|
## 2.1.7
|
|
19
12
|
|
package/config.d.ts
CHANGED
|
@@ -76,6 +76,18 @@ export interface Config {
|
|
|
76
76
|
* @see https://www.mkdocs.org/user-guide/configuration/#hooks
|
|
77
77
|
*/
|
|
78
78
|
dangerouslyAllowAdditionalKeys?: string[];
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* List of additional MkDocs plugins to allow beyond the default set.
|
|
82
|
+
* Plugins not in this list or the default set will be removed from
|
|
83
|
+
* mkdocs.yml before documentation generation.
|
|
84
|
+
*
|
|
85
|
+
* WARNING: Some MkDocs plugins can make outbound HTTP requests or execute
|
|
86
|
+
* arbitrary code during documentation generation. Only allow plugins that
|
|
87
|
+
* have been audited for use in your environment, including the configuration
|
|
88
|
+
* options that documentation authors can supply.
|
|
89
|
+
*/
|
|
90
|
+
dangerouslyAllowAdditionalPlugins?: string[];
|
|
79
91
|
};
|
|
80
92
|
};
|
|
81
93
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CachedEntityLoader.cjs.js","sources":["../../src/service/CachedEntityLoader.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 BackstageCredentials,\n CacheService,\n} from '@backstage/backend-plugin-api';\nimport {\n Entity,\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { CatalogService } from '@backstage/plugin-catalog-node';\n\
|
|
1
|
+
{"version":3,"file":"CachedEntityLoader.cjs.js","sources":["../../src/service/CachedEntityLoader.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 BackstageCredentials,\n CacheService,\n} from '@backstage/backend-plugin-api';\nimport {\n Entity,\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { CatalogService } from '@backstage/plugin-catalog-node';\n\nexport type CachedEntityLoaderOptions = {\n catalog: CatalogService;\n cache: CacheService;\n};\n\nexport class CachedEntityLoader {\n private readonly catalog: CatalogService;\n private readonly cache: CacheService;\n private readonly readTimeout = 1000;\n\n constructor({ catalog, cache }: CachedEntityLoaderOptions) {\n this.catalog = catalog;\n this.cache = cache;\n }\n\n async load(\n credentials: BackstageCredentials,\n entityRef: CompoundEntityRef,\n ): Promise<Entity | undefined> {\n const cacheKey = this.getCacheKey(entityRef, credentials);\n let result = await this.getFromCache(cacheKey);\n\n if (result) {\n return result;\n }\n\n result = await this.catalog.getEntityByRef(entityRef, { credentials });\n\n if (result) {\n this.cache.set(cacheKey, result, { ttl: 5000 });\n }\n\n return result;\n }\n\n private async getFromCache(key: string): Promise<Entity | undefined> {\n // Promise.race ensures we don't hang the client for long if the cache is\n // temporarily unreachable.\n return (await Promise.race([\n this.cache.get(key),\n new Promise(cancelAfter => setTimeout(cancelAfter, this.readTimeout)),\n ])) as Entity | undefined;\n }\n\n private getCacheKey(\n entityName: CompoundEntityRef,\n credentials: BackstageCredentials,\n ): string {\n return [\n 'catalog',\n stringifyEntityRef(entityName),\n String(credentials), // these have a well defined toString method\n ].join(':');\n }\n}\n"],"names":["stringifyEntityRef"],"mappings":";;;;AAgCO,MAAM,kBAAA,CAAmB;AAAA,EACb,OAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA,GAAc,GAAA;AAAA,EAE/B,WAAA,CAAY,EAAE,OAAA,EAAS,KAAA,EAAM,EAA8B;AACzD,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AACf,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AAAA,EAEA,MAAM,IAAA,CACJ,WAAA,EACA,SAAA,EAC6B;AAC7B,IAAA,MAAM,QAAA,GAAW,IAAA,CAAK,WAAA,CAAY,SAAA,EAAW,WAAW,CAAA;AACxD,IAAA,IAAI,MAAA,GAAS,MAAM,IAAA,CAAK,YAAA,CAAa,QAAQ,CAAA;AAE7C,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,OAAO,MAAA;AAAA,IACT;AAEA,IAAA,MAAA,GAAS,MAAM,IAAA,CAAK,OAAA,CAAQ,eAAe,SAAA,EAAW,EAAE,aAAa,CAAA;AAErE,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,IAAA,CAAK,MAAM,GAAA,CAAI,QAAA,EAAU,QAAQ,EAAE,GAAA,EAAK,KAAM,CAAA;AAAA,IAChD;AAEA,IAAA,OAAO,MAAA;AAAA,EACT;AAAA,EAEA,MAAc,aAAa,GAAA,EAA0C;AAGnE,IAAA,OAAQ,MAAM,QAAQ,IAAA,CAAK;AAAA,MACzB,IAAA,CAAK,KAAA,CAAM,GAAA,CAAI,GAAG,CAAA;AAAA,MAClB,IAAI,OAAA,CAAQ,CAAA,WAAA,KAAe,WAAW,WAAA,EAAa,IAAA,CAAK,WAAW,CAAC;AAAA,KACrE,CAAA;AAAA,EACH;AAAA,EAEQ,WAAA,CACN,YACA,WAAA,EACQ;AACR,IAAA,OAAO;AAAA,MACL,SAAA;AAAA,MACAA,gCAAmB,UAAU,CAAA;AAAA,MAC7B,OAAO,WAAW;AAAA;AAAA,KACpB,CAAE,KAAK,GAAG,CAAA;AAAA,EACZ;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-techdocs-backend",
|
|
3
|
-
"version": "2.1.8
|
|
3
|
+
"version": "2.1.8",
|
|
4
4
|
"description": "The Backstage backend plugin that renders technical documentation for your components",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin",
|
|
@@ -75,15 +75,15 @@
|
|
|
75
75
|
"test": "backstage-cli package test"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@backstage/backend-plugin-api": "1.9.
|
|
79
|
-
"@backstage/catalog-client": "1.15.
|
|
80
|
-
"@backstage/catalog-model": "1.8.
|
|
81
|
-
"@backstage/config": "1.3.
|
|
82
|
-
"@backstage/errors": "1.3.
|
|
83
|
-
"@backstage/integration": "2.0.
|
|
84
|
-
"@backstage/plugin-catalog-node": "2.2.
|
|
85
|
-
"@backstage/plugin-techdocs-node": "1.14.
|
|
86
|
-
"@backstage/types": "1.2.2",
|
|
78
|
+
"@backstage/backend-plugin-api": "^1.9.0",
|
|
79
|
+
"@backstage/catalog-client": "^1.15.0",
|
|
80
|
+
"@backstage/catalog-model": "^1.8.0",
|
|
81
|
+
"@backstage/config": "^1.3.7",
|
|
82
|
+
"@backstage/errors": "^1.3.0",
|
|
83
|
+
"@backstage/integration": "^2.0.1",
|
|
84
|
+
"@backstage/plugin-catalog-node": "^2.2.0",
|
|
85
|
+
"@backstage/plugin-techdocs-node": "^1.14.7",
|
|
86
|
+
"@backstage/types": "^1.2.2",
|
|
87
87
|
"express": "^4.22.0",
|
|
88
88
|
"express-promise-router": "^4.1.0",
|
|
89
89
|
"fs-extra": "^11.2.0",
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
"winston": "^3.2.1"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@backstage/backend-defaults": "0.17.
|
|
96
|
-
"@backstage/backend-test-utils": "1.11.
|
|
97
|
-
"@backstage/cli": "0.36.
|
|
95
|
+
"@backstage/backend-defaults": "^0.17.0",
|
|
96
|
+
"@backstage/backend-test-utils": "^1.11.2",
|
|
97
|
+
"@backstage/cli": "^0.36.1",
|
|
98
98
|
"@types/express": "^4.17.6",
|
|
99
99
|
"msw": "^2.0.0",
|
|
100
100
|
"supertest": "^7.0.0"
|