/** * scaffold-business tests — the shared entry-point fixture: a defaults-only * spec pointed at a temp .NET project root, plus the disk helpers the * legacy-sweep and RECURRING-JOBS suites both need. Not a test file. */ import { mkdirSync, writeFileSync } from 'node:fs' import { dirname, join, resolve } from 'node:path' import { fileURLToPath } from 'node:url' export const INDEX = resolve(dirname(fileURLToPath(import.meta.url)), '../index.ts') /** The `@customised` head that opts a file out of every sweep / overwrite. */ export const CUSTOMISED_HEAD = '// @customised — hand-written, the developer owns it\n' /** The invocation documented in backend/business-layer/SKILL.md: no pluralName, no rules, no actions. */ export function entrySpec(projectPath: string, overrides: Record = {}) { return { name: 'Employee', module: 'hrm', appCode: 'MyApp', applicationCode: 'hr', namespace: 'MyApp', fields: [{ name: 'Label', type: 'string', required: true }], projectPath, ...overrides, } } /** Plant a file at `/` (parents created). */ export function plant(root: string, rel: string, content: string): string { const abs = join(root, rel) mkdirSync(dirname(abs), { recursive: true }) writeFileSync(abs, content, 'utf-8') return abs } export const norm = (p: string): string => p.replace(/\\/g, '/')