UNPKG

@swell/cli

Version:

Swell's command line interface/utility

89 lines (88 loc) 3.69 kB
/// <reference types="node" /> import type { GlobbyFilterFunction } from 'globby'; import * as fs from 'node:fs'; import { App, AppConfig, ConfigType, FrontendProjectType } from './lib/apps/index.js'; import { RemoteAppCommand } from './remote-app-command.js'; type WatchFileEvent = 'change' | 'deleted' | 'new'; interface WatchingChange { action: 'push' | 'remove'; appConfig: AppConfig; configFile: string; } export declare abstract class PushAppCommand extends RemoteAppCommand { frontendPath: string; logWatchChanges: boolean; onWatchChange?: (appConfig?: AppConfig, result?: any) => void; watchingChangeQueue: Map<string, WatchingChange>; watchingFiles: Set<string>; watchingIgnoreFilter: GlobbyFilterFunction | null; watchingTimer: NodeJS.Timeout | null; watchListener: (eventType: fs.WatchEventType, filename: null | string) => Promise<void>; buildFrontend(projectType: FrontendProjectType): Promise<void>; chooseAppToPull(query?: any): Promise<App>; createAppStorefront(hasOtherStorefronts?: boolean): Promise<any>; deployAppFrontend(force?: boolean, log?: boolean): Promise<void>; deployFrontend(projectType: FrontendProjectType): Promise<string>; ensureAppExists(file?: string, shouldCreate?: boolean): Promise<boolean>; ensureLoggedIn(): Promise<true | undefined>; exec(command: string, onOutput?: (string: string) => any | false): Promise<void>; getAllAppStorefronts(params?: { type?: string; }): Promise<any>; getAllStorefronts(params?: { app_id?: string; theme_app_id?: string; type?: string; }): Promise<any>; getAppStorefront(params?: { storefront_id?: string; type?: string; }): Promise<any>; getAppToPull(args: { appId?: string; targetPath?: string; }, shouldChoose?: boolean): Promise<App | undefined>; getExistingApp(appId: string): Promise<App>; getFrontendDeploymentHash(): string | undefined; getFrontendProjectType(required?: boolean): FrontendProjectType | null; getStorefrontToPull(args?: { appId?: string; targetPath?: string; }, flags?: { 'storefront-id'?: string; 'storefront-select'?: boolean; env?: string; }): Promise<any>; getStorefrontToPush(flags?: { 'storefront-id'?: string; 'storefront-select'?: boolean; env?: string; }): Promise<any>; setStorefrontEnv(flags: { 'storefront-id'?: string; 'storefront-select'?: boolean; env?: string; }, defaultStorefront?: any): Promise<void>; handleWatchFileChange(configFile: string, configType: ConfigType, event: WatchFileEvent): Promise<void>; logAppFrontendUrl(): void; logDashboardUrl(flags: { [flag: string]: any; }): void; logStorefrontConnected(): void; logStorefrontFrontendUrl(storefront?: any, branchId?: string): void; pushFile(relativePath: string): Promise<void>; pushFilePath(relativePath: string, force?: boolean): Promise<void>; resolveAppPath(appId?: string, targetPath?: string): string; runWatchChangeQueue(): Promise<void>; saveCurrentStorefront(): void; setWatchingFiles(): Promise<void>; updateFrontendDeployment(currentStore: string, projectType: FrontendProjectType, deploymentUrl: string, deploymentHash: string): Promise<void>; watchForChanges({ logChanges, onChange, syncAll, }?: { logChanges?: boolean; onChange?: () => void; syncAll?: boolean; }): Promise<void>; wranglerDeployFrontend(projectType: FrontendProjectType): Promise<string>; private confirmRemoveInstalledApp; } export {};