Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api-extractor] Fix a regression where ExtractorMessage.logLevel was not assigned #1230

Merged
merged 5 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]"
}