MCPcopy Create free account
hub / github.com/MigoXLab/coderio / formatValidationDependencyHelp

Function formatValidationDependencyHelp

src/utils/dependency-installer.ts:24–59  ·  view source on GitHub ↗
(missing: string[])

Source from the content-addressed store, hash-verified

22}
23
24function formatValidationDependencyHelp(missing: string[]): string {
25 const isWin = process.platform === 'win32';
26 const globalInstall = [
27 'npm install -g playwright sharp',
28 isWin ? 'npx playwright install chromium' : 'npx playwright install chromium',
29 ].join('\n');
30
31 const localInstall = [
32 'npm install -D playwright sharp',
33 isWin ? 'npx playwright install chromium' : 'npx playwright install chromium',
34 ].join('\n');
35
36 const pnpmGlobal = ['pnpm add -g playwright sharp', 'pnpm exec playwright install chromium'].join('\n');
37 const pnpmLocal = ['pnpm add -D playwright sharp', 'pnpm exec playwright install chromium'].join('\n');
38
39 return [
40 `Missing optional validation dependencies: ${missing.join(', ')}`,
41 '',
42 'Validation requires Playwright (browsers) and Sharp (image processing).',
43 'These dependencies are NOT bundled with coderio by default to keep installation lightweight.',
44 '',
45 'Recommended (global install):',
46 globalInstall,
47 '',
48 'Or install in your current project:',
49 localInstall,
50 '',
51 'If you use pnpm:',
52 '',
53 'Global:',
54 pnpmGlobal,
55 '',
56 'Local (project):',
57 pnpmLocal,
58 ].join('\n');
59}
60
61export function assertValidationDependenciesInstalled(): void {
62 const missing: string[] = [];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected