Skip to content

Commit 25e96de

Browse files
authored
Merge pull request #21 from lampmaker/claude/public-repo-readiness-5v7x2a
Add CI workflow and update build size documentation
2 parents 09eb08c + fc24a56 commit 25e96de

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 22
16+
- run: npm install
17+
- run: npm run test:all
18+
# the built artifacts are committed (the demo pages load them) — fail if a
19+
# change to src/ or tools/ was pushed without rebuilding dist/
20+
- run: npm run build
21+
- run: git diff --exit-code -- dist

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ each facet derives its own normal so the shading is flat.
290290

291291
## Minified build
292292

293-
`dist/tinywebgpu.min.js`**15.7 KB** (7.7 KB gzipped), versus 91 KB for the source. Rebuild it with
293+
`dist/tinywebgpu.min.js`**15.5 KB** (7.4 KB gzipped), versus 91 KB for the source. Rebuild it with
294294
`npm run build:min` (esbuild is the only dev dependency; consumers still install nothing).
295295

296296
It is a **production artifact and it is silent**: every `console` warning is stripped, and so are
@@ -306,10 +306,10 @@ accident.
306306
## Tiny build (inline / on-chain embedding)
307307

308308
When the library has to be *inlined* — a single self-contained HTML file, an on-chain generative
309-
artwork with a hard byte budget — 15.7 KB of it is still mostly features you are not using. A
309+
artwork with a hard byte budget — 15.5 KB of it is still mostly features you are not using. A
310310
procedural piece renders from a shader and never touches image loading, readback, or PNG export.
311311

312-
`npm run build:tiny` produces **`dist/tinywebgpu.tiny.js` — 8.8 KB** (4.6 KB gzipped) by dropping
312+
`npm run build:tiny` produces **`dist/tinywebgpu.tiny.js` — 8.5 KB** (4.5 KB gzipped) by dropping
313313
every optional entry point, and adding `--iife --no-banner` gets a classic
314314
`<script>` that assigns `globalThis.WEBGPU` for the same size. Two of the dropped switches trade
315315
*behavior* rather than entry points, so know what you are giving up:
@@ -352,7 +352,7 @@ node tools/build-min.mjs tiny --iife --no-banner --out=twg.js
352352
node tools/build-min.mjs --config=my.config.mjs a config of your own
353353
```
354354

355-
What each switch is worth, measured against the 15.7 KB build:
355+
What each switch is worth, measured against the 15.5 KB build:
356356

357357
| `--without=` | Removes | Saves |
358358
|---|---|---|

docs/API.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ the longer spellings above.
339339
| File | Size | What it is |
340340
|---|---|---|
341341
| `src/tinywebgpu.js` | 91 KB | the source, with comments and every diagnostic. `main`/`exports` point here. |
342-
| `dist/tinywebgpu.min.js` | 15.7 KB (7.7 gz) | `npm run build:min`. Silent: no console output, no compile-error window, no resource validator, no debug labels. Errors still throw with their messages. |
343-
| `dist/tinywebgpu.tiny.js` | 8.8 KB (4.6 gz) | `npm run build:tiny`. The above, plus every optional entry point removed and error text folded to numbers. For inlining into a single file. |
342+
| `dist/tinywebgpu.min.js` | 15.5 KB (7.4 gz) | `npm run build:min`. Silent: no console output, no compile-error window, no resource validator, no debug labels. Errors still throw with their messages. |
343+
| `dist/tinywebgpu.tiny.js` | 8.5 KB (4.5 gz) | `npm run build:tiny`. The above, plus every optional entry point removed and error text folded to numbers. For inlining into a single file. |
344344

345345
`build:tiny` drops `writeTexture`, `loadTexture`, `readTexture`, buffer `.r()`, `save`, `show`,
346346
the ping-pong helpers, `resizeCanvas`, depth support, mipmaps, the staging ring (in-frame writes become plain queue writes — last value per frame wins), the long aliases, and the named blend presets. Tiny builds also pack repeated WebGPU member names into a string table (`--no-pack` to skip). Keep any of them with

0 commit comments

Comments
 (0)