Skip to content

Commit

Permalink
fix: remove circular deps and ci check (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn committed Jun 2, 2016
1 parent 8ccc49b commit fda5617
Show file tree
Hide file tree
Showing 21 changed files with 76 additions and 50 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ env:
matrix:
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
- MODE=lint
- MODE=circular_deps
- MODE=e2e
- MODE=saucelabs_required
- MODE=browserstack_required
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
"url": "https://github.com/angular/material2.git"
},
"scripts": {
"ci:forbidden-identifiers": "node ./scripts/ci/forbidden-identifiers.js",
"ci:forbidden-identifiers": "node ./scripts/ci/forbidden-identifiers.js",
"build": "ng build",
"demo-app": "ng serve",
"test": "karma start test/karma.conf.js",
"tslint": "tslint -c tslint.json 'src/**/*.ts'",
"stylelint": "stylelint 'src/**/*.scss' --config stylelint-config.json --syntax scss",
"check-circular-deps": "madge --circular ./dist",
"typings": "typings install --ambient",
"postinstall": "npm run typings",
"e2e": "protractor",
Expand Down Expand Up @@ -60,13 +61,14 @@
"karma-firefox-launcher": "^0.1.7",
"karma-jasmine": "^0.3.8",
"karma-sauce-launcher": "^0.2.14",
"madge": "^0.5.3",
"node-sass": "^3.4.2",
"protractor": "^3.3.0",
"protractor-accessibility-plugin": "0.1.1",
"sass": "^0.5.0",
"strip-ansi": "^3.0.0",
"symlink-or-copy": "^1.0.1",
"stylelint": "^6.5.1",
"symlink-or-copy": "^1.0.1",
"ts-node": "^0.7.3",
"tslint": "^3.5.0",
"typescript": "^1.9.0-dev",
Expand Down
4 changes: 3 additions & 1 deletion scripts/ci/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ wait_for_tunnel
if is_lint; then
npm run tslint
npm run ci:forbidden-identifiers
npm run stylelint
npm run stylelint
elif is_circular_deps_check; then
npm run check-circular-deps
elif is_e2e; then
MD_APP=e2e ng serve &
sleep 20
Expand Down
4 changes: 4 additions & 0 deletions scripts/ci/sources/mode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ is_e2e() {
is_lint() {
[[ "$MODE" = lint ]]
}

is_circular_deps_check() {
[[ "$MODE" = circular_deps ]]
}
16 changes: 16 additions & 0 deletions src/components/grid-list/grid-list-measure.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

/**
* Converts values into strings. Falsy values become empty strings.
* @internal
*/
export function coerceToString(value: string | number): string {
return `${value || ''}`;
}

/**
* Converts a value that might be a string into a number.
* @internal
*/
export function coerceToNumber(value: string | number): number {
return typeof value === 'string' ? parseInt(value, 10) : value;
}
16 changes: 1 addition & 15 deletions src/components/grid-list/grid-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import {MdGridListColsError} from './grid-list-errors';
import {Dir} from '@angular2-material/core/rtl/dir';
import {MdLine} from '@angular2-material/core/line/line';
import {coerceToString, coerceToNumber} from './grid-list-measure';

// TODO(kara): Conditional (responsive) column count / row size.
// TODO(kara): Re-layout on window resize / media change (debounced).
Expand Down Expand Up @@ -152,20 +153,5 @@ export class MdGridList implements OnInit, AfterContentChecked {
}
}

/**
* Converts values into strings. Falsy values become empty strings.
* @internal
*/
export function coerceToString(value: string | number): string {
return `${value || ''}`;
}

/**
* Converts a value that might be a string into a number.
* @internal
*/
export function coerceToNumber(value: string | number): number {
return typeof value === 'string' ? parseInt(value, 10) : value;
}

export const MD_GRID_LIST_DIRECTIVES: any[] = [MdGridList, MdGridTile, MdLine, MdGridTileText];
2 changes: 1 addition & 1 deletion src/components/grid-list/grid-tile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
QueryList,
AfterContentInit
} from '@angular/core';
import { coerceToNumber } from './grid-list';
import { MdLine, MdLineSetter } from '@angular2-material/core/line/line';
import {coerceToNumber} from './grid-list-measure';

@Component({
moduleId: module.id,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 31 additions & 5 deletions src/core/core.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
// RTL
export * from './rtl/dir';
export {Dir, LayoutDirection} from './rtl/dir';

// Portals
export * from './portal/portal';
export * from './portal/portal-directives';
export {
Portal,
PortalHost,
BasePortalHost,
ComponentPortal,
TemplatePortal
} from './portal/portal';
export {
PortalHostDirective,
TemplatePortalDirective,
PORTAL_DIRECTIVES
} from './portal/portal-directives';
export {DomPortalHost} from './portal/dom-portal-host';

// Overlay
export {Overlay, OVERLAY_CONTAINER_TOKEN, OVERLAY_PROVIDERS} from './overlay/overlay';
export {OverlayRef} from './overlay/overlay-ref';
export {OverlayState} from './overlay/overlay-state';
export {
ConnectedOverlayDirective,
OverlayOrigin,
OVERLAY_DIRECTIVES
} from './overlay/overlay-directives';

// Gestures
export * from './gestures/MdGestureConfig';
export {MdGestureConfig} from './gestures/MdGestureConfig';

export * from './line/line';
// a11y
export {
AriaLivePoliteness,
MdLiveAnnouncer,
LIVE_ANNOUNCER_ELEMENT_TOKEN
} from './a11y/live-announcer';
6 changes: 0 additions & 6 deletions src/core/overlay/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,3 @@ export const OVERLAY_PROVIDERS = [
OverlayPositionBuilder,
Overlay,
];

// Re-export overlay-related modules so they can be imported directly from here.
export {OverlayState} from './overlay-state';
export {OverlayRef} from './overlay-ref';
export {createOverlayContainer} from './overlay-container';
export {OVERLAY_DIRECTIVES, ConnectedOverlayDirective, OverlayOrigin} from './overlay-directives';
4 changes: 0 additions & 4 deletions src/core/portal/portal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,3 @@ export abstract class BasePortalHost implements PortalHost {
this._disposeFn = fn;
}
}


export {PORTAL_DIRECTIVES, TemplatePortalDirective, PortalHostDirective} from './portal-directives';
export {DomPortalHost} from './dom-portal-host';
2 changes: 1 addition & 1 deletion src/demo-app/live-announcer/live-announcer-demo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component} from '@angular/core';
import {MdLiveAnnouncer} from '@angular2-material/core/live-announcer/live-announcer';
import {MdLiveAnnouncer} from '@angular2-material/core/a11y/live-announcer';

@Component({
moduleId: module.id,
Expand Down
2 changes: 1 addition & 1 deletion src/demo-app/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// that are consumed across multiple components (and thus shouldn't be scoped).

@import "core/overlay/overlay";
@import "core/live-announcer/live-announcer";
@import "core/a11y/live-announcer";
2 changes: 1 addition & 1 deletion src/demo-app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {provide} from '@angular/core';
import {Renderer} from '@angular/core';

import {OVERLAY_CONTAINER_TOKEN} from '@angular2-material/core/overlay/overlay';
import {MdLiveAnnouncer} from '@angular2-material/core/live-announcer/live-announcer';
import {MdLiveAnnouncer} from '@angular2-material/core/a11y/live-announcer';
import {createOverlayContainer} from '@angular2-material/core/overlay/overlay-container';
import {MdGestureConfig} from '@angular2-material/core/gestures/MdGestureConfig';
import {MdIconRegistry} from '@angular2-material/icon/icon-registry';
Expand Down
6 changes: 2 additions & 4 deletions src/demo-app/overlay/overlay-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ import {
OverlayState,
OverlayOrigin,
OVERLAY_PROVIDERS,
OVERLAY_DIRECTIVES
} from '@angular2-material/core/overlay/overlay';
import {
OVERLAY_DIRECTIVES,
ComponentPortal,
Portal,
PORTAL_DIRECTIVES,
TemplatePortalDirective
} from '@angular2-material/core/portal/portal';
} from '@angular2-material/core/core';


@Component({
Expand Down
15 changes: 8 additions & 7 deletions src/demo-app/portal/portal-demo.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {Component} from '@angular/core';
import {PortalHostDirective} from '@angular2-material/core/portal/portal-directives';
import {TemplatePortalDirective} from '@angular2-material/core/portal/portal-directives';
import {Portal} from '@angular2-material/core/portal/portal';
import {ViewChildren} from '@angular/core';
import {QueryList} from '@angular/core';
import {ComponentPortal} from '@angular2-material/core/portal/portal';
import {Component, ViewChildren, QueryList} from '@angular/core';
import {
Portal,
ComponentPortal,
TemplatePortalDirective,
PortalHostDirective
} from '@angular2-material/core/core';


@Component({
moduleId: module.id,
Expand Down
2 changes: 1 addition & 1 deletion src/e2e-app/main.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@import "core/overlay/overlay";
@import "core/live-announcer/live-announcer";
@import "core/a11y/live-announcer";
2 changes: 1 addition & 1 deletion src/e2e-app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {provide} from '@angular/core';
import {Renderer} from '@angular/core';

import {OVERLAY_CONTAINER_TOKEN} from '@angular2-material/core/overlay/overlay';
import {MdLiveAnnouncer} from '@angular2-material/core/live-announcer/live-announcer';
import {MdLiveAnnouncer} from '@angular2-material/core/a11y/live-announcer';
import {createOverlayContainer} from '@angular2-material/core/overlay/overlay-container';
import {MdGestureConfig} from '@angular2-material/core/gestures/MdGestureConfig';
import {MdIconRegistry} from '@angular2-material/icon/icon-registry';
Expand Down

0 comments on commit fda5617

Please sign in to comment.