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

Commit 54c5c65

Browse files
committed
build: use preconstruct
1 parent f563023 commit 54c5c65

File tree

46 files changed

+2510
-511
lines changed

Some content is hidden

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

46 files changed

+2510
-511
lines changed

.github/workflows/pr.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
matrix:
2020
node-version: [14]
2121
steps:
22+
- name: Get Yarn cache path
23+
id: yarn-cache
24+
run: echo "::set-output name=dir::$(yarn cache dir)"
25+
2226
- name: Checkout
2327
uses: actions/checkout@v2
2428

@@ -27,6 +31,14 @@ jobs:
2731
with:
2832
node-version: ${{ matrix.node-version }}
2933

34+
- name: Load Yarn cache
35+
uses: actions/cache@v2
36+
with:
37+
path: ${{ steps.yarn-cache.outputs.dir }}
38+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-yarn-
41+
3042
- name: Install dependencies
3143
run: yarn install --frozen-lockfile && yarn bootstrap
3244

@@ -39,4 +51,32 @@ jobs:
3951
- name: Run tests
4052
run: yarn test
4153
env:
42-
CI: true
54+
CI: true
55+
56+
bundlesize:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Get Yarn cache path
60+
id: yarn-cache
61+
run: echo "::set-output name=dir::$(yarn cache dir)"
62+
63+
- name: Checkout
64+
uses: actions/checkout@master
65+
66+
- name: Setup Node.js 14.x
67+
uses: actions/setup-node@master
68+
with:
69+
node-version: 14.x
70+
71+
- name: Load Yarn cache
72+
uses: actions/cache@v2
73+
with:
74+
path: ${{ steps.yarn-cache.outputs.dir }}
75+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
76+
restore-keys: |
77+
${{ runner.os }}-yarn-
78+
- name: compressed-size-action
79+
uses: preactjs/compressed-size-action@v2
80+
with:
81+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
82+
pattern: "**/dist/**/*.prod.js"

.github/workflows/release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
name: Release
1616
runs-on: ubuntu-latest
1717
steps:
18+
- name: Get Yarn cache path
19+
id: yarn-cache
20+
run: echo "::set-output name=dir::$(yarn cache dir)"
21+
1822
- name: Checkout Repo
1923
uses: actions/checkout@master
2024
with:
@@ -27,6 +31,14 @@ jobs:
2731
with:
2832
node-version: 14
2933

34+
- name: Load Yarn cache
35+
uses: actions/cache@v2
36+
with:
37+
path: ${{ steps.yarn-cache.outputs.dir }}
38+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-yarn-
41+
3042
- name: Install dependencies
3143
run: yarn install --frozen-lockfile && yarn bootstrap
3244

.size-limit.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"path": "packages/core/dist/chakra-ui-vue-next.cjs.prod.js",
4+
"limit": "85 KB",
5+
"ignore": [
6+
"vue",
7+
"@emotion/css"
8+
]
9+
},
10+
{
11+
"path": "packages/core/dist/chakra-ui-vue-next.esm.js",
12+
"limit": "85 KB",
13+
"ignore": [
14+
"vue",
15+
"@emotion/css"
16+
]
17+
}
18+
]

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
88
"version": "1.0.0",
99
"main": "dist/cjs/index.js",
1010
"module": "dist/esm/index.js",
11-
"types": "dist/types/index.d.ts",
12-
"typings": "dist/types/index.d.ts",
1311
"author": "Jonathan Bakebwa <codebender828@gmail.com>",
1412
"homepage": "https://github.com/chakra-ui/chakra-ui-vue-next#readme",
1513
"license": "MIT",

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
77
"version": "1.0.0",
88
"main": "dist/cjs/index.js",
99
"module": "dist/esm/index.js",
10-
"types": "dist/types/index.d.ts",
11-
"typings": "dist/types/index.d.ts",
1210
"files": [
1311
"dist"
1412
],

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ to: tooling/<%=h.changeCase.paramCase(name)%>/package.json
77
"version": "1.0.0",
88
"main": "dist/cjs/index.js",
99
"module": "dist/esm/index.js",
10-
"types": "dist/types/index.d.ts",
11-
"typings": "dist/types/index.d.ts",
1210
"files": [
1311
"dist"
1412
],

components.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
2-
* Typescript support for @@chakra-ui/vue-next1.0.0-alpha.6 auto-imported
2+
* Typescript support for @@chakra-ui/vue-next1.0.0-alpha.7 auto-imported
33
* components using `vite-plugin-components`
44
*
55
* @see: https://github.com/antfu/vite-plugin-components#typescript
66
*
77
* This is a generated file. Do not edit it's contents.
88
*
9-
* This file was generated on 2021-07-29T05:01:14.847Z
9+
* This file was generated on 2021-08-24T10:32:03.469Z
1010
*/
1111

1212
import { ChakraProps } from '@chakra-ui/vue-system'
@@ -101,6 +101,7 @@ declare module 'vue' {
101101
CAlertDialogOverlay: typeof import('@chakra-ui/vue-next')['CAlertDialogOverlay']
102102
CMotion: typeof import('@chakra-ui/vue-next')['CMotion']
103103
CAnimatePresence: typeof import('@chakra-ui/vue-next')['CAnimatePresence']
104+
CCollapse: typeof import('@chakra-ui/vue-next')['CCollapse']
104105
CPortal: typeof import('@chakra-ui/vue-next')['CPortal']
105106
CScrollLock: typeof import('@chakra-ui/vue-next')['CScrollLock']
106107
CVisuallyHidden: typeof import('@chakra-ui/vue-next')['CVisuallyHidden']

package.json

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@
1111
"website"
1212
],
1313
"scripts": {
14-
"pkg": "manypkg run",
15-
"pkgs:check": "manypkg check",
16-
"pkgs:fix": "manypkg fix",
17-
"postinstall": "yarn bootstrap",
14+
"postinstall": "preconstruct dev",
15+
"dev": "preconstruct dev",
16+
"clean": "yarn workspaces run clean",
17+
"prebuild": "yarn clean",
18+
"build": "yarn preconstruct build",
19+
"postbuild": "yarn analyze",
20+
"start": "preconstruct watch",
1821
"csb:install": "yarn && yarn bootstrap",
1922
"bootstrap": "yarn run lerna bootstrap",
2023
"scaffold": "hygen generator",
2124
"release": "yarn changeset publish",
22-
"build": "lerna run build --no-private --stream",
23-
"dev": "NODE_ENV=development vite serve playground --config ./vite.config.ts --open",
25+
"playground:dev": "NODE_ENV=development vite serve playground --config ./vite.config.ts --open",
2426
"playground:build": "yarn install && yarn build && yarn bootstrap && NODE_ENV=production vite build playground --config ./vite.config.ts",
2527
"cy:open": "cypress open-ct",
2628
"cy:run": "cypress run-ct --quiet",
@@ -33,7 +35,12 @@
3335
"docs:serve:legacy": "vitepress serve docs",
3436
"docs:dev": "yarn pkg @chakra-ui/vue-docs dev",
3537
"docs:generate": "yarn pkg @chakra-ui/vue-docs generate",
36-
"docs:serve": "yarn pkg @chakra-ui/vue-docs serve"
38+
"docs:serve": "yarn pkg @chakra-ui/vue-docs serve",
39+
"pkg": "manypkg run",
40+
"pkgs:check": "manypkg check",
41+
"pkgs:fix": "manypkg fix",
42+
"size": "size-limit",
43+
"analyze": "size-limit --why"
3744
},
3845
"license": "MIT",
3946
"private": true,
@@ -57,6 +64,7 @@
5764
"@emotion/server": "^11.0.0",
5865
"@manypkg/cli": "^0.17.0",
5966
"@popperjs/core": "^2.8.4",
67+
"@preconstruct/cli": "^2.1.1",
6068
"@testing-library/jest-dom": "^5.11.9",
6169
"@testing-library/user-event": "^12.6.2",
6270
"@testing-library/vue": "^6.3.4",
@@ -150,5 +158,16 @@
150158
"vue-prism-editor": "^2.0.0-alpha.2",
151159
"vue-router": "^4.0.10",
152160
"vue3-perfect-scrollbar": "^1.5.5"
161+
},
162+
"devDependencies": {
163+
"@size-limit/file": "^5.0.3",
164+
"@size-limit/webpack": "^5.0.3",
165+
"size-limit": "^5.0.3"
166+
},
167+
"preconstruct": {
168+
"packages": [
169+
"packages/*",
170+
"tooling/*"
171+
]
153172
}
154173
}

packages/c-accordion/package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
{
22
"name": "@chakra-ui/c-accordion",
33
"version": "0.1.0-alpha.5",
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",
4+
"main": "dist/chakra-ui-c-accordion.cjs.js",
5+
"module": "dist/chakra-ui-c-accordion.esm.js",
86
"files": [
97
"dist"
108
],
119
"exports": {
1210
".": {
13-
"require": "./dist/cjs/index.js",
14-
"default": "./dist/esm/index.js"
11+
"require": "./dist/chakra-ui-c-accordion.cjs.js",
12+
"default": "./dist/chakra-ui-c-accordion.esm.js"
1513
}
1614
},
1715
"description": "Chakra UI Vue | CAccordion component",
1816
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next/tree/master/packages/c-accordion",
1917
"author": "Jonathan Bakebwa [email protected]",
2018
"license": "MIT",
2119
"scripts": {
22-
"build": "rimraf ./dist && concurrently yarn:build:*",
23-
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps",
24-
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps",
25-
"build:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types"
20+
"clean": "rimraf dist"
2621
},
2722
"dependencies": {
2823
"@chakra-ui/vue-system": "0.1.0-alpha.5"
24+
},
25+
"peerDependencies": {
26+
"vue": ">=3.0.5"
27+
},
28+
"publishConfig": {
29+
"access": "public"
2930
}
30-
}
31+
}

packages/c-alert/package.json

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,33 @@
11
{
22
"name": "@chakra-ui/c-alert",
33
"version": "1.0.0-alpha.5",
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",
4+
"main": "dist/chakra-ui-c-alert.cjs.js",
5+
"module": "dist/chakra-ui-c-alert.esm.js",
86
"files": [
97
"dist"
108
],
119
"exports": {
1210
".": {
13-
"require": "./dist/cjs/index.js",
14-
"default": "./dist/esm/index.js"
11+
"require": "./dist/chakra-ui-c-alert.cjs.js",
12+
"default": "./dist/chakra-ui-c-alert.esm.js"
1513
}
1614
},
1715
"description": "Chakra UI Vue | CAlert component",
1816
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next/tree/master/packages/c-alert",
1917
"author": "Jonathan Bakebwa [email protected]",
2018
"license": "MIT",
2119
"scripts": {
22-
"build": "rimraf ./dist && concurrently yarn:build:*",
23-
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps",
24-
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps",
25-
"build:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
26-
"watch": "yarn:watch:*",
27-
"watch:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps --watch",
28-
"watch:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps --watch",
29-
"watch:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch --incremental"
20+
"clean": "rimraf dist"
3021
},
3122
"dependencies": {
3223
"@chakra-ui/c-icon": "1.0.0-alpha.5",
3324
"@chakra-ui/vue-system": "0.1.0-alpha.5",
3425
"@chakra-ui/vue-utils": "0.1.0-alpha.5"
3526
},
36-
"devDependencies": {
37-
"vue": "^3.1.4"
27+
"peerDependencies": {
28+
"vue": ">=3.0.5"
29+
},
30+
"publishConfig": {
31+
"access": "public"
3832
}
39-
}
33+
}

0 commit comments

Comments
 (0)