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

Commit 86d9844

Browse files
Merge pull request #35 from chakra-ui/develop
chore: release setup
2 parents 8a4fe29 + 562ee83 commit 86d9844

File tree

122 files changed

+6519
-513
lines changed

Some content is hidden

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

122 files changed

+6519
-513
lines changed

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
node-version: [12.19]
20+
node-version: [14]
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@v2

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
# so that Changesets can generate changelogs with the correct commits
2323
fetch-depth: 0
2424

25-
- name: Use Node.js 12.x
25+
- name: Use Node.js 14.x
2626
uses: actions/setup-node@master
2727
with:
28-
node-version: 12.19
28+
node-version: 14
2929

3030
- name: Install dependencies
3131
run: yarn install --frozen-lockfile && yarn bootstrap

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ dist
9696
.pnp.*
9797

9898
# vscode history extension
99-
.history
99+
.history
100+
website/.vite-ssg-temp

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"johnsoncodehk.volar"
4+
]
5+
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"typescript.tsdk": "node_modules/typescript/lib"
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"volar.tsPlugin": true
34
}

README.md

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,55 @@ yarn dev
2525
```
2626

2727
## Development Guide
28-
### 1. Creating new components
29-
Chakra UI Vue uses [hygen](https://www.hygen.io/) to generate new components. The component templates can be found in the `_templates/generator/component` directory
28+
### Major todos:
29+
- [ ] Documentation (to be based on Nuxt 3)
30+
- [ ] Accessibility JS hooks (Documented in Roadmap)
3031

31-
```bash
32-
yarn hygen component --name <COMPONENT_NAME> --description="MY_COMPONENT_DESCRIPTION"
33-
```
32+
### Creating new components
33+
Chakra UI Vue uses [hygen](https://www.hygen.io/) to generate new components. The component templates can be found in the `_templates/generator/component` directory.
34+
35+
* Run the hygen command to generate your new component.
36+
```bash
37+
yarn hygen generator component --name <COMPONENT_NAME> --description="MY_COMPONENT_DESCRIPTION"
38+
```
39+
This creates a new package with the name `<COMPONENT_NAME>` with some basic sanity tests.
40+
41+
* Run `yarn workspace @chakra-ui/COMPONENT_NAME build && yarn bootstrap` to build and link your component in the monorepo.
42+
43+
* Add the script for your package workspace in the global `package.json` file. `"COMPONENT_NAME": "yarn workspace @chakra-ui/COMPONENT_NAME",` goes under `scripts`.
44+
45+
* Before you can play around with your new component in the playground you will have to export your component from the `@chakra-ui/vue-next` package in the `core` directory under `packages`.
46+
47+
* Inside the `index.ts` file, you will have to add `export * from '@chakra-ui/COMPONENT_NAME'`.
3448

35-
This creates a new package with the name `<COMPONENT_NAME>` with some basic sanity tests.
49+
* Your component also needs to be added as a dependency inside the `package.json` of the `@chakra-ui/vue-next` package as following:
50+
```jsx
51+
"dependencies": {
52+
...
53+
"@chakra-ui/COMPONENT_NAME": "*",
54+
...
55+
}
56+
```
3657

37-
After creating your new package, run `yarn workspace @chakra-ui/COMPONENT_NAME && yarn bootstrap` to build and link your component in the monorepo.
58+
* Run `yarn core build` and then `yarn dev` to view your new component in the playground.
3859

39-
Run `yarn dev` to view your new component in the playground.
60+
* When you make changes to your component, you will need to rebuild your package to have the changes applied in for example the playground `yarn workspace @chakra-ui/COMPONENT_NAME build` or `yarn COMPONENT_NAME build`. Alternatively, you can use the watch command. `yarn workspace @chakra-ui/COMPONENT_NAME watch` or `yarn COMPONENT_NAME watch`.
4061

4162
**Additional notes:**
4263
Add a script for your package workspace in the `package.json` file.
4364

44-
### Major todos:
45-
- [ ] Documentation (to be based on Nuxt 3)
46-
- [ ] Accessibility JS hooks (Documented in Roadmap)
47-
65+
### Creating a new commit message
66+
The commits follow the [conventional commit format](https://www.conventionalcommits.org/). Husky is setup to lint your commit messages to match this format.
67+
```bash
68+
type(scope?): subject #scope is optional; multiple scopes are supported (current delimiter options: "/", "\" and ",")
69+
```
4870

49-
#### Contributors' note:
50-
Hi!
71+
For example:
5172

52-
I'm excited to finally get this project out in the open. I love working on Chakra! Of recent, between my startup(mid-pivot), school, ministry, and family, I have a limited amount of time every day, so I may not be very active online on Twitter/Discord/Github to respond to issues very actively. The reason for this is that I find that I'm most productive when I have less presence on social media(I need it to deliver my best work <3). Notwithstanding, I indeed am oft pleasantly surprised when I do see the help and support from the community and different contributors! Thank you!
73+
```bash
74+
git commit -m "feat(component): create x component"
5375
54-
I have the entire Chakra UI core team members and Vue community to thank for their support, and for every contributor who does so by opening issues, writing tests and fixing bugs. I'm generally reachable by email at `[email protected]` or on `@codebender828` on Twitter and on the Chakra UI Discord.
76+
git commit -m "chore: update x dependencies"
77+
```
5578

56-
For now I'll be hacking away at this! Blessings!
79+
For more information visit: [github.com/conventional-changelog/commitlint/#what-is-commitlint](https://github.com/conventional-changelog/commitlint/#what-is-commitlint)

_templates/generator/component/index.ts.ejs.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
to: packages/<%=h.changeCase.paramCase(name)%>/src/index.ts
33
---
44

5-
export { default as <%= h.changeCase.pascalCase(name) %> } from '@chakra-ui/<%=h.changeCase.paramCase(name)%>'
5+
export { default as <%= h.changeCase.pascalCase(name) %> } from './<%=h.changeCase.paramCase(name)%>'

_templates/generator/component/package.json.ejs.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
2929
},
3030
"sideEffects": false,
3131
"scripts": {
32-
"build": "concurrently yarn:build:*",
32+
"build": "rimraf ./dist && concurrently yarn:build:*",
3333
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps",
3434
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps",
3535
"build:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
3636
"watch": "concurrently yarn:watch:*",
3737
"watch:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps --watch",
3838
"watch:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps --watch",
39-
"watch:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch"
39+
"watch:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch --incremental"
4040
},
4141
"dependencies": {
42-
"@chakra-ui/styled-system": "^1.4.1",
42+
"@chakra-ui/styled-system": "^1.9.0",
4343
"@chakra-ui/vue-system": "*",
4444
"@chakra-ui/vue-utils": "*"
4545
},

_templates/generator/module/package.json.ejs.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
1717
"author": "Jonathan Bakebwa [email protected]",
1818
"license": "MIT",
1919
"scripts": {
20-
"build": "concurrently yarn:build:*",
20+
"build": "rimraf ./dist && concurrently yarn:build:*",
2121
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps",
2222
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps",
2323
"watch": "concurrently yarn:watch:*",
2424
"watch:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps --watch",
2525
"watch:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps --watch",
26-
"watch:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch"
26+
"watch:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch --incremental"
2727
}
2828
}

docs/.vitepress/config.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module.exports = {
2727
sidebar: {
2828
'/setup/': getSetupSidebar(),
2929
'/components/': getSetupSidebar(),
30+
'/composables/': getSetupSidebar(),
3031
'/': getSetupSidebar()
3132
}
3233
}
@@ -52,6 +53,12 @@ function getSetupSidebar() {
5253
{ text: 'CSS reset', link: '/components/css-reset' },
5354
{ text: 'Visually hidden', link: '/components/visually-hidden' },
5455
]
56+
},
57+
{
58+
text: 'Composables',
59+
children: [
60+
{ text: 'usePopper', link: '/composables/use-popper' }
61+
]
5562
}
5663
]
5764
}
@@ -70,13 +77,5 @@ function getComponentsSidebar() {
7077
{ text: 'Visually hidden', link: '/components/visually-hidden' },
7178
]
7279
},
73-
// {
74-
// text: 'Theme',
75-
// children: [
76-
// { text: 'Homepage', link: '/config/homepage' },
77-
// { text: 'Algolia Search', link: '/config/algolia-search' },
78-
// { text: 'Carbon Ads', link: '/config/carbon-ads' }
79-
// ]
80-
// }
8180
]
8281
}

0 commit comments

Comments
 (0)