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-4/

Legacy Update Config Migration

Create a helper that configures application updates via the package while migrating legacy configuration fields into the package's modern update-source format. The helper accepts legacy repo/host fields, normalizes them into the modern configuration, and invokes the package's updater initializer exactly once with the resulting options.

Capabilities

Migrates legacy repo/host

  • Given legacy fields repo: "acme/tool" and host: "https://updates.example.com", it derives a modern update-source object with type: 'github', owner: 'acme', repo: 'tool', host: 'https://updates.example.com', and initializes the updater with that configuration. @test

Prioritizes modern config

  • When both legacy fields and a modern update-source object are provided, it initializes using the modern object as-is while still passing through shared options such as logger and user notification flags. @test

Validates legacy shapes

  • If legacy input omits the owner/repo separator or uses a non-HTTPS host, it rejects with an error before attempting initialization. @test

Implementation

@generates

API

export type UpdateSource =
  | { type: 'github'; owner: string; repo: string; host?: string }
  | { type: 'static'; baseUrl: string; serverType?: 'json' | 'default' };

export interface UpdateOptions {
  repo?: string;
  host?: string;
  source?: UpdateSource;
  logger?: { log: (...args: any[]) => void };
  notifyUser?: boolean;
}

export function configureUpdater(options: UpdateOptions): Promise<void>;

Dependencies { .dependencies }

update-electron-app { .dependency }

Initializes update checking for Electron apps using the provided configuration. @satisfied-by

Install with Tessl CLI

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

tile.json