tonnage 0.2.0 → 0.3.0

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/AGENTS.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  CI-first runtime JavaScript bundle measurement with checked-in README reports.
4
4
 
5
+ - Install `galley.md@^0.1.1` alongside tonnage. It is a required peer for CLI rendering, the programmatic API, and MDX components.
6
+
5
7
  - Tonnage measures emitted minified JavaScript and level-9 gzip bytes. Do not include declarations, source maps, CSS, or other assets in those figures.
6
8
  - Public-module rows retain the complete runtime export surface. Recipe rows use reviewable entry files and tree-shake unused exports.
7
9
  - Treat each recipe as one realistic runtime boundary. Keep server and client recipes separate, and count shared modules once within each bundle.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # tonnage
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 02567f0: Make galley.md ^0.1.1 a required peer dependency so consumers control the Galley version used by report rendering and MDX components. Install a compatible galley.md version alongside tonnage, including for standalone CLI use.
8
+
3
9
  ## 0.2.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -10,6 +10,16 @@ tree-shake the rest. Declarations, source maps, CSS, and other assets are not
10
10
  counted. Peer dependencies stay external, and shared modules are counted once
11
11
  per bundle.
12
12
 
13
+ ## Install
14
+
15
+ Install tonnage and its required Galley peer:
16
+
17
+ ```sh
18
+ pnpm add -D tonnage 'galley.md@^0.1.1'
19
+ ```
20
+
21
+ Galley is required for CLI and programmatic report rendering as well as MDX documents.
22
+
13
23
  ## Configure
14
24
 
15
25
  Add the generated-section comments to the target README, then create a config
@@ -162,7 +172,7 @@ import Example from "./examples/recipes/react-app.ts" with { type: "code", lang:
162
172
  <Tonnage config={config} />
163
173
  ```
164
174
 
165
- The component resolves paths relative to the containing document. Pass `directory` to measure another package. It produces the same tables as the CLI without writing a README or requiring generated-section markers. Tonnage includes Galley as a runtime dependency; add `galley.md` directly to your project's development dependencies to run `galley write` and `galley check` when authoring documents.
175
+ The component resolves paths relative to the containing document. Pass `directory` to measure another package. It produces the same tables as the CLI without writing a README or requiring generated-section markers. Tonnage uses your installed Galley peer; run `galley write` and `galley check` when authoring documents.
166
176
 
167
177
  ## Bundle size
168
178
 
@@ -170,9 +180,9 @@ Package export sizes include complete runtime export surfaces.
170
180
 
171
181
  Sizes are exact minified and level-9 gzip JavaScript byte counts. Declarations, source maps, CSS, and other assets are excluded. Peer dependencies stay external, and shared modules are counted once per bundle.
172
182
 
173
- | Import | Minified JS | Gzip JS |
174
- | ---------------- | ----------: | --------: |
175
- | `tonnage` | 491,915 B | 153,965 B |
176
- | `tonnage/galley` | 484,581 B | 151,561 B |
183
+ | Import | Minified JS | Gzip JS |
184
+ | ---------------- | ----------: | -------: |
185
+ | `tonnage` | 50,614 B | 18,071 B |
186
+ | `tonnage/galley` | 49,315 B | 17,579 B |
177
187
 
178
188
  Report maintained with [tonnage](https://github.com/jeremybanka/tonnage).
package/README.mdx CHANGED
@@ -14,6 +14,16 @@ tree-shake the rest. Declarations, source maps, CSS, and other assets are not
14
14
  counted. Peer dependencies stay external, and shared modules are counted once
15
15
  per bundle.
16
16
 
17
+ ## Install
18
+
19
+ Install tonnage and its required Galley peer:
20
+
21
+ ```sh
22
+ pnpm add -D tonnage 'galley.md@^0.1.1'
23
+ ```
24
+
25
+ Galley is required for CLI and programmatic report rendering as well as MDX documents.
26
+
17
27
  ## Configure
18
28
 
19
29
  Add the generated-section comments to the target README, then create a config
@@ -138,6 +148,6 @@ import Example from "./examples/recipes/react-app.ts" with { type: "code", lang:
138
148
  <Tonnage config={config} />
139
149
  ```
140
150
 
141
- The component resolves paths relative to the containing document. Pass `directory` to measure another package. It produces the same tables as the CLI without writing a README or requiring generated-section markers. Tonnage includes Galley as a runtime dependency; add `galley.md` directly to your project's development dependencies to run `galley write` and `galley check` when authoring documents.
151
+ The component resolves paths relative to the containing document. Pass `directory` to measure another package. It produces the same tables as the CLI without writing a README or requiring generated-section markers. Tonnage uses your installed Galley peer; run `galley write` and `galley check` when authoring documents.
142
152
 
143
153
  <Tonnage config={{ platform: "node", exports: { include: [".", "./galley"] } }} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tonnage",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Keep deterministic bundle size reports in README files and CI.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,13 +36,17 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "comline": "0.9.0",
39
- "esbuild": "0.28.2",
40
- "galley.md": "0.1.1"
39
+ "esbuild": "0.28.2"
41
40
  },
42
41
  "devDependencies": {
43
42
  "@types/node": "26.6.5",
43
+ "breakage": "0.8.5",
44
+ "galley.md": "0.1.1",
44
45
  "typescript": "7.1.0-dev.20261020.3"
45
46
  },
47
+ "peerDependencies": {
48
+ "galley.md": "^0.1.1"
49
+ },
46
50
  "engines": {
47
51
  "node": ">=22.18.0"
48
52
  },
@@ -51,6 +55,8 @@
51
55
  },
52
56
  "scripts": {
53
57
  "build": "vp pack",
58
+ "pack:breakage": "pnpm --reporter=silent pack --out .breakage/package.tgz",
59
+ "test:breakage:peers": "breakage npm check",
54
60
  "test": "vp test",
55
61
  "test:watch": "vp test watch"
56
62
  }