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

Commit d09a90f

Browse files
Merge pull request #2 from chakra-ui/chore/use-babel
Chore/use babel
2 parents 5f41560 + 676e98f commit d09a90f

File tree

134 files changed

+8724
-424
lines changed

Some content is hidden

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

134 files changed

+8724
-424
lines changed

.eslintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extends:
1010
parser: vue-eslint-parser
1111
parserOptions:
1212
parser: '@typescript-eslint/parser'
13-
ecmaVersion: 12
13+
ecmaVersion: 2020
1414
sourceType: module
1515
plugins:
1616
- '@typescript-eslint'

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Report a bug
3+
about: Create a bug report for the Chakra UI ecosystem
4+
---
5+
6+
# Bug report
7+
8+
## Describe the bug
9+
10+
<!-- A clear and concise description of what the bug is. -->
11+
12+
## To reproduce
13+
14+
<!-- Clear and concise reproduction instructions are important for us to be
15+
able to triage your issue in a timely manner. -->
16+
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. Scroll down to '....'
20+
4. See error
21+
22+
## Minimal reproduction
23+
24+
<!-- Please provide a codesandbox link or GitHub repo with a minimal
25+
reproduction of the bug.
26+
27+
Official Chakra CodeSandbox templates:
28+
- [JavaScript CodeSandbox template](https://codesandbox.io/s/github/chakra-ui/codesandbox-react-js-template/tree/master)
29+
- [TypeScript CodeSandbox template](https://codesandbox.io/s/github/chakra-ui/codesandbox-react-ts-template/tree/master)
30+
-->
31+
32+
## Expected behavior
33+
34+
<!-- A clear and concise description of what you expected to happen. -->
35+
36+
## Screenshots
37+
38+
<!-- If applicable, add screenshots to help explain your problem. -->
39+
40+
## System information
41+
42+
- OS: [e.g. macOS, Windows]
43+
- Browser (if applies): [e.g. Chrome, Safari]
44+
- Version of @chakra-ui/core: [e.g. 1.0.0-rc.3]
45+
- Version of Node.js: [e.g. 12.11.1]
46+
47+
## Additional context
48+
49+
<!-- Add any other context about the problem here. -->
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Request a feature
3+
about: Create a feature request for the Chakra UI ecosystem
4+
---
5+
6+
# Feature request
7+
8+
## Is your feature request related to a problem? Please describe.
9+
10+
<!-- A clear and concise description of what you want and what your use case is. -->
11+
12+
## Describe the solution you'd like
13+
14+
<!-- A clear and concise description of what you want to happen. -->
15+
16+
## Describe alternatives you've considered
17+
18+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
19+
20+
## Additional context
21+
22+
<!-- Add any other context or screenshots about the feature request here. -->

.github/pull_request_template.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!-- Please refer to our contributing documentation for any questions on submitting a pull request, or let us know here if you need any help: https://github.com/chakra-ui/chakra-ui/blob/develop/CONTRIBUTING.md -->
2+
3+
## Pull request checklist
4+
5+
Please check if your PR fulfills the following requirements:
6+
7+
- [ ] Tests for the changes have been added (for bug fixes / features)
8+
- [ ] Docs have been reviewed and added / updated if needed (for bug fixes
9+
/start features)
10+
11+
## Pull request type
12+
13+
<!-- Please do not submit updates to dependencies unless it fixes an issue. -->
14+
15+
<!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. -->
16+
17+
Please check the type of change your PR introduces:
18+
19+
- [ ] Bugfix
20+
- [ ] Feature
21+
- [ ] Code style update (formatting, renaming)
22+
- [ ] Refactoring (no functional changes, no api changes)
23+
- [ ] Build related changes
24+
- [ ] Documentation content changes
25+
- [ ] Other (please describe):
26+
27+
## What is the current behavior?
28+
29+
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
30+
31+
Fixes: [ISSUE NUMBER]
32+
33+
## What is the new behavior?
34+
35+
<!-- Please describe the behavior or changes that are being added by this PR. -->
36+
37+
-
38+
-
39+
-
40+
41+
## Does this introduce a breaking change?
42+
43+
- [ ] Yes
44+
- [ ] No
45+
46+
<!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. -->
47+
48+
## Other information

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# `@chakra-ui/vue` for Vue 3 (WIP)
2+
3+
The official working repository for V1 of Chakra UI Vue wit Vue 3 support.
4+
5+
[See Roadmap](https://www.notion.so/4517ba273ef3409d8e0e9ec3d121f6c1?v=ce00244a41b74b79b4d01ee4c3aa61ec)
6+
7+
### Install dependencies
8+
```bash
9+
yarn install
10+
```
11+
12+
### Build components
13+
```bash
14+
yarn build
15+
```
16+
17+
### Component playground (based on vite)
18+
```bash
19+
yarn dev
20+
```
21+
22+
### Major todos:
23+
- [ ] Documentation (to be based on Nuxt 3)
24+
- [ ] Accessibility JS hooks (Documented in Roadmap)
25+
26+
#### Contributors' note:
27+
Hi!
28+
29+
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!
30+
31+
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.
32+
33+
For now I'll be hacking away at these projects! Blessings!

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
1818
"license": "MIT",
1919
"scripts": {
2020
"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/",
21+
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts -d dist/esm --source-maps",
22+
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts -d dist/cjs --source-maps",
2323
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types"
2424
}
2525
}

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
55
{
66
"name": "<%= '@chakra-ui/' + h.changeCase.paramCase(name)%>",
77
"version": "1.0.0",
8-
"main": "index.js",
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+
],
915
"description": "<%= 'Chakra UI Vue | ' + h.changeCase.pascalCase(name) + ' module'%>",
1016
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
1117
"author": "Jonathan Bakebwa [email protected]",
1218
"license": "MIT",
1319
"scripts": {
1420
"build": "concurrently yarn:build:*",
15-
"build:esm": "cross-env swc src --out-dir dist/esm/",
16-
"build:cjs": "cross-env swc -C module.type=commonjs src --out-dir dist/cjs/"
21+
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts -d dist/esm --source-maps",
22+
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts -d dist/cjs --source-maps"
1723
}
1824
}

babel.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const BABEL_ENV = process.env.BABEL_ENV
2+
const isCommonJS = BABEL_ENV !== undefined && BABEL_ENV === 'cjs'
3+
const isESM = BABEL_ENV !== undefined && BABEL_ENV === 'esm'
4+
5+
module.exports = function (api) {
6+
api.cache(true)
7+
8+
const presets = [
9+
[
10+
'@babel/env',
11+
{
12+
loose: true,
13+
modules: isCommonJS ? 'commonjs' : false,
14+
targets: {
15+
esmodules: isESM ? true : undefined,
16+
},
17+
},
18+
],
19+
'@babel/preset-typescript',
20+
]
21+
22+
return {
23+
presets,
24+
}
25+
}

package.json

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
1414
"scaffold": "hygen",
1515
"playground:routes": "ts-node ./scripts/parse-routes.ts",
16-
"playground": "yarn playground:routes && NODE_ENV=development vite serve playground",
17-
"playground:build": "yarn playground:routes && NODE_ENV=production vite build playground",
16+
"dev": "yarn playground:routes && NODE_ENV=development vite serve playground",
17+
"playground:build": "yarn build && yarn playground:routes && NODE_ENV=production vite build playground",
1818
"c-alert": "yarn workspace @chakra-ui/c-alert",
1919
"c-box": "yarn workspace @chakra-ui/c-box",
2020
"c-button": "yarn workspace @chakra-ui/c-button",
@@ -23,12 +23,14 @@
2323
"license": "MIT",
2424
"private": true,
2525
"devDependencies": {
26-
"@swc/cli": "^0.1.26",
27-
"@swc/core": "^1.2.28",
26+
"@babel/cli": "^7.12.8",
27+
"@babel/core": "^7.12.9",
28+
"@babel/preset-env": "^7.12.7",
29+
"@babel/preset-typescript": "^7.12.7",
2830
"@types/jest": "^26.0.14",
2931
"@types/recursive-readdir": "^2.2.0",
3032
"@typescript-eslint/eslint-plugin": "^2.34.0",
31-
"@typescript-eslint/parser": "^2.34.0",
33+
"@typescript-eslint/parser": "4.0.1",
3234
"@vue/eslint-config-typescript": "^5.1.0",
3335
"concurrently": "^5.3.0",
3436
"consola": "^2.15.0",
@@ -48,12 +50,20 @@
4850
"prettier": "^2.1.2",
4951
"recursive-readdir": "^2.2.2",
5052
"ts-node": "^9.0.0",
51-
"typescript": "^4.0.3",
52-
"vite": "^1.0.0-rc.4",
53-
"vue": "^3.0.0",
53+
"typescript": "^4.1.2",
54+
"vite": "^1.0.0-rc.13",
55+
"vue": "^3",
5456
"vue-router": "4.0.0-beta.10"
5557
},
5658
"dependencies": {
57-
"change-case": "^4.1.1"
59+
"@chakra-ui/theme-vue": "^0.2.6",
60+
"@types/lodash.mergewith": "^4.6.6",
61+
"@types/tinycolor2": "^1.4.2",
62+
"change-case": "^4.1.1",
63+
"css-get-unit": "^1.0.1",
64+
"csstype": "^3.0.5",
65+
"lodash.mergewith": "^4.6.2",
66+
"object-assign": "^4.1.1",
67+
"tinycolor2": "^1.4.2"
5868
}
5969
}

packages/c-accordion/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "@chakra-ui/c-accordion",
3+
"version": "1.0.0",
4+
"main": "dist/cjs/index.js",
5+
"module": "dist/esm/index.js",
6+
"types": "dist/types/index.d.ts",
7+
"typings": "dist/types/index.d.ts",
8+
"files": [
9+
"dist"
10+
],
11+
"description": "Chakra UI Vue | CAccordion component",
12+
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
13+
"author": "Jonathan Bakebwa [email protected]",
14+
"license": "MIT",
15+
"scripts": {
16+
"build": "concurrently yarn:build:*",
17+
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts -d dist/esm --source-maps",
18+
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts -d dist/cjs --source-maps",
19+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types"
20+
}
21+
}

0 commit comments

Comments
 (0)