Files
alexm 401084bab3
Test / gate (push) Failing after 19m0s
Initial commit
2026-11-12 22:23:54 -05:00

28 lines
1.2 KiB
JavaScript

// SPDX-FileCopyrightText: 2026 Scientific Computing Studio, LLC
// SPDX-License-Identifier: Apache-2.0
/**
* The engine modules this repository owns, and the file of each that the course receives:
* src/engines/<dir>/<name>.js as written, or dist/engines/<dir>/<name>.js for a module written in
* TypeScript. Shared by engines-diff and engines-export.
*/
import fs from 'node:fs';
import path from 'node:path';
export const ENGINE_DIRS = ['pseudo', 'asm86', 'shared'];
/** Every engine module: { dir, file, label, ours, built }. */
export function engineModules(root) {
const out = [];
for (const dir of ENGINE_DIRS) {
const src = path.join(root, 'src/engines', dir);
for (const f of fs.readdirSync(src).sort()) {
if (f.endsWith('.js')) out.push({ dir, file: f, label: `src/engines/${dir}/${f}`, ours: path.join(src, f), built: false });
else if (f.endsWith('.ts') && !f.endsWith('.d.ts')) {
const js = f.replace(/\.ts$/, '.js');
out.push({ dir, file: js, label: `src/engines/${dir}/${f}`, ours: path.join(root, 'dist/engines', dir, js), built: true });
}
}
}
return out;
}