CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-update-electron-app

A drop-in module that adds autoUpdating capabilities to Electron apps

89

1.08x
Overview
Eval results
Files

task.mdevals/scenario-7/

Update Configuration Validator

Ensure the auto-update configuration for an Electron app is validated before any checks run, covering repository format, HTTPS endpoints, interval windows, and logger requirements.

Capabilities

Accepts valid configuration

  • Providing a repo string in the form owner/repo, an HTTPS host, a 10 minutes interval, and a logger exposing log initializes without throwing. @test

Rejects malformed repository

  • When the repo value is missing /, the setup throws a validation error before scheduling updates. @test

Rejects insecure endpoints

  • Non-HTTPS host or baseUrl values cause immediate errors. @test

Rejects bad intervals or logger

  • An update interval under 5 minutes or lacking a leading number triggers an error. @test
  • Providing a logger object without a log function triggers an error. @test

Implementation

@generates

API

export type UpdateSource =
  | { type: 'service'; repo?: string; host?: string }
  | { type: 'static'; baseUrl: string };

export interface UpdateOptions {
  updateSource?: UpdateSource;
  repo?: string;
  host?: string;
  updateInterval?: string;
  logger?: { log: (...args: unknown[]) => void; [key: string]: unknown };
  notifyUser?: boolean;
  onNotifyUser?: (info: unknown) => void;
}

/**
 * Configure automatic updates for an Electron app, relying on the dependency to enforce
 * repository, HTTPS endpoint, interval, and logger validity.
 */
export function configureUpdates(options?: UpdateOptions): void;

Dependencies { .dependencies }

update-electron-app { .dependency }

Provides configuration, scheduling, and validation for Electron auto-updates.

Install with Tessl CLI

npx tessl i tessl/npm-update-electron-app

tile.json