@backstage/plugin-techdocs-node 0.0.0-nightly-20260928023907 → 0.0.0-nightly-20261028022344

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,19 +1,86 @@
1
1
  # @backstage/plugin-techdocs-node
2
2
 
3
- ## 0.0.0-nightly-20260928023907
3
+ ## 0.0.0-nightly-20261028022344
4
+
5
+ ### Minor Changes
6
+
7
+ - a4604d2: Added a new `@backstage/plugin-techdocs-node/alpha` entry point with building blocks for implementing additional documentation engines in separate modules: `createDockerContainerRunner`, `createOrUpdateMetadata`, `storeEtagMetadata`, `runCommand`, `validateInputDirectory`, `patchIndexPreBuild`, and the `mkdocs.yml` helpers `MKDOCS_SCHEMA`, `validateMkdocsYaml` and `sanitizeMkdocsYml`. These are alpha and may change in minor releases.
8
+
9
+ ### Patch Changes
10
+
11
+ - 686d3cb: Fixed TechDocs served from Azure Blob Storage or Google Cloud Storage keeping storage connections open when a browser navigates away before a file is fully loaded. Errors that occur while streaming a file from Azure Blob Storage are now also logged and handled, instead of being left unhandled.
12
+ - 2e98895: Fixed TechDocs served from AWS S3 leaking S3 connections when a browser navigates away before a file is fully loaded. Over time the connection pool was exhausted and all TechDocs pages failed to load with `Socket timed out without establishing a connection` errors until the backend was restarted.
13
+ - Updated dependencies
14
+ - @backstage/backend-plugin-api@0.0.0-nightly-20261028022344
15
+ - @backstage/integration@2.1.3
16
+ - @backstage/catalog-model@1.10.2
17
+ - @backstage/config@1.3.10
18
+ - @backstage/errors@1.3.2
19
+ - @backstage/integration-aws-node@0.2.3
20
+ - @backstage/plugin-search-common@1.2.26
21
+ - @backstage/plugin-techdocs-common@0.1.2
22
+
23
+ ## 2.2.0-next.0
24
+
25
+ ### Minor Changes
26
+
27
+ - a4604d2: Added a new `@backstage/plugin-techdocs-node/alpha` entry point with building blocks for implementing additional documentation engines in separate modules: `createDockerContainerRunner`, `createOrUpdateMetadata`, `storeEtagMetadata`, `runCommand`, `validateInputDirectory`, `patchIndexPreBuild`, and the `mkdocs.yml` helpers `MKDOCS_SCHEMA`, `validateMkdocsYaml` and `sanitizeMkdocsYml`. These are alpha and may change in minor releases.
28
+
29
+ ### Patch Changes
30
+
31
+ - 686d3cb: Fixed TechDocs served from Azure Blob Storage or Google Cloud Storage keeping storage connections open when a browser navigates away before a file is fully loaded. Errors that occur while streaming a file from Azure Blob Storage are now also logged and handled, instead of being left unhandled.
32
+ - 2e98895: Fixed TechDocs served from AWS S3 leaking S3 connections when a browser navigates away before a file is fully loaded. Over time the connection pool was exhausted and all TechDocs pages failed to load with `Socket timed out without establishing a connection` errors until the backend was restarted.
33
+ - Updated dependencies
34
+ - @backstage/backend-plugin-api@1.11.1-next.0
35
+
36
+ ## 2.1.0
37
+
38
+ ### Minor Changes
39
+
40
+ - 4d4f987: Add engine abstraction layer for multi-engine TechDocs support. Introduces `--engine` flag, engine config map, generator registry with `backstage.io/techdocs-engine` annotation support, `engine` field in `techdocs_metadata.json`, `serve:raw` command, and live-reload adapter interface. MkDocs remains the default with no behavior change.
41
+
42
+ The built-in generator is now registered under `mkdocs`; the previous `techdocs` key is kept as an alias, so existing `generators.register('techdocs', ...)` calls continue to work. The CLI's `--engine` flag takes precedence over the `backstage.io/techdocs-engine` annotation for all commands, and `serve:mkdocs` and the `--mkdocs-parameter-*` flags now print deprecation warnings.
4
43
 
5
44
  ### Patch Changes
6
45
 
7
46
  - 9fc5387: Improved handling of mapping-style Markdown extension configuration.
47
+ - 0fd5fe5: Fixed TechDocs allowing `custom_icons` paths in `mkdocs.yml` that resolve outside the documentation input directory. A `custom_icons` option with such a path is now removed from the configuration with a warning.
48
+ - 8a37336: Fixed TechDocs generation rejecting `mkdocs.yml` files that use the emoji indexes and generators or the `pymdownx.superfences` custom fence formats documented by mkdocs-material, pymdown-extensions and mkdocs-mermaid2.
49
+ - 76ac6ed: Updated dependency `js-yaml` to `^5.0.0`.
8
50
  - Updated dependencies
9
- - @backstage/integration@0.0.0-nightly-20260928023907
10
- - @backstage/config@0.0.0-nightly-20260928023907
11
- - @backstage/errors@0.0.0-nightly-20260928023907
12
- - @backstage/backend-plugin-api@0.0.0-nightly-20260928023907
13
- - @backstage/integration-aws-node@0.0.0-nightly-20260928023907
14
- - @backstage/catalog-model@0.0.0-nightly-20260928023907
15
- - @backstage/plugin-search-common@0.0.0-nightly-20260928023907
16
- - @backstage/plugin-techdocs-common@0.1.1
51
+ - @backstage/integration@2.1.3
52
+ - @backstage/backend-plugin-api@1.11.0
53
+ - @backstage/config@1.3.10
54
+ - @backstage/errors@1.3.2
55
+ - @backstage/plugin-techdocs-common@0.1.2
56
+ - @backstage/catalog-model@1.10.2
57
+ - @backstage/integration-aws-node@0.2.3
58
+ - @backstage/plugin-search-common@1.2.26
59
+
60
+ ## 2.0.3-next.2
61
+
62
+ ### Patch Changes
63
+
64
+ - 76ac6ed: Updated dependency `js-yaml` to `^5.0.0`.
65
+ - Updated dependencies
66
+ - @backstage/integration@2.1.3-next.1
67
+ - @backstage/plugin-techdocs-common@0.1.2-next.0
68
+
69
+ ## 2.0.3-next.1
70
+
71
+ ### Patch Changes
72
+
73
+ - Bumped version to account for a patch release.
74
+
75
+ ## 2.0.2-next.1
76
+
77
+ ### Patch Changes
78
+
79
+ - 9fc5387: Improved handling of mapping-style Markdown extension configuration.
80
+ - 0fd5fe5: Fixed TechDocs allowing `custom_icons` paths in `mkdocs.yml` that resolve outside the documentation input directory. A `custom_icons` option with such a path is now removed from the configuration with a warning.
81
+ - 8a37336: Fixed TechDocs generation rejecting `mkdocs.yml` files that use the emoji indexes and generators or the `pymdownx.superfences` custom fence formats documented by mkdocs-material, pymdown-extensions and mkdocs-mermaid2.
82
+ - Updated dependencies
83
+ - @backstage/backend-plugin-api@1.11.0-next.1
17
84
 
18
85
  ## 2.0.1-next.0
19
86
 
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var DockerContainerRunner = require('./stages/generate/DockerContainerRunner.cjs.js');
4
+ var mkdocsPatchers = require('./stages/generate/mkdocsPatchers.cjs.js');
5
+ var helpers = require('./stages/generate/helpers.cjs.js');
6
+
7
+ function createDockerContainerRunner() {
8
+ return new DockerContainerRunner.DockerContainerRunner();
9
+ }
10
+
11
+ exports.sanitizeMkdocsYml = mkdocsPatchers.sanitizeMkdocsYml;
12
+ exports.MKDOCS_SCHEMA = helpers.MKDOCS_SCHEMA;
13
+ exports.createOrUpdateMetadata = helpers.createOrUpdateMetadata;
14
+ exports.patchIndexPreBuild = helpers.patchIndexPreBuild;
15
+ exports.runCommand = helpers.runCommand;
16
+ exports.storeEtagMetadata = helpers.storeEtagMetadata;
17
+ exports.validateInputDirectory = helpers.validateInputDirectory;
18
+ exports.validateMkdocsYaml = helpers.validateMkdocsYaml;
19
+ exports.createDockerContainerRunner = createDockerContainerRunner;
20
+ //# sourceMappingURL=alpha.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alpha.cjs.js","sources":["../src/alpha.ts"],"sourcesContent":["/*\n * Copyright 2026 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\n// Building blocks for implementing additional TechDocs generators. These are\n// alpha while the set of engines settles and may change in minor releases.\nimport type { TechDocsContainerRunner } from '@backstage/plugin-techdocs-node';\nimport { DockerContainerRunner } from './stages/generate/DockerContainerRunner';\n\nexport { sanitizeMkdocsYml } from './stages/generate/mkdocsPatchers';\nexport {\n createOrUpdateMetadata,\n storeEtagMetadata,\n runCommand,\n validateInputDirectory,\n patchIndexPreBuild,\n validateMkdocsYaml,\n MKDOCS_SCHEMA,\n} from './stages/generate/helpers';\nexport type { RunCommandOptions } from './stages/generate/helpers';\n\n/**\n * Creates a container runner that uses the local Docker daemon, the same one\n * the built-in MkDocs generator uses.\n *\n * @alpha\n */\nexport function createDockerContainerRunner(): TechDocsContainerRunner {\n return new DockerContainerRunner();\n}\n"],"names":["DockerContainerRunner"],"mappings":";;;;;;AAuCO,SAAS,2BAAA,GAAuD;AACrE,EAAA,OAAO,IAAIA,2CAAA,EAAsB;AACnC;;;;;;;;;;"}
@@ -0,0 +1,35 @@
1
+ import { TechDocsContainerRunner } from '@backstage/plugin-techdocs-node';
2
+ import { LoggerService } from '@backstage/backend-plugin-api';
3
+ export { M as MKDOCS_SCHEMA, R as RunCommandOptions, c as createOrUpdateMetadata, p as patchIndexPreBuild, r as runCommand, s as storeEtagMetadata, v as validateInputDirectory, a as validateMkdocsYaml } from './types/helpers.d-DkvPJaTo.js';
4
+ import 'node:child_process';
5
+ import 'js-yaml';
6
+ import 'node:stream';
7
+
8
+ /**
9
+ * Sanitize mkdocs.yml by keeping only allowed configuration keys.
10
+ *
11
+ * TechDocs only supports a subset of MkDocs configuration options.
12
+ * This function reconstructs the config with only allowed keys,
13
+ * discarding everything else. This approach ensures that any unknown
14
+ * or potentially dangerous configuration options are not passed to MkDocs.
15
+ *
16
+ * The file is always rewritten to ensure YAML features like merge keys
17
+ * and anchors are resolved into plain configuration.
18
+ *
19
+ * @param mkdocsYmlPath - Absolute path to mkdocs.yml or equivalent of a docs site
20
+ * @param logger - A logger instance
21
+ * @param additionalAllowedKeys - Optional array of additional keys to allow beyond the default allowlist
22
+ * @param additionalAllowedPlugins - Optional array of additional plugins to allow beyond the default set
23
+ * @alpha
24
+ */
25
+ declare const sanitizeMkdocsYml: (mkdocsYmlPath: string, logger: LoggerService, additionalAllowedKeys?: string[], additionalAllowedPlugins?: string[]) => Promise<void>;
26
+
27
+ /**
28
+ * Creates a container runner that uses the local Docker daemon, the same one
29
+ * the built-in MkDocs generator uses.
30
+ *
31
+ * @alpha
32
+ */
33
+ declare function createDockerContainerRunner(): TechDocsContainerRunner;
34
+
35
+ export { createDockerContainerRunner, sanitizeMkdocsYml };
@@ -1 +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 */\nimport { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { DocsBuildStrategy } from './techdocsTypes';\nimport {\n PreparerBase,\n PublisherBase,\n PublisherType,\n RemoteProtocol,\n TechdocsGenerator,\n} from './stages';\nimport * as winston from 'winston';\nimport { PublisherSettings } from './stages/publish/types';\n\n/**\n * Extension point type for configuring TechDocs builds.\n *\n * @public\n */\nexport interface TechdocsBuildsExtensionPoint {\n setBuildStrategy(buildStrategy: DocsBuildStrategy): void;\n setBuildLogTransport(transport: winston.transport): void;\n}\n\n/**\n * Extension point for configuring TechDocs builds.\n *\n * @public\n */\nexport const techdocsBuildsExtensionPoint =\n createExtensionPoint<TechdocsBuildsExtensionPoint>({\n id: 'techdocs.builds',\n });\n\n/**\n * Extension point type for configuring a custom TechDocs generator\n *\n * @public\n */\nexport interface TechdocsGeneratorExtensionPoint {\n setTechdocsGenerator(generator: TechdocsGenerator): void;\n}\n\n/**\n * Extension point for configuring a custom TechDocs generator\n *\n * @public\n */\nexport const techdocsGeneratorExtensionPoint =\n createExtensionPoint<TechdocsGeneratorExtensionPoint>({\n id: 'techdocs.generator',\n });\n\n/**\n * Extension point type for configuring a custom TechDocs preparer\n *\n * @public\n */\nexport interface TechdocsPreparerExtensionPoint {\n registerPreparer(protocol: RemoteProtocol, preparer: PreparerBase): void;\n}\n\n/**\n * Extension point for configuring a custom TechDocs preparer\n *\n * @public\n */\nexport const techdocsPreparerExtensionPoint =\n createExtensionPoint<TechdocsPreparerExtensionPoint>({\n id: 'techdocs.preparer',\n });\n\n/**\n * Extension point type for configuring a custom TechDocs publisher\n *\n * @public\n */\nexport interface TechdocsPublisherExtensionPoint {\n registerPublisher(type: PublisherType, publisher: PublisherBase): void;\n registerPublisherSettings<T extends keyof PublisherSettings>(\n publisher: T,\n settings: PublisherSettings[T],\n ): void;\n}\n\n/**\n * Extension point for configuring a custom TechDocs publisher\n *\n * @public\n */\nexport const techdocsPublisherExtensionPoint =\n createExtensionPoint<TechdocsPublisherExtensionPoint>({\n id: 'techdocs.publisher',\n });\n"],"names":["createExtensionPoint"],"mappings":";;;;AA0CO,MAAM,+BACXA,qCAAA,CAAmD;AAAA,EACjD,EAAA,EAAI;AACN,CAAC;AAgBI,MAAM,kCACXA,qCAAA,CAAsD;AAAA,EACpD,EAAA,EAAI;AACN,CAAC;AAgBI,MAAM,iCACXA,qCAAA,CAAqD;AAAA,EACnD,EAAA,EAAI;AACN,CAAC;AAoBI,MAAM,kCACXA,qCAAA,CAAsD;AAAA,EACpD,EAAA,EAAI;AACN,CAAC;;;;;"}
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 */\nimport { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { DocsBuildStrategy } from './techdocsTypes';\nimport {\n GeneratorBase,\n PreparerBase,\n PublisherBase,\n PublisherType,\n RemoteProtocol,\n SupportedGeneratorKey,\n} from './stages';\nimport * as winston from 'winston';\nimport { PublisherSettings } from './stages/publish/types';\n\n/**\n * Extension point type for configuring TechDocs builds.\n *\n * @public\n */\nexport interface TechdocsBuildsExtensionPoint {\n setBuildStrategy(buildStrategy: DocsBuildStrategy): void;\n setBuildLogTransport(transport: winston.transport): void;\n}\n\n/**\n * Extension point for configuring TechDocs builds.\n *\n * @public\n */\nexport const techdocsBuildsExtensionPoint =\n createExtensionPoint<TechdocsBuildsExtensionPoint>({\n id: 'techdocs.builds',\n });\n\n/**\n * Extension point type for configuring TechDocs generators.\n *\n * Use `registerGenerator` to add an engine-specific generator from a backend\n * module (e.g. `plugin-techdocs-backend-module-zensical`). The key corresponds\n * to the `backstage.io/techdocs-engine` entity annotation value.\n *\n * `setTechdocsGenerator` is kept for backwards compatibility — it replaces the\n * default MkDocs generator.\n *\n * @public\n */\nexport interface TechdocsGeneratorExtensionPoint {\n setTechdocsGenerator(generator: GeneratorBase): void;\n registerGenerator(key: SupportedGeneratorKey, generator: GeneratorBase): void;\n}\n\n/**\n * Extension point for configuring a custom TechDocs generator\n *\n * @public\n */\nexport const techdocsGeneratorExtensionPoint =\n createExtensionPoint<TechdocsGeneratorExtensionPoint>({\n id: 'techdocs.generator',\n });\n\n/**\n * Extension point type for configuring a custom TechDocs preparer\n *\n * @public\n */\nexport interface TechdocsPreparerExtensionPoint {\n registerPreparer(protocol: RemoteProtocol, preparer: PreparerBase): void;\n}\n\n/**\n * Extension point for configuring a custom TechDocs preparer\n *\n * @public\n */\nexport const techdocsPreparerExtensionPoint =\n createExtensionPoint<TechdocsPreparerExtensionPoint>({\n id: 'techdocs.preparer',\n });\n\n/**\n * Extension point type for configuring a custom TechDocs publisher\n *\n * @public\n */\nexport interface TechdocsPublisherExtensionPoint {\n registerPublisher(type: PublisherType, publisher: PublisherBase): void;\n registerPublisherSettings<T extends keyof PublisherSettings>(\n publisher: T,\n settings: PublisherSettings[T],\n ): void;\n}\n\n/**\n * Extension point for configuring a custom TechDocs publisher\n *\n * @public\n */\nexport const techdocsPublisherExtensionPoint =\n createExtensionPoint<TechdocsPublisherExtensionPoint>({\n id: 'techdocs.publisher',\n });\n"],"names":["createExtensionPoint"],"mappings":";;;;AA2CO,MAAM,+BACXA,qCAAA,CAAmD;AAAA,EACjD,EAAA,EAAI;AACN,CAAC;AAwBI,MAAM,kCACXA,qCAAA,CAAsD;AAAA,EACpD,EAAA,EAAI;AACN,CAAC;AAgBI,MAAM,iCACXA,qCAAA,CAAqD;AAAA,EACnD,EAAA,EAAI;AACN,CAAC;AAoBI,MAAM,kCACXA,qCAAA,CAAsD;AAAA,EACpD,EAAA,EAAI;AACN,CAAC;;;;;"}
package/dist/index.cjs.js CHANGED
@@ -6,6 +6,7 @@ var url = require('./stages/prepare/url.cjs.js');
6
6
  var preparers = require('./stages/prepare/preparers.cjs.js');
7
7
  var publish = require('./stages/publish/publish.cjs.js');
8
8
  var helpers = require('./helpers.cjs.js');
9
+ var techdocsTypes = require('./techdocsTypes.cjs.js');
9
10
  var extensions = require('./extensions.cjs.js');
10
11
  var generators = require('./stages/generate/generators.cjs.js');
11
12
  var techdocs = require('./stages/generate/techdocs.cjs.js');
@@ -22,6 +23,7 @@ exports.getDocFilesFromRepository = helpers.getDocFilesFromRepository;
22
23
  exports.getLocationForEntity = helpers.getLocationForEntity;
23
24
  exports.parseReferenceAnnotation = helpers.parseReferenceAnnotation;
24
25
  exports.transformDirLocation = helpers.transformDirLocation;
26
+ exports.TECHDOCS_ENGINE_CATALOG_ANNOTATION_KEY = techdocsTypes.TECHDOCS_ENGINE_CATALOG_ANNOTATION_KEY;
25
27
  exports.techdocsBuildsExtensionPoint = extensions.techdocsBuildsExtensionPoint;
26
28
  exports.techdocsGeneratorExtensionPoint = extensions.techdocsGeneratorExtensionPoint;
27
29
  exports.techdocsPreparerExtensionPoint = extensions.techdocsPreparerExtensionPoint;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -9,6 +9,9 @@ import { IndexableDocument } from '@backstage/plugin-search-common';
9
9
  import { Writable } from 'node:stream';
10
10
  import * as winston from 'winston';
11
11
  import { Logger } from 'winston';
12
+ export { g as getMkdocsYml } from './types/helpers.d-DkvPJaTo.js';
13
+ import 'node:child_process';
14
+ import 'js-yaml';
12
15
 
13
16
  /**
14
17
  * A unique identifier of the tree blob, usually the commit SHA or etag from the target.
@@ -273,6 +276,7 @@ declare class TechdocsGenerator implements GeneratorBase {
273
276
  */
274
277
  declare class Generators implements GeneratorBuilder {
275
278
  private generatorMap;
279
+ private defaultEngine;
276
280
  /**
277
281
  * Returns a generators instance containing a generator for TechDocs
278
282
  * @param config - A Backstage configuration
@@ -281,7 +285,7 @@ declare class Generators implements GeneratorBuilder {
281
285
  static fromConfig(config: Config, options: {
282
286
  logger: LoggerService;
283
287
  containerRunner?: TechDocsContainerRunner;
284
- customGenerator?: TechdocsGenerator;
288
+ customGenerator?: GeneratorBase;
285
289
  }): Promise<GeneratorBuilder>;
286
290
  /**
287
291
  * Register a generator in the generators collection
@@ -296,24 +300,6 @@ declare class Generators implements GeneratorBuilder {
296
300
  get(entity: Entity): GeneratorBase;
297
301
  }
298
302
 
299
- /**
300
- * Finds and loads the contents of an mkdocs.yml, mkdocs.yaml file, a file
301
- * with a specified name or an ad-hoc created file with minimal config.
302
- * @public
303
- *
304
- * @param inputDir - base dir to be searched for either an mkdocs.yml or mkdocs.yaml file.
305
- * @param options - name: default mkdocs site_name to be used with a ad hoc file default value is "Documentation Site"
306
- * mkdocsConfigFileName (optional): a non-default file name to be used as the config
307
- */
308
- declare const getMkdocsYml: (inputDir: string, options?: {
309
- name?: string;
310
- mkdocsConfigFileName?: string;
311
- }) => Promise<{
312
- path: string;
313
- content: string;
314
- configIsTemporary: boolean;
315
- }>;
316
-
317
303
  /**
318
304
  * @public
319
305
  * @deprecated
@@ -587,6 +573,12 @@ interface DocsBuildStrategy {
587
573
  entity: Entity;
588
574
  }): Promise<boolean>;
589
575
  }
576
+ /**
577
+ * A catalog annotation key indicating which TechDoc Generation Engine to use
578
+ *
579
+ * @public
580
+ */
581
+ declare const TECHDOCS_ENGINE_CATALOG_ANNOTATION_KEY = "backstage.io/techdocs-engine";
590
582
 
591
583
  /**
592
584
  * Extension point type for configuring TechDocs builds.
@@ -604,12 +596,20 @@ interface TechdocsBuildsExtensionPoint {
604
596
  */
605
597
  declare const techdocsBuildsExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<TechdocsBuildsExtensionPoint>;
606
598
  /**
607
- * Extension point type for configuring a custom TechDocs generator
599
+ * Extension point type for configuring TechDocs generators.
600
+ *
601
+ * Use `registerGenerator` to add an engine-specific generator from a backend
602
+ * module (e.g. `plugin-techdocs-backend-module-zensical`). The key corresponds
603
+ * to the `backstage.io/techdocs-engine` entity annotation value.
604
+ *
605
+ * `setTechdocsGenerator` is kept for backwards compatibility — it replaces the
606
+ * default MkDocs generator.
608
607
  *
609
608
  * @public
610
609
  */
611
610
  interface TechdocsGeneratorExtensionPoint {
612
- setTechdocsGenerator(generator: TechdocsGenerator): void;
611
+ setTechdocsGenerator(generator: GeneratorBase): void;
612
+ registerGenerator(key: SupportedGeneratorKey, generator: GeneratorBase): void;
613
613
  }
614
614
  /**
615
615
  * Extension point for configuring a custom TechDocs generator
@@ -647,5 +647,5 @@ interface TechdocsPublisherExtensionPoint {
647
647
  */
648
648
  declare const techdocsPublisherExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<TechdocsPublisherExtensionPoint>;
649
649
 
650
- export { DirectoryPreparer, Generators, Preparers, Publisher, TechdocsGenerator, UrlPreparer, getDocFilesFromRepository, getLocationForEntity, getMkDocsYml, getMkdocsYml, parseReferenceAnnotation, techdocsBuildsExtensionPoint, techdocsGeneratorExtensionPoint, techdocsPreparerExtensionPoint, techdocsPublisherExtensionPoint, transformDirLocation };
650
+ export { DirectoryPreparer, Generators, Preparers, Publisher, TECHDOCS_ENGINE_CATALOG_ANNOTATION_KEY, TechdocsGenerator, UrlPreparer, getDocFilesFromRepository, getLocationForEntity, getMkDocsYml, parseReferenceAnnotation, techdocsBuildsExtensionPoint, techdocsGeneratorExtensionPoint, techdocsPreparerExtensionPoint, techdocsPublisherExtensionPoint, transformDirLocation };
651
651
  export type { ContainerRunnerPullOptions, DocsBuildStrategy, ETag, GeneratorBase, GeneratorBuilder, GeneratorOptions, GeneratorRunOptions, MigrateRequest, ParsedLocationAnnotation, PreparerBase, PreparerBuilder, PreparerConfig, PreparerOptions, PreparerResponse, PublishRequest, PublishResponse, PublisherBase, PublisherBuilder, PublisherFactory, PublisherSettings, PublisherType, ReadinessResponse, RemoteProtocol, SupportedGeneratorKey, TechDocsContainerRunner, TechDocsDocument, TechDocsMetadata, TechdocsBuildsExtensionPoint, TechdocsGeneratorExtensionPoint, TechdocsPreparerExtensionPoint, TechdocsPublisherExtensionPoint };
@@ -1,10 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var helpers = require('./helpers.cjs.js');
4
3
  var techdocs = require('./techdocs.cjs.js');
4
+ var techdocsTypes = require('../../techdocsTypes.cjs.js');
5
5
 
6
+ function normalizeGeneratorKey(key) {
7
+ return key === "techdocs" ? "mkdocs" : key;
8
+ }
6
9
  class Generators {
7
10
  generatorMap = /* @__PURE__ */ new Map();
11
+ defaultEngine = "mkdocs";
8
12
  /**
9
13
  * Returns a generators instance containing a generator for TechDocs
10
14
  * @param config - A Backstage configuration
@@ -12,8 +16,11 @@ class Generators {
12
16
  */
13
17
  static async fromConfig(config, options) {
14
18
  const generators = new Generators();
15
- const techdocsGenerator = options.customGenerator ?? techdocs.TechdocsGenerator.fromConfig(config, options);
16
- generators.register("techdocs", techdocsGenerator);
19
+ const defaultEngine = config.getOptionalString("techdocs.generator.defaultEngine") ?? "mkdocs";
20
+ generators.defaultEngine = defaultEngine;
21
+ options.logger.info(`TechDocs generator defaultEngine: ${defaultEngine}`);
22
+ const mkdocsGenerator = options.customGenerator ?? techdocs.TechdocsGenerator.fromConfig(config, options);
23
+ generators.register("mkdocs", mkdocsGenerator);
17
24
  return generators;
18
25
  }
19
26
  /**
@@ -22,17 +29,26 @@ class Generators {
22
29
  * @param generator - The generator instance to register
23
30
  */
24
31
  register(generatorKey, generator) {
25
- this.generatorMap.set(generatorKey, generator);
32
+ this.generatorMap.set(normalizeGeneratorKey(generatorKey), generator);
26
33
  }
27
34
  /**
28
35
  * Returns the generator for a given TechDocs entity
29
36
  * @param entity - A TechDocs entity instance
30
37
  */
31
38
  get(entity) {
32
- const generatorKey = helpers.getGeneratorKey(entity);
39
+ if (!entity) {
40
+ throw new Error("No entity provided");
41
+ }
42
+ const annotatedEngine = entity.metadata?.annotations?.[techdocsTypes.TECHDOCS_ENGINE_CATALOG_ANNOTATION_KEY];
43
+ const generatorKey = normalizeGeneratorKey(
44
+ annotatedEngine ?? this.defaultEngine
45
+ );
33
46
  const generator = this.generatorMap.get(generatorKey);
34
47
  if (!generator) {
35
- throw new Error(`No generator registered for entity: "${generatorKey}"`);
48
+ const source = annotatedEngine ? `the ${techdocsTypes.TECHDOCS_ENGINE_CATALOG_ANNOTATION_KEY} annotation` : "techdocs.generator.defaultEngine";
49
+ throw new Error(
50
+ `No TechDocs generator registered for engine "${generatorKey}" (from ${source}). Registered engines: ${[...this.generatorMap.keys()].join(", ")}`
51
+ );
36
52
  }
37
53
  return generator;
38
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generators.cjs.js","sources":["../../../src/stages/generate/generators.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { Entity } from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport { getGeneratorKey } from './helpers';\nimport { TechdocsGenerator } from './techdocs';\nimport {\n GeneratorBase,\n GeneratorBuilder,\n SupportedGeneratorKey,\n} from './types';\nimport { LoggerService } from '@backstage/backend-plugin-api';\nimport { TechDocsContainerRunner } from './types';\n\n/**\n * Collection of docs generators\n * @public\n */\nexport class Generators implements GeneratorBuilder {\n private generatorMap = new Map<SupportedGeneratorKey, GeneratorBase>();\n\n /**\n * Returns a generators instance containing a generator for TechDocs\n * @param config - A Backstage configuration\n * @param options - Options to configure the TechDocs generator\n */\n static async fromConfig(\n config: Config,\n options: {\n logger: LoggerService;\n containerRunner?: TechDocsContainerRunner;\n customGenerator?: TechdocsGenerator;\n },\n ): Promise<GeneratorBuilder> {\n const generators = new Generators();\n\n const techdocsGenerator =\n options.customGenerator ?? TechdocsGenerator.fromConfig(config, options);\n generators.register('techdocs', techdocsGenerator);\n\n return generators;\n }\n\n /**\n * Register a generator in the generators collection\n * @param generatorKey - Unique identifier for the generator\n * @param generator - The generator instance to register\n */\n register(generatorKey: SupportedGeneratorKey, generator: GeneratorBase) {\n this.generatorMap.set(generatorKey, generator);\n }\n\n /**\n * Returns the generator for a given TechDocs entity\n * @param entity - A TechDocs entity instance\n */\n get(entity: Entity): GeneratorBase {\n const generatorKey = getGeneratorKey(entity);\n const generator = this.generatorMap.get(generatorKey);\n\n if (!generator) {\n throw new Error(`No generator registered for entity: \"${generatorKey}\"`);\n }\n\n return generator;\n }\n}\n"],"names":["TechdocsGenerator","getGeneratorKey"],"mappings":";;;;;AAgCO,MAAM,UAAA,CAAuC;AAAA,EAC1C,YAAA,uBAAmB,GAAA,EAA0C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOrE,aAAa,UAAA,CACX,MAAA,EACA,OAAA,EAK2B;AAC3B,IAAA,MAAM,UAAA,GAAa,IAAI,UAAA,EAAW;AAElC,IAAA,MAAM,oBACJ,OAAA,CAAQ,eAAA,IAAmBA,0BAAA,CAAkB,UAAA,CAAW,QAAQ,OAAO,CAAA;AACzE,IAAA,UAAA,CAAW,QAAA,CAAS,YAAY,iBAAiB,CAAA;AAEjD,IAAA,OAAO,UAAA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,QAAA,CAAS,cAAqC,SAAA,EAA0B;AACtE,IAAA,IAAA,CAAK,YAAA,CAAa,GAAA,CAAI,YAAA,EAAc,SAAS,CAAA;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,MAAA,EAA+B;AACjC,IAAA,MAAM,YAAA,GAAeC,wBAAgB,MAAM,CAAA;AAC3C,IAAA,MAAM,SAAA,GAAY,IAAA,CAAK,YAAA,CAAa,GAAA,CAAI,YAAY,CAAA;AAEpD,IAAA,IAAI,CAAC,SAAA,EAAW;AACd,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,qCAAA,EAAwC,YAAY,CAAA,CAAA,CAAG,CAAA;AAAA,IACzE;AAEA,IAAA,OAAO,SAAA;AAAA,EACT;AACF;;"}
1
+ {"version":3,"file":"generators.cjs.js","sources":["../../../src/stages/generate/generators.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { Entity } from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport { TechdocsGenerator } from './techdocs';\nimport {\n GeneratorBase,\n GeneratorBuilder,\n SupportedGeneratorKey,\n} from './types';\nimport { LoggerService } from '@backstage/backend-plugin-api';\nimport { TechDocsContainerRunner } from './types';\nimport { TECHDOCS_ENGINE_CATALOG_ANNOTATION_KEY } from '../../techdocsTypes';\n\n/**\n * 'techdocs' was the generator key before engines were introduced, and is\n * kept as an alias of 'mkdocs' so that existing registrations keep working.\n */\nfunction normalizeGeneratorKey(key: SupportedGeneratorKey): string {\n return key === 'techdocs' ? 'mkdocs' : key;\n}\n\n/**\n * Collection of docs generators\n * @public\n */\nexport class Generators implements GeneratorBuilder {\n private generatorMap = new Map<SupportedGeneratorKey, GeneratorBase>();\n private defaultEngine: SupportedGeneratorKey = 'mkdocs';\n\n /**\n * Returns a generators instance containing a generator for TechDocs\n * @param config - A Backstage configuration\n * @param options - Options to configure the TechDocs generator\n */\n static async fromConfig(\n config: Config,\n options: {\n logger: LoggerService;\n containerRunner?: TechDocsContainerRunner;\n customGenerator?: GeneratorBase;\n },\n ): Promise<GeneratorBuilder> {\n const generators = new Generators();\n const defaultEngine =\n config.getOptionalString('techdocs.generator.defaultEngine') ?? 'mkdocs';\n\n generators.defaultEngine = defaultEngine;\n\n options.logger.info(`TechDocs generator defaultEngine: ${defaultEngine}`);\n\n const mkdocsGenerator =\n options.customGenerator ?? TechdocsGenerator.fromConfig(config, options);\n generators.register('mkdocs', mkdocsGenerator);\n\n return generators;\n }\n\n /**\n * Register a generator in the generators collection\n * @param generatorKey - Unique identifier for the generator\n * @param generator - The generator instance to register\n */\n register(generatorKey: SupportedGeneratorKey, generator: GeneratorBase) {\n this.generatorMap.set(normalizeGeneratorKey(generatorKey), generator);\n }\n\n /**\n * Returns the generator for a given TechDocs entity\n * @param entity - A TechDocs entity instance\n */\n get(entity: Entity): GeneratorBase {\n if (!entity) {\n throw new Error('No entity provided');\n }\n\n const annotatedEngine =\n entity.metadata?.annotations?.[TECHDOCS_ENGINE_CATALOG_ANNOTATION_KEY];\n const generatorKey = normalizeGeneratorKey(\n annotatedEngine ?? this.defaultEngine,\n );\n const generator = this.generatorMap.get(generatorKey);\n\n if (!generator) {\n const source = annotatedEngine\n ? `the ${TECHDOCS_ENGINE_CATALOG_ANNOTATION_KEY} annotation`\n : 'techdocs.generator.defaultEngine';\n throw new Error(\n `No TechDocs generator registered for engine \"${generatorKey}\" (from ${source}). ` +\n `Registered engines: ${[...this.generatorMap.keys()].join(', ')}`,\n );\n }\n\n return generator;\n }\n}\n"],"names":["TechdocsGenerator","TECHDOCS_ENGINE_CATALOG_ANNOTATION_KEY"],"mappings":";;;;;AAgCA,SAAS,sBAAsB,GAAA,EAAoC;AACjE,EAAA,OAAO,GAAA,KAAQ,aAAa,QAAA,GAAW,GAAA;AACzC;AAMO,MAAM,UAAA,CAAuC;AAAA,EAC1C,YAAA,uBAAmB,GAAA,EAA0C;AAAA,EAC7D,aAAA,GAAuC,QAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/C,aAAa,UAAA,CACX,MAAA,EACA,OAAA,EAK2B;AAC3B,IAAA,MAAM,UAAA,GAAa,IAAI,UAAA,EAAW;AAClC,IAAA,MAAM,aAAA,GACJ,MAAA,CAAO,iBAAA,CAAkB,kCAAkC,CAAA,IAAK,QAAA;AAElE,IAAA,UAAA,CAAW,aAAA,GAAgB,aAAA;AAE3B,IAAA,OAAA,CAAQ,MAAA,CAAO,IAAA,CAAK,CAAA,kCAAA,EAAqC,aAAa,CAAA,CAAE,CAAA;AAExE,IAAA,MAAM,kBACJ,OAAA,CAAQ,eAAA,IAAmBA,0BAAA,CAAkB,UAAA,CAAW,QAAQ,OAAO,CAAA;AACzE,IAAA,UAAA,CAAW,QAAA,CAAS,UAAU,eAAe,CAAA;AAE7C,IAAA,OAAO,UAAA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,QAAA,CAAS,cAAqC,SAAA,EAA0B;AACtE,IAAA,IAAA,CAAK,YAAA,CAAa,GAAA,CAAI,qBAAA,CAAsB,YAAY,GAAG,SAAS,CAAA;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,MAAA,EAA+B;AACjC,IAAA,IAAI,CAAC,MAAA,EAAQ;AACX,MAAA,MAAM,IAAI,MAAM,oBAAoB,CAAA;AAAA,IACtC;AAEA,IAAA,MAAM,eAAA,GACJ,MAAA,CAAO,QAAA,EAAU,WAAA,GAAcC,oDAAsC,CAAA;AACvE,IAAA,MAAM,YAAA,GAAe,qBAAA;AAAA,MACnB,mBAAmB,IAAA,CAAK;AAAA,KAC1B;AACA,IAAA,MAAM,SAAA,GAAY,IAAA,CAAK,YAAA,CAAa,GAAA,CAAI,YAAY,CAAA;AAEpD,IAAA,IAAI,CAAC,SAAA,EAAW;AACd,MAAA,MAAM,MAAA,GAAS,eAAA,GACX,CAAA,IAAA,EAAOA,oDAAsC,CAAA,WAAA,CAAA,GAC7C,kCAAA;AACJ,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,CAAA,6CAAA,EAAgD,YAAY,CAAA,QAAA,EAAW,MAAM,0BACpD,CAAC,GAAG,IAAA,CAAK,YAAA,CAAa,IAAA,EAAM,CAAA,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,OACnE;AAAA,IACF;AAEA,IAAA,OAAO,SAAA;AAAA,EACT;AACF;;"}
@@ -12,17 +12,29 @@ var helpers = require('../publish/helpers.cjs.js');
12
12
 
13
13
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
14
14
 
15
+ function _interopNamespaceCompat(e) {
16
+ if (e && typeof e === 'object' && 'default' in e) return e;
17
+ var n = Object.create(null);
18
+ if (e) {
19
+ Object.keys(e).forEach(function (k) {
20
+ if (k !== 'default') {
21
+ var d = Object.getOwnPropertyDescriptor(e, k);
22
+ Object.defineProperty(n, k, d.get ? d : {
23
+ enumerable: true,
24
+ get: function () { return e[k]; }
25
+ });
26
+ }
27
+ });
28
+ }
29
+ n.default = e;
30
+ return Object.freeze(n);
31
+ }
32
+
15
33
  var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
16
34
  var gitUrlParse__default = /*#__PURE__*/_interopDefaultCompat(gitUrlParse);
17
- var yaml__default = /*#__PURE__*/_interopDefaultCompat(yaml);
35
+ var yaml__namespace = /*#__PURE__*/_interopNamespaceCompat(yaml);
18
36
  var path__default = /*#__PURE__*/_interopDefaultCompat(path);
19
37
 
20
- function getGeneratorKey(entity) {
21
- if (!entity) {
22
- throw new Error("No entity provided");
23
- }
24
- return "techdocs";
25
- }
26
38
  const runCommand = async ({
27
39
  command,
28
40
  args,
@@ -72,8 +84,28 @@ const getRepoUrlFromLocationAnnotation = (parsedLocationAnnotation, scmIntegrati
72
84
  return {};
73
85
  };
74
86
  const ALLOWED_PYTHON_YAML_TAGS = /* @__PURE__ */ new Set([
87
+ // Emoji indexes; mkdocs-material moved its own from materialx to
88
+ // material.extensions in 9.4.
89
+ "tag:yaml.org,2002:python/name:pymdownx.emoji.emojione",
90
+ "tag:yaml.org,2002:python/name:pymdownx.emoji.gemoji",
91
+ "tag:yaml.org,2002:python/name:pymdownx.emoji.twemoji",
75
92
  "tag:yaml.org,2002:python/name:materialx.emoji.twemoji",
76
- "tag:yaml.org,2002:python/object.apply:materialx.emoji.to_svg",
93
+ "tag:yaml.org,2002:python/name:material.extensions.emoji.twemoji",
94
+ // Emoji generators
95
+ "tag:yaml.org,2002:python/name:pymdownx.emoji.to_alt",
96
+ "tag:yaml.org,2002:python/name:pymdownx.emoji.to_png",
97
+ "tag:yaml.org,2002:python/name:pymdownx.emoji.to_png_sprite",
98
+ "tag:yaml.org,2002:python/name:pymdownx.emoji.to_svg",
99
+ "tag:yaml.org,2002:python/name:pymdownx.emoji.to_svg_sprite",
100
+ "tag:yaml.org,2002:python/name:materialx.emoji.to_svg",
101
+ "tag:yaml.org,2002:python/name:material.extensions.emoji.to_svg",
102
+ // Custom fence formats, used for Mermaid diagrams. The mermaid2 ones come
103
+ // from mkdocs-mermaid2, which mkdocs-techdocs-core does not bundle.
104
+ "tag:yaml.org,2002:python/name:pymdownx.superfences.fence_code_format",
105
+ "tag:yaml.org,2002:python/name:pymdownx.superfences.fence_div_format",
106
+ "tag:yaml.org,2002:python/name:mermaid2.fence_mermaid",
107
+ "tag:yaml.org,2002:python/name:mermaid2.fence_mermaid_custom",
108
+ // Slug factory for toc and pymdownx.tabbed
77
109
  "tag:yaml.org,2002:python/object/apply:pymdownx.slugs.slugify"
78
110
  ]);
79
111
  class UnknownTag {
@@ -87,32 +119,36 @@ class UnknownTag {
87
119
  this.type = type;
88
120
  }
89
121
  }
90
- const MKDOCS_SCHEMA = yaml.DEFAULT_SCHEMA.extend([
91
- new yaml.Type("", {
92
- kind: "scalar",
93
- multi: true,
94
- representName: (o) => o.type,
95
- represent: (o) => o.data ?? "",
96
- instanceOf: UnknownTag,
97
- construct: (data, type) => new UnknownTag(data, type)
122
+ const MKDOCS_SCHEMA = yaml.YAML11_SCHEMA.withTags(
123
+ yaml.defineScalarTag("", {
124
+ matchByTagPrefix: true,
125
+ resolve: (data, _isExplicit, tagName) => new UnknownTag(data, tagName),
126
+ identify: (data) => data instanceof UnknownTag && typeof data.data === "string",
127
+ represent: (data) => data.data,
128
+ representTagName: (data) => data.type
98
129
  }),
99
- new yaml.Type("tag:", {
100
- kind: "mapping",
101
- multi: true,
102
- representName: (o) => o.type,
103
- represent: (o) => o.data ?? "",
104
- instanceOf: UnknownTag,
105
- construct: (data, type) => new UnknownTag(data, type)
130
+ yaml.defineSequenceTag("", {
131
+ matchByTagPrefix: true,
132
+ create: (tagName) => new UnknownTag([], tagName),
133
+ addItem: (carrier, item) => {
134
+ carrier.data.push(item);
135
+ },
136
+ identify: (data) => data instanceof UnknownTag && Array.isArray(data.data),
137
+ represent: (data) => data.data,
138
+ representTagName: (data) => data.type
106
139
  }),
107
- new yaml.Type("", {
108
- kind: "sequence",
109
- multi: true,
110
- representName: (o) => o.type,
111
- represent: (o) => o.data ?? "",
112
- instanceOf: UnknownTag,
113
- construct: (data, type) => new UnknownTag(data, type)
140
+ yaml.defineMappingTag("tag:", {
141
+ matchByTagPrefix: true,
142
+ create: (tagName) => new UnknownTag({}, tagName),
143
+ addPair: (carrier, key, value) => yaml.mapTag.addPair(carrier.data, key, value),
144
+ has: (carrier, key) => yaml.mapTag.has(carrier.data, key),
145
+ keys: (result) => yaml.mapTag.keys(result.data),
146
+ get: (result, key) => yaml.mapTag.get(result.data, key),
147
+ identify: (data) => data instanceof UnknownTag && typeof data.data === "object" && data.data !== null && !Array.isArray(data.data),
148
+ represent: (data) => new Map(Object.entries(data.data)),
149
+ representTagName: (data) => data.type
114
150
  })
115
- ]);
151
+ );
116
152
  const generateMkdocsYml = async (inputDir, siteOptions) => {
117
153
  try {
118
154
  const mkdocsYmlPath = path__default.default.join(inputDir, "mkdocs.yml");
@@ -124,7 +160,7 @@ const generateMkdocsYml = async (inputDir, siteOptions) => {
124
160
  };
125
161
  await fs__default.default.writeFile(
126
162
  mkdocsYmlPath,
127
- yaml__default.default.dump(defaultMkdocsContent, { schema: MKDOCS_SCHEMA })
163
+ yaml__namespace.dump(defaultMkdocsContent, { schema: MKDOCS_SCHEMA })
128
164
  );
129
165
  } catch (error) {
130
166
  throw new errors.ForwardedError("Could not generate mkdocs.yml file", error);
@@ -228,7 +264,7 @@ const ALLOWED_THEME_KEYS = /* @__PURE__ */ new Set([
228
264
  "features"
229
265
  ]);
230
266
  const validateMkdocsYaml = async (inputDir, mkdocsYmlFileString) => {
231
- const mkdocsYml = yaml__default.default.load(mkdocsYmlFileString, {
267
+ const mkdocsYml = yaml__namespace.load(mkdocsYmlFileString, {
232
268
  schema: MKDOCS_SCHEMA
233
269
  });
234
270
  if (mkdocsYml === null || typeof mkdocsYml !== "object") {
@@ -303,7 +339,7 @@ const patchIndexPreBuild = async ({
303
339
  ].join(" ")} exists.`
304
340
  );
305
341
  };
306
- const createOrUpdateMetadata = async (techdocsMetadataPath, logger) => {
342
+ const createOrUpdateMetadata = async (techdocsMetadataPath, logger, engine) => {
307
343
  const techdocsMetadataDir = techdocsMetadataPath.split(path__default.default.sep).slice(0, -1).join(path__default.default.sep);
308
344
  try {
309
345
  await fs__default.default.access(techdocsMetadataPath, fs__default.default.constants.F_OK);
@@ -319,6 +355,9 @@ const createOrUpdateMetadata = async (techdocsMetadataPath, logger) => {
319
355
  throw new Error(message);
320
356
  }
321
357
  json.build_timestamp = Date.now();
358
+ if (engine) {
359
+ json.engine = engine;
360
+ }
322
361
  try {
323
362
  json.files = (await helpers.getFileTreeRecursively(techdocsMetadataDir)).map(
324
363
  (file) => file.replace(`${techdocsMetadataDir}${path__default.default.sep}`, "")
@@ -345,7 +384,6 @@ exports.MKDOCS_SCHEMA = MKDOCS_SCHEMA;
345
384
  exports.UnknownTag = UnknownTag;
346
385
  exports.createOrUpdateMetadata = createOrUpdateMetadata;
347
386
  exports.generateMkdocsYml = generateMkdocsYml;
348
- exports.getGeneratorKey = getGeneratorKey;
349
387
  exports.getMkdocsYml = getMkdocsYml;
350
388
  exports.getRepoUrlFromLocationAnnotation = getRepoUrlFromLocationAnnotation;
351
389
  exports.patchIndexPreBuild = patchIndexPreBuild;