Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request to resolve issue #57 - Angular test file cli option #110

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
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