Skip to content

Commit

Permalink
feat: colorful choice
Browse files Browse the repository at this point in the history
  • Loading branch information
FliPPeDround committed Feb 1, 2024
1 parent a078f83 commit 6a417f5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/question/model.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { PromptObject } from 'prompts'
import { gray } from 'kolorist'
import { UIList } from './UI/choices'
import { modelList } from './tool/choices'
import { configList } from './plugin/choices'

export default (): PromptObject<string>[] => {
const instructions = '使用↑↓选择,空格或←→选中,a全选,回车确认'
const instructions = gray('使用↑↓选择,空格或←→选中,a全选,回车确认')

return [
{
Expand Down
15 changes: 8 additions & 7 deletions src/question/plugin/choices.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
import { trueColor as rgb } from 'kolorist'
import type { ModelType } from '../type'

export const configList: ModelType[] = [
{
title: 'vite-plugin-uni-components',
title: rgb(236, 112, 99)('vite-plugin-uni-components'),
value: 'improt',
description: '按需自动引入组件',
},
{
title: 'vite-plugin-uni-pages',
title: rgb(243, 156, 18)('vite-plugin-uni-pages'),
value: 'pages',
description: '提供基于文件系统的路由',
},
{
title: 'vite-plugin-uni-layouts',
title: rgb(241, 196, 15)('vite-plugin-uni-layouts'),
value: 'layouts',
description: '提供类 nuxt 的 layouts 系统',
},
{
title: 'vite-plugin-uni-manifest',
title: rgb(46, 204, 113)('vite-plugin-uni-manifest'),
value: 'manifest',
description: '自动生成 manifest.json 文件',
},
{
title: 'vite-plugin-uni-platform',
title: rgb(52, 152, 219)('vite-plugin-uni-platform'),
value: 'filePlatform',
description: '基于文件名 (*.<h5|mp-weixin|app>.*) 的按平台编译插件',
},
{
title: 'vite-plugin-uni-platform-modifier',
title: rgb(155, 89, 182)('vite-plugin-uni-platform-modifier'),
value: 'platformModifier',
description: '为属性、指令提供平台修饰符并按需编译',
},
{
title: 'vite-plugin-uni-middleware',
title: rgb(149, 165, 166)('vite-plugin-uni-middleware'),
value: 'middleware',
description: '使用路由中间件',
},
Expand Down
13 changes: 7 additions & 6 deletions src/question/tool/choices.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import { trueColor as rgb } from 'kolorist'
import type { ModelType } from '../type'

export const modelList: ModelType[] = [
{
title: 'Pinia',
title: rgb(235, 186, 43)('Pinia'),
value: 'pinia',
description: '符合直觉的 Vue.js 状态管理库',
},
{
title: 'Unocss',
title: rgb(204, 204, 204)('Unocss'),
value: 'unocss',
description: '即时按需的原子级 CSS 引擎',
},
{
title: 'uni-network ',
value: 'uniNetwork ',
title: rgb(108, 92, 231)('uni-network'),
value: 'uniNetwork',
description: '为 uni-app 打造的基于 Promise 的 HTTP 客户端',
},
{
title: 'uni-use',
title: rgb(63, 168, 125)('uni-use'),
value: 'uniUse',
description: 'uni-app 组合式工具集',
},
{
title: 'uni-promises',
title: rgb(52, 152, 219)('uni-promises'),
value: 'uniPromises',
description: 'uni-app promise 化的 API',
},
Expand Down

0 comments on commit 6a417f5

Please sign in to comment.