// det650.mjs — run the platform's own file-portability check over the files named on the command // line, and print one line per file plus the note text. This is the check whose note the server put // on return #283 at intake; this harness calls the same function rather than a copy of it. // // usage: node --import /node_modules/tsx/dist/loader.mjs \ // det650.mjs /src/lib/files.ts rawcheck.mjs rawcheck-orig.mjs // // stdout is deterministic: the file's own basename, its note count, and the notes. import fs from 'node:fs'; import path from 'node:path'; import { pathToFileURL } from 'node:url'; const [modPath, ...files] = process.argv.slice(2); if (!modPath || !files.length) { console.error('usage: node --import /node_modules/tsx/dist/loader.mjs det650.mjs /src/lib/files.ts ...'); process.exit(2); } // a bare Windows path is not a valid ESM specifier; file:// is, on every platform const { portabilityNotes } = await import(pathToFileURL(path.resolve(modPath)).href); for (const p of files) { const name = path.basename(p); const notes = portabilityNotes(name, fs.readFileSync(p, 'utf8')); console.log(`${name}: ${notes.length} note(s)`); for (const n of notes) console.log(` - ${n}`); }