UNPKG

@mesh-tech/mesh-cli

Version:

CLI for Mesh platform development utilities

58 lines (57 loc) 2.59 kB
import { Command } from "commander"; import { jsonReport, type Check, type CheckResult, type CheckStatus } from "./dev-doctor.js"; export type AppCheckCode = "UI_IN_API" | "NO_UI_SERVICE" | "NO_REGISTER" | "CUSTOM_SESSION_AUTH" | "NON_PLATFORM_LOGGER" | "LOCAL_AUTH_LIB" | "NO_AUTHZ_POINTER" | "METADATA_UNPUBLISHED" | "IAC_GRANTS" | "POINTER_PROJECT_OVERRIDE" | "PASSWORD_STORE" | "EMAIL_ALLOWLIST" | "USERS_TABLE" | "DOCS_SITE_UNAUTHED" | "DOCS_AUDIENCE_IMPLICIT" | "DOCS_AUDIENCE_UNGRANTABLE"; export interface AppCheckRule { gate: string; title: string; severity: "block" | "advisory"; remediation: string; scope: "app" | "repo"; } export declare const APP_CHECK_RULES: Record<AppCheckCode, AppCheckRule>; export declare const APP_CHECK_CODES: AppCheckCode[]; export interface Finding { code: AppCheckCode; path: string; why: string; } export declare function srcFiles(dir: string): string[]; export declare function isUiDir(name: string): boolean; export declare function stringList(value: string | undefined): string[] | undefined; export declare function balancedSpan(text: string, open: number): string; export declare function splitTopLevel(inner: string): string[]; export declare function stripTrailingComments(value: string): string; export declare function topLevelProperties(objectText: string): Map<string, string>; export interface SurfaceDeclaration { ctor: string; body: string; line: number; } export declare function surfaceDeclarations(text: string, pattern?: RegExp): SurfaceDeclaration[]; export declare function docsSiteFindings(text: string): Array<{ code: AppCheckCode; line: number; why: string; }>; export declare function listApps(root: string): string[]; export declare function scanApp(root: string, appRel: string): Finding[]; export declare function scanRepo(root: string): Finding[]; export interface AppCheckContext { root: string; app: string | null; findings: Finding[]; } export declare function resultFor(code: AppCheckCode, findings: Finding[]): CheckResult; export declare function appContractChecks(scope: "app" | "repo"): Check<AppCheckContext>[]; export interface AppCheckReport { root: string; status: CheckStatus; scopes: Array<{ scope: string; } & ReturnType<typeof jsonReport>>; } export declare function runAppCheck(root: string, apps?: string[]): Promise<AppCheckReport>; export declare function renderReport(report: AppCheckReport, opts: { verbose: boolean; }): string; export declare function registerAppCommands(program: Command): void;