Skip to content

Commit e1fa579

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 d0eb6b6 commit e1fa579

43 files changed

Lines changed: 5655 additions & 4 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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",
@@ -286,6 +293,32 @@ ts_project(
286293
],
287294
)
288295

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

363+
jasmine_test(
364+
name = "library_integration_tests",
365+
size = "medium",
366+
data = [":library_integration_test_lib"],
367+
shard_count = 4,
368+
)
369+
330370
genrule(
331371
name = "license",
332372
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.8",
41+
"rolldown-plugin-dts": "0.28.5",
4142
"sass": "1.104.1",
4243
"sass-embedded": "1.104.1",
4344
"semver": "7.8.5",

0 commit comments

Comments
 (0)