Merge pull request #8844 from backstage/rugvip/nowarn

scripts/api-extractor: forbid warnings for a couple of core packages
This commit is contained in:
Ben Lambert
2022-01-10 17:18:56 +01:00
committed by GitHub
3 changed files with 46 additions and 6 deletions
-6
View File
@@ -23,8 +23,6 @@ export type ConfigSchemaProcessingOptions = {
withFilteredKeys?: boolean;
};
// Warning: (ae-missing-release-tag) "ConfigTarget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type ConfigTarget =
| {
@@ -51,15 +49,11 @@ export type LoadConfigOptions = {
watch?: LoadConfigOptionsWatch;
};
// Warning: (ae-missing-release-tag) "LoadConfigOptionsRemote" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type LoadConfigOptionsRemote = {
reloadIntervalSeconds: number;
};
// Warning: (ae-missing-release-tag) "LoadConfigOptionsWatch" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type LoadConfigOptionsWatch = {
onChange: (configs: AppConfig[]) => void;
+3
View File
@@ -29,8 +29,10 @@ import {
} from './lib';
import fetch from 'node-fetch';
/** @public */
export type ConfigTarget = { path: string } | { url: string };
/** @public */
export type LoadConfigOptionsWatch = {
/**
* A listener that is called when a config file is changed.
@@ -43,6 +45,7 @@ export type LoadConfigOptionsWatch = {
stopSignal?: Promise<void>;
};
/** @public */
export type LoadConfigOptionsRemote = {
/**
* A remote config reloading period, in seconds
+43
View File
@@ -198,6 +198,44 @@ const SKIPPED_PACKAGES = [
join('packages', 'techdocs-cli'),
];
const NO_WARNING_PACKAGES = [
'packages/app-defaults',
'packages/backend-common',
'packages/backend-tasks',
'packages/backend-test-utils',
'packages/catalog-client',
'packages/cli-common',
'packages/config',
'packages/config-loader',
'packages/core-app-api',
'packages/core-plugin-api',
'packages/dev-utils',
'packages/errors',
'packages/integration',
'packages/integration-react',
'packages/test-utils',
'packages/theme',
'packages/types',
'packages/version-bridge',
'plugins/catalog-backend-module-ldap',
'plugins/catalog-common',
'plugins/permission-backend',
'plugins/permission-common',
'plugins/permission-node',
'plugins/permission-react',
'plugins/scaffolder-backend-module-cookiecutter',
'plugins/scaffolder-backend-module-rails',
'plugins/scaffolder-backend-module-yeoman',
'plugins/scaffolder-common',
'plugins/tech-insights',
'plugins/tech-insights-backend',
'plugins/tech-insights-backend-module-jsonfc',
'plugins/tech-insights-common',
'plugins/tech-insights-node',
'plugins/todo',
'plugins/todo-backend',
];
async function resolvePackagePath(
packagePath: string,
): Promise<string | undefined> {
@@ -505,6 +543,11 @@ async function runApiExtraction({
}
const warningCountAfter = await countApiReportWarnings(projectFolder);
if (NO_WARNING_PACKAGES.includes(packageDir) && warningCountAfter > 0) {
throw new Error(
`The API Report for ${packageDir} is not allowed to have warnings`,
);
}
if (warningCountAfter > warningCountBefore) {
warnings.push(
`The API Report for ${packageDir} introduces new warnings. ` +