Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check bundle size
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
pull-requests: write

jobs:
sizecheck:
runs-on: ubuntu-latest
env:
CI_RUN: true
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v4
- uses: andresz1/size-limit-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
package_manager: pnpm
22 changes: 22 additions & 0 deletions .size-limit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { SizeLimitConfig } from "size-limit";

module.exports = [
{
name: "createTypedChannel",
path: "dist/index.js",
import: "{ createTypedChannel }",
limit: "254 B",
},
{
name: "createPostMessageTransport",
path: "dist/index.js",
import: "{ createPostMessageTransport }",
limit: "86 B",
},
{
name: "createEventTargetTransport",
path: "dist/index.js",
import: "{ createEventTargetTransport }",
limit: "109 B",
},
] satisfies SizeLimitConfig;
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
A type-safe communication channel for sending and receiving messages between different contexts in a TypeScript environment.

[![npm version](https://img.shields.io/npm/v/typed-channel.svg)](https://www.npmjs.com/package/typed-channel)
[![Bundle size](https://img.shields.io/badge/Bundle_size-from_363_B-brightgreen)](https://github.com/psd-coder/typed-channel/blob/main/.size-limit.ts)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

## Features
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"lint": "pnpm --parallel /^lint:*/",
"lint:oxlint": "oxlint",
"lint:prettier": "prettier --check .",
"lint:size": "pnpm build && size-limit",
"format": "prettier . --write",
"typecheck": "tsc --noEmit",
"test": "vitest run",
Expand All @@ -39,8 +40,10 @@
},
"packageManager": "pnpm@10.8.1",
"devDependencies": {
"@size-limit/preset-small-lib": "^11.2.0",
"oxlint": "^0.16.6",
"prettier": "^3.5.3",
"size-limit": "^11.2.0",
"tsup": "^8.4.0",
"typescript": "^5.8.3",
"vite": "^6.3.1",
Expand Down
112 changes: 97 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.