-
Notifications
You must be signed in to change notification settings - Fork 23
/
packages.bzl
79 lines (74 loc) · 2.76 KB
/
packages.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
"""
Package version management. These are used for replacement in built bundles.
"""
# Each individual package uses a placeholder for the version of Angular to ensure they're
# all in-sync. This map is passed to each ng_package rule to stamp out the appropriate
# version for the placeholders.
ANGULAR_PACKAGE_VERSION = "^18.0.0 || ^19.0.0"
CDK_PACKAGE_VERSION = "^18.0.0"
TSLIB_PACKAGE_VERSION = "^2.3.0"
RXJS_PACKAGE_VERSION = "^6.5.3 || ^7.4.0"
# Each placeholder is used to stamp versions during the build process, replacing the key with it's
# value pair. These replacements occur during building of `npm_package` and `ng_package` stamping in
# the peer dependencies and versions, primarily in `package.json`s.
NPM_PACKAGE_SUBSTITUTIONS = {
# Version of `@angular/cdk`
"0.0.0-CDK": CDK_PACKAGE_VERSION,
# Version of `@angular/core`
"0.0.0-NG": ANGULAR_PACKAGE_VERSION,
# Version of `tslib`
"0.0.0-TSLIB": TSLIB_PACKAGE_VERSION,
# Version of the local package being built, generated via the `--workspace_status_command` flag.
"0.0.0-PLACEHOLDER": "{BUILD_SCM_VERSION}",
# Version of `rxjs`
"0.0.0-RXJS": RXJS_PACKAGE_VERSION,
}
NO_STAMP_NPM_PACKAGE_SUBSTITUTIONS = dict(NPM_PACKAGE_SUBSTITUTIONS, **{
# When building NPM packages for tests (where stamping is disabled),
# we use `0.0.0` for the version placeholder.
"0.0.0-PLACEHOLDER": "0.0.0",
})
ANGULAR_PACKAGES_CONFIG = [
("@angular/animations", struct(entry_points = ["browser"])),
("@angular/common", struct(entry_points = ["http/testing", "http", "testing"])),
("@angular/core", struct(entry_points = ["testing"])),
("@angular/forms", struct(entry_points = [])),
("@angular/platform-browser", struct(entry_points = ["testing", "animations"])),
("@angular/platform-server", struct(entry_points = [], platform = "node")),
("@angular/platform-browser-dynamic", struct(entry_points = ["testing"])),
("@angular/router", struct(entry_points = [])),
("@angular/localize", struct(entry_points = ["init"])),
("@angular/cdk", struct(entry_points = [
"a11y",
"accordion",
"bidi",
"clipboard",
"coercion",
"collections",
"dialog",
"drag-drop",
"keycodes",
"layout",
"observers",
"overlay",
"platform",
"portal",
"private",
"scrolling",
"stepper",
"table",
"text-field",
"tree",
"testing",
"testing/testbed",
])),
]
ANGULAR_PACKAGES = [
struct(
name = name[len("@angular/"):],
entry_points = config.entry_points,
platform = config.platform if hasattr(config, "platform") else "browser",
module_name = name,
)
for name, config in ANGULAR_PACKAGES_CONFIG
]