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){
@@ -142,6 +142,14 @@ module.exports = class extends Generator {
142
142
},
143
143
validate: validators.version
144
144
},
145
+
{
146
+
type: "input",
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"
152
+
},
145
153
{
146
154
type: "input",
147
155
name: "importBuildFileFromNPM",
@@ -154,7 +162,7 @@ module.exports = class extends Generator {
154
162
"?version="+
155
163
answers.version
156
164
)+
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."
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."
158
166
);
159
167
},
160
168
when: function(responses){
@@ -165,154 +173,25 @@ module.exports = class extends Generator {
165
173
returnfalse;// Don't show this prompt if user says that package description is incorrect
166
174
},
167
175
validate: validators.importBuildFileFromNPM
168
-
},
169
-
{
170
-
type: "list",
171
-
name: "renameOrOverwriteNpm",
172
-
message: "What do you want to do?",
173
-
choices: [
174
-
"Rename the component-dist directory we are making.",
175
-
"Overwrite the files in the existing component-dist directory."
176
-
],
177
-
when: function(responses){
178
-
if(responses.importBuildFileFromNPM==="skip"){
179
-
returntrue;// Show this prompt if user says that package description is correct
180
-
}
181
-
182
-
returnfalse;// Don't show this prompt if user says that package description is incorrect
183
-
}
184
-
},
185
-
{
186
-
type: "input",
187
-
name: "renameDirectoryNpm",
188
-
message: `Enter the name of the directory in which you want to import the build file, make sure it is not ${chalk.cyan(
189
-
"dist"
190
-
)} or ${chalk.cyan("component-dist")}.`,
191
-
when: function(responses){
192
-
if(
193
-
responses.renameOrOverwriteNpm===
194
-
"Rename the component-dist directory we are making."
195
-
){
196
-
returntrue;
197
-
}
198
-
199
-
returnfalse;
200
-
},
201
-
validate: validators.renameDirectory
202
-
},
203
-
{
204
-
type: "input",
205
-
name: "importBuildFileInRenamedDirectoryNpm",
206
-
message:
207
-
"Great! Now enter the URL of the build file to import it in the renamed directory.",
208
-
when: function(responses){
209
-
if(
210
-
responses.renameOrOverwriteNpm===
211
-
"Rename the component-dist directory we are making."
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"
298
189
},
299
190
{
300
191
type: "input",
301
-
name: "overwriteDirectoryContent",
302
-
message: `Enter the path of the build file. Please note that this will overwrite all the existing content in ${chalk.cyan(
303
-
"component-dist"
304
-
)}.`,
305
-
when: function(responses){
306
-
if(
307
-
responses.renameOrOverwriteLocal===
308
-
"Overwrite the files in the existing component-dist directory."
309
-
){
310
-
returntrue;
311
-
}
312
-
313
-
returnfalse;
314
-
},
315
-
validate: validators.overwriteDirectoryContent
192
+
name: "importBuildFileLocally",
193
+
message: "Please enter the path of the build file.",
194
+
validate: validators.importBuildFileLocally
316
195
}
317
196
];
318
197
@@ -566,7 +445,7 @@ module.exports = class extends Generator {
566
445
yarn: false
567
446
});
568
447
this.log(
569
-
`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(
570
449
"src/index.js"
571
450
)}.\n2. Add css styles to your component in ${chalk.yellow(
0 commit comments