Skip to content

Commit fda5617

Browse files
committed
fix: remove circular deps and ci check (#608)
1 parent 8ccc49b commit fda5617

File tree

21 files changed

+76
-50
lines changed

21 files changed

+76
-50
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ env:
3636
matrix:
3737
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
3838
- MODE=lint
39+
- MODE=circular_deps
3940
- MODE=e2e
4041
- MODE=saucelabs_required
4142
- MODE=browserstack_required

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
"url": "https://github.com/angular/material2.git"
99
},
1010
"scripts": {
11-
"ci:forbidden-identifiers": "node ./scripts/ci/forbidden-identifiers.js",
11+
"ci:forbidden-identifiers": "node ./scripts/ci/forbidden-identifiers.js",
1212
"build": "ng build",
1313
"demo-app": "ng serve",
1414
"test": "karma start test/karma.conf.js",
1515
"tslint": "tslint -c tslint.json 'src/**/*.ts'",
1616
"stylelint": "stylelint 'src/**/*.scss' --config stylelint-config.json --syntax scss",
17+
"check-circular-deps": "madge --circular ./dist",
1718
"typings": "typings install --ambient",
1819
"postinstall": "npm run typings",
1920
"e2e": "protractor",
@@ -60,13 +61,14 @@
6061
"karma-firefox-launcher": "^0.1.7",
6162
"karma-jasmine": "^0.3.8",
6263
"karma-sauce-launcher": "^0.2.14",
64+
"madge": "^0.5.3",
6365
"node-sass": "^3.4.2",
6466
"protractor": "^3.3.0",
6567
"protractor-accessibility-plugin": "0.1.1",
6668
"sass": "^0.5.0",
6769
"strip-ansi": "^3.0.0",
68-
"symlink-or-copy": "^1.0.1",
6970
"stylelint": "^6.5.1",
71+
"symlink-or-copy": "^1.0.1",
7072
"ts-node": "^0.7.3",
7173
"tslint": "^3.5.0",
7274
"typescript": "^1.9.0-dev",

scripts/ci/build-and-test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ wait_for_tunnel
1818
if is_lint; then
1919
npm run tslint
2020
npm run ci:forbidden-identifiers
21-
npm run stylelint
21+
npm run stylelint
22+
elif is_circular_deps_check; then
23+
npm run check-circular-deps
2224
elif is_e2e; then
2325
MD_APP=e2e ng serve &
2426
sleep 20

scripts/ci/sources/mode.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ is_e2e() {
88
is_lint() {
99
[[ "$MODE" = lint ]]
1010
}
11+
12+
is_circular_deps_check() {
13+
[[ "$MODE" = circular_deps ]]
14+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
/**
3+
* Converts values into strings. Falsy values become empty strings.
4+
* @internal
5+
*/
6+
export function coerceToString(value: string | number): string {
7+
return `${value || ''}`;
8+
}
9+
10+
/**
11+
* Converts a value that might be a string into a number.
12+
* @internal
13+
*/
14+
export function coerceToNumber(value: string | number): number {
15+
return typeof value === 'string' ? parseInt(value, 10) : value;
16+
}

src/components/grid-list/grid-list.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
import {MdGridListColsError} from './grid-list-errors';
2222
import {Dir} from '@angular2-material/core/rtl/dir';
2323
import {MdLine} from '@angular2-material/core/line/line';
24+
import {coerceToString, coerceToNumber} from './grid-list-measure';
2425

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

155-
/**
156-
* Converts values into strings. Falsy values become empty strings.
157-
* @internal
158-
*/
159-
export function coerceToString(value: string | number): string {
160-
return `${value || ''}`;
161-
}
162-
163-
/**
164-
* Converts a value that might be a string into a number.
165-
* @internal
166-
*/
167-
export function coerceToNumber(value: string | number): number {
168-
return typeof value === 'string' ? parseInt(value, 10) : value;
169-
}
170156

171157
export const MD_GRID_LIST_DIRECTIVES: any[] = [MdGridList, MdGridTile, MdLine, MdGridTileText];

src/components/grid-list/grid-tile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
QueryList,
99
AfterContentInit
1010
} from '@angular/core';
11-
import { coerceToNumber } from './grid-list';
1211
import { MdLine, MdLineSetter } from '@angular2-material/core/line/line';
12+
import {coerceToNumber} from './grid-list-measure';
1313

1414
@Component({
1515
moduleId: module.id,
File renamed without changes.

0 commit comments

Comments
 (0)