Skip to content

Commit ff910bf

Browse files
committed
feat: first blood, should just work
1 parent b98a6ce commit ff910bf

File tree

26 files changed

+564
-253
lines changed

26 files changed

+564
-253
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"changelog": [
44
"@changesets/changelog-github",
55
{
6-
"repo": "un-ts/mono-lib-boilerplate"
6+
"repo": "un-ts/size-limit"
77
}
88
],
99
"commit": false,

.github/workflows/pkg-size.yml

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

.github/workflows/size-limit.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Size Limit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
size-limit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Setup pnpm
15+
uses: pnpm/action-setup@v2
16+
with:
17+
version: latest
18+
19+
- name: Setup Node.js 16
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 16
23+
cache: pnpm
24+
25+
- name: Install Dependencies
26+
run: pnpm i
27+
28+
- uses: andresz1/size-limit-action@v1
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
skip_step: install
32+
script: pnpm size-limit --json

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ public-hoist-pattern[]=@pkgr/*
66
public-hoist-pattern[]=@types/*
77
public-hoist-pattern[]=cross-env
88
public-hoist-pattern[]=core-js
9+
public-hoist-pattern[]=esbuild
910
public-hoist-pattern[]=*eslint*
1011
public-hoist-pattern[]=*/loader
1112
public-hoist-pattern[]=*-loader
12-
public-hoist-pattern[]=jest
1313
public-hoist-pattern[]=lint-staged
1414
public-hoist-pattern[]=npm-run-all
1515
public-hoist-pattern[]=*prettier*

.stylelintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ lib
44
LICENSE
55
*.json
66
*.log
7+
*.patch
78
*.tsbuildinfo
89
*.yaml
910
*.yml

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6-
- [pkg](./packages/pkg/CHANGELOG.md)
6+
- [size-limit-node-esbuild](./packages/node-esbuild/CHANGELOG.md)
7+
- [size-limit-preset-node-lib](./packages/preset-node-lib/CHANGELOG.md)

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
# mono-lib-boilerplate
1+
# size-limit
22

3-
[![GitHub Actions](https://github.com/un-ts/mono-lib-boilerplate/workflows/CI/badge.svg)](https://github.com/un-ts/mono-lib-boilerplate/actions/workflows/ci.yml)
4-
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/un-ts/mono-lib-boilerplate.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/un-ts/mono-lib-boilerplate/context:javascript)
5-
[![Codecov](https://img.shields.io/codecov/c/gh/un-ts/mono-lib-boilerplate)](https://codecov.io/gh/un-ts/mono-lib-boilerplate)
6-
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fun-ts%2Fmono-lib-boilerplate%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
7-
[![GitHub release](https://img.shields.io/github/release/un-ts/mono-lib-boilerplate)](https://github.com/un-ts/mono-lib-boilerplate/releases)
3+
[![GitHub Actions](https://github.com/un-ts/size-limit/workflows/CI/badge.svg)](https://github.com/un-ts/size-limit/actions/workflows/ci.yml)
4+
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/un-ts/size-limit.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/un-ts/size-limit/context:javascript)
5+
[![Codecov](https://img.shields.io/codecov/c/gh/un-ts/size-limit)](https://codecov.io/gh/un-ts/size-limit)
6+
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fun-ts%2Fsize-limit%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
7+
[![GitHub release](https://img.shields.io/github/release/un-ts/size-limit)](https://github.com/un-ts/size-limit/releases)
88

99
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
1010
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
1111
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
1212
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
1313
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)
1414

15-
> A simple mono library boilerplate
15+
> Incredible [`size-limit`](https://github.com/ai/size-limit) plugins, make `size-limit` greater
1616
1717
## Packages
1818

1919
This repository is a monorepo managed by [changesets][] what means we actually publish several packages to npm from same codebase, including:
2020

21-
| Package | Description | Version |
22-
| ---------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23-
| [`pkg`](/packages/pkg) | A simple package | [![npm](https://img.shields.io/npm/v/pkg.svg)](https://www.npmjs.com/package/pkg) [![View changelog](https://img.shields.io/badge/changelog-explore-brightgreen)](https://changelogs.xyz/pkg) |
21+
| Package | Description | Version |
22+
| --------------------------------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
23+
| [`size-limit-node-esbuild`](/packages/node-esbuild) | Node esbuild plugin for Size Limit | [![npm](https://img.shields.io/npm/v/size-limit-node-esbuild.svg)](https://www.npmjs.com/package/size-limit-node-esbuild) [![View changelog](https://img.shields.io/badge/changelog-explore-brightgreen)](https://changelogs.xyz/size-limit-node-esbuild) |
24+
| [`size-limit-preset-node-lib`](/packages/preset-node-lib) | Size Limit preset for Node libraries | [![npm](https://img.shields.io/npm/v/size-limit-preset-node-lib.svg)](https://www.npmjs.com/package/size-limit-preset-node-lib) [![View changelog](https://img.shields.io/badge/changelog-explore-brightgreen)](https://changelogs.xyz/size-limit-preset-node-lib) |
2425

2526
## Sponsors
2627

package.json

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "mono-lib-boilerplate",
2+
"name": "@unts/size-limit",
33
"version": "0.0.0",
44
"type": "module",
5-
"description": "A simple mono library boilerplate",
6-
"repository": "git+https://github.com/un-ts/mono-lib-boilerplate.git",
5+
"description": "Incredible `size-limit` plugins, make `size-limit` greater",
6+
"repository": "git+https://github.com/un-ts/size-limit.git",
77
"author": "JounQin (https://www.1stG.me) <[email protected]>",
88
"license": "MIT",
99
"private": true,
@@ -18,7 +18,6 @@
1818
"clean": "rimraf 'packages/**/{lib,*.tsbuildinfo}'",
1919
"codesanbox:install": "npx [email protected] i",
2020
"dev": "w -e docs --disableDotRule --publicPath /",
21-
"jest": "node --experimental-vm-modules node_modules/.bin/jest",
2221
"lint": "run-p lint:*",
2322
"lint:es": "eslint . --cache -f friendly",
2423
"lint:style": "stylelint . --cache",
@@ -28,7 +27,7 @@
2827
"prerelease": "pnpm build",
2928
"release": "changeset publish",
3029
"serve": "sirv dist -s",
31-
"test": "jest",
30+
"test": "size-limit",
3231
"typecov": "type-coverage",
3332
"vercel-build": "w -e docs -p --publicPath /",
3433
"version": "changeset version"
@@ -40,19 +39,19 @@
4039
"@changesets/cli": "^2.23.2",
4140
"@pkgr/webpack": "^3.1.2",
4241
"@pkgr/webpack-mdx": "^2.0.3",
43-
"@types/jest": "^28.1.5",
42+
"@types/nanoid": "^3.0.0",
4443
"@types/node": "^18.0.4",
4544
"@types/react": "^18.0.15",
4645
"@types/react-dom": "^18.0.6",
4746
"@types/web": "^0.0.69",
4847
"github-markdown-css": "^5.1.0",
49-
"pkg": "workspace:*",
5048
"react": "^18.2.0",
5149
"react-dom": "^18.2.0",
5250
"react-router-dom": "^6.3.0",
5351
"sirv-cli": "^2.0.2",
54-
"ts-jest": "^28.0.5",
55-
"tsx": "^3.8.0",
52+
"size-limit": "^7.0.8",
53+
"size-limit-node-esbuild": "workspace:*",
54+
"size-limit-preset-node-lib": "workspace:*",
5655
"type-coverage": "^2.22.0",
5756
"typescript": "^4.7.4"
5857
},
@@ -76,17 +75,9 @@
7675
"/pnpm-lock.yaml",
7776
"!/.*.cjs"
7877
],
79-
"jest": {
80-
"preset": "ts-jest/presets/default-esm",
81-
"collectCoverage": true,
82-
"globals": {
83-
"ts-jest": {
84-
"useESM": true
85-
}
86-
},
87-
"moduleNameMapper": {
88-
"^(\\.{1,2}/.*)\\.js$": "$1",
89-
"pkg": "<rootDir>/packages/pkg/src"
78+
"pnpm": {
79+
"patchedDependencies": {
80+
9081
}
9182
},
9283
"prettier": "@1stg/prettier-config",
@@ -100,6 +91,14 @@
10091
"@1stg"
10192
]
10293
},
94+
"size-limit": [
95+
{
96+
"path": "./packages/node-esbuild/lib/index.js"
97+
},
98+
{
99+
"path": "./packages/preset-node-lib/lib/index.js"
100+
}
101+
],
103102
"stylelint": {
104103
"extends": "@1stg/stylelint-config"
105104
},
File renamed without changes.

packages/pkg/README.md renamed to packages/node-esbuild/README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
# pkg
1+
# size-limit-node-esbuild
22

3-
A simple package
3+
Node esbuild plugin for Size Limit
44

55
## TOC <!-- omit in toc -->
66

77
- [Usage](#usage)
88
- [Install](#install)
9-
- [API](#api)
109
- [Sponsors](#sponsors)
1110
- [Backers](#backers)
1211
- [Changelog](#changelog)
@@ -18,21 +17,13 @@ A simple package
1817

1918
```sh
2019
# pnpm
21-
pnpm add pkg
20+
pnpm add -D size-limit-node-esbuild
2221

2322
# yarn
24-
yarn add pkg
23+
yarn add -D size-limit-node-esbuild
2524

2625
# npm
27-
npm i pkg
28-
```
29-
30-
### API
31-
32-
```js
33-
import echo from 'pkg'
34-
35-
echo()
26+
npm i -D size-limit-node-esbuild
3627
```
3728

3829
## Sponsors

0 commit comments

Comments
 (0)