Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions cmd/make-js-component.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ var vueApi;
})(vueApi || (vueApi = {}));
wizard()
.then((answers) => {
const { componentName, framework, template, folder, anotherComponent, advancedOpts, advanced } = answers;
const { componentName, framework, testFile, template, folder, anotherComponent, advancedOpts, advanced } = answers;
const api = template.indexOf("composition") !== -1 ? vueApi.Composition : vueApi.Option;
const t = advanced ? "advanced-component.vue" : template;
if (anotherComponent) {
createComponent(componentName, framework, t, folder, api, advancedOpts).then(() => {
createComponent(componentName, framework, testFile, t, folder, api, advancedOpts).then(() => {
console.log("✅ Component created");
createAnotherComponent();
});
}
else
createComponent(componentName, framework, t, folder, api, advancedOpts).then(() => console.log("✅ Component created"));
createComponent(componentName, framework, testFile, t, folder, api, advancedOpts).then(() => console.log("✅ Component created"));
})
.catch((e) => {
console.error(e.message);
Expand Down
6 changes: 3 additions & 3 deletions cmd/make-js-component.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ enum vueApi {

wizard()
.then((answers: Answers) => {
const { componentName, framework, template, folder, anotherComponent, advancedOpts, advanced } = answers;
const { componentName, framework, testFile, template, folder, anotherComponent, advancedOpts, advanced } = answers;
const api = template.indexOf("composition") !== -1 ? vueApi.Composition : vueApi.Option;
const t = advanced ? "advanced-component.vue" : template;
if (anotherComponent) {
createComponent(componentName, framework, t, folder, api, advancedOpts).then(() => {
createComponent(componentName, framework, testFile, t, folder, api, advancedOpts).then(() => {
console.log("✅ Component created");
createAnotherComponent();
});
} else
createComponent(componentName, framework, t, folder, api, advancedOpts).then(() =>
createComponent(componentName, framework, testFile, t, folder, api, advancedOpts).then(() =>
console.log("✅ Component created")
);
})
Expand Down
Loading