Skip to content

Commit deaed8f

Browse files
author
Kim Brandl
committed
Merge branch 'master' into kb-patch-office
2 parents b384e57 + c58f48d commit deaed8f

File tree

175 files changed

+3797
-948
lines changed

Some content is hidden

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

175 files changed

+3797
-948
lines changed

apps/api-documenter/CHANGELOG.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,74 @@
11
{
22
"name": "@microsoft/api-documenter",
33
"entries": [
4+
{
5+
"version": "1.1.32",
6+
"tag": "@microsoft/api-documenter_v1.1.32",
7+
"date": "Tue, 03 Apr 2018 16:05:29 GMT",
8+
"comments": {
9+
"dependency": [
10+
{
11+
"comment": "Updating dependency \"@microsoft/api-extractor\" from `5.6.2` to `5.6.3`"
12+
},
13+
{
14+
"comment": "Updating dependency \"@microsoft/node-core-library\" from `1.1.0` to `1.2.0`"
15+
},
16+
{
17+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `4.3.30` to `4.3.31`"
18+
}
19+
]
20+
}
21+
},
22+
{
23+
"version": "1.1.31",
24+
"tag": "@microsoft/api-documenter_v1.1.31",
25+
"date": "Mon, 02 Apr 2018 16:05:24 GMT",
26+
"comments": {
27+
"patch": [
28+
{
29+
"comment": "Refactor to use new @microsoft/node-core-library"
30+
}
31+
],
32+
"dependency": [
33+
{
34+
"comment": "Updating dependency \"@microsoft/api-extractor\" from `5.6.1` to `5.6.2`"
35+
},
36+
{
37+
"comment": "Updating dependency \"@microsoft/node-core-library\" from `1.0.0` to `1.1.0`"
38+
},
39+
{
40+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `4.3.29` to `4.3.30`"
41+
}
42+
]
43+
}
44+
},
45+
{
46+
"version": "1.1.30",
47+
"tag": "@microsoft/api-documenter_v1.1.30",
48+
"date": "Tue, 27 Mar 2018 01:34:25 GMT",
49+
"comments": {
50+
"dependency": [
51+
{
52+
"comment": "Updating dependency \"@microsoft/api-extractor\" from `5.6.0` to `5.6.1`"
53+
},
54+
{
55+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `4.3.28` to `4.3.29`"
56+
}
57+
]
58+
}
59+
},
60+
{
61+
"version": "1.1.29",
62+
"tag": "@microsoft/api-documenter_v1.1.29",
63+
"date": "Mon, 26 Mar 2018 19:12:42 GMT",
64+
"comments": {
65+
"dependency": [
66+
{
67+
"comment": "Updating dependency \"@microsoft/node-library-build\" from `4.3.27` to `4.3.28`"
68+
}
69+
]
70+
}
71+
},
472
{
573
"version": "1.1.28",
674
"tag": "@microsoft/api-documenter_v1.1.28",

apps/api-documenter/CHANGELOG.md

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

3-
This log was last generated on Sun, 25 Mar 2018 01:26:19 GMT and should not be manually modified.
3+
This log was last generated on Tue, 03 Apr 2018 16:05:29 GMT and should not be manually modified.
4+
5+
## 1.1.32
6+
Tue, 03 Apr 2018 16:05:29 GMT
7+
8+
*Version update only*
9+
10+
## 1.1.31
11+
Mon, 02 Apr 2018 16:05:24 GMT
12+
13+
### Patches
14+
15+
- Refactor to use new @microsoft/node-core-library
16+
17+
## 1.1.30
18+
Tue, 27 Mar 2018 01:34:25 GMT
19+
20+
*Version update only*
21+
22+
## 1.1.29
23+
Mon, 26 Mar 2018 19:12:42 GMT
24+
25+
*Version update only*
426

527
## 1.1.28
628
Sun, 25 Mar 2018 01:26:19 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": "1.1.28",
3+
"version": "1.1.32",
44
"description": "Read JSON files from api-extractor, generate documentation pages",
55
"repository": {
66
"type": "git",
@@ -15,15 +15,15 @@
1515
"api-documenter": "./bin/api-documenter"
1616
},
1717
"dependencies": {
18-
"@microsoft/api-extractor": "5.6.0",
19-
"@microsoft/node-core-library": "1.0.0",
18+
"@microsoft/api-extractor": "5.6.3",
19+
"@microsoft/node-core-library": "1.2.0",
2020
"@microsoft/ts-command-line": "3.1.1",
2121
"colors": "~1.2.1",
2222
"fs-extra": "~0.26.7",
2323
"js-yaml": "~3.9.1"
2424
},
2525
"devDependencies": {
26-
"@microsoft/node-library-build": "4.3.27",
26+
"@microsoft/node-library-build": "4.3.31",
2727
"@types/fs-extra": "0.0.37",
2828
"@types/js-yaml": "3.9.1",
2929
"@types/node": "8.5.8",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import * as fsx from 'fs-extra';
55
import * as path from 'path';
66

7-
import { Text } from '@microsoft/node-core-library';
7+
import { Text, PackageName } from '@microsoft/node-core-library';
88
import {
99
IApiClass,
1010
IApiEnum,
@@ -63,7 +63,7 @@ export class MarkdownDocumenter {
6363
private _writePackagePage(docPackage: DocItem): void {
6464
console.log(`Writing ${docPackage.name} package`);
6565

66-
const unscopedPackageName: string = Utilities.getUnscopedPackageName(docPackage.name);
66+
const unscopedPackageName: string = PackageName.getUnscopedName(docPackage.name);
6767

6868
const markupPage: IMarkupPage = Markup.createPage(`${unscopedPackageName} package`);
6969
this._writeBreadcrumb(markupPage, docPackage);
@@ -604,7 +604,7 @@ export class MarkdownDocumenter {
604604
let baseName: string = '';
605605
for (const part of docItem.getHierarchy()) {
606606
if (part.kind === DocItemKind.Package) {
607-
baseName = Utilities.getUnscopedPackageName(part.name);
607+
baseName = PackageName.getUnscopedName(part.name);
608608
} else {
609609
baseName += '.' + part.name;
610610
}

apps/api-documenter/src/utils/DocItemSet.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4+
import { PackageName } from '@microsoft/node-core-library';
45
import {
56
IApiPackage,
67
ApiItem,
78
ApiJsonFile,
89
IApiItemReference
910
} from '@microsoft/api-extractor';
1011

11-
import { Utilities } from './Utilities';
12-
1312
export enum DocItemKind {
1413
Package,
1514
Namespace,
@@ -133,7 +132,8 @@ export class DocItem {
133132
for (const docItem of this.getHierarchy()) {
134133
switch (i) {
135134
case 0:
136-
reference.packageName = docItem.name;
135+
reference.scopeName = PackageName.getScope(docItem.name);
136+
reference.packageName = PackageName.getUnscopedName(docItem.name);
137137
break;
138138
case 1:
139139
reference.exportName = docItem.name;
@@ -219,11 +219,7 @@ export class DocItemSet {
219219
closestMatch: undefined
220220
};
221221

222-
const packageName: string = Utilities.getScopedPackageName(reference.scopeName, reference.packageName);
223-
if (!packageName) {
224-
// This would indicate an invalid data file, since API Extractor is supposed to normalize this
225-
throw new Error('resolveApiItemReference() failed because the packageName should not be empty');
226-
}
222+
const packageName: string = PackageName.combineParts(reference.scopeName, reference.packageName);
227223

228224
let current: DocItem | undefined = undefined;
229225

apps/api-documenter/src/utils/Utilities.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,6 @@ export class Utilities {
3232

3333
}
3434

35-
/**
36-
* Strips the scope from an NPM package name. For example, given "@microsoft/decorators"
37-
* this function would return "decorators".
38-
*/
39-
public static getUnscopedPackageName(packageName: string): string {
40-
// If there is a "/", return everything after the last "/"
41-
return packageName.split('/').slice(-1)[0];
42-
}
43-
44-
/**
45-
* Creates a scoped package name by assembling the scope name and unscoped package name.
46-
* For example, getScopedPackageName("", "example") returns "example", whereas
47-
* getScopedPackageName("@ms", "example") returns "@ms/example".
48-
*/
49-
public static getScopedPackageName(scopeName: string, packageName: string): string {
50-
if (scopeName) {
51-
return scopeName + '/' + packageName;
52-
}
53-
return packageName;
54-
}
55-
5635
/**
5736
* Generates a concise signature for a function. Example: "getArea(width, height)"
5837
*/

apps/api-documenter/src/yaml/YamlDocumenter.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as path from 'path';
66
import * as colors from 'colors';
77

88
import yaml = require('js-yaml');
9-
import { JsonFile, JsonSchema, Text } from '@microsoft/node-core-library';
9+
import { JsonFile, JsonSchema, Text, PackageName } from '@microsoft/node-core-library';
1010
import {
1111
MarkupElement,
1212
IApiMethod,
@@ -165,18 +165,25 @@ export class YamlDocumenter {
165165
if (docItem.kind === DocItemKind.Namespace) {
166166
// Namespaces don't have nodes yet
167167
tocItem = {
168-
name: Utilities.getUnscopedPackageName(docItem.name)
168+
name: docItem.name
169169
};
170170
} else {
171171
if (this._shouldEmbed(docItem.kind)) {
172172
// Don't generate table of contents items for embedded definitions
173173
continue;
174174
}
175175

176-
tocItem = {
177-
name: Utilities.getUnscopedPackageName(docItem.name),
178-
uid: this._getUid(docItem)
179-
};
176+
if (docItem.kind === DocItemKind.Package) {
177+
tocItem = {
178+
name: PackageName.getUnscopedName(docItem.name),
179+
uid: this._getUid(docItem)
180+
};
181+
} else {
182+
tocItem = {
183+
name: docItem.name,
184+
uid: this._getUid(docItem)
185+
};
186+
}
180187
}
181188

182189
tocItems.push(tocItem);
@@ -399,7 +406,7 @@ export class YamlDocumenter {
399406
for (const current of docItem.getHierarchy()) {
400407
switch (current.kind) {
401408
case DocItemKind.Package:
402-
result += Utilities.getUnscopedPackageName(current.name);
409+
result += PackageName.getUnscopedName(current.name);
403410
break;
404411
default:
405412
result += '.';
@@ -425,7 +432,7 @@ export class YamlDocumenter {
425432
for (const current of docItem.getHierarchy()) {
426433
switch (current.kind) {
427434
case DocItemKind.Package:
428-
result += Utilities.getUnscopedPackageName(current.name);
435+
result += PackageName.getUnscopedName(current.name);
429436
break;
430437
default:
431438
if (current.parent && current.parent.kind === DocItemKind.Package) {

apps/api-extractor/CHANGELOG.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,47 @@
11
{
22
"name": "@microsoft/api-extractor",
33
"entries": [
4+
{
5+
"version": "5.6.3",
6+
"tag": "@microsoft/api-extractor_v5.6.3",
7+
"date": "Tue, 03 Apr 2018 16:05:29 GMT",
8+
"comments": {
9+
"dependency": [
10+
{
11+
"comment": "Updating dependency \"@microsoft/node-core-library\" from `1.1.0` to `1.2.0`"
12+
}
13+
]
14+
}
15+
},
16+
{
17+
"version": "5.6.2",
18+
"tag": "@microsoft/api-extractor_v5.6.2",
19+
"date": "Mon, 02 Apr 2018 16:05:24 GMT",
20+
"comments": {
21+
"patch": [
22+
{
23+
"comment": "Refactor to use new @microsoft/node-core-library"
24+
}
25+
],
26+
"dependency": [
27+
{
28+
"comment": "Updating dependency \"@microsoft/node-core-library\" from `1.0.0` to `1.1.0`"
29+
}
30+
]
31+
}
32+
},
33+
{
34+
"version": "5.6.1",
35+
"tag": "@microsoft/api-extractor_v5.6.1",
36+
"date": "Tue, 27 Mar 2018 01:34:25 GMT",
37+
"comments": {
38+
"patch": [
39+
{
40+
"comment": "Update build config so API Extractor builds using the latest version of itself"
41+
}
42+
]
43+
}
44+
},
445
{
546
"version": "5.6.0",
647
"tag": "@microsoft/api-extractor_v5.6.0",

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 Sun, 25 Mar 2018 01:26:19 GMT and should not be manually modified.
3+
This log was last generated on Tue, 03 Apr 2018 16:05:29 GMT and should not be manually modified.
4+
5+
## 5.6.3
6+
Tue, 03 Apr 2018 16:05:29 GMT
7+
8+
*Version update only*
9+
10+
## 5.6.2
11+
Mon, 02 Apr 2018 16:05:24 GMT
12+
13+
### Patches
14+
15+
- Refactor to use new @microsoft/node-core-library
16+
17+
## 5.6.1
18+
Tue, 27 Mar 2018 01:34:25 GMT
19+
20+
### Patches
21+
22+
- Update build config so API Extractor builds using the latest version of itself
423

524
## 5.6.0
625
Sun, 25 Mar 2018 01:26:19 GMT

apps/api-extractor/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@
1515

1616
- **Missing exports:** Suppose the **awesome-widgets** package exports an API function `AwesomeButton.draw()` that requires a parameter of type `DrawStyle`, but you forgot to export this enum. Things seem fine at first, but when a developer tries to call that function, they discover that there's no way to specify the `DrawStyle`. How to avoid these oversights?
1717

18-
- **Accidental exports:** You meant for your `DrawHelper` class to be kept internal, but one day you realize it's a package export. When you try to remove it, consumers complain that they are using it. How do we avoid this in the future?
18+
- **Accidental exports:** You meant for your `DrawHelper` class to be kept internal, but one day you realize it's being exported. When you try to remove it, consumers complain that they're using it. How do we avoid this in the future?
1919

20-
- **Alpha/Beta graduation:** You want to release previews of new APIs that are not ready for prime time yet. But if you did a major SemVer bump every time you change these definitions, the villagers would be after you with torches and pitchforks! A better approach is to designate certain classes/members as **alpha** quality, then promote them to **beta** and finally to **public** when they're mature. But how to indicate this to your consumers? (And how to detect scoping mistakes? A **public** function should never return a **beta** result.)
20+
- **Alpha/Beta graduation:** You want to release previews of new APIs that are not ready for prime time yet. But if you did a major SemVer bump every time these definitions evolve, the villagers would be after you with torches and pitchforks! A better approach is to designate certain classes/members as **alpha** quality, then promote them to **beta** and finally to **public** as they mature. But how to indicate this to your consumers? (And how to detect scoping mistakes? A **public** function should never return a **beta** result.)
2121

22-
- **\*.d.ts rollup:** You webpacked your library into a nice **\*.js** bundle file -- so why are you distributing your typings as a messy tree of **lib/\*.d.ts** files full of private definitions? Let's consolidate them into a tidy **\*.d.ts** rollup file. If you publish internal/beta/public releases, a semantic analyzer can trim the **\*.d.ts** rollup according to each release type. Developers working on a production project don't want to see a bunch of **internal** and **beta** members in their VS Code IntelliSense!
22+
- **\*.d.ts rollup:** You webpacked your library into a nice **\*.js** bundle file -- so why ship your typings as a messy tree of **lib/\*.d.ts** files full of private definitions? Can't we consolidate them into a tidy **\*.d.ts** rollup file? And if you publish internal/beta/public releases, each release type should get its own **\*.d.ts** file with appropriate trimming. Developers building a production project don't want to see a bunch of **internal** and **beta** members in their VS Code IntelliSense!
2323

24-
- **Online documentation:** You have faithfully annotated each TypeScript member with nice [JSDoc](http://usejsdoc.org/) descriptions. Now that your library is published, you should probably set up [a nicely formatted](https://docs.microsoft.com/en-us/javascript/api/sp-http) API reference. Which tool should we use to generate that? (What!? There aren't any good ones!?)
24+
- **Online documentation:** You have faithfully annotated each TypeScript member with nice [JSDoc](http://usejsdoc.org/) descriptions. Now that your library has shipped, it's time to set up [a nicely formatted](https://docs.microsoft.com/en-us/javascript/api/sp-http) API reference. What tool to use?
2525

2626
**API Extractor** provides an integrated, professional-quality solution for all these problems. It is invoked at build time by your toolchain and leverages the TypeScript compiler engine to:
2727

2828
- Detect a project's exported API surface
2929
- Capture the contracts in a concise report designed to facilitate review
3030
- Warn about common mistakes (e.g. missing exports, inconsistent visibility, etc.)
31-
- Generate \*.d.ts rollups
32-
- Output API documentation in a portable format that's easy to integrate with your publishing pipeline
31+
- Generate \*.d.ts rollups with trimming according to release type
32+
- Output API documentation in a portable format that's easy to integrate with your content pipeline
3333

3434
Best of all, **API Extractor** is free and open source. Join the community and create a pull request!
3535

0 commit comments

Comments
 (0)