Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions goldens/public-api/angular/build/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export function executeExtractI18nBuilder(options: ExtractI18nBuilderOptions, co
// @public
export function executeKarmaBuilder(options: KarmaBuilderOptions, context: BuilderContext, transforms?: KarmaBuilderTransformsOptions): AsyncIterable<BuilderOutput>;

// @public
// @public @deprecated
export function executeNgPackagrBuilder(options: NgPackagrBuilderOptions, context: BuilderContext): AsyncIterableIterator<BuilderOutput>;

// @public
Expand Down Expand Up @@ -208,7 +208,7 @@ export type KarmaBuilderOptions = {
webWorkerTsConfig?: string;
};

// @public
// @public @deprecated
export type NgPackagrBuilderOptions = {
poll?: number;
project?: string;
Expand Down
4 changes: 2 additions & 2 deletions goldens/public-api/angular_devkit/build_angular/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export function executeKarmaBuilder(options: KarmaBuilderOptions, context: Build
karmaOptions?: (options: KarmaConfigOptions) => KarmaConfigOptions;
}): Observable<BuilderOutput>;

// @public
// @public @deprecated
export function executeNgPackagrBuilder(options: NgPackagrBuilderOptions, context: BuilderContext): Observable<BuilderOutput>;

// @public
Expand Down Expand Up @@ -236,7 +236,7 @@ export type KarmaConfigOptions = ConfigOptions & {
configFile?: string;
};

// @public
// @public @deprecated
export type NgPackagrBuilderOptions = {
poll?: number;
project: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/build/builders.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"ng-packagr": {
"implementation": "./src/builders/ng-packagr/index",
"schema": "./src/builders/ng-packagr/schema.json",
"description": "Build a library with ng-packagr."
"description": "Build a library with ng-packagr. (Deprecated: Use '@angular/build:library' instead.)"
},
"unit-test": {
"implementation": "./src/builders/unit-test",
Expand Down
6 changes: 6 additions & 0 deletions packages/angular/build/src/builders/ng-packagr/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ import type { Schema as NgPackagrBuilderOptions } from './schema';
* @returns A BuilderOutput object.
*
* @experimental Direct usage of this function is considered experimental.
* @deprecated Use the `@angular/build:library` builder instead. Deprecated since v22.3.
Comment thread
alan-agius4 marked this conversation as resolved.
Resolved
*/
export async function* execute(
options: NgPackagrBuilderOptions,
context: BuilderContext,
): AsyncIterableIterator<BuilderOutput> {
context.logger.warn(
'The "@angular/build:ng-packagr" builder is deprecated. ' +
'Use "@angular/build:library" instead.',
);

// Purge old build disk cache.
await purgeStaleBuildCache(context);

Expand Down
1 change: 1 addition & 0 deletions packages/angular/build/src/builders/ng-packagr/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema",
"title": "ng-packagr Target",
"description": "ng-packagr target options for Build Architect. Use to build library projects.",
"deprecated": true,
"type": "object",
"properties": {
"project": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ import { Schema as NgPackagrBuilderOptions } from './schema';

/**
* @experimental Direct usage of this function is considered experimental.
* @deprecated Use the `@angular/build:library` builder instead.
*/
export function execute(
options: NgPackagrBuilderOptions,
context: BuilderContext,
): Observable<BuilderOutput> {
context.logger.warn(
'The "@angular-devkit/build-angular:ng-packagr" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build:ng-packagr" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
'Use "@angular/build:library" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
);

return from(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema",
"title": "ng-packagr Target",
"description": "ng-packagr target options for Build Architect. Use to build library projects.",
"deprecated": true,
"type": "object",
"properties": {
"project": {
Expand Down
6 changes: 6 additions & 0 deletions packages/schematics/angular/utility/workspace-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ export enum Builders {
BuildKarma = '@angular/build:karma',
BuildUnitTest = '@angular/build:unit-test',
TsLint = '@angular-devkit/build-angular:tslint',

/** @deprecated Use `BuildLibrary` instead. */
NgPackagr = '@angular-devkit/build-angular:ng-packagr',

/** @deprecated Use `BuildLibrary` instead. */
BuildNgPackagr = '@angular/build:ng-packagr',
DevServer = '@angular-devkit/build-angular:dev-server',
BuildDevServer = '@angular/build:dev-server',
Expand Down Expand Up @@ -82,6 +86,7 @@ export interface ServeBuilderOptions {
buildTarget: string;
}

/** @deprecated */
export interface LibraryBuilderOptions {
tsConfig: string;
project: string;
Expand Down Expand Up @@ -135,6 +140,7 @@ export interface BuilderTarget<TBuilder extends Builders, TOptions> {
};
}

/** @deprecated */
export type LibraryBuilderTarget = BuilderTarget<Builders.NgPackagr, LibraryBuilderOptions>;
export type BrowserBuilderTarget = BuilderTarget<Builders.Browser, BrowserBuilderOptions>;
export type ServerBuilderTarget = BuilderTarget<Builders.Server, ServerBuilderOptions>;
Expand Down
8 changes: 8 additions & 0 deletions tools/quicktype_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ async function generate(inPath) {
*/
function appendDeprecatedDescription(schema) {
const content = JSON.parse(schema);
const rootDeprecated = content['x-deprecated'] ?? content['deprecated'];
if (rootDeprecated) {
content.description =
(content.description ? content.description + '\n' : '') +
'@deprecated' +
(typeof rootDeprecated === 'string' ? ` ${rootDeprecated}` : '');
}

const props = content.properties;

for (const key in props) {
Expand Down
Loading