Finder-launched terminals now inherit a login PATH so tools like ollama resolve, destructive SFTP/editor actions require confirmation, and terminal search plus window dragging work again. SSH forwards and RDP sessions keep listeners and survive reconnect without FastPath crashes. Co-authored-by: Cursor <cursoragent@cursor.com>
58 lines
2.0 KiB
JavaScript
58 lines
2.0 KiB
JavaScript
import { existsSync } from 'node:fs'
|
|
import { homedir } from 'node:os'
|
|
import { join } from 'node:path'
|
|
import { spawnSync } from 'node:child_process'
|
|
|
|
const mode = process.argv[2] ?? 'quick'
|
|
if (!['quick', 'full'].includes(mode)) {
|
|
console.error(`Unknown acceptance mode: ${mode}`)
|
|
process.exit(2)
|
|
}
|
|
|
|
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'
|
|
const cargoHomeBinary = join(homedir(), '.cargo', 'bin', process.platform === 'win32' ? 'cargo.exe' : 'cargo')
|
|
const cargo = process.env.CARGO || (existsSync(cargoHomeBinary) ? cargoHomeBinary : 'cargo')
|
|
const manifest = 'src-tauri/Cargo.toml'
|
|
|
|
const quickSteps = [
|
|
['Renderer type contract', npm, ['run', 'typecheck:ui']],
|
|
['Test and mock contracts', npm, ['run', 'typecheck:test']],
|
|
['Unit + SSH/SFTP/RDP/VNC patrol', npm, ['test']],
|
|
['Rust formatting', cargo, ['fmt', '--manifest-path', manifest, '--', '--check']],
|
|
['Rust compile check', cargo, ['check', '--manifest-path', manifest]],
|
|
]
|
|
|
|
const fullSteps = [
|
|
['TypeScript and React lint', npm, ['run', 'lint']],
|
|
...quickSteps,
|
|
['Rust lint with warnings denied', cargo, ['clippy', '--manifest-path', manifest, '--all-targets', '--', '-D', 'warnings']],
|
|
['Rust tests', cargo, ['test', '--manifest-path', manifest]],
|
|
['Renderer production build', npm, ['run', 'build:ui']],
|
|
['Release tooling tests', npm, ['run', 'test:release']],
|
|
]
|
|
|
|
const steps = mode === 'full' ? fullSteps : quickSteps
|
|
const startedAt = Date.now()
|
|
|
|
for (const [label, command, args] of steps) {
|
|
console.log(`\n[acceptance] ${label}`)
|
|
const result = spawnSync(command, args, {
|
|
cwd: process.cwd(),
|
|
env: process.env,
|
|
stdio: 'inherit',
|
|
})
|
|
|
|
if (result.error) {
|
|
console.error(`[acceptance] Unable to run ${command}: ${result.error.message}`)
|
|
process.exit(1)
|
|
}
|
|
|
|
if (result.status !== 0) {
|
|
console.error(`[acceptance] FAILED: ${label}`)
|
|
process.exit(result.status ?? 1)
|
|
}
|
|
}
|
|
|
|
const elapsedSeconds = ((Date.now() - startedAt) / 1000).toFixed(1)
|
|
console.log(`\n[acceptance] PASS (${mode}, ${elapsedSeconds}s)`)
|