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

Commit 13f1e82

Browse files
Merge pull request #1 from chakra-ui/release/playground
Release/playground
2 parents b148949 + c796ae9 commit 13f1e82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2678
-117
lines changed

.DS_Store

6 KB
Binary file not shown.

.eslintignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
node_modules
2-
dist
2+
dist
3+
4+
# At the time of writing this, I could not find any helpful
5+
# documentation for adding ESLint for Vue 3 projects running on Vite.
6+
# For this reason, we ignore the playground directory.
7+
playground

.eslintrc.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@ env:
33
es2021: true
44
node: true
55
extends:
6-
- standard
6+
- prettier/@typescript-eslint
7+
- plugin:prettier/recommended
8+
- plugin:vue/essential
9+
- '@vue/typescript/recommended'
710
parser: '@typescript-eslint/parser'
811
parserOptions:
912
ecmaVersion: 12
1013
sourceType: module
1114
plugins:
1215
- '@typescript-eslint'
13-
rules: {}
16+
rules:
17+
'@typescript-eslint/member-delimiter-style':
18+
- error
19+
- multiline:
20+
delimiter: none
21+
requireLast: false
22+
singleline:
23+
delimiter: comma
24+
requireLast: false

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
dist
3-
_templates
3+
playground/src/.generated/imports.js
4+
playground/src/.generated/routes.json

.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
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
to: packages/<%=h.changeCase.paramCase(name)%>/src/index.ts
3+
---
4+
5+
import { h, defineComponent, PropType } from 'vue'
6+
7+
const <%= h.changeCase.pascalCase(name) %> = defineComponent({
8+
props: {
9+
as: {
10+
type: Object as PropType<string>,
11+
default: 'div',
12+
},
13+
},
14+
setup(props, { slots, attrs }) {
15+
return h(props?.as, { ...attrs }, slots.default?.())
16+
},
17+
})
18+
19+
export default <%= h.changeCase.pascalCase(name) %>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
to: packages/<%=h.changeCase.paramCase(name)%>/package.json
3+
---
4+
5+
{
6+
"name": "<%= '@chakra-ui/' + h.changeCase.paramCase(name)%>",
7+
"version": "1.0.0",
8+
"main": "dist/cjs/index.js",
9+
"module": "dist/esm/index.js",
10+
"types": "dist/types/index.d.ts",
11+
"typings": "dist/types/index.d.ts",
12+
"files": [
13+
"dist"
14+
],
15+
"description": "<%= 'Chakra UI Vue | ' + h.changeCase.pascalCase(name) + ' component'%>",
16+
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
17+
"author": "codebender828 [email protected]",
18+
"license": "MIT",
19+
"scripts": {
20+
"build": "concurrently yarn:build:*",
21+
"build:esm": "cross-env swc src --out-dir dist/esm/",
22+
"build:cjs": "cross-env swc -C module.type=commonjs src --out-dir dist/cjs/",
23+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types"
24+
}
25+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
to: packages/<%=h.changeCase.paramCase(name)%>/tests/<%=h.changeCase.paramCase(name)%>.test.ts
3+
---
4+
import { render } from '@chakra-ui/vue-test-utils'
5+
import <%= h.changeCase.pascalCase(name) %> from '../'
6+
7+
8+
it('should render properly', () => {
9+
const { html } = render(<%= h.changeCase.pascalCase(name) %>)
10+
expect(html()).toMatchSnapshot()
11+
})
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
to: packages/<%=h.changeCase.paramCase(name)%>/tsconfig.json
3+
---
4+
5+
{
6+
"extends": "../../tsconfig.json",
7+
"include": ["src"]
8+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
to: packages/<%=h.changeCase.paramCase(name)%>/src/<%=h.changeCase.paramCase(name)%>.ts
3+
---
4+
5+
import { h, defineComponent } from 'vue'
6+
7+
const <%= h.changeCase.pascalCase(name) %> = defineComponent({
8+
props: {
9+
as: {
10+
type: Object as PropType<string>,
11+
default: 'div',
12+
},
13+
},
14+
setup(props, { slots, attrs }) {
15+
return h(props?.as, { ...attrs }, slots.default?.())
16+
},
17+
})
18+
19+
export default <%= h.changeCase.pascalCase(name) %>

0 commit comments

Comments
 (0)