@@ -23,89 +23,89 @@ function assertSucceeded {
23
23
}
24
24
25
25
26
- ivy- ngcc --help
27
- assertSucceeded " Expected 'ivy- ngcc --help' to succeed."
26
+ ngcc --help
27
+ assertSucceeded " Expected 'ngcc --help' to succeed."
28
28
29
- # node --inspect-brk $(npm bin)/ivy- ngcc -f esm2015
29
+ # node --inspect-brk $(npm bin)/ngcc -f esm2015
30
30
# Run ngcc and check it logged compilation output as expected
31
- ivy- ngcc | grep ' Compiling'
32
- assertSucceeded " Expected 'ivy- ngcc' to log 'Compiling'."
31
+ ngcc | grep ' Compiling'
32
+ assertSucceeded " Expected 'ngcc' to log 'Compiling'."
33
33
34
34
35
35
# Did it add the appropriate build markers?
36
36
37
37
# - esm2015
38
38
cat node_modules/@angular/common/package.json | awk ' ORS=" "' | grep ' "__processed_by_ivy_ngcc__":[^}]*"esm2015": "'
39
- assertSucceeded " Expected 'ivy- ngcc' to add build marker for 'esm2015' in '@angular/common'."
39
+ assertSucceeded " Expected 'ngcc' to add build marker for 'esm2015' in '@angular/common'."
40
40
41
41
# - fesm2015
42
42
cat node_modules/@angular/common/package.json | awk ' ORS=" "' | grep ' "__processed_by_ivy_ngcc__":[^}]*"fesm2015": "'
43
- assertSucceeded " Expected 'ivy- ngcc' to add build marker for 'fesm2015' in '@angular/common'."
43
+ assertSucceeded " Expected 'ngcc' to add build marker for 'fesm2015' in '@angular/common'."
44
44
45
45
cat node_modules/@angular/common/package.json | awk ' ORS=" "' | grep ' "__processed_by_ivy_ngcc__":[^}]*"es2015": "'
46
- assertSucceeded " Expected 'ivy- ngcc' to add build marker for 'es2015' in '@angular/common'."
46
+ assertSucceeded " Expected 'ngcc' to add build marker for 'es2015' in '@angular/common'."
47
47
48
48
# - esm5
49
49
cat node_modules/@angular/common/package.json | awk ' ORS=" "' | grep ' "__processed_by_ivy_ngcc__":[^}]*"esm5": "'
50
- assertSucceeded " Expected 'ivy- ngcc' to add build marker for 'esm5' in '@angular/common'."
50
+ assertSucceeded " Expected 'ngcc' to add build marker for 'esm5' in '@angular/common'."
51
51
52
52
# - fesm5
53
53
cat node_modules/@angular/common/package.json | awk ' ORS=" "' | grep ' "__processed_by_ivy_ngcc__":[^}]*"module": "'
54
- assertSucceeded " Expected 'ivy- ngcc' to add build marker for 'module' in '@angular/common'."
54
+ assertSucceeded " Expected 'ngcc' to add build marker for 'module' in '@angular/common'."
55
55
56
56
cat node_modules/@angular/common/package.json | awk ' ORS=" "' | grep ' "__processed_by_ivy_ngcc__":[^}]*"fesm5": "'
57
- assertSucceeded " Expected 'ivy- ngcc' to add build marker for 'fesm5' in '@angular/common'."
57
+ assertSucceeded " Expected 'ngcc' to add build marker for 'fesm5' in '@angular/common'."
58
58
59
59
60
60
# Did it replace the PRE_R3 markers correctly?
61
61
grep " = SWITCH_COMPILE_COMPONENT__POST_R3__" node_modules/@angular/core/fesm2015/core.js
62
- assertSucceeded " Expected 'ivy- ngcc' to replace 'SWITCH_COMPILE_COMPONENT__PRE_R3__' in '@angular/core' (fesm2015)."
62
+ assertSucceeded " Expected 'ngcc' to replace 'SWITCH_COMPILE_COMPONENT__PRE_R3__' in '@angular/core' (fesm2015)."
63
63
64
64
grep " = SWITCH_COMPILE_COMPONENT__POST_R3__" node_modules/@angular/core/fesm5/core.js
65
- assertSucceeded " Expected 'ivy- ngcc' to replace 'SWITCH_COMPILE_COMPONENT__PRE_R3__' in '@angular/core' (fesm5)."
65
+ assertSucceeded " Expected 'ngcc' to replace 'SWITCH_COMPILE_COMPONENT__PRE_R3__' in '@angular/core' (fesm5)."
66
66
67
67
68
68
# Did it compile @angular/core/ApplicationModule correctly?
69
69
grep " ApplicationModule.ngModuleDef = ɵɵdefineNgModule" node_modules/@angular/core/fesm2015/core.js
70
- assertSucceeded " Expected 'ivy- ngcc' to correctly compile 'ApplicationModule' in '@angular/core' (fesm2015)."
70
+ assertSucceeded " Expected 'ngcc' to correctly compile 'ApplicationModule' in '@angular/core' (fesm2015)."
71
71
72
72
grep " ApplicationModule.ngModuleDef = ɵɵdefineNgModule" node_modules/@angular/core/fesm5/core.js
73
- assertSucceeded " Expected 'ivy- ngcc' to correctly compile 'ApplicationModule' in '@angular/core' (fesm5)."
73
+ assertSucceeded " Expected 'ngcc' to correctly compile 'ApplicationModule' in '@angular/core' (fesm5)."
74
74
75
75
grep " ApplicationModule.ngModuleDef = ɵngcc0.ɵɵdefineNgModule" node_modules/@angular/core/esm2015/src/application_module.js
76
- assertSucceeded " Expected 'ivy- ngcc' to correctly compile 'ApplicationModule' in '@angular/core' (esm2015)."
76
+ assertSucceeded " Expected 'ngcc' to correctly compile 'ApplicationModule' in '@angular/core' (esm2015)."
77
77
78
78
grep " ApplicationModule.ngModuleDef = ɵngcc0.ɵɵdefineNgModule" node_modules/@angular/core/esm5/src/application_module.js
79
- assertSucceeded " Expected 'ivy- ngcc' to correctly compile 'ApplicationModule' in '@angular/core' (esm5)."
79
+ assertSucceeded " Expected 'ngcc' to correctly compile 'ApplicationModule' in '@angular/core' (esm5)."
80
80
81
81
82
82
# Did it transform @angular/core typing files correctly?
83
83
grep " import [*] as ɵngcc0 from './src/r3_symbols';" node_modules/@angular/core/core.d.ts
84
- assertSucceeded " Expected 'ivy- ngcc' to add an import for 'src/r3_symbols' in '@angular/core' typings."
84
+ assertSucceeded " Expected 'ngcc' to add an import for 'src/r3_symbols' in '@angular/core' typings."
85
85
86
86
grep " static ngInjectorDef: ɵngcc0.ɵɵInjectorDef<ApplicationModule>;" node_modules/@angular/core/core.d.ts
87
- assertSucceeded " Expected 'ivy- ngcc' to add a definition for 'ApplicationModule.ngInjectorDef' in '@angular/core' typings."
87
+ assertSucceeded " Expected 'ngcc' to add a definition for 'ApplicationModule.ngInjectorDef' in '@angular/core' typings."
88
88
89
89
90
90
# Did it generate a base factory call for synthesized constructors correctly?
91
91
grep " const ɵMatTable_BaseFactory = ɵngcc0.ɵɵgetInheritedFactory(MatTable);" node_modules/@angular/material/esm2015/table.js
92
- assertSucceeded " Expected 'ivy- ngcc' to generate a base factory for 'MatTable' in '@angular/material' (esm2015)."
92
+ assertSucceeded " Expected 'ngcc' to generate a base factory for 'MatTable' in '@angular/material' (esm2015)."
93
93
94
94
grep " const ɵMatTable_BaseFactory = ɵngcc0.ɵɵgetInheritedFactory(MatTable);" node_modules/@angular/material/esm5/table.es5.js
95
- assertSucceeded " Expected 'ivy- ngcc' to generate a base factory for 'MatTable' in '@angular/material' (esm5)."
95
+ assertSucceeded " Expected 'ngcc' to generate a base factory for 'MatTable' in '@angular/material' (esm5)."
96
96
97
97
98
98
# Did it generate a base definition for undecorated classes with inputs and view queries?
99
99
grep " _MatMenuBase.ngBaseDef = ɵngcc0.ɵɵdefineBase({ inputs: {" node_modules/@angular/material/esm2015/menu.js
100
- assertSucceeded " Expected 'ivy- ngcc' to generate a base definition for 'MatMenuBase' in '@angular/material' (esm2015)."
100
+ assertSucceeded " Expected 'ngcc' to generate a base definition for 'MatMenuBase' in '@angular/material' (esm2015)."
101
101
102
102
grep " _MatMenuBase.ngBaseDef = ɵngcc0.ɵɵdefineBase({ inputs: {" node_modules/@angular/material/esm5/menu.es5.js
103
- assertSucceeded " Expected 'ivy- ngcc' to generate a base definition for 'MatMenuBase' in '@angular/material' (esm5)."
103
+ assertSucceeded " Expected 'ngcc' to generate a base definition for 'MatMenuBase' in '@angular/material' (esm5)."
104
104
105
105
106
106
# Did it handle namespace imported decorators in UMD using `__decorate` syntax?
107
107
grep " type: i0.Injectable" node_modules/@angular/common/bundles/common.umd.js
108
- assertSucceeded " Expected 'ivy- ngcc' to correctly handle '__decorate' syntax in '@angular/common' (umd)."
108
+ assertSucceeded " Expected 'ngcc' to correctly handle '__decorate' syntax in '@angular/common' (umd)."
109
109
110
110
# (and ensure the @angular/common package is indeed using `__decorate` syntax)
111
111
grep " JsonPipe = __decorate(" node_modules/@angular/common/bundles/common.umd.js.__ivy_ngcc_bak
@@ -114,7 +114,7 @@ assertSucceeded "Expected 'ivy-ngcc' to log 'Compiling'."
114
114
115
115
# Did it handle namespace imported decorators in UMD using static properties?
116
116
grep " type: core.Injectable," node_modules/@angular/cdk/bundles/cdk-a11y.umd.js
117
- assertSucceeded " Expected 'ivy- ngcc' to correctly handle decorators via static properties in '@angular/cdk/a11y' (umd)."
117
+ assertSucceeded " Expected 'ngcc' to correctly handle decorators via static properties in '@angular/cdk/a11y' (umd)."
118
118
119
119
# (and ensure the @angular/cdk/a11y package is indeed using static properties)
120
120
grep " FocusMonitor.decorators =" node_modules/@angular/cdk/bundles/cdk-a11y.umd.js.__ivy_ngcc_bak
@@ -123,20 +123,20 @@ assertSucceeded "Expected 'ivy-ngcc' to log 'Compiling'."
123
123
124
124
# Can it be safely run again (as a noop)?
125
125
# And check that it logged skipping compilation as expected
126
- ivy- ngcc -l debug | grep ' Skipping'
127
- assertSucceeded " Expected 'ivy- ngcc -l debug' to successfully rerun (as a noop) and log 'Skipping'."
126
+ ngcc -l debug | grep ' Skipping'
127
+ assertSucceeded " Expected 'ngcc -l debug' to successfully rerun (as a noop) and log 'Skipping'."
128
128
129
129
# Does it process the tasks in parallel?
130
- ivy- ngcc -l debug | grep ' Running ngcc on ClusterExecutor'
131
- assertSucceeded " Expected 'ivy- ngcc -l debug' to run in parallel mode (using 'ClusterExecutor')."
130
+ ngcc -l debug | grep ' Running ngcc on ClusterExecutor'
131
+ assertSucceeded " Expected 'ngcc -l debug' to run in parallel mode (using 'ClusterExecutor')."
132
132
133
133
# Check that running it with logging level error outputs nothing
134
- ivy- ngcc -l error | grep ' .'
135
- assertFailed " Expected 'ivy- ngcc -l error' to not output anything."
134
+ ngcc -l error | grep ' .'
135
+ assertFailed " Expected 'ngcc -l error' to not output anything."
136
136
137
137
# Does running it with --formats fail?
138
- ivy- ngcc --formats fesm2015
139
- assertFailed " Expected 'ivy- ngcc --formats fesm2015' to fail (since '--formats' is deprecated)."
138
+ ngcc --formats fesm2015
139
+ assertFailed " Expected 'ngcc --formats fesm2015' to fail (since '--formats' is deprecated)."
140
140
141
141
# Now try compiling the app using the ngcc compiled libraries
142
142
ngc -p tsconfig-app.json
@@ -148,3 +148,11 @@ assertSucceeded "Expected the app to successfully compile with the ngcc-processe
148
148
149
149
grep " directives: \[.*\.MatButton.*\]" dist/src/main.js
150
150
assertSucceeded " Expected the compiled app's 'main.ts' to list 'MatButton' in 'directives'."
151
+
152
+
153
+ # 'ivy-ngcc' should fail with an appropriate error message.
154
+ ivy-ngcc
155
+ assertFailed " Expected 'ivy-ngcc' to fail (since it was renamed to 'ngcc')."
156
+
157
+ ivy-ngcc 2>&1 | grep " Error: The 'ivy-ngcc' command was renamed to just 'ngcc'. Please update your usage."
158
+ assertSucceeded " Expected 'ivy-ngcc' to show an appropriate error message."
0 commit comments