You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 30, 2021. It is now read-only.
@@ -131,7 +131,7 @@ module.exports = class extends Generator {
131
131
type: "input",
132
132
name: "version",
133
133
message:
134
-
"Great! We will import the latest version of your file from the npm package, if you don't want this, enter the version.",
134
+
"Great! I will import the latest version of your file from the npm package, if you don't want this, enter the version.",
135
135
default: "latest",
136
136
when: function(responses){
137
137
if(responses.confirmPackageName){
@@ -144,31 +144,15 @@ module.exports = class extends Generator {
144
144
},
145
145
{
146
146
type: "input",
147
-
name: "importBuildFileFromNPM",
148
-
message: function(answers){
149
-
return(
150
-
"This URL - "+
151
-
chalk.bold.yellow(
152
-
"https://www.jsdelivr.com/package/npm/"+
153
-
answers.packageName+
154
-
"?version="+
155
-
answers.version
156
-
)+
157
-
" contains the directory of the package, please find the build file (generally in the dist or build folder) and paste the link here, we will download it for you."
158
-
);
159
-
},
160
-
when: function(responses){
161
-
if(responses.confirmPackageName){
162
-
returntrue;// Show this prompt if user says that package description is correct
163
-
}
164
-
165
-
returnfalse;// Don't show this prompt if user says that package description is incorrect
166
-
},
167
-
validate: validators.importBuildFileFromNPM
147
+
name: "directoryName",
148
+
message:
149
+
"The build file will be imported in a separate directory in the project's root. Enter the name of this directory or press Enter if you like to go with default.",
150
+
validate: validators.directoryName,
151
+
default: "component-dist"
168
152
},
169
153
{
170
154
type: "input",
171
-
name: "copyBuildFileFromNPM",
155
+
name: "importBuildFileFromNPM",
172
156
message: function(answers){
173
157
return(
174
158
"This URL - "+
@@ -178,41 +162,36 @@ module.exports = class extends Generator {
178
162
"?version="+
179
163
answers.version
180
164
)+
181
-
" contains the directory of the package, please find the build file (generally in the dist or build folder) and paste the link here, we will download it for you in the existing folder."
165
+
" contains the directory of the package, please find the build file (generally in the dist or build folder) and paste the link here, I will download it for you."
182
166
);
183
167
},
184
168
when: function(responses){
185
-
if(responses.importBuildFileFromNPM==="skip"){
169
+
if(responses.confirmPackageName){
186
170
returntrue;// Show this prompt if user says that package description is correct
187
171
}
188
172
189
173
returnfalse;// Don't show this prompt if user says that package description is incorrect
190
174
},
191
-
validate: validators.copyBuildFileFromNPM
175
+
validate: validators.importBuildFileFromNPM
192
176
}
193
177
];
194
178
195
179
// Prompt(s) if user chooses to import files locally from computer
196
180
constlocalPrompts=[
197
181
{
198
182
type: "input",
199
-
name: "importBuildFileLocally",
200
-
message: "Please enter the path of the build file.",
201
-
validate: validators.importBuildFileLocally
183
+
name: "directoryName",
184
+
message: `The build file will be imported in a separate directory in the project's root. Enter the name of this directory or press Enter if you like to go with default ${chalk.cyan(
185
+
"component-dist"
186
+
)}.`,
187
+
validate: validators.directoryName,
188
+
default: "component-dist"
202
189
},
203
190
{
204
191
type: "input",
205
-
name: "copyBuildFileLocally",
206
-
message:
207
-
"Please enter the path of the build file, we will paste it into the existing directory.",
208
-
when: function(responses){
209
-
if(responses.importBuildFileLocally==="skip"){
210
-
returntrue;// Show this prompt if user says that package description is correct
211
-
}
212
-
213
-
returnfalse;// Don't show this prompt if user says that package description is incorrect
214
-
},
215
-
validate: validators.copyBuildFileLocally
192
+
name: "importBuildFileLocally",
193
+
message: "Please enter the path of the build file.",
194
+
validate: validators.importBuildFileLocally
216
195
}
217
196
];
218
197
@@ -466,7 +445,7 @@ module.exports = class extends Generator {
466
445
yarn: false
467
446
});
468
447
this.log(
469
-
`While we install the dependencies, you can read the next steps - \n1. Write the code for your component, instructions are in ${chalk.yellow(
448
+
`While I install the dependencies, you can read the next steps - \n1. Write the code for your component, instructions are in ${chalk.yellow(
470
449
"src/index.js"
471
450
)}.\n2. Add css styles to your component in ${chalk.yellow(
0 commit comments