2018-08-09 14:23:56 +01:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
2018-08-09 13:54:20 +01:00
|
|
|
|
set -e -x
|
2018-08-09 14:23:56 +01:00
|
|
|
|
|
|
|
|
|
|
PATH=$PATH:$(npm bin)
|
|
|
|
|
|
|
2018-08-09 15:59:10 +01:00
|
|
|
|
ivy-ngcc --help
|
|
|
|
|
|
|
|
|
|
|
|
# node --inspect-brk $(npm bin)/ivy-ngcc -f esm2015
|
|
|
|
|
|
ivy-ngcc
|
|
|
|
|
|
|
2018-08-17 22:00:00 +01:00
|
|
|
|
# Did it add the appropriate build markers?
|
2018-10-03 17:00:05 +01:00
|
|
|
|
# - fesm2015
|
|
|
|
|
|
ls node_modules/@angular/common | grep __modified_by_ngcc_for_fesm2015
|
|
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
|
|
|
|
|
# - esm2015
|
|
|
|
|
|
ls node_modules/@angular/common | grep __modified_by_ngcc_for_esm2015
|
|
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
|
|
|
|
|
|
2018-10-17 15:44:44 -07:00
|
|
|
|
# Did it replace the PRE_R3 markers correctly?
|
|
|
|
|
|
grep "= SWITCH_COMPILE_COMPONENT__POST_R3__" node_modules/@angular/core/fesm2015/core.js
|
2018-10-03 17:00:05 +01:00
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
2018-10-17 15:44:44 -07:00
|
|
|
|
grep "= SWITCH_COMPILE_COMPONENT__POST_R3__" node_modules/@angular/core/fesm5/core.js
|
2018-10-03 17:00:05 +01:00
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
|
|
|
|
|
|
|
|
|
|
|
# Did it compile @angular/core/ApplicationModule correctly?
|
2018-11-11 19:16:04 +01:00
|
|
|
|
grep "ApplicationModule.ngModuleDef = defineNgModule" node_modules/@angular/core/fesm2015/core.js
|
2018-10-03 17:00:05 +01:00
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
2018-11-11 19:16:04 +01:00
|
|
|
|
grep "ApplicationModule.ngModuleDef = defineNgModule" node_modules/@angular/core/fesm5/core.js
|
2018-10-03 17:00:05 +01:00
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
2018-11-11 19:16:04 +01:00
|
|
|
|
grep "ApplicationModule.ngModuleDef = ɵngcc0.defineNgModule" node_modules/@angular/core/esm2015/src/application_module.js
|
2018-10-03 17:00:05 +01:00
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
2018-11-11 19:16:04 +01:00
|
|
|
|
grep "ApplicationModule.ngModuleDef = ɵngcc0.defineNgModule" node_modules/@angular/core/esm5/src/application_module.js
|
2018-10-03 17:00:05 +01:00
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
|
|
|
|
|
|
2018-11-12 00:07:42 +01:00
|
|
|
|
# Did it transform @angular/core typing files correctly?
|
|
|
|
|
|
grep "import [*] as ɵngcc0 from './r3_symbols';" node_modules/@angular/core/src/application_module.d.ts
|
|
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
|
|
|
|
|
grep "static ngInjectorDef: ɵngcc0.InjectorDef<ApplicationModule>;" node_modules/@angular/core/src/application_module.d.ts
|
|
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
|
|
|
|
|
|
2019-01-02 23:25:58 +01:00
|
|
|
|
# Did it generate a base factory call for synthesized constructors correctly?
|
|
|
|
|
|
grep "const ɵMatTable_BaseFactory = ɵngcc0.ɵgetInheritedFactory(MatTable);" node_modules/@angular/material/esm2015/table.js
|
|
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
|
|
|
|
|
grep "const ɵMatTable_BaseFactory = ɵngcc0.ɵgetInheritedFactory(MatTable);" node_modules/@angular/material/esm5/table.es5.js
|
|
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
|
|
|
|
|
|
2018-10-03 17:00:05 +01:00
|
|
|
|
# Can it be safely run again (as a noop)?
|
|
|
|
|
|
ivy-ngcc
|
2018-08-09 15:59:10 +01:00
|
|
|
|
|
2018-10-03 17:00:05 +01:00
|
|
|
|
# Now try compiling the app using the ngcc compiled libraries
|
2018-08-09 14:23:56 +01:00
|
|
|
|
ngc -p tsconfig-app.json
|
|
|
|
|
|
|
2018-10-15 11:02:38 +01:00
|
|
|
|
# Did it compile the main.ts correctly (including the ngIf and MatButton directives)?
|
|
|
|
|
|
grep "directives: \[.*\.NgIf.*\]" dist/src/main.js
|
|
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|
|
|
|
|
|
grep "directives: \[.*\.MatButton.*\]" dist/src/main.js
|
2018-10-03 17:00:05 +01:00
|
|
|
|
if [[ $? != 0 ]]; then exit 1; fi
|