From 78c7043806bbcdc29b8cde9b1cccbde4e5950ed7 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 11 Feb 2019 02:58:27 -0800 Subject: [PATCH] Fixing api-extractor in GCB projects. --- .../reviews/api/gulp-core-build-sass.api.ts | 8 +- .../reviews/api/gulp-core-build-serve.api.ts | 20 +- .../api/gulp-core-build-webpack.api.ts | 45 +-- common/reviews/api/gulp-core-build.api.ts | 346 +++++++++--------- common/reviews/api/node-core-library.api.ts | 36 +- common/reviews/api/web-library-build.api.ts | 336 +---------------- core-build/gulp-core-build-sass/src/index.ts | 3 + core-build/gulp-core-build-serve/src/index.ts | 15 + .../gulp-core-build-typescript/package.json | 2 +- .../gulp-core-build/config/api-extractor.json | 20 +- core-build/web-library-build/src/index.ts | 35 +- 11 files changed, 342 insertions(+), 524 deletions(-) diff --git a/common/reviews/api/gulp-core-build-sass.api.ts b/common/reviews/api/gulp-core-build-sass.api.ts index 3bbdaf18bd4..817731ee5c3 100644 --- a/common/reviews/api/gulp-core-build-sass.api.ts +++ b/common/reviews/api/gulp-core-build-sass.api.ts @@ -1,3 +1,5 @@ -// WARNING: Unsupported export: sass -// WARNING: Unsupported export: default -// (No @packagedocumentation comment for this package) +// @public (undocumented) +declare const sass: SassTask; + + +// (No @packageDocumentation comment for this package) diff --git a/common/reviews/api/gulp-core-build-serve.api.ts b/common/reviews/api/gulp-core-build-serve.api.ts index 6b8947d6285..caacbe4dfa2 100644 --- a/common/reviews/api/gulp-core-build-serve.api.ts +++ b/common/reviews/api/gulp-core-build-serve.api.ts @@ -1,6 +1,14 @@ -// WARNING: Unsupported export: serve -// WARNING: Unsupported export: reload -// WARNING: Unsupported export: trustDevCert -// WARNING: Unsupported export: untrustDevCert -// WARNING: Unsupported export: default -// (No @packagedocumentation comment for this package) +// @public (undocumented) +declare const reload: ReloadTask; + +// @public (undocumented) +declare const serve: ServeTask; + +// @public (undocumented) +declare const trustDevCert: TrustCertTask; + +// @public (undocumented) +declare const untrustDevCert: UntrustCertTask; + + +// (No @packageDocumentation comment for this package) diff --git a/common/reviews/api/gulp-core-build-webpack.api.ts b/common/reviews/api/gulp-core-build-webpack.api.ts index d8e652c5eee..4095232d91e 100644 --- a/common/reviews/api/gulp-core-build-webpack.api.ts +++ b/common/reviews/api/gulp-core-build-webpack.api.ts @@ -1,31 +1,34 @@ // @public (undocumented) interface IWebpackResources { - // (undocumented) - webpack: typeof Webpack; + // (undocumented) + webpack: typeof Webpack; } // @public (undocumented) interface IWebpackTaskConfig { - config?: Webpack.Configuration; - configPath: string; - printStats?: boolean; - suppressWarnings?: (string | RegExp)[]; - webpack?: typeof Webpack; + config?: Webpack.Configuration; + configPath: string; + printStats?: boolean; + suppressWarnings?: (string | RegExp)[]; + webpack?: typeof Webpack; } // @public (undocumented) -class WebpackTask extends GulpTask { - constructor(extendedName?: string, extendedConfig?: TExtendedConfig); - // (undocumented) - executeTask(gulp: typeof Gulp, completeCallback: (error?: string) => void): void; - // (undocumented) - isEnabled(buildConfig: IBuildConfig): boolean; - // (undocumented) - loadSchema(): Object; - // (undocumented) - readonly resources: IWebpackResources; -} +declare const webpack: WebpackTask; + +// @public (undocumented) +declare class WebpackTask extends GulpTask { + // (undocumented) + constructor(extendedName?: string, extendedConfig?: TExtendedConfig); + // (undocumented) + executeTask(gulp: typeof Gulp, completeCallback: (error?: string) => void): void; + // (undocumented) + isEnabled(buildConfig: IBuildConfig): boolean; + // (undocumented) + loadSchema(): Object; + // (undocumented) + readonly resources: IWebpackResources; + } + -// WARNING: Unsupported export: webpack -// WARNING: Unsupported export: default -// (No @packagedocumentation comment for this package) +// (No @packageDocumentation comment for this package) diff --git a/common/reviews/api/gulp-core-build.api.ts b/common/reviews/api/gulp-core-build.api.ts index 8874c2d6f94..a6d99757dc9 100644 --- a/common/reviews/api/gulp-core-build.api.ts +++ b/common/reviews/api/gulp-core-build.api.ts @@ -1,259 +1,271 @@ -// @internal -export function _isJestEnabled(rootFolder: string): boolean; - // @public -export function addSuppression(suppression: string | RegExp): void; +declare function addSuppression(suppression: string | RegExp): void; + +// @public (undocumented) +declare const clean: IExecutable; + +// @public (undocumented) +declare const cleanFlag: IExecutable; // @public -class CleanFlagTask extends CleanTask { - constructor(); - // (undocumented) - executeTask(gulp: typeof Gulp, completeCallback: (error?: string | Error) => void): void; - // (undocumented) - isEnabled(buildConfig: IBuildConfig): boolean; +declare class CleanFlagTask extends CleanTask { + // (undocumented) + constructor(); + // (undocumented) + executeTask(gulp: typeof gulp_2, completeCallback: (error?: string | Error) => void): void; + // (undocumented) + isEnabled(buildConfig: IBuildConfig): boolean; } // @public -class CleanTask extends GulpTask { - constructor(); - executeTask(gulp: typeof Gulp, completeCallback: (error?: string | Error) => void): void; +declare class CleanTask extends GulpTask { + constructor(); + executeTask(gulp: typeof gulp_2, completeCallback: (error?: string | Error) => void): void; } +// @public (undocumented) +declare const copyStaticAssets: CopyStaticAssetsTask; + // @public -class CopyStaticAssetsTask extends GulpTask { - constructor(); - // (undocumented) - executeTask(gulp: typeof Gulp, completeCallback: (error?: string) => void): NodeJS.ReadWriteStream; - // (undocumented) - loadSchema(): Object; +declare class CopyStaticAssetsTask extends GulpTask { + // (undocumented) + constructor(); + // (undocumented) + executeTask(gulp: typeof gulp_2, completeCallback: (error?: string) => void): NodeJS.ReadWriteStream; + // (undocumented) + loadSchema(): Object; } // @public -class CopyTask extends GulpTask { - constructor(); - executeTask(gulp: typeof Gulp, completeCallback: (error?: string | Error) => void): Promise | NodeJS.ReadWriteStream | void; - loadSchema(): Object; +declare class CopyTask extends GulpTask { + constructor(); + executeTask(gulp: typeof gulp_2, completeCallback: (error?: string | Error) => void): Promise | NodeJS.ReadWriteStream | void; + loadSchema(): Object; } // @public -export function coverageData(coverage: number, threshold: number, filePath: string): void; +declare function coverageData(coverage: number, threshold: number, filePath: string): void; // @public -export function error(...args: Array): void; +declare function error(...args: Array): void; // @public -export function fileError(taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void; +declare function fileError(taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void; // @public -export function fileLog(write: (text: string) => void, taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void; +declare function fileLog(write: (text: string) => void, taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void; // @public -export function fileWarning(taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void; +declare function fileWarning(taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void; // @public -export function functionalTestRun(name: string, result: TestResultState, duration: number): void; +declare function functionalTestRun(name: string, result: TestResultState, duration: number): void; // @public -class GenerateShrinkwrapTask extends GulpTask { - constructor(); - executeTask(gulp: gulpType.Gulp, completeCallback: (error?: string | Error) => void): NodeJS.ReadWriteStream | void; +declare class GenerateShrinkwrapTask extends GulpTask { + constructor(); + executeTask(gulp: gulp.Gulp, completeCallback: (error?: string | Error) => void): NodeJS.ReadWriteStream | void; } // @public -export function getConfig(): IBuildConfig; - -// @public -export function getErrors(): string[]; - -// @public -export function getWarnings(): string[]; - -// @public -class GulpTask implements IExecutable { - constructor(name: string, initialTaskConfig?: Partial); - protected _getConfigFilePath(): string; - buildConfig: IBuildConfig; - cleanMatch: string[]; - copyFile(localSourcePath: string, localDestPath?: string): void; - enabled: boolean; - execute(config: IBuildConfig): Promise; - // WARNING: The type "GulpProxy" needs to be exported by the package (e.g. added to index.ts) - abstract executeTask(gulp: gulp.Gulp | GulpProxy, completeCallback?: (error?: string | Error) => void): Promise | NodeJS.ReadWriteStream | void; - fileError(filePath: string, line: number, column: number, errorCode: string, message: string): void; - fileExists(localPath: string): boolean; - fileWarning(filePath: string, line: number, column: number, warningCode: string, message: string): void; - getCleanMatch(buildConfig: IBuildConfig, taskConfig?: TTaskConfig): string[]; - isEnabled(buildConfig: IBuildConfig): boolean; - protected loadSchema(): Object | undefined; - log(message: string): void; - logError(message: string): void; - logVerbose(message: string): void; - logWarning(message: string): void; - mergeConfig(taskConfig: Partial): void; - name: string; - onRegister(): void; - readJSONSync(localPath: string): Object | undefined; - replaceConfig(taskConfig: TTaskConfig): void; - resolvePath(localPath: string): string; - readonly schema: Object | undefined; - setConfig(taskConfig: Partial): void; - taskConfig: TTaskConfig; +declare function getConfig(): IBuildConfig; + +// @public +declare function getErrors(): string[]; + +// @public +declare function getWarnings(): string[]; + +// @public +declare abstract class GulpTask implements IExecutable { + constructor(name: string, initialTaskConfig?: Partial); + buildConfig: IBuildConfig; + cleanMatch: string[]; + copyFile(localSourcePath: string, localDestPath?: string): void; + enabled: boolean; + execute(config: IBuildConfig): Promise; + abstract executeTask(gulp: gulp.Gulp | GulpProxy, completeCallback?: (error?: string | Error) => void): Promise | NodeJS.ReadWriteStream | void; + fileError(filePath: string, line: number, column: number, errorCode: string, message: string): void; + fileExists(localPath: string): boolean; + fileWarning(filePath: string, line: number, column: number, warningCode: string, message: string): void; + getCleanMatch(buildConfig: IBuildConfig, taskConfig?: TTaskConfig): string[]; + protected _getConfigFilePath(): string; + isEnabled(buildConfig: IBuildConfig): boolean; + protected loadSchema(): Object | undefined; + log(message: string): void; + logError(message: string): void; + logVerbose(message: string): void; + logWarning(message: string): void; + mergeConfig(taskConfig: Partial): void; + name: string; + onRegister(): void; + readJSONSync(localPath: string): Object | undefined; + replaceConfig(taskConfig: TTaskConfig): void; + resolvePath(localPath: string): string; + readonly schema: Object | undefined; + setConfig(taskConfig: Partial): void; + taskConfig: TTaskConfig; } // @public (undocumented) interface IBuildConfig { - args: { - [name: string]: string | boolean; - } - buildErrorIconPath?: string; - buildSuccessIconPath?: string; - distFolder: string; - gulp: GulpProxy | gulp.Gulp; - isRedundantBuild?: boolean; - jestEnabled?: boolean; - libAMDFolder?: string; - libES6Folder?: string; - libESNextFolder?: string; - libFolder: string; - onTaskEnd?: (taskName: string, duration: number[], error?: any) => void; - onTaskStart?: (taskName: string) => void; - packageFolder: string; - production: boolean; - properties?: { - [key: string]: any; - } - relogIssues?: boolean; - rootPath: string; - shouldWarningsFailBuild: boolean; - showToast?: boolean; - srcFolder: string; - tempFolder: string; - uniqueTasks?: IExecutable[]; - verbose: boolean; + args: { + // (undocumented) + [name: string]: string | boolean; + }; + buildErrorIconPath?: string; + buildSuccessIconPath?: string; + distFolder: string; + gulp: GulpProxy | gulp_2.Gulp; + isRedundantBuild?: boolean; + jestEnabled?: boolean; + libAMDFolder?: string; + libES6Folder?: string; + libESNextFolder?: string; + libFolder: string; + onTaskEnd?: (taskName: string, duration: number[], error?: any) => void; + onTaskStart?: (taskName: string) => void; + packageFolder: string; + production: boolean; + properties?: { + // (undocumented) + [key: string]: any; + }; + relogIssues?: boolean; + rootPath: string; + shouldWarningsFailBuild: boolean; + showToast?: boolean; + srcFolder: string; + tempFolder: string; + uniqueTasks?: IExecutable[]; + verbose: boolean; } // @public interface ICopyConfig { - copyTo: { - [destPath: string]: string[]; - } - shouldFlatten?: boolean; + copyTo: { + [destPath: string]: string[]; + }; + shouldFlatten?: boolean; } // @public interface ICopyStaticAssetsTaskConfig { - // (undocumented) - excludeExtensions?: string[]; - // (undocumented) - excludeFiles?: string[]; - // (undocumented) - includeExtensions?: string[]; - // (undocumented) - includeFiles?: string[]; + // (undocumented) + excludeExtensions?: string[]; + // (undocumented) + excludeFiles?: string[]; + // (undocumented) + includeExtensions?: string[]; + // (undocumented) + includeFiles?: string[]; } // @public interface ICustomGulpTask { - // WARNING: The type "GulpProxy" needs to be exported by the package (e.g. added to index.ts) - // (undocumented) - (gulp: typeof Gulp | GulpProxy, buildConfig: IBuildConfig, done?: (failure?: Object) => void): Promise | NodeJS.ReadWriteStream | void; + // (undocumented) + (gulp: typeof gulp_2 | GulpProxy, buildConfig: IBuildConfig, done?: (failure?: Object) => void): Promise | NodeJS.ReadWriteStream | void; } // @public (undocumented) interface IExecutable { - execute: (config: IBuildConfig) => Promise; - getCleanMatch?: (config: IBuildConfig, taskConfig?: any) => string[]; - isEnabled?: (buildConfig: IBuildConfig) => boolean; - name?: string; - onRegister?: () => void; + execute: (config: IBuildConfig) => Promise; + getCleanMatch?: (config: IBuildConfig, taskConfig?: any) => string[]; + isEnabled?: (buildConfig: IBuildConfig) => boolean; + name?: string; + onRegister?: () => void; } // @alpha interface IJestConfig { - cache?: boolean; - collectCoverageFrom?: string[]; - coverage?: boolean; - coverageReporters?: string[]; - isEnabled?: boolean; - maxWorkers?: number; - moduleDirectories?: string[]; - modulePathIgnorePatterns?: string[]; - testMatch?: string[]; - testPathIgnorePatterns?: string[]; + cache?: boolean; + collectCoverageFrom?: string[]; + coverage?: boolean; + coverageReporters?: string[]; + isEnabled?: boolean; + maxWorkers?: number; + moduleDirectories?: string[]; + modulePathIgnorePatterns?: string[]; + testMatch?: string[]; + testPathIgnorePatterns?: string[]; } // @public -export function initialize(gulp: typeof Gulp): void; +declare function initialize(gulp: typeof gulp_2): void; + +// @internal +declare function _isJestEnabled(rootFolder: string): boolean; + +// @public (undocumented) +declare const jest: JestTask; // @alpha -class JestTask extends GulpTask { - constructor(); - // (undocumented) - executeTask(gulp: typeof Gulp, completeCallback: (error?: string | Error) => void): void; - // (undocumented) - isEnabled(buildConfig: IBuildConfig): boolean; - loadSchema(): Object; +declare class JestTask extends GulpTask { + // (undocumented) + constructor(); + // (undocumented) + executeTask(gulp: typeof gulp_2, completeCallback: (error?: string | Error) => void): void; + // (undocumented) + isEnabled(buildConfig: IBuildConfig): boolean; + loadSchema(): Object; } // @public -export function log(...args: Array): void; +declare function log(...args: Array): void; // @public -export function logSummary(value: string): void; +declare function logSummary(value: string): void; // @public -export function mergeConfig(config: Partial): void; +declare function mergeConfig(config: Partial): void; // @public -export function parallel(...tasks: Array): IExecutable; +declare function parallel(...tasks: Array): IExecutable; // @public -export function replaceConfig(config: IBuildConfig): void; +declare function replaceConfig(config: IBuildConfig): void; // @public -export function reset(): void; +declare function reset(): void; // @public -export function serial(...tasks: Array): IExecutable; +declare function serial(...tasks: Array): IExecutable; // @public -export function setConfig(config: Partial): void; +declare function setConfig(config: Partial): void; // @public -export function subTask(taskName: string, fn: ICustomGulpTask): IExecutable; +declare function subTask(taskName: string, fn: ICustomGulpTask): IExecutable; // @public -export function task(taskName: string, taskExecutable: IExecutable): IExecutable; +declare function task(taskName: string, taskExecutable: IExecutable): IExecutable; // @public -enum TestResultState { - // (undocumented) - Failed = 1, - // (undocumented) - FlakyFailed = 2, - // (undocumented) - Passed = 0, - // (undocumented) - Skipped = 3 +declare enum TestResultState { + // (undocumented) + Failed = 1, + // (undocumented) + FlakyFailed = 2, + // (undocumented) + Passed = 0, + // (undocumented) + Skipped = 3 } // @public -class ValidateShrinkwrapTask extends GulpTask { - constructor(); - executeTask(gulp: gulpType.Gulp, completeCallback: (error: string) => void): NodeJS.ReadWriteStream | void; -} +declare class ValidateShrinkwrapTask extends GulpTask { + constructor(); + executeTask(gulp: gulp.Gulp, completeCallback: (error: string) => void): NodeJS.ReadWriteStream | void; + } // @public -export function verbose(...args: Array): void; +declare function verbose(...args: Array): void; // @public -export function warn(...args: Array): void; +declare function warn(...args: Array): void; // @public -export function watch(watchMatch: string | string[], taskExecutable: IExecutable): IExecutable; +declare function watch(watchMatch: string | string[], taskExecutable: IExecutable): IExecutable; + -// WARNING: Unsupported export: cleanFlag -// WARNING: Unsupported export: clean -// WARNING: Unsupported export: copyStaticAssets -// WARNING: Unsupported export: jest -// (No @packagedocumentation comment for this package) +// (No @packageDocumentation comment for this package) diff --git a/common/reviews/api/node-core-library.api.ts b/common/reviews/api/node-core-library.api.ts index 9ab177c2f2f..4583911d1b3 100644 --- a/common/reviews/api/node-core-library.api.ts +++ b/common/reviews/api/node-core-library.api.ts @@ -8,14 +8,20 @@ declare class Colors { // (undocumented) static blackBackground(text: string | IColorableSequence): IColorableSequence; // (undocumented) + static blink(text: string | IColorableSequence): IColorableSequence; + // (undocumented) static blue(text: string | IColorableSequence): IColorableSequence; // (undocumented) static blueBackground(text: string | IColorableSequence): IColorableSequence; // (undocumented) + static bold(text: string | IColorableSequence): IColorableSequence; + // (undocumented) static cyan(text: string | IColorableSequence): IColorableSequence; // (undocumented) static cyanBackground(text: string | IColorableSequence): IColorableSequence; // (undocumented) + static dim(text: string | IColorableSequence): IColorableSequence; + // (undocumented) static gray(text: string | IColorableSequence): IColorableSequence; // (undocumented) static grayBackground(text: string | IColorableSequence): IColorableSequence; @@ -24,16 +30,22 @@ declare class Colors { // (undocumented) static greenBackground(text: string | IColorableSequence): IColorableSequence; // (undocumented) + static hidden(text: string | IColorableSequence): IColorableSequence; + // (undocumented) + static invertColor(text: string | IColorableSequence): IColorableSequence; + // (undocumented) static magenta(text: string | IColorableSequence): IColorableSequence; // (undocumented) static magentaBackground(text: string | IColorableSequence): IColorableSequence; - // @internal (undocumented) + // @internal static _normalizeStringOrColorableSequence(value: string | IColorableSequence): IColorableSequence; // (undocumented) static red(text: string | IColorableSequence): IColorableSequence; // (undocumented) static redBackground(text: string | IColorableSequence): IColorableSequence; // (undocumented) + static underline(text: string | IColorableSequence): IColorableSequence; + // (undocumented) static white(text: string | IColorableSequence): IColorableSequence; // (undocumented) static whiteBackground(text: string | IColorableSequence): IColorableSequence; @@ -43,7 +55,7 @@ declare class Colors { static yellowBackground(text: string | IColorableSequence): IColorableSequence; } -// @beta (undocumented) +// @beta declare class ConsoleTerminalProvider implements ITerminalProvider { // (undocumented) constructor(options?: Partial); @@ -51,7 +63,6 @@ declare class ConsoleTerminalProvider implements ITerminalProvider { readonly eolCharacter: string; // (undocumented) readonly supportsColor: boolean; - // (undocumented) verboseEnabled: boolean; // (undocumented) write(data: string, severity: TerminalProviderSeverity): void; @@ -124,6 +135,8 @@ interface IColorableSequence { isEol?: boolean; // (undocumented) text: string; + // (undocumented) + textAttributes?: TextAttribute[]; } // @beta @@ -231,6 +244,7 @@ interface IJsonSchemaValidateOptions { // @public declare class InternalError extends Error { constructor(message: string); + static breakInDebugger: boolean; // @override (undocumented) toString(): string; readonly unformattedMessage: string; @@ -434,6 +448,22 @@ declare class Sort { static sortSetBy(set: Set, keySelector: (element: T) => any, keyComparer?: (x: T, y: T) => number): void; } +// @beta +declare class StringBufferTerminalProvider implements ITerminalProvider { + // (undocumented) + constructor(supportsColor?: boolean); + // (undocumented) + readonly eolCharacter: string; + getErrorOutput(): string; + getOutput(): string; + getVerbose(): string; + getWarningOutput(): string; + // (undocumented) + readonly supportsColor: boolean; + // (undocumented) + write(data: string, severity: TerminalProviderSeverity): void; +} + // @public declare class StringBuilder implements IStringBuilder { // (undocumented) diff --git a/common/reviews/api/web-library-build.api.ts b/common/reviews/api/web-library-build.api.ts index 224cd953eaa..8621ee12212 100644 --- a/common/reviews/api/web-library-build.api.ts +++ b/common/reviews/api/web-library-build.api.ts @@ -1,335 +1,35 @@ -// @internal -export function _isJestEnabled(rootFolder: string): boolean; - -// @public -export function addSuppression(suppression: string | RegExp): void; - -// @public -class CleanFlagTask extends CleanTask { - constructor(); - // (undocumented) - executeTask(gulp: typeof Gulp, completeCallback: (error?: string | Error) => void): void; - // (undocumented) - isEnabled(buildConfig: IBuildConfig): boolean; -} - -// @public -class CleanTask extends GulpTask { - constructor(); - executeTask(gulp: typeof Gulp, completeCallback: (error?: string | Error) => void): void; -} - -// @public -class CopyStaticAssetsTask extends GulpTask { - constructor(); - // (undocumented) - executeTask(gulp: typeof Gulp, completeCallback: (error?: string) => void): NodeJS.ReadWriteStream; - // (undocumented) - loadSchema(): Object; -} - -// @public -class CopyTask extends GulpTask { - constructor(); - executeTask(gulp: typeof Gulp, completeCallback: (error?: string | Error) => void): Promise | NodeJS.ReadWriteStream | void; - loadSchema(): Object; -} - -// @public -export function coverageData(coverage: number, threshold: number, filePath: string): void; - -// @public -export function error(...args: Array): void; - -// @public -export function fileError(taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void; - -// @public -export function fileLog(write: (text: string) => void, taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void; - -// @public -export function fileWarning(taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void; - -// @public -export function functionalTestRun(name: string, result: TestResultState, duration: number): void; - -// @public -class GenerateShrinkwrapTask extends GulpTask { - constructor(); - executeTask(gulp: gulpType.Gulp, completeCallback: (error?: string | Error) => void): NodeJS.ReadWriteStream | void; -} - -// @public -export function getConfig(): IBuildConfig; - -// @public -export function getErrors(): string[]; - -// @public -export function getWarnings(): string[]; - -// @public -class GulpTask implements IExecutable { - constructor(name: string, initialTaskConfig?: Partial); - protected _getConfigFilePath(): string; - buildConfig: IBuildConfig; - cleanMatch: string[]; - copyFile(localSourcePath: string, localDestPath?: string): void; - enabled: boolean; - execute(config: IBuildConfig): Promise; - abstract executeTask(gulp: gulp.Gulp | GulpProxy, completeCallback?: (error?: string | Error) => void): Promise | NodeJS.ReadWriteStream | void; - fileError(filePath: string, line: number, column: number, errorCode: string, message: string): void; - fileExists(localPath: string): boolean; - fileWarning(filePath: string, line: number, column: number, warningCode: string, message: string): void; - getCleanMatch(buildConfig: IBuildConfig, taskConfig?: TTaskConfig): string[]; - isEnabled(buildConfig: IBuildConfig): boolean; - protected loadSchema(): Object | undefined; - log(message: string): void; - logError(message: string): void; - logVerbose(message: string): void; - logWarning(message: string): void; - mergeConfig(taskConfig: Partial): void; - name: string; - onRegister(): void; - readJSONSync(localPath: string): Object | undefined; - replaceConfig(taskConfig: TTaskConfig): void; - resolvePath(localPath: string): string; - readonly schema: Object | undefined; - setConfig(taskConfig: Partial): void; - taskConfig: TTaskConfig; -} - // @public (undocumented) -interface IBuildConfig { - args: { - [name: string]: string | boolean; - } - buildErrorIconPath?: string; - buildSuccessIconPath?: string; - distFolder: string; - gulp: GulpProxy | gulp.Gulp; - isRedundantBuild?: boolean; - jestEnabled?: boolean; - libAMDFolder?: string; - libES6Folder?: string; - libESNextFolder?: string; - libFolder: string; - onTaskEnd?: (taskName: string, duration: number[], error?: any) => void; - onTaskStart?: (taskName: string) => void; - packageFolder: string; - production: boolean; - properties?: { - [key: string]: any; - } - relogIssues?: boolean; - rootPath: string; - shouldWarningsFailBuild: boolean; - showToast?: boolean; - srcFolder: string; - tempFolder: string; - uniqueTasks?: IExecutable[]; - verbose: boolean; -} - -// @public -interface ICopyConfig { - copyTo: { - [destPath: string]: string[]; - } - shouldFlatten?: boolean; -} - -// @public -interface ICopyStaticAssetsTaskConfig { - // (undocumented) - excludeExtensions?: string[]; - // (undocumented) - excludeFiles?: string[]; - // (undocumented) - includeExtensions?: string[]; - // (undocumented) - includeFiles?: string[]; -} - -// @public -interface ICustomGulpTask { - // (undocumented) - (gulp: typeof Gulp | GulpProxy, buildConfig: IBuildConfig, done?: (failure?: Object) => void): Promise | NodeJS.ReadWriteStream | void; -} +declare const buildTasks: IExecutable; // @public (undocumented) -interface IExecutable { - execute: (config: IBuildConfig) => Promise; - getCleanMatch?: (config: IBuildConfig, taskConfig?: any) => string[]; - isEnabled?: (buildConfig: IBuildConfig) => boolean; - name?: string; - onRegister?: () => void; -} - -// @alpha -interface IJestConfig { - cache?: boolean; - collectCoverageFrom?: string[]; - coverage?: boolean; - coverageReporters?: string[]; - isEnabled?: boolean; - maxWorkers?: number; - moduleDirectories?: string[]; - modulePathIgnorePatterns?: string[]; - testMatch?: string[]; - testPathIgnorePatterns?: string[]; -} - -// @public -export function initialize(gulp: typeof Gulp): void; +declare const bundleTasks: IExecutable; // @public (undocumented) -interface ITscCmdTaskConfig extends IRSCTaskConfig { - customArgs?: string[]; - removeCommentsFromJavaScript?: boolean; - staticMatch?: string[]; -} +declare const defaultTasks: IExecutable; // @public (undocumented) -interface ITslintCmdTaskConfig extends IRSCTaskConfig { - displayAsError?: boolean; -} +declare const generateShrinkwrapTask: GenerateShrinkwrapTask; // @public (undocumented) -interface IWebpackResources { - // (undocumented) - webpack: typeof Webpack; -} +declare const postCopy: CopyTask; // @public (undocumented) -interface IWebpackTaskConfig { - config?: Webpack.Configuration; - configPath: string; - printStats?: boolean; - suppressWarnings?: (string | RegExp)[]; - webpack?: typeof Webpack; -} - -// @alpha -class JestTask extends GulpTask { - constructor(); - // (undocumented) - executeTask(gulp: typeof Gulp, completeCallback: (error?: string | Error) => void): void; - // (undocumented) - isEnabled(buildConfig: IBuildConfig): boolean; - loadSchema(): Object; -} - -// @public -export function log(...args: Array): void; - -// @public -export function logSummary(value: string): void; - -// @public -export function mergeConfig(config: Partial): void; - -// @public -export function parallel(...tasks: Array): IExecutable; - -// @public -export function replaceConfig(config: IBuildConfig): void; - -// @public -export function reset(): void; - -// @public -export function serial(...tasks: Array): IExecutable; +declare const postProcessSourceMapsTask: PostProcessSourceMaps; -// @public -export function setConfig(config: Partial): void; - -// @public -export function subTask(taskName: string, fn: ICustomGulpTask): IExecutable; - -// @public -export function task(taskName: string, taskExecutable: IExecutable): IExecutable; - -// @public -enum TestResultState { - // (undocumented) - Failed = 1, - // (undocumented) - FlakyFailed = 2, - // (undocumented) - Passed = 0, - // (undocumented) - Skipped = 3 -} - -// @beta (undocumented) -class TscCmdTask extends RSCTask { - constructor(); - // (undocumented) - protected _onData(data: Buffer): void; - // (undocumented) - executeTask(): Promise; - // (undocumented) - loadSchema(): Object; -} - -// @beta (undocumented) -class TslintCmdTask extends RSCTask { - constructor(); - // (undocumented) - executeTask(): Promise; - // (undocumented) - loadSchema(): Object; -} - -// @public -class ValidateShrinkwrapTask extends GulpTask { - constructor(); - executeTask(gulp: gulpType.Gulp, completeCallback: (error: string) => void): NodeJS.ReadWriteStream | void; -} +// @public (undocumented) +declare const preCopy: CopyTask; -// @public -export function verbose(...args: Array): void; +// @public (undocumented) +declare const testTasks: IExecutable; -// @public -export function warn(...args: Array): void; +// @public (undocumented) +declare const validateShrinkwrapTask: ValidateShrinkwrapTask; -// @public -export function watch(watchMatch: string | string[], taskExecutable: IExecutable): IExecutable; -// @public (undocumented) -class WebpackTask extends GulpTask { - constructor(extendedName?: string, extendedConfig?: TExtendedConfig); - // (undocumented) - executeTask(gulp: typeof Gulp, completeCallback: (error?: string) => void): void; - // (undocumented) - isEnabled(buildConfig: IBuildConfig): boolean; - // (undocumented) - loadSchema(): Object; - // (undocumented) - readonly resources: IWebpackResources; -} +export * from "@microsoft/gulp-core-build"; +export * from "@microsoft/gulp-core-build-sass"; +export * from "@microsoft/gulp-core-build-serve"; +export * from "@microsoft/gulp-core-build-typescript"; +export * from "@microsoft/gulp-core-build-webpack"; -// WARNING: Unsupported export: preCopy -// WARNING: Unsupported export: postCopy -// WARNING: Unsupported export: buildTasks -// WARNING: Unsupported export: bundleTasks -// WARNING: Unsupported export: testTasks -// WARNING: Unsupported export: defaultTasks -// WARNING: Unsupported export: postProcessSourceMapsTask -// WARNING: Unsupported export: validateShrinkwrapTask -// WARNING: Unsupported export: generateShrinkwrapTask -// WARNING: Unsupported export: cleanFlag -// WARNING: Unsupported export: clean -// WARNING: Unsupported export: copyStaticAssets -// WARNING: Unsupported export: jest -// WARNING: Unsupported export: tscCmd -// WARNING: Unsupported export: tslintCmd -// WARNING: Unsupported export: apiExtractor -// WARNING: Unsupported export: sass -// WARNING: Unsupported export: webpack -// WARNING: Unsupported export: serve -// WARNING: Unsupported export: reload -// WARNING: Unsupported export: trustDevCert -// WARNING: Unsupported export: untrustDevCert -// (No @packagedocumentation comment for this package) +// (No @packageDocumentation comment for this package) diff --git a/core-build/gulp-core-build-sass/src/index.ts b/core-build/gulp-core-build-sass/src/index.ts index 34a75366004..3ffd5aab239 100644 --- a/core-build/gulp-core-build-sass/src/index.ts +++ b/core-build/gulp-core-build-sass/src/index.ts @@ -3,6 +3,9 @@ import { SassTask } from './SassTask'; +/** + * @public + */ export const sass: SassTask = new SassTask(); /* tslint:disable:export-name */ diff --git a/core-build/gulp-core-build-serve/src/index.ts b/core-build/gulp-core-build-serve/src/index.ts index 1e87da5ebb3..c356a4d0ae9 100644 --- a/core-build/gulp-core-build-serve/src/index.ts +++ b/core-build/gulp-core-build-serve/src/index.ts @@ -6,9 +6,24 @@ import { ReloadTask } from './ReloadTask'; import { TrustCertTask } from './TrustCertTask'; import { UntrustCertTask } from './UntrustCertTask'; +/** + * @public + */ export const serve: ServeTask = new ServeTask(); + +/** + * @public + */ export const reload: ReloadTask = new ReloadTask(); + +/** + * @public + */ export const trustDevCert: TrustCertTask = new TrustCertTask(); + +/** + * @public + */ export const untrustDevCert: UntrustCertTask = new UntrustCertTask(); export default serve; // tslint:disable-line:export-name diff --git a/core-build/gulp-core-build-typescript/package.json b/core-build/gulp-core-build-typescript/package.json index b17775fba6b..c8e8eb3267b 100644 --- a/core-build/gulp-core-build-typescript/package.json +++ b/core-build/gulp-core-build-typescript/package.json @@ -16,7 +16,7 @@ "build": "gulp --clean" }, "dependencies": { - "@microsoft/rush-stack-compiler-2.7": "0.5.2", + "@microsoft/rush-stack-compiler-3.1": "0.5.2", "@microsoft/gulp-core-build": "3.9.6", "@microsoft/node-core-library": "3.10.0", "@types/node": "8.5.8", diff --git a/core-build/gulp-core-build/config/api-extractor.json b/core-build/gulp-core-build/config/api-extractor.json index 5b65c425f79..328579d2b54 100644 --- a/core-build/gulp-core-build/config/api-extractor.json +++ b/core-build/gulp-core-build/config/api-extractor.json @@ -1,6 +1,18 @@ { - "enabled": true, - "apiReviewFolder": "../../common/reviews/api", - "apiJsonFolder": "./temp", - "entry": "lib/index.d.ts" + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/api-extractor.schema.json", + "project": { + "entryPointSourceFile": "lib/index.d.ts" + }, + "compiler": { + "rootFolder": ".", + "configType": "tsconfig" + }, + "apiReviewFile": { + "enabled": true, + "apiReviewFolder": "../../common/reviews/api" + }, + "apiJsonFile": { + "enabled": true, + "outputFolder": "./temp" + } } diff --git a/core-build/web-library-build/src/index.ts b/core-build/web-library-build/src/index.ts index a4c787f0ae8..e03db094964 100644 --- a/core-build/web-library-build/src/index.ts +++ b/core-build/web-library-build/src/index.ts @@ -26,10 +26,16 @@ export * from '@microsoft/gulp-core-build-sass'; export * from '@microsoft/gulp-core-build-webpack'; export * from '@microsoft/gulp-core-build-serve'; -// pre copy and post copy allows you to specify a map of dest: [sources] to copy from one place to another. +// Pre copy and post copy allows you to specify a map of dest: [sources] to copy from one place to another. +/** + * @public + */ export const preCopy: CopyTask = new CopyTask(); preCopy.name = 'pre-copy'; +/** + * @public + */ export const postCopy: CopyTask = new CopyTask(); postCopy.name = 'post-copy'; @@ -46,15 +52,42 @@ setConfig({ }); // Define default task groups. +/** + * @public + */ export const buildTasks: IExecutable = task( 'build', serial(preCopy, sass, parallel(tslintCmd, tscCmd), apiExtractor, postCopy) ); + +/** + * @public + */ export const bundleTasks: IExecutable = task('bundle', serial(buildTasks, webpack)); + +/** + * @public + */ export const testTasks: IExecutable = task('test', serial(buildTasks, jest)); + +/** + * @public + */ export const defaultTasks: IExecutable = serial(bundleTasks, jest); + +/** + * @public + */ export const postProcessSourceMapsTask: PostProcessSourceMaps = new PostProcessSourceMaps(); + +/** + * @public + */ export const validateShrinkwrapTask: ValidateShrinkwrapTask = new ValidateShrinkwrapTask(); + +/** + * @public + */ export const generateShrinkwrapTask: GenerateShrinkwrapTask = new GenerateShrinkwrapTask(); task('validate-shrinkwrap', validateShrinkwrapTask);