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

Commit

Permalink
refactor(): use strict, consolidate material.core, interimElement cha…
Browse files Browse the repository at this point in the history
…ining

Closes #643. Closes #650. Closes #597. Closes #596. Closes #525.
  • Loading branch information
rschmukler authored and ajoslin committed Nov 15, 2014
1 parent de3ff4b commit 12b8cbc
Show file tree
Hide file tree
Showing 90 changed files with 2,583 additions and 2,409 deletions.
2 changes: 0 additions & 2 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ module.exports = function(config) {
// globbing.
'src/components/*/*.js',
'src/components/tabs/js/*.js',
'src/services/*.js',
'src/services/*/*.js',
],

port: 9876,
Expand Down
15 changes: 13 additions & 2 deletions config/test-utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var TestUtil = {
/**
/**
* Mocks angular.element#focus for the duration of the test
* @example
* it('some focus test', inject(function($document) {
Expand Down Expand Up @@ -46,7 +46,7 @@ beforeEach(function() {
// toHaveClass matcher from angularjs test helpers
toHaveClass: function(clazz) {
this.message = function() {
return "Expected '" + angular.mock.dump(this.actual) +
return "Expected '" + angular.mock.dump(this.actual) +
(this.isNot ? ' not' : '') + " to have class '" + clazz + "'.";
};
var classes = clazz.trim().split(/\s+/);
Expand All @@ -56,6 +56,17 @@ beforeEach(function() {
}
}
return true;
},
/**
* A helper to match the type of a given value
* @example expect(1).toBeOfType('number')
*/
toBeOfType: function(type) {
this.message = function() {
return "Expected " + angular.mock.dump(this.actual) + " of type " +
(typeof this.actual) + (this.isNot ? ' not ' : '') + " to have type '" + type + "'.";
};
return typeof this.actual == type;
}
});

Expand Down
2 changes: 1 addition & 1 deletion docs/config/template/index.template.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html ng-app="docsApp" ng-controller="DocsCtrl" lang="en">
<html ng-app="docsApp" ng-controller="DocsCtrl" lang="en" ng-strict-di>
<head>
<title ng-bind="(menu.currentSection.name || 'Material Design') + (menu.currentPage ? (' > ' + (menu.currentPage | humanizeDoc)) : '')">Material Design</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1" />
Expand Down
38 changes: 17 additions & 21 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var insert = require('gulp-insert');
var jshint = require('gulp-jshint');
var lazypipe = require('lazypipe');
var minifyCss = require('gulp-minify-css');
var ngAnnotate = require('gulp-ng-annotate');
var rename = require('gulp-rename');
var sass = require('gulp-sass');
var through2 = require('through2');
Expand All @@ -40,7 +41,7 @@ var config = {
' * @license MIT\n' +
' * v' + pkg.version + '\n' +
' */\n',
jsBaseFiles: ['src/core/core.js', 'src/core/util/*.js'],
jsBaseFiles: ['src/core/**/*.js', '!src/core/**/*.spec.js'],
themeBaseFiles: ['src/core/style/color-palette.scss', 'src/core/style/variables.scss', 'src/core/style/mixins.scss'],
scssBaseFiles: ['src/core/style/color-palette.scss', 'src/core/style/variables.scss', 'src/core/style/mixins.scss', 'src/core/style/{structure,layout}.scss'],
paths: 'src/{components,services}/**',
Expand Down Expand Up @@ -204,9 +205,8 @@ function buildTheme(theme) {

gulp.task('build-scss', ['build-default-theme'], function() {
var defaultThemeContents = fs.readFileSync('themes/_default-theme.scss');


var scssGlob = path.join(config.paths, '*.scss');

gutil.log("Building css files...");
return gulp.src(config.scssBaseFiles.concat(scssGlob))
.pipe(filterNonCodeFiles())
Expand Down Expand Up @@ -234,6 +234,7 @@ gulp.task('build-js', function() {
.pipe(insert.wrap('(function() {\n', '})();\n'))
.pipe(concat('angular-material.js'))
.pipe(insert.prepend(config.banner))
.pipe(ngAnnotate())
.pipe(gulp.dest(config.outputDir))
.pipe(gulpif(IS_RELEASE_BUILD, lazypipe()
.pipe(uglify)
Expand Down Expand Up @@ -299,36 +300,31 @@ function buildModuleStyles(name) {
return fs.readFileSync(fileName, 'utf8').toString();
}).join('\n');
return lazypipe()
.pipe(insert.prepend, baseStyles)
.pipe(gulpif, /theme.scss/,
rename(name + '-default-theme.scss'), concat(name + '.scss')
)
.pipe(sass)
.pipe(autoprefix)
.pipe(gulpif, IS_RELEASE_BUILD, minifyCss())
(); // invoke the returning fn to create our pipe
.pipe(insert.prepend, baseStyles)
.pipe(gulpif, /theme.scss/,
rename(name + '-default-theme.scss'), concat(name + '.scss')
)
.pipe(sass)
.pipe(autoprefix)
.pipe(gulpif, IS_RELEASE_BUILD, minifyCss())
(); // invoke the returning fn to create our pipe
}

function buildModuleJs(name) {
return lazypipe()
.pipe(insert.wrap, '(function() {\n', '})();\n')
.pipe(concat, name + '.js')
.pipe(gulpif, IS_RELEASE_BUILD, uglify({preserveComments: 'some'}))
();
.pipe(ngAnnotate())
.pipe(concat, name + '.js')
.pipe(gulpif, IS_RELEASE_BUILD, uglify({preserveComments: 'some'}))
();
}


/**
* Preconfigured gulp plugin invocations
*/

function filterNonCodeFiles() {
return filter(function(file) {
if (/demo/.test(file.path)) return false;
if (/README/.test(file.path)) return false;
if (/module\.json/.test(file.path)) return false;
if (/\.spec\.js/.test(file.path)) return false;
return true;
return !/demo|module\.json|\.spec.js|README/.test(file.path);
});
}

Expand Down
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,26 @@
"url": "git://github.com/angular/material.git"
},
"devDependencies": {
"batch": "^0.5.1",
"canonical-path": "0.0.2",
"conventional-changelog": "0.0.9",
"dgeni": "^0.4.1",
"dgeni-packages": "^0.10.3",
"esprima": "^1.2.2",
"event-stream": "^3.1.5",
"glob": "~4.0.2",
"gulp": "^3.6.2",
"gulp-autoprefixer": "^1.0.1",
"gulp-concat": "^2.2.0",
"gulp-filter": "^1.0.2",
"gulp-footer": "^1.0.4",
"gulp-header": "^1.0.2",
"gulp-if": "^1.2.0",
"gulp-insert": "^0.4.0",
"gulp-jshint": "^1.5.5",
"gulp-minify-css": "^0.3.4",
"gulp-minify-html": "^0.1.6",
"gulp-ng-annotate": "^0.3.4",
"gulp-ng-html2js": "^0.1.8",
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.3.0",
"gulp-sass": "ajoslin/gulp-sass#master",
"gulp-strip-debug": "^0.3.0",
"gulp-uglify": "^0.3.0",
"gulp-uncss": "^0.4.5",
"gulp-util": "^3.0.1",
"gulp-webserver": "^0.8.3",
"jshint-summary": "^0.3.0",
Expand Down
50 changes: 0 additions & 50 deletions src/components/animate/_effects.scss

This file was deleted.

115 changes: 0 additions & 115 deletions src/components/animate/effects.js

This file was deleted.

46 changes: 0 additions & 46 deletions src/components/animate/noEffect.js

This file was deleted.

Loading

0 comments on commit 12b8cbc

Please sign in to comment.