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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
# This file should be checked into version control along with the pnpm-lock.yaml file.
.npmrc=-2023857461
package.json=2030416769
pnpm-lock.yaml=757562281
pnpm-workspace.yaml=1711114604
yarn.lock=-1189684420
package.json=1373382412
packages/angular_devkit/architect/package.json=-107274537
packages/angular_devkit/core/package.json=339935828
pnpm-lock.yaml=1069382541
pnpm-workspace.yaml=-1853274682
yarn.lock=-1457550495
10 changes: 4 additions & 6 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ exports_files([
"package.json",
])

npm_link_all_packages(
name = "root_modules",
)
npm_link_all_packages()

rules_js_tsconfig(
name = "build-tsconfig",
src = "tsconfig-build.json",
deps = [
"tsconfig.json",
"//:root_modules/@types/node",
"//:node_modules/@types/node",
],
)

Expand All @@ -48,8 +46,8 @@ rules_js_tsconfig(
src = "tsconfig-test.json",
deps = [
"tsconfig.json",
"//:root_modules/@types/jasmine",
"//:root_modules/@types/node",
"//:node_modules/@types/jasmine",
"//:node_modules/@types/node",
],
)

Expand Down
14 changes: 14 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ npm_translate_lock(
data = [
"//:package.json",
"//:pnpm-workspace.yaml",
"//packages/angular_devkit/architect:package.json",
"//packages/angular_devkit/core:package.json",
],
npmrc = "//:.npmrc",
patches = {
Expand Down Expand Up @@ -225,3 +227,15 @@ http_file(
sha256 = "5a5c46846ecda83e05b9da26f1672ad51c59bce08fed88419850d0e29c993b30",
urls = ["https://raw.githubusercontent.com/devversion/rules_angular/4b7532ba2b29078d005899cd15b415593d03cceb/dist/worker.mjs"],
)

http_archive(
name = "aspect_rules_jasmine",
sha256 = "0d2f9c977842685895020cac721d8cc4f1b37aae15af46128cf619741dc61529",
strip_prefix = "rules_jasmine-2.0.0",
url = "https://github.com/aspect-build/rules_jasmine/releases/download/v2.0.0/rules_jasmine-v2.0.0.tar.gz",
)

load("@aspect_rules_jasmine//jasmine:dependencies.bzl", "rules_jasmine_dependencies")

# Fetch dependencies which users need as well
rules_jasmine_dependencies()
12 changes: 12 additions & 0 deletions goldens/public-api/angular_devkit/architect/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ export class Architect {
scheduleTarget(target: Target, overrides?: json.JsonObject, scheduleOptions?: ScheduleOptions): Promise<BuilderRun>;
}

// @public
export interface Builder<OptionT extends json.JsonObject = json.JsonObject> {
// (undocumented)
[BuilderSymbol]: true;
// (undocumented)
[BuilderVersionSymbol]: string;
// (undocumented)
__OptionT: OptionT;
// (undocumented)
handler: JobHandler<json.JsonObject, BuilderInput, BuilderOutput>;
}

// @public
export interface BuilderContext {
addTeardown(teardown: () => Promise<void> | void): void;
Expand Down
2 changes: 1 addition & 1 deletion modules/testing/builder/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ts_project(
),
data = glob(["projects/**/*"]),
deps = [
"//:root_modules/rxjs",
"//:node_modules/rxjs",
"//packages/angular_devkit/architect:architect_rjs",
"//packages/angular_devkit/architect/node:node_rjs",
"//packages/angular_devkit/architect/testing:testing_rjs",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"@types/http-proxy": "^1.17.4",
"@types/ini": "^4.0.0",
"@types/jasmine": "~5.1.0",
"@types/jasmine-reporters": "^2",
"@types/karma": "^6.3.0",
"@types/less": "^3.0.3",
"@types/loader-utils": "^2.0.0",
Expand Down Expand Up @@ -141,6 +142,7 @@
"istanbul-lib-instrument": "6.0.3",
"jasmine": "^5.0.0",
"jasmine-core": "~5.5.0",
"jasmine-reporters": "^2.5.2",
"jasmine-spec-reporter": "~7.0.0",
"jsonc-parser": "3.3.1",
"karma": "~6.4.0",
Expand Down
153 changes: 77 additions & 76 deletions packages/angular/build/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -61,52 +61,53 @@ ts_project(
data = RUNTIME_ASSETS,
module_name = "@angular/build",
deps = [
"//:root_modules/@ampproject/remapping",
"//:root_modules/@angular/common",
"//:root_modules/@angular/compiler",
"//:root_modules/@angular/compiler-cli",
"//:root_modules/@angular/core",
"//:root_modules/@angular/localize",
"//:root_modules/@angular/platform-server",
"//:root_modules/@angular/service-worker",
"//:root_modules/@babel/core",
"//:root_modules/@babel/helper-annotate-as-pure",
"//:root_modules/@babel/helper-split-export-declaration",
"//:root_modules/@babel/plugin-syntax-import-attributes",
"//:root_modules/@inquirer/confirm",
"//:root_modules/@types/babel__core",
"//:root_modules/@types/less",
"//:root_modules/@types/node",
"//:root_modules/@types/picomatch",
"//:root_modules/@types/semver",
"//:root_modules/@types/watchpack",
"//:root_modules/@vitejs/plugin-basic-ssl",
"//:root_modules/beasties",
"//:root_modules/browserslist",
"//:root_modules/esbuild",
"//:root_modules/esbuild-wasm",
"//:root_modules/fast-glob",
"//:root_modules/https-proxy-agent",
"//:root_modules/jsonc-parser",
"//:root_modules/listr2",
"//:root_modules/lmdb",
"//:root_modules/magic-string",
"//:root_modules/mrmime",
"//:root_modules/ng-packagr",
"//:root_modules/parse5-html-rewriting-stream",
"//:root_modules/picomatch",
"//:root_modules/piscina",
"//:root_modules/postcss",
"//:root_modules/rollup",
"//:root_modules/sass",
"//:root_modules/semver",
"//:root_modules/tslib",
"//:root_modules/typescript",
"//:root_modules/vite",
"//:root_modules/watchpack",
"//:node_modules/@ampproject/remapping",
"//:node_modules/@angular/common",
"//:node_modules/@angular/compiler",
"//:node_modules/@angular/compiler-cli",
"//:node_modules/@angular/core",
"//:node_modules/@angular/localize",
"//:node_modules/@angular/platform-server",
"//:node_modules/@angular/service-worker",
"//:node_modules/@babel/core",
"//:node_modules/@babel/helper-annotate-as-pure",
"//:node_modules/@babel/helper-split-export-declaration",
"//:node_modules/@babel/plugin-syntax-import-attributes",
"//:node_modules/@inquirer/confirm",
"//:node_modules/@types/babel__core",
"//:node_modules/@types/less",
"//:node_modules/@types/node",
"//:node_modules/@types/picomatch",
"//:node_modules/@types/semver",
"//:node_modules/@types/watchpack",
"//:node_modules/@vitejs/plugin-basic-ssl",
"//:node_modules/beasties",
"//:node_modules/browserslist",
"//:node_modules/esbuild",
"//:node_modules/esbuild-wasm",
"//:node_modules/fast-glob",
"//:node_modules/https-proxy-agent",
"//:node_modules/jsonc-parser",
"//:node_modules/listr2",
"//:node_modules/lmdb",
"//:node_modules/magic-string",
"//:node_modules/mrmime",
"//:node_modules/ng-packagr",
"//:node_modules/parse5-html-rewriting-stream",
"//:node_modules/picomatch",
"//:node_modules/piscina",
"//:node_modules/postcss",
"//:node_modules/rollup",
"//:node_modules/sass",
"//:node_modules/semver",
"//:node_modules/tslib",
"//:node_modules/typescript",
"//:node_modules/vite",
"//:node_modules/watchpack",
"//packages/angular/ssr:ssr_rjs",
"//packages/angular/ssr/node:node_rjs",
"//packages/angular_devkit/architect:architect_rjs",
"//packages/angular_devkit/core:core_rjs",
],
)

Expand All @@ -119,11 +120,11 @@ ts_project(
),
deps = [
":build_rjs",
"//:root_modules/@angular/compiler-cli",
"//:root_modules/@babel/core",
"//:root_modules/@types/jasmine",
"//:root_modules/prettier",
"//:root_modules/typescript",
"//:node_modules/@angular/compiler-cli",
"//:node_modules/@babel/core",
"//:node_modules/@types/jasmine",
"//:node_modules/prettier",
"//:node_modules/typescript",
"//packages/angular/build/private:private_rjs",
"//packages/angular_devkit/core:core_rjs",
"//packages/angular_devkit/core/node:node_rjs",
Expand All @@ -150,18 +151,18 @@ ts_project(
"//packages/angular_devkit/core/node:node_rjs",

# Base dependencies for the application in hello-world-app.
"//:root_modules/@angular/common",
"//:root_modules/@angular/compiler",
"//:root_modules/@angular/compiler-cli",
"//:root_modules/@angular/core",
"//:root_modules/@angular/platform-browser",
"//:root_modules/@angular/platform-browser-dynamic",
"//:root_modules/@angular/router",
"//:root_modules/rxjs",
"//:root_modules/tslib",
"//:root_modules/typescript",
"//:root_modules/zone.js",
"//:root_modules/buffer",
"//:node_modules/@angular/common",
"//:node_modules/@angular/compiler",
"//:node_modules/@angular/compiler-cli",
"//:node_modules/@angular/core",
"//:node_modules/@angular/platform-browser",
"//:node_modules/@angular/platform-browser-dynamic",
"//:node_modules/@angular/router",
"//:node_modules/rxjs",
"//:node_modules/tslib",
"//:node_modules/typescript",
"//:node_modules/zone.js",
"//:node_modules/buffer",
],
)

Expand All @@ -180,24 +181,24 @@ ts_project(
"//packages/angular_devkit/core/node:node_rjs",

# dev server only test deps
"//:root_modules/@types/http-proxy",
"//:root_modules/http-proxy",
"//:root_modules/puppeteer",
"//:node_modules/@types/http-proxy",
"//:node_modules/http-proxy",
"//:node_modules/puppeteer",

# Base dependencies for the application in hello-world-app.
"//:root_modules/@angular/common",
"//:root_modules/@angular/compiler",
"//:root_modules/@angular/compiler-cli",
"//:root_modules/@angular/core",
"//:root_modules/@angular/platform-browser",
"//:root_modules/@angular/platform-browser-dynamic",
"//:root_modules/@angular/router",
"//:root_modules/ng-packagr",
"//:root_modules/rxjs",
"//:root_modules/tslib",
"//:root_modules/typescript",
"//:root_modules/zone.js",
"//:root_modules/buffer",
"//:node_modules/@angular/common",
"//:node_modules/@angular/compiler",
"//:node_modules/@angular/compiler-cli",
"//:node_modules/@angular/core",
"//:node_modules/@angular/platform-browser",
"//:node_modules/@angular/platform-browser-dynamic",
"//:node_modules/@angular/router",
"//:node_modules/ng-packagr",
"//:node_modules/rxjs",
"//:node_modules/tslib",
"//:node_modules/typescript",
"//:node_modules/zone.js",
"//:node_modules/buffer",
],
)

Expand Down
8 changes: 6 additions & 2 deletions packages/angular/build/src/builders/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.dev/license
*/

import { BuilderContext, BuilderOutput, createBuilder } from '@angular-devkit/architect';
import { Builder, BuilderContext, BuilderOutput, createBuilder } from '@angular-devkit/architect';
import { json } from '@angular-devkit/core';
import assert from 'node:assert';
import fs from 'node:fs/promises';
import path from 'node:path';
Expand Down Expand Up @@ -259,4 +260,7 @@ function generateFullPath(
return fullFilePath;
}

export default createBuilder(buildApplication);
const builder: Builder<ApplicationBuilderOptions & json.JsonObject> =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const builder: Builder<ApplicationBuilderOptions & json.JsonObject> =
const builder: Builder<ApplicationBuilderOptions & import('@angular-devkit/core').json.JsonObject> =

I'd like to minimize the core package usage as much as possible here. I think this is as far as possible right now. Assuming it works with the other changes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devversion maybe we should switch to Type instead of Interface which would avoid the & json.JsonObject.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be used throughout the repository, within the same builders. Are we good keeping as is and just leaving this to a general cleanup? (seems more work, even with Alan's idea; which seems to work; I'm not sure of the consequences and there would still be quite some cleanup work then)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with some TODOs here to cleanup later in the migration process.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline. TODO not necessary, but we'll track this in a separate issue as cleanup.

createBuilder(buildApplication);

export default builder;
10 changes: 8 additions & 2 deletions packages/angular/build/src/builders/dev-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.dev/license
*/

import { createBuilder } from '@angular-devkit/architect';
import { Builder, createBuilder } from '@angular-devkit/architect';
import { json } from '@angular-devkit/core';
import { execute } from './builder';
import type { DevServerBuilderOutput } from './output';
import type { Schema as DevServerBuilderOptions } from './schema';
Expand All @@ -16,7 +17,12 @@ export {
type DevServerBuilderOutput,
execute as executeDevServerBuilder,
};
export default createBuilder<DevServerBuilderOptions, DevServerBuilderOutput>(execute);
const builder: Builder<DevServerBuilderOptions & json.JsonObject> = createBuilder<
DevServerBuilderOptions,
DevServerBuilderOutput
>(execute);

export default builder;

// Temporary export to support specs
export { execute as executeDevServer };
9 changes: 7 additions & 2 deletions packages/angular/build/src/builders/extract-i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
* found in the LICENSE file at https://angular.dev/license
*/

import { createBuilder } from '@angular-devkit/architect';
import { Builder, createBuilder } from '@angular-devkit/architect';
import { json } from '@angular-devkit/core';
import { execute } from './builder';
import type { Schema as ExtractI18nBuilderOptions } from './schema';

export { ExtractI18nBuilderOptions, execute };
export default createBuilder<ExtractI18nBuilderOptions>(execute);

const builder: Builder<ExtractI18nBuilderOptions & json.JsonObject> =
createBuilder<ExtractI18nBuilderOptions>(execute);

export default builder;
9 changes: 7 additions & 2 deletions packages/angular/build/src/builders/ng-packagr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
* found in the LICENSE file at https://angular.dev/license
*/

import { createBuilder } from '@angular-devkit/architect';
import { Builder, createBuilder } from '@angular-devkit/architect';
import { json } from '@angular-devkit/core';
import { execute } from './builder';
import type { Schema as NgPackagrBuilderOptions } from './schema';

export { type NgPackagrBuilderOptions, execute };
export default createBuilder<NgPackagrBuilderOptions>(execute);

const builder: Builder<NgPackagrBuilderOptions & json.JsonObject> =
createBuilder<NgPackagrBuilderOptions>(execute);

export default builder;
Loading
Loading