UNPKG

13.5 kBJSONView Raw
1{
2 "title": "API Extractor Configuration",
3 "description": "Describes how the API Extractor tool will process a project.",
4 "type": "object",
5 "properties": {
6 "$schema": {
7 "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.",
8 "type": "string"
9 },
10
11 "extends": {
12 "description": "Optionally specifies another JSON config file that this file extends from. This provides a way for standard settings to be shared across multiple projects.",
13 "type": "string"
14 },
15
16 "projectFolder": {
17 "description": "Determines the \"<projectFolder>\" token that can be used with other config file settings. The project folder typically contains the tsconfig.json and package.json config files, but the path is user-defined. The path is resolved relative to the folder of the config file that contains the setting. The default value for \"projectFolder\" is the token \"<lookup>\", which means the folder is determined using the following heuristics:\n\nIf the config/rig.json system is used (as defined by @rushstack/rig-package), then the \"<lookup>\" value will be the package folder that referenced the rig.\n\nOtherwise, the \"<lookup>\" value is determined by traversing parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error will be reported.",
18 "type": "string"
19 },
20
21 "mainEntryPointFilePath": {
22 "description": "Specifies the .d.ts file to be used as the starting point for analysis. API Extractor analyzes the symbols exported by this module. The file extension must be \".d.ts\" and not \".ts\". 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>\".",
23 "type": "string"
24 },
25
26 "bundledPackages": {
27 "description": "A list of NPM package names whose exports should be treated as part of this package.",
28 "type": "array",
29 "items": {
30 "type": "string"
31 }
32 },
33
34 "enumMemberOrder": {
35 "description": "Specifies how API Extractor sorts the members of an enum when generating the .api.json doc model. \n 'by-name': sort the items according to the enum member name \n 'preserve': keep the original order that items appear in the source code",
36 "type": "string",
37 "enum": ["by-name", "preserve"],
38 "default": "by-name"
39 },
40
41 "compiler": {
42 "description": "Determines how the TypeScript compiler engine will be invoked by API Extractor.",
43 "type": "object",
44 "properties": {
45 "tsconfigFilePath": {
46 "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.",
47 "type": "string"
48 },
49 "overrideTsconfig": {
50 "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\".",
51 "type": "object"
52 },
53 "skipLibCheck": {
54 "description": "This option causes the compiler 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. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck.",
55 "type": "boolean"
56 }
57 },
58 "additionalProperties": false
59 },
60
61 "apiReport": {
62 "description": "Configures how the API report file (*.api.md) will be generated.",
63 "type": "object",
64 "properties": {
65 "enabled": {
66 "description": "Whether to generate an API report.",
67 "type": "boolean"
68 },
69
70 "reportFileName": {
71 "description": "The filename for the API report files. It will be combined with \"reportFolder\" or \"reportTempFolder\" to produce a full file path. The file extension should be \".api.md\", and the string should not contain a path separator such as \"\\\" or \"/\".",
72 "type": "string"
73 },
74
75 "reportFolder": {
76 "description": "Specifies the folder where the API report file is written. The file name portion is determined by the \"reportFileName\" setting. The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, e.g. for an API review. 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>\".",
77 "type": "string"
78 },
79
80 "reportTempFolder": {
81 "description": "Specifies the folder where the temporary report file is written. The file name portion is determined by the \"reportFileName\" setting. After the temporary file is written to disk, it is compared with the file in the \"reportFolder\". If they are different, a production build will fail. 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>\".",
82 "type": "string"
83 }
84 },
85 "required": ["enabled"],
86 "additionalProperties": false
87 },
88
89 "docModel": {
90 "description": "Configures how the doc model file (*.api.json) will be generated.",
91 "type": "object",
92 "properties": {
93 "enabled": {
94 "description": "Whether to generate doc model file.",
95 "type": "boolean"
96 },
97 "apiJsonFilePath": {
98 "description": "The output path for the doc model file. The file extension should be \".api.json\". 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>\".",
99 "type": "string"
100 }
101 },
102 "required": ["enabled"],
103 "additionalProperties": false
104 },
105
106 "dtsRollup": {
107 "description": "Configures how the .d.ts rollup file will be generated.",
108 "type": "object",
109 "properties": {
110 "enabled": {
111 "description": "Whether to generate the .d.ts rollup file.",
112 "type": "boolean"
113 },
114 "untrimmedFilePath": {
115 "description": "Specifies the output path for a .d.ts rollup file to be generated without any trimming. This file will include all declarations that are exported by the main entry point. If the path is an empty string, then this file will not be written. 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>\".",
116 "type": "string"
117 },
118 "alphaTrimmedFilePath": {
119 "description": "Specifies the output path for a .d.ts rollup file to be generated with trimming for an \"alpha\" release. This file will include only declarations that are marked as \"@public\", \"@beta\", or \"@alpha\". 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>\".",
120 "type": "string"
121 },
122 "betaTrimmedFilePath": {
123 "description": "Specifies the output path for a .d.ts rollup file to be generated with trimming for a \"beta\" release. This file will include only declarations that are marked as \"@public\" or \"@beta\". 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>\".",
124 "type": "string"
125 },
126 "publicTrimmedFilePath": {
127 "description": "Specifies the output path for a .d.ts rollup file to be generated with trimming for a \"public\" release. This file will include only declarations that are marked as \"@public\". If the path is an empty string, then this file will not be written. 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>\".",
128 "type": "string"
129 },
130 "omitTrimmingComments": {
131 "description": "When a declaration is trimmed, by default it will be replaced by a code comment such as \"Excluded from this release type: exampleMember\". Set \"omitTrimmingComments\" to true to remove the declaration completely.",
132 "type": "boolean"
133 }
134 },
135 "required": ["enabled"],
136 "additionalProperties": false
137 },
138
139 "tsdocMetadata": {
140 "description": "Configures how the tsdoc-metadata.json file will be generated.",
141 "type": "object",
142 "properties": {
143 "enabled": {
144 "description": "Whether to generate the tsdoc-metadata.json file.",
145 "type": "boolean"
146 },
147 "tsdocMetadataFilePath": {
148 "description": "Specifies where the TSDoc metadata file should be written. 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>\". The default value is \"<lookup>\", 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, the lookup falls back to \"tsdoc-metadata.json\" in the package folder.",
149 "type": "string"
150 }
151 },
152 "additionalProperties": false
153 },
154
155 "newlineKind": {
156 "description": "Specifies what type of newlines API Extractor should use when writing output files. By default, the output files will be written with Windows-style newlines. To use POSIX-style newlines, specify \"lf\" instead. To use the OS's default newline kind, specify \"os\".",
157 "type": "string",
158 "enum": ["crlf", "lf", "os"],
159 "default": "crlf"
160 },
161
162 "messages": {
163 "description": "Configures how API Extractor reports error and warning messages produced during analysis.",
164 "type": "object",
165 "properties": {
166 "compilerMessageReporting": {
167 "description": "Configures handling of diagnostic messages generating the TypeScript compiler while analyzing the input .d.ts files.",
168 "$ref": "#/definitions/extractorMessageReportingTable"
169 },
170 "extractorMessageReporting": {
171 "description": "Configures handling of messages reported by API Extractor during its analysis.",
172 "$ref": "#/definitions/extractorMessageReportingTable"
173 },
174 "tsdocMessageReporting": {
175 "description": "Configures handling of messages reported by the TSDoc parser when analyzing code comments.",
176 "$ref": "#/definitions/extractorMessageReportingTable"
177 }
178 },
179 "additionalProperties": false
180 },
181
182 "testMode": {
183 "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.",
184 "type": "boolean"
185 }
186 },
187 "required": ["mainEntryPointFilePath"],
188 "additionalProperties": false,
189
190 "definitions": {
191 "extractorMessageReportingTable": {
192 "type": "object",
193 "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).",
194 "patternProperties": {
195 ".+": {
196 "type": "object",
197 "description": "Configures reporting for a given message identifier.",
198 "properties": {
199 "logLevel": {
200 "type": "string",
201 "description": "Specifies whether the message should be written to the the tool's output log. Note that the \"addToApiReportFile\" property may supersede this option.",
202 "enum": ["error", "warning", "none"]
203 },
204 "addToApiReportFile": {
205 "type": "boolean",
206 "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."
207 }
208 },
209 "additionalProperties": false,
210 "required": ["logLevel"]
211 }
212 },
213 "additionalProperties": false
214 }
215 }
216}