@backstage/plugin-techdocs-node 1.12.9-next.0 → 1.12.9-next.2
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 +32 -0
- package/dist/index.cjs.js +8 -19
- package/dist/index.cjs.js.map +1 -1
- package/package.json +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @backstage/plugin-techdocs-node
|
|
2
2
|
|
|
3
|
+
## 1.12.9-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/backend-plugin-api@0.8.0-next.2
|
|
9
|
+
- @backstage/backend-common@0.23.4-next.2
|
|
10
|
+
- @backstage/plugin-search-common@1.2.14-next.1
|
|
11
|
+
- @backstage/integration@1.14.0-next.0
|
|
12
|
+
- @backstage/integration-aws-node@0.1.12
|
|
13
|
+
- @backstage/catalog-model@1.5.0
|
|
14
|
+
- @backstage/config@1.2.0
|
|
15
|
+
- @backstage/errors@1.2.4
|
|
16
|
+
- @backstage/plugin-techdocs-common@0.1.0-next.0
|
|
17
|
+
|
|
18
|
+
## 1.12.9-next.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 69bd940: Use annotation constants from new techdocs-common package.
|
|
23
|
+
- 949083d: Update `patchMkdocsYmlPrebuild` to modify `repo_url` and `edit_uri` independently.
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
- @backstage/plugin-techdocs-common@0.1.0-next.0
|
|
26
|
+
- @backstage/backend-plugin-api@0.7.1-next.1
|
|
27
|
+
- @backstage/backend-common@0.23.4-next.1
|
|
28
|
+
- @backstage/integration@1.14.0-next.0
|
|
29
|
+
- @backstage/integration-aws-node@0.1.12
|
|
30
|
+
- @backstage/plugin-search-common@1.2.14-next.0
|
|
31
|
+
- @backstage/catalog-model@1.5.0
|
|
32
|
+
- @backstage/config@1.2.0
|
|
33
|
+
- @backstage/errors@1.2.4
|
|
34
|
+
|
|
3
35
|
## 1.12.9-next.0
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -15,6 +15,7 @@ var createLimiter = require('p-limit');
|
|
|
15
15
|
var recursiveReadDir = require('recursive-readdir');
|
|
16
16
|
var Docker = require('dockerode');
|
|
17
17
|
var util = require('util');
|
|
18
|
+
var pluginTechdocsCommon = require('@backstage/plugin-techdocs-common');
|
|
18
19
|
var integrationAwsNode = require('@backstage/integration-aws-node');
|
|
19
20
|
var clientS3 = require('@aws-sdk/client-s3');
|
|
20
21
|
var credentialProviders = require('@aws-sdk/credential-providers');
|
|
@@ -397,15 +398,15 @@ const patchMkdocsFile = async (mkdocsYmlPath, logger, updateAction) => {
|
|
|
397
398
|
};
|
|
398
399
|
const patchMkdocsYmlPreBuild = async (mkdocsYmlPath, logger, parsedLocationAnnotation, scmIntegrations) => {
|
|
399
400
|
await patchMkdocsFile(mkdocsYmlPath, logger, (mkdocsYml) => {
|
|
400
|
-
if (!("repo_url" in mkdocsYml)
|
|
401
|
+
if (!("repo_url" in mkdocsYml) || !("edit_uri" in mkdocsYml)) {
|
|
401
402
|
const result = getRepoUrlFromLocationAnnotation(
|
|
402
403
|
parsedLocationAnnotation,
|
|
403
404
|
scmIntegrations,
|
|
404
405
|
mkdocsYml.docs_dir
|
|
405
406
|
);
|
|
406
407
|
if (result.repo_url || result.edit_uri) {
|
|
407
|
-
mkdocsYml.repo_url = result.repo_url;
|
|
408
|
-
mkdocsYml.edit_uri = result.edit_uri;
|
|
408
|
+
mkdocsYml.repo_url = mkdocsYml.repo_url || result.repo_url;
|
|
409
|
+
mkdocsYml.edit_uri = mkdocsYml.edit_uri || result.edit_uri;
|
|
409
410
|
logger.info(
|
|
410
411
|
`Set ${JSON.stringify(
|
|
411
412
|
result
|
|
@@ -743,10 +744,7 @@ const transformDirLocation = (entity, dirAnnotation, scmIntegrations) => {
|
|
|
743
744
|
}
|
|
744
745
|
};
|
|
745
746
|
const getLocationForEntity = (entity, scmIntegration) => {
|
|
746
|
-
const annotation = parseReferenceAnnotation(
|
|
747
|
-
"backstage.io/techdocs-ref",
|
|
748
|
-
entity
|
|
749
|
-
);
|
|
747
|
+
const annotation = parseReferenceAnnotation(pluginTechdocsCommon.TECHDOCS_ANNOTATION, entity);
|
|
750
748
|
switch (annotation.type) {
|
|
751
749
|
case "url":
|
|
752
750
|
return annotation;
|
|
@@ -757,10 +755,7 @@ const getLocationForEntity = (entity, scmIntegration) => {
|
|
|
757
755
|
}
|
|
758
756
|
};
|
|
759
757
|
const getDocFilesFromRepository = async (reader, entity, opts) => {
|
|
760
|
-
const { target } = parseReferenceAnnotation(
|
|
761
|
-
"backstage.io/techdocs-ref",
|
|
762
|
-
entity
|
|
763
|
-
);
|
|
758
|
+
const { target } = parseReferenceAnnotation(pluginTechdocsCommon.TECHDOCS_ANNOTATION, entity);
|
|
764
759
|
opts?.logger?.debug(`Reading files from ${target}`);
|
|
765
760
|
const readTreeResponse = await reader.readTree(target, { etag: opts?.etag });
|
|
766
761
|
const preparedDir = await readTreeResponse.dir();
|
|
@@ -792,10 +787,7 @@ class DirectoryPreparer {
|
|
|
792
787
|
}
|
|
793
788
|
/** {@inheritDoc PreparerBase.prepare} */
|
|
794
789
|
async prepare(entity, options) {
|
|
795
|
-
const annotation = parseReferenceAnnotation(
|
|
796
|
-
"backstage.io/techdocs-ref",
|
|
797
|
-
entity
|
|
798
|
-
);
|
|
790
|
+
const annotation = parseReferenceAnnotation(pluginTechdocsCommon.TECHDOCS_ANNOTATION, entity);
|
|
799
791
|
const { type, target } = transformDirLocation(
|
|
800
792
|
entity,
|
|
801
793
|
annotation,
|
|
@@ -903,10 +895,7 @@ class Preparers {
|
|
|
903
895
|
* @returns
|
|
904
896
|
*/
|
|
905
897
|
get(entity) {
|
|
906
|
-
const { type } = parseReferenceAnnotation(
|
|
907
|
-
"backstage.io/techdocs-ref",
|
|
908
|
-
entity
|
|
909
|
-
);
|
|
898
|
+
const { type } = parseReferenceAnnotation(pluginTechdocsCommon.TECHDOCS_ANNOTATION, entity);
|
|
910
899
|
const preparer = this.preparerMap.get(type);
|
|
911
900
|
if (!preparer) {
|
|
912
901
|
throw new Error(`No preparer registered for type: "${type}"`);
|