Skip to content

Commit

Permalink
Merge pull request #1230 from Microsoft/octogonz/ae-misc-fixes
Browse files Browse the repository at this point in the history
[api-extractor] Fix a regression where ExtractorMessage.logLevel was not assigned
  • Loading branch information
octogonz authored Apr 12, 2019
2 parents b82072a + 86c4883 commit 0e27a34
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/api-extractor/src/api/ExtractorMessageId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const enum ExtractorMessageId {
UnresolvedInheritDocBase = 'ae-unresolved-inheritdoc-base',

/**
* "The `@inheritDoc` tag for ____ refers to its own declaration".
* "The `@inheritDoc` tag for ___ refers to its own declaration".
*/
CyclicInheritDoc = 'ae-cyclic-inherit-doc',

Expand Down
4 changes: 2 additions & 2 deletions apps/api-extractor/src/api/IConfigFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface IConfigCompiler {
tsconfigFilePath?: string;

/**
* Provides already parsed tsconfig.json contents.
* Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
*
* @remarks
* The value must conform to the TypeScript tsconfig schema:
Expand Down Expand Up @@ -107,7 +107,7 @@ export interface IConfigApiReport {
*/
export interface IConfigDocModel {
/**
* Whether to generate doc model file.
* Whether to generate a doc model file.
*/
enabled: boolean;

Expand Down
8 changes: 8 additions & 0 deletions apps/api-extractor/src/collector/MessageRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,14 @@ export class MessageRouter {
return;
}

// Assign the ExtractorMessage.logLevel; the message callback may adjust it below
if (message.category === ExtractorMessageCategory.Console) {
// Console messages have their category log level assigned via logInfo(), logVerbose(), etc.
} else {
const reportingRule: IReportingRule = this._getRuleForMessage(message);
message.logLevel = reportingRule.logLevel;
}

if (this._messageCallback) {
this._messageCallback(message);

Expand Down
6 changes: 3 additions & 3 deletions apps/api-extractor/src/collector/VisitorState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ export enum VisitorState {
/**
* We have not visited the node yet.
*/
Unvisited,
Unvisited = 0,

/**
* We have visited the node, but have not finished traversing its references yet.
* If we reach a node that is already in the `Visiting` state, this means we have
* encountered a cyclic reference.
*/
Visiting,
Visiting = 1,

/**
* We are finished vising the node and all its references.
*/
Visited
Visited = 2
}
6 changes: 3 additions & 3 deletions apps/api-extractor/src/schemas/api-extractor-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* SUPPORTED TOKENS: <lookup>
* DEFAULT VALUE: "<lookup>"
*/
// "projectFolder": "",
// "projectFolder": "..",

/**
* (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor
Expand Down Expand Up @@ -65,7 +65,7 @@
// "tsconfigFilePath": "<projectFolder>/tsconfig.json",

/**
* Provides compiler configuration that will be used instead of reading the tsconfig.json file from disk.
* Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
* The object must conform to the TypeScript tsconfig schema:
*
* http://json.schemastore.org/tsconfig
Expand Down Expand Up @@ -145,7 +145,7 @@
*/
"docModel": {
/**
* (REQUIRED) Whether to generate doc model file.
* (REQUIRED) Whether to generate a doc model file.
*/
"enabled": true,

Expand Down
4 changes: 2 additions & 2 deletions apps/api-extractor/src/schemas/api-extractor.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"type": "object",
"properties": {
"tsconfigFilePath": {
"description": " Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. The path is resolved relative to the folder of the config file that contains the setting; to change this, prepend a folder token such as \"<projectFolder>\". Note: This setting will be ignored if \"overrideTsconfig\" is used.",
"description": "Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. The path is resolved relative to the folder of the config file that contains the setting; to change this, prepend a folder token such as \"<projectFolder>\". Note: This setting will be ignored if \"overrideTsconfig\" is used.",
"type": "string"
},
"overrideTsconfig": {
"description": "Provides already parsed tsconfig.json contents conforming to the TypeScript tsconfig schema: http://json.schemastore.org/tsconfig If omitted, then the tsconfig.json file will be read from the \"projectFolder\".",
"description": "Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. The object must conform to the TypeScript tsconfig schema: http://json.schemastore.org/tsconfig If omitted, then the tsconfig.json file will be read from the \"projectFolder\".",
"type": "object"
},
"skipLibCheck": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/api-extractor",
"comment": "Fix a regression that prevented certain types of warnings from being reported",
"type": "patch"
}
],
"packageName": "@microsoft/api-extractor",
"email": "[email protected]"
}

0 comments on commit 0e27a34

Please sign in to comment.