Skip to content

Commit d410c2f

Browse files
chore: merge conflict
2 parents 5d28f48 + e7d5a41 commit d410c2f

File tree

17 files changed

+512
-124
lines changed

17 files changed

+512
-124
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,7 @@ module.exports = {
7474
},
7575
// Node scripts
7676
{
77-
files: [
78-
'scripts/**',
79-
'*.{js,ts}',
80-
'packages/**/index.js',
81-
'packages/size-check/**'
82-
],
77+
files: ['scripts/**', '*.{js,ts}', 'packages/**/index.js'],
8378
rules: {
8479
'no-restricted-globals': 'off',
8580
'no-restricted-syntax': 'off'

.github/contributing.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,6 @@ This repository employs a [monorepo](https://en.wikipedia.org/wiki/Monorepo) set
248248

249249
- `template-explorer`: A development tool for debugging compiler output, continuously deployed at https://template-explorer.vuejs.org/. To run it locally, run [`nr dev-compiler`](#nr-dev-compiler).
250250

251-
- `size-check`: Used for checking built bundle sizes on CI.
252-
253251
### Importing Packages
254252

255253
The packages can import each other directly using their package names. Note that when importing a package, the name listed in its `package.json` should be used. Most of the time the `@vue/` prefix is needed:

.github/workflows/ci.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,3 @@ jobs:
117117

118118
- name: Run type declaration tests
119119
run: pnpm run test-dts
120-
121-
size:
122-
runs-on: ubuntu-latest
123-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
124-
env:
125-
CI_JOB_NUMBER: 1
126-
steps:
127-
- uses: actions/checkout@v3
128-
129-
- name: Install pnpm
130-
uses: pnpm/action-setup@v2
131-
132-
- name: Set node version to the latest LTS release
133-
uses: actions/setup-node@v3
134-
with:
135-
node-version: ${{ env.NODE_VERSION }}
136-
cache: 'pnpm'
137-
138-
- run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
139-
- run: pnpm run size

.github/workflows/size-data.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: size data
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
upload:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v2
23+
24+
- name: Set node version to LTS
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: lts/*
28+
cache: pnpm
29+
30+
- name: Install dependencies
31+
run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
32+
33+
- run: pnpm run size
34+
35+
- name: Upload Size Data
36+
uses: actions/upload-artifact@v3
37+
with:
38+
name: size-data
39+
path: temp/size
40+
41+
- name: Save PR number
42+
if: ${{github.event_name == 'pull_request'}}
43+
run: echo ${{ github.event.number }} > ./pr.txt
44+
45+
- uses: actions/upload-artifact@v2
46+
if: ${{github.event_name == 'pull_request'}}
47+
with:
48+
name: pr-number
49+
path: pr.txt

.github/workflows/size-report.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: size report
2+
3+
on:
4+
workflow_run:
5+
workflows: ['size data']
6+
types:
7+
- completed
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
issues: write
13+
14+
jobs:
15+
size-report:
16+
runs-on: ubuntu-latest
17+
if: >
18+
github.event.workflow_run.event == 'pull_request' &&
19+
github.event.workflow_run.conclusion == 'success'
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v2
25+
26+
- name: Set node version to LTS
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: lts/*
30+
cache: pnpm
31+
32+
- name: Install dependencies
33+
run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
34+
35+
- name: Download PR number
36+
uses: dawidd6/action-download-artifact@v2
37+
with:
38+
name: pr-number
39+
run_id: ${{ github.event.workflow_run.id }}
40+
41+
- name: Read PR Number
42+
id: pr-number
43+
uses: juliangruber/read-file-action@v1
44+
with:
45+
path: ./pr.txt
46+
47+
- name: Download Size Data
48+
uses: dawidd6/action-download-artifact@v2
49+
with:
50+
name: size-data
51+
run_id: ${{ github.event.workflow_run.id }}
52+
path: temp/size
53+
54+
- name: Download Previous Size Data
55+
uses: dawidd6/action-download-artifact@v2
56+
with:
57+
branch: main
58+
workflow: size-data.yml
59+
event: push
60+
name: size-data
61+
path: temp/size-prev
62+
if_no_artifact_found: warn
63+
64+
- name: Compare size
65+
run: pnpm tsx scripts/size-report.ts > size-report.md
66+
67+
- name: Read Size Report
68+
id: size-report
69+
uses: juliangruber/read-file-action@v1
70+
with:
71+
path: ./size-report.md
72+
73+
- name: Create Comment
74+
uses: actions-cool/maintain-one-comment@v3
75+
with:
76+
token: ${{ secrets.GITHUB_TOKEN }}
77+
number: ${{ steps.pr-number.outputs.content }}
78+
body: |
79+
${{ steps.size-report.outputs.content }}
80+
<!-- VUE_CORE_SIZE -->
81+
body-include: '<!-- VUE_CORE_SIZE -->'

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"dev": "node scripts/dev.js",
88
"build": "node scripts/build.js",
99
"build-dts": "tsc -p tsconfig.build.json && rollup -c rollup.dts.config.js",
10-
"size": "run-s size-global size-baseline",
11-
"size-global": "node scripts/build.js vue runtime-dom -f global -p",
12-
"size-baseline": "node scripts/build.js vue -f esm-bundler-runtime && node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler && cd packages/size-check && vite build && node brotli",
10+
"size": "run-s \"size-*\" && tsx scripts/usage-size.ts",
11+
"size-global": "node scripts/build.js vue runtime-dom -f global -p --size",
12+
"size-esm-runtime": "node scripts/build.js vue -f esm-bundler-runtime",
13+
"size-esm": "node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler",
1314
"check": "tsc --incremental --noEmit",
1415
"lint": "eslint --cache --ext .ts packages/*/{src,__tests__}/**.ts",
1516
"format": "prettier --write --cache \"**/*.[tj]s?(x)\"",
@@ -81,10 +82,12 @@
8182
"lint-staged": "^10.2.10",
8283
"lodash": "^4.17.15",
8384
"magic-string": "^0.30.0",
85+
"markdown-table": "^3.0.3",
8486
"marked": "^4.0.10",
8587
"minimist": "^1.2.0",
8688
"npm-run-all": "^4.1.5",
8789
"prettier": "^3.0.1",
90+
"pretty-bytes": "^6.1.1",
8891
"pug": "^3.0.1",
8992
"puppeteer": "~19.6.0",
9093
"rollup": "^3.26.0",
@@ -94,9 +97,10 @@
9497
"semver": "^7.3.2",
9598
"serve": "^12.0.0",
9699
"simple-git-hooks": "^2.8.1",
97-
"terser": "^5.15.1",
100+
"terser": "^5.19.2",
98101
"todomvc-app-css": "^2.3.0",
99102
"tslib": "^2.5.0",
103+
"tsx": "^3.12.7",
100104
"typescript": "^5.1.6",
101105
"vite": "^4.3.0",
102106
"vitest": "^0.30.1"

packages/size-check/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/size-check/brotli.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/size-check/package.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/size-check/src/index.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/size-check/vite.config.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)