Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
245 lines (232 sloc) 11.9 KB
{
"title": "API Extractor Configuration",
"description": "Describes how the API Extractor tool will process a project.",
"type": "object",
"properties": {
"$schema": {
"description": "Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.",
"type": "string"
},
"extends": {
"description": "Optional field. Path to json config file from which config should extend",
"type": "string"
},
"compiler": {
"description": "Determines how the TypeScript compiler will be invoked. The compiler.configType selects the type of configuration. Different options are available according to the configuration type.",
"type": "object",
"oneOf": [
{
"type": "object",
"properties": {
"configType": {
"description": "configType=tsconfig indicates that the compiler settings will be taken from a tsconfig.json file",
"type": "string",
"enum": [ "tsconfig" ]
},
"rootFolder": {
"description": "The root folder for the project. This folder typically contains the tsconfig.json and package.json config files.",
"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.",
"type": "object"
}
},
"required": [ "configType", "rootFolder" ],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"configType": {
"description": "configType=runtime indicates that the compiler settings will be provided by a tool chain via a runtime API",
"type": "string",
"enum": [ "runtime" ]
}
},
"required": [ "configType" ],
"additionalProperties": false
}
]
},
"project": {
"description": "Describes a specific project that will be analyzed.",
"type": "object",
"properties": {
"entryPointSourceFile": {
"description": "Specifies the TypeScript source file that will be treated as the entry point for compilation.",
"type": "string"
}
},
"required": [ "entryPointSourceFile" ],
"additionalProperties": false
},
"policies": {
"description": "These policies determine how API Extractor validates various best practices for API design.",
"type": "object",
"properties": {
"namespaceSupport": {
"description": "Controls how API Extractor treats the TypeScript namespace keyword:\n\nconservative - (the default) namespaces may only be used to represent tables of constants\n\npermissive - arbitrary nesting of namespaces is allowed",
"type": "string",
"enum": [ "conservative", "permissive" ]
}
},
"additionalProperties": false
},
"validationRules": {
"description": "Configuration for various validation checks that ensure good API design",
"type": "object",
"properties": {
"missingReleaseTags": {
"description": "This rule checks for top-level API items that are missing a release tag such as \"@beta\" or \"@internal\". If \"allow\" is chosen, then missing release tags will be assumed to be \"@public\". The default policy is \"error\".",
"type": "string",
"enum": [ "error", "allow" ]
}
},
"additionalProperties": false
},
"apiReviewFile": {
"description": "Configures how the API review files (*.api.md) will be generated.",
"type": "object",
"properties": {
"enabled": {
"description": "Whether to generate review files at all. The default is true.",
"type": "boolean"
},
"apiReviewFolder": {
"description": "The file path of the folder containing API review file, relative to the project folder. The default value is \"./etc\".",
"type": "string"
},
"tempFolder": {
"description": "The *.api.md report is saved into this folder. During a production build, the temporary file will be compared with the file in apiReviewFolder; if there are differences, and error will be reported. The default value is \"./temp\".",
"type": "string"
}
},
"required": [ "enabled" ],
"additionalProperties": false
},
"apiJsonFile": {
"description": "Configures how the API JSON files (*.api.json) will be generated.",
"type": "object",
"properties": {
"enabled": {
"description": "Whether to generate API JSON files at all. The default is true.",
"type": "boolean"
},
"outputFolder": {
"description": "Specifies where the *.api.json file should be written. The default value is \"./dist\"",
"type": "string"
}
},
"required": [ "enabled" ],
"additionalProperties": false
},
"dtsRollup": {
"description": "Configures how the *.d.ts rollup files will be generated.",
"type": "object",
"properties": {
"enabled": {
"description": "Whether to generate rollup *.d.ts files. The default is false.",
"type": "boolean"
},
"trimming": {
"description": "If \"trimming\" is false (the default), then a single *.d.ts rollup file will be generated in the \"publishFolder\". If \"trimming\" is true, then three separate *.d.ts rollups will be generated in \"publishFolderForInternal\", \"publishFolderForBeta\", and \"publishFolderForPublic\".",
"type": "boolean"
},
"publishFolder": {
"description": "This setting is only used if \"trimming\" is false. It indicates the folder where \"npm publish\" will be run. The default value is \"./dist\".",
"type": "string"
},
"publishFolderForInternal": {
"description": "This setting is only used if \"trimming\" is true. It indicates the folder where \"npm publish\" will be run for an internal release. The default value is \"./dist/internal\". An internal release will contain all definitions that are reachable from the entry point.",
"type": "string"
},
"publishFolderForBeta": {
"description": "This setting is only used if \"trimming\" is true. It indicates the folder where \"npm publish\" will be run for a beta release. The default value is \"./dist/beta\". A beta release will contain all definitions that are reachable from the entry point, except definitions marked as @alpha or @internal.",
"type": "string"
},
"publishFolderForPublic": {
"description": "This setting is only used if \"trimming\" is true. It indicates the folder where \"npm publish\" will be run for a public release. The default value is \"./dist/public\". A public release will contain all definitions that are reachable from the entry point, except definitions marked as @beta, @alpha, or @internal.",
"type": "string"
},
"mainDtsRollupPath": {
"description": "Specifies the relative path for the *.d.ts rollup file to be generated for the package's main entry point. The default value is an empty string, which causes the path to be automatically inferred from the \"typings\" field of the project's package.json file. If specified, the value must be a relative path that can be combined with one of the publish folder settings.",
"type": "string"
}
},
"required": [ "enabled" ],
"additionalProperties": false
},
"tsdocMetadata": {
"description": "Configures how the TSDoc metadata file will be generated",
"type": "object",
"properties": {
"enabled": {
"description": "Whether to generate the TSDoc metadata file. The default is true.",
"type": "boolean"
},
"tsdocMetadataPath": {
"description": "Specifies where the TSDoc metadata file should be written. The default value is an empty string, which causes the path to be automatically inferred from the \"tsdocMetadata\", \"typings\" or \"main\" fields of the project's package.json. If none of these fields are set, it defaults to \"tsdoc-metadata.json\".",
"type": "string"
},
},
"required": [ "enabled" ],
"additionalProperties": false
},
"messages": {
"description": "Configures how API Extractor reports error and warning messages produced during analysis.",
"type": "object",
"properties": {
"compilerMessageReporting": {
"description": "Configures handling of diagnostic messages generating the TypeScript compiler while analyzing the input .d.ts files.",
"$ref": "#/definitions/extractorMessageReportingTable"
},
"extractorMessageReporting": {
"description": "Configures handling of messages reported by API Extractor during its analysis.",
"$ref": "#/definitions/extractorMessageReportingTable"
},
"tsdocMessageReporting": {
"description": "Configures handling of messages reported by the TSDoc parser when analyzing code comments.",
"$ref": "#/definitions/extractorMessageReportingTable"
}
},
"additionalProperties": false
},
"skipLibCheck": {
"description": "This option causes the typechecker to be invoked with the --skipLibCheck option. This option is not recommended and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses for its analysis. If this option is used, it is strongly recommended that broken dependencies be fixed or upgraded.",
"type": "boolean"
},
"testMode": {
"description": "Set to true invoking API Extractor's test harness. When \"testMode\" is true, the \"toolVersion\" field in the .api.json file is assigned an empty string to prevent spurious diffs in output files tracked for tests.",
"type": "boolean"
}
},
"required": [ "compiler", "project" ],
"additionalProperties": false,
"definitions": {
"extractorMessageReportingTable": {
"type":"object",
"description": "Specifies a table of reporting rules for different message identifiers, and also the default rule used for identifiers that do not appear in the table. The key is a message identifier for the associated type of message, or \"default\" to specify the default policy. For example, the key might be \"TS2551\" (a compiler message), \"tsdoc-link-tag-unescaped-text\" (a TSDOc message), or \"ae-extra-release-tag\" (a message related to the API Extractor analysis).",
"patternProperties": {
".+": {
"type": "object",
"description": "Configures reporting for a given message identifier.",
"properties": {
"logLevel": {
"type": "string",
"description": "Specifies whether the message should be written to the the tool's output log. Note that the \"addToApiReviewFile\" property may supersede this option.",
"enum": [ "error", "warning", "none" ]
},
"addToApiReviewFile": {
"type": "boolean",
"description": "If API Extractor is configured to write an API review file (.api.md), then the message will be written inside that file. If the API review file is NOT being written, then the message is instead logged according to the \"logLevel\" option."
}
},
"additionalProperties": false,
"required": [ "logLevel" ]
}
},
"additionalProperties": false
}
}
}
You can’t perform that action at this time.