Skip to content

Commit 7714b4f

Browse files
authored
Merge pull request microsoft#238 from Microsoft/pgonzal/ae-pure-rename
Various renaming to standardize terminology
2 parents 1587572 + 9767c10 commit 7714b4f

29 files changed

Lines changed: 197 additions & 182 deletions
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"packageName": "@microsoft/api-extractor",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/api-extractor",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}

‎libraries/api-extractor/CHANGELOG.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@
338338
"comments": {
339339
"patch": [
340340
{
341-
"comment": "Check for missing JsDoc sequences changed."
341+
"comment": "Check for missing JSDoc sequences changed."
342342
},
343343
{
344344
"comment": "Improved error messages"

‎libraries/api-extractor/CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Thu, 19 Jan 2017 20:04:40 GMT
196196

197197
### Patches
198198

199-
- Check for missing JsDoc sequences changed.
199+
- Check for missing JSDoc sequences changed.
200200
- Improved error messages
201201

202202
## 1.1.0

‎libraries/api-extractor/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"typescript",
77
"API",
88
"JSDoc",
9+
"AEDoc",
910
"generate",
1011
"documentation",
1112
"compiler",

‎libraries/api-extractor/src/DocElementParser.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default class DocElementParser {
9090
case '@inheritdoc':
9191
tokenizer.getToken();
9292
if (docElements.length > 0 || documentation.summary.length > 0) {
93-
documentation.reportError('Cannot provide summary in JsDoc if @inheritdoc tag is given');
93+
documentation.reportError('Cannot provide summary in AEDoc if @inheritdoc tag is given');
9494
}
9595
documentation.incompleteInheritdocs.push(token);
9696
documentation.isDocInherited = true;

‎libraries/api-extractor/src/ResolvedApiItem.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ApiItem, { ApiItemKind } from './definitions/ApiItem';
2-
import { ApiTag } from './definitions/ApiDocumentation';
2+
import { ReleaseTag } from './definitions/ApiDocumentation';
33
import { IDocElement, IParam } from './IDocElement';
44
import { IDocItem } from './IDocItem';
55
import ApiJsonFile from './generators/ApiJsonFile';
@@ -13,7 +13,7 @@ export default class ResolvedApiItem {
1313
public summary: IDocElement[];
1414
public remarks: IDocElement[];
1515
public deprecatedMessage: IDocElement[];
16-
public apiTag: ApiTag;
16+
public releaseTag: ReleaseTag;
1717
public isBeta: boolean;
1818
public params: {[name: string]: IParam};
1919
public returnsMessage: IDocElement[];
@@ -32,10 +32,10 @@ export default class ResolvedApiItem {
3232
apiItem.documentation.summary,
3333
apiItem.documentation.remarks,
3434
apiItem.documentation.deprecatedMessage,
35-
apiItem.documentation.apiTag === ApiTag.Beta,
35+
apiItem.documentation.releaseTag === ReleaseTag.Beta,
3636
apiItem.documentation.parameters,
3737
apiItem.documentation.returnsMessage,
38-
apiItem.documentation.apiTag,
38+
apiItem.documentation.releaseTag,
3939
apiItem
4040
);
4141
}
@@ -68,7 +68,7 @@ export default class ResolvedApiItem {
6868
docItem.isBeta,
6969
parameters,
7070
returnsMessage,
71-
ApiTag.Public,
71+
ReleaseTag.Public,
7272
undefined
7373
);
7474
}
@@ -81,7 +81,7 @@ export default class ResolvedApiItem {
8181
isBeta: boolean,
8282
params: {[name: string]: IParam},
8383
returnsMessage: IDocElement[],
84-
apiTag: ApiTag,
84+
releaseTag: ReleaseTag,
8585
apiItem: ApiItem) {
8686
this.kind = kind;
8787
this.summary = summary;
@@ -90,7 +90,7 @@ export default class ResolvedApiItem {
9090
this.isBeta = isBeta;
9191
this.params = params;
9292
this.returnsMessage = returnsMessage;
93-
this.apiTag = apiTag;
93+
this.releaseTag = releaseTag;
9494
this.apiItem = apiItem;
9595
}
9696
}

‎libraries/api-extractor/src/Token.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export enum TokenType {
2525
}
2626

2727
/**
28-
* A structured object created from a doc comment string within a JSDoc comment block.
28+
* A structured object created from a doc comment string within an AEDoc comment block.
2929
*/
3030
export default class Token {
3131

‎libraries/api-extractor/src/Tokenizer.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import Token, { TokenType } from './Token';
22
import TypeScriptHelpers from './TypeScriptHelpers';
33

44
/**
5-
* Handles the tokenization of a JSDoc comment.
5+
* Handles the tokenization of an AEDoc comment.
66
*/
77
export default class Tokenizer {
88

99
/**
10-
* Match JsDoc block tags and inline tags
10+
* Match AEDoc block tags and inline tags
1111
* Example "@a @b@c d@e @f {whatever} {@link a} { @something } \@g" => ["@a", "@f", "{@link a}", "{ @something }"]
1212
*/
13-
private static _jsdocTagsRegex: RegExp = /{\s*@(\\{|\\}|[^{}])*}|(?:^|\s)(\@[a-z_]+)(?=\s|$)/gi;
13+
private static _aedocTagsRegex: RegExp = /{\s*@(\\{|\\}|[^{}])*}|(?:^|\s)(\@[a-z_]+)(?=\s|$)/gi;
1414

1515
/**
1616
* List of Tokens that have been tokenized.
@@ -27,9 +27,9 @@ export default class Tokenizer {
2727
/**
2828
* Converts a doc comment string into an array of Tokens. This processing is done so that docs
2929
* can be processed more strictly.
30-
* Example: "This is a JsDoc description with a {@link URL} and more text. \@remarks example \@public"
30+
* Example: "This is an AEDoc description with a {@link URL} and more text. \@remarks example \@public"
3131
* => [
32-
* {tokenType: 'text', parameter: 'This is a JsDoc description with a'},
32+
* {tokenType: 'text', parameter: 'This is an AEDoc description with a'},
3333
* {tokenType: '@link', parameter: 'URL'},
3434
* {tokenType: '\@remarks', parameter: ''},
3535
* {tokenType: 'text', parameter: 'example'},
@@ -40,7 +40,7 @@ export default class Tokenizer {
4040
if (!docs) {
4141
return;
4242
}
43-
const docEntries: string[] = TypeScriptHelpers.splitStringWithRegEx(docs, Tokenizer._jsdocTagsRegex);
43+
const docEntries: string[] = TypeScriptHelpers.splitStringWithRegEx(docs, Tokenizer._aedocTagsRegex);
4444
const sanitizedTokens: string[] = this._sanitizeDocEntries(docEntries); // remove white space and empty entries
4545

4646
// process each sanitized doc string to a Token object

‎libraries/api-extractor/src/TypeScriptHelpers.ts‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ export default class TypeScriptHelpers {
1313
/**
1414
* Start sequence is '/**'.
1515
*/
16-
public static jsDocStartRegEx: RegExp = /^\s*\/\*\*\s?/g;
16+
public static jsdocStartRegEx: RegExp = /^\s*\/\*\*\s?/g;
1717

1818
/**
1919
* End sequence is '*\/'.
2020
*/
21-
public static jsDocEndRegEx: RegExp = /\s*\*\/\s*$/g;
21+
public static jsdocEndRegEx: RegExp = /\s*\*\/\s*$/g;
2222

2323
/**
2424
* Intermediate lines of JSDoc comment character.
2525
*/
26-
public static jsDocIntermediateRegEx: RegExp = /^\s*[*]\s?/g;
26+
public static jsdocIntermediateRegEx: RegExp = /^\s*[*]\s?/g;
2727

2828
/**
2929
* Returns the Symbol for the provided Declaration. This is a workaround for a missing
@@ -59,34 +59,34 @@ export default class TypeScriptHelpers {
5959
* Example:
6060
* "This \n is \n a comment" from "\/** This\r\n* is\r\n* a comment *\/
6161
*/
62-
public static getJsDocComments(node: ts.Node, errorLogger: (message: string) => void): string {
63-
let jsDoc: string = '';
62+
public static getJsdocComments(node: ts.Node, errorLogger: (message: string) => void): string {
63+
let jsdoc: string = '';
6464
// tslint:disable-next-line:no-any
65-
const nodeJsDocObjects: any = (node as any).jsDoc;
66-
if (nodeJsDocObjects && nodeJsDocObjects.length > 0) {
65+
const nodeJsdocObjects: any = (node as any).jsDoc;
66+
if (nodeJsdocObjects && nodeJsdocObjects.length > 0) {
6767
// Use the JSDoc closest to the declaration
68-
const lastJsDocIndex: number = nodeJsDocObjects.length - 1;
69-
const jsDocFullText: string = nodeJsDocObjects[lastJsDocIndex].getText();
70-
const jsDocLines: string[] = jsDocFullText.split(TypeScriptHelpers.newLineRegEx);
71-
const jsDocStartSeqExists: boolean = TypeScriptHelpers.jsDocStartRegEx.test(jsDocLines[0].toString());
68+
const lastJsdocIndex: number = nodeJsdocObjects.length - 1;
69+
const jsdocFullText: string = nodeJsdocObjects[lastJsdocIndex].getText();
70+
const jsdocLines: string[] = jsdocFullText.split(TypeScriptHelpers.newLineRegEx);
71+
const jsdocStartSeqExists: boolean = TypeScriptHelpers.jsdocStartRegEx.test(jsdocLines[0].toString());
7272

7373
// Report error for each missing sequence seperately
74-
if (!jsDocStartSeqExists) {
75-
errorLogger('JsDoc comment must begin with a \"/**\" sequence.');
74+
if (!jsdocStartSeqExists) {
75+
errorLogger('Jsdoc comment must begin with a \"/**\" sequence.');
7676
return '';
7777
}
78-
const jsDocEndSeqExists: boolean = TypeScriptHelpers.jsDocEndRegEx.test(
79-
jsDocLines[jsDocLines.length - 1].toString()
78+
const jsdocEndSeqExists: boolean = TypeScriptHelpers.jsdocEndRegEx.test(
79+
jsdocLines[jsdocLines.length - 1].toString()
8080
);
81-
if (!jsDocEndSeqExists) {
82-
errorLogger('JsDoc comment must end with a \"*/\" sequence.');
81+
if (!jsdocEndSeqExists) {
82+
errorLogger('Jsdoc comment must end with a \"*/\" sequence.');
8383
return '';
8484
}
8585

86-
jsDoc = TypeScriptHelpers.removeJsDocSequences(jsDocLines);
86+
jsdoc = TypeScriptHelpers.removeJsdocSequences(jsdocLines);
8787
}
8888

89-
return jsDoc;
89+
return jsdoc;
9090
}
9191

9292
/**
@@ -95,15 +95,15 @@ export default class TypeScriptHelpers {
9595
* Example:
9696
* ["\/**", "*This \n", "*is \n", "*a comment", "*\/"] to "This \n is \n a comment"
9797
*/
98-
public static removeJsDocSequences(textLines: string[]): string {
98+
public static removeJsdocSequences(textLines: string[]): string {
9999
// Remove '/**'
100-
textLines[0] = textLines[0].replace(TypeScriptHelpers.jsDocStartRegEx, '');
100+
textLines[0] = textLines[0].replace(TypeScriptHelpers.jsdocStartRegEx, '');
101101
if (textLines[0] === '') {
102102
textLines.shift();
103103
}
104104
// Remove '*/'
105105
textLines[textLines.length - 1] = textLines[textLines.length - 1].replace(
106-
TypeScriptHelpers.jsDocEndRegEx,
106+
TypeScriptHelpers.jsdocEndRegEx,
107107
'');
108108
if (textLines[textLines.length - 1] === '') {
109109
textLines.pop();
@@ -112,7 +112,7 @@ export default class TypeScriptHelpers {
112112
// Remove the leading '*' from any intermediate lines
113113
if (textLines.length > 0) {
114114
for (let i: number = 0; i < textLines.length; i++) {
115-
textLines[i] = textLines[i].replace(TypeScriptHelpers.jsDocIntermediateRegEx, '');
115+
textLines[i] = textLines[i].replace(TypeScriptHelpers.jsdocIntermediateRegEx, '');
116116
}
117117
}
118118

0 commit comments

Comments
 (0)