build: remove unnecessary stability check (#23176)

Previously, it was necessary to attach on of the three "stability"
jsdoc tags (`@stable`, `@deprecated` or `@experimental`) to each
public API export.

To ensure that the public API was correctly tagged, the `ts-api-guardian`
would check that one of these tags appeared on every public export.

Now the doc-gen is able to compute that a code item is stable if
it does not contain the `@experimental` nor `@deprecated` tags.

Therefore there is no need to provide the `@stable` tag any more; and
this tag has now been marked as deprecated - i.e. it should not be used.

The ts-api-guardian has been modified in this commit so that it no longer
warns/fails if the `@stable` is missing.

PR Close #23176
This commit is contained in:
Pete Bacon Darwin
2018-04-04 21:31:34 +01:00
committed by Igor Minar
parent b8053f1d4f
commit ac316be79b
5 changed files with 2 additions and 52 deletions

View File

@ -24,14 +24,8 @@ export function startCli() {
const options: SerializationOptions = {
stripExportPattern: argv['stripExportPattern'],
allowModuleIdentifiers: [].concat(argv['allowModuleIdentifiers']),
onStabilityMissing: argv['onStabilityMissing'] || 'none'
};
if (['warn', 'error', 'none'].indexOf(options.onStabilityMissing as string) < 0) {
throw new Error(
'Argument for "--onStabilityMissing" option must be one of: "warn", "error", "none"');
}
for (const error of errors) {
console.warn(error);
}
@ -85,7 +79,7 @@ export function parseArguments(input: string[]):
const argv = minimist(input, {
string: [
'out', 'outDir', 'verify', 'verifyDir', 'rootDir', 'stripExportPattern',
'allowModuleIdentifiers', 'onStabilityMissing'
'allowModuleIdentifiers'
],
boolean: [
'help',
@ -161,10 +155,7 @@ Options:
--stripExportPattern <regexp> Do not output exports matching the pattern
--allowModuleIdentifiers <identifier>
Whitelist identifier for "* as foo" imports
--onStabilityMissing <warn|error|none>
Warn or error if an export has no stability
annotation`);
Whitelist identifier for "* as foo" imports`);
process.exit(error ? 1 : 0);
}