@better-update/cli 0.39.1 → 0.39.2

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/dist/index.mjs CHANGED
@@ -35,7 +35,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
35
35
 
36
36
  //#endregion
37
37
  //#region package.json
38
- var version = "0.39.1";
38
+ var version = "0.39.2";
39
39
 
40
40
  //#endregion
41
41
  //#region src/lib/interactive-mode.ts
@@ -3527,10 +3527,11 @@ const PresignedUploadClientLive = Layer.effect(PresignedUploadClient, Effect.gen
3527
3527
  const now = Date.now();
3528
3528
  const expiryMs = new Date(expiresAt).getTime();
3529
3529
  if (Number.isNaN(expiryMs) || now > expiryMs - EXPIRY_SAFETY_MARGIN_MS) return yield* new PresignedUrlExpiredError({ message: `Presigned upload URL expired or too close to expiry (expiresAt=${expiresAt}).` });
3530
- const request = yield* HttpClientRequest.put(url).pipe(HttpClientRequest.bodyFile(filePath), Effect.provideService(FileSystem.FileSystem, fileSystem), Effect.map(HttpClientRequest.setHeaders({
3530
+ const bytes = yield* fileSystem.readFile(filePath).pipe(Effect.mapError((cause) => new UploadFailedError({ message: `Failed to read artifact for upload: ${String(cause)}` })));
3531
+ const request = HttpClientRequest.put(url).pipe(HttpClientRequest.bodyUint8Array(bytes), HttpClientRequest.setHeaders({
3531
3532
  "content-length": String(byteSize),
3532
3533
  ...headers
3533
- })), Effect.mapError((cause) => new UploadFailedError({ message: `Failed to open artifact for upload: ${String(cause)}` })));
3534
+ }));
3534
3535
  const response = yield* client.execute(request).pipe(Effect.mapError((cause) => new UploadFailedError({ message: `HTTP request to presigned URL failed: ${String(cause)}` })));
3535
3536
  if (response.status < 200 || response.status >= 300) {
3536
3537
  const body = yield* response.text.pipe(Effect.orElseSucceed(() => ""));
@@ -35500,6 +35501,7 @@ const gitCreateFields = (git) => ({
35500
35501
  ...compact({ gitCommit: git.commit })
35501
35502
  });
35502
35503
  const dedupeAssetsByHash = (assets) => uniqBy(assets, (asset) => asset.hash);
35504
+ const dedupeAssetsByKey = (assets) => uniqBy(assets, (asset) => asset.key);
35503
35505
  /**
35504
35506
  * Record the per-platform fingerprint (matching EAS) so `fingerprint:compare`
35505
35507
  * lines up with the per-platform `fingerprint`-policy RTV. Best-effort: the hash
@@ -35621,7 +35623,7 @@ const publishPlatform = (params) => Effect.gen(function* () {
35621
35623
  groupId: params.groupId,
35622
35624
  metadata: manifestMetadata,
35623
35625
  extra: manifestExtra,
35624
- assets: preparedAssets.map((asset) => ({
35626
+ assets: dedupeAssetsByKey(preparedAssets).map((asset) => ({
35625
35627
  hash: asset.hash,
35626
35628
  key: asset.key,
35627
35629
  isLaunch: asset.isLaunch,