Skip to content

Commit

Permalink
chore: 更新依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
markthree committed Jan 20, 2022
1 parent ebb57fd commit 712781e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 84 deletions.
18 changes: 0 additions & 18 deletions __unconfig_vite.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@iconify-json/mdi": "^1.0.12",
"@markthree/node-shared": "^1.2.1",
"@markthree/node-shared": "^1.3.0",
"@types/nprogress": "^0.2.0",
"@vitejs/plugin-vue": "^2.0.1",
"@vueuse/components": "^7.5.3",
Expand Down
38 changes: 34 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 0 additions & 61 deletions scripts/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,3 @@ import {
} from '@markthree/node-shared'

const usePath = createPath(__dirname)

const types = [
{
type: 'list',
name: 'type',
message: '你希望自动创建以下哪种类型',
choices: ['page', 'component']
}
]

const names = [
{
type: 'input',
name: 'name',
message: '请输入名称'
}
]

const loading = createTerminalLoading()

const fail = (msg: string) => loading.fail(msg)
const succeed = (msg: string) => loading.succeed(msg)

const reConfirm = async () => {
const { confirm } = await prompt([
{
type: 'confirm',
name: 'confirm',
message: '该文件已存在,是否覆盖'
}
])
return confirm
}

const runAutoCreate = async () => {
const { type } = await prompt(types)
const isComponent = type === 'component'
if (isComponent) {
return createComponentWithTemplate()
}
}

runAutoCreate()

const createComponentWithTemplate = async () => {
const src = usePath('./template/component.vue')

const { name } = await prompt(names)
const dest = usePath(`../src/components/${name}.vue`)
const componentExists = pathExistsSync(dest)
if (componentExists) {
const confirm = await reConfirm()
if (confirm) {
await copy(src, dest)
return succeed('该文件已被覆盖初始化')
}
return fail('创建失败')
}
await copy(src, dest)
succeed('创建成功')
}

0 comments on commit 712781e

Please sign in to comment.