Skip to content

Commit

Permalink
fix(build): fix rollup scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
pimenovoleg committed May 29, 2018
1 parent 8f9cc6d commit 0b6a135
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 77 deletions.
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"@angular/platform-browser": "6.0.0",
"core-js": "^2.5.5",
"@ptsecurity/mosaic-icons": "2.5.0",
"rxjs": "^6.1.0",
"rxjs": "6.0.0",
"systemjs": "0.19.43",
"tslib": "1.9.0",
"tslib": "^1.9.1",
"zone.js": "0.8.26"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion src/cdk/a11y/focus-monitor/focus-monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
OnDestroy,
Optional,
Output,
Renderer2,
SkipSelf
} from '@angular/core';

Expand Down
2 changes: 1 addition & 1 deletion src/cdk/collections/unique-selection-dispatcher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable, Optional, SkipSelf, OnDestroy } from '@angular/core';
import { Injectable, OnDestroy } from '@angular/core';


// Users of the Dispatcher never need to see this type, but TypeScript requires it to be exported.
Expand Down
59 changes: 30 additions & 29 deletions src/cdk/package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
{
"name": "@ptsecurity/cdk",
"version": "0.0.0-PLACEHOLDER",
"description": "Mosaic Component Development Kit",
"main": "./bundles/cdk.umd.js",
"module": "./esm5/cdk.es5.js",
"es2015": "./esm2015/cdk.js",
"typings": "./cdk.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/positive-js/mosaic.git"
},
"keywords": [
"cdk",
"component",
"development",
"kit"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/positive-js/mosaic/issues"
},
"homepage": "https://github.com/positive-js/mosaic#readme",
"peerDependencies": {
"@angular/core": "0.0.0-NG",
"@angular/common": "0.0.0-NG"
},
"dependencies": {
"tslib": "^1.7.1"
}
"name": "@ptsecurity/cdk",
"version": "0.0.0-PLACEHOLDER",
"description": "Mosaic Component Development Kit",
"main": "./bundles/cdk.umd.js",
"module": "./esm5/cdk.es5.js",
"es2015": "./esm2015/cdk.js",
"typings": "./cdk.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/positive-js/mosaic.git"
},
"keywords": [
"cdk",
"component",
"development",
"kit"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/positive-js/mosaic/issues"
},
"homepage": "https://github.com/positive-js/mosaic#readme",
"peerDependencies": {
"@angular/core": "0.0.0-NG",
"@angular/common": "0.0.0-NG"
},
"dependencies": {
"tslib": "^1.7.1"
},
"sideEffects": false
}
2 changes: 1 addition & 1 deletion src/cdk/style-manager/style-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Injectable } from '@angular/core';
* Class for managing stylesheets. Stylesheets are loaded into named slots so that they can be
* removed or changed later.
*/
@Injectable()
@Injectable({providedIn: 'root'})
export class StyleManager {
/**
* Set the stylesheet with the specified key.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icon/icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ChangeDetectionStrategy,
Component,
Directive,
ElementRef, Input,
ElementRef,
ViewEncapsulation
} from '@angular/core';

Expand Down
13 changes: 11 additions & 2 deletions src/lib/list/list-selection.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,17 @@ export class McListSelection extends _McListSelectionMixinBase implements
// непонятна целесообразность сего
// Sync external changes to the model back to the options.
this._modelChanges = this.selectedOptions.onChange!.subscribe((event) => {
event.added.forEach((item) => { item.selected = true; });
event.removed.forEach((item) => { item.selected = false; });
if (event.added) {
for (const item of event.added) {
item.selected = true;
}
}

if (event.removed) {
for (const item of event.removed) {
item.selected = false;
}
}
});

this.updateScrollSize();
Expand Down
1 change: 1 addition & 0 deletions tools/packages/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './build-config';
export * from './build-bundles';
export * from './build-release';
export * from './build-package';
export * from './copy-files';

Expand Down
48 changes: 29 additions & 19 deletions tools/packages/rollup-globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,55 @@ import { buildConfig } from './build-config';
import { getSubdirectoryNames } from './secondary-entry-points';
import { dashCaseToCamelCase } from './utils';


/** Generates rollup entry point mappings for the given package and entry points. */
function generateRollupEntryPoints(packageName: string, entryPoints: string[]):
{[k: string]: string} {
return entryPoints.reduce((globals: {[k: string]: string}, entryPoint: string) => {
globals[`@ptsecurity/${packageName}/${entryPoint}`] =
`ng.${dashCaseToCamelCase(packageName)}.${dashCaseToCamelCase(entryPoint)}`;

return globals;
}, {});
}

/** 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[`@ptsecurity/cdk/${entryPoint}`] = `ng.cdk.${dashCaseToCamelCase(entryPoint)}`;

return globals;
}, {});

/** List of potential secondary entry-points for the package. */
const mcSecondaryEntryPoints = getSubdirectoryNames(join(buildConfig.packagesDir, 'lib'));

const rollupMcEntryPoints = mcSecondaryEntryPoints.reduce((globals: any, entryPoint: string) => {
globals[`@ptsecurity/mosaic/${entryPoint}`] = `ng.mosaic.${dashCaseToCamelCase(entryPoint)}`;

return globals;
}, {});
/** Object with all cdk entry points in the format of Rollup globals. */
const rollupCdkEntryPoints = generateRollupEntryPoints('cdk', cdkSecondaryEntryPoints);

/** Object with all mosaic entry points in the format of Rollup globals. */
const rollupMcEntryPoints = generateRollupEntryPoints('mosaic', mcSecondaryEntryPoints);


/** Map of globals that are used inside of the different packages. */
export const rollupGlobals = {
tslib: 'tslib',
'tslib': 'tslib',

'@angular/animations': 'ng.animations',
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/forms': 'ng.forms',
'@angular/common/http': 'ng.common.http',
'@angular/router': 'ng.router',
'@angular/common/http/testing': 'ng.common.http.testing',
'@angular/common/testing': 'ng.common.testing',
'@angular/core': 'ng.core',
'@angular/core/testing': 'ng.core.testing',
'@angular/forms': 'ng.forms',
'@angular/platform-browser': 'ng.platformBrowser',
'@angular/platform-server': 'ng.platformServer',
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
'@angular/platform-browser-dynamic/testing': 'ng.platformBrowserDynamic.testing',
'@angular/platform-browser/animations': 'ng.platformBrowser.animations',
'@angular/core/testing': 'ng.core.testing',
'@angular/common/testing': 'ng.common.testing',
'@angular/common/http/testing': 'ng.common.http.testing',
'@angular/platform-server': 'ng.platformServer',
'@angular/router': 'ng.router',

'@ptsecurity/mosaic': 'ng.mosaic',
'@ptsecurity/cdk': 'ng.cdk',
'@ptsecurity/mosaic': 'ng.mosaic',
'@ptsecurity/mosaic-examples': 'ng.mosaicExamples',

...rollupCdkEntryPoints,
...rollupMcEntryPoints,
Expand Down

0 comments on commit 0b6a135

Please sign in to comment.