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

Commit 5b2e1c2

Browse files
Merge pull request #42 from chakra-ui/refactor/use-core-utils
refactor: refactor/use core utils
2 parents eae605c + 73acd07 commit 5b2e1c2

Some content is hidden

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

85 files changed

+626
-1250
lines changed

.changeset/sweet-lamps-brake.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@chakra-ui/c-accordion': patch
3+
'@chakra-ui/c-alert': patch
4+
'@chakra-ui/c-badge': patch
5+
'@chakra-ui/c-button': patch
6+
'@chakra-ui/c-color-mode': patch
7+
'@chakra-ui/c-flex': patch
8+
'@chakra-ui/c-icon': patch
9+
'@chakra-ui/c-popper': patch
10+
'@chakra-ui/c-portal': patch
11+
'@chakra-ui/c-reset': patch
12+
'@chakra-ui/c-spinner': patch
13+
'@chakra-ui/c-theme-provider': patch
14+
'@chakra-ui/c-visually-hidden': patch
15+
'@chakra-ui/vue-next': patch
16+
'@chakra-ui/nuxt-next': patch
17+
'@chakra-ui/vue-system': patch
18+
'@chakra-ui/vue-test-utils': patch
19+
'@chakra-ui/vue-theme': patch
20+
'@chakra-ui/vue-theme-tools': patch
21+
'@chakra-ui/vue-utils': patch
22+
'@chakra-ui/vue-auto-import': patch
23+
'@chakra-ui/vue-docs': patch
24+
---
25+
26+
Extract Vue dependant utilities to "@chakra-ui/vue-utils" and consumes base utils from "@chakra-ui/utils@1.5.0"

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
1616
"files": [
1717
"dist"
1818
],
19-
19+
"exports": {
20+
".": {
21+
"require": "./dist/cjs/index.js",
22+
"default": "./dist/esm/index.js"
23+
}
24+
},
2025
"publishConfig": {
2126
"access": "public"
2227
},
@@ -25,7 +30,7 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
2530
"url": "git+https://github.com/chakra-ui/chakra-ui-vue-next.git"
2631
},
2732
"bugs": {
28-
"url": "https://github.com/chakra-ui/chakra-ui=vue-next/issues"
33+
"url": "https://github.com/chakra-ui/chakra-ui-vue-next/issues"
2934
},
3035
"sideEffects": false,
3136
"scripts": {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
1212
"files": [
1313
"dist"
1414
],
15+
"exports": {
16+
".": {
17+
"require": "./dist/cjs/index.js",
18+
"default": "./dist/esm/index.js"
19+
}
20+
},
1521
"description": "<%= 'Chakra UI Vue | ' + h.changeCase.pascalCase(name) + ' module'%>",
1622
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
1723
"author": "Jonathan Bakebwa [email protected]",

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ to: tooling/<%=h.changeCase.paramCase(name)%>/package.json
1212
"files": [
1313
"dist"
1414
],
15+
"exports": {
16+
".": {
17+
"require": "./dist/cjs/index.js",
18+
"default": "./dist/esm/index.js"
19+
}
20+
},
1521
"description": "<%= 'Chakra UI Vue | ' + h.changeCase.pascalCase(name) + ' module'%>",
1622
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
1723
"author": "Jonathan Bakebwa [email protected]",

package.json

Lines changed: 34 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
"version": "1.0.0",
44
"description": "Vue 3 compatible Chakra UI",
55
"main": "index.js",
6-
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
6+
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next",
77
"author": "Jonathan Bakebwa [email protected]",
88
"workspaces": [
99
"packages/*",
1010
"tooling/*",
1111
"website"
1212
],
1313
"scripts": {
14+
"pkg": "manypkg run",
15+
"pkgs:check": "manypkg check",
16+
"pkgs:fix": "manypkg fix",
1417
"postinstall": "yarn bootstrap",
1518
"bootstrap": "yarn run lerna bootstrap",
1619
"scaffold": "hygen",
@@ -22,57 +25,54 @@
2225
"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
2326
"docs:dev": "vitepress dev docs",
2427
"docs:build": "vitepress build docs",
25-
"docs:serve": "vitepress serve docs",
26-
"website": "yarn workspace @chakra-ui/vue-docs",
27-
"core": "yarn workspace @chakra-ui/vue-next",
28-
"nuxt": "yarn workspace @chakra-ui/nuxt-next",
29-
"system": "yarn workspace @chakra-ui/vue-system",
30-
"utils": "yarn workspace @chakra-ui/vue-utils",
31-
"theme": "yarn workspace @chakra-ui/vue-theme",
32-
"auto-import": "yarn workspace @chakra-ui/vue-auto-import",
33-
"c-alert": "yarn workspace @chakra-ui/c-alert",
34-
"c-theme-provider": "yarn workspace @chakra-ui/c-theme-provider",
35-
"c-box": "yarn workspace @chakra-ui/c-box",
36-
"c-button": "yarn workspace @chakra-ui/c-button",
37-
"c-flex": "yarn workspace @chakra-ui/c-flex",
38-
"c-icon": "yarn workspace @chakra-ui/c-icon",
39-
"c-reset": "yarn workspace @chakra-ui/c-reset",
40-
"c-spinner": "yarn workspace @chakra-ui/c-spinner",
41-
"c-badge": "yarn workspace @chakra-ui/c-badge",
42-
"c-portal": "yarn workspace @chakra-ui/c-portal",
43-
"c-popper": "yarn workspace @chakra-ui/c-popper"
28+
"docs:serve": "vitepress serve docs"
4429
},
4530
"license": "MIT",
4631
"private": true,
47-
"devDependencies": {
32+
"dependencies": {
4833
"@babel/cli": "^7.12.8",
4934
"@babel/core": "^7.12.9",
5035
"@babel/preset-env": "^7.12.7",
5136
"@babel/preset-typescript": "^7.12.7",
37+
"@chakra-ui/styled-system": "^1.10.0",
38+
"@chakra-ui/utils": "^1.5.0",
5239
"@changesets/changelog-github": "^0.3.0",
5340
"@changesets/cli": "^2.14.1",
5441
"@commitlint/cli": "^11.0.0",
5542
"@commitlint/config-conventional": "^11.0.0",
43+
"@emotion/css": "^11.1.3",
44+
"@emotion/server": "^11.0.0",
45+
"@manypkg/cli": "^0.17.0",
46+
"@popperjs/core": "^2.8.4",
5647
"@testing-library/jest-dom": "^5.11.9",
5748
"@testing-library/user-event": "^12.6.2",
5849
"@testing-library/vue": "^6.3.4",
5950
"@types/jest": "^26.0.20",
6051
"@types/jest-axe": "^3.5.1",
52+
"@types/lodash.camelcase": "^4.3.6",
53+
"@types/lodash.kebabcase": "^4.1.6",
54+
"@types/lodash.mergewith": "^4.6.6",
6155
"@types/recursive-readdir": "^2.2.0",
56+
"@types/tinycolor2": "^1.4.2",
6257
"@typescript-eslint/eslint-plugin": "^2.34.0",
6358
"@typescript-eslint/parser": "4.0.1",
64-
"@vitejs/plugin-vue": "^1.0.6",
59+
"@vitejs/plugin-vue": "^1.1.4",
6560
"@vue/babel-plugin-jsx": "^1.0.3",
66-
"@vue/compiler-sfc": "^3.0.5",
61+
"@vue/compiler-sfc": "^3.0.6",
6762
"@vue/eslint-config-typescript": "^5.1.0",
6863
"@vuedx/typecheck": "^0.4.1",
6964
"@vuedx/typescript-plugin-vue": "^0.4.1",
65+
"@vueuse/motion": "^1.4.4",
7066
"axe-core": "^4.1.2",
7167
"babel-jest": "^26.6.3",
68+
"change-case": "^4.1.1",
7269
"chokidar": "^3.5.1",
7370
"concurrently": "^5.3.0",
7471
"consola": "^2.15.0",
7572
"cross-env": "^7.0.2",
73+
"css-get-unit": "^1.0.1",
74+
"csstype": "^3.0.5",
75+
"dequal": "^2.0.2",
7676
"esbuild-jest": "^0.4.0",
7777
"eslint": "^7.0.0",
7878
"eslint-config-prettier": "^6.12.0",
@@ -92,40 +92,24 @@
9292
"jest-transform-stub": "^2.0.0",
9393
"lerna": "^3.22.1",
9494
"lint-staged": "^10.5.3",
95+
"lodash.camelcase": "^4.3.0",
96+
"lodash.kebabcase": "^4.1.1",
97+
"lodash.mergewith": "^4.6.2",
98+
"object-assign": "^4.1.1",
9599
"prettier": "^2.1.2",
96100
"pretty": "^2.0.0",
101+
"react": "^17.0.1",
97102
"recursive-readdir": "^2.2.2",
103+
"tinycolor2": "^1.4.2",
98104
"ts-jest": "^26.5.0",
99105
"ts-node": "^9.0.0",
100-
"typescript": "^4.1.2",
101-
"vite": "^2.0.0-beta.44",
106+
"typescript": "^4.1.3",
107+
"vite": "^2.0.1",
102108
"vite-plugin-components": "^0.6.6",
103-
"vite-plugin-pages": "^0.3.0",
109+
"vite-plugin-pages": "^0.5.1",
104110
"vitepress": "^0.12.0",
105-
"vue": "^3.0.5",
111+
"vue": ">=3.0.5",
106112
"vue-jest": "^5.0.0-alpha.7",
107-
"vue-router": "4.0.0-beta.10"
108-
},
109-
"dependencies": {
110-
"@chakra-ui/styled-system": "^1.9.0",
111-
"@emotion/css": "^11.1.3",
112-
"@emotion/server": "^11.0.0",
113-
"@popperjs/core": "^2.8.4",
114-
"@types/lodash.camelcase": "^4.3.6",
115-
"@types/lodash.kebabcase": "^4.1.6",
116-
"@types/lodash.mergewith": "^4.6.6",
117-
"@types/tinycolor2": "^1.4.2",
118-
"@vueuse/motion": "^1.4.4",
119-
"change-case": "^4.1.1",
120-
"css-get-unit": "^1.0.1",
121-
"csstype": "^3.0.5",
122-
"dequal": "^2.0.2",
123-
"lodash.camelcase": "^4.3.0",
124-
"lodash.kebabcase": "^4.1.1",
125-
"lodash.mergewith": "^4.6.2",
126-
"object-assign": "^4.1.1",
127-
"react": "^17.0.1",
128-
"tinycolor2": "^1.4.2",
129-
"vue": "^3.0.5"
113+
"vue-router": "^4.0.4"
130114
}
131115
}

packages/c-accordion/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './src'

packages/c-accordion/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@
88
"files": [
99
"dist"
1010
],
11+
"exports": {
12+
".": {
13+
"require": "./dist/cjs/index.js",
14+
"default": "./dist/esm/index.js"
15+
}
16+
},
1117
"description": "Chakra UI Vue | CAccordion component",
12-
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
18+
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next/tree/master/packages/c-accordion",
1319
"author": "Jonathan Bakebwa [email protected]",
1420
"license": "MIT",
1521
"scripts": {
@@ -19,6 +25,6 @@
1925
"build:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types"
2026
},
2127
"dependencies": {
22-
"@chakra-ui/vue-system": "^0.0.1-alpha.0"
28+
"@chakra-ui/vue-system": "0.0.1-alpha.0"
2329
}
2430
}

packages/c-alert/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './src'

packages/c-alert/package.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@
88
"files": [
99
"dist"
1010
],
11+
"exports": {
12+
".": {
13+
"require": "./dist/cjs/index.js",
14+
"default": "./dist/esm/index.js"
15+
}
16+
},
1117
"description": "Chakra UI Vue | CAlert component",
12-
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
18+
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next/tree/master/packages/c-alert",
1319
"author": "Jonathan Bakebwa [email protected]",
1420
"license": "MIT",
1521
"scripts": {
@@ -23,16 +29,15 @@
2329
"watch:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch --incremental"
2430
},
2531
"dependencies": {
26-
"@chakra-ui/vue-system": "^0.0.1-alpha.0",
27-
"@chakra-ui/vue-utils": "^0.0.1-alpha.0",
28-
"@chakra-ui/c-icon": "^0.0.1-alpha.0"
32+
"@chakra-ui/c-icon": "0.0.1-alpha.0",
33+
"@chakra-ui/vue-system": "0.0.1-alpha.0",
34+
"@chakra-ui/vue-utils": "0.0.1-alpha.0"
2935
},
3036
"devDependencies": {
31-
"@chakra-ui/vue-system": "^0.0.1-alpha.0",
32-
"vue": "^3.0.5"
37+
"vue": ">=3.0.5"
3338
},
3439
"peerDependencies": {
35-
"@chakra-ui/vue-system": "^0.0.1-alpha.0",
40+
"@chakra-ui/vue-system": "0.0.1-alpha.0",
3641
"vue": "^3.0.5"
3742
}
3843
}

packages/c-badge/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './src'

0 commit comments

Comments
 (0)