Skip to content

Commit 2d646e5

Browse files
authored
Merge branch 'master' into feature/support-namespace
2 parents fa6497f + 3ce359f commit 2d646e5

File tree

46 files changed

+309
-249
lines changed

Some content is hidden

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

46 files changed

+309
-249
lines changed

apps/api-documenter/CHANGELOG.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
{
22
"name": "@microsoft/api-documenter",
33
"entries": [
4+
{
5+
"version": "1.5.10",
6+
"tag": "@microsoft/api-documenter_v1.5.10",
7+
"date": "Mon, 20 Aug 2018 16:04:29 GMT",
8+
"comments": {
9+
"patch": [
10+
{
11+
"comment": "Allow markdown to continue generating when api reference check failed"
12+
}
13+
]
14+
}
15+
},
416
{
517
"version": "1.5.9",
618
"tag": "@microsoft/api-documenter_v1.5.9",

apps/api-documenter/CHANGELOG.md

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

3-
This log was last generated on Thu, 09 Aug 2018 21:58:02 GMT and should not be manually modified.
3+
This log was last generated on Mon, 20 Aug 2018 16:04:29 GMT and should not be manually modified.
4+
5+
## 1.5.10
6+
Mon, 20 Aug 2018 16:04:29 GMT
7+
8+
### Patches
9+
10+
- Allow markdown to continue generating when api reference check failed
411

512
## 1.5.9
613
Thu, 09 Aug 2018 21:58:02 GMT

apps/api-documenter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/api-documenter",
3-
"version": "1.5.9",
3+
"version": "1.5.10",
44
"description": "Read JSON files from api-extractor, generate documentation pages",
55
"repository": {
66
"type": "git",

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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 * as colors from 'colors';
45
import * as path from 'path';
56

67
import {
@@ -625,14 +626,16 @@ export class MarkdownDocumenter {
625626
onRenderApiLink: (args: IMarkdownRenderApiLinkArgs) => {
626627
const resolveResult: IDocItemSetResolveResult = this._docItemSet.resolveApiItemReference(args.reference);
627628
if (!resolveResult.docItem) {
628-
throw new Error('Unresolved: ' + JSON.stringify(args.reference));
629+
// Eventually we should introduce a warnings file
630+
console.error(colors.yellow('Warning: Unresolved hyperlink to '
631+
+ Markup.formatApiItemReference(args.reference)));
632+
} else {
633+
// NOTE: GitHub's markdown renderer does not resolve relative hyperlinks correctly
634+
// unless they start with "./" or "../".
635+
const docFilename: string = './' + this._getFilenameForDocItem(resolveResult.docItem);
636+
args.prefix = '[';
637+
args.suffix = '](' + docFilename + ')';
629638
}
630-
631-
// NOTE: GitHub's markdown renderer does not resolve relative hyperlinks correctly
632-
// unless they start with "./" or "../".
633-
const docFilename: string = './' + this._getFilenameForDocItem(resolveResult.docItem);
634-
args.prefix = '[';
635-
args.suffix = '](' + docFilename + ')';
636639
}
637640
});
638641

apps/api-documenter/src/start.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import * as os from 'os';
55
import * as colors from 'colors';
66
import * as path from 'path';
77

8+
import { FileConstants } from '@microsoft/node-core-library';
9+
810
import { ApiDocumenterCommandLine } from './cli/ApiDocumenterCommandLine';
911

1012
const myPackageJsonFilename: string = path.resolve(path.join(
11-
__dirname, '..', 'package.json')
13+
__dirname, '..', FileConstants.PackageJson)
1214
);
1315
const myPackageJson: { version: string } = require(myPackageJsonFilename);
1416

apps/api-extractor/src/DocItemLoader.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import * as os from 'os';
55
import * as path from 'path';
66
import {
77
JsonFile,
8-
FileSystem
8+
FileSystem,
9+
FileConstants
910
} from '@microsoft/node-core-library';
1011

1112
import {
@@ -40,7 +41,7 @@ export class DocItemLoader implements IReferenceResolver {
4041
* that we are compiling.
4142
*/
4243
constructor(projectFolder: string) {
43-
if (!FileSystem.exists(path.join(projectFolder, 'package.json'))) {
44+
if (!FileSystem.exists(path.join(projectFolder, FileConstants.PackageJson))) {
4445
throw new Error(`An NPM project was not found in the specified folder: ${projectFolder}`);
4546
}
4647

apps/api-extractor/src/start.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import * as os from 'os';
55
import * as colors from 'colors';
66
import * as path from 'path';
77

8+
import { FileConstants } from '@microsoft/node-core-library';
9+
810
import { ApiExtractorCommandLine } from './cli/ApiExtractorCommandLine';
911

1012
const myPackageJsonFilename: string = path.resolve(path.join(
11-
__dirname, '..', 'package.json')
13+
__dirname, '..', FileConstants.PackageJson)
1214
);
1315
const myPackageJson: { version: string } = require(myPackageJsonFilename);
1416

apps/rush-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/rush-lib",
3-
"version": "5.0.0",
3+
"version": "5.0.2",
44
"description": "A library for writing scripts that interact with the Rush tool",
55
"repository": {
66
"type": "git",

apps/rush-lib/src/api/ChangeFile.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,22 @@ export class ChangeFile {
6262
}
6363

6464
/**
65-
* Writes the change file to disk in sync mode
65+
* Writes the change file to disk in sync mode.
66+
* Returns the filepath.
67+
* @returns the path to the file that was written (based on generatePath())
6668
*/
67-
public writeSync(): void {
69+
public writeSync(): string {
6870
const filePath: string = this.generatePath();
6971
JsonFile.save(this._changeFileData, filePath, {
7072
ensureFolderExists: true
7173
});
74+
return filePath;
7275
}
7376

7477
/**
75-
* Generates a file path for storing the change file to disk
78+
* Generates a file path for storing the change file to disk.
79+
* Note that this value may change if called twice in a row,
80+
* as it is partially based on the current date/time.
7681
*/
7782
public generatePath(): string {
7883
let branch: string | undefined = undefined;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { RushConfiguration } from './RushConfiguration';
2+
import { RushConfigurationProject } from './RushConfigurationProject';
3+
import { ChangeFile } from './ChangeFile';
4+
import { IChangeFile } from './ChangeManagement';
5+
6+
/**
7+
* A class that helps with programatically interacting with Rush's change files.
8+
* @public
9+
*/
10+
export class ChangeManager {
11+
/**
12+
* Creates a change file that has a 'none' type.
13+
* @param rushConfiguration - The rush configuration we are working with
14+
* @param projectName - The name of the project for which to create a change file
15+
* @param emailAddress - The email address which should be associated with this change
16+
* @returns the path to the file that was created, or undefined if no file was written
17+
*/
18+
public static createEmptyChangeFiles(
19+
rushConfiguration: RushConfiguration,
20+
projectName: string,
21+
emailAddress: string): string | undefined {
22+
const projectInfo: RushConfigurationProject | undefined = rushConfiguration.getProjectByName(projectName);
23+
if (projectInfo && projectInfo.shouldPublish) {
24+
25+
const changefile: IChangeFile = { // tslint:disable-line:no-any
26+
'changes': [{
27+
comment: '',
28+
packageName: projectName,
29+
type: 'none'
30+
}],
31+
'packageName': projectName,
32+
'email': emailAddress
33+
};
34+
35+
return new ChangeFile(changefile, rushConfiguration).writeSync();
36+
}
37+
return undefined;
38+
}
39+
}

0 commit comments

Comments
 (0)