mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
8b54715053
* Makes the `openDialog` public. * Adds a unique id to each `MdDialogRef`, as well as the option to override the id and to look dialogs by id. * The `afterAllClosed` stream now emits on subscribe if there are no open dialogs. Fixes #6272.
87 lines
3.7 KiB
TypeScript
87 lines
3.7 KiB
TypeScript
import {join} from 'path';
|
|
import {getSubdirectoryNames} from './secondary-entry-points';
|
|
import {buildConfig} from './build-config';
|
|
|
|
/** Method that converts dash-case strings to a camel-based string. */
|
|
const dashCaseToCamelCase = (str: string) => str.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
|
|
/** List of potential secondary entry-points for the CDK package. */
|
|
const cdkSecondaryEntryPoints = getSubdirectoryNames(join(buildConfig.packagesDir, 'cdk'));
|
|
|
|
/** Object with all CDK entry points in the format of Rollup globals. */
|
|
const rollupCdkEntryPoints = cdkSecondaryEntryPoints.reduce((globals: any, entryPoint: string) => {
|
|
globals[`@angular/cdk/${entryPoint}`] = `ng.cdk.${dashCaseToCamelCase(entryPoint)}`;
|
|
return globals;
|
|
}, {});
|
|
|
|
/** Map of globals that are used inside of the different packages. */
|
|
export const rollupGlobals = {
|
|
'tslib': 'tslib',
|
|
|
|
'@angular/animations': 'ng.animations',
|
|
'@angular/core': 'ng.core',
|
|
'@angular/common': 'ng.common',
|
|
'@angular/forms': 'ng.forms',
|
|
'@angular/http': 'ng.http',
|
|
'@angular/router': 'ng.router',
|
|
'@angular/platform-browser': 'ng.platformBrowser',
|
|
'@angular/platform-server': 'ng.platformServer',
|
|
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
|
|
'@angular/platform-browser/animations': 'ng.platformBrowser.animations',
|
|
'@angular/core/testing': 'ng.core.testing',
|
|
'@angular/common/testing': 'ng.common.testing',
|
|
'@angular/http/testing': 'ng.http.testing',
|
|
|
|
|
|
'@angular/material': 'ng.material',
|
|
'@angular/cdk': 'ng.cdk',
|
|
|
|
// Include secondary entry-points of the CDK package
|
|
...rollupCdkEntryPoints,
|
|
|
|
// Some packages are not really needed for the UMD bundles, but for the missingRollupGlobals rule.
|
|
// TODO(devversion): remove by adding minimatch and better globbing to rules
|
|
'@angular/cdk/testing': 'ng.cdk.testing',
|
|
'@angular/material-examples': 'ng.materialExamples',
|
|
|
|
'rxjs/BehaviorSubject': 'Rx',
|
|
'rxjs/Observable': 'Rx',
|
|
'rxjs/Subject': 'Rx',
|
|
'rxjs/Subscription': 'Rx',
|
|
'rxjs/Observer': 'Rx',
|
|
'rxjs/Scheduler': 'Rx',
|
|
'rxjs/observable/combineLatest': 'Rx.Observable',
|
|
'rxjs/observable/forkJoin': 'Rx.Observable',
|
|
'rxjs/observable/fromEvent': 'Rx.Observable',
|
|
'rxjs/observable/merge': 'Rx.Observable',
|
|
'rxjs/observable/of': 'Rx.Observable',
|
|
'rxjs/observable/throw': 'Rx.Observable',
|
|
'rxjs/observable/defer': 'Rx.Observable',
|
|
'rxjs/operator/auditTime': 'Rx.Observable.prototype',
|
|
'rxjs/operator/catch': 'Rx.Observable.prototype',
|
|
'rxjs/operator/debounceTime': 'Rx.Observable.prototype',
|
|
'rxjs/operator/do': 'Rx.Observable.prototype',
|
|
'rxjs/operator/filter': 'Rx.Observable.prototype',
|
|
'rxjs/operator/finally': 'Rx.Observable.prototype',
|
|
'rxjs/operator/first': 'Rx.Observable.prototype',
|
|
'rxjs/operator/let': 'Rx.Observable.prototype',
|
|
'rxjs/operator/map': 'Rx.Observable.prototype',
|
|
'rxjs/operator/share': 'Rx.Observable.prototype',
|
|
'rxjs/operator/startWith': 'Rx.Observable.prototype',
|
|
'rxjs/operator/switchMap': 'Rx.Observable.prototype',
|
|
'rxjs/operator/takeUntil': 'Rx.Observable.prototype',
|
|
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
|
|
|
|
'rxjs/add/observable/merge': 'Rx.Observable',
|
|
'rxjs/add/observable/fromEvent': 'Rx.Observable',
|
|
'rxjs/add/observable/of': 'Rx.Observable',
|
|
'rxjs/add/observable/interval': 'Rx.Observable',
|
|
'rxjs/add/operator/startWith': 'Rx.Observable.prototype',
|
|
'rxjs/add/operator/map': 'Rx.Observable.prototype',
|
|
'rxjs/add/operator/debounceTime': 'Rx.Observable.prototype',
|
|
'rxjs/add/operator/distinctUntilChanged': 'Rx.Observable.prototype',
|
|
'rxjs/add/operator/first': 'Rx.Observable.prototype',
|
|
'rxjs/add/operator/catch': 'Rx.Observable.prototype',
|
|
'rxjs/add/operator/switchMap': 'Rx.Observable.prototype'
|
|
};
|