Skip to content

Commit

Permalink
Update RegExps in packaging for npm.
Browse files Browse the repository at this point in the history
Fixes npm packaging for components api, site (#1878) and transition.
  • Loading branch information
davide committed Aug 9, 2015
1 parent adc674d commit 3698a35
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tasks/admin/components/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ module.exports = function(callback) {
unrelatedNotes : new RegExp('^((?!(^.*(' + component + ').*$|###.*)).)*$', 'gmi'),
whitespace : /\n\s*\n\s*\n/gm,
// npm
export : /\$\.fn\.\w+\s*=\s*function\(parameters\)\s*{/g,
formExport : /\$\.fn\.\w+\s*=\s*function\(fields, parameters\)\s*{/g,
componentExport : /(.*)\$\.fn\.\w+\s*=\s*function\(([^\)]*)\)\s*{/g,
componentReference: '$.fn.' + component,
settingsExport : /\$\.fn\.\w+\.settings\s*=/g,
settingsReference : /\$\.fn\.\w+\.settings/g,
trailingComma : /,(?=[^,]*$)/,
Expand All @@ -111,8 +111,8 @@ module.exports = function(callback) {
unrelatedNotes : '',
whitespace : '\n\n',
// npm
export : 'var _module = module;\nmodule.exports = function(parameters) {',
formExport : 'var _module = module;\nmodule.exports = function(fields, parameters) {',
componentExport : 'var _module = module;\n$1module.exports = function($2) {',
componentReference: '_module.exports',
settingsExport : 'module.exports.settings =',
settingsReference : '_module.exports.settings',
jQuery : 'require("jquery")'
Expand Down Expand Up @@ -151,8 +151,8 @@ module.exports = function(callback) {
return gulp.src(release.source + component + '!(*.min|*.map).js')
.pipe(plumber())
.pipe(flatten())
.pipe(replace(regExp.match.export, regExp.replace.export))
.pipe(replace(regExp.match.formExport, regExp.replace.formExport))
.pipe(replace(regExp.match.componentExport, regExp.replace.componentExport))
.pipe(replace(regExp.match.componentReference, regExp.replace.componentReference))
.pipe(replace(regExp.match.settingsExport, regExp.replace.settingsExport))
.pipe(replace(regExp.match.settingsReference, regExp.replace.settingsReference))
.pipe(replace(regExp.match.jQuery, regExp.replace.jQuery))
Expand Down Expand Up @@ -329,4 +329,4 @@ module.exports = function(callback) {
}

runSequence(tasks, callback);
};
};

0 comments on commit 3698a35

Please sign in to comment.