Skip to content

Commit 7bc5a65

Browse files
authored
Merge pull request microsoft#242 from Microsoft/pgonzal/ae-new-validation
API Extractor now validates release tags and autogenerates constructor summaries
2 parents 08bd7e5 + e8370d0 commit 7bc5a65

54 files changed

Lines changed: 632 additions & 125 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/rush-lib/src/data/ApprovedPackagesPolicy.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import RushConfiguration, { IRushConfigurationJson, IApprovedPackagesPolicyJson
1111
/**
1212
* This is a helper object for RushConfiguration.
1313
* It exposes the "approvedPackagesPolicy" feature from rush.json.
14+
* @public
1415
*/
1516
export class ApprovedPackagesPolicy {
1617
private _enabled: boolean;

‎apps/rush-lib/src/utilities/JsonSchemaValidator.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import JsonFile from './JsonFile';
88

99
export type ValidateErrorCallback = (errorDescription: string) => void;
1010

11+
/**
12+
* @alpha
13+
*/
1114
export default class JsonSchemaValidator {
1215
private _validator: Validator;
1316
private _schemaObject: Object;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/api-extractor",
5+
"comment": "Add two new features: An error is reported if a top-level definition is missing its release tag. The constructor summary will now be autogenerated if omitted.",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@microsoft/api-extractor",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/gulp-core-build-typescript",
5+
"comment": "Add missing API Extractor release tags",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/gulp-core-build-typescript",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/gulp-core-build-webpack",
5+
"comment": "Add missing API Extractor release tags",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/gulp-core-build-webpack",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/gulp-core-build",
5+
"comment": "Add missing API Extractor release tags",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/gulp-core-build",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/node-core-library",
5+
"comment": "Add missing API Extractor release tags",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/node-core-library",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/package-deps-hash",
5+
"comment": "Add missing API Extractor release tags",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/package-deps-hash",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}

‎common/reviews/api/gulp-core-build-webpack.api.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// (undocumented)
1+
// @public (undocumented)
22
interface IWebpackTaskConfig {
33
config?: Webpack.Configuration;
44
configPath: string;
55
suppressWarnings?: (string | RegExp)[];
66
webpack?: typeof Webpack;
77
}
88

9-
// (undocumented)
9+
// @public (undocumented)
1010
class WebpackTask extends GulpTask<IWebpackTaskConfig> {
1111
// (undocumented)
1212
public executeTask(gulp: gulp.Gulp, completeCallback: (result?: Object) => void): void;

‎common/reviews/api/gulp-core-build.api.ts‎

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
// @public
12
export function addSuppression(str: string): void;
23

4+
// @public
35
class CleanTask extends GulpTask<void> {
46
constructor();
57
public executeTask(gulp: gulp.Gulp,
68
completeCallback: (result?: Object) => void): void;
79
}
810

11+
// @public
912
class CopyTask extends GulpTask<ICopyConfig> {
1013
constructor();
1114
public executeTask(gulp: gulp.Gulp,
@@ -14,29 +17,40 @@ class CopyTask extends GulpTask<ICopyConfig> {
1417
public loadSchema(): Object;
1518
}
1619

20+
// @public
1721
export function coverageData(coverage: number, threshold: number, filePath: string): void;
1822

23+
// @public
1924
export function error(...args: Array<string | Chalk.ChalkChain>): void;
2025

26+
// @public
2127
export function fileError(taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void;
2228

29+
// @public
2330
export function fileLog(write: (text: string) => void, taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void;
2431

32+
// @public
2533
export function fileWarning(taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void;
2634

35+
// @public
2736
export function functionalTestRun(name: string, result: TestResultState, duration: number): void;
2837

38+
// @public
2939
class GenerateShrinkwrapTask extends GulpTask<void> {
3040
constructor();
3141
public executeTask(gulp: gulpType.Gulp, completeCallback: (result?: Object) => void): NodeJS.ReadWriteStream;
3242
}
3343

44+
// @public
3445
export function getConfig(): IBuildConfig;
3546

47+
// @public
3648
export function getErrors(): string[];
3749

50+
// @public
3851
export function getWarnings(): string[];
3952

53+
// @public
4054
class GulpTask<TASK_CONFIG> implements IExecutable {
4155
protected _getConfigFilePath(): string;
4256
public buildConfig: IBuildConfig;
@@ -67,7 +81,7 @@ class GulpTask<TASK_CONFIG> implements IExecutable {
6781
public taskConfig: TASK_CONFIG;
6882
}
6983

70-
// (undocumented)
84+
// @public (undocumented)
7185
interface IBuildConfig {
7286
args?: {
7387
[ name: string ]: string | boolean
@@ -97,20 +111,22 @@ interface IBuildConfig {
97111
verbose?: boolean;
98112
}
99113

114+
// @public
100115
interface ICopyConfig {
101116
copyTo: {
102117
[ destPath: string ]: string[];
103118
}
104119
shouldFlatten?: boolean;
105120
}
106121

122+
// @public
107123
interface ICustomGulpTask {
108124
// WARNING: The type "GulpProxy" needs to be exported by the package (e.g. added to index.ts)
109125
// (undocumented)
110126
(gulp: gulp.Gulp | GulpProxy, buildConfig: IBuildConfig, done: (failure?: Object) => void): Promise<Object> | NodeJS.ReadWriteStream | void;
111127
}
112128

113-
// (undocumented)
129+
// @public (undocumented)
114130
interface IExecutable {
115131
execute: (config: IBuildConfig) => Promise<void>;
116132
getCleanMatch?: (config: IBuildConfig, taskConfig?: any) => string[];
@@ -119,36 +135,48 @@ interface IExecutable {
119135
onRegister?: () => void;
120136
}
121137

138+
// @public
122139
export function initialize(gulp: gulp.Gulp): void;
123140

141+
// @public
124142
export function log(...args: Array<string | Chalk.ChalkChain>): void;
125143

144+
// @public
126145
export function logSummary(value: string): void;
127146

147+
// @public
128148
export function mergeConfig(config: IBuildConfig): void;
129149

150+
// @public
130151
export function parallel(...tasks: Array<IExecutable[] | IExecutable>): IExecutable;
131152

153+
// @public
132154
export function replaceConfig(config: IBuildConfig): void;
133155

134156
// @internal
135157
export function reset(): void;
136158

159+
// @public
137160
class SchemaValidator {
138161
public static readAndValidateJson < TResult >(dataFilePath: string, schemaFilePath: string): TResult;
139162
// (undocumented)
140163
public static readCommentedJsonFile < TResult >(filename: string): TResult;
141164
public static validate(data: Object, schema: Object, dataFilePath?: string): void;
142165
}
143166

167+
// @public
144168
export function serial(...tasks: Array<IExecutable[] | IExecutable>): IExecutable;
145169

170+
// @public
146171
export function setConfig(config: IBuildConfig): void;
147172

173+
// @public
148174
export function subTask(taskName: string, fn: ICustomGulpTask): IExecutable;
149175

176+
// @public
150177
export function task(taskName: string, task: IExecutable): IExecutable;
151178

179+
// @public
152180
enum TestResultState {
153181
// (undocumented)
154182
Failed,
@@ -160,15 +188,19 @@ enum TestResultState {
160188
Skipped
161189
}
162190

191+
// @public
163192
class ValidateShrinkwrapTask extends GulpTask<void> {
164193
constructor();
165194
public executeTask(gulp: gulpType.Gulp): NodeJS.ReadWriteStream;
166195
}
167196

197+
// @public
168198
export function verbose(...args: Array<string | Chalk.ChalkChain>): void;
169199

200+
// @public
170201
export function warn(...args: Array<string | Chalk.ChalkChain>): void;
171202

203+
// @public
172204
export function watch(watchMatch: string | string[], task: IExecutable): IExecutable;
173205

174206
// WARNING: Unsupported export: clean

0 commit comments

Comments
 (0)