@blucass/create-project
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -41,6 +41,7 @@ #!/usr/bin/env node | ||
const projectType = yield getProjectType(); | ||
const repoUrl = repos_1.Boilerplate_Repos[projectType]; | ||
if (!!repoUrl === false) | ||
const t = repos_1.templates.find((i) => i.value === projectType); | ||
if (!t) { | ||
return; | ||
(0, utils_1.downloadRepos)(repoUrl, projectPath, projectName); | ||
} | ||
(0, utils_1.downloadRepos)(t.value, projectPath, projectName); | ||
}); | ||
@@ -70,29 +71,3 @@ } | ||
message: '选择项目模板', | ||
choices: [ | ||
{ | ||
title: 'Vue3 (vite)', | ||
value: 'vue-vite', | ||
description: '基于 vite 构建, PC 和移动端双页面入口' | ||
}, | ||
{ | ||
title: 'Vanilla(vite)', | ||
value: 'vanilla-vite', | ||
description: '基于 vite 构建' | ||
}, | ||
{ | ||
title: 'React(cra) B端 ', | ||
value: 'react-lite-pc', | ||
description: '基于 cra,通过 react-app-rewired 自定义配置' | ||
}, | ||
{ | ||
title: 'React(vite) B端', | ||
value: 'react-vite-pc', | ||
description: '技术栈:Vite + React + antd + axios' | ||
}, | ||
{ | ||
title: 'React(vite) C端', | ||
value: 'react-vite-mobile', | ||
description: '技术栈: Vite + React + antd-mobile + TailwindCSS + axios' | ||
} | ||
] | ||
choices: repos_1.templates | ||
}); | ||
@@ -99,0 +74,0 @@ return projectType; |
@@ -1,22 +0,6 @@ | ||
export declare const Boilerplate_Repos: { | ||
'react-lite-pc': { | ||
url: string; | ||
branch: string; | ||
}; | ||
'react-vite-pc': { | ||
url: string; | ||
branch: string; | ||
}; | ||
'react-vite-mobile': { | ||
url: string; | ||
branch: string; | ||
}; | ||
'vanilla-vite': { | ||
url: string; | ||
branch: string; | ||
}; | ||
'vue-vite': { | ||
url: string; | ||
branch: string; | ||
}; | ||
}; | ||
export declare const repo = "git@github.com:wqcstrong/boilerplate.git"; | ||
export declare const templates: { | ||
title: string; | ||
value: string; | ||
description: string; | ||
}[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Boilerplate_Repos = void 0; | ||
const repo = 'git@github.com:wqcstrong/boilerplate.git'; | ||
exports.Boilerplate_Repos = { | ||
'react-lite-pc': { | ||
url: repo, | ||
branch: 'react-lite-pc' | ||
exports.templates = exports.repo = void 0; | ||
exports.repo = 'git@github.com:wqcstrong/boilerplate.git'; | ||
exports.templates = [ | ||
{ | ||
title: 'Vue3 (vite)', | ||
value: 'vue-vite', | ||
description: '基于 vite 构建, PC 和移动端双页面入口' | ||
}, | ||
'react-vite-pc': { | ||
url: repo, | ||
branch: 'react-vite-pc' | ||
{ | ||
title: 'Vanilla(vite)', | ||
value: 'vanilla-vite', | ||
description: '基于 vite 构建' | ||
}, | ||
'react-vite-mobile': { | ||
url: repo, | ||
branch: 'react-vite-mobile' | ||
{ | ||
title: 'React(cra) B端 ', | ||
value: 'react-lite-pc', | ||
description: '基于 cra,通过 react-app-rewired 自定义配置' | ||
}, | ||
'vanilla-vite': { | ||
url: repo, | ||
branch: 'vanilla-vite' | ||
{ | ||
title: 'React(vite) B端', | ||
value: 'react-vite-pc', | ||
description: '技术栈:Vite + React + antd + axios' | ||
}, | ||
'vue-vite': { | ||
url: repo, | ||
branch: 'vue-vite' | ||
{ | ||
title: 'React(vite) C端', | ||
value: 'react-vite-mobile', | ||
description: '技术栈: Vite + React + antd-mobile + TailwindCSS + axios' | ||
}, | ||
{ | ||
title: 'NestJS - API', | ||
value: 'nestjs-api', | ||
description: '技术栈: nestjs + typeorm' | ||
} | ||
}; | ||
]; |
export declare const checkCommandInstall: (command: string) => boolean; | ||
export declare const checkYarnInstall: () => boolean; | ||
export declare const downloadRepos: (repoObj: I.Repo, localPath: string, projectName: string) => void; | ||
export declare const downloadRepos: (branch: string, localPath: string, projectName: string) => void; |
@@ -13,2 +13,3 @@ "use strict"; | ||
const path_1 = __importDefault(require("path")); | ||
const repos_1 = require("../repos"); | ||
const checkCommandInstall = (command) => { | ||
@@ -32,7 +33,6 @@ try { | ||
} | ||
const downloadRepos = (repoObj, localPath, projectName) => { | ||
const downloadRepos = (branch, localPath, projectName) => { | ||
const spinner = (0, ora_1.default)('Downloading...').start(); | ||
const { url, branch = '' } = repoObj; | ||
const params = { | ||
url, | ||
url: repos_1.repo, | ||
branch, | ||
@@ -39,0 +39,0 @@ localPath |
{ | ||
"name": "@blucass/create-project", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "Create start project boilerplate", | ||
@@ -10,6 +10,3 @@ "bin": "dist/index.js", | ||
"test": "yarn build && node dist/index.js", | ||
"commit": "git-cz", | ||
"release:patch": "standard-version --release-as patch", | ||
"release:minor": "standard-version --release-as minor", | ||
"release:major": "standard-version --release-as major", | ||
"commit": "git add . && git-cz", | ||
"prepublishOnly": "yarn build" | ||
@@ -49,3 +46,2 @@ }, | ||
"prettier": "^2.2.1", | ||
"standard-version": "^9.3.0", | ||
"yorkie": "^2.0.0" | ||
@@ -52,0 +48,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
8945
204