Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add size limit action and command #1

Merged
merged 4 commits into from
Mar 2, 2024
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
19 changes: 19 additions & 0 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "size"
on:
pull_request:
branches:
- main
permissions:
pull-requests: write
jobs:
size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v4
- uses: EskiMojo14/size-limit-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: build-only
size_margin: non-zero
24 changes: 24 additions & 0 deletions .size-limit.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = [
{
path: "dist/index.js",
name: "history-adapter",
},
{
path: "dist/index.cjs",
name: "history-adapter (CJS)",
},
{
path: "dist/redux.js",
name: "history-adapter/redux",
},
{
path: "dist/index.js",
import: "{ createHistoryAdapter }",
name: "import { createHistoryAdapter } from 'history-adapter'",
},
{
path: "dist/redux.js",
import: "{ createHistoryAdapter }",
name: "import { createHistoryAdapter } from 'history-adapter/redux'",
},
];
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,19 @@
"redux"
],
"scripts": {
"clean": "rimraf dist",
"prepare": "husky install",
"prebuild": "yarn type",
"build": "tsup",
"run-build": "tsup",
"build": "yarn clean && yarn type && yarn run-build",
"build-only": "yarn clean && yarn run-build",
"test": "vitest",
"lint": "eslint",
"pre-commit": "lint-staged",
"attw": "attw",
"publint": "publint",
"type": "tsc",
"prepack": "yarn publint"
"prepack": "yarn build && yarn publint",
"size": "size-limit"
},
"repository": "https://github.com/EskiMojo14/history-adapter.git",
"author": "EskiMojo14 <[email protected]>",
Expand All @@ -59,6 +62,7 @@
"prettier": "^3.1.1",
"publint": "^0.2.7",
"reselect": "^5.1.0",
"rimraf": "^5.0.5",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"vitest": "^1.1.3"
Expand All @@ -84,7 +88,9 @@
"minify": true
},
"dependencies": {
"immer": "^10.0.3"
"@size-limit/preset-small-lib": "^11.0.2",
"immer": "^10.0.3",
"size-limit": "^11.0.2"
},
"peerDependencies": {
"@reduxjs/toolkit": "^1.9.7 || ^2",
Expand Down
Loading
Loading