Files
jackwener__opencli/src/verify.ts
T
jackwener 7555f14369 refactor: deep code review improvements
- Add *.log to .gitignore, remove debug.log from tracking
- Fix dev-mode FS scan to discover .ts adapter files (not just .js)
- Deduplicate CONNECT_TIMEOUT: browser.ts now uses runtime.ts constant
- Fix CSV output: escape newlines in field values per RFC 4180
- Add proper type interfaces for validate/verify (remove any types)
- Remove unused hadOuterQuotes variable in snapshotFormatter
- Derive CliOptions from CliCommand via Omit+Partial to reduce duplication
- Expand dense one-liner action callbacks in main.ts for readability
2026-03-17 01:38:23 +08:00

33 lines
938 B
TypeScript

/**
* Verification: runs validation and optional smoke test.
*
* The smoke test is intentionally kept as a stub — full browser-based
* smoke testing requires a running browser session and is better suited
* to the `opencli test` command or CI pipelines.
*/
import { validateClisWithTarget, renderValidationReport, type ValidationReport } from './validate.js';
export interface VerifyOptions {
builtinClis: string;
userClis: string;
target?: string;
smoke?: boolean;
}
export interface VerifyReport {
ok: boolean;
validation: ValidationReport;
smoke: null;
}
export async function verifyClis(opts: VerifyOptions): Promise<VerifyReport> {
const report = validateClisWithTarget([opts.builtinClis, opts.userClis], opts.target);
return { ok: report.ok, validation: report, smoke: null };
}
export function renderVerifyReport(report: VerifyReport): string {
return renderValidationReport(report.validation);
}