Skip to content

Commit 75a94a7

Browse files
committed
[Feature] Created templates directory
1 parent 67b82e0 commit 75a94a7

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

bin/main.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import program from "commander"
55
import pkg from "../package.json"
66
import selectShell from "select-shell"
77
import chalk from "chalk"
8-
import inquirer = require("inquirer")
8+
import inquirer from "inquirer"
9+
import fs from "fs"
10+
import path from "path"
911

1012
const welcome = `
1113
███████╗██╗░░░░░░█████╗░░██╗░░░░░░░██╗░░░░░░██████╗░███████╗░█████╗░░█████╗░████████╗░░░░░░░█████╗░██╗░░░░░██╗
@@ -58,9 +60,14 @@ function nameTheComponent() {
5860
if (!isValidateComponentNaming(nameOfComponent)) {
5961
nameTheComponent()
6062
}
63+
createComponent(nameOfComponent)
6164
})
6265
}
6366

67+
function createComponent(nameOfComponent: string) {
68+
69+
}
70+
6471
function selectTheNameOfTheComponent() {
6572
list.on("select", (ontions) => {
6673
shell.echo(chalk.yellow("select the name of the component."))

dist/bin/main.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const commander_1 = __importDefault(require("commander"));
1010
const package_json_1 = __importDefault(require("../package.json"));
1111
const select_shell_1 = __importDefault(require("select-shell"));
1212
const chalk_1 = __importDefault(require("chalk"));
13-
const inquirer = require("inquirer");
13+
const inquirer_1 = __importDefault(require("inquirer"));
1414
const welcome = `
1515
███████╗██╗░░░░░░█████╗░░██╗░░░░░░░██╗░░░░░░██████╗░███████╗░█████╗░░█████╗░████████╗░░░░░░░█████╗░██╗░░░░░██╗
1616
██╔════╝██║░░░░░██╔══██╗░██║░░██╗░░██║░░░░░░██╔══██╗██╔════╝██╔══██╗██╔══██╗╚══██╔══╝░░░░░░██╔══██╗██║░░░░░██║
@@ -48,7 +48,7 @@ function isValidateComponentNaming(name) {
4848
return true;
4949
}
5050
function nameTheComponent() {
51-
inquirer
51+
inquirer_1.default
5252
.prompt([
5353
{
5454
name: "value",
@@ -60,8 +60,11 @@ function nameTheComponent() {
6060
if (!isValidateComponentNaming(nameOfComponent)) {
6161
nameTheComponent();
6262
}
63+
createComponent(nameOfComponent);
6364
});
6465
}
66+
function createComponent(nameOfComponent) {
67+
}
6568
function selectTheNameOfTheComponent() {
6669
list.on("select", (ontions) => {
6770
shelljs_1.default.echo(chalk_1.default.yellow("select the name of the component."));

templates/FunctionalComponent.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
interface FunctionalComponentsProps {
2+
3+
}
4+
5+
const FunctionalComponents: React.FC<FunctionalComponentsProps> = () => {
6+
return (
7+
<div></div>
8+
)
9+
}
10+
11+
export default FunctionalComponents
12+

0 commit comments

Comments
 (0)