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.
Updated workflow, changed dummy prompts for tests (#17)
* Updated workflow for upgrading old components and making new components, changed dummy prompts in tests
This adds the feature for importing old files if user chooses to upgrade an
old component to a web component by implementing a new workflow. It also changes
the tests to add a new dummy variable.
* Added loader and version check
This adds the loader for asynchronous tasks and checks version
before showing the package directory URL to user. It also updates
package.json to save the dependencies.
" 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."
127
+
);
128
+
},
129
+
when: function(responses){
130
+
if(responses.packageNameConfirm){
131
+
returntrue;// Show this prompt if user says that package description is correct
132
+
}
133
+
134
+
returnfalse;// Don't show this prompt if user says that package description is incorrect
135
+
},
136
+
validate: asyncfunction(props){
137
+
varres=awaitexecuteCommand(
138
+
"mkdir dist && cd dist && curl -O "+props,
139
+
"downloadURL"
140
+
);// Import the build file in dist directory from npm
141
+
returnres;
142
+
/**
143
+
* Returns true if command execution is successful and proceeds to commonPrompts
144
+
* returns and logs the error if execution fails
145
+
*/
146
+
}
147
+
}
148
+
];
149
+
150
+
// Prompt(s) if user chooses to import files locally from computer
151
+
constlocalPrompts=[
152
+
{
153
+
type: "input",
154
+
name: "pathOfBuildFile",
155
+
message: "Please enter the path of the build file.",
156
+
validate: asyncprops=>{
157
+
varres=executeCommand(
158
+
"mkdir dist && cp "+props+" dist",
159
+
"local"
160
+
);// Import the build file in dist directory locally from computer
161
+
returnres;
162
+
/**
163
+
* Returns true if command execution is successful and proceeds to commonPrompts
164
+
* returns and logs the error if execution fails
165
+
*/
166
+
}
167
+
}
168
+
];
169
+
170
+
// Secondary prompts is user chooses to make a new component and final prompts if user chooses to upgrade an existing component
171
+
constcommonPrompts=[
24
172
{
25
173
type: "input",
26
174
name: "toolNameComputer",
@@ -50,11 +198,83 @@ module.exports = class extends Generator {
50
198
default: "BioJS component"
51
199
}
52
200
];
53
-
returnthis.prompt(prompts).then(props=>{
54
-
// To access props later use this.props.someAnswer;
0 commit comments