Skip to content

Commit 325c0bf

Browse files
committed
feat(@angular/build): add library builder
Add a new native `@angular/build:library` builder providing a modern, high-performance compilation and packaging pipeline.
1 parent 099e52f commit 325c0bf

38 files changed

Lines changed: 4835 additions & 2 deletions

‎packages/angular/build/BUILD.bazel‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ ts_json_schema(
2424
src = "src/builders/extract-i18n/schema.json",
2525
)
2626

27+
ts_json_schema(
28+
name = "library_schema",
29+
src = "src/builders/library/schema.json",
30+
)
31+
2732
ts_json_schema(
2833
name = "ng_karma_schema",
2934
src = "src/builders/karma/schema.json",
@@ -72,6 +77,7 @@ ts_project(
7277
"//packages/angular/build:src/builders/dev-server/schema.ts",
7378
"//packages/angular/build:src/builders/extract-i18n/schema.ts",
7479
"//packages/angular/build:src/builders/karma/schema.ts",
80+
"//packages/angular/build:src/builders/library/schema.ts",
7581
"//packages/angular/build:src/builders/ng-packagr/schema.ts",
7682
"//packages/angular/build:src/builders/unit-test/schema.ts",
7783
],
@@ -104,6 +110,7 @@ ts_project(
104110
":node_modules/piscina",
105111
":node_modules/postcss",
106112
":node_modules/rolldown",
113+
":node_modules/rolldown-plugin-dts",
107114
":node_modules/rollup",
108115
":node_modules/sass",
109116
":node_modules/sass-embedded",
@@ -287,6 +294,32 @@ ts_project(
287294
],
288295
)
289296

297+
ts_project(
298+
name = "library_integration_test_lib",
299+
testonly = True,
300+
srcs = glob(include = ["src/builders/library/tests/**/*.ts"]),
301+
deps = [
302+
":build",
303+
"//packages/angular/build/private",
304+
"//modules/testing/builder",
305+
":node_modules/@angular-devkit/architect",
306+
":node_modules/@angular-devkit/core",
307+
"//:node_modules/@types/node",
308+
309+
# Base dependencies for the library in hello-world-lib.
310+
"//:node_modules/@angular/common",
311+
"//:node_modules/@angular/compiler",
312+
"//:node_modules/@angular/compiler-cli",
313+
"//:node_modules/@angular/core",
314+
"//:node_modules/@angular/platform-browser",
315+
"//:node_modules/@angular/router",
316+
":node_modules/rxjs",
317+
"//:node_modules/tslib",
318+
"//:node_modules/typescript",
319+
"//:node_modules/zone.js",
320+
],
321+
)
322+
290323
jasmine_test(
291324
name = "application_integration_tests",
292325
size = "medium",
@@ -324,6 +357,13 @@ jasmine_test(
324357
shard_count = 5,
325358
)
326359

360+
jasmine_test(
361+
name = "library_integration_tests",
362+
size = "medium",
363+
data = [":library_integration_test_lib"],
364+
shard_count = 4,
365+
)
366+
327367
genrule(
328368
name = "license",
329369
srcs = ["//:LICENSE"],

‎packages/angular/build/builders.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
"schema": "./src/builders/karma/schema.json",
2121
"description": "Run Karma unit tests."
2222
},
23+
"library": {
24+
"implementation": "./src/builders/library/index",
25+
"schema": "./src/builders/library/schema.json",
26+
"description": "Build an Angular library package conforming to the Angular Package Format (APF)."
27+
},
2328
"ng-packagr": {
2429
"implementation": "./src/builders/ng-packagr/index",
2530
"schema": "./src/builders/ng-packagr/schema.json",

‎packages/angular/build/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"picomatch": "4.0.7",
3939
"piscina": "5.3.2",
4040
"rolldown": "1.2.11",
41+
"rolldown-plugin-dts": "0.28.5",
4142
"sass": "1.105.0",
4243
"sass-embedded": "1.105.0",
4344
"semver": "7.8.5",

0 commit comments

Comments
 (0)