2018-02-08 11:59:25 -05:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2018-02-27 17:06:06 -05:00
|
|
|
const {set, cd, sed, rm} = require('shelljs');
|
2018-03-08 23:23:33 -05:00
|
|
|
const path = require('path');
|
2018-02-08 11:59:25 -05:00
|
|
|
const log = console.log;
|
2018-03-08 23:23:33 -05:00
|
|
|
|
2018-02-27 17:06:06 -05:00
|
|
|
log('===== about to run the postinstall-patches.js script =====');
|
2018-03-08 23:23:33 -05:00
|
|
|
// fail on first error
|
|
|
|
set('-e');
|
|
|
|
// print commands as being executed
|
|
|
|
set('-v');
|
|
|
|
// jump to project root
|
|
|
|
cd(path.join(__dirname, '../'));
|
|
|
|
|
2018-02-27 17:06:06 -05:00
|
|
|
/* EXAMPLE PATCH:
|
2018-03-08 23:39:41 -05:00
|
|
|
// https://github.com/ReactiveX/rxjs/pull/3302
|
|
|
|
// make node_modules/rxjs compilable with Typescript 2.7
|
|
|
|
// remove when we update to rxjs v6
|
2018-02-08 11:59:25 -05:00
|
|
|
log('\n# patch: reactivex/rxjs#3302 make node_modules/rxjs compilable with Typescript 2.7');
|
|
|
|
sed('-i', '(\'response\' in xhr)', '(\'response\' in (xhr as any))',
|
|
|
|
'node_modules/rxjs/src/observable/dom/AjaxObservable.ts');
|
2018-02-27 17:06:06 -05:00
|
|
|
*/
|
2018-03-08 23:39:41 -05:00
|
|
|
|
2018-03-20 16:55:27 -04:00
|
|
|
// fixes rxjs bazel build: https://github.com/ReactiveX/rxjs/pull/3454
|
|
|
|
sed('-i', /^ srcs = glob.*/,
|
|
|
|
'srcs = glob(["*.ts", "**/*.ts"], exclude = ["internal/Rx.ts", "internal-compatibility/**", "internal/patching/**", "umd.ts"]),',
|
|
|
|
'node_modules/rxjs/src/BUILD.bazel');
|
2018-03-08 23:23:33 -05:00
|
|
|
|
2018-02-27 17:06:06 -05:00
|
|
|
log('===== finished running the postinstall-patches.js script =====');
|