Skip to content

Commit 4f004d5

Browse files
authored
Merge branch 'master' into default_import_esmodule
2 parents fbd15c2 + ed89660 commit 4f004d5

146 files changed

Lines changed: 1821 additions & 511 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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,54 @@
11
{
22
"name": "@microsoft/api-documenter",
33
"entries": [
4+
{
5+
"version": "7.1.6",
6+
"tag": "@microsoft/api-documenter_v7.1.6",
7+
"date": "Mon, 06 May 2019 20:46:21 GMT",
8+
"comments": {
9+
"dependency": [
10+
{
11+
"comment": "Updating dependency \"@microsoft/ts-command-line\" from `4.2.3` to `4.2.4`"
12+
},
13+
{
14+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.3.11` to `0.3.12`"
15+
},
16+
{
17+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.59` to `6.0.60`"
18+
}
19+
]
20+
}
21+
},
22+
{
23+
"version": "7.1.5",
24+
"tag": "@microsoft/api-documenter_v7.1.5",
25+
"date": "Mon, 06 May 2019 19:34:54 GMT",
26+
"comments": {
27+
"dependency": [
28+
{
29+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.3.10` to `0.3.11`"
30+
},
31+
{
32+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.58` to `6.0.59`"
33+
}
34+
]
35+
}
36+
},
37+
{
38+
"version": "7.1.4",
39+
"tag": "@microsoft/api-documenter_v7.1.4",
40+
"date": "Mon, 06 May 2019 19:11:16 GMT",
41+
"comments": {
42+
"dependency": [
43+
{
44+
"comment": "Updating dependency \"@microsoft/rush-stack-compiler-3.2\" from `0.3.9` to `0.3.10`"
45+
},
46+
{
47+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `6.0.57` to `6.0.58`"
48+
}
49+
]
50+
}
51+
},
452
{
553
"version": "7.1.3",
654
"tag": "@microsoft/api-documenter_v7.1.3",

apps/api-documenter/CHANGELOG.md

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

3-
This log was last generated on Tue, 30 Apr 2019 23:08:02 GMT and should not be manually modified.
3+
This log was last generated on Mon, 06 May 2019 20:46:21 GMT and should not be manually modified.
4+
5+
## 7.1.6
6+
Mon, 06 May 2019 20:46:21 GMT
7+
8+
*Version update only*
9+
10+
## 7.1.5
11+
Mon, 06 May 2019 19:34:54 GMT
12+
13+
*Version update only*
14+
15+
## 7.1.4
16+
Mon, 06 May 2019 19:11:16 GMT
17+
18+
*Version update only*
419

520
## 7.1.3
621
Tue, 30 Apr 2019 23:08:02 GMT

apps/api-documenter/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/api-documenter",
3-
"version": "7.1.3",
3+
"version": "7.1.6",
44
"description": "Read JSON files from api-extractor, generate documentation pages",
55
"repository": {
66
"type": "git",
@@ -17,14 +17,14 @@
1717
"dependencies": {
1818
"@microsoft/api-extractor-model": "7.1.0",
1919
"@microsoft/node-core-library": "3.13.0",
20-
"@microsoft/ts-command-line": "4.2.3",
20+
"@microsoft/ts-command-line": "4.2.4",
2121
"@microsoft/tsdoc": "0.12.9",
2222
"colors": "~1.2.1",
2323
"js-yaml": "~3.13.1"
2424
},
2525
"devDependencies": {
26-
"@microsoft/rush-stack-compiler-3.2": "0.3.9",
27-
"@microsoft/node-library-build": "6.0.57",
26+
"@microsoft/rush-stack-compiler-3.2": "0.3.12",
27+
"@microsoft/node-library-build": "6.0.60",
2828
"@types/js-yaml": "3.12.1",
2929
"@types/node": "8.5.8",
3030
"gulp": "~3.9.1",

apps/api-extractor/CHANGELOG.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,42 @@
11
{
22
"name": "@microsoft/api-extractor",
33
"entries": [
4+
{
5+
"version": "7.1.4",
6+
"tag": "@microsoft/api-extractor_v7.1.4",
7+
"date": "Mon, 06 May 2019 20:46:21 GMT",
8+
"comments": {
9+
"dependency": [
10+
{
11+
"comment": "Updating dependency \"@microsoft/ts-command-line\" from `4.2.3` to `4.2.4`"
12+
}
13+
]
14+
}
15+
},
16+
{
17+
"version": "7.1.3",
18+
"tag": "@microsoft/api-extractor_v7.1.3",
19+
"date": "Mon, 06 May 2019 19:34:54 GMT",
20+
"comments": {
21+
"patch": [
22+
{
23+
"comment": "Add a new setting \"omitTrimmingComments\" to prevent extra comments from being emitted in the .d.ts rollup"
24+
}
25+
]
26+
}
27+
},
28+
{
29+
"version": "7.1.2",
30+
"tag": "@microsoft/api-extractor_v7.1.2",
31+
"date": "Mon, 06 May 2019 19:11:16 GMT",
32+
"comments": {
33+
"patch": [
34+
{
35+
"comment": "Fix an issue where ExtractorResult.warningCount was not incremented for messages handled by IExtractorInvokeOptions.messageCallback (GitHub #1258)"
36+
}
37+
]
38+
}
39+
},
440
{
541
"version": "7.1.1",
642
"tag": "@microsoft/api-extractor_v7.1.1",

apps/api-extractor/CHANGELOG.md

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

3-
This log was last generated on Tue, 30 Apr 2019 23:08:02 GMT and should not be manually modified.
3+
This log was last generated on Mon, 06 May 2019 20:46:21 GMT and should not be manually modified.
4+
5+
## 7.1.4
6+
Mon, 06 May 2019 20:46:21 GMT
7+
8+
*Version update only*
9+
10+
## 7.1.3
11+
Mon, 06 May 2019 19:34:54 GMT
12+
13+
### Patches
14+
15+
- Add a new setting "omitTrimmingComments" to prevent extra comments from being emitted in the .d.ts rollup
16+
17+
## 7.1.2
18+
Mon, 06 May 2019 19:11:16 GMT
19+
20+
### Patches
21+
22+
- Fix an issue where ExtractorResult.warningCount was not incremented for messages handled by IExtractorInvokeOptions.messageCallback (GitHub #1258)
423

524
## 7.1.1
625
Tue, 30 Apr 2019 23:08:02 GMT

apps/api-extractor/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/api-extractor",
3-
"version": "7.1.1",
3+
"version": "7.1.4",
44
"description": "Analyze the exported API for a TypeScript library and generate reviews, documentation, and .d.ts rollups",
55
"keywords": [
66
"typescript",
@@ -37,7 +37,7 @@
3737
"dependencies": {
3838
"@microsoft/api-extractor-model": "7.1.0",
3939
"@microsoft/node-core-library": "3.13.0",
40-
"@microsoft/ts-command-line": "4.2.3",
40+
"@microsoft/ts-command-line": "4.2.4",
4141
"@microsoft/tsdoc": "0.12.9",
4242
"colors": "~1.2.1",
4343
"lodash": "~4.17.5",

apps/api-extractor/src/api/ExtractorConfig.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ interface IExtractorConfigParameters {
106106
untrimmedFilePath: string;
107107
betaTrimmedFilePath: string;
108108
publicTrimmedFilePath: string;
109+
omitTrimmingComments: boolean;
109110
tsdocMetadataEnabled: boolean;
110111
tsdocMetadataFilePath: string;
111112
messages: IExtractorMessagesConfig;
@@ -181,6 +182,8 @@ export class ExtractorConfig {
181182
public readonly betaTrimmedFilePath: string;
182183
/** {@inheritDoc IConfigDtsRollup.publicTrimmedFilePath} */
183184
public readonly publicTrimmedFilePath: string;
185+
/** {@inheritDoc IConfigDtsRollup.omitTrimmingComments} */
186+
public readonly omitTrimmingComments: boolean;
184187

185188
/** {@inheritDoc IConfigTsdocMetadata.enabled} */
186189
public readonly tsdocMetadataEnabled: boolean;
@@ -210,6 +213,7 @@ export class ExtractorConfig {
210213
this.untrimmedFilePath = parameters.untrimmedFilePath;
211214
this.betaTrimmedFilePath = parameters.betaTrimmedFilePath;
212215
this.publicTrimmedFilePath = parameters.publicTrimmedFilePath;
216+
this.omitTrimmingComments = parameters.omitTrimmingComments;
213217
this.tsdocMetadataEnabled = parameters.tsdocMetadataEnabled;
214218
this.tsdocMetadataFilePath = parameters.tsdocMetadataFilePath;
215219
this.messages = parameters.messages;
@@ -609,6 +613,7 @@ export class ExtractorConfig {
609613
let untrimmedFilePath: string = '';
610614
let betaTrimmedFilePath: string = '';
611615
let publicTrimmedFilePath: string = '';
616+
let omitTrimmingComments: boolean = false;
612617

613618
if (configObject.dtsRollup) {
614619
rollupEnabled = !!configObject.dtsRollup.enabled;
@@ -618,6 +623,7 @@ export class ExtractorConfig {
618623
configObject.dtsRollup.betaTrimmedFilePath, tokenContext);
619624
publicTrimmedFilePath = ExtractorConfig._resolvePathWithTokens('publicTrimmedFilePath',
620625
configObject.dtsRollup.publicTrimmedFilePath, tokenContext);
626+
omitTrimmingComments = !!configObject.dtsRollup.omitTrimmingComments;
621627
}
622628

623629
return new ExtractorConfig({
@@ -637,6 +643,7 @@ export class ExtractorConfig {
637643
untrimmedFilePath,
638644
betaTrimmedFilePath,
639645
publicTrimmedFilePath,
646+
omitTrimmingComments,
640647
tsdocMetadataEnabled,
641648
tsdocMetadataFilePath,
642649
messages: configObject.messages || { },

apps/api-extractor/src/api/IConfigFile.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ export interface IConfigDtsRollup {
171171
* prepend a folder token such as `<projectFolder>`.
172172
*/
173173
publicTrimmedFilePath?: string;
174+
175+
/**
176+
* When a declaration is trimmed, by default it will be replaced by a code comment such as
177+
* "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the
178+
* declaration completely.
179+
*/
180+
omitTrimmingComments?: boolean;
174181
}
175182

176183
/**

apps/api-extractor/src/collector/Collector.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export class Collector {
6767

6868
public readonly workingPackage: WorkingPackage;
6969

70+
public readonly extractorConfig: ExtractorConfig;
71+
7072
private readonly _program: ts.Program;
7173

7274
private readonly _tsdocParser: tsdoc.TSDocParser;
@@ -85,25 +87,24 @@ export class Collector {
8587
this.packageJsonLookup = new PackageJsonLookup();
8688

8789
this._program = options.program;
88-
89-
const extractorConfig: ExtractorConfig = options.extractorConfig;
90+
this.extractorConfig = options.extractorConfig;
9091

9192
const entryPointSourceFile: ts.SourceFile | undefined = options.program.getSourceFile(
92-
extractorConfig.mainEntryPointFilePath);
93+
this.extractorConfig.mainEntryPointFilePath);
9394

9495
if (!entryPointSourceFile) {
95-
throw new Error('Unable to load file: ' + extractorConfig.mainEntryPointFilePath);
96+
throw new Error('Unable to load file: ' + this.extractorConfig.mainEntryPointFilePath);
9697
}
9798

98-
if (!extractorConfig.packageFolder || !extractorConfig.packageJson) {
99+
if (!this.extractorConfig.packageFolder || !this.extractorConfig.packageJson) {
99100
// TODO: We should be able to analyze projects that don't have any package.json.
100101
// The ExtractorConfig class is already designed to allow this.
101102
throw new Error('Unable to find a package.json file for the project being analyzed');
102103
}
103104

104105
this.workingPackage = new WorkingPackage({
105-
packageFolder: extractorConfig.packageFolder,
106-
packageJson: extractorConfig.packageJson,
106+
packageFolder: this.extractorConfig.packageFolder,
107+
packageJson: this.extractorConfig.packageJson,
107108
entryPointSourceFile
108109
});
109110

apps/api-extractor/src/collector/MessageRouter.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ export class MessageRouter {
388388
* Give the calling application a chance to handle the `ExtractorMessage`, and if not, display it on the console.
389389
*/
390390
private _handleMessage(message: ExtractorMessage): void {
391+
// Don't tally messages that were already "handled" by writing them into the API report
391392
if (message.handled) {
392393
return;
393394
}
@@ -400,14 +401,26 @@ export class MessageRouter {
400401
message.logLevel = reportingRule.logLevel;
401402
}
402403

404+
// If there is a callback, allow it to modify and/or handle the message
403405
if (this._messageCallback) {
404406
this._messageCallback(message);
407+
}
405408

406-
if (message.handled) {
407-
return;
408-
}
409+
// Update the statistics
410+
switch (message.logLevel) {
411+
case ExtractorLogLevel.Error:
412+
++this.errorCount;
413+
break;
414+
case ExtractorLogLevel.Warning:
415+
++this.warningCount;
416+
break;
409417
}
410418

419+
if (message.handled) {
420+
return;
421+
}
422+
423+
// The messageCallback did not handle the message, so perform default handling
411424
message.handled = true;
412425

413426
if (message.logLevel === ExtractorLogLevel.None) {
@@ -423,11 +436,9 @@ export class MessageRouter {
423436

424437
switch (message.logLevel) {
425438
case ExtractorLogLevel.Error:
426-
++this.errorCount;
427439
console.error(colors.red('Error: ' + messageText));
428440
break;
429441
case ExtractorLogLevel.Warning:
430-
++this.warningCount;
431442
console.warn(colors.yellow('Warning: ' + messageText));
432443
break;
433444
case ExtractorLogLevel.Info:

0 commit comments

Comments
 (0)