Skip to content

Commit 398d89f

Browse files
committed
chore: add Lighthouse CI configuration and update dependencies
1 parent bdd645f commit 398d89f

File tree

7 files changed

+786
-285
lines changed

7 files changed

+786
-285
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,25 @@ jobs:
7979
with:
8080
name: report-${{ matrix.package }}
8181

82+
# lighthouse:
83+
# continue-on-error: true
84+
# runs-on: ubuntu-latest
85+
# steps:
86+
# - name: Checkout
87+
# uses: actions/checkout@v6
88+
# with:
89+
# persist-credentials: false
90+
# - uses: ./.github/actions/pnpm-setup
91+
# - name: Build dependencies
92+
# run: pnpm --filter @public-ui/sample-react^... build
93+
# - name: Lighthouse CI
94+
# run: pnpm --filter @public-ui/sample-react lighthouse
95+
# - uses: actions/upload-artifact@v4
96+
# if: always()
97+
# with:
98+
# name: lighthouse-report
99+
# path: packages/samples/react/.lighthouseci/
100+
82101
check-results:
83102
runs-on: ubuntu-latest
84103
needs: [build-and-check, e2e-tests, visual-tests]

packages/icons/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"devDependencies": {
66
"oslllo-svg-fixer": "6.0.1",
77
"rimraf": "6.1.3",
8-
"serve": "14.2.6",
8+
"http-server": "14.1.1",
99
"svgtofont": "6.5.1"
1010
},
1111
"scripts": {
1212
"svg-fixer": "node node_modules/oslllo-svg-fixer/src/cli.js --source ./svg --destination ./svg-fixed",
1313
"delete-unused": "rimraf ../components/assets/kolicons/react && rimraf ../components/assets/kolicons/vue && rimraf ../components/assets/kolicons/kolicons.symbol.svg && rimraf ../components/assets/kolicons/style.less && rimraf ../components/assets/kolicons/style.module.less && rimraf ../components/assets/kolicons/style.scss && rimraf ../components/assets/kolicons/style.styl",
1414
"build": "pnpm svg-fixer && svgtofont --sources ./svg-fixed --output ../components/assets/kolicons && pnpm delete-unused",
1515
"prebuild": "rimraf ../components/assets/kolicons && rimraf ./svg-fixed && mkdir svg-fixed",
16-
"start": "serve"
16+
"start": "http-server"
1717
},
1818
"svgtofont": {
1919
"classNamePrefix": "kolicon",

packages/samples/react/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Thumbs.db
2525
# Other
2626
/.husky/
2727
/.reports/
28+
/.lighthouseci/
2829
.env
2930
.eslintcache
3031
/dist/

packages/samples/react/.knip.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"$schema": "https://unpkg.com/knip@5/schema.json",
33
"entry": ["src/react.main.tsx", "unocss.config.ts", "src/**/routes.ts"],
44
"ignore": ["src/scenarios/appointment-form/**"],
5-
"ignoreDependencies": ["@public-ui/components", "@public-ui/react-hook-form-adapter", "@public-ui/react-v19", "@public-ui/themes", "uno.css"],
5+
"ignoreDependencies": ["@public-ui/components", "@public-ui/react-hook-form-adapter", "@public-ui/react-v19", "@public-ui/themes", "http-server", "uno.css"],
66
"project": ["**/*.ts", "**/*.tsx"]
77
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
ci: {
3+
collect: {
4+
startServerCommand: 'npx http-server ./dist -p 8085 --silent',
5+
url: ['http://localhost:8085/'],
6+
numberOfRuns: 1,
7+
},
8+
assert: {
9+
assertions: {
10+
'categories:accessibility': ['error', { minScore: 0.95 }],
11+
'categories:performance': ['warn', { minScore: 0.7 }],
12+
'total-byte-weight': ['error', { maxNumericValue: 500000 }],
13+
},
14+
},
15+
upload: {
16+
target: 'filesystem',
17+
outputDir: '.lighthouseci',
18+
},
19+
},
20+
};

packages/samples/react/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build": "vite build",
1212
"build:deps": "pnpm --filter @public-ui/sample-react^... build",
1313
"format": "prettier --check src",
14+
"lighthouse": "lhci autorun",
1415
"lint": "pnpm lint:stylelint && pnpm lint:tsc",
1516
"lint:eslint": "eslint src",
1617
"lint:stylelint": "stylelint \"src/**/*.{css,scss}\"",
@@ -52,6 +53,7 @@
5253
},
5354
"devDependencies": {
5455
"@eslint/js": "9.39.4",
56+
"@lhci/cli": "0.15.1",
5557
"@playwright/test": "1.58.2",
5658
"@typescript-eslint/eslint-plugin": "8.57.2",
5759
"@typescript-eslint/parser": "8.57.2",
@@ -60,6 +62,7 @@
6062
"eslint-plugin-jsx-a11y": "6.10.2",
6163
"eslint-plugin-react": "7.37.5",
6264
"eslint-plugin-react-hooks": "7.0.1",
65+
"http-server": "14.1.1",
6366
"knip": "5.88.1",
6467
"npm-run-all2": "8.0.4",
6568
"prettier": "3.8.1",

0 commit comments

Comments
 (0)