@sebastienrousseau/size-limit-config 0.0.3 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.size-limit.js CHANGED
@@ -1,3 +1,6 @@
1
+ // SPDX-FileCopyrightText: 2026 Sebastien Rousseau <sebastian.rousseau@gmail.com>
2
+ // SPDX-License-Identifier: Apache-2.0 OR MIT
3
+
1
4
  module.exports = [
2
5
  {
3
6
  path: "dist/index.js",
package/README.md CHANGED
@@ -17,30 +17,30 @@
17
17
  <a href="https://scorecard.dev/viewer/?uri=github.com/sebastienrousseau/size-limit-config"><img src="https://img.shields.io/ossf-scorecard/github.com/sebastienrousseau/size-limit-config?style=for-the-badge&label=OpenSSF%20Scorecard&logo=openssf" alt="OpenSSF Scorecard" /></a>
18
18
  <a href="https://www.bestpractices.dev/projects/14519"><img src="https://img.shields.io/cii/level/14519?style=for-the-badge&label=OpenSSF%20Best%20Practices&logo=openssf" alt="OpenSSF Best Practices" /></a>
19
19
  <a href="LICENSE-APACHE"><img src="https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue.svg?style=for-the-badge" alt="License: Apache-2.0 OR MIT" /></a>
20
- <a href="#minimum-toolchain-policy"><img src="https://img.shields.io/badge/node->=%2018.0.0-93450a.svg?style=for-the-badge&logo=node.js" alt="Node >= 18.0.0" /></a>
20
+ <a href="#minimum-toolchain-policy"><img src="https://img.shields.io/badge/node->=%2020.0.0-93450a.svg?style=for-the-badge&logo=node.js" alt="Node >= 20.0.0" /></a>
21
21
  </p>
22
22
 
23
23
  ---
24
24
 
25
25
  ## Contents
26
26
 
27
- **Getting started**
27
+ ### Getting started
28
28
 
29
29
  - [Install](#install) — npm, pnpm, yarn, bun, source
30
30
  - [Requirements](#requirements) — runtime floor, platform support
31
31
  - [Quick Start](#quick-start) — import and extend in seconds
32
32
 
33
- **The configuration ecosystem**
33
+ ### Ecosystem
34
34
 
35
35
  - [The configuration ecosystem](#the-configuration-ecosystem) — `@sebastienrousseau/config` family map at a glance
36
36
 
37
- **Configuration reference**
37
+ ### Configuration reference
38
38
 
39
39
  - [Why this approach?](#why-this-approach) — design rationale and engineering principles
40
40
  - [Performance Bundle Budget Enforcement](#performance-bundle-budget-enforcement) — before and after rule comparison
41
41
  - [Module compatibility](#module-compatibility) — dual CJS/ESM exports and TypeScript declarations
42
42
 
43
- **Operational**
43
+ ### Operational
44
44
 
45
45
  - [When not to use this configuration](#when-not-to-use-this-configuration) — boundaries and limitations
46
46
  - [Development](#development) — make targets, validation, test suite
@@ -84,7 +84,7 @@ make # check + test
84
84
 
85
85
  ## Requirements
86
86
 
87
- - **Node.js 18.0.0 or newer.** Every package manifest declares `engines.node`, and CI enforces the runtime floor on every push across macOS, Linux, and Windows.
87
+ - **Node.js 20.0.0 or newer.** Declared in `engines.node` and proved on every push: the CI matrix runs Node 20, 22, 24 on Linux, macOS and Windows, and fails if the matrix floor and `engines.node` disagree.
88
88
  - **npm 9.0.0 or newer** (or modern pnpm / yarn / bun).
89
89
  - **Module systems.** Full native support for ECMAScript Modules (ESM) and CommonJS (CJS).
90
90
  - **TypeScript 5.0 or newer** (optional, recommended for type checking).
@@ -93,27 +93,14 @@ make # check + test
93
93
 
94
94
  ## Quick Start
95
95
 
96
- ### In `package.json`
96
+ Size Limit reads `.size-limit.json`, or a JS config that requires this package.
97
97
 
98
- ```json
99
- {
100
- "size-limit": "@sebastienrousseau/size-limit-config"
101
- }
102
- ```
103
-
104
- ### In CommonJS Configuration
98
+ ### .size-limit.cjs
105
99
 
106
100
  ```js
107
101
  module.exports = require("@sebastienrousseau/size-limit-config");
108
102
  ```
109
103
 
110
- ### In ES Module Configuration
111
-
112
- ```js
113
- import config from "@sebastienrousseau/size-limit-config";
114
- export default config;
115
- ```
116
-
117
104
  ---
118
105
 
119
106
  ## The configuration ecosystem
@@ -124,25 +111,42 @@ export default config;
124
111
  | :--- | :--- | :--- |
125
112
  | [`@sebastienrousseau/biome-config`](https://github.com/sebastienrousseau/biome-config) | Rust-powered linting & formatting | Biome 1.9+ |
126
113
  | [`@sebastienrousseau/browserslist-config`](https://github.com/sebastienrousseau/browserslist-config) | Target browser matrix | Browserslist 4+ |
114
+ | [`@sebastienrousseau/c-config`](https://github.com/sebastienrousseau/c-config) | Modern C23 clang-format and clang-tidy rules | Clang 18+ / C23 |
127
115
  | [`@sebastienrousseau/c8-config`](https://github.com/sebastienrousseau/c8-config) | V8 native code coverage thresholds | c8 / V8 |
128
116
  | [`@sebastienrousseau/commitlint-config`](https://github.com/sebastienrousseau/commitlint-config) | Conventional Commits standard | Commitlint 19+ |
117
+ | [`@sebastienrousseau/cpp-config`](https://github.com/sebastienrousseau/cpp-config) | Modern C++23 clang-format, tidy & cmake rules | Clang 18+ / C++23 |
118
+ | [`@sebastienrousseau/csharp-config`](https://github.com/sebastienrousseau/csharp-config) | C# Roslyn analyzers and OmniSharp rules | .NET 8/9 / Roslyn |
119
+ | [`@sebastienrousseau/dart-config`](https://github.com/sebastienrousseau/dart-config) | Dart and Flutter analysis_options presets | Dart 3.x / Flutter |
129
120
  | [`@sebastienrousseau/docker-config`](https://github.com/sebastienrousseau/docker-config) | Multi-stage Docker hardening | Hadolint / BuildKit |
130
121
  | [`@sebastienrousseau/eslint-config`](https://github.com/sebastienrousseau/eslint-config) | Strict ECMAScript & TypeScript linting | ESLint 9+ Flat Config |
122
+ | [`@sebastienrousseau/go-config`](https://github.com/sebastienrousseau/go-config) | Golangci-lint, staticcheck, and revive rules | Go 1.22+ / golangci-lint |
123
+ | [`@sebastienrousseau/java-config`](https://github.com/sebastienrousseau/java-config) | Checkstyle, SpotBugs, and PMD rulesets | Java 21+ / Checkstyle |
131
124
  | [`@sebastienrousseau/jsdoc-config`](https://github.com/sebastienrousseau/jsdoc-config) | Structured API documentation generation | JSDoc 4+ |
132
125
  | [`@sebastienrousseau/knip-config`](https://github.com/sebastienrousseau/knip-config) | Unused files, exports & dependencies audit | Knip 5+ |
126
+ | [`@sebastienrousseau/kotlin-config`](https://github.com/sebastienrousseau/kotlin-config) | Official ktlint formatting and Detekt analysis | Kotlin 2.0+ / Detekt |
133
127
  | [`@sebastienrousseau/lefthook-config`](https://github.com/sebastienrousseau/lefthook-config) | Fast, parallel Git hook automation | Lefthook 1.7+ |
128
+ | [`@sebastienrousseau/lua-config`](https://github.com/sebastienrousseau/lua-config) | Lua 5.4, Neovim LuaCheck and StyLua presets | Lua 5.4 / StyLua |
134
129
  | [`@sebastienrousseau/markdownlint-config`](https://github.com/sebastienrousseau/markdownlint-config) | Markdown document style & structure | markdownlint-cli2 |
135
130
  | [`@sebastienrousseau/mocha-config`](https://github.com/sebastienrousseau/mocha-config) | BDD testing settings & reporting | Mocha 10+ |
136
131
  | [`@sebastienrousseau/oxlint-config`](https://github.com/sebastienrousseau/oxlint-config) | Sub-millisecond Rust JavaScript linting | Oxlint |
132
+ | [`@sebastienrousseau/php-config`](https://github.com/sebastienrousseau/php-config) | PER-CS 2.0, PSR-12 and Level 8 PHPStan | PHP 8.3+ / PHPStan |
137
133
  | [`@sebastienrousseau/playwright-config`](https://github.com/sebastienrousseau/playwright-config) | Cross-browser end-to-end testing | Playwright 1.40+ |
138
134
  | [`@sebastienrousseau/prettier-config`](https://github.com/sebastienrousseau/prettier-config) | Deterministic code formatting | Prettier 3+ |
135
+ | [`@sebastienrousseau/python-config`](https://github.com/sebastienrousseau/python-config) | Hardened Ruff, Black, Flake8, and MyPy rules | Python 3.12+ / Ruff |
136
+ | [`@sebastienrousseau/r-config`](https://github.com/sebastienrousseau/r-config) | Lintr and styler presets for data science | R 4.3+ / lintr |
139
137
  | [`@sebastienrousseau/remark-config`](https://github.com/sebastienrousseau/remark-config) | AST-based markdown verification | Remark 13+ |
138
+ | [`@sebastienrousseau/ruby-config`](https://github.com/sebastienrousseau/ruby-config) | RuboCop and StandardRB rules for Ruby 3.3+ | Ruby 3.3+ / RuboCop |
139
+ | [`@sebastienrousseau/rust-config`](https://github.com/sebastienrousseau/rust-config) | Hardened rustfmt formatting and Clippy lints | Rust 2021 / Clippy |
140
140
  | [`@sebastienrousseau/semantic-release-config`](https://github.com/sebastienrousseau/semantic-release-config) | Tag-driven automated releases & changelogs | semantic-release 24+ |
141
+ | [`@sebastienrousseau/shell-config`](https://github.com/sebastienrousseau/shell-config) | Strict ShellCheck static analysis & shfmt presets | POSIX / Bash / ShellCheck |
141
142
  | [`@sebastienrousseau/size-limit-config`](https://github.com/sebastienrousseau/size-limit-config) | Performance bundle budget enforcement | Size Limit 11+ |
143
+ | [`@sebastienrousseau/sql-config`](https://github.com/sebastienrousseau/sql-config) | Dialect-aware SQLFluff linting & formatting | SQLFluff / ANSI SQL |
142
144
  | [`@sebastienrousseau/stylelint-config`](https://github.com/sebastienrousseau/stylelint-config) | Modern CSS & SCSS quality assurance | Stylelint 16+ |
145
+ | [`@sebastienrousseau/swift-config`](https://github.com/sebastienrousseau/swift-config) | Strict SwiftLint rules & SwiftFormat presets | Swift 5.10 / SwiftLint |
143
146
  | [`@sebastienrousseau/tailwindcss-config`](https://github.com/sebastienrousseau/tailwindcss-config) | Utility-first design tokens & typography | Tailwind CSS 4+ |
144
147
  | [`@sebastienrousseau/tsconfig-config`](https://github.com/sebastienrousseau/tsconfig-config) | Strict type checking & modern module resolution | TypeScript 5+ |
145
148
  | [`@sebastienrousseau/vitest-config`](https://github.com/sebastienrousseau/vitest-config) | Lightning-fast Vite-native unit testing | Vitest 2+ |
149
+ | [`@sebastienrousseau/zig-config`](https://github.com/sebastienrousseau/zig-config) | Hardened ZLS and build formatting rules | Zig 0.13+ / ZLS |
146
150
 
147
151
  To adopt the complete suite with a single import, install the master meta-package:
148
152
 
@@ -158,9 +162,9 @@ Configuration rot is one of the most common vectors for project decay. Ad-hoc to
158
162
 
159
163
  `@sebastienrousseau/size-limit-config` solves this with three deliberate engineering choices:
160
164
 
161
- 1. **Zero Runtime Dependencies**: The configuration contains only static, serialisable declarative definitions and clean programmatic adapters.
162
- 2. **Dual CJS/ESM Architecture**: Ships dedicated CommonJS (`index.cjs`) and ES Module (`index.mjs`) entrypoints alongside comprehensive TypeScript declarations (`index.d.ts`).
163
- 3. **Deterministic Governance**: Versioned strictly by `+0.0.1` per release, cryptographically signed with published PGP keys, and audited continuously.
165
+ 1. **Zero Runtime Dependencies**: The configuration contains only static, serialisable declarative definitions and clean programmatic adapters.
166
+ 1. **Dual CJS/ESM Architecture**: Ships dedicated CommonJS (`index.cjs`) and ES Module (`index.mjs`) entrypoints alongside comprehensive TypeScript declarations (`index.d.ts`).
167
+ 1. **Deterministic Governance**: Versioned strictly by `+0.0.1` per release, cryptographically signed with published PGP keys, and audited continuously.
164
168
 
165
169
  ---
166
170
 
@@ -228,15 +232,17 @@ make test
228
232
 
229
233
  ## Security
230
234
 
231
- - **Private Reporting**: Report security vulnerabilities by emailing **sebastian.rousseau@gmail.com**. Expect an initial response within 48 hours and a mitigation plan within 7 days.
235
+ - **Private Reporting**: Report security vulnerabilities by emailing **<sebastian.rousseau@gmail.com>**. Expect an initial response within 48 hours and a mitigation plan within 7 days.
232
236
  - **Commit Integrity**: All commits on `main` and release tags are cryptographically signed.
233
- - **Release Signing Key**: The release-signing PGP key is published in [`KEYS.asc`](KEYS.asc):
234
- ```text
235
- 4B7F16C909C7A8EE9BED338A4F047EDF5F90F638
236
- ```
237
- Signing key `Sebastien Rousseau <sebastian.rousseau@gmail.com>`, ed25519, expires 2028-08-16.
237
+ - **Release Signing Key**: The release-signing PGP key is published in [`KEYS.asc`](KEYS.asc).
238
238
  - **Supply Chain**: Monitored continuously via Dependabot, CodeQL, and SLSA provenance. See [`SECURITY.md`](SECURITY.md) for details.
239
239
 
240
+ ```text
241
+ 4B7F16C909C7A8EE9BED338A4F047EDF5F90F638
242
+ ```
243
+
244
+ Signing key `Sebastien Rousseau <sebastian.rousseau@gmail.com>`, ed25519, expires 2028-08-16.
245
+
240
246
  ---
241
247
 
242
248
  ## Documentation
@@ -259,10 +265,10 @@ make test
259
265
 
260
266
  ## Minimum-toolchain policy
261
267
 
262
- The minimum supported Node.js version is **18.0.0**. The floor may raise only when:
268
+ The minimum supported Node.js version is **20.0.0**. The floor may raise only when:
263
269
 
264
- 1. An upstream LTS version reaches official End-of-Life (EOL).
265
- 2. The reason is explicitly recorded in `CHANGELOG.md` and `DEVELOPMENT.md`.
270
+ 1. An upstream LTS version reaches official End-of-Life (EOL).
271
+ 1. The reason is explicitly recorded in `CHANGELOG.md` and `DEVELOPMENT.md`.
266
272
 
267
273
  ---
268
274
 
package/index.cjs CHANGED
@@ -1,3 +1,6 @@
1
+ // SPDX-FileCopyrightText: 2026 Sebastien Rousseau <sebastian.rousseau@gmail.com>
2
+ // SPDX-License-Identifier: Apache-2.0 OR MIT
3
+
1
4
  /**
2
5
  * Modern Size Limit CommonJS Configuration
3
6
  */
package/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- export interface SizeLimitConfig {
2
- [key: string]: unknown;
3
- }
1
+ // SPDX-FileCopyrightText: 2026 Sebastien Rousseau <sebastian.rousseau@gmail.com>
2
+ // SPDX-License-Identifier: Apache-2.0 OR MIT
3
+
4
+ export type SizeLimitConfig = ReadonlyArray<Record<string, unknown>>;
4
5
 
5
6
  declare const config: SizeLimitConfig;
6
7
  export default config;
package/index.js CHANGED
@@ -1 +1,7 @@
1
+ // SPDX-FileCopyrightText: 2026 Sebastien Rousseau <sebastian.rousseau@gmail.com>
2
+ // SPDX-License-Identifier: Apache-2.0 OR MIT
3
+
4
+ "use strict";
5
+
6
+ // Legacy `main` entrypoint; the implementation lives in index.cjs.
1
7
  module.exports = require("./index.cjs");
package/index.mjs CHANGED
@@ -1,5 +1,14 @@
1
+ // SPDX-FileCopyrightText: 2026 Sebastien Rousseau <sebastian.rousseau@gmail.com>
2
+ // SPDX-License-Identifier: Apache-2.0 OR MIT
3
+
1
4
  /**
2
- * Modern Size Limit ESM Configuration
5
+ * ESM entrypoint.
6
+ *
7
+ * The configuration is defined once, in `index.cjs`, and re-exported here so the
8
+ * two module systems cannot drift apart. Node resolves a CommonJS default import
9
+ * to `module.exports`, which is exactly the value consumers of the CJS entry get.
3
10
  */
4
- import config from "./.size-limit.js";
11
+
12
+ import config from "./index.cjs";
13
+
5
14
  export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sebastienrousseau/size-limit-config",
3
- "version": "0.0.3",
3
+ "version": "0.0.7",
4
4
  "description": "Shareable Size Limit configuration rules enforcing strict performance bundle budgets.",
5
5
  "author": "Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>",
6
6
  "license": "Apache-2.0 OR MIT",
@@ -42,10 +42,25 @@
42
42
  "access": "public"
43
43
  },
44
44
  "scripts": {
45
- "test": "node --test --experimental-test-coverage --test-coverage-exclude=\"tests/**\" --test-coverage-lines=98 --test-coverage-branches=98 --test-coverage-functions=98 tests/unit.test.js tests/integration.test.js tests/bench.test.js",
46
- "test:coverage": "node --test --experimental-test-coverage --test-coverage-exclude=\"tests/**\" --test-coverage-lines=98 --test-coverage-branches=98 --test-coverage-functions=98 tests/unit.test.js tests/integration.test.js tests/bench.test.js",
45
+ "test": "node --test tests/conformance.test.js tests/bench.test.js",
47
46
  "bench": "node benches/bench_load.js",
48
47
  "examples": "node examples/basic.js && node examples/advanced.js && node examples/features.js && node examples/esm.mjs",
49
- "docs:build": "bash scripts/build-docs.sh"
48
+ "docs:build": "bash scripts/build-docs.sh",
49
+ "test:conformance": "node --test tests/conformance.test.js",
50
+ "fuzz": "node fuzz/fuzz_config.js"
51
+ },
52
+ "engines": {
53
+ "node": ">=20.0.0"
54
+ },
55
+ "sideEffects": false,
56
+ "devDependencies": {
57
+ "@sebastienrousseau/config-kit": "^0.0.8"
58
+ },
59
+ "configKit": {
60
+ "shape": "array",
61
+ "presets": [
62
+ ".size-limit.js"
63
+ ],
64
+ "nativeToolchain": "size-limit"
50
65
  }
51
66
  }