Skip to content

Commit

Permalink
fix(build): buildNgMaterialDefinition RegExp updated
Browse files Browse the repository at this point in the history
update buildNgMaterialDefinition() regExp to search for module definitions of 'material.*'.

excludes any extraneous, demo-related module definitions.
use `material.layout` to match `material.animate`

Fixes angular#4305.
  • Loading branch information
ThomasBurleson authored and kennethcachia committed Sep 23, 2015
1 parent 154c28a commit 60a10b5
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/ngModuleData.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Regex adapted from https://github.com/ceymard/gulp-ngcompile

module.exports = function processContent(fileContent) {
var NG_MODULE_REGEX = /\.module\(('[^']*'|"[^"]*")\s*,(?:\s*\[([^\]]+)\])?/g;
var NG_MODULE_REGEX = /\.module\((['|"]\material\..*'|"[^"]*")\s*,?\s*\[(([^\]]+)\])?/g;
var match = NG_MODULE_REGEX.exec(fileContent || '');
var module = match && match[1] && match[1].slice(1, -1); //remove quotes
var depsMatch = match && match[2] && match[2].trim();
Expand Down
2 changes: 1 addition & 1 deletion gulp/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function readModuleArg() {

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

Expand Down
6 changes: 0 additions & 6 deletions src/components/icon/js/iconDirective.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/**
* @ngdoc directive
* @name material.components.icon
* @description
* Icon
*/
angular
.module('material.components.icon')
.directive('mdIcon', ['$mdIcon', '$mdTheming', '$mdAria', mdIconDirective]);
Expand Down
2 changes: 1 addition & 1 deletion src/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ angular
.module('material.core', [
'ngAnimate',
'material.animate',
'material.layout',
'material.core.gestures',
'material.core.layout',
'material.core.theming'
])
.directive('mdTemplate', MdTemplateDirective)
Expand Down
2 changes: 1 addition & 1 deletion src/core/services/layout/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* }
* ```
*/
angular.module('material.core.layout', [ ])
angular.module('material.layout', [ ])

// Attribute directives with optional value(s)

Expand Down
2 changes: 1 addition & 1 deletion src/core/services/layout/layout.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('layout directives', function() {

beforeEach(module('material.core'));
beforeEach(module('material.core', 'material.layout'));

describe('expecting layout classes', function() {

Expand Down

0 comments on commit 60a10b5

Please sign in to comment.