Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): mark programmatic builder executi…
Browse files Browse the repository at this point in the history
…on functions as experimental

While the builders when executed via the Angular CLI and their associated options are considered stable, the programmatic APIs are not considered officially supported and are not subject to the breaking change guarantees of SemVer.
The programmatic APIs for the builders are now explicitly marked as experimental. This allows the package to use a stable versioning scheme while also continuing to provide access to the experimental programmatic API elements of the package.
  • Loading branch information
clydin committed Apr 14, 2021
1 parent 07bf174 commit 27e63e2
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/angular_devkit/build_angular/src/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ import { Schema as BrowserBuilderSchema } from './schema';

const cacheDownlevelPath = cachingDisabled ? undefined : findCachePath('angular-build-dl');

/**
* @experimental Direct usage of this type is considered experimental.
*/
export type BrowserBuilderOutput = json.JsonObject &
BuilderOutput & {
baseOutputPath: string;
Expand Down Expand Up @@ -186,6 +189,9 @@ async function initialize(
return { config: transformedConfig || config, projectRoot, projectSourceRoot, i18n };
}

/**
* @experimental Direct usage of this function is considered experimental.
*/
// tslint:disable-next-line: no-big-function
export function buildWebpackBrowser(
options: BrowserBuilderSchema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,21 @@ const devServerBuildOverriddenKeys: (keyof DevServerBuilderOptions)[] = [
'deployUrl',
];

/**
* @experimental Direct usage of this type is considered experimental.
*/
export type DevServerBuilderOutput = DevServerBuildOutput & {
baseUrl: string;
};

/**
* Reusable implementation of the build angular webpack dev server builder.
* Reusable implementation of the Angular Webpack development server builder.
* @param options Dev Server options.
* @param context The build context.
* @param transforms A map of transforms that can be used to hook into some logic (such as
* transforming webpack configuration before passing it to webpack).
*
* @experimental Direct usage of this function is considered experimental.
*/
// tslint:disable-next-line: no-big-function
export function serveWebpackBrowser(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class NoEmitPlugin {
}
}

/**
* @experimental Direct usage of this function is considered experimental.
*/
export async function execute(
options: ExtractI18nBuilderOptions,
context: BuilderContext,
Expand Down
3 changes: 3 additions & 0 deletions packages/angular_devkit/build_angular/src/karma/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ async function initialize(
];
}

/**
* @experimental Direct usage of this function is considered experimental.
*/
export function execute(
options: KarmaBuilderOptions,
context: BuilderContext,
Expand Down
3 changes: 3 additions & 0 deletions packages/angular_devkit/build_angular/src/ng-packagr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ async function initialize(
return packager;
}

/**
* @experimental Direct usage of this function is considered experimental.
*/
export function execute(
options: NgPackagrBuilderOptions,
context: BuilderContext,
Expand Down
3 changes: 3 additions & 0 deletions packages/angular_devkit/build_angular/src/protractor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ async function updateWebdriver() {

export { ProtractorBuilderOptions };

/**
* @experimental Direct usage of this function is considered experimental.
*/
export async function execute(
options: ProtractorBuilderOptions,
context: BuilderContext,
Expand Down
7 changes: 6 additions & 1 deletion packages/angular_devkit/build_angular/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ import {
import { JsonCompilationStats, webpackStatsLogger } from '../webpack/utils/stats';
import { Schema as ServerBuilderOptions } from './schema';

// If success is true, outputPath should be set.
/**
* @experimental Direct usage of this type is considered experimental.
*/
export type ServerBuilderOutput = json.JsonObject & BuilderOutput & {
baseOutputPath: string;
outputPaths: string[];
Expand All @@ -43,6 +45,9 @@ export type ServerBuilderOutput = json.JsonObject & BuilderOutput & {

export { ServerBuilderOptions };

/**
* @experimental Direct usage of this function is considered experimental.
*/
export function execute(
options: ServerBuilderOptions,
context: BuilderContext,
Expand Down

0 comments on commit 27e63e2

Please sign in to comment.