-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from giuseppesciacca/fix/106_issue_create_ano…
…ther_component_question_moment Fix/ #106 issue create another component question moment
- Loading branch information
Showing
16 changed files
with
479 additions
and
411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
const framework = "angular"; | ||
export default function (componentName, folder, anotherComponent) { | ||
return { | ||
componentName: componentName, | ||
framework: framework.toLowerCase(), | ||
template: "component.component.ts", | ||
folder: folder, | ||
anotherComponent: anotherComponent, | ||
}; | ||
|
||
export default function (componentName, folder) { | ||
return { | ||
componentName, | ||
framework: framework.toLowerCase(), | ||
template: "component.component.ts", | ||
folder: folder, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
import { Answers } from "../../wizard.mjs"; | ||
|
||
const framework = "angular"; | ||
|
||
export default function (componentName: string, folder: string, anotherComponent: boolean): Answers { | ||
export default function (componentName: string, folder: string) { | ||
return { | ||
componentName: componentName, | ||
componentName, | ||
framework: framework.toLowerCase(), | ||
template: "component.component.ts", | ||
folder: folder, | ||
anotherComponent: anotherComponent, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
const framework = "astro"; | ||
export default function (componentName, folder, anotherComponent) { | ||
return { | ||
componentName: componentName, | ||
framework: framework.toLowerCase(), | ||
template: "component.astro", | ||
folder: folder, | ||
anotherComponent: anotherComponent, | ||
}; | ||
export default function (componentName, folder) { | ||
return { | ||
componentName: componentName, | ||
framework: framework.toLowerCase(), | ||
template: "component.astro", | ||
folder: folder, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
const framework = "astro"; | ||
|
||
export default function (componentName: string, folder: string, anotherComponent: boolean) { | ||
export default function (componentName: string, folder: string) { | ||
return { | ||
componentName: componentName, | ||
framework: framework.toLowerCase(), | ||
template: "component.astro", | ||
folder: folder, | ||
anotherComponent: anotherComponent, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import inquirer from "inquirer"; | ||
const framework = "qwik"; | ||
export default function (componentName, folder, anotherComponent) { | ||
return inquirer | ||
.prompt([ | ||
{ | ||
type: "list", | ||
name: "type", | ||
message: "Choose wich type of component to create", | ||
choices: ["Hello World", "useStore", "useStyles"], | ||
}, | ||
export default function (componentName, folder) { | ||
return inquirer | ||
.prompt([ | ||
{ | ||
type: "list", | ||
name: "type", | ||
message: "Choose wich type of component to create", | ||
choices: ["Hello World", "useStore", "useStyles"], | ||
}, | ||
]) | ||
.then(answers => { | ||
return { | ||
componentName: componentName, | ||
framework: framework.toLowerCase(), | ||
template: answers.type === "Hello World" | ||
? "hello-world-component.tsx" | ||
: answers.type === "useStore" | ||
? "usestore-component.tsx" | ||
: answers.type === "useStyles" | ||
? "usestyles-component.tsx" | ||
: "hello-world-component.tsx", | ||
folder: folder, | ||
anotherComponent: anotherComponent, | ||
}; | ||
.then((answers) => { | ||
return { | ||
componentName: componentName, | ||
framework: framework.toLowerCase(), | ||
template: | ||
answers.type === "Hello World" | ||
? "hello-world-component.tsx" | ||
: answers.type === "useStore" | ||
? "usestore-component.tsx" | ||
: answers.type === "useStyles" | ||
? "usestyles-component.tsx" | ||
: "hello-world-component.tsx", | ||
folder: folder, | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,48 @@ | ||
import inquirer from "inquirer"; | ||
const framework = "react"; | ||
export default function (componentName, folder, anotherComponent) { | ||
return inquirer | ||
.prompt([ | ||
{ | ||
type: "confirm", | ||
name: "typescript", | ||
message: "Do you want to use Typescript?", | ||
default: true, | ||
}, | ||
export default function (componentName, folder) { | ||
return inquirer | ||
.prompt([ | ||
{ | ||
type: "confirm", | ||
name: "typescript", | ||
message: "Do you want to use Typescript?", | ||
default: true, | ||
}, | ||
{ | ||
type: "list", | ||
name: "css", | ||
message: "Do you want to use any CSS framework?", | ||
choices: ["Tailwind", "Styled Components", "CSS Module", "No"], | ||
default: "No", | ||
}, | ||
]) | ||
.then((answers) => { | ||
const { typescript } = answers; | ||
return inquirer | ||
.prompt([ | ||
{ | ||
type: "list", | ||
name: "css", | ||
message: "Do you want to use any CSS framework?", | ||
choices: ["Tailwind", "Styled Components", "CSS Module", "No"], | ||
default: "No", | ||
}, | ||
]) | ||
.then((answers) => { | ||
const { css } = answers; | ||
const extension = typescript ? "tsx" : "jsx"; | ||
let templateBase = "function-component"; | ||
switch (css) { | ||
case "Tailwind": | ||
templateBase += "-tailwind"; | ||
break; | ||
case "Styled Components": | ||
templateBase += "-styled-components"; | ||
break; | ||
case "CSS Module": | ||
templateBase += "-css-module"; | ||
break; | ||
default: | ||
break; | ||
} | ||
const template = `${templateBase}.${extension}`; | ||
return { | ||
componentName: componentName, | ||
framework: framework.toLowerCase(), | ||
template: template, | ||
folder: folder, | ||
anotherComponent: anotherComponent, | ||
}; | ||
}); | ||
.then((answers) => { | ||
const { typescript } = answers; | ||
const { css } = answers; | ||
const extension = typescript ? "tsx" : "jsx"; | ||
let templateBase = "function-component"; | ||
|
||
switch (css) { | ||
case "Tailwind": | ||
templateBase += "-tailwind"; | ||
break; | ||
case "Styled Components": | ||
templateBase += "-styled-components"; | ||
break; | ||
case "CSS Module": | ||
templateBase += "-css-module"; | ||
break; | ||
default: | ||
break; | ||
} | ||
const template = `${templateBase}.${extension}`; | ||
|
||
return { | ||
componentName: componentName, | ||
framework: framework.toLowerCase(), | ||
template: template, | ||
folder: folder, | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
import inquirer from "inquirer"; | ||
const framework = "svelte"; | ||
export default function (componentName, folder, anotherComponent) { | ||
return inquirer | ||
.prompt([ | ||
{ | ||
type: "confirm", | ||
name: "typescript", | ||
message: "Do you want to use Typescript?", | ||
default: true, | ||
}, | ||
export default function (componentName, folder) { | ||
return inquirer | ||
.prompt([ | ||
{ | ||
type: "confirm", | ||
name: "typescript", | ||
message: "Do you want to use Typescript?", | ||
default: true, | ||
}, | ||
]) | ||
.then((answers) => { | ||
return { | ||
componentName: componentName, | ||
framework: framework.toLowerCase(), | ||
template: answers.typescript ? "component-ts.svelte" : "component-js.svelte", | ||
folder: folder, | ||
anotherComponent: anotherComponent, | ||
}; | ||
.then((answers) => { | ||
return { | ||
componentName: componentName, | ||
framework: framework.toLowerCase(), | ||
template: answers.typescript | ||
? "component-ts.svelte" | ||
: "component-js.svelte", | ||
folder: folder, | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.