@backstage/plugin-techdocs-node 1.8.2 → 1.9.0

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,18 +1,78 @@
1
1
  # @backstage/plugin-techdocs-node
2
2
 
3
- ## 1.8.2
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 344cfbcfbc: Allow prepared directory clean up for custom preparers
8
+
9
+ When using custom preparer for TechDocs, the `preparedDir` might
10
+ end up taking disk space. This requires all custom preparers to
11
+ implement a new method `shouldCleanPreparedDirectory` which indicates
12
+ whether the prepared directory should be cleaned after generation.
13
+
14
+ - d06b30b050: Add possibility to use a mkdocs config file with a different name than `mkdocs.<yaml|yml> with the serve command using the `--mkdocs-config-file-name` argument
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+ - @backstage/backend-common@0.19.8
20
+ - @backstage/integration@1.7.1
21
+ - @backstage/catalog-model@1.4.3
22
+ - @backstage/errors@1.2.3
23
+ - @backstage/config@1.1.1
24
+ - @backstage/integration-aws-node@0.1.7
25
+ - @backstage/plugin-search-common@1.2.7
26
+
27
+ ## 1.9.0-next.2
28
+
29
+ ### Minor Changes
30
+
31
+ - 344cfbcfbc: Allow prepared directory clean up for custom preparers
32
+
33
+ When using custom preparer for TechDocs, the `preparedDir` might
34
+ end up taking disk space. This requires all custom preparers to
35
+ implement a new method `shouldCleanPreparedDirectory` which indicates
36
+ whether the prepared directory should be cleaned after generation.
37
+
38
+ - d06b30b050: Add possibility to use a mkdocs config file with a different name than `mkdocs.<yaml|yml> with the serve command using the `--mkdocs-config-file-name` argument
4
39
 
5
40
  ### Patch Changes
6
41
 
7
42
  - Updated dependencies
8
- - @backstage/backend-common@0.19.7
43
+ - @backstage/backend-common@0.19.8-next.2
44
+ - @backstage/catalog-model@1.4.3-next.0
45
+ - @backstage/integration@1.7.1-next.1
46
+ - @backstage/errors@1.2.3-next.0
47
+ - @backstage/config@1.1.1-next.0
48
+ - @backstage/integration-aws-node@0.1.7-next.0
49
+ - @backstage/plugin-search-common@1.2.7-next.0
9
50
 
10
- ## 1.8.1
51
+ ## 1.8.2-next.1
11
52
 
12
53
  ### Patch Changes
13
54
 
14
55
  - Updated dependencies
15
- - @backstage/backend-common@0.19.6
56
+ - @backstage/backend-common@0.19.7-next.1
57
+ - @backstage/config@1.1.0
58
+ - @backstage/integration-aws-node@0.1.6
59
+ - @backstage/catalog-model@1.4.2
60
+ - @backstage/errors@1.2.2
61
+ - @backstage/integration@1.7.1-next.0
62
+ - @backstage/plugin-search-common@1.2.6
63
+
64
+ ## 1.8.2-next.0
65
+
66
+ ### Patch Changes
67
+
68
+ - Updated dependencies
69
+ - @backstage/integration@1.7.1-next.0
70
+ - @backstage/backend-common@0.19.7-next.0
71
+ - @backstage/config@1.1.0
72
+ - @backstage/integration-aws-node@0.1.6
73
+ - @backstage/catalog-model@1.4.2
74
+ - @backstage/errors@1.2.2
75
+ - @backstage/plugin-search-common@1.2.6
16
76
 
17
77
  ## 1.8.0
18
78
 
package/dist/index.cjs.js CHANGED
@@ -226,10 +226,22 @@ const generateMkdocsYml = async (inputDir, siteOptions) => {
226
226
  throw new errors.ForwardedError("Could not generate mkdocs.yml file", error);
227
227
  }
228
228
  };
229
- const getMkdocsYml = async (inputDir, siteOptions) => {
229
+ const getMkdocsYml = async (inputDir, options) => {
230
230
  let mkdocsYmlPath;
231
231
  let mkdocsYmlFileString;
232
232
  try {
233
+ if (options == null ? void 0 : options.mkdocsConfigFileName) {
234
+ mkdocsYmlPath = path__default["default"].join(inputDir, options.mkdocsConfigFileName);
235
+ if (!await fs__default["default"].pathExists(mkdocsYmlPath)) {
236
+ throw new Error(`The specified file ${mkdocsYmlPath} does not exist`);
237
+ }
238
+ mkdocsYmlFileString = await fs__default["default"].readFile(mkdocsYmlPath, "utf8");
239
+ return {
240
+ path: mkdocsYmlPath,
241
+ content: mkdocsYmlFileString,
242
+ configIsTemporary: false
243
+ };
244
+ }
233
245
  mkdocsYmlPath = path__default["default"].join(inputDir, "mkdocs.yaml");
234
246
  if (await fs__default["default"].pathExists(mkdocsYmlPath)) {
235
247
  mkdocsYmlFileString = await fs__default["default"].readFile(mkdocsYmlPath, "utf8");
@@ -248,7 +260,7 @@ const getMkdocsYml = async (inputDir, siteOptions) => {
248
260
  configIsTemporary: false
249
261
  };
250
262
  }
251
- await generateMkdocsYml(inputDir, siteOptions);
263
+ await generateMkdocsYml(inputDir, options);
252
264
  mkdocsYmlFileString = await fs__default["default"].readFile(mkdocsYmlPath, "utf8");
253
265
  } catch (error) {
254
266
  throw new errors.ForwardedError(
@@ -726,6 +738,10 @@ class DirectoryPreparer {
726
738
  static fromConfig(config, options) {
727
739
  return new DirectoryPreparer(config, options.logger, options.reader);
728
740
  }
741
+ /** {@inheritDoc PreparerBase.shouldCleanPreparedDirectory} */
742
+ shouldCleanPreparedDirectory() {
743
+ return false;
744
+ }
729
745
  /** {@inheritDoc PreparerBase.prepare} */
730
746
  async prepare(entity, options) {
731
747
  var _a, _b;
@@ -785,6 +801,10 @@ class UrlPreparer {
785
801
  static fromConfig(options) {
786
802
  return new UrlPreparer(options.reader, options.logger);
787
803
  }
804
+ /** {@inheritDoc PreparerBase.shouldCleanPreparedDirectory} */
805
+ shouldCleanPreparedDirectory() {
806
+ return true;
807
+ }
788
808
  /** {@inheritDoc PreparerBase.prepare} */
789
809
  async prepare(entity, options) {
790
810
  try {