Skip to content

Commit

Permalink
feat:cli不再添加S
Browse files Browse the repository at this point in the history
  • Loading branch information
413281823 committed Jul 7, 2022
1 parent b36868a commit 3e90196
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"/Users/yangtao/projects/sheep-ui/sheep-ui/src/tree/index.ts":"1","/Users/yangtao/projects/sheep-ui/sheep-ui/cli/shared/create-component.ts":"2","/Users/yangtao/projects/sheep-ui/sheep-ui/cli/template/core.ts":"3","/Users/yangtao/projects/sheep-ui/sheep-ui/cli/template/index.ts":"4","/Users/yangtao/projects/sheep-ui/sheep-ui/cli/template/style.ts":"5","/Users/yangtao/projects/sheep-ui/sheep-ui/cli/template/test.ts":"6","/Users/yangtao/projects/sheep-ui/sheep-ui/cli/template/types.ts":"7","/Users/yangtao/projects/sheep-ui/sheep-ui/src/tree/src/tree-type.ts":"8","/Users/yangtao/projects/sheep-ui/sheep-ui/src/tree/src/tree.tsx":"9","/Users/yangtao/projects/sheep-ui/sheep-ui/src/tree/test/tree.test.ts":"10"},{"size":328,"mtime":1652262221840},{"size":2065,"mtime":1652262209452,"results":"11","hashOfConfig":"12"},{"size":669,"mtime":1652260250762,"results":"13","hashOfConfig":"12"},{"size":489,"mtime":1652262251865,"results":"14","hashOfConfig":"12"},{"size":102,"mtime":1652261397357,"results":"15","hashOfConfig":"12"},{"size":362,"mtime":1652261472172,"results":"16","hashOfConfig":"12"},{"size":441,"mtime":1652261208355,"results":"17","hashOfConfig":"12"},{"size":146,"mtime":1652262221838,"results":"18","hashOfConfig":"12"},{"size":290,"mtime":1652262221837},{"size":218,"mtime":1652262221839,"results":"19","hashOfConfig":"12"},{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"kzw0my",{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","suppressedMessages":"31","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"32","messages":"33","suppressedMessages":"34","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"35","messages":"36","suppressedMessages":"37","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","suppressedMessages":"40","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"41","messages":"42","suppressedMessages":"43","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/yangtao/projects/sheep-ui/sheep-ui/cli/shared/create-component.ts",[],[],"/Users/yangtao/projects/sheep-ui/sheep-ui/cli/template/core.ts",[],[],"/Users/yangtao/projects/sheep-ui/sheep-ui/cli/template/index.ts",[],[],"/Users/yangtao/projects/sheep-ui/sheep-ui/cli/template/style.ts",[],[],"/Users/yangtao/projects/sheep-ui/sheep-ui/cli/template/test.ts",[],[],"/Users/yangtao/projects/sheep-ui/sheep-ui/cli/template/types.ts",[],[],"/Users/yangtao/projects/sheep-ui/sheep-ui/src/tree/src/tree-type.ts",["44"],[],"/Users/yangtao/projects/sheep-ui/sheep-ui/src/tree/test/tree.test.ts",[],[],{"ruleId":"45","severity":1,"message":"46","line":1,"column":28,"nodeType":"47","messageId":"48","endLine":1,"endColumn":36},"@typescript-eslint/no-unused-vars","'PropType' is defined but never used.","Identifier","unusedVar"]
[{"/Users/liangqianyang/Desktop/vue/git/sheep-ui/cli/template/core.ts":"1","/Users/liangqianyang/Desktop/vue/git/sheep-ui/src/App.vue":"2","/Users/liangqianyang/Desktop/vue/git/sheep-ui/src/button/src/button.tsx":"3","/Users/liangqianyang/Desktop/vue/git/sheep-ui/src/tree/index.ts":"4","/Users/liangqianyang/Desktop/vue/git/sheep-ui/src/tree/src/tree.tsx":"5","/Users/liangqianyang/Desktop/vue/git/sheep-ui/.eslintrc.js":"6"},{"size":663,"mtime":1657202953630,"results":"7","hashOfConfig":"8"},{"size":1695,"mtime":1657203332673,"results":"9","hashOfConfig":"8"},{"size":1366,"mtime":1657203521109,"results":"10","hashOfConfig":"8"},{"size":326,"mtime":1657201178996,"results":"11","hashOfConfig":"8"},{"size":2361,"mtime":1657203151085,"results":"12","hashOfConfig":"8"},{"size":597,"mtime":1657205036658,"results":"13","hashOfConfig":"8"},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"pa7b6v",{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","suppressedMessages":"31","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/liangqianyang/Desktop/vue/git/sheep-ui/cli/template/core.ts",[],[],"/Users/liangqianyang/Desktop/vue/git/sheep-ui/src/App.vue",[],[],"/Users/liangqianyang/Desktop/vue/git/sheep-ui/src/button/src/button.tsx",[],[],"/Users/liangqianyang/Desktop/vue/git/sheep-ui/src/tree/index.ts",[],[],"/Users/liangqianyang/Desktop/vue/git/sheep-ui/src/tree/src/tree.tsx",[],[],"/Users/liangqianyang/Desktop/vue/git/sheep-ui/.eslintrc.js",[],[]]
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ module.exports = {
parserOptions: {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser',
sourceType: 'module'
sourceType: 'module',
jsx: true,
tsx: true
},
plugins: ['vue', '@typescript-eslint'],
rules: {
Expand Down
2 changes: 1 addition & 1 deletion cli/template/core.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { upperFirst } from './utils'
// 创建组件核心文件模板
export default function genCoreTemplate(name: string) {
const compName = 'S' + upperFirst(name)
const compName = upperFirst(name)
const propsTypeName = upperFirst(name) + 'Props'
const propsName = name + 'Props'
const propsFileName = name + '-type'
Expand Down
55 changes: 55 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,60 @@
<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
import { reactive } from 'vue'
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
const tree = [
{
label: 'docs',
id: 'docs'
},
{
label: 'packages',
id: 'packages',
expanded: true,
children: [
{
label: 'plugin-vue',
id: 'plugin-vue'
},
{
label: 'vite',
id: 'vite',
expanded: true,
children: [
{
label: 'src',
id: 'src'
},
{
label: 'README.md',
id: 'README.md'
}
]
}
]
},
{
label: 'scripts',
id: 'scripts',
children: [
{
label: 'release.ts',
id: 'release.ts'
},
{
label: 'verifyCommit.ts',
id: 'verifyCommit.ts'
}
]
},
{
label: 'pnpm-workspace.yaml',
id: 'pnpm-workspace.yaml'
}
]
const TreeData = reactive(tree)
</script>

<template>
Expand All @@ -9,6 +63,7 @@
trigger="click"
:unmount-on-close="true"
>
<STree :data="TreeData" />
<SButton>Click me</SButton>
<template #content>
<div class="demo-basic">luanhanxiao is a good man</div>
Expand Down
2 changes: 1 addition & 1 deletion src/button/src/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default defineComponent({
const { type, size, disabled, block } = toRefs(props)

const prefixCls = getComponentCls('btn')

console.log(prefixCls)
//新手村报道
const classes = computed(() => [
prefixCls,
Expand Down
4 changes: 2 additions & 2 deletions src/tree/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { App } from 'vue'
import Tree from './src/tree'
import { installComponent } from '../install'
import type { SniperUIOptions } from '../_utils/global-config'
import type { SheepUIOptions } from '../_utils/global-config'

// 具名导出
export { Tree }

// 导出插件
export default {
install(app: App, options?: SniperUIOptions) {
install(app: App, options?: SheepUIOptions) {
installComponent(app, Tree, options)
}
}

0 comments on commit 3e90196

Please sign in to comment.