Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 1457c82

Browse files
committed
chore: setup component generator with hygen
1 parent b148949 commit 1457c82

File tree

8 files changed

+1474
-32
lines changed

8 files changed

+1474
-32
lines changed

.eslintrc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ env:
33
es2021: true
44
node: true
55
extends:
6-
- standard
6+
- prettier/@typescript-eslint
7+
- plugin:prettier/recommended
78
parser: '@typescript-eslint/parser'
89
parserOptions:
910
ecmaVersion: 12

.prettierrc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# .prettierrc or .prettierrc.yaml
2+
trailingComma: "es5"
3+
tabWidth: 2
4+
semi: false
5+
singleQuote: true

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"packages/*"
1010
],
1111
"scripts": {
12-
"build": "lerna run build --no-private --stream"
12+
"build": "lerna run build",
13+
"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix"
1314
},
1415
"license": "MIT",
1516
"private": true,
@@ -21,11 +22,17 @@
2122
"concurrently": "^5.3.0",
2223
"cross-env": "^7.0.2",
2324
"eslint": "^7.9.0",
25+
"eslint-config-prettier": "^6.12.0",
2426
"eslint-config-standard": "^14.1.1",
2527
"eslint-plugin-import": "^2.22.0",
2628
"eslint-plugin-node": "^11.1.0",
29+
"eslint-plugin-prettier": "^3.1.4",
2730
"eslint-plugin-promise": "^4.2.1",
2831
"eslint-plugin-standard": "^4.0.1",
29-
"lerna": "^3.22.1"
32+
"lerna": "^3.22.1",
33+
"prettier": "^2.1.2",
34+
"vite": "^1.0.0-rc.4",
35+
"vue": "^3.0.0",
36+
"vue-router": "4.0.0-beta.10"
3037
}
3138
}

packages/c-button/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@chakra-ui/c-button",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"description": "Chakra UI Vue | CButton component",
6+
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
7+
"author": "codebender828 [email protected]",
8+
"license": "MIT",
9+
"scripts": {
10+
"build": "concurrently yarn:build:*",
11+
"build:esm": "cross-env swc src --out-dir dist/esm/",
12+
"build:cjs": "cross-env swc -C module.type=commonjs src --out-dir dist/cjs/"
13+
}
14+
}

packages/c-button/src/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { h, defineComponent } from 'vue'
2+
3+
const CButton = defineComponent({
4+
props: {
5+
as: {
6+
type: Object as PropType<string>,
7+
default: 'div',
8+
},
9+
},
10+
setup(props, { slots, attrs }) {
11+
return h(props?.as, { ...attrs }, slots.default?.())
12+
},
13+
})
14+
15+
export default CButton
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { render } from '@chakra-ui/vue-test-utils'
2+
import CButton from '../'
3+
4+
5+
it('should render properly', () => {
6+
const { html } = render(CButton)
7+
expect(html()).toMatchSnapshot()
8+
})

packages/c-button/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"include": ["src"]
4+
}

0 commit comments

Comments
 (0)