Skip to content

Commit 1b53a9d

Browse files
committed
Merge remote-tracking branch 'remotes/origin/master' into tnc1997/pnpm-version-3
2 parents 420533b + 7e50b23 commit 1b53a9d

338 files changed

Lines changed: 9238 additions & 2758 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/api-documenter/CHANGELOG.json

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,191 @@
11
{
22
"name": "@microsoft/api-documenter",
33
"entries": [
4+
{
5+
"version": "7.1.1",
6+
"tag": "@microsoft/api-documenter_v7.1.1",
7+
"date": "Wed, 17 Apr 2019 19:12:31 GMT",
8+
"comments": {
9+
"patch": [
10+
{
11+
"comment": "Fix newline rendering when code blocks are used in tables"
12+
}
13+
]
14+
}
15+
},
16+
{
17+
"version": "7.1.0",
18+
"tag": "@microsoft/api-documenter_v7.1.0",
19+
"date": "Tue, 16 Apr 2019 11:01:37 GMT",
20+
"comments": {
21+
"patch": [
22+
{
23+
"comment": "Adding an extra newline to the OfficeYamlDocumenter Examples header insertion"
24+
}
25+
],
26+
"minor": [
27+
{
28+
"comment": "Initial stable release of API Extractor 7"
29+
}
30+
],
31+
"dependency": [
32+
{
33+
"comment": "Updating dependency \"@microsoft/api-extractor-model\" from `7.0.28` to `7.1.0`"
34+
},
35+
{
36+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.3.7` to `0.3.8`"
37+
},
38+
{
39+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.55` to `6.0.56`"
40+
}
41+
]
42+
}
43+
},
44+
{
45+
"version": "7.0.51",
46+
"tag": "@microsoft/api-documenter_v7.0.51",
47+
"date": "Fri, 12 Apr 2019 06:13:16 GMT",
48+
"comments": {
49+
"dependency": [
50+
{
51+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.3.6` to `0.3.7`"
52+
},
53+
{
54+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.54` to `6.0.55`"
55+
}
56+
]
57+
}
58+
},
59+
{
60+
"version": "7.0.50",
61+
"tag": "@microsoft/api-documenter_v7.0.50",
62+
"date": "Thu, 11 Apr 2019 07:14:01 GMT",
63+
"comments": {
64+
"dependency": [
65+
{
66+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.3.5` to `0.3.6`"
67+
},
68+
{
69+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.53` to `6.0.54`"
70+
}
71+
]
72+
}
73+
},
74+
{
75+
"version": "7.0.49",
76+
"tag": "@microsoft/api-documenter_v7.0.49",
77+
"date": "Tue, 09 Apr 2019 05:31:01 GMT",
78+
"comments": {
79+
"patch": [
80+
{
81+
"comment": "Add 'do not edit' header to generated documentation files"
82+
}
83+
],
84+
"dependency": [
85+
{
86+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.3.4` to `0.3.5`"
87+
},
88+
{
89+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.52` to `6.0.53`"
90+
}
91+
]
92+
}
93+
},
94+
{
95+
"version": "7.0.48",
96+
"tag": "@microsoft/api-documenter_v7.0.48",
97+
"date": "Mon, 08 Apr 2019 19:12:52 GMT",
98+
"comments": {
99+
"dependency": [
100+
{
101+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.3.3` to `0.3.4`"
102+
},
103+
{
104+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.51` to `6.0.52`"
105+
}
106+
]
107+
}
108+
},
109+
{
110+
"version": "7.0.47",
111+
"tag": "@microsoft/api-documenter_v7.0.47",
112+
"date": "Sat, 06 Apr 2019 02:05:51 GMT",
113+
"comments": {
114+
"dependency": [
115+
{
116+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.3.2` to `0.3.3`"
117+
},
118+
{
119+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.50` to `6.0.51`"
120+
}
121+
]
122+
}
123+
},
124+
{
125+
"version": "7.0.46",
126+
"tag": "@microsoft/api-documenter_v7.0.46",
127+
"date": "Fri, 05 Apr 2019 04:16:17 GMT",
128+
"comments": {
129+
"dependency": [
130+
{
131+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.3.1` to `0.3.2`"
132+
},
133+
{
134+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.49` to `6.0.50`"
135+
}
136+
]
137+
}
138+
},
139+
{
140+
"version": "7.0.45",
141+
"tag": "@microsoft/api-documenter_v7.0.45",
142+
"date": "Wed, 03 Apr 2019 02:58:33 GMT",
143+
"comments": {
144+
"dependency": [
145+
{
146+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.3.0` to `0.3.1`"
147+
},
148+
{
149+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.48` to `6.0.49`"
150+
}
151+
]
152+
}
153+
},
154+
{
155+
"version": "7.0.44",
156+
"tag": "@microsoft/api-documenter_v7.0.44",
157+
"date": "Tue, 02 Apr 2019 01:12:02 GMT",
158+
"comments": {
159+
"dependency": [
160+
{
161+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.2.20` to `0.3.0`"
162+
},
163+
{
164+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.47` to `6.0.48`"
165+
}
166+
]
167+
}
168+
},
169+
{
170+
"version": "7.0.43",
171+
"tag": "@microsoft/api-documenter_v7.0.43",
172+
"date": "Sat, 30 Mar 2019 22:27:16 GMT",
173+
"comments": {
174+
"patch": [
175+
{
176+
"comment": "Add limited support for resolving @inheritDoc references to external packages by postprocessing them in api-documenter"
177+
}
178+
],
179+
"dependency": [
180+
{
181+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.2.19` to `0.2.20`"
182+
},
183+
{
184+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.46` to `6.0.47`"
185+
}
186+
]
187+
}
188+
},
4189
{
5190
"version": "7.0.42",
6191
"tag": "@microsoft/api-documenter_v7.0.42",

apps/api-documenter/CHANGELOG.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,73 @@
11
# Change Log - @microsoft/api-documenter
22

3-
This log was last generated on Thu, 28 Mar 2019 19:14:27 GMT and should not be manually modified.
3+
This log was last generated on Wed, 17 Apr 2019 19:12:31 GMT and should not be manually modified.
4+
5+
## 7.1.1
6+
Wed, 17 Apr 2019 19:12:31 GMT
7+
8+
### Patches
9+
10+
- Fix newline rendering when code blocks are used in tables
11+
12+
## 7.1.0
13+
Tue, 16 Apr 2019 11:01:37 GMT
14+
15+
### Minor changes
16+
17+
- Initial stable release of API Extractor 7
18+
19+
### Patches
20+
21+
- Adding an extra newline to the OfficeYamlDocumenter Examples header insertion
22+
23+
## 7.0.51
24+
Fri, 12 Apr 2019 06:13:16 GMT
25+
26+
*Version update only*
27+
28+
## 7.0.50
29+
Thu, 11 Apr 2019 07:14:01 GMT
30+
31+
*Version update only*
32+
33+
## 7.0.49
34+
Tue, 09 Apr 2019 05:31:01 GMT
35+
36+
### Patches
37+
38+
- Add 'do not edit' header to generated documentation files
39+
40+
## 7.0.48
41+
Mon, 08 Apr 2019 19:12:52 GMT
42+
43+
*Version update only*
44+
45+
## 7.0.47
46+
Sat, 06 Apr 2019 02:05:51 GMT
47+
48+
*Version update only*
49+
50+
## 7.0.46
51+
Fri, 05 Apr 2019 04:16:17 GMT
52+
53+
*Version update only*
54+
55+
## 7.0.45
56+
Wed, 03 Apr 2019 02:58:33 GMT
57+
58+
*Version update only*
59+
60+
## 7.0.44
61+
Tue, 02 Apr 2019 01:12:02 GMT
62+
63+
*Version update only*
64+
65+
## 7.0.43
66+
Sat, 30 Mar 2019 22:27:16 GMT
67+
68+
### Patches
69+
70+
- Add limited support for resolving @inheritDoc references to external packages by postprocessing them in api-documenter
471

572
## 7.0.42
673
Thu, 28 Mar 2019 19:14:27 GMT

apps/api-documenter/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/api-documenter",
3-
"version": "7.0.42",
3+
"version": "7.1.1",
44
"description": "Read JSON files from api-extractor, generate documentation pages",
55
"repository": {
66
"type": "git",
@@ -15,16 +15,16 @@
1515
"api-documenter": "./bin/api-documenter"
1616
},
1717
"dependencies": {
18-
"@microsoft/api-extractor-model": "7.0.28",
18+
"@microsoft/api-extractor-model": "7.1.0",
1919
"@microsoft/node-core-library": "3.13.0",
2020
"@microsoft/ts-command-line": "4.2.3",
21-
"@microsoft/tsdoc": "0.12.8",
21+
"@microsoft/tsdoc": "0.12.9",
2222
"colors": "~1.2.1",
2323
"js-yaml": "~3.9.1"
2424
},
2525
"devDependencies": {
26-
"@microsoft/rush-stack-compiler-3.2": "0.2.19",
27-
"@microsoft/node-library-build": "6.0.46",
26+
"@microsoft/rush-stack-compiler-3.2": "0.3.8",
27+
"@microsoft/node-library-build": "6.0.56",
2828
"@types/js-yaml": "3.9.1",
2929
"@types/node": "8.5.8",
3030
"gulp": "~3.9.1",

apps/api-documenter/src/cli/BaseAction.ts

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22
// See LICENSE in the project root for license information.
33

44
import * as path from 'path';
5+
import * as tsdoc from '@microsoft/tsdoc';
6+
import * as colors from 'colors';
57

68
import {
79
CommandLineAction,
810
CommandLineStringParameter
911
} from '@microsoft/ts-command-line';
1012
import { FileSystem } from '@microsoft/node-core-library';
11-
import { ApiModel } from '@microsoft/api-extractor-model';
13+
import {
14+
ApiModel,
15+
ApiItem,
16+
ApiItemContainerMixin,
17+
ApiDocumentedItem,
18+
IResolveDeclarationReferenceResult
19+
} from '@microsoft/api-extractor-model';
1220

1321
export abstract class BaseAction extends CommandLineAction {
1422
protected inputFolder: string;
@@ -55,6 +63,66 @@ export abstract class BaseAction extends CommandLineAction {
5563
}
5664
}
5765

66+
this._applyInheritDoc(apiModel, apiModel);
67+
5868
return apiModel;
5969
}
70+
71+
// TODO: This is a temporary workaround. The long term plan is for API Extractor's DocCommentEnhancer
72+
// to apply all @inheritDoc tags before the .api.json file is written.
73+
// See DocCommentEnhancer._applyInheritDoc() for more info.
74+
private _applyInheritDoc(apiItem: ApiItem, apiModel: ApiModel): void {
75+
76+
if (apiItem instanceof ApiDocumentedItem) {
77+
if (apiItem.tsdocComment) {
78+
const inheritDocTag: tsdoc.DocInheritDocTag | undefined = apiItem.tsdocComment.inheritDocTag;
79+
80+
if (inheritDocTag && inheritDocTag.declarationReference) {
81+
// Attempt to resolve the declaration reference
82+
const result: IResolveDeclarationReferenceResult
83+
= apiModel.resolveDeclarationReference(inheritDocTag.declarationReference, apiItem);
84+
85+
if (result.errorMessage) {
86+
console.log(colors.yellow(`Warning: Unresolved @inheritDoc tag for ${apiItem.displayName}: `
87+
+ result.errorMessage));
88+
} else {
89+
if (result.resolvedApiItem instanceof ApiDocumentedItem
90+
&& result.resolvedApiItem.tsdocComment
91+
&& result.resolvedApiItem !== apiItem) {
92+
this._copyInheritedDocs(apiItem.tsdocComment, result.resolvedApiItem.tsdocComment);
93+
}
94+
}
95+
}
96+
97+
}
98+
}
99+
100+
// Recurse members
101+
if (ApiItemContainerMixin.isBaseClassOf(apiItem)) {
102+
for (const member of apiItem.members) {
103+
this._applyInheritDoc(member, apiModel);
104+
}
105+
}
106+
}
107+
108+
/**
109+
* Copy the content from `sourceDocComment` to `targetDocComment`.
110+
* This code is borrowed from DocCommentEnhancer as a temporary workaround.
111+
*/
112+
private _copyInheritedDocs(targetDocComment: tsdoc.DocComment, sourceDocComment: tsdoc.DocComment): void {
113+
targetDocComment.summarySection = sourceDocComment.summarySection;
114+
targetDocComment.remarksBlock = sourceDocComment.remarksBlock;
115+
116+
targetDocComment.params.clear();
117+
for (const param of sourceDocComment.params) {
118+
targetDocComment.params.add(param);
119+
}
120+
for (const typeParam of sourceDocComment.typeParams) {
121+
targetDocComment.typeParams.add(typeParam);
122+
}
123+
targetDocComment.returnsBlock = sourceDocComment.returnsBlock;
124+
125+
targetDocComment.inheritDocTag = undefined;
126+
}
127+
60128
}

apps/api-documenter/src/documenters/MarkdownDocumenter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ export class MarkdownDocumenter {
234234
const filename: string = path.join(this._outputFolder, this._getFilenameForApiItem(apiItem));
235235
const stringBuilder: StringBuilder = new StringBuilder();
236236

237+
stringBuilder.append('<!-- Do not edit this file. It is automatically generated by API Documenter. -->\n\n');
238+
237239
this._markdownEmitter.emit(stringBuilder, output, {
238240
contextApiItem: apiItem,
239241
onGetFilenameForApiItem: (apiItemForFilename: ApiItem) => {

0 commit comments

Comments
 (0)