Skip to content

Commit ee8bbe8

Browse files
committed
Use the same syntax as regex character classes when providing feedback
1 parent 48057db commit ee8bbe8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/generator-widget/generators/app/lib/prompttexts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function promptWidgetProperties(mxProjectDir, widgetName) {
99
if (/^([a-zA-Z]+)$/.test(input)) {
1010
return true;
1111
}
12-
return "Your widget name can only contain one or more letters (a-z & A-Z). Please provide a valid name";
12+
return "Your widget name may only contain characters matching [a-zA-Z]. Please provide a valid name.";
1313
},
1414
message: "What is the name of your widget?",
1515
default: widgetName ? widgetName : "MyWidget"
@@ -25,10 +25,10 @@ function promptWidgetProperties(mxProjectDir, widgetName) {
2525
name: "organization",
2626
validate: input => {
2727
if (/[^a-zA-Z0-9_.-]/.test(input)) {
28-
return "Your organization name can only contain alphanumeric characters, '_', '-', and '.'. Please provide a valid name";
28+
return "Your organization name may only contain characters matching [a-zA-Z0-9_.-]. Please provide a valid name.";
2929
}
3030
if (!/^([a-zA-Z0-9_-]+.)*[a-zA-Z0-9_-]+$/.test(input)) {
31-
return "Your organization name must follow the structure [namespace.]org-name, for example 'mendix' or 'com.mendix.widgets'. Please provide a valid name";
31+
return "Your organization name must follow the structure (namespace.)org-name, for example 'mendix' or 'com.mendix.widgets'. Please provide a valid name.";
3232
}
3333
return true;
3434
},

0 commit comments

Comments
 (0)