Skip to content

Commit

Permalink
chore: 更新依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
fonghehe committed Jun 18, 2023
1 parent dbc3541 commit aa708f4
Show file tree
Hide file tree
Showing 4 changed files with 9,025 additions and 8,701 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"dependencies": {
"@ant-design/icons-vue": "^6.1.0",
"@element-plus/icons-vue": "^2.1.0",
"@vueuse/components": "^10.1.2",
"@vueuse/core": "^10.1.2",
"@vueuse/components": "^10.2.0",
"@vueuse/core": "^10.2.0",
"ant-design-vue": "^3.2.19",
"axios": "^1.4.0",
"dayjs": "^1.11.8",
Expand All @@ -47,7 +47,7 @@
"@vitejs/plugin-vue": "^4.2.0",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"autoprefixer": "^10.4.14",
"eslint": "^8.42.0",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.8.0",
"eslint-define-config": "^1.20.0",
"eslint-plugin-import": "^2.27.5",
Expand All @@ -69,7 +69,7 @@
"postcss-scss": "^4.0.6",
"prettier": "^2.8.8",
"rollup-plugin-visualizer": "^5.9.2",
"stylelint": "^15.7.0",
"stylelint": "^15.8.0",
"stylelint-config-recommended": "^12.0.0",
"stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-standard": "^33.0.0",
Expand Down
44 changes: 27 additions & 17 deletions packages/create-fast-vue3/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@ async function loading(fn, message, ...args) {
const result = await fn(...args)
spinner.succeed()
return result
} catch(error) {
} catch (error) {
console.log(error)
spinner.fail('Request failed, refetch...')
}
}

function changePackageInfo(root, packageName) {
const pkgJSONPath = path.join(root, 'package.json')
const pkg = JSON.parse(fs.readFileSync(pkgJSONPath))
pkg.name = packageName
pkg.version = '0.0.0'
delete pkg.author
fs.writeFileSync(pkgJSONPath, JSON.stringify(pkg, null, 2) + '\n')
const pkgJSONPath = path.join(root, 'package.json')
const pkg = JSON.parse(fs.readFileSync(pkgJSONPath))
pkg.name = packageName
pkg.version = '0.0.0'
delete pkg.author
fs.writeFileSync(pkgJSONPath, JSON.stringify(pkg, null, 2) + '\n')
}

function removeDir(root, dir) {
const deleteFolderRecursive = function(path) {
const deleteFolderRecursive = function (path) {
if (fs.existsSync(path)) {
fs.readdirSync(path).forEach(function(file) {
let curPath = path + "/" + file
fs.readdirSync(path).forEach(function (file) {
let curPath = path + '/' + file
if (fs.lstatSync(curPath).isDirectory()) {
deleteFolderRecursive(curPath)
} else {
Expand Down Expand Up @@ -97,8 +97,16 @@ async function init() {
type: 'select',
message: 'Choice a Template:',
choices: [
{ title: 'template-pc', description: 'This will generate template for web scene', value: 'web' },
{ title: 'template-mobile', description: 'This will generate template for mobile scene', value: 'mobile' }
{
title: 'template-pc',
description: 'This will generate template for web scene',
value: 'web'
},
{
title: 'template-mobile',
description: 'This will generate template for mobile scene',
value: 'mobile'
}
],
initial: 0
},
Expand Down Expand Up @@ -154,16 +162,18 @@ async function init() {
}

const templates = {
'web': 'main',
'mobile': 'mobile-template'
web: 'main',
mobile: 'mobile-template'
}

console.log(`\nScaffolding project in ${root}...`)

await loading(clone, 'waiting download template', downloadUrl, root, { checkout: templates[template] })
await loading(clone, 'waiting download template', downloadUrl, root, {
checkout: templates[template]
})

removeDir(root, "packages")
removeDir(root, ".git")
removeDir(root, 'packages')
removeDir(root, '.git')
changePackageInfo(root, packageName)

const packageManager = /pnpm/.test(process.env.npm_execpath)
Expand Down
Loading

0 comments on commit aa708f4

Please sign in to comment.