Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build Tools] Update RegExps in packaging for npm. #2816

Merged
merged 1 commit into from
Aug 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
};
};