Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 12b8cbc

Browse files
rschmuklerajoslin
authored andcommitted
refactor(): use strict, consolidate material.core, interimElement chaining
Closes #643. Closes #650. Closes #597. Closes #596. Closes #525.
1 parent de3ff4b commit 12b8cbc

File tree

90 files changed

+2583
-2409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2583
-2409
lines changed

config/karma.conf.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ module.exports = function(config) {
1818
// globbing.
1919
'src/components/*/*.js',
2020
'src/components/tabs/js/*.js',
21-
'src/services/*.js',
22-
'src/services/*/*.js',
2321
],
2422

2523
port: 9876,

config/test-utils.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var TestUtil = {
2-
/**
2+
/**
33
* Mocks angular.element#focus for the duration of the test
44
* @example
55
* it('some focus test', inject(function($document) {
@@ -46,7 +46,7 @@ beforeEach(function() {
4646
// toHaveClass matcher from angularjs test helpers
4747
toHaveClass: function(clazz) {
4848
this.message = function() {
49-
return "Expected '" + angular.mock.dump(this.actual) +
49+
return "Expected '" + angular.mock.dump(this.actual) +
5050
(this.isNot ? ' not' : '') + " to have class '" + clazz + "'.";
5151
};
5252
var classes = clazz.trim().split(/\s+/);
@@ -56,6 +56,17 @@ beforeEach(function() {
5656
}
5757
}
5858
return true;
59+
},
60+
/**
61+
* A helper to match the type of a given value
62+
* @example expect(1).toBeOfType('number')
63+
*/
64+
toBeOfType: function(type) {
65+
this.message = function() {
66+
return "Expected " + angular.mock.dump(this.actual) + " of type " +
67+
(typeof this.actual) + (this.isNot ? ' not ' : '') + " to have type '" + type + "'.";
68+
};
69+
return typeof this.actual == type;
5970
}
6071
});
6172

docs/config/template/index.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<html ng-app="docsApp" ng-controller="DocsCtrl" lang="en">
2+
<html ng-app="docsApp" ng-controller="DocsCtrl" lang="en" ng-strict-di>
33
<head>
44
<title ng-bind="(menu.currentSection.name || 'Material Design') + (menu.currentPage ? (' > ' + (menu.currentPage | humanizeDoc)) : '')">Material Design</title>
55
<meta name="viewport" content="initial-scale=1, maximum-scale=1" />

gulpfile.js

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var insert = require('gulp-insert');
2121
var jshint = require('gulp-jshint');
2222
var lazypipe = require('lazypipe');
2323
var minifyCss = require('gulp-minify-css');
24+
var ngAnnotate = require('gulp-ng-annotate');
2425
var rename = require('gulp-rename');
2526
var sass = require('gulp-sass');
2627
var through2 = require('through2');
@@ -40,7 +41,7 @@ var config = {
4041
' * @license MIT\n' +
4142
' * v' + pkg.version + '\n' +
4243
' */\n',
43-
jsBaseFiles: ['src/core/core.js', 'src/core/util/*.js'],
44+
jsBaseFiles: ['src/core/**/*.js', '!src/core/**/*.spec.js'],
4445
themeBaseFiles: ['src/core/style/color-palette.scss', 'src/core/style/variables.scss', 'src/core/style/mixins.scss'],
4546
scssBaseFiles: ['src/core/style/color-palette.scss', 'src/core/style/variables.scss', 'src/core/style/mixins.scss', 'src/core/style/{structure,layout}.scss'],
4647
paths: 'src/{components,services}/**',
@@ -204,9 +205,8 @@ function buildTheme(theme) {
204205

205206
gulp.task('build-scss', ['build-default-theme'], function() {
206207
var defaultThemeContents = fs.readFileSync('themes/_default-theme.scss');
207-
208-
209208
var scssGlob = path.join(config.paths, '*.scss');
209+
210210
gutil.log("Building css files...");
211211
return gulp.src(config.scssBaseFiles.concat(scssGlob))
212212
.pipe(filterNonCodeFiles())
@@ -234,6 +234,7 @@ gulp.task('build-js', function() {
234234
.pipe(insert.wrap('(function() {\n', '})();\n'))
235235
.pipe(concat('angular-material.js'))
236236
.pipe(insert.prepend(config.banner))
237+
.pipe(ngAnnotate())
237238
.pipe(gulp.dest(config.outputDir))
238239
.pipe(gulpif(IS_RELEASE_BUILD, lazypipe()
239240
.pipe(uglify)
@@ -299,36 +300,31 @@ function buildModuleStyles(name) {
299300
return fs.readFileSync(fileName, 'utf8').toString();
300301
}).join('\n');
301302
return lazypipe()
302-
.pipe(insert.prepend, baseStyles)
303-
.pipe(gulpif, /theme.scss/,
304-
rename(name + '-default-theme.scss'), concat(name + '.scss')
305-
)
306-
.pipe(sass)
307-
.pipe(autoprefix)
308-
.pipe(gulpif, IS_RELEASE_BUILD, minifyCss())
309-
(); // invoke the returning fn to create our pipe
303+
.pipe(insert.prepend, baseStyles)
304+
.pipe(gulpif, /theme.scss/,
305+
rename(name + '-default-theme.scss'), concat(name + '.scss')
306+
)
307+
.pipe(sass)
308+
.pipe(autoprefix)
309+
.pipe(gulpif, IS_RELEASE_BUILD, minifyCss())
310+
(); // invoke the returning fn to create our pipe
310311
}
311312

312313
function buildModuleJs(name) {
313314
return lazypipe()
314-
.pipe(insert.wrap, '(function() {\n', '})();\n')
315-
.pipe(concat, name + '.js')
316-
.pipe(gulpif, IS_RELEASE_BUILD, uglify({preserveComments: 'some'}))
317-
();
315+
.pipe(ngAnnotate())
316+
.pipe(concat, name + '.js')
317+
.pipe(gulpif, IS_RELEASE_BUILD, uglify({preserveComments: 'some'}))
318+
();
318319
}
319320

320321

321322
/**
322323
* Preconfigured gulp plugin invocations
323324
*/
324-
325325
function filterNonCodeFiles() {
326326
return filter(function(file) {
327-
if (/demo/.test(file.path)) return false;
328-
if (/README/.test(file.path)) return false;
329-
if (/module\.json/.test(file.path)) return false;
330-
if (/\.spec\.js/.test(file.path)) return false;
331-
return true;
327+
return !/demo|module\.json|\.spec.js|README/.test(file.path);
332328
});
333329
}
334330

package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,26 @@
55
"url": "git://github.com/angular/material.git"
66
},
77
"devDependencies": {
8-
"batch": "^0.5.1",
98
"canonical-path": "0.0.2",
109
"conventional-changelog": "0.0.9",
1110
"dgeni": "^0.4.1",
1211
"dgeni-packages": "^0.10.3",
1312
"esprima": "^1.2.2",
14-
"event-stream": "^3.1.5",
1513
"glob": "~4.0.2",
1614
"gulp": "^3.6.2",
1715
"gulp-autoprefixer": "^1.0.1",
1816
"gulp-concat": "^2.2.0",
1917
"gulp-filter": "^1.0.2",
20-
"gulp-footer": "^1.0.4",
21-
"gulp-header": "^1.0.2",
2218
"gulp-if": "^1.2.0",
2319
"gulp-insert": "^0.4.0",
2420
"gulp-jshint": "^1.5.5",
2521
"gulp-minify-css": "^0.3.4",
26-
"gulp-minify-html": "^0.1.6",
22+
"gulp-ng-annotate": "^0.3.4",
2723
"gulp-ng-html2js": "^0.1.8",
2824
"gulp-rename": "^1.2.0",
2925
"gulp-replace": "^0.3.0",
3026
"gulp-sass": "ajoslin/gulp-sass#master",
31-
"gulp-strip-debug": "^0.3.0",
3227
"gulp-uglify": "^0.3.0",
33-
"gulp-uncss": "^0.4.5",
3428
"gulp-util": "^3.0.1",
3529
"gulp-webserver": "^0.8.3",
3630
"jshint-summary": "^0.3.0",

src/components/animate/_effects.scss

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/components/animate/effects.js

Lines changed: 0 additions & 115 deletions
This file was deleted.

src/components/animate/noEffect.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)