@@ -389,6 +389,19 @@ jobs: |
389 | 389 | # process that resets the limit to its default of 4, so the serialisation would be a no-op. |
390 | 390 | - name: Build desktop bundle (serialised) |
391 | 391 | shell: bash |
| 392 | + env: |
| 393 | + # Issue #53. The web renderer's source maps were 37.4 MiB of a 189.66 MiB app.asar — the |
| 394 | + # single largest line item in the bundle, and 20% of what every user downloads on every |
| 395 | + # update. Nothing reads them: a `.map` is only parsed with --enable-source-maps, which the |
| 396 | + # desktop backend passes through rather than sets (DesktopBackendConfiguration.ts), and |
| 397 | + # renderer maps are DevTools-only. |
| 398 | + # |
| 399 | + # This is an EXISTING upstream variable (apps/web/vite.config.ts), which is why the biggest |
| 400 | + # single win in the issue costs zero seam rows. First-party maps outside the renderer — |
| 401 | + # bin.mjs.map and main.cjs.map, ~12 MiB — are deliberately still built and still shipped, so |
| 402 | + # an operator who exports NODE_OPTIONS=--enable-source-maps keeps readable stack traces for |
| 403 | + # our own code. |
| 404 | + T3CODE_WEB_SOURCEMAP: "0" |
392 | 405 | run: | |
393 | 406 | set -uo pipefail |
394 | 407 |
|
@@ -438,6 +451,29 @@ jobs: |
438 | 451 | echo "::error::build:desktop failed three times with transient process-startup errors." >&2 |
439 | 452 | exit 1 |
440 | 453 |
|
| 454 | + # Issue #53. Kept in its own step so the exact glob list appears in the release log: the list is |
| 455 | + # the risky part of the packaging change, and reading it back out of a failed build matters more |
| 456 | + # than saving a step. scripts/coil/desktop-file-exclusions.mjs is the single source — it also |
| 457 | + # feeds its own unit tests. |
| 458 | + # |
| 459 | + # A STEP OUTPUT, NOT $GITHUB_ENV, and that is deliberate. Upstream's own test asserts |
| 460 | + # DESKTOP_FILE_EXCLUSIONS deep-equals exactly its one entry, so any job-wide export of this |
| 461 | + # variable makes `vp test` fail in that job with a confusing 68-vs-1 array diff. An output is |
| 462 | + # consumed by exactly the one step that names it below. |
| 463 | + - name: Resolve desktop bundle exclusions |
| 464 | + id: exclusions |
| 465 | + shell: bash |
| 466 | + run: | |
| 467 | + set -euo pipefail |
| 468 | + exclusions="$(node scripts/coil/desktop-file-exclusions.mjs)" |
| 469 | + if [[ -z "$exclusions" ]]; then |
| 470 | + echo "::error::scripts/coil/desktop-file-exclusions.mjs produced an empty list." >&2 |
| 471 | + exit 1 |
| 472 | + fi |
| 473 | + echo "value=$exclusions" >> "$GITHUB_OUTPUT" |
| 474 | + echo "Excluding from the asar:" |
| 475 | + tr ',' '\n' <<< "$exclusions" | sed 's/^/ /' |
| 476 | +
|
441 | 477 | - name: Build desktop artifact |
442 | 478 | shell: bash |
443 | 479 | env: |
@@ -468,6 +504,9 @@ jobs: |
468 | 504 | # Keep this in step with DESKTOP_BUNDLE_IDENTIFIER in scripts/coil/mac-signature.ts; a test |
469 | 505 | # asserts the two agree, and the verify step below fails an artifact carrying the wrong id. |
470 | 506 | T3X_DESKTOP_APP_ID: dev.curlycloud.t3coil |
| 507 | + # Issue #53. Takes the packaged asar from 189.66 MiB / 14,765 files to 99.02 MiB / 3,429. |
| 508 | + # Scoped to this step on purpose — see the note on the step that produces it. |
| 509 | + T3X_DESKTOP_FILE_EXCLUSIONS: ${{ steps.exclusions.outputs.value }} |
471 | 510 | run: | |
472 | 511 | set -euo pipefail |
473 | 512 | node scripts/build-desktop-artifact.ts \ |
@@ -492,6 +531,30 @@ jobs: |
492 | 531 | fi |
493 | 532 | echo "No app-update.yml packaged." |
494 | 533 |
|
| 534 | + # Issue #53's compensating control, and the reason the exclusion list above is safe to grow. |
| 535 | + # |
| 536 | + # The fork now excludes roughly half the asar. The failure mode of one bad glob is a |
| 537 | + # MODULE_NOT_FOUND thrown by a shipped app, on a path that may not run until a user signs in, |
| 538 | + # days after a green release. So this reads the artifact that is about to be published, resolves |
| 539 | + # every bare import in the packaged first-party bundles against what actually survived, and fails |
| 540 | + # if any of them is not loadable — whether or not a fork glob can be blamed for it. Severity does |
| 541 | + # not depend on attribution: a bundle that imports what it does not contain is broken either way, |
| 542 | + # and an earlier draft that warned on unattributed gaps passed a build that could not start. |
| 543 | + # |
| 544 | + # Runs on BOTH platforms: the Windows bundle unpacks node_modules outside the asar (the checker |
| 545 | + # merges app.asar.unpacked back in) and its graph differs (WSL backend, Linux fff binaries), so a |
| 546 | + # mac-only check would not cover it. |
| 547 | + - name: Verify the packaged bundle still resolves |
| 548 | + shell: bash |
| 549 | + run: | |
| 550 | + set -euo pipefail |
| 551 | + asar="$(find release -name "app.asar" -print -quit)" |
| 552 | + if [[ -z "$asar" ]]; then |
| 553 | + echo "::error::No app.asar found under release/. Nothing was verified." >&2 |
| 554 | + exit 1 |
| 555 | + fi |
| 556 | + node scripts/coil/verify-desktop-bundle.mjs --asar "$asar" |
| 557 | +
|
495 | 558 | # The machine-checkable form of "this update will not re-ask for permissions" (issue #70), |
496 | 559 | # made against the .app inside the shipped .dmg rather than a staging copy. |
497 | 560 | # |
|