Commit 59da663
feat: add esbuild single-file bundle as lightweight distribution (#1581)
* feat: add esbuild single-file bundle as lightweight distribution
Add a ~350KB esbuild bundle (release/awf-bundle.js) as an alternative to
the ~50MB pkg binary. GitHub hosted runners already have Node.js 22,
making the bundled Node.js 18 runtime in pkg redundant.
Changes:
- Add scripts/build-bundle.mjs: esbuild config that bundles dist/cli.js
into a single CJS file with the seccomp profile inlined via `define`
- Modify src/docker-manager.ts: support embedded seccomp profile
(__AWF_SECCOMP_PROFILE__) and guard --build-local for bundle users
- Add esbuild to devDependencies and build:bundle script
- Update release.yml to build, smoke-test, and publish the bundle
- Update install.sh to prefer the bundle when Node.js >= 20 is available
(opt out with AWF_FORCE_BINARY=1)
- Add release/ to .gitignore
Closes #1577
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address review feedback on esbuild bundle PR
- Tighten Node.js version check in install.sh to >=20.12.0 (matches
engines.node in package.json) instead of just >=20
- Remove redundant `npm install esbuild` in release workflow since
esbuild is already installed via `npm ci` from devDependencies
- Add build-time JSON.parse validation for seccomp profile to fail
fast on malformed JSON
- Set executable bit (chmod 755) on bundle output file
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0199067 commit 59da663
7 files changed
Lines changed: 684 additions & 43 deletions
File tree
- .github/workflows
- scripts
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
370 | 379 | | |
371 | 380 | | |
372 | 381 | | |
| |||
550 | 559 | | |
551 | 560 | | |
552 | 561 | | |
| 562 | + | |
553 | 563 | | |
554 | 564 | | |
555 | 565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
145 | 168 | | |
146 | 169 | | |
147 | 170 | | |
| |||
263 | 286 | | |
264 | 287 | | |
265 | 288 | | |
266 | | - | |
| 289 | + | |
| 290 | + | |
267 | 291 | | |
268 | 292 | | |
269 | | - | |
| 293 | + | |
270 | 294 | | |
271 | 295 | | |
272 | 296 | | |
273 | | - | |
| 297 | + | |
274 | 298 | | |
275 | 299 | | |
276 | 300 | | |
277 | 301 | | |
278 | 302 | | |
279 | | - | |
| 303 | + | |
280 | 304 | | |
281 | 305 | | |
282 | | - | |
| 306 | + | |
283 | 307 | | |
284 | 308 | | |
285 | | - | |
286 | 309 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
305 | 335 | | |
306 | | - | |
307 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
308 | 364 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
| 365 | + | |
314 | 366 | | |
315 | 367 | | |
316 | 368 | | |
| |||
0 commit comments