@@ -22,98 +22,61 @@ VERSION_PLACEHOLDER_REPLACEMENTS = {
22
22
"0.0.0-RXJS" : RXJS_PACKAGE_VERSION ,
23
23
}
24
24
25
- # Map of MDC packages and their UMD bundles. These are used for unit tests and the dev-app.
26
- MDC_PACKAGE_UMD_BUNDLES = {
27
- "@material/animation" : "@npm//:node_modules/@material/animation/dist/mdc.animation.js" ,
28
- "@material/auto-init" : "@npm//:node_modules/@material/auto-init/dist/mdc.autoInit.js" ,
29
- "@material/base" : "@npm//:node_modules/@material/base/dist/mdc.base.js" ,
30
- "@material/checkbox" : "@npm//:node_modules/@material/checkbox/dist/mdc.checkbox.js" ,
31
- "@material/chips" : "@npm//:node_modules/@material/chips/dist/mdc.chips.js" ,
32
- "@material/circular-progress" : "@npm//:node_modules/@material/circular-progress/dist/mdc.circularProgress.js" ,
33
- "@material/data-table" : "@npm//:node_modules/@material/data-table/dist/mdc.dataTable.js" ,
34
- "@material/dialog" : "@npm//:node_modules/@material/dialog/dist/mdc.dialog.js" ,
35
- "@material/dom" : "@npm//:node_modules/@material/dom/dist/mdc.dom.js" ,
36
- "@material/drawer" : "@npm//:node_modules/@material/drawer/dist/mdc.drawer.js" ,
37
- "@material/floating-label" : "@npm//:node_modules/@material/floating-label/dist/mdc.floatingLabel.js" ,
38
- "@material/form-field" : "@npm//:node_modules/@material/form-field/dist/mdc.formField.js" ,
39
- "@material/icon-button" : "@npm//:node_modules/@material/icon-button/dist/mdc.iconButton.js" ,
40
- "@material/line-ripple" : "@npm//:node_modules/@material/line-ripple/dist/mdc.lineRipple.js" ,
41
- "@material/linear-progress" : "@npm//:node_modules/@material/linear-progress/dist/mdc.linearProgress.js" ,
42
- "@material/list" : "@npm//:node_modules/@material/list/dist/mdc.list.js" ,
43
- "@material/menu-surface" : "@npm//:node_modules/@material/menu-surface/dist/mdc.menuSurface.js" ,
44
- "@material/menu" : "@npm//:node_modules/@material/menu/dist/mdc.menu.js" ,
45
- "@material/notched-outline" : "@npm//:node_modules/@material/notched-outline/dist/mdc.notchedOutline.js" ,
46
- "@material/radio" : "@npm//:node_modules/@material/radio/dist/mdc.radio.js" ,
47
- "@material/ripple" : "@npm//:node_modules/@material/ripple/dist/mdc.ripple.js" ,
48
- "@material/select" : "@npm//:node_modules/@material/select/dist/mdc.select.js" ,
49
- "@material/slider" : "@npm//:node_modules/@material/slider/dist/mdc.slider.js" ,
50
- "@material/snackbar" : "@npm//:node_modules/@material/snackbar/dist/mdc.snackbar.js" ,
51
- "@material/switch" : "@npm//:node_modules/@material/switch/dist/mdc.switch.js" ,
52
- "@material/tab-bar" : "@npm//:node_modules/@material/tab-bar/dist/mdc.tabBar.js" ,
53
- "@material/tab-indicator" : "@npm//:node_modules/@material/tab-indicator/dist/mdc.tabIndicator.js" ,
54
- "@material/tab-scroller" : "@npm//:node_modules/@material/tab-scroller/dist/mdc.tabScroller.js" ,
55
- "@material/tab" : "@npm//:node_modules/@material/tab/dist/mdc.tab.js" ,
56
- "@material/textfield" : "@npm//:node_modules/@material/textfield/dist/mdc.textfield.js" ,
57
- "@material/tooltip" : "@npm//:node_modules/@material/tooltip/dist/mdc.tooltip.js" ,
58
- "@material/top-app-bar" : "@npm//:node_modules/@material/top-app-bar/dist/mdc.topAppBar.js" ,
59
- }
60
-
61
- # List of default Angular library UMD bundles which are not processed by ngcc.
62
- ANGULAR_NO_NGCC_BUNDLES = [
63
- ("@angular/compiler" , ["compiler.umd.js" ]),
64
- ("@angular/localize" , ["localize.umd.js" , "localize-init.umd.js" ]),
25
+ # List of MDC packages.
26
+ MDC_PACKAGES = [
27
+ "@material/animation" ,
28
+ "@material/auto-init" ,
29
+ "@material/base" ,
30
+ "@material/checkbox" ,
31
+ "@material/chips" ,
32
+ "@material/circular-progress" ,
33
+ "@material/data-table" ,
34
+ "@material/dialog" ,
35
+ "@material/dom" ,
36
+ "@material/drawer" ,
37
+ "@material/floating-label" ,
38
+ "@material/form-field" ,
39
+ "@material/icon-button" ,
40
+ "@material/line-ripple" ,
41
+ "@material/linear-progress" ,
42
+ "@material/list" ,
43
+ "@material/menu-surface" ,
44
+ "@material/menu" ,
45
+ "@material/notched-outline" ,
46
+ "@material/radio" ,
47
+ "@material/ripple" ,
48
+ "@material/select" ,
49
+ "@material/slider" ,
50
+ "@material/snackbar" ,
51
+ "@material/switch" ,
52
+ "@material/tab-bar" ,
53
+ "@material/tab-indicator" ,
54
+ "@material/tab-scroller" ,
55
+ "@material/tab" ,
56
+ "@material/textfield" ,
57
+ "@material/tooltip" ,
58
+ "@material/top-app-bar" ,
65
59
]
66
60
67
- # List of Angular library UMD bundles which will are processed by ngcc.
68
- ANGULAR_NGCC_BUNDLES = [
69
- ("@angular/animations" , ["animations-browser.umd.js" , "animations.umd.js" ]),
70
- ("@angular/common" , ["common-http-testing.umd.js" , "common-http.umd.js" , "common-testing.umd.js" , "common.umd.js" ]),
71
- ("@angular/compiler" , ["compiler-testing.umd.js" ]),
72
- ("@angular/core" , ["core-testing.umd.js" , "core.umd.js" ]),
73
- ("@angular/forms" , ["forms.umd.js" ]),
74
- ("@angular/platform-browser-dynamic" , ["platform-browser-dynamic-testing.umd.js" , "platform-browser-dynamic.umd.js" ]),
75
- ("@angular/platform-browser" , ["platform-browser.umd.js" , "platform-browser-testing.umd.js" , "platform-browser-animations.umd.js" ]),
76
- ("@angular/router" , ["router.umd.js" ]),
61
+ ANGULAR_PACKAGES_CONFIG = [
62
+ ("@angular/animations" , struct (entry_points = ["browser" ])),
63
+ ("@angular/common" , struct (entry_points = ["http/testing" , "http" , "testing" ])),
64
+ ("@angular/compiler" , struct (entry_points = ["testing" ])),
65
+ ("@angular/core" , struct (entry_points = ["testing" ])),
66
+ ("@angular/forms" , struct (entry_points = [])),
67
+ ("@angular/platform-browser" , struct (entry_points = ["testing" , "animations" ])),
68
+ ("@angular/platform-server" , struct (entry_points = [], platform = "node" )),
69
+ ("@angular/platform-browser-dynamic" , struct (entry_points = ["testing" ])),
70
+ ("@angular/router" , struct (entry_points = [])),
71
+ ("@angular/localize" , struct (entry_points = ["init" ])),
77
72
]
78
73
79
- """
80
- Gets a dictionary of all packages and their bundle names.
81
- """
82
-
83
- def getFrameworkPackageBundles ():
84
- res = {}
85
- for pkgName , bundleNames in ANGULAR_NGCC_BUNDLES + ANGULAR_NO_NGCC_BUNDLES :
86
- res [pkgName ] = res .get (pkgName , []) + bundleNames
87
- return res
88
-
89
- """
90
- Gets a list of labels which resolve to the UMD bundles of the given packages.
91
- """
92
-
93
- def getUmdFilePaths (packages , ngcc_artifacts ):
94
- tmpl = "@npm//:node_modules/%s" + ("/__ivy_ngcc__" if ngcc_artifacts else "" ) + "/bundles/%s"
95
- return [
96
- tmpl % (pkgName , bundleName )
97
- for pkgName , bundleNames in packages
98
- for bundleName in bundleNames
99
- ]
100
-
101
- ANGULAR_PACKAGE_BUNDLES = getFrameworkPackageBundles ()
102
-
103
- ANGULAR_LIBRARY_VIEW_ENGINE_UMDS = getUmdFilePaths (ANGULAR_NO_NGCC_BUNDLES , False ) + \
104
- getUmdFilePaths (ANGULAR_NGCC_BUNDLES , False )
105
-
106
- ANGULAR_LIBRARY_IVY_UMDS = getUmdFilePaths (ANGULAR_NO_NGCC_BUNDLES , False ) + \
107
- getUmdFilePaths (ANGULAR_NGCC_BUNDLES , True )
108
-
109
- """
110
- Gets the list of targets for the Angular library UMD bundles. Conditionally
111
- switches between View Engine or Ivy UMD bundles based on the
112
- "--config={ivy,view-engine}" flag.
113
- """
114
-
115
- def getAngularUmdTargets ():
116
- return select ({
117
- "//tools:view_engine_mode" : ANGULAR_LIBRARY_VIEW_ENGINE_UMDS ,
118
- "//conditions:default" : ANGULAR_LIBRARY_IVY_UMDS ,
119
- })
74
+ ANGULAR_PACKAGES = [
75
+ struct (
76
+ name = name [len ("@angular/" ):],
77
+ entry_points = config .entry_points ,
78
+ platform = config .platform if hasattr (config , "platform" ) else "browser" ,
79
+ module_name = name ,
80
+ )
81
+ for name , config in ANGULAR_PACKAGES_CONFIG
82
+ ]
0 commit comments