@microsoft/api-documenter 7.26.22 → 7.26.24

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.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "@microsoft/api-documenter",
3
3
  "entries": [
4
+ {
5
+ "version": "7.26.24",
6
+ "tag": "@microsoft/api-documenter_v7.26.24",
7
+ "date": "Fri, 25 Apr 2025 00:11:32 GMT",
8
+ "comments": {
9
+ "dependency": [
10
+ {
11
+ "comment": "Updating dependency \"@rushstack/heft\" to `0.73.3`"
12
+ }
13
+ ]
14
+ }
15
+ },
16
+ {
17
+ "version": "7.26.23",
18
+ "tag": "@microsoft/api-documenter_v7.26.23",
19
+ "date": "Mon, 21 Apr 2025 22:24:25 GMT",
20
+ "comments": {
21
+ "dependency": [
22
+ {
23
+ "comment": "Updating dependency \"@rushstack/ts-command-line\" to `5.0.0`"
24
+ },
25
+ {
26
+ "comment": "Updating dependency \"@rushstack/heft\" to `0.73.2`"
27
+ }
28
+ ]
29
+ }
30
+ },
4
31
  {
5
32
  "version": "7.26.22",
6
33
  "tag": "@microsoft/api-documenter_v7.26.22",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # Change Log - @microsoft/api-documenter
2
2
 
3
- This log was last generated on Thu, 17 Apr 2025 00:11:21 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 25 Apr 2025 00:11:32 GMT and should not be manually modified.
4
+
5
+ ## 7.26.24
6
+ Fri, 25 Apr 2025 00:11:32 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 7.26.23
11
+ Mon, 21 Apr 2025 22:24:25 GMT
12
+
13
+ _Version update only_
4
14
 
5
15
  ## 7.26.22
6
16
  Thu, 17 Apr 2025 00:11:21 GMT
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.52.3"
8
+ "packageVersion": "7.52.5"
9
9
  }
10
10
  ]
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BaseAction.d.ts","sourceRoot":"","sources":["../../src/cli/BaseAction.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,iBAAiB,EAEjB,KAAK,yBAAyB,EAC/B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,QAAQ,EAKT,MAAM,gCAAgC,CAAC;AAGxC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,8BAAsB,UAAW,SAAQ,iBAAiB;IACxD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAA6B;IACnE,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAA6B;IAEpE,SAAS,aAAa,OAAO,EAAE,yBAAyB;IAwBxD,SAAS,CAAC,aAAa,IAAI,oBAAoB;IA2B/C,OAAO,CAAC,gBAAgB;IAuCxB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;CAe3B"}
1
+ {"version":3,"file":"BaseAction.d.ts","sourceRoot":"","sources":["../../src/cli/BaseAction.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,iBAAiB,EAEjB,KAAK,yBAAyB,EAC/B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,QAAQ,EAKT,MAAM,gCAAgC,CAAC;AAGxC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,8BAAsB,UAAW,SAAQ,iBAAiB;IACxD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAA6B;IACnE,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAA6B;IAEpE,SAAS,aAAa,OAAO,EAAE,yBAAyB;IAuBxD,SAAS,CAAC,aAAa,IAAI,oBAAoB;IA2B/C,OAAO,CAAC,gBAAgB;IAuCxB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;CAe3B"}
@@ -44,7 +44,6 @@ const terminal_1 = require("@rushstack/terminal");
44
44
  class BaseAction extends ts_command_line_1.CommandLineAction {
45
45
  constructor(options) {
46
46
  super(options);
47
- // override
48
47
  this._inputFolderParameter = this.defineStringParameter({
49
48
  parameterLongName: '--input-folder',
50
49
  parameterShortName: '-i',
@@ -1 +1 @@
1
- {"version":3,"file":"BaseAction.js","sourceRoot":"","sources":["../../src/cli/BaseAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAG7B,gEAIoC;AACpC,oEAA0D;AAC1D,wEAMwC;AACxC,kDAA+C;AAQ/C,MAAsB,UAAW,SAAQ,mCAAiB;IAIxD,YAAsB,OAAkC;QACtD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,WAAW;QACX,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAC;YACtD,iBAAiB,EAAE,gBAAgB;YACnC,kBAAkB,EAAE,IAAI;YACxB,YAAY,EAAE,SAAS;YACvB,WAAW,EACT,6EAA6E;gBAC7E,uCAAuC;SAC1C,CAAC,CAAC;QAEH,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,qBAAqB,CAAC;YACvD,iBAAiB,EAAE,iBAAiB;YACpC,kBAAkB,EAAE,IAAI;YACxB,YAAY,EAAE,SAAS;YACvB,WAAW,EACT,sEAAsE;gBACtE,yCAAyC;gBACzC,kCAAkC,IAAI,CAAC,UAAU,GAAG;SACvD,CAAC,CAAC;IACL,CAAC;IAES,aAAa;QACrB,MAAM,QAAQ,GAAa,IAAI,8BAAQ,EAAE,CAAC;QAE1C,MAAM,WAAW,GAAW,IAAI,CAAC,qBAAqB,CAAC,KAAK,IAAI,SAAS,CAAC;QAC1E,IAAI,CAAC,8BAAU,CAAC,MAAM,CAAC,W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AG,SAAS,CAAC;IAC7C,CAAC;CACF;AAjHD,gCAiHC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\nimport type * as tsdoc from '@microsoft/tsdoc';\n\nimport {\n CommandLineAction,\n type CommandLineStringParameter,\n type ICommandLineActionOptions\n} from '@rushstack/ts-command-line';\nimport { FileSystem } from '@rushstack/node-core-library';\nimport {\n ApiModel,\n type ApiItem,\n ApiItemContainerMixin,\n ApiDocumentedItem,\n type IResolveDeclarationReferenceResult\n} from '@microsoft/api-extractor-model';\nimport { Colorize } from '@rushstack/terminal';\n\nexport interface IBuildApiModelResult {\n apiModel: ApiModel;\n inputFolder: string;\n outputFolder: string;\n}\n\nexport abstract class BaseAction extends CommandLineAction {\n private readonly _inputFolderParameter: CommandLineStringParameter;\n private readonly _outputFolderParameter: CommandLineStringParameter;\n\n protected constructor(options: ICommandLineActionOptions) {\n super(options);\n\n // override\n this._inputFolderParameter = this.defineStringParameter({\n parameterLongName: '--input-folder',\n parameterShortName: '-i',\n argumentName: 'FOLDER1',\n description:\n `Specifies the input folder containing the *.api.json files to be processed.` +\n ` If omitted, the default is \"./input\"`\n });\n\n this._outputFolderParameter = this.defineStringParameter({\n parameterLongName: '--output-folder',\n parameterShortName: '-o',\n argumentName: 'FOLDER2',\n description:\n `Specifies the output folder where the documentation will be written.` +\n ` ANY EXISTING CONTENTS WILL BE DELETED!` +\n ` If omitted, the default is \"./${this.actionName}\"`\n });\n }\n\n protected buildApiModel(): IBuildApiModelResult {\n const apiModel: ApiModel = new ApiModel();\n\n const inputFolder: string = this._inputFolderParameter.value || './input';\n if (!FileSystem.exists(inputFolder)) {\n throw new Error('The input folder does not exist: ' + inputFolder);\n }\n\n const outputFolder: string = this._outputFolderParameter.value || `./${this.actionName}`;\n FileSystem.ensureFolder(outputFolder);\n\n for (const filename of FileSystem.readFolderItemNames(inputFolder)) {\n if (filename.match(/\\.api\\.json$/i)) {\n console.log(`Reading ${filename}`);\n const filenamePath: string = path.join(inputFolder, filename);\n apiModel.loadPackage(filenamePath);\n }\n }\n\n this._applyInheritDoc(apiModel, apiModel);\n\n return { apiModel, inputFolder, outputFolder };\n }\n\n // TODO: This is a temporary workaround. The long term plan is for API Extractor's DocCommentEnhancer\n // to apply all @inheritDoc tags before the .api.json file is written.\n // See DocCommentEnhancer._applyInheritDoc() for more info.\n private _applyInheritDoc(apiItem: ApiItem, apiModel: ApiModel): void {\n if (apiItem instanceof ApiDocumentedItem) {\n if (apiItem.tsdocComment) {\n const inheritDocTag: tsdoc.DocInheritDocTag | undefined = apiItem.tsdocComment.inheritDocTag;\n\n if (inheritDocTag && inheritDocTag.declarationReference) {\n // Attempt to resolve the declaration reference\n const result: IResolveDeclarationReferenceResult = apiModel.resolveDeclarationReference(\n inheritDocTag.declarationReference,\n apiItem\n );\n\n if (result.errorMessage) {\n console.log(\n Colorize.yellow(\n `Warning: Unresolved @inheritDoc tag for ${apiItem.displayName}: ` + result.errorMessage\n )\n );\n } else {\n if (\n result.resolvedApiItem instanceof ApiDocumentedItem &&\n result.resolvedApiItem.tsdocComment &&\n result.resolvedApiItem !== apiItem\n ) {\n this._copyInheritedDocs(apiItem.tsdocComment, result.resolvedApiItem.tsdocComment);\n }\n }\n }\n }\n }\n\n // Recurse members\n if (ApiItemContainerMixin.isBaseClassOf(apiItem)) {\n for (const member of apiItem.members) {\n this._applyInheritDoc(member, apiModel);\n }\n }\n }\n\n /**\n * Copy the content from `sourceDocComment` to `targetDocComment`.\n * This code is borrowed from DocCommentEnhancer as a temporary workaround.\n */\n private _copyInheritedDocs(targetDocComment: tsdoc.DocComment, sourceDocComment: tsdoc.DocComment): void {\n targetDocComment.summarySection = sourceDocComment.summarySection;\n targetDocComment.remarksBlock = sourceDocComment.remarksBlock;\n\n targetDocComment.params.clear();\n for (const param of sourceDocComment.params) {\n targetDocComment.params.add(param);\n }\n for (const typeParam of sourceDocComment.typeParams) {\n targetDocComment.typeParams.add(typeParam);\n }\n targetDocComment.returnsBlock = sourceDocComment.returnsBlock;\n\n targetDocComment.inheritDocTag = undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"BaseAction.js","sourceRoot":"","sources":["../../src/cli/BaseAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAG7B,gEAIoC;AACpC,oEAA0D;AAC1D,wEAMwC;AACxC,kDAA+C;AAQ/C,MAAsB,UAAW,SAAQ,mCAAiB;IAIxD,YAAsB,OAAkC;QACtD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAC;YACtD,iBAAiB,EAAE,gBAAgB;YACnC,kBAAkB,EAAE,IAAI;YACxB,YAAY,EAAE,SAAS;YACvB,WAAW,EACT,6EAA6E;gBAC7E,uCAAuC;SAC1C,CAAC,CAAC;QAEH,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,qBAAqB,CAAC;YACvD,iBAAiB,EAAE,iBAAiB;YACpC,kBAAkB,EAAE,IAAI;YACxB,YAAY,EAAE,SAAS;YACvB,WAAW,EACT,sEAAsE;gBACtE,yCAAyC;gBACzC,kCAAkC,IAAI,CAAC,UAAU,GAAG;SACvD,CAAC,CAAC;IACL,CAAC;IAES,aAAa;QACrB,MAAM,QAAQ,GAAa,IAAI,8BAAQ,EAAE,CAAC;QAE1C,MAAM,WAAW,GAAW,IAAI,CAAC,qBAAqB,CAAC,KAAK,IAAI,SAAS,CAAC;QAC1E,IAAI,CAAC,8BAAU,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,mCAAmC,GAAG,WAAW,CAAC,CAAC;QACrE,CAAC;QAED,MAAM,YAAY,GAAW,IAAI,CAAC,sBAAsB,CAAC,KAAK,IAAI,KAAK,IAAI,CAAC,UAAU,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AAe,CAAC,YAAY;4BACnC,MAAM,CAAC,eAAe,KAAK,OAAO,EAClC,CAAC;4BACD,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;wBACrF,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,kBAAkB;QAClB,IAAI,2CAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACrC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;OAGG;IACK,kBAAkB,CAAC,gBAAkC,EAAE,gBAAkC;QAC/F,gBAAgB,CAAC,cAAc,GAAG,gBAAgB,CAAC,cAAc,CAAC;QAClE,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC,YAAY,CAAC;QAE9D,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAChC,KAAK,MAAM,KAAK,IAAI,gBAAgB,CAAC,MAAM,EAAE,CAAC;YAC5C,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;QACD,KAAK,MAAM,SAAS,IAAI,gBAAgB,CAAC,UAAU,EAAE,CAAC;YACpD,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7C,CAAC;QACD,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC,YAAY,CAAC;QAE9D,gBAAgB,CAAC,aAAa,GAAG,SAAS,CAAC;IAC7C,CAAC;CACF;AAhHD,gCAgHC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\nimport type * as tsdoc from '@microsoft/tsdoc';\n\nimport {\n CommandLineAction,\n type CommandLineStringParameter,\n type ICommandLineActionOptions\n} from '@rushstack/ts-command-line';\nimport { FileSystem } from '@rushstack/node-core-library';\nimport {\n ApiModel,\n type ApiItem,\n ApiItemContainerMixin,\n ApiDocumentedItem,\n type IResolveDeclarationReferenceResult\n} from '@microsoft/api-extractor-model';\nimport { Colorize } from '@rushstack/terminal';\n\nexport interface IBuildApiModelResult {\n apiModel: ApiModel;\n inputFolder: string;\n outputFolder: string;\n}\n\nexport abstract class BaseAction extends CommandLineAction {\n private readonly _inputFolderParameter: CommandLineStringParameter;\n private readonly _outputFolderParameter: CommandLineStringParameter;\n\n protected constructor(options: ICommandLineActionOptions) {\n super(options);\n\n this._inputFolderParameter = this.defineStringParameter({\n parameterLongName: '--input-folder',\n parameterShortName: '-i',\n argumentName: 'FOLDER1',\n description:\n `Specifies the input folder containing the *.api.json files to be processed.` +\n ` If omitted, the default is \"./input\"`\n });\n\n this._outputFolderParameter = this.defineStringParameter({\n parameterLongName: '--output-folder',\n parameterShortName: '-o',\n argumentName: 'FOLDER2',\n description:\n `Specifies the output folder where the documentation will be written.` +\n ` ANY EXISTING CONTENTS WILL BE DELETED!` +\n ` If omitted, the default is \"./${this.actionName}\"`\n });\n }\n\n protected buildApiModel(): IBuildApiModelResult {\n const apiModel: ApiModel = new ApiModel();\n\n const inputFolder: string = this._inputFolderParameter.value || './input';\n if (!FileSystem.exists(inputFolder)) {\n throw new Error('The input folder does not exist: ' + inputFolder);\n }\n\n const outputFolder: string = this._outputFolderParameter.value || `./${this.actionName}`;\n FileSystem.ensureFolder(outputFolder);\n\n for (const filename of FileSystem.readFolderItemNames(inputFolder)) {\n if (filename.match(/\\.api\\.json$/i)) {\n console.log(`Reading ${filename}`);\n const filenamePath: string = path.join(inputFolder, filename);\n apiModel.loadPackage(filenamePath);\n }\n }\n\n this._applyInheritDoc(apiModel, apiModel);\n\n return { apiModel, inputFolder, outputFolder };\n }\n\n // TODO: This is a temporary workaround. The long term plan is for API Extractor's DocCommentEnhancer\n // to apply all @inheritDoc tags before the .api.json file is written.\n // See DocCommentEnhancer._applyInheritDoc() for more info.\n private _applyInheritDoc(apiItem: ApiItem, apiModel: ApiModel): void {\n if (apiItem instanceof ApiDocumentedItem) {\n if (apiItem.tsdocComment) {\n const inheritDocTag: tsdoc.DocInheritDocTag | undefined = apiItem.tsdocComment.inheritDocTag;\n\n if (inheritDocTag && inheritDocTag.declarationReference) {\n // Attempt to resolve the declaration reference\n const result: IResolveDeclarationReferenceResult = apiModel.resolveDeclarationReference(\n inheritDocTag.declarationReference,\n apiItem\n );\n\n if (result.errorMessage) {\n console.log(\n Colorize.yellow(\n `Warning: Unresolved @inheritDoc tag for ${apiItem.displayName}: ` + result.errorMessage\n )\n );\n } else {\n if (\n result.resolvedApiItem instanceof ApiDocumentedItem &&\n result.resolvedApiItem.tsdocComment &&\n result.resolvedApiItem !== apiItem\n ) {\n this._copyInheritedDocs(apiItem.tsdocComment, result.resolvedApiItem.tsdocComment);\n }\n }\n }\n }\n }\n\n // Recurse members\n if (ApiItemContainerMixin.isBaseClassOf(apiItem)) {\n for (const member of apiItem.members) {\n this._applyInheritDoc(member, apiModel);\n }\n }\n }\n\n /**\n * Copy the content from `sourceDocComment` to `targetDocComment`.\n * This code is borrowed from DocCommentEnhancer as a temporary workaround.\n */\n private _copyInheritedDocs(targetDocComment: tsdoc.DocComment, sourceDocComment: tsdoc.DocComment): void {\n targetDocComment.summarySection = sourceDocComment.summarySection;\n targetDocComment.remarksBlock = sourceDocComment.remarksBlock;\n\n targetDocComment.params.clear();\n for (const param of sourceDocComment.params) {\n targetDocComment.params.add(param);\n }\n for (const typeParam of sourceDocComment.typeParams) {\n targetDocComment.typeParams.add(typeParam);\n }\n targetDocComment.returnsBlock = sourceDocComment.returnsBlock;\n\n targetDocComment.inheritDocTag = undefined;\n }\n}\n"]}
@@ -2,6 +2,6 @@ import type { ApiDocumenterCommandLine } from './ApiDocumenterCommandLine';
2
2
  import { BaseAction } from './BaseAction';
3
3
  export declare class GenerateAction extends BaseAction {
4
4
  constructor(parser: ApiDocumenterCommandLine);
5
- protected onExecute(): Promise<void>;
5
+ protected onExecuteAsync(): Promise<void>;
6
6
  }
7
7
  //# sourceMappingURL=GenerateAction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenerateAction.d.ts","sourceRoot":"","sources":["../../src/cli/GenerateAction.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,qBAAa,cAAe,SAAQ,UAAU;gBACzB,MAAM,EAAE,wBAAwB;cAUnC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAoC3C"}
1
+ {"version":3,"file":"GenerateAction.d.ts","sourceRoot":"","sources":["../../src/cli/GenerateAction.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,qBAAa,cAAe,SAAQ,UAAU;gBACzB,MAAM,EAAE,wBAAwB;cAU1B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAmCzD"}
@@ -51,8 +51,7 @@ class GenerateAction extends BaseAction_1.BaseAction {
51
51
  ' API Documenter. It is not ready for general usage yet. Its design may change in the future.'
52
52
  });
53
53
  }
54
- async onExecute() {
55
- // override
54
+ async onExecuteAsync() {
56
55
  // Look for the config file under the current folder
57
56
  let configFilePath = path.join(process.cwd(), DocumenterConfig_1.DocumenterConfig.FILENAME);
58
57
  // First try the current folder
@@ -1 +1 @@
1
- {"version":3,"file":"GenerateAction.js","sourceRoot":"","sources":["../../src/cli/GenerateAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAG7B,6CAA0C;AAC1C,sEAA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AQ,EACR,gBAAgB,CACjB,CAAC;YACF,cAAc,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;CACF;AA/CD,wCA+CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\n\nimport type { ApiDocumenterCommandLine } from './ApiDocumenterCommandLine';\nimport { BaseAction } from './BaseAction';\nimport { DocumenterConfig } from '../documenters/DocumenterConfig';\nimport { ExperimentalYamlDocumenter } from '../documenters/ExperimentalYamlDocumenter';\n\nimport { FileSystem } from '@rushstack/node-core-library';\nimport { MarkdownDocumenter } from '../documenters/MarkdownDocumenter';\n\nexport class GenerateAction extends BaseAction {\n public constructor(parser: ApiDocumenterCommandLine) {\n super({\n actionName: 'generate',\n summary: 'EXPERIMENTAL',\n documentation:\n 'EXPERIMENTAL - This action is a prototype of a new config file driven mode of operation for' +\n ' API Documenter. It is not ready for general usage yet. Its design may change in the future.'\n });\n }\n\n protected async onExecute(): Promise<void> {\n // override\n // Look for the config file under the current folder\n\n let configFilePath: string = path.join(process.cwd(), DocumenterConfig.FILENAME);\n\n // First try the current folder\n if (!FileSystem.exists(configFilePath)) {\n // Otherwise try the standard \"config\" subfolder\n configFilePath = path.join(process.cwd(), 'config', DocumenterConfig.FILENAME);\n if (!FileSystem.exists(configFilePath)) {\n throw new Error(\n `Unable to find ${DocumenterConfig.FILENAME} in the current folder or in a \"config\" subfolder`\n );\n }\n }\n\n const documenterConfig: DocumenterConfig = DocumenterConfig.loadFile(configFilePath);\n\n const { apiModel, outputFolder } = this.buildApiModel();\n\n if (documenterConfig.configFile.outputTarget === 'markdown') {\n const markdownDocumenter: MarkdownDocumenter = new MarkdownDocumenter({\n apiModel,\n documenterConfig,\n outputFolder\n });\n markdownDocumenter.generateFiles();\n } else {\n const yamlDocumenter: ExperimentalYamlDocumenter = new ExperimentalYamlDocumenter(\n apiModel,\n documenterConfig\n );\n yaml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,CAAC;YAC5D,MAAM,kBAAkB,GAAuB,IAAI,uCAAkB,CAAC;gBACpE,QAAQ;gBACR,gBAAgB;gBAChB,YAAY;aACb,CAAC,CAAC;YACH,kBAAkB,CAAC,aAAa,EAAE,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,MAAM,cAAc,GAA+B,IAAI,uDAA0B,CAC/E,QAAQ,EACR,gBAAgB,CACjB,CAAC;YACF,cAAc,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;CACF;AA9CD,wCA8CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\n\nimport type { ApiDocumenterCommandLine } from './ApiDocumenterCommandLine';\nimport { BaseAction } from './BaseAction';\nimport { DocumenterConfig } from '../documenters/DocumenterConfig';\nimport { ExperimentalYamlDocumenter } from '../documenters/ExperimentalYamlDocumenter';\n\nimport { FileSystem } from '@rushstack/node-core-library';\nimport { MarkdownDocumenter } from '../documenters/MarkdownDocumenter';\n\nexport class GenerateAction extends BaseAction {\n public constructor(parser: ApiDocumenterCommandLine) {\n super({\n actionName: 'generate',\n summary: 'EXPERIMENTAL',\n documentation:\n 'EXPERIMENTAL - This action is a prototype of a new config file driven mode of operation for' +\n ' API Documenter. It is not ready for general usage yet. Its design may change in the future.'\n });\n }\n\n protected override async onExecuteAsync(): Promise<void> {\n // Look for the config file under the current folder\n\n let configFilePath: string = path.join(process.cwd(), DocumenterConfig.FILENAME);\n\n // First try the current folder\n if (!FileSystem.exists(configFilePath)) {\n // Otherwise try the standard \"config\" subfolder\n configFilePath = path.join(process.cwd(), 'config', DocumenterConfig.FILENAME);\n if (!FileSystem.exists(configFilePath)) {\n throw new Error(\n `Unable to find ${DocumenterConfig.FILENAME} in the current folder or in a \"config\" subfolder`\n );\n }\n }\n\n const documenterConfig: DocumenterConfig = DocumenterConfig.loadFile(configFilePath);\n\n const { apiModel, outputFolder } = this.buildApiModel();\n\n if (documenterConfig.configFile.outputTarget === 'markdown') {\n const markdownDocumenter: MarkdownDocumenter = new MarkdownDocumenter({\n apiModel,\n documenterConfig,\n outputFolder\n });\n markdownDocumenter.generateFiles();\n } else {\n const yamlDocumenter: ExperimentalYamlDocumenter = new ExperimentalYamlDocumenter(\n apiModel,\n documenterConfig\n );\n yamlDocumenter.generateFiles(outputFolder);\n }\n }\n}\n"]}
@@ -2,6 +2,6 @@ import type { ApiDocumenterCommandLine } from './ApiDocumenterCommandLine';
2
2
  import { BaseAction } from './BaseAction';
3
3
  export declare class MarkdownAction extends BaseAction {
4
4
  constructor(parser: ApiDocumenterCommandLine);
5
- protected onExecute(): Promise<void>;
5
+ protected onExecuteAsync(): Promise<void>;
6
6
  }
7
7
  //# sourceMappingURL=MarkdownAction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownAction.d.ts","sourceRoot":"","sources":["../../src/cli/MarkdownAction.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,qBAAa,cAAe,SAAQ,UAAU;gBACzB,MAAM,EAAE,wBAAwB;cAUnC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAW3C"}
1
+ {"version":3,"file":"MarkdownAction.d.ts","sourceRoot":"","sources":["../../src/cli/MarkdownAction.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,qBAAa,cAAe,SAAQ,UAAU;gBACzB,MAAM,EAAE,wBAAwB;cAU1B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAUzD"}
@@ -14,8 +14,7 @@ class MarkdownAction extends BaseAction_1.BaseAction {
14
14
  ' Markdown format, suitable for example for publishing on a GitHub site.'
15
15
  });
16
16
  }
17
- async onExecute() {
18
- // override
17
+ async onExecuteAsync() {
19
18
  const { apiModel, outputFolder } = this.buildApiModel();
20
19
  const markdownDocumenter = new MarkdownDocumenter_1.MarkdownDocumenter({
21
20
  apiModel,
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownAction.js","sourceRoot":"","sources":["../../src/cli/MarkdownAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,6CAA0C;AAC1C,0EAAuE;AAEvE,MAAa,cAAe,SAAQ,uBAAU;IAC5C,YAAmB,MAAgC;QACjD,KAAK,CAAC;YACJ,UAAU,EAAE,UAAU;YACtB,OAAO,EAAE,iDAAiD;YAC1D,aAAa,EACX,yDAAyD;gBACzD,yEAAyE;SAC5E,CAAC,CAAC;IACL,CAAC;IAES,KAAK,CAAC,SAAS;QACvB,WAAW;QACX,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAExD,MAAM,kBAAkB,GAAuB,IAAI,uCAAkB,CAAC;YACpE,QAAQ;YACR,gBAAgB,EAAE,SAAS;YAC3B,YAAY;SACb,CAAC,CAAC;QACH,kBAAkB,CAAC,aAAa,EAAE,CAAC;IACrC,CAAC;CACF;AAtBD,wCAsBC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { ApiDocumenterCommandLine } from './ApiDocumenterCommandLine';\nimport { BaseAction } from './BaseAction';\nimport { MarkdownDocumenter } from '../documenters/MarkdownDocumenter';\n\nexport class MarkdownAction extends BaseAction {\n public constructor(parser: ApiDocumenterCommandLine) {\n super({\n actionName: 'markdown',\n summary: 'Generate documentation as Markdown files (*.md)',\n documentation:\n 'Generates API documentation as a collection of files in' +\n ' Markdown format, suitable for example for publishing on a GitHub site.'\n });\n }\n\n protected async onExecute(): Promise<void> {\n // override\n const { apiModel, outputFolder } = this.buildApiModel();\n\n const markdownDocumenter: MarkdownDocumenter = new MarkdownDocumenter({\n apiModel,\n documenterConfig: undefined,\n outputFolder\n });\n markdownDocumenter.generateFiles();\n }\n}\n"]}
1
+ {"version":3,"file":"MarkdownAction.js","sourceRoot":"","sources":["../../src/cli/MarkdownAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,6CAA0C;AAC1C,0EAAuE;AAEvE,MAAa,cAAe,SAAQ,uBAAU;IAC5C,YAAmB,MAAgC;QACjD,KAAK,CAAC;YACJ,UAAU,EAAE,UAAU;YACtB,OAAO,EAAE,iDAAiD;YAC1D,aAAa,EACX,yDAAyD;gBACzD,yEAAyE;SAC5E,CAAC,CAAC;IACL,CAAC;IAEkB,KAAK,CAAC,cAAc;QACrC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAExD,MAAM,kBAAkB,GAAuB,IAAI,uCAAkB,CAAC;YACpE,QAAQ;YACR,gBAAgB,EAAE,SAAS;YAC3B,YAAY;SACb,CAAC,CAAC;QACH,kBAAkB,CAAC,aAAa,EAAE,CAAC;IACrC,CAAC;CACF;AArBD,wCAqBC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { ApiDocumenterCommandLine } from './ApiDocumenterCommandLine';\nimport { BaseAction } from './BaseAction';\nimport { MarkdownDocumenter } from '../documenters/MarkdownDocumenter';\n\nexport class MarkdownAction extends BaseAction {\n public constructor(parser: ApiDocumenterCommandLine) {\n super({\n actionName: 'markdown',\n summary: 'Generate documentation as Markdown files (*.md)',\n documentation:\n 'Generates API documentation as a collection of files in' +\n ' Markdown format, suitable for example for publishing on a GitHub site.'\n });\n }\n\n protected override async onExecuteAsync(): Promise<void> {\n const { apiModel, outputFolder } = this.buildApiModel();\n\n const markdownDocumenter: MarkdownDocumenter = new MarkdownDocumenter({\n apiModel,\n documenterConfig: undefined,\n outputFolder\n });\n markdownDocumenter.generateFiles();\n }\n}\n"]}
@@ -5,6 +5,6 @@ export declare class YamlAction extends BaseAction {
5
5
  private readonly _newDocfxNamespacesParameter;
6
6
  private readonly _yamlFormatParameter;
7
7
  constructor(parser: ApiDocumenterCommandLine);
8
- protected onExecute(): Promise<void>;
8
+ protected onExecuteAsync(): Promise<void>;
9
9
  }
10
10
  //# sourceMappingURL=YamlAction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"YamlAction.d.ts","sourceRoot":"","sources":["../../src/cli/YamlAction.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,qBAAa,UAAW,SAAQ,UAAU;IACxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA2B;IAC5D,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAA2B;IACxE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAkD;gBAEpE,MAAM,EAAE,wBAAwB;cAiCnC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAc3C"}
1
+ {"version":3,"file":"YamlAction.d.ts","sourceRoot":"","sources":["../../src/cli/YamlAction.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,qBAAa,UAAW,SAAQ,UAAU;IACxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA2B;IAC5D,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAA2B;IACxE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAkD;gBAEpE,MAAM,EAAE,wBAAwB;cAiC1B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAazD"}
@@ -35,8 +35,7 @@ class YamlAction extends BaseAction_1.BaseAction {
35
35
  ` NOTE: This parameter is ignored if you use --office.`
36
36
  });
37
37
  }
38
- async onExecute() {
39
- // override
38
+ async onExecuteAsync() {
40
39
  const { apiModel, inputFolder, outputFolder } = this.buildApiModel();
41
40
  const yamlDocumenter = this._officeParameter.value
42
41
  ? new OfficeYamlDocumenter_1.OfficeYamlDocumenter(apiModel, inputFolder, this._newDocfxNamespacesParameter.value)
@@ -1 +1 @@
1
- {"version":3,"file":"YamlAction.js","sourceRoot":"","sources":["../../src/cli/YamlAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAQ3D,6CAA0C;AAE1C,kEAAgF;AAChF,8EAA2E;AAE3E,MAAa,UAAW,SAAQ,uBAAU;IAKxC,YAAmB,MAAgC;QACjD,KAAK,CAAC;YACJ,UAAU,EAAE,MAAM;YAClB,OAAO,EAAE,kEAAkE;YAC3E,aAAa,EACX,iEAAiE;gBACjE,kFAAkF;gBAClF,YAAY;SACf,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAC/C,iBAAiB,EAAE,UAAU;YAC7B,WAAW,EAAE,6DAA6D;SAC3E,CAAC,CAAC;QACH,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAC3D,iBAAiB,EAAE,wBAAwB;YAC3C,WAAW,EACT,mGAAmG;gBACnG,oGAAoG;gBACpG,4GAA4G;gBAC5G,0EAA0E;SAC7E,CAAC,CAAC;QACH,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,CAAa;YACjE,iBAAiB,EAAE,eAAe;YAClC,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;YAC5B,YAAY,EAAE,KAAK;YACnB,WAAW,EACT,6GAA6G;gBAC7G,yFAAyF;gBACzF,uDAAuD;SAC1D,CAAC,CAAC;IACL,CAAC;IAES,KAAK,CAAC,SAAS;QACvB,WAAW;QACX,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAErE,MAAM,cAAc,GAAmB,IAAI,CAAC,gBAAgB,CAAC,KAAK;YAChE,CAAC,CAAC,IAAI,2CAAoB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,4BAA4B,CAAC,KAAK,CAAC;YAC1F,CAAC,CAAC,IAAI,+BAAc,CAChB,QAAQ,EACR,IAAI,CAAC,4BAA4B,CAAC,KAAK,EACvC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAChC,CAAC;QAEN,cAAc,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;CACF;AApDD,gCAoDC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type {\n CommandLineFlagParameter,\n IRequiredCommandLineChoiceParameter\n} from '@rushstack/ts-command-line';\n\nimport type { ApiDocumenterCommandLine } from './ApiDocumenterCommandLine';\nimport { BaseAction } from './BaseAction';\n\nimport { YamlDocumenter, type YamlFormat } from '../documenters/YamlDocumenter';\nimport { OfficeYamlDocumenter } from '../documenters/OfficeYamlDocumenter';\n\nexport class YamlAction extends BaseAction {\n private readonly _officeParameter: CommandLineFlagParameter;\n private readonly _newDocfxNamespacesParameter: CommandLineFlagParameter;\n private readonly _yamlFormatParameter: IRequiredCommandLineChoiceParameter<YamlFormat>;\n\n public constructor(parser: ApiDocumenterCommandLine) {\n super({\n actionName: 'yaml',\n summary: 'Generate documentation as universal reference YAML files (*.yml)',\n documentation:\n 'Generates API documentation as a collection of files conforming' +\n ' to the universal reference YAML format, which is used by the docs.microsoft.com' +\n ' pipeline.'\n });\n\n this._officeParameter = this.defineFlagParameter({\n parameterLongName: '--office',\n description: `Enables some additional features specific to Office Add-ins`\n });\n this._newDocfxNamespacesParameter = this.defineFlagParameter({\n parameterLongName: '--new-docfx-namespaces',\n description:\n `This enables an experimental feature that will be officially released with the next major version` +\n ` of API Documenter. It requires DocFX 2.46 or newer. It enables documentation for namespaces and` +\n ` adds them to the table of contents. This will also affect file layout as namespaced items will be nested` +\n ` under a directory for the namespace instead of just within the package.`\n });\n this._yamlFormatParameter = this.defineChoiceParameter<YamlFormat>({\n parameterLongName: '--yaml-format',\n alternatives: ['udp', 'sdp'],\n defaultValue: 'sdp',\n description:\n `Specifies the YAML format - udp or sdp. Universal Document Processor (udp) should be used if you generating` +\n ` YAML files for DocFX 2.x. Schema Driven Processor (sdp) should be used with DocFX 3.x.` +\n ` NOTE: This parameter is ignored if you use --office.`\n });\n }\n\n protected async onExecute(): Promise<void> {\n // override\n const { apiModel, inputFolder, outputFolder } = this.buildApiModel();\n\n const yamlDocumenter: YamlDocumenter = this._officeParameter.value\n ? new OfficeYamlDocumenter(apiModel, inputFolder, this._newDocfxNamespacesParameter.value)\n : new YamlDocumenter(\n apiModel,\n this._newDocfxNamespacesParameter.value,\n this._yamlFormatParameter.value\n );\n\n yamlDocumenter.generateFiles(outputFolder);\n }\n}\n"]}
1
+ {"version":3,"file":"YamlAction.js","sourceRoot":"","sources":["../../src/cli/YamlAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAQ3D,6CAA0C;AAE1C,kEAAgF;AAChF,8EAA2E;AAE3E,MAAa,UAAW,SAAQ,uBAAU;IAKxC,YAAmB,MAAgC;QACjD,KAAK,CAAC;YACJ,UAAU,EAAE,MAAM;YAClB,OAAO,EAAE,kEAAkE;YAC3E,aAAa,EACX,iEAAiE;gBACjE,kFAAkF;gBAClF,YAAY;SACf,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAC/C,iBAAiB,EAAE,UAAU;YAC7B,WAAW,EAAE,6DAA6D;SAC3E,CAAC,CAAC;QACH,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAC3D,iBAAiB,EAAE,wBAAwB;YAC3C,WAAW,EACT,mGAAmG;gBACnG,oGAAoG;gBACpG,4GAA4G;gBAC5G,0EAA0E;SAC7E,CAAC,CAAC;QACH,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,CAAa;YACjE,iBAAiB,EAAE,eAAe;YAClC,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;YAC5B,YAAY,EAAE,KAAK;YACnB,WAAW,EACT,6GAA6G;gBAC7G,yFAAyF;gBACzF,uDAAuD;SAC1D,CAAC,CAAC;IACL,CAAC;IAEkB,KAAK,CAAC,cAAc;QACrC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAErE,MAAM,cAAc,GAAmB,IAAI,CAAC,gBAAgB,CAAC,KAAK;YAChE,CAAC,CAAC,IAAI,2CAAoB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,4BAA4B,CAAC,KAAK,CAAC;YAC1F,CAAC,CAAC,IAAI,+BAAc,CAChB,QAAQ,EACR,IAAI,CAAC,4BAA4B,CAAC,KAAK,EACvC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAChC,CAAC;QAEN,cAAc,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;CACF;AAnDD,gCAmDC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type {\n CommandLineFlagParameter,\n IRequiredCommandLineChoiceParameter\n} from '@rushstack/ts-command-line';\n\nimport type { ApiDocumenterCommandLine } from './ApiDocumenterCommandLine';\nimport { BaseAction } from './BaseAction';\n\nimport { YamlDocumenter, type YamlFormat } from '../documenters/YamlDocumenter';\nimport { OfficeYamlDocumenter } from '../documenters/OfficeYamlDocumenter';\n\nexport class YamlAction extends BaseAction {\n private readonly _officeParameter: CommandLineFlagParameter;\n private readonly _newDocfxNamespacesParameter: CommandLineFlagParameter;\n private readonly _yamlFormatParameter: IRequiredCommandLineChoiceParameter<YamlFormat>;\n\n public constructor(parser: ApiDocumenterCommandLine) {\n super({\n actionName: 'yaml',\n summary: 'Generate documentation as universal reference YAML files (*.yml)',\n documentation:\n 'Generates API documentation as a collection of files conforming' +\n ' to the universal reference YAML format, which is used by the docs.microsoft.com' +\n ' pipeline.'\n });\n\n this._officeParameter = this.defineFlagParameter({\n parameterLongName: '--office',\n description: `Enables some additional features specific to Office Add-ins`\n });\n this._newDocfxNamespacesParameter = this.defineFlagParameter({\n parameterLongName: '--new-docfx-namespaces',\n description:\n `This enables an experimental feature that will be officially released with the next major version` +\n ` of API Documenter. It requires DocFX 2.46 or newer. It enables documentation for namespaces and` +\n ` adds them to the table of contents. This will also affect file layout as namespaced items will be nested` +\n ` under a directory for the namespace instead of just within the package.`\n });\n this._yamlFormatParameter = this.defineChoiceParameter<YamlFormat>({\n parameterLongName: '--yaml-format',\n alternatives: ['udp', 'sdp'],\n defaultValue: 'sdp',\n description:\n `Specifies the YAML format - udp or sdp. Universal Document Processor (udp) should be used if you generating` +\n ` YAML files for DocFX 2.x. Schema Driven Processor (sdp) should be used with DocFX 3.x.` +\n ` NOTE: This parameter is ignored if you use --office.`\n });\n }\n\n protected override async onExecuteAsync(): Promise<void> {\n const { apiModel, inputFolder, outputFolder } = this.buildApiModel();\n\n const yamlDocumenter: YamlDocumenter = this._officeParameter.value\n ? new OfficeYamlDocumenter(apiModel, inputFolder, this._newDocfxNamespacesParameter.value)\n : new YamlDocumenter(\n apiModel,\n this._newDocfxNamespacesParameter.value,\n this._yamlFormatParameter.value\n );\n\n yamlDocumenter.generateFiles(outputFolder);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"OfficeYamlDocumenter.d.ts","sourceRoot":"","sources":["../../src/documenters/OfficeYamlDocumenter.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAA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OAAO;IAYxF,gBAAgB;IACT,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAUhD,gBAAgB;IAChB,SAAS,CAAC,YAAY,IAAI,YAAY;IAQtC,gBAAgB;IAChB,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI;IA0BxD,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,2BAA2B;CAOpC"}
@@ -75,7 +75,6 @@ class OfficeYamlDocumenter extends YamlDocumenter_1.YamlDocumenter {
75
75
  }
76
76
  /** @override */
77
77
  onGetTocRoot() {
78
- // override
79
78
  return {
80
79
  name: 'API reference',
81
80
  href: 'overview.md',
@@ -1 +1 @@
1
- {"version":3,"file":"OfficeYamlDocumenter.js","sourceRoot":"","sources":["../../src/documenters/OfficeYamlDocumenter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,gCAAiC;AAGjC,oEAA0D;AAC1D,kDAA+C;AAI/C,qDAAkD;AAUlD;;GAEG;AACH,MAAa,oBAAqB,SAAQ,+BAAc;IAiBtD,YAAmB,QAAkB,EAAE,WAAmB,EAAE,kBAA4B;QACtF,KAAK,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;QAdtC,sDAAsD;QAC9C,sBAAiB,GAAW,yDAAyD,CAAC;QAE9F,6CAA6C;QACrC,gBAAW,GAA2B;YAC5C,KAAK,EAAE,mEAAmE;YAC1E,OAAO,EAAE,uEAAuE;YAChF,OAAO,EAAE,uEAAuE;YAChF,UAAU,EAAE,6EAA6E;YACzF,KAAK,EAAE,4EAA4E;YACnF,IAAI,EAAE,iEAAiE;SACxE,CAAC;QAKA,MAAM,gBAAgB,GAAW,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QAEzE,OAAO,CAAC,GAAG,CAAC,wBAAwB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E,CAAC;YAChD,MAAM,MAAM,GAAW,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAC5C,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,mBAAmB;IACpD,CAAC;IAEO,2BAA2B,CAAC,QAAkB;QACpD,MAAM,IAAI,GAAa,CAAC,qBAAqB,CAAC,CAAC;QAC/C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,IAAI,CAAC,IAAI,CAAC,qBAAqB,OAAO,UAAU,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;CACF;AAzGD,oDAyGC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\nimport yaml = require('js-yaml');\n\nimport type { ApiModel } from '@microsoft/api-extractor-model';\nimport { FileSystem } from '@rushstack/node-core-library';\nimport { Colorize } from '@rushstack/terminal';\n\nimport type { IYamlTocItem } from '../yaml/IYamlTocFile';\nimport type { IYamlItem } from '../yaml/IYamlApiFile';\nimport { YamlDocumenter } from './YamlDocumenter';\n\ninterface ISnippetsFile {\n /**\n * The keys are API names like \"Excel.Range.clear\".\n * The values are TypeScript source code excerpts.\n */\n [apiName: string]: string[];\n}\n\n/**\n * Extends YamlDocumenter with some custom logic that is specific to Office Add-ins.\n */\nexport class OfficeYamlDocumenter extends YamlDocumenter {\n private _snippets: ISnippetsFile;\n private _snippetsAll: ISnippetsFile;\n\n // Default API Set URL when no product match is found.\n private _apiSetUrlDefault: string = '/office/dev/add-ins/reference/javascript-api-for-office';\n\n // Hash set of API Set URLs based on product.\n private _apiSetUrls: Record<string, string> = {\n Excel: '/javascript/api/requirement-sets/excel/excel-api-requirement-sets',\n OneNote: '/javascript/api/requirement-sets/onenote/onenote-api-requirement-sets',\n Outlook: '/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets',\n PowerPoint: '/javascript/api/requirement-sets/powerpoint/powerpoint-api-requirement-sets',\n Visio: '/office/dev/add-ins/reference/overview/visio-javascript-reference-overview',\n Word: '/javascript/api/requirement-sets/word/word-api-requirement-sets'\n };\n\n public constructor(apiModel: ApiModel, inputFolder: string, newDocfxNamespaces?: boolean) {\n super(apiModel, newDocfxNamespaces);\n\n const snippetsFilePath: string = path.join(inputFolder, 'snippets.yaml');\n\n console.log('Loading snippets from ' + snippetsFilePath);\n\n const snippetsContent: string = FileSystem.readFile(snippetsFilePath);\n this._snippets = yaml.load(snippetsContent, { filename: snippetsFilePath });\n this._snippetsAll = yaml.load(snippetsContent, { filename: snippetsFilePath });\n }\n\n /** @override */\n public generateFiles(outputFolder: string): void {\n super.generateFiles(outputFolder);\n\n // After we generate everything, check for any unused snippets\n console.log();\n for (const apiName of Object.keys(this._snippets)) {\n console.error(Colorize.yellow('Warning: Unused snippet ' + apiName));\n }\n }\n\n /** @override */\n protected onGetTocRoot(): IYamlTocItem {\n // override\n return {\n name: 'API reference',\n href: 'overview.md',\n items: []\n };\n }\n\n /** @override */\n protected onCustomizeYamlItem(yamlItem: IYamlItem): void {\n const nameWithoutPackage: string = yamlItem.uid.replace(/^[^.]+\\!/, '');\n if (yamlItem.summary) {\n yamlItem.summary = this._fixupApiSet(yamlItem.summary, yamlItem.uid);\n }\n if (yamlItem.remarks) {\n yamlItem.remarks = this._fixupApiSet(yamlItem.remarks, yamlItem.uid);\n }\n\n const snippets: string[] | undefined = this._snippetsAll[nameWithoutPackage];\n if (snippets) {\n delete this._snippets[nameWithoutPackage];\n const snippetText: string = this._generateExampleSnippetText(snippets);\n if (yamlItem.remarks) {\n yamlItem.remarks += snippetText;\n } else if (yamlItem.syntax && yamlItem.syntax.return) {\n if (!yamlItem.syntax.return.description) {\n yamlItem.syntax.return.description = '';\n }\n yamlItem.syntax.return.description += snippetText;\n } else {\n yamlItem.remarks = snippetText;\n }\n }\n }\n\n private _fixupApiSet(markup: string, uid: string): string {\n // Search for a pattern such as this:\n // \\[Api set: ExcelApi 1.1\\]\n //\n // Hyperlink it like this:\n // \\[ [API set: ExcelApi 1.1](http://bing.com?type=excel) \\]\n markup = markup.replace(/Api/, 'API');\n return markup.replace(/\\\\\\[(API set:[^\\]]+)\\\\\\]/, '\\\\[ [$1](' + this._getApiSetUrl(uid) + ') \\\\]');\n }\n\n // Gets the link to the API set based on product context. Seeks a case-insensitive match in the hash set.\n private _getApiSetUrl(uid: string): string {\n for (const key of Object.keys(this._apiSetUrls)) {\n const regexp: RegExp = new RegExp(key, 'i');\n if (regexp.test(uid)) {\n return this._apiSetUrls[key];\n }\n }\n return this._apiSetUrlDefault; // match not found.\n }\n\n private _generateExampleSnippetText(snippets: string[]): string {\n const text: string[] = ['\\n\\n#### Examples\\n'];\n for (const snippet of snippets) {\n text.push(`\\`\\`\\`TypeScript\\n${snippet}\\n\\`\\`\\``);\n }\n return text.join('\\n');\n }\n}\n"]}
1
+ {"version":3,"file":"OfficeYamlDocumenter.js","sourceRoot":"","sources":["../../src/documenters/OfficeYamlDocumenter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,gCAAiC;AAGjC,oEAA0D;AAC1D,kDAA+C;AAI/C,qDAAkD;AAUlD;;GAEG;AACH,MAAa,oBAAqB,SAAQ,+BAAc;IAiBtD,YAAmB,QAAkB,EAAE,WAAmB,EAAE,kBAA4B;QACtF,KAAK,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;QAdtC,sDAAsD;QAC9C,sBAAiB,GAAW,yDAAyD,CAAC;QAE9F,6CAA6C;QACrC,gBAAW,GAA2B;YAC5C,KAAK,EAAE,mEAAmE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QACtC,OAAO,MAAM,CAAC,OAAO,CAAC,0BAA0B,EAAE,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IACrG,CAAC;IAED,yGAAyG;IACjG,aAAa,CAAC,GAAW;QAC/B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAChD,MAAM,MAAM,GAAW,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAC5C,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,mBAAmB;IACpD,CAAC;IAEO,2BAA2B,CAAC,QAAkB;QACpD,MAAM,IAAI,GAAa,CAAC,qBAAqB,CAAC,CAAC;QAC/C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,IAAI,CAAC,IAAI,CAAC,qBAAqB,OAAO,UAAU,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;CACF;AAxGD,oDAwGC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\nimport yaml = require('js-yaml');\n\nimport type { ApiModel } from '@microsoft/api-extractor-model';\nimport { FileSystem } from '@rushstack/node-core-library';\nimport { Colorize } from '@rushstack/terminal';\n\nimport type { IYamlTocItem } from '../yaml/IYamlTocFile';\nimport type { IYamlItem } from '../yaml/IYamlApiFile';\nimport { YamlDocumenter } from './YamlDocumenter';\n\ninterface ISnippetsFile {\n /**\n * The keys are API names like \"Excel.Range.clear\".\n * The values are TypeScript source code excerpts.\n */\n [apiName: string]: string[];\n}\n\n/**\n * Extends YamlDocumenter with some custom logic that is specific to Office Add-ins.\n */\nexport class OfficeYamlDocumenter extends YamlDocumenter {\n private _snippets: ISnippetsFile;\n private _snippetsAll: ISnippetsFile;\n\n // Default API Set URL when no product match is found.\n private _apiSetUrlDefault: string = '/office/dev/add-ins/reference/javascript-api-for-office';\n\n // Hash set of API Set URLs based on product.\n private _apiSetUrls: Record<string, string> = {\n Excel: '/javascript/api/requirement-sets/excel/excel-api-requirement-sets',\n OneNote: '/javascript/api/requirement-sets/onenote/onenote-api-requirement-sets',\n Outlook: '/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets',\n PowerPoint: '/javascript/api/requirement-sets/powerpoint/powerpoint-api-requirement-sets',\n Visio: '/office/dev/add-ins/reference/overview/visio-javascript-reference-overview',\n Word: '/javascript/api/requirement-sets/word/word-api-requirement-sets'\n };\n\n public constructor(apiModel: ApiModel, inputFolder: string, newDocfxNamespaces?: boolean) {\n super(apiModel, newDocfxNamespaces);\n\n const snippetsFilePath: string = path.join(inputFolder, 'snippets.yaml');\n\n console.log('Loading snippets from ' + snippetsFilePath);\n\n const snippetsContent: string = FileSystem.readFile(snippetsFilePath);\n this._snippets = yaml.load(snippetsContent, { filename: snippetsFilePath });\n this._snippetsAll = yaml.load(snippetsContent, { filename: snippetsFilePath });\n }\n\n /** @override */\n public generateFiles(outputFolder: string): void {\n super.generateFiles(outputFolder);\n\n // After we generate everything, check for any unused snippets\n console.log();\n for (const apiName of Object.keys(this._snippets)) {\n console.error(Colorize.yellow('Warning: Unused snippet ' + apiName));\n }\n }\n\n /** @override */\n protected onGetTocRoot(): IYamlTocItem {\n return {\n name: 'API reference',\n href: 'overview.md',\n items: []\n };\n }\n\n /** @override */\n protected onCustomizeYamlItem(yamlItem: IYamlItem): void {\n const nameWithoutPackage: string = yamlItem.uid.replace(/^[^.]+\\!/, '');\n if (yamlItem.summary) {\n yamlItem.summary = this._fixupApiSet(yamlItem.summary, yamlItem.uid);\n }\n if (yamlItem.remarks) {\n yamlItem.remarks = this._fixupApiSet(yamlItem.remarks, yamlItem.uid);\n }\n\n const snippets: string[] | undefined = this._snippetsAll[nameWithoutPackage];\n if (snippets) {\n delete this._snippets[nameWithoutPackage];\n const snippetText: string = this._generateExampleSnippetText(snippets);\n if (yamlItem.remarks) {\n yamlItem.remarks += snippetText;\n } else if (yamlItem.syntax && yamlItem.syntax.return) {\n if (!yamlItem.syntax.return.description) {\n yamlItem.syntax.return.description = '';\n }\n yamlItem.syntax.return.description += snippetText;\n } else {\n yamlItem.remarks = snippetText;\n }\n }\n }\n\n private _fixupApiSet(markup: string, uid: string): string {\n // Search for a pattern such as this:\n // \\[Api set: ExcelApi 1.1\\]\n //\n // Hyperlink it like this:\n // \\[ [API set: ExcelApi 1.1](http://bing.com?type=excel) \\]\n markup = markup.replace(/Api/, 'API');\n return markup.replace(/\\\\\\[(API set:[^\\]]+)\\\\\\]/, '\\\\[ [$1](' + this._getApiSetUrl(uid) + ') \\\\]');\n }\n\n // Gets the link to the API set based on product context. Seeks a case-insensitive match in the hash set.\n private _getApiSetUrl(uid: string): string {\n for (const key of Object.keys(this._apiSetUrls)) {\n const regexp: RegExp = new RegExp(key, 'i');\n if (regexp.test(uid)) {\n return this._apiSetUrls[key];\n }\n }\n return this._apiSetUrlDefault; // match not found.\n }\n\n private _generateExampleSnippetText(snippets: string[]): string {\n const text: string[] = ['\\n\\n#### Examples\\n'];\n for (const snippet of snippets) {\n text.push(`\\`\\`\\`TypeScript\\n${snippet}\\n\\`\\`\\``);\n }\n return text.join('\\n');\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/api-documenter",
3
- "version": "7.26.22",
3
+ "version": "7.26.24",
4
4
  "description": "Read JSON files from api-extractor, generate documentation pages",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,16 +18,16 @@
18
18
  "@microsoft/tsdoc": "~0.15.1",
19
19
  "js-yaml": "~3.13.1",
20
20
  "resolve": "~1.22.1",
21
- "@microsoft/api-extractor-model": "7.30.5",
22
- "@rushstack/ts-command-line": "4.23.7",
23
21
  "@rushstack/node-core-library": "5.13.0",
24
- "@rushstack/terminal": "0.15.2"
22
+ "@rushstack/terminal": "0.15.2",
23
+ "@microsoft/api-extractor-model": "7.30.5",
24
+ "@rushstack/ts-command-line": "5.0.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/js-yaml": "3.12.1",
28
28
  "@types/resolve": "1.20.2",
29
- "local-node-rig": "1.0.0",
30
- "@rushstack/heft": "0.73.1"
29
+ "@rushstack/heft": "0.73.3",
30
+ "local-node-rig": "1.0.0"
31
31
  },
32
32
  "scripts": {
33
33
  "build": "heft build --clean",