- added rpc tests
- removed git clone
This commit is contained in:
2024-10-28 12:10:58 +00:00
parent 39e6455271
commit 828a3deb33
7 changed files with 175 additions and 58 deletions
+12 -18
View File
@@ -1,7 +1,7 @@
import c from 'chalk'
import { input, select } from '@inquirer/prompts'
import clone from 'git-clone'
import path from 'node:path'
import { cloneBranch } from '../utils/cloner'
export async function initProject() {
let folder
@@ -10,7 +10,7 @@ export async function initProject() {
if (!folder) {
folder = await input({
message: c.gray('Enter project name:'),
default: 'rage-fw',
default: 'rage-fw-example',
})
} else {
console.log(c.gray('Project name:'), folder)
@@ -19,19 +19,14 @@ export async function initProject() {
if (!framework) {
framework = await select({
message: c.gray('Select frontend:'),
default: 'react',
default: 'react-18',
loop: true,
choices: [
{
name: 'React + TypeScript (Vite)',
value: 'react',
value: 'react-18',
description: 'React + TypeScript (Vite) as a frontend',
},
// {
// name: 'vue',
// value: 'vue',
// description: 'npm is the most popular package manager',
// },
],
})
} else {
@@ -46,21 +41,20 @@ export async function initProject() {
c.gray('as a frontend..'),
)
clone(
cloneBranch(
'https://git.entityseven.com/entityseven/rage-framework-example',
path.join(process.cwd(), folder),
{},
err => {
if (err) {
console.log(c.red('Error occured: \n', err))
return
}
framework,
)
.then(() => {
console.log(c.gray('Scaffolded project into'), folder)
console.log(
c.gray(
`Project was created ar dir: ${path.join(process.cwd(), folder)}`,
),
)
},
)
})
.catch(e => {
console.log(c.red('Error occured: \n', e))
})
}