Skip to content

Commit da51957

Browse files
committed
chore: Package size reports.
1 parent 6cbf4f9 commit da51957

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.github/workflows/browser.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,15 @@ jobs:
3131
with:
3232
workspace_name: '@launchdarkly/js-client-sdk'
3333
workspace_path: packages/sdk/browser
34+
- name: Install Brotli
35+
if: github.event_name == 'pull_request'
36+
run: apt-get update && apt-install brotli
37+
- name: Check Package Size
38+
if: github.event_name == 'pull_request'
39+
env:
40+
PR_NUMBER: ${{ github.event.number }}
41+
run: |
42+
brotli packages/sdk/browser/dist/index.js
43+
export PR_SIZE=$(stat -c %s packages/sdk/browser/dist/index.js.br)
44+
gh pr comment $PR_NUMBER -b "`@launchdarkly/js-client-sdk` size: $PR_SIZE"
45+
[ $PR_SIZE -le 25000 ] || exit 1

packages/sdk/browser/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"scripts": {
4949
"clean": "rimraf dist",
5050
"build": "tsup",
51+
"build-with-deps": "yarn workspaces foreach -pR --topological-dev --from '@launchdarkly/js-client-sdk' run build",
5152
"lint": "eslint . --ext .ts,.tsx",
5253
"prettier": "prettier --write '**/*.@(js|ts|tsx|json|css)' --ignore-path ../../../.prettierignore",
5354
"test": "npx jest --runInBand",
@@ -59,6 +60,7 @@
5960
},
6061
"devDependencies": {
6162
"@jest/globals": "^29.7.0",
63+
"@size-limit/preset-big-lib": "^11.1.6",
6264
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
6365
"@types/jest": "^29.5.11",
6466
"@typescript-eslint/eslint-plugin": "^6.20.0",

packages/shared/sdk-client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"make-esm-package-json": "echo '{\"type\":\"module\"}' > dist/esm/package.json",
3636
"make-package-jsons": "npm run make-cjs-package-json && npm run make-esm-package-json",
3737
"build": "npx tsc --noEmit && rollup -c rollup.config.js && npm run make-package-jsons",
38+
"build-with-deps": "yarn workspaces foreach -pR --topological-dev --from '@launchdarkly/js-client-sdk-common' run build",
3839
"clean": "rimraf dist",
3940
"lint": "npx eslint . --ext .ts",
4041
"lint:fix": "yarn run lint -- --fix",

0 commit comments

Comments
 (0)