sparkbun 0.2.3 → 0.2.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli/index.ts +21 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sparkbun",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Build fast, lightweight, cross-platform desktop apps with TypeScript and Bun.",
5
5
  "license": "MIT",
6
6
  "author": "SparkBun Contributors",
package/src/cli/index.ts CHANGED
@@ -3333,7 +3333,12 @@ usageDescriptions : ""}${urlTypes ? "\n" + urlTypes : ""}${documentTypes ?
3333
3333
  }
3334
3334
 
3335
3335
  const outPath = getFlag("--out=");
3336
- const iconPath = getFlag("--icon=");
3336
+ // Fall back to the platform icon from sparkbun.config.ts (build.win.icon)
3337
+ // so the installer is branded without needing an explicit --icon flag.
3338
+ const iconPath =
3339
+ getFlag("--icon=") ||
3340
+ (config.build as any)?.win?.icon ||
3341
+ undefined;
3337
3342
  const installerName = getFlag("--name=") || config.app.name;
3338
3343
  const installerVersion = getFlag("--version=") || config.app.version;
3339
3344
  const installerPublisher = getFlag("--publisher=") || (config.app as any).publisher || "";
@@ -3412,15 +3417,25 @@ usageDescriptions : ""}${urlTypes ? "\n" + urlTypes : ""}${documentTypes ?
3412
3417
 
3413
3418
  console.log(` Archiving ${spec.name}: ${spec.path}`);
3414
3419
 
3415
- // Build an uncompressed tar that preserves the source folder name as
3416
- // the archive root (e.g. "Dune 2000/..."), so the installer extracts
3417
- // into the correct subdirectory. tar -C <parent> <basename>.
3420
+ // Build the uncompressed tar with the system `tar`. It streams to disk
3421
+ // (bounded build memory) and preserves empty directories as real
3422
+ // entries. The source folder name is kept as the archive root (e.g.
3423
+ // "Dune 2000/...") via `tar -C <parent> <basename>`, so it extracts
3424
+ // into the correct subdirectory.
3425
+ //
3426
+ // The on-disk format may be GNU (Windows/Linux — long paths via
3427
+ // "././@LongLink") or pax (macOS bsdtar — long paths via extended
3428
+ // headers). The installer's streaming extractor understands both, plus
3429
+ // plain ustar, so the archive is portable regardless of build host.
3430
+ //
3431
+ // (Bun.Archive is intentionally not used here: its lazy Bun.file()
3432
+ // inputs write empty file bodies, and eager byte inputs would require
3433
+ // loading the entire payload into memory.)
3418
3434
  const parent = dirname(spec.path);
3419
3435
  const baseName = basename(spec.path);
3420
3436
  createTar(tarTmpPath, parent, [baseName]);
3421
3437
 
3422
- // Measure uncompressed bytes + file count so the installer can show
3423
- // real per-file / byte progress without unpacking first.
3438
+ // Measure uncompressed bytes + file count for progress denominators.
3424
3439
  const { bytes: uncompressedBytes, fileCount } = measureDir(spec.path);
3425
3440
 
3426
3441
  // Stream-compress the tar at the requested level (bounded build memory).